private void printThanhToan(string invoiceNumber, string tableNumber) { Printer printer = serviceGet.GetPrinterByName(StaticClass.storeId, StaticClass.stationId, "Hóa đơn"); if (!(printer == null || printer.Details == "NONE" || printer.Disable == true)) { Re_ThanhToan xxx = new Re_ThanhToan(); string[] pa = { "@Store_ID", "@Invoice_Number", "table" }; object[] value = { StaticClass.storeId, invoiceNumber, tableNumber }; serviceGet.FillDataReport(xxx, pa, value, true); //xxx.PrintOptions.PrinterName = printer.Details; xxx.PrintOptions.ApplyPageMargins(new PageMargins(1, 2, 1, 0)); Utilities.Utils.Print(xxx, Printer.PrinterHoadon); //try //{ // xxx.PrintToPrinter(1, false, 0, 0); //} //catch (Exception) //{ // Alert.Show("Lỗi máy in", Color.Red); //} //Service.CashdrawerService.OpenCashDrawer1(printer.Details); xxx.Dispose(); } }
private void SendToKitchen() { if (myCash1.listInvoiceItem.Rows.Count > 0) { bool kt = false; foreach (Printer c in serviceGet.getPrinters(StaticClass.storeId, StaticClass.stationId)) { kt = false; if (!c.Disable) { foreach (MyItem c1 in myCash1.get_All_Rows()) { if (!(c1.Mota.StartsWith(">"))) { DataTable inventPrinter = getGui.GetInventPrinter(StaticClass.storeId, myCash1.listInvoiceItem.Rows[c1.Id - 1]["ItemNum"].ToString(), c.PrinterName); if (inventPrinter.Rows.Count > 0) { string lineNum = myCash1.listInvoiceItem.Rows[c1.Id - 1]["LineNum"].ToString(); string itemNum = myCash1.listInvoiceItem.Rows[c1.Id - 1]["ItemNum"].ToString(); string quan = myCash1.listInvoiceItem.Rows[c1.Id - 1]["Quantity"].ToString(); string note = myCash1.listInvoiceItem.Rows[c1.Id - 1]["Kit_ItemNum"].ToString(); string itemname = myCash1.listInvoiceItem.Rows[c1.Id - 1]["DiffItemName"].ToString(); getGui.InsertItemsToPrintToKit(StaticClass.storeId, invoiceNum, lineNum, itemNum, quan, note, itemname); kt = true; } } } if (kt) { rpt_PrintToKit xxx = new rpt_PrintToKit(); xxx.DataSourceConnections[0].SetConnection(StaticClass.serverName, StaticClass.databaseName, true); string[] para = { "@Store_ID", "@Invoice_Number", "@Table" }; string[] value = { StaticClass.storeId, invoiceNum, tableName }; serviceGet.FillDataReport(xxx, para, value, true); xxx.PrintOptions.PrinterName = c.Details; xxx.PrintOptions.ApplyPageMargins(new PageMargins(1, 2, 1, 0)); xxx.PrintToPrinter(1, false, 0, 0); getGui.DeleteItemsPrintToKit(StaticClass.storeId, invoiceNum); } } } } }
private void xemSốTiềnBánTrongNgàyToolStripMenuItem_Click(object sender, EventArgs e) { if (Alert.ShowClockInRequest()) { DateTime DateTime1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); DateTime DateTime2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 23, 59, 59); POSReport.Report.rptDetailSaleReport_2 DetailSaleReport = new rptDetailSaleReport_2(); string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report Title", }; object[] value = { StaticClass.storeId, DateTime1, DateTime2, "C", StaticClass.cashierId, "Báo cáo bán hàng chi tiết trong ngày" }; test.FillDataReport(DetailSaleReport, pa, value, true); ReportClass reportClass = DetailSaleReport; if (reportClass == null) { return; } FrmViewReporting frmViewReporting = new FrmViewReporting(reportClass); frmViewReporting.Show(); } }
private ReportClass ViewReport(int s) { //EnableDateTime(); switch (s) { case 0: { if (DateTime2.Ticks <= DateTime1.Ticks) { Alert.Show("Nhập Ngày Sai.\n Nhập lại ngày", Color.Red); return(null); } string status = ""; if (StatusInvoice == Const.Invoice_Status.THANH_TOAN_ROI) { status = "Hóa đơn thanh toán"; } else if (StatusInvoice == Const.Invoice_Status.HUY) { status = "Hóa đơn hủy"; } POSReport.Report.InvoiceTotal invoiceTotal = new POSReport.Report.InvoiceTotal(); string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "HuyOrThanhToan" }; object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, status }; test.FillDataReport(invoiceTotal, pa, value, true); return(invoiceTotal); } case 1: { string status = ""; if (StatusInvoice == Const.Invoice_Status.THANH_TOAN_ROI) { status = "Hóa đơn thanh toán"; } else if (StatusInvoice == Const.Invoice_Status.HUY) { status = "Hóa đơn hủy"; } POSReport.Report.rptInvoiceTotalsDaily invoiceTotalsDaily = new rptInvoiceTotalsDaily(); string[] pa = { "@Store_ID", "Report_Title_Param", "@Status", "@Cashier_ID", "HuyOrThanhToan" }; object[] value = { StaticClass.storeId, "Báo cáo hóa đơn theo từng ngày", StatusInvoice, Cashier_ID, status }; test.FillDataReport(invoiceTotalsDaily, pa, value, true); return(invoiceTotalsDaily); } case 2: { POSReport.Report.rptDetailSaleReport DetailSaleReport = new rptDetailSaleReport(); string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report Title", }; object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo bán hàng chi tiết trong ngày" }; test.FillDataReport(DetailSaleReport, pa, value, true); return(DetailSaleReport); } case 3: { POSReport.Report.rptReturn rptReturn = new rptReturn(); string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report_Title", }; object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo các mặt hàng trả lại" }; test.FillDataReport(rptReturn, pa, value, true); return(rptReturn); } case 4: { POSReport.Report.rptItemDept invoice = new rptItemDept(); string[] pa = { "@Store_ID", "Report_Title_Param", "@Status", "@DateTime1", "@DateTime2" }; object[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm", StatusInvoice, DateTime1, DateTime2 }; test.FillDataReport(invoice, pa, value, true); return(invoice); } case 5: { POSReport.Report.rptItemDetail invoice = new rptItemDetail(); string[] pa = { "@Store_ID", "@ReportTitle", "@Status", "@DateTime1", "@DateTime2" }; object[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo từng mặt hàng", StatusInvoice, DateTime1, DateTime2 }; test.FillDataReport(invoice, pa, value, true); return(invoice); } case 40: { POSReport.Report.rptInventoryByApha rptInventoryByApha = new rptInventoryByApha(); string[] pa = { "@Store_ID", "Report_Title_Param" }; string[] value = { StaticClass.storeId, "Báo cáo tồn kho" }; test.FillDataReport(rptInventoryByApha, pa, value, true); return(rptInventoryByApha); } case 41: { POSReport.Report.rptReceivedItems invoice = new rptReceivedItems(); string[] pa = { "@DateTime1", "@DateTime2" }; object[] value = { DateTime1, DateTime2 }; test.FillDataReport(invoice, pa, value, true); return(invoice); } case 42: { POSReport.Report.rptReOrderReport report = new rptReOrderReport(); string[] pa = { "@Store_ID" }; object[] value = { StaticClass.storeId }; test.FillDataReport(report, pa, value, true); return(report); } default: return(null); } }
private ReportClass ViewReport(int s) { EnableDateTime(); switch (s) { case 0: { if (DateTime2.Ticks <= DateTime1.Ticks) { Alert.Show("Nhập Ngày Sai.\n Nhập lại ngày", Color.Red); return(null); } POSReport.Report.InvoiceTotal invoiceTotal = new POSReport.Report.InvoiceTotal(); string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID" }; object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID }; test.FillDataReport(invoiceTotal, pa, value, true); return(invoiceTotal); } case 1: { POSReport.Report.rptInvoiceTotalsDaily invoiceTotalsDaily = new rptInvoiceTotalsDaily(); string[] pa = { "@Store_ID", "Report_Title_Param", "@Status", "@Cashier_ID" }; object[] value = { StaticClass.storeId, "Báo cáo hóa đơn theo từng ngày", StatusInvoice, Cashier_ID }; test.FillDataReport(invoiceTotalsDaily, pa, value, true); return(invoiceTotalsDaily); } case 2: { POSReport.Report.rptDetailSaleReport DetailSaleReport = new rptDetailSaleReport(); string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report Title", }; object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo bán hàng chi tiết trong ngày" }; test.FillDataReport(DetailSaleReport, pa, value, true); return(DetailSaleReport); } case 3: { POSReport.Report.rptReturn rptReturn = new rptReturn(); string[] pa = { "@Store_ID", "@DateTime1", "@DateTime2", "@Status", "@Cashier_ID", "Report_Title", }; object[] value = { StaticClass.storeId, DateTime1, DateTime2, StatusInvoice, Cashier_ID, "Báo cáo các mặt hàng trả lại" }; test.FillDataReport(rptReturn, pa, value, true); return(rptReturn); } case 4: { POSReport.Report.rptItemDept invoice = new rptItemDept(); string[] pa = { "@Store_ID", "Report_Title_Param", "@Status" }; string[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm", StatusInvoice }; test.FillDataReport(invoice, pa, value, true); return(invoice); } case 40: { POSReport.Report.rptInventoryByApha rptInventoryByApha = new rptInventoryByApha(); string[] pa = { "@Store_ID", "Report_Title_Param" }; string[] value = { StaticClass.storeId, "Tình hình các mặt hàng trong kho" }; test.FillDataReport(rptInventoryByApha, pa, value, true); return(rptInventoryByApha); } //case 41: // { // POSReport.Report.rptItemDept invoice = new rptItemDept(); // string[] pa = { "@Store_ID", "Report_Title_Param", "@Status"}; // string[] value = { StaticClass.storeId, "Báo cáo chi tiết bán hàng theo nhóm",StatusInvoice}; // test.FillDataReport(invoice, pa, value, true); // return invoice; // } default: return(null); } }