private void AcceptOrder() { if (mReceipt != null && mReceipt.PurchasedItems.Count > 0) { if (mReceipt.TransDate.ToShortDateString() != DateTime.Now.ToShortDateString() && ValidateAdmin() == false) { } else { frmPayment pay = new frmPayment(); if (mReceipt.CashTendered == 0 || mReceipt.CashTendered < Convert.ToDouble(lblTotal.Text)) { pay.PaymentAmount = Convert.ToDouble(lblTotal.Text); } else { pay.PaymentAmount = mReceipt.CashTendered; } if (pay.ShowDialog() == System.Windows.Forms.DialogResult.OK) { mReceipt.CashTendered = pay.PaymentAmount; mReceipt.CustomerName = (GetSelectedCustomer() != "" ? GetSelectedCustomer() : mReceipt.CustomerName); UpdateList(); mReceipt.Save(); lblOR.Text = mReceipt.ToString(); cboName.SelectedItem = mReceipt.CustomerName; txtInput.SelectAll(); Profile _myProfile = new Profile(); _myProfile.ReadXML(); if (_myProfile.EnableAutoPrint == true) { Print(); } else if (_myProfile.PrintReceipt) { if (MessageBox.Show("Would you like to print a receipt?", "Print", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.Yes) { Print(); } } } } } else { txtInput.Text = ""; MessageBox.Show("No Transaction to Process", "Accept Order", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } txtInput.SelectAll(); txtInput.Focus(); }
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); }
private void btnPayment_Click(object sender, EventArgs e) { frmPayment pay = new frmPayment(); pay.level = lblGradeLevel.Text; if (lblMOPInfo.Text == "RESERVATION") { //PAYMENT INFOS pay.fee_for_reservation = Convert.ToDouble(lblReserve.Text); pay.amount_due = Convert.ToDouble(lblReserve.Text); pay.amount_per_month = lblPerMonthAdv.Text; pay.total_tuition = Convert.ToDouble(lblTotalPayment.Text); pay.total_tuition = Convert.ToDouble(lblTotalPayment.Text); pay.voucher_info = lblVoucher.Text; pay.voucher_amount = Convert.ToDouble(lblVoucherAmount.Text); //STUDENT INFORMATION pay.full_name = lblName.Text; pay.S_LRN = lblLRN.Text; pay.reg_no = lblRegNo.Text; pay.GOCNo = lblGOCNo.Text; pay.S_PAYFOR = lblMOPInfo.Text; pay.ifFullPay = cmbMOP.Text; //if Reservation or Partial pay.payment_status = lblMOPInfo.Text; //Call Method to load info before transaction pay.Render(); //to show the form pay.ShowDialog(); } else if (lblMOPInfo.Text == "PARTIAL PAYMENT") { if (Convert.ToInt32(lblPaymentNoCheck.Text) == 0) { pay.fee_for_reservation = Convert.ToDouble(lblReserve.Text); } else { if (EnStatus.Equals("Reservee")) { pay.amount_due = Convert.ToDouble(lblAmountDues.Text); } else { pay.amount_due = Convert.ToDouble(lblPerMonthAdv.Text); } } pay.amount_per_month = lblPerMonthAdv.Text; pay.total_tuition = Convert.ToDouble(lblTotalPayment.Text); pay.tuitionFeeMinusVC = Convert.ToDouble(lblTuition.Text); pay.voucher_info = lblVoucher.Text; pay.voucher_amount = Convert.ToDouble(lblVoucherAmount.Text); //STUDENT INFORMATION pay.full_name = lblName.Text; pay.S_LRN = lblLRN.Text; pay.reg_no = lblRegNo.Text; pay.GOCNo = lblGOCNo.Text; pay.S_PAYFOR = lblAmountDues.Text; //if Reservation or Partial pay.payment_status = lblMOPInfo.Text; pay.payment_no = Convert.ToInt32(lblPaymentNoCheck.Text); //Call Method to load info before transaction pay.EnrollmentStatus(); //to check the payment if this is the second payment, check by the Enrollment Status tag pay.Render(); //to show the form pay.ShowDialog(); } else if (lblMOPInfo.Text == "FULL PAYMENT") { //// double a = Convert.ToDouble(lblPerMonthAdv.Text); // double a = Convert.ToDouble(lblAmountDues.Text); if (lblGOCNo.Text.Equals("N/A")) { //STUDENT INFORMATION pay.full_name = lblName.Text; pay.S_LRN = lblLRN.Text; pay.reg_no = lblRegNo.Text; pay.GOCNo = lblGOCNo.Text; //pay.S_PAYFOR = lblTotalPayment.Text; //if Reservation or Partial pay.payment_status = lblMOPInfo.Text; pay.payment_no = Convert.ToInt32(lblPaymentNoCheck.Text); //pay.amount_due = Convert.ToDouble(lblTotalPayment.Text); pay.amount_due = Convert.ToDouble(lblTotalPayment.Text) - Convert.ToDouble(lblVoucherAmount.Text); //Call Method to load info before transaction pay.EnrollmentStatus(); //to check the payment if this is the second payment, check by the Enrollment Status tag pay.fullPayStat = "FullPayment"; pay.RenderFullpay(); //to show the form pay.ShowDialog(); } else { MessageBox.Show("Account is Fully Paid", "Enrollment System", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
/// <summary> /// Displays form consisting of the current order's information /// </summary> private void ShowPaymentForm() { Form paymentForm = new frmPayment(existingOrder); paymentForm.ShowDialog(); }