private void btnCloseBill_Click(object sender, EventArgs e) { if (billObj.dtBillDetails.Rows.Count == 0) { XtraMessageBox.Show("No items to bill", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } frmPayment paymentForm = new frmPayment(billObj); paymentForm.ShowDialog(); if (!paymentForm.IsPaid) { return; } DataSet nextBillDetails = null; try { nextBillDetails = billingRepository.FinishBill(Utility.logininfo.UserID, daySequenceID, billObj); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // use this object for printing Bill oldBillObj = billObj.Clone() as Bill; DataView dv = oldBillObj.dtMopValues.DefaultView; dv.RowFilter = "MOPVALUE > 0"; rptBill rpt = new rptBill(oldBillObj.dtBillDetails, dv.ToTable()); rpt.Parameters["GSTIN"].Value = "37AADFV6514H1Z2"; rpt.Parameters["FSSAI"].Value = "10114004000548"; rpt.Parameters["Address"].Value = Utility.branchinfo.BranchAddress; rpt.Parameters["BillDate"].Value = DateTime.Now; rpt.Parameters["BillNumber"].Value = oldBillObj.BillNumber; rpt.Parameters["BranchName"].Value = Utility.branchinfo.BranchName; rpt.Parameters["CounterName"].Value = Utility.branchinfo.BranchCounterName; rpt.Parameters["Phone"].Value = Utility.branchinfo.PhoneNumber; rpt.Parameters["UserName"].Value = Utility.logininfo.UserFullName; rpt.Parameters["RoundingFactor"].Value = oldBillObj.Rounding; rpt.Parameters["IsDuplicate"].Value = false; rpt.Print(); LoadBillData(nextBillDetails); }