public void FillLabels() { CashLabel.Text = "0.000"; EFTLabel.Text = "0.000"; ChequeLabel.Text = "0.000"; VoucherLabel.Text = "0.000"; DiscountLabel.Text = "0.000"; DepositeLabel.Text = "0.000"; lblNetSaleValue.Text = "0.000"; lblServiceCharge.Text = "0.000"; if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0); else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now; CPaymentSummaryManager tempPaymentSummaryManager = new CPaymentSummaryManager(); CPaymentSummary tempPayamentSummary = new CPaymentSummary(); if (tempViewType == 0) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummary(tempCurrentDate).Data; } else if (tempViewType == 1) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByOrderType(tempCurrentDate, "Table").Data; } else if (tempViewType == 2) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByOrderType(tempCurrentDate, "TakeAway").Data; } else if (tempViewType == 3) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByOrderType(tempCurrentDate, "Tabs").Data; } else if (tempViewType == 4) { //tempPayamentSummary = (CPaymentSummary)tempResult.Data; } if (tempPayamentSummary != null) { CashLabel.Text = (tempPayamentSummary.TotalCashPayment - tempPayamentSummary.ServiceChargeCash).ToString("F02"); EFTLabel.Text = (tempPayamentSummary.TotalEFTPayment - tempPayamentSummary.ServiceChargeEft).ToString("F02"); ChequeLabel.Text = (tempPayamentSummary.TotalChequePayment - tempPayamentSummary.ServiceChargeCheque).ToString("F02"); AccLabel.Text = (tempPayamentSummary.TotalAccPayment - tempPayamentSummary.ServiceChargeAcc).ToString("F02"); VoucherLabel.Text = tempPayamentSummary.TotalVoucherPayment.ToString("F02"); DiscountLabel.Text = tempPayamentSummary.TotalDiscount.ToString("F02"); DepositeLabel.Text = tempPayamentSummary.TotalDepositePayment.ToString("F02"); lblServiceCharge.Text=tempPayamentSummary.TotalServicePayment.ToString("F02"); lblGrossValue.Text = (tempPayamentSummary.TotalPayment + tempPayamentSummary.TotalServicePayment + tempPayamentSummary.TotalDiscount + tempPayamentSummary.TotalVoucherPayment).ToString("F02"); lblNetSaleValue.Text = ((tempPayamentSummary.TotalPayment + tempPayamentSummary.TotalServicePayment + tempPayamentSummary.TotalDiscount + tempPayamentSummary.TotalVoucherPayment ) - tempPayamentSummary.TotalDiscount - tempPayamentSummary.TotalVoucherPayment - tempPayamentSummary.TotalServicePayment).ToString("F02"); lblCashService.Text = tempPayamentSummary.ServiceChargeCash.ToString("F02"); lblChequeService.Text = tempPayamentSummary.ServiceChargeCheque.ToString("F02"); lblEftService.Text = tempPayamentSummary.ServiceChargeEft.ToString("F02"); lblServiceAcc.Text = tempPayamentSummary.ServiceChargeAcc.ToString("F02"); lblServiceVoucher.Text = tempPayamentSummary.ServiceChargeVoucher.ToString("F02"); } }
private void PrintDetailButton_Click(object sender, EventArgs e) { try { CPrintMethods tempPrintMethods = new CPrintMethods(); string serialHeader = ""; string serialFooter = ""; string serialBody = ""; serialBody += " Payment Detail Report"; String DateString = "Billing Date: " + tempCurrentDate.ToLongDateString(); serialBody += "\r\n".PadRight((int)(45 - DateString.Length) / 2) + DateString + "\r\n\r\n"; if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0); else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now; CPaymentSummaryManager tempSummaryByOrderManager = new CPaymentSummaryManager(); List<CPaymentSummaryByOrder> tempSummaryByOrder = (List<CPaymentSummaryByOrder>)tempSummaryByOrderManager.GetTotalPaymentSummaryForViewReport(tempCurrentDate).Data; CPaymentSummaryByOrder[] tempSummaryByOrderArray = tempSummaryByOrder.ToArray(); serialBody += "SL Order Table Payment Total"; serialBody += "\r\n Type Number Type"; serialBody += "\r\n--- -------- ---- --------------- ------"; for (int counter = 0; counter < tempSummaryByOrderArray.Length; counter++) { bool tempbool = false; float tempCashPayment = 0; float tempChequePayment = 0; float tempVoucherPayment = 0; float tempDiscount = 0; float tempDepositePayment = 0; float tempEFTPayment = 0; float tempServicePayment = 0; float.TryParse(tempSummaryByOrderArray[counter].TotalCashPayment.ToString(), out tempCashPayment); float.TryParse(tempSummaryByOrderArray[counter].TotalChequePayment.ToString(), out tempChequePayment); float.TryParse(tempSummaryByOrderArray[counter].TotalVoucherPayment.ToString(), out tempVoucherPayment); float.TryParse(tempSummaryByOrderArray[counter].TotalDepositePayment.ToString(), out tempDepositePayment); float.TryParse(tempSummaryByOrderArray[counter].TotalEFTPayment.ToString(), out tempEFTPayment); float.TryParse(tempSummaryByOrderArray[counter].TotalServicePayment.ToString(), out tempServicePayment); float.TryParse(tempSummaryByOrderArray[counter].Discount.ToString(), out tempDiscount); serialBody += "\r\n" + ((int)(counter + 1)).ToString().PadRight(3) + " " + (tempSummaryByOrderArray[counter].OrderType.Trim()).PadRight(8, ' ') + " " + tempSummaryByOrderArray[counter].TableNumber.ToString().PadRight(4, ' ') + " ";// +tempPayString.Trim().PadRight(13, ' ') + " " + tempSummaryByOrderArray[i].TotalPayment; if (tempCashPayment > 0) { string temp = "Cash:(" + tempCashPayment.ToString("F02") + ")"; if (!tempbool) { serialBody += temp.PadRight(15, ' ') + " " + (tempSummaryByOrderArray[counter].TotalPayment+tempSummaryByOrderArray[counter].TotalServicePayment).ToString("F02") + "\r\n"; tempbool = true; } else { serialBody += " " + temp.PadRight(15, ' ') + "\r\n"; } } if (tempChequePayment > 0) { string temp = "Cheque(" + tempChequePayment.ToString("F02") + ")"; if (!tempbool) { serialBody += temp.PadRight(15, ' ') + " " + (tempSummaryByOrderArray[counter].TotalPayment+tempSummaryByOrderArray[counter].TotalServicePayment).ToString("F02") + "\r\n"; tempbool = true; } else { serialBody += " " + temp.PadRight(15, ' ') + "\r\n"; } } if (tempVoucherPayment > 0) { string temp = "Voucher(" + tempVoucherPayment.ToString("F02") + ")"; if (!tempbool) { serialBody += temp.PadRight(15, ' ') + " " + (tempSummaryByOrderArray[counter].TotalPayment + tempSummaryByOrderArray[counter].TotalServicePayment).ToString("F02") + "\r\n"; tempbool = true; } else { serialBody += " " + temp.PadRight(15, ' ') + "\r\n"; } } if (tempEFTPayment > 0) { string temp = "EFT(" + tempEFTPayment.ToString("F02") + ")"; if (!tempbool) { serialBody += temp.PadRight(15, ' ') + " " + (tempSummaryByOrderArray[counter].TotalPayment + tempSummaryByOrderArray[counter].TotalServicePayment).ToString("F02") + "\r\n"; tempbool = true; } else { serialBody += " " + temp.PadRight(15, ' ') + "\r\n"; } } if (tempServicePayment > 0) { string temp = "Sevice(" + tempServicePayment.ToString("F02") + ")"; if (!tempbool) { serialBody += temp.PadRight(15, ' ') + " " + (tempSummaryByOrderArray[counter].TotalPayment + tempSummaryByOrderArray[counter].TotalServicePayment).ToString("F02") + "\r\n"; tempbool = true; } else { serialBody += " " + temp.PadRight(15, ' ') + "\r\n"; } } if (tempDiscount > 0) { string temp = "Discount(" + tempDiscount.ToString("F02") + ")"; if (!tempbool) { serialBody += temp.PadRight(15, ' ') + " " + (tempSummaryByOrderArray[counter].TotalPayment + tempSummaryByOrderArray[counter].TotalServicePayment).ToString("F02") + "\r\n"; tempbool = true; } else { serialBody += " " + temp.PadRight(15, ' ') + "\r\n"; } } if (tempDepositePayment > 0) { string temp = "Deposit(" + tempDepositePayment.ToString("F02") + ")"; if (!tempbool) { serialBody += temp.PadRight(15, ' ') + " " + (tempSummaryByOrderArray[counter].TotalPayment + tempSummaryByOrderArray[counter].TotalServicePayment).ToString("F02") + "\r\n"; tempbool = true; } else { serialBody += " " + temp.PadRight(15, ' ') + "\r\n"; } } } CPaymentSummaryManager tempPaymentSummaryManager = new CPaymentSummaryManager(); CPaymentSummary tempPayamentSummary = new CPaymentSummary(); tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummary(tempCurrentDate).Data; if (tempPayamentSummary != null) { serialBody += "Payable Summary:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\nGross Sale:" + (tempPayamentSummary.TotalPayment + tempPayamentSummary.TotalServicePayment + tempPayamentSummary.TotalDiscount + tempPayamentSummary.TotalVoucherPayment - tempPayamentSummary.ServiceChargeVoucher).ToString("F02"); serialBody += "\r\nNet Sale:" + (Convert.ToDouble(lblGrossValue.Text) - tempPayamentSummary.TotalDiscount - tempPayamentSummary.TotalVoucherPayment - tempPayamentSummary.TotalServicePayment + tempPayamentSummary.ServiceChargeVoucher).ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\nNet Sales Breakdown:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\nTotal Cash: " + (tempPayamentSummary.TotalCashPayment-tempPayamentSummary.ServiceChargeCash) .ToString("F02"); serialBody += "\r\n EFT: " + (tempPayamentSummary.TotalEFTPayment-tempPayamentSummary.ServiceChargeEft).ToString("F02"); serialBody += "\r\n Cheque: " + (tempPayamentSummary.TotalChequePayment-tempPayamentSummary.ServiceChargeCheque).ToString("F02"); serialBody += "\r\n Account: " + (tempPayamentSummary.TotalAccPayment - tempPayamentSummary.ServiceChargeAcc).ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\nPromotions and Discounts:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\n Voucher: " + tempPayamentSummary.TotalVoucherPayment.ToString("F02"); serialBody += "\r\n Discount: " + tempPayamentSummary.TotalDiscount.ToString("F02"); serialBody += "\r\n Service Ch: " + tempPayamentSummary.TotalServicePayment.ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\nService Charge Breakdown:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\n Cash: " + tempPayamentSummary.ServiceChargeCash.ToString("F02"); serialBody += "\r\n Cheque: " + tempPayamentSummary.ServiceChargeCheque.ToString("F02"); serialBody += "\r\n Voucher: " + tempPayamentSummary.ServiceChargeVoucher.ToString("F02"); serialBody += "\r\n Eft: " + tempPayamentSummary.ServiceChargeEft.ToString("F02"); serialBody += "\r\n Accounts: " + tempPayamentSummary.ServiceChargeAcc.ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\n Deposit Used: " + tempPayamentSummary.TotalDepositePayment.ToString("F02"); serialBody += "\r\n\r\n"; } serialBody += "\r\n\r\n"; tempPrintMethods.SerialPrint(PRINTER_TYPES.NORMAL_PRINTER, serialHeader, serialBody, serialFooter, ""); this.WriteString(serialBody);///Write to a file when print command is executed } catch (Exception exp) { throw exp; } }
private void PrintSummaryButton_Click(object sender, EventArgs e) { try { if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0); else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now; CPaymentSummaryManager tempPaymentSummaryManager = new CPaymentSummaryManager(); CPaymentSummary tempPayamentSummary = new CPaymentSummary(); tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummary(tempCurrentDate).Data; CPrintMethods tempPrintMethods = new CPrintMethods(); string serialHeader = ""; string serialFooter = ""; string serialBody = ""; serialBody += " Payment Summary Report"; String DateString = "Billing Date: " + tempCurrentDate.ToLongDateString(); serialBody += "\r\n".PadRight((int)(45 - DateString.Length) / 2) + DateString + "\r\n\r\n"; if (tempPayamentSummary != null) { serialBody += "Payable Summary:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\nGross Sale:" + (tempPayamentSummary.TotalPayment + tempPayamentSummary.TotalServicePayment + tempPayamentSummary.TotalDiscount + tempPayamentSummary.TotalVoucherPayment - tempPayamentSummary.ServiceChargeVoucher).ToString("F02"); serialBody += "\r\nNet Sale:" + (Convert.ToDouble(lblGrossValue.Text) - tempPayamentSummary.TotalDiscount - tempPayamentSummary.TotalVoucherPayment - tempPayamentSummary.TotalServicePayment + tempPayamentSummary.ServiceChargeVoucher).ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\nNet Sales Breakdown:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\nTotal Cash: " + (tempPayamentSummary.TotalCashPayment-tempPayamentSummary.ServiceChargeCash).ToString("F02"); serialBody += "\r\n EFT: " + (tempPayamentSummary.TotalEFTPayment-tempPayamentSummary.ServiceChargeEft).ToString("F02"); serialBody += "\r\n Cheque: " + (tempPayamentSummary.TotalChequePayment-tempPayamentSummary.ServiceChargeCheque).ToString("F02"); serialBody += "\r\n Account: " + (tempPayamentSummary.TotalAccPayment - tempPayamentSummary.ServiceChargeAcc).ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\nPromotions and Discounts:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\n Voucher: " + tempPayamentSummary.TotalVoucherPayment.ToString("F02"); serialBody += "\r\n Discount: " + tempPayamentSummary.TotalDiscount.ToString("F02"); serialBody += "\r\n Service Ch: " + tempPayamentSummary.TotalServicePayment.ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\nService Charge Breakdown:"; serialBody += "\r\n----------------------------------------"; serialBody += "\r\n Cash: " + tempPayamentSummary.ServiceChargeCash.ToString("F02"); serialBody += "\r\n Cheque: " + tempPayamentSummary.ServiceChargeCheque.ToString("F02"); serialBody += "\r\n Voucher: " + tempPayamentSummary.ServiceChargeVoucher.ToString("F02"); serialBody += "\r\n Eft: " + tempPayamentSummary.ServiceChargeEft.ToString("F02"); serialBody += "\r\n Accounts: " + tempPayamentSummary.ServiceChargeAcc.ToString("F02"); serialBody += "\r\n----------------------------------------"; serialBody += "\r\n Deposit Used: " + tempPayamentSummary.TotalDepositePayment.ToString("F02"); } serialBody += "\r\n\r\n"; tempPrintMethods.SerialPrint(PRINTER_TYPES.NORMAL_PRINTER, serialHeader, serialBody, serialFooter, ""); this.WriteString(serialBody);///Write to a file when print command is executed } catch (Exception exp) { throw exp; } }
public void LabelPayTextLabels(string inRefNo, string inPrice, string inTableNo) { if (!tempSearch && m_oViewed) { if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0); else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now; CPaymentSummaryManager tempPaymentSummaryManager = new CPaymentSummaryManager(); CPaymentSummary tempPayamentSummary = new CPaymentSummary(); if (tempViewType == 0) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummary(tempCurrentDate).Data; } else if (tempViewType == 1) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByOrderType(tempCurrentDate, "Table").Data; } else if (tempViewType == 2) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByOrderType(tempCurrentDate, "TakeAway").Data; } else if (tempViewType == 3) { tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByOrderType(tempCurrentDate, "Tabs").Data; } else if (tempViewType == 4) { //tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByOrderType(tempCurrentDate, "Tabs").Data; //tempPayamentSummary = (CPaymentSummary)tempResult.Data; } if (tempPayamentSummary != null) { if ((tempPayamentSummary.TotalCashPayment - tempPayamentSummary.ServiceChargeCash)>0) { CashLabel.Text = (tempPayamentSummary.TotalCashPayment - tempPayamentSummary.ServiceChargeCash).ToString("F02"); } if (tempPayamentSummary.TotalEFTPayment - tempPayamentSummary.ServiceChargeEft > 0) { EFTLabel.Text = (tempPayamentSummary.TotalEFTPayment - tempPayamentSummary.ServiceChargeEft).ToString("F02"); } if ((tempPayamentSummary.TotalChequePayment - tempPayamentSummary.ServiceChargeCheque) > 0) { ChequeLabel.Text = (tempPayamentSummary.TotalChequePayment - tempPayamentSummary.ServiceChargeCheque).ToString("F02"); } if ((tempPayamentSummary.TotalAccPayment - tempPayamentSummary.ServiceChargeAcc) > 0) { AccLabel.Text = (tempPayamentSummary.TotalAccPayment - tempPayamentSummary.ServiceChargeAcc).ToString("F02"); } VoucherLabel.Text = tempPayamentSummary.TotalVoucherPayment.ToString("F02"); DiscountLabel.Text = tempPayamentSummary.TotalDiscount.ToString("F02"); DepositLabel.Text = tempPayamentSummary.TotalDepositePayment.ToString("F02"); TotalPayLabel.Text = tempPayamentSummary.TotalPayment.ToString("F02"); lblServiceCharge.Text = tempPayamentSummary.TotalServicePayment.ToString("F02"); lblGrossValue.Text = (tempPayamentSummary.TotalPayment + tempPayamentSummary.TotalServicePayment + tempPayamentSummary.TotalDiscount + tempPayamentSummary.TotalVoucherPayment).ToString("F02"); lblNetSaleValue.Text = ((tempPayamentSummary.TotalPayment + tempPayamentSummary.TotalServicePayment + tempPayamentSummary.TotalDiscount + tempPayamentSummary.TotalVoucherPayment) - tempPayamentSummary.TotalDiscount - tempPayamentSummary.TotalVoucherPayment - tempPayamentSummary.TotalServicePayment).ToString("F02"); lblCashService.Text = tempPayamentSummary.ServiceChargeCash.ToString("F02"); lblChequeService.Text = tempPayamentSummary.ServiceChargeCheque.ToString("F02"); lblEftService.Text = tempPayamentSummary.ServiceChargeEft.ToString("F02"); lblServiceAcc.Text = tempPayamentSummary.ServiceChargeAcc.ToString("F02"); lblServiceVoucher.Text = tempPayamentSummary.ServiceChargeVoucher.ToString("F02"); } else { CashLabel.Text = "0.000"; EFTLabel.Text = "0.000"; ChequeLabel.Text = "0.000"; VoucherLabel.Text = "0.000"; DiscountLabel.Text = "0.000"; DepositLabel.Text = "0.000"; TotalPayLabel.Text = "0.000"; lblGrossValue.Text = "0.000"; lblNetSaleValue.Text = "0.000"; lblCashService.Text = "0.000"; lblChequeService.Text = "0.000"; lblEftService.Text = "0.000"; lblServiceAcc.Text = "0.000"; lblServiceCharge.Text = "0.000"; lblServiceVoucher.Text = "0.000"; } } else if (tempSearch) { float tempCash = 0; float tempEFT = 0; float tempCheque = 0; float tempVoucher = 0; float tempDiscount = 0; float tempDeposite = 0; float tempTotal = 0; float tempService = 0; float tempAcc = 0; double tempCashService = 0; double tempChequeService = 0; double tempEftService = 0; double tempVoucherService = 0; double tempAccservice = 0; if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0); else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now; CPaymentSummaryManager tempSummaryByOrderManager = new CPaymentSummaryManager(); List<CPaymentSummaryByOrder> inSummaryByOrder = (List<CPaymentSummaryByOrder>)tempSummaryByOrderManager.GetTotalPaymentSummaryForViewReportBySearch(tempCurrentDate, inRefNo, inPrice, inTableNo, m_bRef, m_bPrice, m_bTable).Data; if (inSummaryByOrder != null) { CPaymentSummaryByOrder[] tempPaymentSummaryByOrder = inSummaryByOrder.ToArray(); for (int arrayIndex = 0; arrayIndex < tempPaymentSummaryByOrder.Length; arrayIndex++) { if (tempViewType == 0) { tempCash += tempPaymentSummaryByOrder[arrayIndex].TotalCashPayment; tempCheque += tempPaymentSummaryByOrder[arrayIndex].TotalChequePayment; tempEFT += tempPaymentSummaryByOrder[arrayIndex].TotalEFTPayment; tempVoucher += tempPaymentSummaryByOrder[arrayIndex].TotalVoucherPayment; tempDiscount += tempPaymentSummaryByOrder[arrayIndex].Discount; tempDeposite += tempPaymentSummaryByOrder[arrayIndex].TotalDepositePayment; tempTotal += tempPaymentSummaryByOrder[arrayIndex].TotalPayment; tempService += tempPaymentSummaryByOrder[arrayIndex].TotalServicePayment; tempAcc += tempPaymentSummaryByOrder[arrayIndex].TotalAccPayment; tempCashService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCash; tempChequeService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCheque; tempEftService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeEft; tempAccservice += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeAcc; tempVoucherService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeVoucher; } else if (tempViewType == 1 && tempPaymentSummaryByOrder[arrayIndex].OrderType.Equals("Table")) { tempCash += tempPaymentSummaryByOrder[arrayIndex].TotalCashPayment; tempCheque += tempPaymentSummaryByOrder[arrayIndex].TotalChequePayment; tempEFT += tempPaymentSummaryByOrder[arrayIndex].TotalEFTPayment; tempVoucher += tempPaymentSummaryByOrder[arrayIndex].TotalVoucherPayment; tempDiscount += tempPaymentSummaryByOrder[arrayIndex].Discount; tempDeposite += tempPaymentSummaryByOrder[arrayIndex].TotalDepositePayment; tempTotal += tempPaymentSummaryByOrder[arrayIndex].TotalPayment; tempService += tempPaymentSummaryByOrder[arrayIndex].TotalServicePayment; tempAcc += tempPaymentSummaryByOrder[arrayIndex].TotalAccPayment; tempCashService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCash; tempChequeService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCheque; tempEftService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeEft; tempAccservice += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeAcc; tempVoucherService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeVoucher; } else if (tempViewType == 2 && tempPaymentSummaryByOrder[arrayIndex].OrderType.Equals("TakeAway")) { tempCash += tempPaymentSummaryByOrder[arrayIndex].TotalCashPayment; tempCheque += tempPaymentSummaryByOrder[arrayIndex].TotalChequePayment; tempEFT += tempPaymentSummaryByOrder[arrayIndex].TotalEFTPayment; tempVoucher += tempPaymentSummaryByOrder[arrayIndex].TotalVoucherPayment; tempDiscount += tempPaymentSummaryByOrder[arrayIndex].Discount; tempDeposite += tempPaymentSummaryByOrder[arrayIndex].TotalDepositePayment; tempTotal += tempPaymentSummaryByOrder[arrayIndex].TotalPayment; tempService += tempPaymentSummaryByOrder[arrayIndex].TotalServicePayment; tempAcc += tempPaymentSummaryByOrder[arrayIndex].TotalAccPayment; tempCashService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCash; tempChequeService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCheque; tempEftService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeEft; tempAccservice += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeAcc; tempVoucherService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeVoucher; } else if (tempViewType == 3 && tempPaymentSummaryByOrder[arrayIndex].OrderType.Equals("Tabs")) { tempCash += tempPaymentSummaryByOrder[arrayIndex].TotalCashPayment; tempCheque += tempPaymentSummaryByOrder[arrayIndex].TotalChequePayment; tempEFT += tempPaymentSummaryByOrder[arrayIndex].TotalEFTPayment; tempVoucher += tempPaymentSummaryByOrder[arrayIndex].TotalVoucherPayment; tempDiscount += tempPaymentSummaryByOrder[arrayIndex].Discount; tempDeposite += tempPaymentSummaryByOrder[arrayIndex].TotalDepositePayment; tempTotal += tempPaymentSummaryByOrder[arrayIndex].TotalPayment; tempService += tempPaymentSummaryByOrder[arrayIndex].TotalServicePayment; tempAcc += tempPaymentSummaryByOrder[arrayIndex].TotalAccPayment; tempCashService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCash; tempChequeService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCheque; tempEftService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeEft; tempAccservice += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeAcc; tempVoucherService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeVoucher; } else if (tempViewType == 4 && tempPaymentSummaryByOrder[arrayIndex].OrderType.Equals("Deposit")) { tempCash += tempPaymentSummaryByOrder[arrayIndex].TotalCashPayment; tempCheque += tempPaymentSummaryByOrder[arrayIndex].TotalChequePayment; tempEFT += tempPaymentSummaryByOrder[arrayIndex].TotalEFTPayment; tempVoucher += tempPaymentSummaryByOrder[arrayIndex].TotalVoucherPayment; tempDiscount += tempPaymentSummaryByOrder[arrayIndex].Discount; tempDeposite += tempPaymentSummaryByOrder[arrayIndex].TotalDepositePayment; tempTotal += tempPaymentSummaryByOrder[arrayIndex].TotalPayment; tempService += tempPaymentSummaryByOrder[arrayIndex].TotalServicePayment; tempAcc += tempPaymentSummaryByOrder[arrayIndex].TotalAccPayment; tempCashService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCash; tempChequeService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeCheque; tempEftService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeEft; tempAccservice += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeAcc; tempVoucherService += tempPaymentSummaryByOrder[arrayIndex].ServiceChargeVoucher; } } CashLabel.Text = (tempCash-tempCashService).ToString("F02"); EFTLabel.Text = (tempEFT-tempEftService).ToString("F02"); ChequeLabel.Text = (tempCheque-tempChequeService).ToString("F02"); AccLabel.Text = (tempAcc - tempAccservice).ToString("F02"); VoucherLabel.Text = tempVoucher.ToString("F02"); DiscountLabel.Text = tempDiscount.ToString("F02"); DepositLabel.Text = tempDeposite.ToString("F02"); TotalPayLabel.Text = tempTotal.ToString("F02"); lblGrossValue.Text = (tempTotal+tempService+tempDiscount+tempVoucher).ToString("F02"); lblNetSaleValue.Text = (tempTotal).ToString("F02"); lblCashService.Text = tempCashService.ToString("F02"); lblChequeService.Text = tempChequeService.ToString("F02"); lblEftService.Text = tempEftService.ToString("F02"); lblServiceAcc.Text = tempAccservice.ToString("F02"); lblServiceVoucher.Text = tempVoucherService.ToString("F02"); } else { CashLabel.Text = "0.000"; EFTLabel.Text = "0.000"; ChequeLabel.Text = "0.000"; VoucherLabel.Text = "0.000"; DiscountLabel.Text = "0.000"; DepositLabel.Text = "0.000"; TotalPayLabel.Text = "0.000"; lblGrossValue.Text = "0.000"; lblNetSaleValue.Text = "0.000"; lblServiceCharge.Text = "0.000"; lblCashService.Text = "0.000"; lblChequeService.Text = "0.000"; lblEftService.Text = "0.000"; lblServiceAcc.Text = "0.000"; lblServiceVoucher.Text = "0.000"; } } }