Beispiel #1
0
        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");
            }
        }
Beispiel #2
0
        private void ViewButton_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 tempSummaryByOrderManager = new CPaymentSummaryManager();
                List<CPaymentSummaryByOrder> tempSummaryByOrder = (List<CPaymentSummaryByOrder>)tempSummaryByOrderManager.GetTotalPaymentSummaryForViewReport(tempCurrentDate).Data;
                ViewReportDataGridView.Rows.Clear();

                if (tempSummaryByOrder != null)
                {
                    PopulateViewReportDataGridView(tempSummaryByOrder);
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
        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;
            }
        }
Beispiel #5
0
        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";
                }
            }
        }
Beispiel #6
0
        public void PopulateViewReportDataGridViewBySearch(string inRefNo, string inPrice, string inTableNo, bool inRef, bool inPrc, bool inTable)
        {
            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 tempSummaryByOrderManager = new CPaymentSummaryManager();
                List<CPaymentSummaryByOrder> inSummaryByOrder = (List<CPaymentSummaryByOrder>)tempSummaryByOrderManager.GetTotalPaymentSummaryForViewReportBySearch(tempCurrentDate, inRefNo, inPrice, inTableNo, ReferenceCheckBox.Checked, PriceCheckBox.Checked, checkBox2.Checked).Data;
                ViewReportDataGridView.Rows.Clear();

                if (inSummaryByOrder != null)
                {
                    CPaymentSummaryByOrder[] tempPaymentSummaryByOrder = inSummaryByOrder.ToArray();

                    for (int orderIndex = 0; orderIndex < tempPaymentSummaryByOrder.Length; orderIndex++)
                    {
                        int sl = orderIndex + 1;
                        //String tempPayString = "CS(" + tempPaymentSummaryByOrder[i].TotalCashPayment.ToString() + ") CH(" + tempPaymentSummaryByOrder[i].TotalChequePayment.ToString() + ") V(" + tempPaymentSummaryByOrder[i].TotalVoucherPayment.ToString() + ") E(" + tempPaymentSummaryByOrder[i].TotalEFTPayment.ToString() + ") S(" + tempPaymentSummaryByOrder[i].TotalServicePayment.ToString() + ")";
                        String tempPayString = "";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalCashPayment > 0) tempPayString += "CSH(" + tempPaymentSummaryByOrder[orderIndex].TotalCashPayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalChequePayment > 0) tempPayString += "CHQ(" + tempPaymentSummaryByOrder[orderIndex].TotalChequePayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalVoucherPayment > 0) tempPayString += "VOU(" + tempPaymentSummaryByOrder[orderIndex].TotalVoucherPayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalEFTPayment > 0) tempPayString += "EFT(" + tempPaymentSummaryByOrder[orderIndex].TotalEFTPayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalServicePayment > 0) tempPayString += "SRV(" + tempPaymentSummaryByOrder[orderIndex].TotalServicePayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].Discount > 0) tempPayString += "DIS(" + tempPaymentSummaryByOrder[orderIndex].Discount.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalDepositePayment > 0) tempPayString += "DEP(" + tempPaymentSummaryByOrder[orderIndex].TotalDepositePayment.ToString("F02") + ") ";
                        else ;

                        String[] tempString ={ tempPaymentSummaryByOrder[orderIndex].OrderID.ToString(), sl.ToString(), tempPaymentSummaryByOrder[orderIndex].OrderType, tempPaymentSummaryByOrder[orderIndex].TableNumber.ToString(), tempPayString, tempPaymentSummaryByOrder[orderIndex].TotalPayment.ToString(), "Void" };

                        ViewReportDataGridView.Rows.Add(tempString);
                        if (tempViewType == 0) ViewReportDataGridView.Rows[orderIndex].Visible = true;
                        else if (tempViewType == 1 && !tempPaymentSummaryByOrder[orderIndex].OrderType.Equals("Table")) ViewReportDataGridView.Rows[orderIndex].Visible = false;
                        else if (tempViewType == 2 && !tempPaymentSummaryByOrder[orderIndex].OrderType.Equals("TakeAway")) ViewReportDataGridView.Rows[orderIndex].Visible = false;
                        else if (tempViewType == 3 && !tempPaymentSummaryByOrder[orderIndex].OrderType.Equals("Tabs")) ViewReportDataGridView.Rows[orderIndex].Visible = false;
                        else if (tempViewType == 4 && !tempPaymentSummaryByOrder[orderIndex].OrderType.Equals("Deposit")) ViewReportDataGridView.Rows[orderIndex].Visible = false;
                    }

                    m_sPrice = inPrice;
                    m_sRef = inRefNo;
                    m_sTable = inTableNo;

                    m_bRef = inRef;
                    m_bPrice = inPrc;
                    m_bTable = inTable;

                    LabelPayTextLabels(m_sRef, m_sPrice, m_sTable);
                }
                if (ViewReportDataGridView.RowCount < 15) ViewReportDataGridView.RowCount = 15;
            }
             catch (Exception exp)
            {
                Console.Write(exp.Message);
            }
        }
