Ejemplo n.º 1
0
        public void PrintPageAndReportFooterSection(bool IsReceipt, DateTime OverRidingPrintDate, bool boPrintTermsAndConditions = false)
        {
            //if (mclsTerminalDetails.AutoPrint != PrintingPreference.AskFirst)
            //{
            int iCtr = 0;
            string stModule = "";
            Receipt clsReceipt = new Receipt(mConnection, mTransaction);
            ReceiptDetails clsReceiptDetails;

            if (IsReceipt)
            {
                // print page footer
                for (iCtr = 1; iCtr <= 20; iCtr++)
                {
                    stModule = "PageFooterA" + iCtr;
                    clsReceiptDetails = clsReceipt.Details(stModule);

                    PrintReportValue(clsReceiptDetails, IsReceipt, OverRidingPrintDate);
                }
                // print page footer
                for (iCtr = 1; iCtr <= 5; iCtr++)
                {
                    stModule = "PageFooterB" + iCtr;
                    clsReceiptDetails = clsReceipt.Details(stModule);

                    PrintReportValue(clsReceiptDetails, IsReceipt, OverRidingPrintDate);
                }
            }

            // print report footer
            for (iCtr = 1; iCtr <= 5; iCtr++)
            {
                stModule = "ReportFooter" + iCtr;
                clsReceiptDetails = clsReceipt.Details(stModule);

                PrintReportValue(clsReceiptDetails, IsReceipt, OverRidingPrintDate);
            }

            if (mclsTerminalDetails.IncludeTermsAndConditions & boPrintTermsAndConditions)
                PrintTermsAndConditions();

            // Sep 14, 2014 get the msbToPrint to remove the spacers.
            msbEJournalToPrint = msbToPrint;

            // print report footer Spacer
            clsReceiptDetails = clsReceipt.Details(ReportFormatModule.ReportFooterSpacer);
            for (int i = 0; i < Convert.ToInt32(clsReceiptDetails.Value); i++)
            { msbToPrint.Append(Environment.NewLine); }
            clsReceipt.CommitAndDispose();

            // do the actual print
            if (mclsTerminalDetails.AutoPrint != PrintingPreference.AskFirst)
            {
                this.bgwPOSPrinter.RunWorkerAsync();

                // Wait for the BackgroundWorker to finish the download.
                while (this.bgwPOSPrinter.IsBusy)
                {
                    Application.DoEvents();
                }

                //mclsFilePrinter.Write(msbToPrint);
                //RawPrinterHelper.SendFileToPrinter(mclsTerminalDetails.PrinterName, mclsFilePrinter.FileName, "RetailPlus " + mclsFilePrinter.FileName);
                //mclsFilePrinter.DeleteFile();

                ////print the first part of transaction header if autocutter
                //if (mclsTerminalDetails.IsPrinterAutoCutter)
                //    //cut the paper if printer is auto cutter
                //    CutPrinterPaper(mclsTerminalDetails.PrinterName);
            }

            // Sep 14, 2014 add electronic journal only for all valid transactions with transaction no
            if (mclsSalesTransactionDetails.TransactionID != 0)
            {
                msbEJournalToPrint.Append("-".PadLeft(mclsTerminalDetails.MaxReceiptWidth, '-') + Environment.NewLine);
                mclsEJournal = new EJournalPrinter();
                if (string.IsNullOrEmpty(mstrBeginningTransactionNo))
                {
                    Data.TerminalReport clsTerminalReport = new Data.TerminalReport(mConnection, mTransaction);
                    mstrBeginningTransactionNo = clsTerminalReport.BeginningTransactionNo(mclsTerminalDetails.BranchID, mclsTerminalDetails.TerminalNo);
                    //mstrBeginningTransactionNo = clsTerminalReport.Details(mclsTerminalDetails.BranchID, mclsTerminalDetails.TerminalNo).BeginningTransactionNo;
                    clsTerminalReport.CommitAndDispose();
                }
                mclsEJournal.FileName = mstrBeginningTransactionNo;
                mclsEJournal.Write(msbEJournalToPrint);
            }
        }
Ejemplo n.º 2
0
        public void PrintReportPageHeaderSectionChecked(bool IsReceipt)
        {
            if (IsReceipt)
            {
                // print page header <-- second transaction header
                int iCtr = 0;
                string stModule = "";

                Receipt clsReceipt = new Receipt(mConnection, mTransaction);
                ReceiptDetails clsReceiptDetails;

                for (iCtr = 1; iCtr <= 10; iCtr++)
                {
                    stModule = "PageHeader" + iCtr;
                    clsReceiptDetails = clsReceipt.Details(stModule);

                    PrintReportValue(clsReceiptDetails, IsReceipt, DateTime.MinValue);
                }

                PrintItemHeader();

                clsReceipt.CommitAndDispose();
            }
        }
Ejemplo n.º 3
0
        public void PrintPageFooterBSection()
        {
            int iCtr = 0;
            string stModule = "";
            Receipt clsReceipt = new Receipt(mConnection, mTransaction);
            ReceiptDetails clsReceiptDetails;

            // print page footer
            for (iCtr = 1; iCtr <= 5; iCtr++)
            {
                stModule = "PageFooterB" + iCtr;
                clsReceiptDetails = clsReceipt.Details(stModule);

                PrintReportValue(clsReceiptDetails, false, DateTime.MinValue);
            }

            clsReceipt.CommitAndDispose();
        }
Ejemplo n.º 4
0
		private void LoadRecord()
		{
			lblCompanyName.Text = CompanyDetails.CompanyName;

			Label lblLabel;

			int iCtr = 0;
			string stModule = "";
			Receipt clsReceipt = new Receipt();
			ReceiptDetails clsReceiptDetails;

			stModule = "ReportHeaderSpacer";
			clsReceiptDetails = clsReceipt.Details(stModule);
//			txtReportHeaderSpacer.Text = clsReceiptDetails.Value;

			for (iCtr=1;iCtr<=10;iCtr++)
			{
				lblLabel = (Label) this.FindControl("lblReportHeader" + iCtr);

				stModule = "ReportHeader" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=10;iCtr++)
			{
				lblLabel = (Label) this.FindControl("lblPageHeader" + iCtr);
				
				stModule = "PageHeader" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
				
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=20;iCtr++)
			{
				lblLabel = (Label) this.FindControl("lblPageFooterA" + iCtr);
				
				stModule = "PageFooterA" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=5;iCtr++)
			{
				lblLabel = (Label) this.FindControl("lblPageFooterB" + iCtr);
				
				stModule = "PageFooterB" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=5;iCtr++)
			{
				lblLabel = (Label) this.FindControl("lblReportFooter" + iCtr);
				
				stModule = "ReportFooter" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				ApplyFormat(clsReceiptDetails, lblLabel);
			}

			stModule = "ReportFooterSpacer";
			clsReceiptDetails = clsReceipt.Details(stModule);
//			txtReportFooterSpacer.Text = clsReceiptDetails.Value;

			clsReceipt.CommitAndDispose();
		}
Ejemplo n.º 5
0
        public void PrintReportPageHeaderSection(bool isReceipt, bool isCheckOutBill = false)
        {

            Receipt clsReceipt = new Receipt(mConnection, mTransaction);
            ReceiptDetails clsReceiptDetails;

            // print Page Header
            int iCtr = 0;
            string stModule = "";
            for (iCtr = 1; iCtr <= 10; iCtr++)
            {
                stModule = "PageHeader" + iCtr;
                clsReceiptDetails = clsReceipt.Details(stModule);

                PrintReportValue(clsReceiptDetails, isReceipt, DateTime.MinValue, isCheckOutBill);
            }

            PrintItemHeader();

            clsReceipt.CommitAndDispose();
        }
Ejemplo n.º 6
0
        private void PopulatePLUReport()
        {
            lblCompany.Text = CompanyDetails.CompanyCode;

            lblStartDate.Text = "Start Date: " + mStartDate.ToString("MM/dd/yyyy hh:mm:ss tt") + Environment.NewLine;
            lblEndDate.Text = "End Date  : " + mEndDate.ToString("MM/dd/yyyy hh:mm:ss tt") + Environment.NewLine + Environment.NewLine;

            Receipt clsReceipt = new Receipt();

            lblReportHeader1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader1").Value);
            lblReportHeader2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader2").Value);
            lblReportHeader3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader3").Value);
            lblReportHeader4.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader4").Value);

            this.dgStyle.MappingName = mdtPLUReport.TableName;
            dgPLUReport.DataSource = mdtPLUReport;
            decimal TotalQuantity = 0;
            decimal TotalAmount = 0;
            try
            {
                foreach (System.Data.DataRow dr in mdtPLUReport.Rows)
                {
                    TotalQuantity += Convert.ToDecimal(dr["Quantity"]);
                    TotalAmount += Convert.ToDecimal(dr["Amount"]);
                }
                dgPLUReport.Select(0);
            }
            catch { }
            lblTotalQuantity.Text = TotalQuantity.ToString("#,##0.#0");
            lblTotalAmount.Text = TotalAmount.ToString("#,##0.#0");

            lblGrandTotal.Text = mCashierReportDetails.GrossSales.ToString("#,##0.#0");

            lblReportFooter1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter1").Value);
            lblReportFooter2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter2").Value);
            lblReportFooter3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter3").Value);

            clsReceipt.CommitAndDispose();

        }
Ejemplo n.º 7
0
        private void PopulateGroupReport()
        {
            lblCompany.Text = CompanyDetails.CompanyCode;

            Receipt clsReceipt = new Receipt();

            lblReportHeader1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader1").Value);
            lblReportHeader2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader2").Value);
            lblReportHeader3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader3").Value);
            lblReportHeader4.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader4").Value);

            this.dgStyle.MappingName = mdtGroupReport.TableName;
            dgGroupReport.DataSource = mdtGroupReport;
            decimal TotalTranCount = 0;
            decimal TotalAmount = 0;
            try
            {
                foreach (System.Data.DataRow dr in mdtGroupReport.Rows)
                {
                    TotalTranCount += Convert.ToDecimal(dr["TranCount"]);
                    TotalAmount += Convert.ToDecimal(dr["Amount"]);
                }
                dgGroupReport.Select(0);
            }
            catch { }
            lblTotalTran.Text = TotalTranCount.ToString("#,##0");
            lblTotalAmount.Text = TotalAmount.ToString("#,##0.#0");
            if (TotalTranCount > 0)
                lblTotalPercentage.Text = "100%";
            else
                lblTotalPercentage.Text = "0%";

            lblDiscount.Text = mTerminalReportDetails.SubTotalDiscount.ToString("#,##0.#0");
            lblCharge.Text = mTerminalReportDetails.TotalCharge.ToString("#,##0.#0");
            lblVAT.Text = mTerminalReportDetails.VAT.ToString("#,##0.#0");

            lblVATName.Visible = !mclsTerminalDetails.IsVATInclusive;
            lblVAT.Visible = !mclsTerminalDetails.IsVATInclusive;
            lblVATSpacer.Visible = !mclsTerminalDetails.IsVATInclusive;

            decimal GrandTotal = mTerminalReportDetails.DailySales + mTerminalReportDetails.VAT + mTerminalReportDetails.TotalCharge;
            lblGrandTotal.Text = GrandTotal.ToString("#,##0.#0");

            lblReportFooter1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter1").Value);
            lblReportFooter2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter2").Value);
            lblReportFooter3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter3").Value);

            clsReceipt.CommitAndDispose();

        }
