Example #1
0
        private void LoadWeeklyReportDetail()
        {
            pDetail.Controls.Clear();
            UCDailySaleSumaryReport ucDailyReport = new UCDailySaleSumaryReport();

            ucDailyReport.Dock = DockStyle.Fill;

            var dateselect = Convert.ToDateTime(dateSelect.Text).ToString("yyyy-MM-dd");

            var data = ReportService.GetDataSummaryReport(dateselect, 1).FirstOrDefault();

            if (data != null)
            {
                SetDataSummary(ucDailyReport, data);
            }


            pDetail.Controls.Add(ucDailyReport);
        }
Example #2
0
        public void SetDataSummary(UCDailySaleSumaryReport ucDailyReport, DailyReportModel data)
        {
            var fomat = new MoneyFortmat(1);

            ucDailyReport.lblNetSalse.Text = fomat.getValue(data.NetSale).ToString("C");
            Double gst = Convert.ToDouble(data.NetSale) / 11000;

            if (gst < 1)
            {
                ucDailyReport.lblGST.Text = "$0" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }
            else
            {
                ucDailyReport.lblGST.Text = "$" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }

            ucDailyReport.lblDiscount.Text     = fomat.getValue(data.Discount).ToString("C");
            ucDailyReport.lblRefund.Text       = fomat.getValue(data.Refund).ToString("C");
            ucDailyReport.lblTotakReceiva.Text = "$" +
                                                 fomat.getValue(data.NetSale + data.GST - data.Discount).ToString("N2");
            ucDailyReport.lblTotakCash.Text    = "$" + fomat.getValue(data.CashTotal).ToString("N2");
            ucDailyReport.lblTotalCard.Text    = fomat.getValue(data.CardTotal).ToString("C");
            ucDailyReport.lblTotalAccount.Text = fomat.getValue(data.AccountTotal).ToString("C");

            var export = new List <ExportExcelToDataTable>();

            var temp1 = new ExportExcelToDataTable();

            temp1.Tilte = "Net Sale";
            temp1.Value = "$" + fomat.getValue(data.NetSale).ToString("N2");
            export.Add(temp1);

            var temp2 = new ExportExcelToDataTable();

            temp2.Tilte = "GST";
            if (gst < 1)
            {
                temp2.Value = "$0" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }
            else
            {
                temp2.Value = "$" + money.Format2(Convert.ToDouble(data.NetSale) / 11);
            }

            export.Add(temp2);

            var temp3 = new ExportExcelToDataTable();

            temp3.Tilte = "Discount";
            temp3.Value = "$" + fomat.getValue(data.Discount).ToString("N2");
            export.Add(temp3);

            var temp4 = new ExportExcelToDataTable();

            temp4.Tilte = "Refund";
            temp4.Value = "$" + fomat.getValue(data.Refund).ToString("N2");
            export.Add(temp4);

            var temp5 = new ExportExcelToDataTable();

            temp5.Tilte = "Total Receivable";
            temp5.Value = "$" + fomat.getValue(data.NetSale + data.GST - data.Discount).ToString("N2");
            export.Add(temp5);

            var temp6 = new ExportExcelToDataTable();

            temp6.Tilte = "Total CASH";
            temp6.Value = "$" + fomat.getValue(data.CashTotal).ToString("N2");
            export.Add(temp6);

            var temp7 = new ExportExcelToDataTable();

            temp7.Tilte = "Total CARD";
            temp7.Value = "$" + fomat.getValue(data.CardTotal).ToString("N2");
            export.Add(temp7);

            var temp8 = new ExportExcelToDataTable();

            temp8.Tilte = "Total ACCOUNT";
            temp8.Value = "$" + fomat.getValue(data.AccountTotal).ToString("N2");
            export.Add(temp8);



            ucDailyReport.btnExport.Tag    = export;
            ucDailyReport.btnExport.Click += ExportExcel_Click;

            ucDailyReport.btnPrint.Tag    = export;
            ucDailyReport.btnPrint.Click += PrinterClick_Click;
        }