Beispiel #7
0
        public void PopulateViewReportDataGridView()
        {
            ReferenceTextBox.Clear();
            ReferenceCheckBox.Checked = false;
            PriceTextBox.Clear();
            PriceCheckBox.Checked = false;
            TableNoTextBox.Clear();
            checkBox2.Checked = false;
            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 tempSummaryByOrderManager = new CPaymentSummaryManager();
                List<CPaymentSummaryByOrder> inSummaryByOrder = (List<CPaymentSummaryByOrder>)tempSummaryByOrderManager.GetTotalPaymentSummaryForViewReport(tempCurrentDate).Data;
                ViewReportDataGridView.Rows.Clear();

                if (inSummaryByOrder != null)
                {
                    CPaymentSummaryByOrder[] tempPaymentSummaryByOrder = inSummaryByOrder.ToArray();

                    for (int orderIndex = 0; orderIndex < tempPaymentSummaryByOrder.Length; orderIndex++)
                    {
                        int sl = orderIndex + 1;
                        String tempPayString = "";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalCashPayment > 0) tempPayString += "CSH(" + tempPaymentSummaryByOrder[orderIndex].TotalCashPayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalChequePayment > 0) tempPayString += "CHQ(" + tempPaymentSummaryByOrder[orderIndex].TotalChequePayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalVoucherPayment > 0) tempPayString += "VOU(" + tempPaymentSummaryByOrder[orderIndex].TotalVoucherPayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalEFTPayment > 0) tempPayString += "EFT(" + tempPaymentSummaryByOrder[orderIndex].TotalEFTPayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalAccPayment > 0) tempPayString += "ACC(" + tempPaymentSummaryByOrder[orderIndex].TotalAccPayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalServicePayment > 0) tempPayString += "SRV(" + tempPaymentSummaryByOrder[orderIndex].TotalServicePayment.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].Discount > 0) tempPayString += "DIS(" + tempPaymentSummaryByOrder[orderIndex].Discount.ToString("F02") + ") ";
                        if (tempPaymentSummaryByOrder[orderIndex].TotalDepositePayment > 0) tempPayString += "DEP(" + tempPaymentSummaryByOrder[orderIndex].TotalDepositePayment.ToString("F02") + ") ";

                        String[] tempString ={ tempPaymentSummaryByOrder[orderIndex].OrderID.ToString(), sl.ToString(), tempPaymentSummaryByOrder[orderIndex].OrderType, tempPaymentSummaryByOrder[orderIndex].TableNumber.ToString(), tempPayString, (tempPaymentSummaryByOrder[orderIndex].TotalPayment+tempPaymentSummaryByOrder[orderIndex].TotalServicePayment).ToString("F02"), "Void" };

                        ViewReportDataGridView.Rows.Add(tempString);
                    }

                    for (int rowIndex = 0; rowIndex < ViewReportDataGridView.RowCount; rowIndex++)
                    {
                        if (tempViewType == 0)
                        {
                            ViewReportDataGridView.Rows[rowIndex].Visible = true;
                        }
                        else if (tempViewType == 1 && !tempPaymentSummaryByOrder[rowIndex].OrderType.Equals("Table"))
                        {
                            ViewReportDataGridView.Rows[rowIndex].Visible = false;
                        }
                        else if (tempViewType == 2 && !tempPaymentSummaryByOrder[rowIndex].OrderType.Equals("TakeAway"))
                        {
                            ViewReportDataGridView.Rows[rowIndex].Visible = false;
                        }
                        else if (tempViewType == 3 && !tempPaymentSummaryByOrder[rowIndex].OrderType.Equals("Tabs"))
                        {
                            ViewReportDataGridView.Rows[rowIndex].Visible = false;
                        }
                        else if (tempViewType == 4 && !tempPaymentSummaryByOrder[rowIndex].OrderType.Equals("Deposit"))
                        {
                            ViewReportDataGridView.Rows[rowIndex].Visible = false;
                        }
                    }

                    m_oViewed = true;
                    tempSearch = false;
                    LabelPayTextLabels("", "", "");
                }
                if (ViewReportDataGridView.RowCount < 15)
                {
                    ViewReportDataGridView.RowCount = 15;
                }

            }
            catch (Exception exp)
            {
                Console.Write(exp.Message);
            }
        }