Ejemplo n.º 8
0
		private void SaveRecord()
		{
			DropDownList cboOrientationBox;
			DropDownList cboBox;
			TextBox txtBox;
			int iCtr = 1;

			Receipt clsReceipt = new Receipt();
			ReceiptDetails clsDetails = new ReceiptDetails();

			clsDetails.Module = "ReportHeaderSpacer";
			clsDetails.Value = txtReportHeaderSpacer.Text;
			clsReceipt.Update(clsDetails);

			for (iCtr=1;iCtr<=10;iCtr++)
			{
				cboOrientationBox = (DropDownList) this.FindControl("cboReportHeaderOrientation" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboReportHeader" + iCtr);
				txtBox = (TextBox) this.FindControl("txtReportHeader" + iCtr);
				clsDetails.Module = "ReportHeader" + iCtr;
				clsDetails.Text = txtBox.Text;
				clsDetails.Value = cboBox.SelectedItem.Value.ToString();
				clsDetails.Orientation = (ReportFormatOrientation) Enum.Parse(typeof(ReportFormatOrientation),cboOrientationBox.SelectedItem.Value.ToString());

				clsReceipt.Update(clsDetails);
			}
			for (iCtr=1;iCtr<=10;iCtr++)
			{
				cboOrientationBox = (DropDownList) this.FindControl("cboPageHeaderOrientation" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboPageHeader" + iCtr);
				txtBox = (TextBox) this.FindControl("txtPageHeader" + iCtr);

				clsDetails.Module = "PageHeader" + iCtr;
				clsDetails.Text = txtBox.Text;
				clsDetails.Value = cboBox.SelectedItem.Value.ToString();
				clsDetails.Orientation = (ReportFormatOrientation) Enum.Parse(typeof(ReportFormatOrientation),cboOrientationBox.SelectedItem.Value.ToString());

				clsReceipt.Update(clsDetails);
			}
			for (iCtr=1;iCtr<=20;iCtr++)
			{
				cboOrientationBox = (DropDownList) this.FindControl("cboPageFooterAOrientation" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboPageFooterA" + iCtr);
				txtBox = (TextBox) this.FindControl("txtPageFooterA" + iCtr);

				clsDetails.Module = "PageFooterA" + iCtr;
				clsDetails.Text = txtBox.Text;
				clsDetails.Value = cboBox.SelectedItem.Value.ToString();
				clsDetails.Orientation = (ReportFormatOrientation) Enum.Parse(typeof(ReportFormatOrientation),cboOrientationBox.SelectedItem.Value.ToString());

				clsReceipt.Update(clsDetails);
			}
			for (iCtr=1;iCtr<=5;iCtr++)
			{
				cboOrientationBox = (DropDownList) this.FindControl("cboPageFooterBOrientation" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboPageFooterB" + iCtr);
				txtBox = (TextBox) this.FindControl("txtPageFooterB" + iCtr);

				clsDetails.Module = "PageFooterB" + iCtr;
				clsDetails.Text = txtBox.Text;
				clsDetails.Value = cboBox.SelectedItem.Value.ToString();
				clsDetails.Orientation = (ReportFormatOrientation) Enum.Parse(typeof(ReportFormatOrientation),cboOrientationBox.SelectedItem.Value.ToString());

				clsReceipt.Update(clsDetails);
			}
			for (iCtr=1;iCtr<=5;iCtr++)
			{
				cboOrientationBox = (DropDownList) this.FindControl("cboReportFooterOrientation" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboReportFooter" + iCtr);
				txtBox = (TextBox) this.FindControl("txtReportFooter" + iCtr);

				clsDetails.Module = "ReportFooter" + iCtr;
				clsDetails.Text = txtBox.Text;
				clsDetails.Value = cboBox.SelectedItem.Value.ToString();
				clsDetails.Orientation = (ReportFormatOrientation) Enum.Parse(typeof(ReportFormatOrientation),cboOrientationBox.SelectedItem.Value.ToString());

				clsReceipt.Update(clsDetails);
			}

			clsDetails.Module = "ReportFooterSpacer";
			clsDetails.Value = txtReportFooterSpacer.Text;
			clsReceipt.Update(clsDetails);

			clsReceipt.CommitAndDispose();
		}
Ejemplo n.º 9
0
		private void LoadRecord()
		{

			lblCompanyName.Text = CompanyDetails.CompanyName;
			lblCompanyName1.Text = CompanyDetails.CompanyName;

			DropDownList cboOrientationBox;
			DropDownList cboBox;
			TextBox txtBox;
			Label lblLabel;

			int iCtr = 0;
			string stModule = "";
			Receipt clsReceipt = new Receipt();
			ReceiptDetails clsReceiptDetails;

			stModule = "ReportHeaderSpacer";
			clsReceiptDetails = clsReceipt.Details(stModule);
			txtReportHeaderSpacer.Text = clsReceiptDetails.Value;

			for (iCtr=1;iCtr<=10;iCtr++)
			{
				txtBox = (TextBox) this.FindControl("txtReportHeader" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboReportHeader" + iCtr);
				cboOrientationBox = (DropDownList) this.FindControl("cboReportHeaderOrientation" + iCtr);
				lblLabel = (Label) this.FindControl("lblReportHeader" + iCtr);

				stModule = "ReportHeader" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				txtBox.Text = clsReceiptDetails.Text;
				cboBox.SelectedIndex = cboBox.Items.IndexOf(cboBox.Items.FindByValue(clsReceiptDetails.Value));
				cboOrientationBox.SelectedIndex = cboOrientationBox.Items.IndexOf(cboOrientationBox.Items.FindByValue(clsReceiptDetails.Orientation.ToString("d")));
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=10;iCtr++)
			{
				txtBox = (TextBox) this.FindControl("txtPageHeader" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboPageHeader" + iCtr);
				cboOrientationBox = (DropDownList) this.FindControl("cboPageHeaderOrientation" + iCtr);
				lblLabel = (Label) this.FindControl("lblPageHeader" + iCtr);
				
				stModule = "PageHeader" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
				
				txtBox.Text = clsReceiptDetails.Text;
				cboBox.SelectedIndex = cboBox.Items.IndexOf(cboBox.Items.FindByValue(clsReceiptDetails.Value));
				cboOrientationBox.SelectedIndex = cboOrientationBox.Items.IndexOf(cboOrientationBox.Items.FindByValue(clsReceiptDetails.Orientation.ToString("d")));
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=20;iCtr++)
			{
				txtBox = (TextBox) this.FindControl("txtPageFooterA" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboPageFooterA" + iCtr);
				cboOrientationBox = (DropDownList) this.FindControl("cboPageFooterAOrientation" + iCtr);
				lblLabel = (Label) this.FindControl("lblPageFooterA" + iCtr);
				
				stModule = "PageFooterA" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				txtBox.Text = clsReceiptDetails.Text;
				cboBox.SelectedIndex = cboBox.Items.IndexOf(cboBox.Items.FindByValue(clsReceiptDetails.Value));
				cboOrientationBox.SelectedIndex = cboOrientationBox.Items.IndexOf(cboOrientationBox.Items.FindByValue(clsReceiptDetails.Orientation.ToString("d")));
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=5;iCtr++)
			{
				txtBox = (TextBox) this.FindControl("txtPageFooterB" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboPageFooterB" + iCtr);
				cboOrientationBox = (DropDownList) this.FindControl("cboPageFooterBOrientation" + iCtr);
				lblLabel = (Label) this.FindControl("lblPageFooterB" + iCtr);
				
				stModule = "PageFooterB" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				txtBox.Text = clsReceiptDetails.Text;
				cboBox.SelectedIndex = cboBox.Items.IndexOf(cboBox.Items.FindByValue(clsReceiptDetails.Value));
				cboOrientationBox.SelectedIndex = cboOrientationBox.Items.IndexOf(cboOrientationBox.Items.FindByValue(clsReceiptDetails.Orientation.ToString("d")));
				ApplyFormat(clsReceiptDetails, lblLabel);
			}
			for (iCtr=1;iCtr<=5;iCtr++)
			{
				txtBox = (TextBox) this.FindControl("txtReportFooter" + iCtr);
				cboBox = (DropDownList) this.FindControl("cboReportFooter" + iCtr);
				cboOrientationBox = (DropDownList) this.FindControl("cboReportFooterOrientation" + iCtr);
				lblLabel = (Label) this.FindControl("lblReportFooter" + iCtr);
				
				stModule = "ReportFooter" + iCtr;
				clsReceiptDetails = clsReceipt.Details(stModule);
			
				txtBox.Text = clsReceiptDetails.Text;
				cboBox.SelectedIndex = cboBox.Items.IndexOf(cboBox.Items.FindByValue(clsReceiptDetails.Value));
				cboOrientationBox.SelectedIndex = cboOrientationBox.Items.IndexOf(cboOrientationBox.Items.FindByValue(clsReceiptDetails.Orientation.ToString("d")));
				ApplyFormat(clsReceiptDetails, lblLabel);
			}

			stModule = "ReportFooterSpacer";
			clsReceiptDetails = clsReceipt.Details(stModule);
			txtReportFooterSpacer.Text = clsReceiptDetails.Value;

			clsReceipt.CommitAndDispose();
		}
Ejemplo n.º 10
0
        private void PopulateCashiersReport()
        {
            Receipt clsReceipt = new Receipt();
            clsReceipt.GetConnection();

            Data.TerminalReportDetails clsTerminalReportDetails = new Data.TerminalReport(clsReceipt.Connection, clsReceipt.Transaction).Details(mclsDetails.BranchID, mclsDetails.TerminalNo);

            mclsTerminalDetails.MaxReceiptWidth = 94;

            System.Data.DataTable dt = new System.Data.DataTable("tblTerminalReport");
            dt.Columns.Add("Module");
            dt.Columns.Add("Separator");
            dt.Columns.Add("Value");
            //dt.Rows.Add(CenterString(CompanyDetails.CompanyCode, mclsTerminalDetails.MaxReceiptWidth));
            //dt.Rows.Add("-".PadRight(mclsTerminalDetails.MaxReceiptWidth, '-'));
            //dt.Rows.Add(CenterString("Terminal Report", mclsTerminalDetails.MaxReceiptWidth));
            //dt.Rows.Add("-".PadRight(mclsTerminalDetails.MaxReceiptWidth, '-'));

            //string strReportHeader1 = clsReceipt.Details("ReportHeader1").Value;
            //string strReportHeader2 = clsReceipt.Details("ReportHeader2").Value;
            //string strReportHeader3 = clsReceipt.Details("ReportHeader3").Value;
            //string strReportHeader4 = clsReceipt.Details("ReportHeader4").Value;
            //if (!string.IsNullOrEmpty(strReportHeader1)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader1), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader2)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader2), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader3)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader3), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader4)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader4), mclsTerminalDetails.MaxReceiptWidth));

            dt.Rows.Add("Gross Sales", ":", (mclsDetails.GrossSales + mclsDetails.TotalCharge).ToString("#,##0.#0"));
            dt.Rows.Add("(-) Service Charge", ":", mclsDetails.TotalCharge.ToString("#,##0.#0"));
            dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("Total Amount", ":", mclsDetails.GrossSales.ToString("#,##0.#0"));
            dt.Rows.Add("(-) " + mclsTerminalDetails.VAT.ToString("##") + "% VAT Exempt ", ":", (mclsDetails.VATExempt * (mclsTerminalDetails.VAT / 100)).ToString("#,##0.#0"));
            dt.Rows.Add("(-) Subtotal Discount", ":", mclsDetails.SubTotalDiscount.ToString("#,##0.#0"));
            dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("Net Sales", ":", mclsDetails.NetSales.ToString("#,##0.#0"));

            dt.Rows.Add("Taxables Breakdown", "", "");
            dt.Rows.Add("VAT Exempt", ":", mclsDetails.VATExempt.ToString("#,##0.00"));
            dt.Rows.Add("VAT Zero Rated", ":", mclsDetails.ZeroRatedSales.ToString("#,##0.00"));
            dt.Rows.Add("NonVATable Amount", ":", mclsDetails.NonVATableAmount.ToString("#,##0.00"));
            dt.Rows.Add("VATable Amount", ":", mclsDetails.VATableAmount.ToString("#,##0.00"));
            dt.Rows.Add(mclsTerminalDetails.VAT.ToString("##") + "% VAT", ":", mclsDetails.VAT.ToString("#,##0.00"));
            dt.Rows.Add("Local Tax", ":", mclsDetails.LocalTax.ToString("#,##0.00"));

            dt.Rows.Add("Total Amount Breakdown", "", "");
            dt.Rows.Add("Cash Sales", ":", mclsDetails.CashSales.ToString("#,##0.00"));
            dt.Rows.Add("Cheque Sales", ":", mclsDetails.ChequeSales.ToString("#,##0.00"));
            dt.Rows.Add("Credit Card Sales", ":", mclsDetails.CreditCardSales.ToString("#,##0.00"));
            dt.Rows.Add("Credit (Charge)", ":", mclsDetails.CreditSales.ToString("#,##0.00"));
            dt.Rows.Add("Credit Payment", ":", mclsDetails.CreditPayment.ToString("#,##0.00"));
            dt.Rows.Add("      Cash", ":", mclsDetails.CreditPaymentCash.ToString("#,##0.00"));
            dt.Rows.Add("      Cheque", ":", mclsDetails.CreditPaymentCheque.ToString("#,##0.00"));
            dt.Rows.Add("      Credit Card", ":", mclsDetails.CreditPaymentCreditCard.ToString("#,##0.00"));
            dt.Rows.Add("      Debit", ":", mclsDetails.CreditPaymentDebit.ToString("#,##0.00"));
            dt.Rows.Add("Debit Sales", ":", mclsDetails.DebitPayment.ToString("#,##0.00"));
            dt.Rows.Add("     Rewards Points Redeemed", ":", mclsDetails.RewardPointsPayment.ToString("#,##0.00"));
            dt.Rows.Add("Employee Acct.", ":", "0.00");
            dt.Rows.Add("Void Sales", ":", mclsDetails.VoidSales.ToString("#,##0.00"));
            dt.Rows.Add("Refund Sales", ":", mclsDetails.RefundSales.ToString("#,##0.00"));
            dt.Rows.Add("      Cash", ":", mclsDetails.RefundCash.ToString("#,##0.00"));
            dt.Rows.Add("      Cheque", ":", mclsDetails.RefundCheque.ToString("#,##0.00"));
            dt.Rows.Add("      Credit Card", ":", mclsDetails.RefundCreditCard.ToString("#,##0.00"));
            dt.Rows.Add("      Credit", ":", mclsDetails.RefundCredit.ToString("#,##0.00"));
            dt.Rows.Add("      Debit", ":", mclsDetails.RefundDebit.ToString("#,##0.00"));

            Data.SalesTransactions clsSalesTransactions = new Data.SalesTransactions(clsReceipt.Connection, clsReceipt.Transaction);
            // CashierID = 0 ALL

            Data.TerminalReport clsTerminalReport = new Data.TerminalReport(clsReceipt.Connection, clsReceipt.Transaction);
            System.Data.DataTable dtCreditCards = clsSalesTransactions.SalesPerCreditCard(mclsDetails.BranchID, mclsDetails.TerminalNo, mclsDetails.CashierID, clsTerminalReportDetails.DateLastInitialized, clsTerminalReportDetails.NEXTDateLastInitialized);

            if (dtCreditCards.Rows.Count > 0)
            {
                dt.Rows.Add("-", "-", "-");
                dt.Rows.Add("Credit Card Breakdown", "", "");
                dt.Rows.Add("-", "-", "-");
                foreach (System.Data.DataRow dr in dtCreditCards.Rows)
                {
                    dt.Rows.Add(dr["CardTypeCode"].ToString(), ":", decimal.Parse(dr["Amount"].ToString()).ToString("#,##0.00"));
                }
            }

            dt.Rows.Add("Discounts", "", "");
            dt.Rows.Add("Items Discount", ":", mclsDetails.ItemsDiscount.ToString("#,##0.00"));
            dt.Rows.Add("Subtotal Discount", ":", mclsDetails.SubTotalDiscount.ToString("#,##0.00"));
            dt.Rows.Add("     Senior Citizen", ":", mclsDetails.SNRDiscount.ToString("#,##0.00"));
            dt.Rows.Add("     PWD", ":", mclsDetails.PWDDiscount.ToString("#,##0.00"));
            dt.Rows.Add("     Others", ":", mclsDetails.OtherDiscount.ToString("#,##0.00"));
            dt.Rows.Add("Total Discounts", ":", mclsDetails.TotalDiscount.ToString("#,##0.00"));

            clsSalesTransactions = new Data.SalesTransactions(clsReceipt.Connection, clsReceipt.Transaction);

            System.Data.DataTable dtDiscounts = clsSalesTransactions.Discounts(mclsDetails.BranchID, mclsDetails.TerminalNo, clsTerminalReportDetails.BeginningTransactionNo, clsTerminalReportDetails.EndingTransactionNo);
            if (dtDiscounts.Rows.Count > 0)
            {
                dt.Rows.Add("-", "-", "-");
                dt.Rows.Add("Subtotal Discounts Breakdown", "", "");
                dt.Rows.Add("-", "-", "-");
                foreach (System.Data.DataRow dr in dtDiscounts.Rows)
                {
                    dt.Rows.Add(dr["DiscountCode"].ToString(), ":", decimal.Parse(dr["Discount"].ToString()).ToString("#,##0.00"));
                }
            }

            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Drawer Information", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Beginning Balance", ":", mclsDetails.BeginningBalance.ToString("#,##0.00"));
            dt.Rows.Add("Cash In Drawer", ":", mclsDetails.CashInDrawer.ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Paid Out", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Paid Out", ":", mclsDetails.TotalPaidOut.ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("PICK UP / Disburstment", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash", ":", mclsDetails.CashDisburse.ToString("#,##0.00"));
            dt.Rows.Add("Cheque", ":", mclsDetails.ChequeDisburse.ToString("#,##0.00"));
            dt.Rows.Add("Credit Card", ":", mclsDetails.CreditCardDisburse.ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Receive on Account", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash", ":", mclsDetails.CashWithHold.ToString("#,##0.00"));
            dt.Rows.Add("Cheque", ":", mclsDetails.ChequeWithHold.ToString("#,##0.00"));
            dt.Rows.Add("Credit Card", ":", mclsDetails.CreditCardWithHold.ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Customer Deposits", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash", ":", mclsDetails.CashDeposit.ToString("#,##0.00"));
            dt.Rows.Add("Cheque", ":", mclsDetails.ChequeDeposit.ToString("#,##0.00"));
            dt.Rows.Add("Credit Card", ":", mclsDetails.CreditCardDeposit.ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Transaction Count Breakdown", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash Transactions", ":", mclsDetails.NoOfCashTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Cheque Transactions", ":", mclsDetails.NoOfChequeTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Credit Card Transactions", ":", mclsDetails.NoOfCreditCardTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Credit Transactions", ":", mclsDetails.NoOfCreditTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Debit Transactions", ":", mclsDetails.NoOfDebitPaymentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Refund Transactions", ":", mclsDetails.NoOfRefundTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Void Transactions", ":", mclsDetails.NoOfVoidTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Combination Trans", ":", mclsDetails.NoOfCombinationPaymentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Credit Payment Trans", ":", mclsDetails.NoOfCreditPaymentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Reward Points Trans", ":", mclsDetails.NoOfRewardPointsPayment.ToString("#,##0.00"));

            dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("Total Transactions", ":", mclsDetails.NoOfTotalTransactions.ToString("#,##0.00"));

            dt.Rows.Add("Misc Amount Breakdown", "", "");
            dt.Rows.Add("    Consignment", ":", mclsDetails.ConsignmentSales.ToString("#,##0.00"));
            dt.Rows.Add("    Walk-In", ":", mclsDetails.WalkInSales.ToString("#,##0.00"));
            dt.Rows.Add("    Out Of Stock", ":", mclsDetails.OutOfStockSales.ToString("#,##0.00"));
            dt.Rows.Add("Refund - Misc Amount Breakdown", "", "");
            dt.Rows.Add("    Consignment", ":", mclsDetails.ConsignmentRefundSales.ToString("#,##0.00"));
            dt.Rows.Add("    Walk-In", ":", mclsDetails.WalkInRefundSales.ToString("#,##0.00"));
            dt.Rows.Add("    Out Of Stock", ":", mclsDetails.OutOfStockRefundSales.ToString("#,##0.00"));
            dt.Rows.Add("Misc Trans Breakdown", "", "");
            dt.Rows.Add("    Consignment Trans", ":", mclsDetails.NoOfConsignmentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("    Walk-In Trans", ":", mclsDetails.NoOfWalkInTransactions.ToString("#,##0.00"));
            dt.Rows.Add("    Out Of Stock Trans", ":", mclsDetails.NoOfOutOfStockTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Refund - Misc Trans Breakdown", "", "");
            dt.Rows.Add("    Consignment Trans", ":", mclsDetails.NoOfConsignmentRefundTransactions.ToString("#,##0.00"));
            dt.Rows.Add("    Walk-In Trans", ":", mclsDetails.NoOfWalkInRefundTransactions.ToString("#,##0.00"));
            dt.Rows.Add("    Out Of Stock Trans", ":", mclsDetails.NoOfOutOfStockRefundTransactions.ToString("#,##0.00"));

            string strReportFooter1 = clsReceipt.Details("ReportFooter1").Value;
            string strReportFooter2 = clsReceipt.Details("ReportFooter2").Value;
            string strReportFooter3 = clsReceipt.Details("ReportFooter3").Value;
            if (!string.IsNullOrEmpty(strReportFooter1)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter1), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter2)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter2), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter3)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter3), mclsTerminalDetails.MaxReceiptWidth));

            clsReceipt.CommitAndDispose();

            dgvItems.MultiSelect = true;
            dgvItems.AutoGenerateColumns = true;
            dgvItems.AutoSize = true;
            dgvItems.ScrollBars = ScrollBars.Vertical;
            dgvItems.DataSource = dt.TableName;
            dgvItems.DataSource = dt;

            //dgvItems.Columns["ReportValue"].Visible = true;
            //dgvItems.Columns["ReportValue"].HeaderText = "";
            //dgvItems.Columns["ReportValue"].Width = 388;

            dgvItems.Columns["Module"].Visible = true;
            dgvItems.Columns["Separator"].Visible = true;
            dgvItems.Columns["Value"].Visible = true;

            dgvItems.Columns["Module"].HeaderText = "";
            dgvItems.Columns["Separator"].HeaderText = "";
            dgvItems.Columns["Value"].HeaderText = "";

            dgvItems.Columns["Module"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            dgvItems.Columns["Separator"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvItems.Columns["Value"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvItems.Columns["Module"].Width = 230;
            dgvItems.Columns["Separator"].Width = 20;
            dgvItems.Columns["Value"].Width = dgvItems.Width-250-20;

        }
Ejemplo n.º 11
0
        private void PopulateTerminalReport()
        {
            lblCompany.Text = CompanyDetails.CompanyCode;

            Receipt clsReceipt = new Receipt();

            lblReportHeader1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader1").Value);
            lblReportHeader2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader2").Value);
            lblReportHeader3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader3").Value);
            lblReportHeader4.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader4").Value);

            lblGrossSales.Text = mDetails.GrossSales.ToString("#,##0.00");
            lblTotalDiscount.Text = mDetails.TotalDiscount.ToString("#,##0.00");

            lblNetSales.Text = mDetails.DailySales.ToString("#,##0.00");
            lblVAT.Text = mDetails.VAT.ToString("#,##0.00");
            lblCharge.Text = mDetails.TotalCharge.ToString("#,##0.00");
            decimal TotalAmount = mDetails.DailySales + mDetails.VAT + mDetails.EVAT + mDetails.LocalTax + mDetails.TotalCharge;
            lblTotalAmount.Text = TotalAmount.ToString("#,##0.00");

            lblVAT1.Text = mDetails.VAT.ToString("#,##0.#0");
            lblLocalTax.Text = mDetails.LocalTax.ToString("#,##0.#0");

            lblCashSales.Text = mDetails.CashSales.ToString("#,##0.#0");
            lblChequeSales.Text = mDetails.ChequeSales.ToString("#,##0.#0");
            lblCreditCardSales.Text = mDetails.CreditCardSales.ToString("#,##0.#0");
            lblCreditSales.Text = mDetails.CreditSales.ToString("#,##0.#0");
            lblCreditPayment.Text = mDetails.CreditPayment.ToString("#,##0.#0");
            lblCreditPaymentCash.Text = mDetails.CreditPaymentCash.ToString("#,##0.#0");
            lblCreditPaymentCheque.Text = mDetails.CreditPaymentCheque.ToString("#,##0.#0");
            lblCreditPaymentCreditCard.Text = mDetails.CreditPaymentCreditCard.ToString("#,##0.#0");
            lblCreditPaymentDebit.Text = mDetails.CreditPaymentDebit.ToString("#,##0.#0");

            lblDebitPayment.Text = mDetails.DebitPayment.ToString("#,##0.#0");
            lblVoidSales.Text = mDetails.VoidSales.ToString("#,##0.#0");
            lblRefundSales.Text = mDetails.RefundSales.ToString("#,##0.#0");

            lblItemsDiscount.Text = mDetails.ItemsDiscount.ToString("#,##0.#0");
            lblSubtotalDiscount.Text = mDetails.SubTotalDiscount.ToString("#,##0.#0");
            lblTotalDiscounts.Text = mDetails.TotalDiscount.ToString("#,##0.#0");

            lblBeginningBalance.Text = mDetails.BeginningBalance.ToString("#,##0.#0");
            lblCashInDrawer.Text = mDetails.CashInDrawer.ToString("#,##0.#0");

            lblPaidOut.Text = mDetails.TotalPaidOut.ToString("#,##0.#0");
            lblCashDisburse.Text = mDetails.CashDisburse.ToString("#,##0.#0");
            lblChequeDisburse.Text = mDetails.ChequeDisburse.ToString("#,##0.#0");
            lblCreditCardDisburse.Text = mDetails.CreditCardDisburse.ToString("#,##0.#0");

            lblCashWithHold.Text = mDetails.CashWithHold.ToString("#,##0.#0");
            lblChequeWithHold.Text = mDetails.ChequeWithHold.ToString("#,##0.#0");
            lblCreditCardWithHold.Text = mDetails.CreditCardWithHold.ToString("#,##0.#0");

            lblCashDeposit.Text = mDetails.CashDeposit.ToString("#,##0.#0");
            lblChequeDeposit.Text = mDetails.ChequeDeposit.ToString("#,##0.#0");
            lblCreditCardDeposit.Text = mDetails.CreditCardDeposit.ToString("#,##0.#0");

            lblNoOfCashTransactions.Text = mDetails.NoOfCashTransactions.ToString("#,##0");
            lblNoOfChequeTransactions.Text = mDetails.NoOfChequeTransactions.ToString("#,##0");
            lblNoOfCreditCardTran.Text = mDetails.NoOfCreditCardTransactions.ToString("#,##0");
            lblNoOfCreditTran.Text = mDetails.NoOfCreditTransactions.ToString("#,##0");
            lblNoOfCombPayTran.Text = mDetails.NoOfCombinationPaymentTransactions.ToString("#,##0");
            lblNoOfCreditPaymentTran.Text = mDetails.NoOfCreditPaymentTransactions.ToString("#,##0");
            lblNoOfDebitPaymentTransactions.Text = mDetails.NoOfDebitPaymentTransactions.ToString("#,##0");
            lblNoOfRefundTransactions.Text = mDetails.NoOfRefundTransactions.ToString("#,##0");
            lblNoOfVoidTransactions.Text = mDetails.NoOfVoidTransactions.ToString("#,##0");
            lblNoOfTotalTransactions.Text = mDetails.NoOfTotalTransactions.ToString("#,##0");

            lblCashCount.Text = mDetails.CashCount.ToString("#,##0.#0");

            if (mDetails.CashInDrawer > mDetails.CashCount)
            {
                lblShortOverName.Text = "Short";
                decimal decShort = mDetails.CashInDrawer - mDetails.CashCount;
                lblShortOver.Text = decShort.ToString("#,##0.#0");
            }
            else if (mDetails.CashCount > mDetails.CashInDrawer)
            {
                lblShortOverName.Text = "Over";
                decimal decOver = mDetails.CashCount - mDetails.CashInDrawer;
                lblShortOver.Text = decOver.ToString("#,##0.#0");
            }
            else
            {
                lblShortOverName.Text = "";
                lblShortOver.Text = "";
            }

            lblReportFooter1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter1").Value);
            lblReportFooter2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter2").Value);
            lblReportFooter3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter3").Value);

            clsReceipt.CommitAndDispose();
        }
Ejemplo n.º 12
0
        private void PopulatePLUReport()
        {
            lblCompany.Text = CompanyDetails.CompanyCode;

            lblStartDate.Text = "Start Date: " + mStartDate.ToString("MM/dd/yyyy hh:mm:ss tt") + Environment.NewLine;
            lblEndDate.Text = "End Date  : " + mEndDate.ToString("MM/dd/yyyy hh:mm:ss tt") + Environment.NewLine + Environment.NewLine;

            Receipt clsReceipt = new Receipt();

            lblReportHeader1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader1").Value);
            lblReportHeader2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader2").Value);
            lblReportHeader3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader3").Value);
            lblReportHeader4.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader4").Value);

            this.dgStyle.MappingName = mdtPLUReport.TableName;
            dgPLUReport.DataSource = mdtPLUReport;
            decimal TotalQuantity = 0;
            decimal TotalAmount = 0;
            try
            {
                foreach (System.Data.DataRow dr in mdtPLUReport.Rows)
                {
                    TotalQuantity += Convert.ToDecimal(dr["Quantity"]);
                    TotalAmount += Convert.ToDecimal(dr["Amount"]);
                }
                dgPLUReport.Select(0);
            }
            catch { }
            lblTotalQuantity.Text = TotalQuantity.ToString("#,##0.#0");
            lblTotalAmount.Text = TotalAmount.ToString("#,##0.#0");


            lblDiscount.Text = mCashierReportDetails.SubTotalDiscount.ToString("#,##0.#0");
            decimal GrandTotal = mCashierReportDetails.DailySales + mCashierReportDetails.VAT + mCashierReportDetails.TotalCharge;
            lblVATExempt.Text = (TotalAmount - GrandTotal - mCashierReportDetails.SubTotalDiscount).ToString("#,##0.#0");

            lblCharge.Text = mCashierReportDetails.TotalCharge.ToString("#,##0.#0");
            lblVAT.Text = mCashierReportDetails.VAT.ToString("#,##0.#0");

            //put back in case inde gumana
            lblVAT.Visible = !mclsTerminalDetails.IsVATInclusive;
            lblVATName.Visible = !mclsTerminalDetails.IsVATInclusive;

            lblGrandTotal.Text = GrandTotal.ToString("#,##0.#0");

            lblReportFooter1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter1").Value);
            lblReportFooter2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter2").Value);
            lblReportFooter3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter3").Value);

            clsReceipt.CommitAndDispose();

        }
Ejemplo n.º 13
0
        private void PopulateTerminalReport()
        {
            Receipt clsReceipt = new Receipt();

            mclsTerminalDetails.MaxReceiptWidth = 94;

            System.Data.DataTable dt = new System.Data.DataTable("tblTerminalReport");
            dt.Columns.Add("Module");
            dt.Columns.Add("Separator");
            dt.Columns.Add("Value");
            
            //dt.Rows.Add(CenterString(CompanyDetails.CompanyCode, mclsTerminalDetails.MaxReceiptWidth));
            //dt.Rows.Add("-".PadRight(mclsTerminalDetails.MaxReceiptWidth, '-'));
            //dt.Rows.Add(CenterString("Terminal Report", mclsTerminalDetails.MaxReceiptWidth));
            //dt.Rows.Add("-".PadRight(mclsTerminalDetails.MaxReceiptWidth, '-'));

            //string strReportHeader1 = clsReceipt.Details("ReportHeader1").Value;
            //string strReportHeader2 = clsReceipt.Details("ReportHeader2").Value;
            //string strReportHeader3 = clsReceipt.Details("ReportHeader3").Value;
            //string strReportHeader4 = clsReceipt.Details("ReportHeader4").Value;
            //if (!string.IsNullOrEmpty(strReportHeader1)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader1), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader2)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader2), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader3)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader3), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader4)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader4), mclsTerminalDetails.MaxReceiptWidth));

            if (Int64.Parse(mclsDetails.BeginningORNo) == 0)
                dt.Rows.Add("Beginning OR No.", ":", mclsDetails.BeginningORNo.Remove(mclsDetails.BeginningORNo.Length - 1) + "1");
            else
                dt.Rows.Add("Beginning OR No.", ":", mclsDetails.BeginningORNo);

            dt.Rows.Add("Ending OR No.", ":", mclsDetails.EndingORNo);
            dt.Rows.Add("", "", "");
            dt.Rows.Add("Gross Sales", ":", ((mclsDetails.GrossSales + mclsDetails.TotalCharge)).ToString("#,##0.#0"));
            dt.Rows.Add("(-) Service Charge", ":", mclsDetails.TotalCharge.ToString("#,##0.#0"));
            dt.Rows.Add("",":","------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("Total Amount", ":", (mclsDetails.GrossSales).ToString("#,##0.#0"));
            dt.Rows.Add("(-) " + mclsTerminalDetails.VAT.ToString("##") + "% VAT Exempt ", ":", (mclsDetails.VATExempt * (mclsTerminalDetails.VAT / 100)).ToString("#,##0.#0"));
            dt.Rows.Add("(-) Discount", ":", (mclsDetails.SubTotalDiscount + mclsDetails.ItemsDiscount).ToString("#,##0.#0"));
            dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("Net Sales", ":", (mclsDetails.NetSales).ToString("#,##0.#0"));

            if (mclsTerminalDetails.WillPrintGrandTotal == true)
            {
                //switch (mTerminalReportType)
                //{
                //    case Reports.TerminalReportType.XRead:
                //    case Reports.TerminalReportType.TerminalReport:
                //    case Reports.TerminalReportType.CashiersTerminalReport:
                //        dt.Rows.Add("-", "-", "-");
                //        dt.Rows.Add("OLD GRAND TOTAL", ":", (mclsDetails.eSalesOldGrandTotal).ToString("#,##0.#0"));
                //        dt.Rows.Add("This Total Amount", ":", (mclsDetails.GrossSales).ToString("#,##0.#0"));
                //        dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
                //        dt.Rows.Add("NEW GRAND TOTAL", ":", (mclsDetails.eSalesNewGrandTotal).ToString("#,##0.#0"));
                //        break;
                //    default:
                dt.Rows.Add("-", "-", "-");
                dt.Rows.Add("OLD GRAND TOTAL", ":", (mclsDetails.OldGrandTotal).ToString("#,##0.#0"));
                dt.Rows.Add("This Total Amount", ":", (mclsDetails.GrossSales).ToString("#,##0.#0"));
                if (Math.Round((mclsDetails.NewGrandTotal - (mclsDetails.OldGrandTotal + mclsDetails.GrossSales))) != 0)
                    dt.Rows.Add("   (-) TF Consigned", ":", ((mclsDetails.OldGrandTotal + mclsDetails.GrossSales) - mclsDetails.NewGrandTotal).ToString("#,##0.#0"));
                dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
                dt.Rows.Add("NEW GRAND TOTAL", ":", (mclsDetails.NewGrandTotal).ToString("#,##0.#0"));
                //        break;
                //}
                //dt.Rows.Add("-", "-", "-");
                //dt.Rows.Add("OLD GRAND TOTAL", ":", (mclsDetails.eSalesOldGrandTotal).ToString("#,##0.#0"));
                //dt.Rows.Add("This Total Amount", ":", (mclsDetails.GrossSales).ToString("#,##0.#0"));
                //dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
                //dt.Rows.Add("NEW GRAND TOTAL", ":", (mclsDetails.eSalesOldGrandTotal + mclsDetails.GrossSales).ToString("#,##0.#0"));
            }

            dt.Rows.Add("Taxables Breakdown", "", "");
            dt.Rows.Add("VAT Exempt", ":", (mclsDetails.VATExempt).ToString("#,##0.00"));
            dt.Rows.Add("VAT Zero Rated", ":", (mclsDetails.ZeroRatedSales).ToString("#,##0.00"));
            dt.Rows.Add("NonVATable Amount", ":", (mclsDetails.NonVATableAmount).ToString("#,##0.00"));
            dt.Rows.Add("VATable Amount", ":", (mclsDetails.VATableAmount).ToString("#,##0.00"));
            dt.Rows.Add(mclsTerminalDetails.VAT.ToString("##") + "% VAT", ":", (mclsDetails.VAT).ToString("#,##0.00"));
            dt.Rows.Add("Local Tax", ":", (mclsDetails.LocalTax).ToString("#,##0.00"));

            dt.Rows.Add("Total Amount Breakdown", "", "");
            dt.Rows.Add("Cash Sales", ":", (mclsDetails.CashSales).ToString("#,##0.00"));
            dt.Rows.Add("Cheque Sales", ":", (mclsDetails.ChequeSales).ToString("#,##0.00"));
            dt.Rows.Add("Credit Card Sales", ":", (mclsDetails.CreditCardSales).ToString("#,##0.00"));
            dt.Rows.Add("Credit (Charge)", ":", (mclsDetails.CreditSales).ToString("#,##0.00"));
            dt.Rows.Add("Credit Payment", ":", (mclsDetails.CreditPayment).ToString("#,##0.00"));
            dt.Rows.Add("      Cash", ":", (mclsDetails.CreditPaymentCash).ToString("#,##0.00"));
            dt.Rows.Add("      Cheque", ":", (mclsDetails.CreditPaymentCheque).ToString("#,##0.00"));
            dt.Rows.Add("      Credit Card", ":", (mclsDetails.CreditPaymentCreditCard).ToString("#,##0.00"));
            dt.Rows.Add("      Debit", ":", (mclsDetails.CreditPaymentDebit).ToString("#,##0.00"));
            dt.Rows.Add("Debit Sales", ":", (mclsDetails.DebitPayment).ToString("#,##0.00"));
            dt.Rows.Add("     Rewards Points Redeemed", ":", (mclsDetails.RewardPointsPayment).ToString("#,##0.00"));
            dt.Rows.Add("Employee Acct.", ":", "0.00");
            dt.Rows.Add("Void Sales", ":", (mclsDetails.VoidSales).ToString("#,##0.00"));
            dt.Rows.Add("Refund Sales", ":", (mclsDetails.RefundSales).ToString("#,##0.00"));
            dt.Rows.Add("      Cash", ":", (mclsDetails.RefundCash).ToString("#,##0.00"));
            dt.Rows.Add("      Cheque", ":", (mclsDetails.RefundCheque).ToString("#,##0.00"));
            dt.Rows.Add("      Credit Card", ":", (mclsDetails.RefundCreditCard).ToString("#,##0.00"));
            dt.Rows.Add("      Credit", ":", (mclsDetails.RefundCredit).ToString("#,##0.00"));
            dt.Rows.Add("      Debit", ":", (mclsDetails.RefundDebit).ToString("#,##0.00"));

            Data.SalesTransactions clsSalesTransactions = new Data.SalesTransactions(clsReceipt.Connection, clsReceipt.Transaction);
            System.Data.DataTable dtCreditCards = clsSalesTransactions.SalesPerCreditCard(mclsDetails.BranchID, mclsDetails.TerminalNo, 0, mclsDetails.DateLastInitialized, mclsDetails.NEXTDateLastInitialized);

            if (dtCreditCards.Rows.Count > 0)
            {
                dt.Rows.Add("-", "-", "-");
                dt.Rows.Add("Credit Card Breakdown", "", "");
                dt.Rows.Add("-", "-", "-");
                foreach (System.Data.DataRow dr in dtCreditCards.Rows)
                {
                    dt.Rows.Add(dr["CardTypeCode"].ToString(), ":", (decimal.Parse(dr["Amount"].ToString()) * ((100 - mclsDetails.TrustFund) / 100)).ToString("#,##0.00"));
                }
            }

            dt.Rows.Add("Discounts", "", "");
            dt.Rows.Add("Items Discount", ":", (mclsDetails.ItemsDiscount).ToString("#,##0.00"));
            dt.Rows.Add("Subtotal Discount", ":", (mclsDetails.SubTotalDiscount).ToString("#,##0.00"));
            dt.Rows.Add("     Senior Citizen", ":", (mclsDetails.SNRDiscount).ToString("#,##0.00"));
            dt.Rows.Add("     PWD", ":", (mclsDetails.PWDDiscount).ToString("#,##0.00"));
            dt.Rows.Add("     Others", ":", (mclsDetails.OtherDiscount).ToString("#,##0.00"));
            dt.Rows.Add("Total Discounts", ":", (mclsDetails.TotalDiscount).ToString("#,##0.00"));

            clsSalesTransactions = new Data.SalesTransactions(clsReceipt.Connection, clsReceipt.Transaction);

            System.Data.DataTable dtDiscounts = clsSalesTransactions.Discounts(mclsDetails.BranchID, mclsDetails.TerminalNo, mclsDetails.BeginningTransactionNo, mclsDetails.EndingTransactionNo);
            if (dtDiscounts.Rows.Count > 0)
            {
                dt.Rows.Add("-", "-", "-");
                dt.Rows.Add("Subtotal Discounts Breakdown", "", "");
                dt.Rows.Add("-", "-", "-");
                foreach (System.Data.DataRow dr in dtDiscounts.Rows)
                {
                    dt.Rows.Add(dr["DiscountCode"].ToString(), ":", (decimal.Parse(dr["Discount"].ToString()) * ((100 - mclsDetails.TrustFund) / 100)).ToString("#,##0.00"));
                }
            }

            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Drawer Information", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Beginning Balance", ":", (mclsDetails.BeginningBalance).ToString("#,##0.00"));
            dt.Rows.Add("Cash In Drawer", ":", (mclsDetails.CashInDrawer).ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Paid Out", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Paid Out", ":", (mclsDetails.TotalPaidOut).ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("PICK UP / Disburstment", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash", ":", (mclsDetails.CashDisburse).ToString("#,##0.00"));
            dt.Rows.Add("Cheque", ":", (mclsDetails.ChequeDisburse).ToString("#,##0.00"));
            dt.Rows.Add("Credit Card", ":", (mclsDetails.CreditCardDisburse).ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Receive on Account", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash", ":", (mclsDetails.CashWithHold).ToString("#,##0.00"));
            dt.Rows.Add("Cheque", ":", (mclsDetails.ChequeWithHold).ToString("#,##0.00"));
            dt.Rows.Add("Credit Card", ":", (mclsDetails.CreditCardWithHold).ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Customer Deposits", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash", ":", (mclsDetails.CashDeposit).ToString("#,##0.00"));
            dt.Rows.Add("Cheque", ":", (mclsDetails.ChequeDeposit).ToString("#,##0.00"));
            dt.Rows.Add("Credit Card", ":", (mclsDetails.CreditCardDeposit).ToString("#,##0.00"));
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Transaction Count Breakdown", "", "");
            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Cash Transactions", ":", mclsDetails.NoOfCashTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Cheque Transactions", ":", mclsDetails.NoOfChequeTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Credit Card Transactions", ":", mclsDetails.NoOfCreditCardTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Credit Transactions", ":", mclsDetails.NoOfCreditTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Debit Transactions", ":", mclsDetails.NoOfDebitPaymentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Refund Transactions", ":", mclsDetails.NoOfRefundTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Void Transactions", ":", mclsDetails.NoOfVoidTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Combination Trans", ":", mclsDetails.NoOfCombinationPaymentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Credit Payment Trans", ":", mclsDetails.NoOfCreditPaymentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Reward Points Trans", ":", mclsDetails.NoOfRewardPointsPayment.ToString("#,##0.00"));
            dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("Total Transactions", ":", mclsDetails.NoOfTotalTransactions.ToString("#,##0.00"));

            // 25Feb2015 : These lines will not be printed in the actual print-out
            dt.Rows.Add("Misc Amount Breakdown", "", "");
            dt.Rows.Add("Consignment", ":", (mclsDetails.ConsignmentSales).ToString("#,##0.00"));
            dt.Rows.Add("Walk-In", ":", (mclsDetails.WalkInSales).ToString("#,##0.00"));
            dt.Rows.Add("Out Of Stock", ":", (mclsDetails.OutOfStockSales).ToString("#,##0.00"));
            dt.Rows.Add("    Refund", "", "");
            dt.Rows.Add("Consignment", ":", (mclsDetails.ConsignmentRefundSales).ToString("#,##0.00"));
            dt.Rows.Add("Walk-In", ":", (mclsDetails.WalkInRefundSales).ToString("#,##0.00"));
            dt.Rows.Add("Out Of Stock", ":", (mclsDetails.OutOfStockRefundSales).ToString("#,##0.00"));

            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("Consignment Trans", ":", mclsDetails.NoOfConsignmentTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Walk-In Trans", ":", mclsDetails.NoOfWalkInTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Out Of Stock Trans", ":", mclsDetails.NoOfOutOfStockTransactions.ToString("#,##0.00"));
            dt.Rows.Add("    Refund", "", "");
            dt.Rows.Add("Consignment Trans", ":", mclsDetails.NoOfConsignmentRefundTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Walk-In Trans", ":", mclsDetails.NoOfWalkInRefundTransactions.ToString("#,##0.00"));
            dt.Rows.Add("Out Of Stock Trans", ":", mclsDetails.NoOfOutOfStockRefundTransactions.ToString("#,##0.00"));
            // 25Feb2015 : End of lines

            string strReportFooter1 = clsReceipt.Details("ReportFooter1").Value;
            string strReportFooter2 = clsReceipt.Details("ReportFooter2").Value;
            string strReportFooter3 = clsReceipt.Details("ReportFooter3").Value;
            if (!string.IsNullOrEmpty(strReportFooter1)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter1), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter2)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter2), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter3)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter3), mclsTerminalDetails.MaxReceiptWidth));

            clsReceipt.CommitAndDispose();

            dgvItems.MultiSelect = true;
            dgvItems.AutoGenerateColumns = true;
            dgvItems.AutoSize = true;
            dgvItems.ScrollBars = ScrollBars.Vertical;
            dgvItems.DataSource = dt.TableName;
            dgvItems.DataSource = dt;
            
            //dgvItems.Columns["ReportValue"].Visible = true;
            //dgvItems.Columns["ReportValue"].HeaderText = "";
            //dgvItems.Columns["ReportValue"].Width = 388;

            dgvItems.Columns["Module"].Visible = true;
            dgvItems.Columns["Separator"].Visible = true;
            dgvItems.Columns["Value"].Visible = true;

            dgvItems.Columns["Module"].HeaderText = "";
            dgvItems.Columns["Separator"].HeaderText = "";
            dgvItems.Columns["Value"].HeaderText = "";

            dgvItems.Columns["Module"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            dgvItems.Columns["Separator"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvItems.Columns["Value"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvItems.Columns["Module"].Width = 230;
            dgvItems.Columns["Separator"].Width = 20;
            dgvItems.Columns["Value"].Width = dgvItems.Width - 250 - 20;

        }
Ejemplo n.º 14
0
        private void PopulateGroupReport()
        {
            Receipt clsReceipt = new Receipt();
            
            // disabled the trustfund
            mTerminalReportDetails.TrustFund = 0;

            mclsTerminalDetails.MaxReceiptWidth = 94;

            System.Data.DataTable dt = new System.Data.DataTable("tblGroupReport");
            dt.Columns.Add("Module");
            dt.Columns.Add("Separator");
            dt.Columns.Add("Value");
            dt.Columns.Add("Prcntg");

            decimal TotalTranCount = 0;
            decimal TotalAmount = 0;
            try
            {
                foreach (System.Data.DataRow dr in mdtGroupReport.Rows)
                {
                    string ProductGroup = dr["ProductGroup"].ToString();
                    string TranCount = Convert.ToDecimal(dr["TranCount"].ToString()).ToString("#,##0");
                    string Amount = Convert.ToDecimal(dr["Amount"].ToString()).ToString("#,##0.#0");
                    string Percentage = dr["Percentage"].ToString();

                    TotalTranCount += decimal.Parse(Math.Round(Convert.ToDecimal(TranCount) * ((100 - mTerminalReportDetails.TrustFund) / 100), 2).ToString());
                    TotalAmount += decimal.Parse(Math.Round(Convert.ToDecimal(Amount) * ((100 - mTerminalReportDetails.TrustFund) / 100), 2).ToString());
                    dt.Rows.Add(ProductGroup, TranCount, Amount, Percentage);
                }
            }
            catch { }
            dt.Rows.Add("Total", TotalTranCount.ToString("#,##0.#0"), "", TotalAmount.ToString("#,##0.#0"));
            dt.Rows.Add("(+) Items Disc/VatE", ":", "", ((mTerminalReportDetails.GrossSales - TotalAmount) * ((100 - mTerminalReportDetails.TrustFund) / 100)).ToString("#,##0.#0"));
            dt.Rows.Add("-----------------------------------", "--", "----------", "----------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 80, '-'));
            dt.Rows.Add("Gross Sales", ":", "", ((mTerminalReportDetails.GrossSales + mTerminalReportDetails.TotalCharge) * ((100 - mTerminalReportDetails.TrustFund) / 100)).ToString("#,##0.#0"));
            dt.Rows.Add("(-) Service Charge", ":", "", mTerminalReportDetails.TotalCharge.ToString("#,##0.#0"));
            dt.Rows.Add("-----------------------------------", "--", "----------", "----------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 80, '-'));
            dt.Rows.Add("Total Amount", ":", "", (mTerminalReportDetails.GrossSales * ((100 - mTerminalReportDetails.TrustFund) / 100)).ToString("#,##0.#0"));
            dt.Rows.Add("(-) " + mclsTerminalDetails.VAT.ToString("##") + "% VAT Exempt ", ":", "", (mTerminalReportDetails.VATExempt * (mclsTerminalDetails.VAT / 100) * ((100 - mTerminalReportDetails.TrustFund) / 100)).ToString("#,##0.#0"));
            dt.Rows.Add("(-) Discount", ":", "", (mTerminalReportDetails.SubTotalDiscount + mTerminalReportDetails.ItemsDiscount).ToString("#,##0.#0"));
            dt.Rows.Add("-----------------------------------", "--", "----------", "----------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 80, '-'));
            dt.Rows.Add("Net Sales", ":", "", (mTerminalReportDetails.NetSales * ((100 - mTerminalReportDetails.TrustFund) / 100)).ToString("#,##0.#0"));

            string strReportFooter1 = clsReceipt.Details("ReportFooter1").Value;
            string strReportFooter2 = clsReceipt.Details("ReportFooter2").Value;
            string strReportFooter3 = clsReceipt.Details("ReportFooter3").Value;
            if (!string.IsNullOrEmpty(strReportFooter1)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter1), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter2)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter2), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter3)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter3), mclsTerminalDetails.MaxReceiptWidth));

            clsReceipt.CommitAndDispose();

            dgvItems.MultiSelect = true;
            dgvItems.AutoGenerateColumns = true;
            dgvItems.AutoSize = true;
            dgvItems.ScrollBars = ScrollBars.Vertical;
            dgvItems.DataSource = dt.TableName;
            dgvItems.DataSource = dt;

            //dgvItems.Columns["ReportValue"].Visible = true;
            //dgvItems.Columns["ReportValue"].HeaderText = "";
            //dgvItems.Columns["ReportValue"].Width = 388;

            dgvItems.Columns["Module"].Visible = true;
            dgvItems.Columns["Separator"].Visible = true;
            dgvItems.Columns["Value"].Visible = true;
            dgvItems.Columns["Prcntg"].Visible = true;

            dgvItems.Columns["Module"].HeaderText = "Group";
            dgvItems.Columns["Separator"].HeaderText = "Qty";
            dgvItems.Columns["Value"].HeaderText = "Amount";
            dgvItems.Columns["Prcntg"].HeaderText = "Prcntg.";

            dgvItems.Columns["Module"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            dgvItems.Columns["Separator"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            dgvItems.Columns["Value"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
            dgvItems.Columns["Prcntg"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvItems.Columns["Module"].Width = 200;
            dgvItems.Columns["Separator"].Width = 40;
            dgvItems.Columns["Value"].Width = (dgvItems.Width - 220 - 40) / 2;
            dgvItems.Columns["Prcntg"].Width = (dgvItems.Width - 220 - 40) / 2;

        }
Ejemplo n.º 15
0
        private void PopulateTerminalReport1()
        {
            mclsTerminalDetails.MaxReceiptWidth = 94;

            System.Data.DataTable dt = new System.Data.DataTable("tblTerminalReport");
            dt.Columns.Add("Module");
            dt.Columns.Add("Separator");
            dt.Columns.Add("Value");

            //dt.Rows.Add(CenterString(CompanyDetails.CompanyCode, mclsTerminalDetails.MaxReceiptWidth));
            //dt.Rows.Add("-".PadRight(mclsTerminalDetails.MaxReceiptWidth, '-'));
            //dt.Rows.Add(CenterString("Terminal Report", mclsTerminalDetails.MaxReceiptWidth));
            //dt.Rows.Add("-".PadRight(mclsTerminalDetails.MaxReceiptWidth, '-'));

            Receipt clsReceipt = new Receipt();

            //string strReportHeader1 = clsReceipt.Details("ReportHeader1").Value;
            //string strReportHeader2 = clsReceipt.Details("ReportHeader2").Value;
            //string strReportHeader3 = clsReceipt.Details("ReportHeader3").Value;
            //string strReportHeader4 = clsReceipt.Details("ReportHeader4").Value;
            //if (!string.IsNullOrEmpty(strReportHeader1)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader1), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader2)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader2), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader3)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader3), mclsTerminalDetails.MaxReceiptWidth));
            //if (!string.IsNullOrEmpty(strReportHeader4)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportHeader4), mclsTerminalDetails.MaxReceiptWidth));

            dt.Rows.Add("Beginning OR No.", ":" , mDetails.BeginningORNo);
            string strEndingORNo = (Int64.Parse(mDetails.EndingORNo) - 1).ToString().PadLeft(mDetails.BeginningORNo.Length, '0');
            dt.Rows.Add("Ending OR No.", ":", strEndingORNo);

            dt.Rows.Add("Gross Sales",":", (mDetails.GrossSales + mDetails.TotalCharge).ToString("#,##0.#0"));
            dt.Rows.Add("(-) Service Charge", ":", mDetails.TotalCharge.ToString("#,##0.#0"));
            dt.Rows.Add("",":","------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("Total Amount", ":", mDetails.GrossSales.ToString("#,##0.#0"));

            dt.Rows.Add("-", "-", "-");
            dt.Rows.Add("OLD GRAND TOTAL", ":", mDetails.OldGrandTotal.ToString("#,##0.#0"));
            dt.Rows.Add("This Total Amount", ":", mDetails.GrossSales.ToString("#,##0.#0"));
            dt.Rows.Add("", ":", "------------".PadLeft(mclsTerminalDetails.MaxReceiptWidth - 66, '-'));
            dt.Rows.Add("NEW GRAND TOTAL", ":", mDetails.NewGrandTotal.ToString("#,##0.#0"));

            string strReportFooter1 = clsReceipt.Details("ReportFooter1").Value;
            string strReportFooter2 = clsReceipt.Details("ReportFooter2").Value;
            string strReportFooter3 = clsReceipt.Details("ReportFooter3").Value;
            if (!string.IsNullOrEmpty(strReportFooter1)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter1), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter2)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter2), mclsTerminalDetails.MaxReceiptWidth));
            if (!string.IsNullOrEmpty(strReportFooter3)) dt.Rows.Add(CenterString(GetReceiptFormatParameter(strReportFooter3), mclsTerminalDetails.MaxReceiptWidth));

            clsReceipt.CommitAndDispose();

            dgvItems.MultiSelect = true;
            dgvItems.AutoGenerateColumns = true;
            dgvItems.AutoSize = true;
            dgvItems.DataSource = dt.TableName;
            dgvItems.DataSource = dt;
            
            //dgvItems.Columns["ReportValue"].Visible = true;
            //dgvItems.Columns["ReportValue"].HeaderText = "";
            //dgvItems.Columns["ReportValue"].Width = 388;

            dgvItems.Columns["Module"].Visible = true;
            dgvItems.Columns["Separator"].Visible = true;
            dgvItems.Columns["Value"].Visible = true;

            dgvItems.Columns["Module"].HeaderText = "";
            dgvItems.Columns["Separator"].HeaderText = "";
            dgvItems.Columns["Value"].HeaderText = "";

            dgvItems.Columns["Module"].Width = 230;
            dgvItems.Columns["Separator"].Width = 20;
            dgvItems.Columns["Value"].Width = 138;


            lblTaxableAmount.Text = Convert.ToDecimal(mDetails.VATableAmount).ToString("#,##0.00");
            lblNonTaxableAmount.Text = Convert.ToDecimal(mDetails.NonVATableAmount).ToString("#,##0.00");
            lblVAT1.Text = Convert.ToDecimal(mDetails.VAT).ToString("#,##0.#0");
            lblLocalTax.Text = Convert.ToDecimal(mDetails.LocalTax).ToString("#,##0.#0");

            lblCashSales.Text = Convert.ToDecimal(mDetails.CashSales).ToString("#,##0.#0");
            lblChequeSales.Text = Convert.ToDecimal(mDetails.ChequeSales).ToString("#,##0.#0");
            lblCreditCardSales.Text = Convert.ToDecimal(mDetails.CreditCardSales).ToString("#,##0.#0");
            lblCreditSales.Text = Convert.ToDecimal(mDetails.CreditSales).ToString("#,##0.#0");
            lblCreditPayment.Text = Convert.ToDecimal(mDetails.CreditPayment).ToString("#,##0.#0");

            // Apr 12, 2014 added the breakdown
            lblCreditPaymentCash.Text = Convert.ToDecimal(mDetails.CreditPaymentCash).ToString("#,##0.#0");
            lblCreditPaymentCheque.Text = Convert.ToDecimal(mDetails.CreditPaymentCheque).ToString("#,##0.#0");
            lblCreditPaymentCreditCard.Text = Convert.ToDecimal(mDetails.CreditPaymentCreditCard).ToString("#,##0.#0");
            lblCreditPaymentDebit.Text = Convert.ToDecimal(mDetails.CreditPaymentDebit).ToString("#,##0.#0");

            lblDebitPayment.Text = Convert.ToDecimal(mDetails.DebitPayment).ToString("#,##0.#0");
            lblVoidSales.Text = Convert.ToDecimal(mDetails.VoidSales).ToString("#,##0.#0");
            lblRefundSales.Text = Convert.ToDecimal(mDetails.RefundSales).ToString("#,##0.#0");

            lblItemsDiscount.Text = Convert.ToDecimal(mDetails.ItemsDiscount).ToString("#,##0.#0");
            lblSubtotalDiscount.Text = Convert.ToDecimal(mDetails.SubTotalDiscount).ToString("#,##0.#0");
            lblTotalDiscounts.Text = Convert.ToDecimal(mDetails.TotalDiscount).ToString("#,##0.#0");

            lblBeginningBalance.Text = Convert.ToDecimal(mDetails.BeginningBalance).ToString("#,##0.#0");
            lblCashInDrawer.Text = Convert.ToDecimal(mDetails.CashInDrawer).ToString("#,##0.#0");

            lblPaidOut.Text = Convert.ToDecimal(mDetails.TotalPaidOut).ToString("#,##0.#0");
            lblCashDisburse.Text = Convert.ToDecimal(mDetails.CashDisburse).ToString("#,##0.#0");
            lblChequeDisburse.Text = Convert.ToDecimal(mDetails.ChequeDisburse).ToString("#,##0.#0");
            lblCreditCardDisburse.Text = Convert.ToDecimal(mDetails.CreditCardDisburse).ToString("#,##0.#0");

            lblCashWithHold.Text = Convert.ToDecimal(mDetails.CashWithHold).ToString("#,##0.#0");
            lblChequeWithHold.Text = Convert.ToDecimal(mDetails.ChequeWithHold).ToString("#,##0.#0");
            lblCreditCardWithHold.Text = Convert.ToDecimal(mDetails.CreditCardWithHold).ToString("#,##0.#0");

            lblCashDeposit.Text = Convert.ToDecimal(mDetails.CashDeposit).ToString("#,##0.#0");
            lblChequeDeposit.Text = Convert.ToDecimal(mDetails.ChequeDeposit).ToString("#,##0.#0");
            lblCreditCardDeposit.Text = Convert.ToDecimal(mDetails.CreditCardDeposit).ToString("#,##0.#0");

            //lblGrossSales.Text = Convert.ToDecimal(mDetails.GrossSales - (mDetails.GrossSales * (mTrustFund / 100))).ToString("#,##0.00");
            //lblTotalDiscount.Text = Convert.ToDecimal(mDetails.TotalDiscount - (mDetails.TotalDiscount * (mTrustFund / 100))).ToString("#,##0.00");

            //lblNetSales.Text = Convert.ToDecimal(mDetails.DailySales - (mDetails.DailySales * (mTrustFund / 100))).ToString("#,##0.00");
            //lblVAT.Text = Convert.ToDecimal(mDetails.VAT - (mDetails.VAT * (mTrustFund / 100))).ToString("#,##0.00");
            //lblCharge.Text = Convert.ToDecimal(mDetails.TotalCharge - (mDetails.TotalCharge * (mTrustFund / 100))).ToString("#,##0.00");
            //decimal TotalAmount = mDetails.DailySales + mDetails.VAT + mDetails.EVAT + mDetails.LocalTax + mDetails.TotalCharge;
            //lblTotalAmount.Text = Convert.ToDecimal(TotalAmount - (TotalAmount * (mTrustFund / 100))).ToString("#,##0.00");

            //lblOldGrandTotal.Text = Convert.ToDecimal(mDetails.OldGrandTotal - (mDetails.OldGrandTotal * (mTrustFund / 100))).ToString("#,##0.00");
            //lblDailySales.Text = Convert.ToDecimal(TotalAmount - (TotalAmount * (mTrustFund / 100))).ToString("#,##0.00");
            //lblNewGrandTotal.Text = Convert.ToDecimal(mDetails.NewGrandTotal - (mDetails.NewGrandTotal * (mTrustFund / 100))).ToString("#,##0.00");

            //lblTaxableAmount.Text = Convert.ToDecimal(mDetails.VATableAmount - (mDetails.VATableAmount * (mTrustFund / 100))).ToString("#,##0.00");
            //lblNonTaxableAmount.Text = Convert.ToDecimal(mDetails.NonVaTableAmount - (mDetails.NonVaTableAmount * (mTrustFund / 100))).ToString("#,##0.00");
            //lblVAT1.Text = Convert.ToDecimal(mDetails.VAT - (mDetails.VAT * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblLocalTax.Text = Convert.ToDecimal(mDetails.LocalTax - (mDetails.LocalTax * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblCashSales.Text = Convert.ToDecimal(mDetails.CashSales - (mDetails.CashSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeSales.Text = Convert.ToDecimal(mDetails.ChequeSales - (mDetails.ChequeSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardSales.Text = Convert.ToDecimal(mDetails.CreditCardSales - (mDetails.CreditCardSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditSales.Text = Convert.ToDecimal(mDetails.CreditSales - (mDetails.CreditSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditPayment.Text = Convert.ToDecimal(mDetails.CreditPayment - (mDetails.CreditPayment * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblDebitPayment.Text = Convert.ToDecimal(mDetails.DebitPayment - (mDetails.DebitPayment * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblVoidSales.Text = Convert.ToDecimal(mDetails.VoidSales - (mDetails.VoidSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblRefundSales.Text = Convert.ToDecimal(mDetails.RefundSales - (mDetails.RefundSales * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblItemsDiscount.Text = Convert.ToDecimal(mDetails.ItemsDiscount - (mDetails.ItemsDiscount * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblSubtotalDiscount.Text = Convert.ToDecimal(mDetails.SubTotalDiscount - (mDetails.SubTotalDiscount * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblTotalDiscounts.Text = Convert.ToDecimal(mDetails.TotalDiscount - (mDetails.TotalDiscount * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblBeginningBalance.Text = Convert.ToDecimal(mDetails.BeginningBalance - (mDetails.BeginningBalance * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCashInDrawer.Text = Convert.ToDecimal(mDetails.CashInDrawer - (mDetails.CashInDrawer * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblPaidOut.Text = Convert.ToDecimal(mDetails.TotalPaidOut - (mDetails.TotalPaidOut * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCashDisburse.Text = Convert.ToDecimal(mDetails.CashDisburse - (mDetails.CashDisburse * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeDisburse.Text = Convert.ToDecimal(mDetails.ChequeDisburse - (mDetails.ChequeDisburse * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardDisburse.Text = Convert.ToDecimal(mDetails.CreditCardDisburse - (mDetails.CreditCardDisburse * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblCashWithHold.Text = Convert.ToDecimal(mDetails.CashWithHold - (mDetails.CashWithHold * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeWithHold.Text = Convert.ToDecimal(mDetails.ChequeWithHold - (mDetails.ChequeWithHold * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardWithHold.Text = Convert.ToDecimal(mDetails.CreditCardWithHold - (mDetails.CreditCardWithHold * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblCashDeposit.Text = Convert.ToDecimal(mDetails.CashDeposit - (mDetails.CashDeposit * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeDeposit.Text = Convert.ToDecimal(mDetails.ChequeDeposit - (mDetails.ChequeDeposit * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardDeposit.Text = Convert.ToDecimal(mDetails.CreditCardDeposit - (mDetails.CreditCardDeposit * (mTrustFund / 100))).ToString("#,##0.#0");

            lblNoOfCashTransactions.Text = mDetails.NoOfCashTransactions.ToString("#,##0");
            lblNoOfChequeTransactions.Text = mDetails.NoOfChequeTransactions.ToString("#,##0");
            lblNoOfCreditCardTran.Text = mDetails.NoOfCreditCardTransactions.ToString("#,##0");
            lblNoOfCreditTran.Text = mDetails.NoOfCreditTransactions.ToString("#,##0");
            lblNoOfCombPayTran.Text = mDetails.NoOfCombinationPaymentTransactions.ToString("#,##0");
            lblNoOfCreditPaymentTran.Text = mDetails.NoOfCreditPaymentTransactions.ToString("#,##0");
            lblNoOfDebitPaymentTransactions.Text = mDetails.NoOfDebitPaymentTransactions.ToString("#,##0");
            lblNoOfRefundTransactions.Text = mDetails.NoOfRefundTransactions.ToString("#,##0");
            lblNoOfVoidTransactions.Text = mDetails.NoOfVoidTransactions.ToString("#,##0");
            lblNoOfTotalTransactions.Text = mDetails.NoOfTotalTransactions.ToString("#,##0");

            

        }
Ejemplo n.º 16
0
        private void PopulateHourlyReport()
        {
            lblCompany.Text = CompanyDetails.CompanyCode;

            Receipt clsReceipt = new Receipt();

            lblReportHeader1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader1").Value);
            lblReportHeader2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader2").Value);
            lblReportHeader3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader3").Value);
            lblReportHeader4.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader4").Value);

            this.dgStyle.MappingName = mdtHourlyReport.TableName;
            dgHourlyReport.DataSource = mdtHourlyReport;
            decimal TotalTranCount = 0;
            decimal TotalAmount = 0;
            decimal TotalDiscount = 0;
            try
            {
                dgHourlyReport.Select(0);
                foreach (System.Data.DataRow dr in mdtHourlyReport.Rows)
                {
                    TotalTranCount += Convert.ToDecimal(dr["TranCount"]);
                    TotalAmount += Convert.ToDecimal(dr["Amount"]);
                    TotalDiscount += Convert.ToDecimal(dr["Discount"]);
                }
            }
            catch { }
            lblTotalTran.Text = TotalTranCount.ToString("#,##0");
            lblTotalAmount.Text = TotalAmount.ToString("#,##0.#0");
            lblTotalDiscount.Text = TotalDiscount.ToString("#,##0.#0");

            lblReportFooter1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter1").Value);
            lblReportFooter2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter2").Value);
            lblReportFooter3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter3").Value);

            clsReceipt.CommitAndDispose();

        }
Ejemplo n.º 17
0
        private void PopulateTerminalReport()
        {
            lblCompany.Text = CompanyDetails.CompanyCode;

            Receipt clsReceipt = new Receipt();

            lblReportHeader1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader1").Value);
            lblReportHeader2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader2").Value);
            lblReportHeader3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader3").Value);
            lblReportHeader4.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader4").Value);

            lblBeginningTransactionNo.Text = mDetails.BeginningORNo;
            lblEndingTransactionNo.Text = mDetails.EndingORNo;

            lblGrossSales.Text = Convert.ToDecimal(mDetails.GrossSales).ToString("#,##0.00");
            lblTotalDiscount.Text = Convert.ToDecimal(mDetails.TotalDiscount).ToString("#,##0.00");

            lblNetSales.Text = Convert.ToDecimal(mDetails.DailySales).ToString("#,##0.00");
            lblVAT.Text = Convert.ToDecimal(mDetails.VAT).ToString("#,##0.00");
            lblCharge.Text = Convert.ToDecimal(mDetails.TotalCharge).ToString("#,##0.00");
            decimal TotalAmount = mDetails.DailySales + mDetails.VAT + mDetails.EVAT + mDetails.LocalTax + mDetails.TotalCharge;
            lblTotalAmount.Text = Convert.ToDecimal(TotalAmount).ToString("#,##0.00");

            lblOldGrandTotal.Text = Convert.ToDecimal(mDetails.OldGrandTotal - (mDetails.OldGrandTotal * (mTrustFund / 100))).ToString("#,##0.00");
            lblDailySales.Text = Convert.ToDecimal(TotalAmount).ToString("#,##0.00");
            lblNewGrandTotal.Text = Convert.ToDecimal((mDetails.OldGrandTotal - (mDetails.OldGrandTotal * (mTrustFund / 100))) + TotalAmount).ToString("#,##0.00");

            lblTaxableAmount.Text = Convert.ToDecimal(mDetails.VATableAmount).ToString("#,##0.00");
            lblNonTaxableAmount.Text = Convert.ToDecimal(mDetails.NonVATableAmount).ToString("#,##0.00");
            lblVAT1.Text = Convert.ToDecimal(mDetails.VAT).ToString("#,##0.#0");
            lblLocalTax.Text = Convert.ToDecimal(mDetails.LocalTax).ToString("#,##0.#0");

            lblCashSales.Text = Convert.ToDecimal(mDetails.CashSales).ToString("#,##0.#0");
            lblChequeSales.Text = Convert.ToDecimal(mDetails.ChequeSales).ToString("#,##0.#0");
            lblCreditCardSales.Text = Convert.ToDecimal(mDetails.CreditCardSales).ToString("#,##0.#0");
            lblCreditSales.Text = Convert.ToDecimal(mDetails.CreditSales).ToString("#,##0.#0");
            lblCreditPayment.Text = Convert.ToDecimal(mDetails.CreditPayment).ToString("#,##0.#0");

            // Apr 12, 2014 added the breakdown
            lblCreditPaymentCash.Text = Convert.ToDecimal(mDetails.CreditPaymentCash).ToString("#,##0.#0");
            lblCreditPaymentCheque.Text = Convert.ToDecimal(mDetails.CreditPaymentCheque).ToString("#,##0.#0");
            lblCreditPaymentCreditCard.Text = Convert.ToDecimal(mDetails.CreditPaymentCreditCard).ToString("#,##0.#0");
            lblCreditPaymentDebit.Text = Convert.ToDecimal(mDetails.CreditPaymentDebit).ToString("#,##0.#0");

            lblDebitPayment.Text = Convert.ToDecimal(mDetails.DebitPayment).ToString("#,##0.#0");
            lblVoidSales.Text = Convert.ToDecimal(mDetails.VoidSales).ToString("#,##0.#0");
            lblRefundSales.Text = Convert.ToDecimal(mDetails.RefundSales).ToString("#,##0.#0");

            lblItemsDiscount.Text = Convert.ToDecimal(mDetails.ItemsDiscount).ToString("#,##0.#0");
            lblSubtotalDiscount.Text = Convert.ToDecimal(mDetails.SubTotalDiscount).ToString("#,##0.#0");
            lblTotalDiscounts.Text = Convert.ToDecimal(mDetails.TotalDiscount).ToString("#,##0.#0");

            lblBeginningBalance.Text = Convert.ToDecimal(mDetails.BeginningBalance).ToString("#,##0.#0");
            lblCashInDrawer.Text = Convert.ToDecimal(mDetails.CashInDrawer).ToString("#,##0.#0");

            lblPaidOut.Text = Convert.ToDecimal(mDetails.TotalPaidOut).ToString("#,##0.#0");
            lblCashDisburse.Text = Convert.ToDecimal(mDetails.CashDisburse).ToString("#,##0.#0");
            lblChequeDisburse.Text = Convert.ToDecimal(mDetails.ChequeDisburse).ToString("#,##0.#0");
            lblCreditCardDisburse.Text = Convert.ToDecimal(mDetails.CreditCardDisburse).ToString("#,##0.#0");

            lblCashWithHold.Text = Convert.ToDecimal(mDetails.CashWithHold).ToString("#,##0.#0");
            lblChequeWithHold.Text = Convert.ToDecimal(mDetails.ChequeWithHold).ToString("#,##0.#0");
            lblCreditCardWithHold.Text = Convert.ToDecimal(mDetails.CreditCardWithHold).ToString("#,##0.#0");

            lblCashDeposit.Text = Convert.ToDecimal(mDetails.CashDeposit).ToString("#,##0.#0");
            lblChequeDeposit.Text = Convert.ToDecimal(mDetails.ChequeDeposit).ToString("#,##0.#0");
            lblCreditCardDeposit.Text = Convert.ToDecimal(mDetails.CreditCardDeposit).ToString("#,##0.#0");

            //lblGrossSales.Text = Convert.ToDecimal(mDetails.GrossSales - (mDetails.GrossSales * (mTrustFund / 100))).ToString("#,##0.00");
            //lblTotalDiscount.Text = Convert.ToDecimal(mDetails.TotalDiscount - (mDetails.TotalDiscount * (mTrustFund / 100))).ToString("#,##0.00");

            //lblNetSales.Text = Convert.ToDecimal(mDetails.DailySales - (mDetails.DailySales * (mTrustFund / 100))).ToString("#,##0.00");
            //lblVAT.Text = Convert.ToDecimal(mDetails.VAT - (mDetails.VAT * (mTrustFund / 100))).ToString("#,##0.00");
            //lblCharge.Text = Convert.ToDecimal(mDetails.TotalCharge - (mDetails.TotalCharge * (mTrustFund / 100))).ToString("#,##0.00");
            //decimal TotalAmount = mDetails.DailySales + mDetails.VAT + mDetails.EVAT + mDetails.LocalTax + mDetails.TotalCharge;
            //lblTotalAmount.Text = Convert.ToDecimal(TotalAmount - (TotalAmount * (mTrustFund / 100))).ToString("#,##0.00");

            //lblOldGrandTotal.Text = Convert.ToDecimal(mDetails.OldGrandTotal - (mDetails.OldGrandTotal * (mTrustFund / 100))).ToString("#,##0.00");
            //lblDailySales.Text = Convert.ToDecimal(TotalAmount - (TotalAmount * (mTrustFund / 100))).ToString("#,##0.00");
            //lblNewGrandTotal.Text = Convert.ToDecimal(mDetails.NewGrandTotal - (mDetails.NewGrandTotal * (mTrustFund / 100))).ToString("#,##0.00");

            //lblTaxableAmount.Text = Convert.ToDecimal(mDetails.VATableAmount - (mDetails.VATableAmount * (mTrustFund / 100))).ToString("#,##0.00");
            //lblNonTaxableAmount.Text = Convert.ToDecimal(mDetails.NonVaTableAmount - (mDetails.NonVaTableAmount * (mTrustFund / 100))).ToString("#,##0.00");
            //lblVAT1.Text = Convert.ToDecimal(mDetails.VAT - (mDetails.VAT * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblLocalTax.Text = Convert.ToDecimal(mDetails.LocalTax - (mDetails.LocalTax * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblCashSales.Text = Convert.ToDecimal(mDetails.CashSales - (mDetails.CashSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeSales.Text = Convert.ToDecimal(mDetails.ChequeSales - (mDetails.ChequeSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardSales.Text = Convert.ToDecimal(mDetails.CreditCardSales - (mDetails.CreditCardSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditSales.Text = Convert.ToDecimal(mDetails.CreditSales - (mDetails.CreditSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditPayment.Text = Convert.ToDecimal(mDetails.CreditPayment - (mDetails.CreditPayment * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblDebitPayment.Text = Convert.ToDecimal(mDetails.DebitPayment - (mDetails.DebitPayment * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblVoidSales.Text = Convert.ToDecimal(mDetails.VoidSales - (mDetails.VoidSales * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblRefundSales.Text = Convert.ToDecimal(mDetails.RefundSales - (mDetails.RefundSales * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblItemsDiscount.Text = Convert.ToDecimal(mDetails.ItemsDiscount - (mDetails.ItemsDiscount * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblSubtotalDiscount.Text = Convert.ToDecimal(mDetails.SubTotalDiscount - (mDetails.SubTotalDiscount * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblTotalDiscounts.Text = Convert.ToDecimal(mDetails.TotalDiscount - (mDetails.TotalDiscount * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblBeginningBalance.Text = Convert.ToDecimal(mDetails.BeginningBalance - (mDetails.BeginningBalance * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCashInDrawer.Text = Convert.ToDecimal(mDetails.CashInDrawer - (mDetails.CashInDrawer * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblPaidOut.Text = Convert.ToDecimal(mDetails.TotalPaidOut - (mDetails.TotalPaidOut * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCashDisburse.Text = Convert.ToDecimal(mDetails.CashDisburse - (mDetails.CashDisburse * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeDisburse.Text = Convert.ToDecimal(mDetails.ChequeDisburse - (mDetails.ChequeDisburse * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardDisburse.Text = Convert.ToDecimal(mDetails.CreditCardDisburse - (mDetails.CreditCardDisburse * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblCashWithHold.Text = Convert.ToDecimal(mDetails.CashWithHold - (mDetails.CashWithHold * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeWithHold.Text = Convert.ToDecimal(mDetails.ChequeWithHold - (mDetails.ChequeWithHold * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardWithHold.Text = Convert.ToDecimal(mDetails.CreditCardWithHold - (mDetails.CreditCardWithHold * (mTrustFund / 100))).ToString("#,##0.#0");

            //lblCashDeposit.Text = Convert.ToDecimal(mDetails.CashDeposit - (mDetails.CashDeposit * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblChequeDeposit.Text = Convert.ToDecimal(mDetails.ChequeDeposit - (mDetails.ChequeDeposit * (mTrustFund / 100))).ToString("#,##0.#0");
            //lblCreditCardDeposit.Text = Convert.ToDecimal(mDetails.CreditCardDeposit - (mDetails.CreditCardDeposit * (mTrustFund / 100))).ToString("#,##0.#0");

            lblNoOfCashTransactions.Text = mDetails.NoOfCashTransactions.ToString("#,##0");
            lblNoOfChequeTransactions.Text = mDetails.NoOfChequeTransactions.ToString("#,##0");
            lblNoOfCreditCardTran.Text = mDetails.NoOfCreditCardTransactions.ToString("#,##0");
            lblNoOfCreditTran.Text = mDetails.NoOfCreditTransactions.ToString("#,##0");
            lblNoOfCombPayTran.Text = mDetails.NoOfCombinationPaymentTransactions.ToString("#,##0");
            lblNoOfCreditPaymentTran.Text = mDetails.NoOfCreditPaymentTransactions.ToString("#,##0");
            lblNoOfDebitPaymentTransactions.Text = mDetails.NoOfDebitPaymentTransactions.ToString("#,##0");
            lblNoOfRefundTransactions.Text = mDetails.NoOfRefundTransactions.ToString("#,##0");
            lblNoOfVoidTransactions.Text = mDetails.NoOfVoidTransactions.ToString("#,##0");
            lblNoOfTotalTransactions.Text = mDetails.NoOfTotalTransactions.ToString("#,##0");

            lblReportFooter1.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter1").Value);
            lblReportFooter2.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter2").Value);
            lblReportFooter3.Text = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter3").Value);

            clsReceipt.CommitAndDispose();

        }
Ejemplo n.º 18
0
		private void SetParameters (ReportDocument Report)
		{
			ParameterFieldDefinition paramField;
			ParameterValues currentValues;
			ParameterDiscreteValue discreteParam;

			paramField = Report.DataDefinition.ParameterFields["CompanyName"];
			discreteParam = new ParameterDiscreteValue();
			discreteParam.Value = CompanyDetails.CompanyName;
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

            Receipt clsReceipt = new Receipt();

			paramField = Report.DataDefinition.ParameterFields["ReportHeader1"];
			discreteParam = new ParameterDiscreteValue();
            discreteParam.Value = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader1").Value);
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

			paramField = Report.DataDefinition.ParameterFields["ReportHeader2"];
			discreteParam = new ParameterDiscreteValue();
            discreteParam.Value = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader2").Value);
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

			paramField = Report.DataDefinition.ParameterFields["ReportHeader3"];
			discreteParam = new ParameterDiscreteValue();
            discreteParam.Value = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader3").Value);
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

			paramField = Report.DataDefinition.ParameterFields["ReportHeader4"];
			discreteParam = new ParameterDiscreteValue();
            discreteParam.Value = GetReceiptFormatParameter(clsReceipt.Details("ReportHeader4").Value);
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

			/**** Set the report footer ****/
			paramField = Report.DataDefinition.ParameterFields["ReportFooter1"];
			discreteParam = new ParameterDiscreteValue();
            discreteParam.Value = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter1").Value);
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

			paramField = Report.DataDefinition.ParameterFields["ReportFooter2"];
			discreteParam = new ParameterDiscreteValue();
            discreteParam.Value = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter2").Value);
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

			paramField = Report.DataDefinition.ParameterFields["ReportFooter3"];
			discreteParam = new ParameterDiscreteValue();
			discreteParam.Value = GetReceiptFormatParameter(clsReceipt.Details("ReportFooter3").Value);
			currentValues = new ParameterValues();
			currentValues.Add(discreteParam);
			paramField.ApplyCurrentValues(currentValues);

            clsReceipt.CommitAndDispose();

		}