Beispiel #8
0
        private void TillReportingButton_Click(object sender, EventArgs e)
        {
            try
            {
                CPcInfoManager tempPcInfoManager = new CPcInfoManager();
                IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
                CPcInfo tempPcInfo = (CPcInfo)tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString()).Data;
                CPrintMethodsEXT tempPrintMethods = new CPrintMethodsEXT();

                string serialHeader = "IBACS RMS";
                string serialFooter = "";

                string serialBody = "";
                serialBody += "                 Till Report";
                String DateString = "Date: " + DateTime.Now.ToLongDateString();
                serialBody += "\r\n".PadRight((int)(45 - DateString.Length) / 2) + DateString + "\r\n\r\n";

                CPaymentSummaryManager tempSummaryByOrderManager = new CPaymentSummaryManager();
                List<CPaymentSummaryByOrder> tempSummaryByOrder = (List<CPaymentSummaryByOrder>)tempSummaryByOrderManager.GetTotalPaymentSummaryForViewReportByPC(DateTime.Now, tempPcInfo.PcID).Data;
                CPaymentSummaryByOrder[] tempSummaryByOrderArray = tempSummaryByOrder.ToArray();

                serialBody += "SL  Order    Table   Payment       Total";
                serialBody += "\r\n    Type     Number   Type";
                serialBody += "\r\n--- -------- ---- ---------------  ------";
                for (int i = 0; i < tempSummaryByOrderArray.Length; i++)
                {
                    bool tempbool = false;
                    float tempAccPayment = 0;
                    float tempCashPayment = 0;
                    float tempChequePayment = 0;
                    float tempVoucherPayment = 0;
                    float tempDiscount = 0;
                    float tempDepositePayment = 0;
                    float tempEFTPayment = 0;
                    float tempServicePayment = 0;

                    float.TryParse(tempSummaryByOrderArray[i].TotalAccPayment.ToString(), out tempAccPayment);
                    float.TryParse(tempSummaryByOrderArray[i].TotalCashPayment.ToString(), out tempCashPayment);
                    float.TryParse(tempSummaryByOrderArray[i].TotalChequePayment.ToString(), out tempChequePayment);
                    float.TryParse(tempSummaryByOrderArray[i].TotalVoucherPayment.ToString(), out tempVoucherPayment);
                    float.TryParse(tempSummaryByOrderArray[i].TotalDepositePayment.ToString(), out tempDepositePayment);
                    float.TryParse(tempSummaryByOrderArray[i].TotalEFTPayment.ToString(), out tempEFTPayment);
                    float.TryParse(tempSummaryByOrderArray[i].TotalServicePayment.ToString(), out tempServicePayment);
                    float.TryParse(tempSummaryByOrderArray[i].Discount.ToString(), out tempDiscount);

                    //Modified By Baruri on 30/07/2008 for discarding table number for take way.
                    if (tempSummaryByOrderArray[i].OrderType.Trim().ToUpper().Replace(" ", "") == "Take Away".Trim().ToUpper().Replace(" ", ""))
                    {
                        serialBody += "\r\n" + ((int)(i + 1)).ToString().PadRight(3) + " " + (tempSummaryByOrderArray[i].OrderType.Trim()).PadRight(9, ' ') + " " + " ".PadRight(4, ' ') + " ";// +tempPayString.Trim().PadRight(13, ' ') + "  " + tempSummaryByOrderArray[i].TotalPayment;
                    }
                    else
                    {
                        serialBody += "\r\n" + ((int)(i + 1)).ToString().PadRight(3) + " " + (tempSummaryByOrderArray[i].OrderType.Trim()).PadRight(9, ' ') + " " + tempSummaryByOrderArray[i].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[i].TotalPayment.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[i].TotalPayment.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[i].TotalPayment.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[i].TotalPayment.ToString("F02") + "\r\n";
                            tempbool = true;
                        }
                        else
                        {
                            serialBody += "                  " + temp.PadRight(15, ' ') + "\r\n";
                        }
                    }

                    if (tempAccPayment > 0)
                    {
                        string temp = "ACC(" + tempAccPayment.ToString("F02") + ")";
                        if (!tempbool)
                        {
                            serialBody += temp.PadRight(15, ' ') + " " + tempSummaryByOrderArray[i].TotalPayment.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[i].TotalPayment.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[i].TotalPayment.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[i].TotalPayment.ToString("F02") + "\r\n";
                            tempbool = true;
                        }
                        else
                        {
                            serialBody += "                  " + temp.PadRight(15, ' ') + "\r\n";
                        }
                    }
                }

                CPaymentSummaryManager tempPaymentSummaryManager = new CPaymentSummaryManager();
                CPaymentSummary tempPayamentSummary = new CPaymentSummary();
                tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByPC(DateTime.Now, tempPcInfo.PcID).Data;

                if (tempPayamentSummary != null)
                {
                    serialBody += "\r\n\r\nCash Pay: " + tempPayamentSummary.TotalCashPayment;
                    serialBody += "\r\nEFT Pay: " + tempPayamentSummary.TotalEFTPayment;
                   // serialBody += "\r\nCheque Pay: " + tempPayamentSummary.TotalChequePayment;
                   // serialBody += "\r\nVoucher Pay: " + tempPayamentSummary.TotalVoucherPayment;
                    serialBody += "\r\nDiscount: " + tempPayamentSummary.TotalDiscount;
                    serialBody += "\r\nDeposite Used: " + tempPayamentSummary.TotalDepositePayment;
                    serialBody += "\r\n\r\nTotal Pay: " + tempPayamentSummary.TotalPayment;
                }

               // tempPrintMethods.SerialPrint(PRINTER_TYPES.NORMAL_PRINTER, serialHeader, serialBody, serialFooter, "");
                tempPrintMethods.USBPrint(serialBody, PrintDestiNation.CLIENT, false);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
Beispiel #9
0
        private void CSystemManagementForm_Activated(object sender, EventArgs e)
        {
            try
            {
                CPcInfoManager tempPcInfoManager = new CPcInfoManager();
                IPHostEntry ipEntry = System.Net.Dns.GetHostByName(Dns.GetHostName());
                CPcInfo tempPcInfo = (CPcInfo)tempPcInfoManager.PcInfoByPcIP(ipEntry.AddressList[0].ToString()).Data;

                CPaymentSummaryManager tempPaymentSummaryManager = new CPaymentSummaryManager();
                CPaymentSummary tempPayamentSummary = new CPaymentSummary();
                tempPayamentSummary = (CPaymentSummary)tempPaymentSummaryManager.GetTotalPaymentSummaryByPC(DateTime.Now, tempPcInfo.PcID).Data;

                if (tempPayamentSummary != null) PopulateSummaryDataGridView(tempPayamentSummary);
                PaymentSummaryDataGridView.Update();
               // LoadGraph();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }