public ThermalPrinterInternalDocumentOrderRequest(SYS_ConfigurationPrinters pPrinter, FIN_DocumentOrderTicket pOrderTicket, bool pEnableArticlePrinter) : base(pPrinter) { try { //Parameters _orderTicket = pOrderTicket; _enableArticlePrinter = pEnableArticlePrinter; //Order Request #1/3 _ticketTitle = string.Format("{0} : #{1}" , Resx.global_order_request , _orderTicket.TicketId ); //Table|Order #2|Name/Zone _ticketSubTitle = string.Format("{0} : #{1}/{2}" , Resx.ResourceManager.GetString(string.Format("global_table_appmode_{0}", _appOperationModeToken).ToLower()) , _orderTicket.OrderMain.PlaceTable.Designation , _orderTicket.OrderMain.PlaceTable.Place.Designation ); } catch (Exception ex) { throw ex; } }
public static void Print(SYS_ConfigurationPrinters pPrinter) { try { //Parameters FIN_DocumentFinancePayment documentFinancePayment = (FIN_DocumentFinancePayment)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_DocumentFinancePayment), SettingsApp.XpoPrintFinanceDocumentPayment); //Print Document if (documentFinancePayment != null) { List <int> copyNames = new List <int> { 0 /*, 1*/ }; //Test Print Document ThermalPrinterFinanceDocumentPayment thermalPrinterFinanceDocumentPayment = new ThermalPrinterFinanceDocumentPayment(pPrinter, documentFinancePayment, copyNames, true); thermalPrinterFinanceDocumentPayment.Print(); Console.WriteLine(string.Format("DocumentFinancePayment Printed: {0}", documentFinancePayment.PaymentRefNo)); } else { Console.WriteLine(string.Format("ERROR: DocumentFinancePayment NULL: {0}", SettingsApp.XpoPrintFinanceDocumentPayment)); } } catch (Exception ex) { throw ex; } }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Used for Money Movements and Open/Close Terminal/Day Sessions public static bool PrintCashDrawerOpenAndMoneyInOut(SYS_ConfigurationPrinters pPrinter, String pTicketTitle, decimal pMovementAmount, decimal pTotalAmountInCashDrawer, string pMovementDescription) { bool result = false; if (pPrinter != null) { try { switch (GetPrinterToken(pPrinter.PrinterType.Token)) { //Impressora SINOCAN em ambiente Windows case "THERMAL_PRINTER_WINDOWS": //Impressora SINOCAN em ambiente Linux case "THERMAL_PRINTER_LINUX": //Impressora SINOCAN em ambiente WindowsLinux/Socket case "THERMAL_PRINTER_SOCKET": //Impressora SINOCAN em ambiente WindowsLinux/USB case "THERMAL_PRINTER_USB": ThermalPrinterInternalDocumentCashDrawer thermalPrinterInternalDocumentCashDrawer = new ThermalPrinterInternalDocumentCashDrawer(pPrinter, pTicketTitle, pTotalAmountInCashDrawer, pMovementAmount, pMovementDescription); thermalPrinterInternalDocumentCashDrawer.Print(); break; } result = true; } catch (Exception ex) { _log.Warn(ex.Message, ex); throw new Exception(ex.Message); } } return(result); }
public static void Print(SYS_ConfigurationPrinters pPrinter) { try { FIN_DocumentOrderTicket orderTicket = (FIN_DocumentOrderTicket)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_DocumentOrderTicket), SettingsApp.XpoPrintDocumentOrderTicket); //Print Document if (orderTicket != null) { //Test Print Document ThermalPrinterInternalDocumentOrderRequest thermalPrinterInternalDocumentOrderRequest = new ThermalPrinterInternalDocumentOrderRequest(pPrinter, orderTicket); thermalPrinterInternalDocumentOrderRequest.Print(); Console.WriteLine(string.Format("ThermalPrinterInternalDocumentOrderRequest Printed: {0}", orderTicket.Oid)); //Call PrintArticlePrinters PrintArticlePrinters(orderTicket); } else { Console.WriteLine(string.Format("ERROR: ThermalPrinterInternalDocumentOrderRequest NULL: {0}", orderTicket.Oid)); } } catch (Exception ex) { throw ex; } }
public static void Print(SYS_ConfigurationPrinters pPrinter) { try { //Parameters FIN_DocumentFinanceMaster documentFinanceMaster = (FIN_DocumentFinanceMaster)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_DocumentFinanceMaster), SettingsApp.XpoPrintFinanceDocument); //Print Document if (documentFinanceMaster != null) { //Test Print Document List <int> copyNames = new List <int> { 0, /*1, 2, 3*/ }; ThermalPrinterFinanceDocumentMaster thermalPrinterFinanceDocument = new ThermalPrinterFinanceDocumentMaster(pPrinter, documentFinanceMaster, copyNames, true, "Cancelado"); thermalPrinterFinanceDocument.Print(); Console.WriteLine(string.Format("DocumentFinanceMaster Printed: {0}", documentFinanceMaster.DocumentNumber)); } else { Console.WriteLine(string.Format("ERROR: DocumentFinanceMaster NULL: {0}", SettingsApp.XpoPrintFinanceDocument)); } } catch (Exception ex) { throw ex; } }
public ThermalPrinterInternalDocumentCashDrawer(SYS_ConfigurationPrinters pPrinter, string pTicketTitle, decimal pTotalAmountInCashDrawer, decimal pMovementAmount, string pMovementDescription) : base(pPrinter) { _ticketTitle = pTicketTitle; _totalAmountInCashDrawer = pTotalAmountInCashDrawer; _movementAmount = pMovementAmount; _movementDescription = pMovementDescription; }
public ThermalPrinterGeneric(SYS_ConfigurationPrinters pPrinter, string pEncoding) // Old HardCoded Method Settings //: this(pPrinter, pEncoding, SettingsApp.PrinterThermalMaxCharsPerLineNormal, SettingsApp.PrinterThermalMaxCharsPerLineNormalBold, SettingsApp.PrinterThermalMaxCharsPerLineSmall) : this(pPrinter, pEncoding, (GlobalFramework.LoggedTerminal.Printer != null && GlobalFramework.LoggedTerminal.Printer.ThermalMaxCharsPerLineNormal > 0) ? GlobalFramework.LoggedTerminal.Printer.ThermalMaxCharsPerLineNormal : SettingsApp.PrinterThermalMaxCharsPerLineNormal, (GlobalFramework.LoggedTerminal.Printer != null && GlobalFramework.LoggedTerminal.Printer.ThermalMaxCharsPerLineNormalBold > 0) ? GlobalFramework.LoggedTerminal.Printer.ThermalMaxCharsPerLineNormalBold : SettingsApp.PrinterThermalMaxCharsPerLineNormalBold, (GlobalFramework.LoggedTerminal.Printer != null && GlobalFramework.LoggedTerminal.Printer.ThermalMaxCharsPerLineSmall > 0) ? GlobalFramework.LoggedTerminal.Printer.ThermalMaxCharsPerLineSmall : SettingsApp.PrinterThermalMaxCharsPerLineSmall ) { }
public ThermalPrinterGeneric(SYS_ConfigurationPrinters pPrinter, string pEncoding, int pMaxCharsPerLineNormal, int pMaxCharsPerLineNormalBold, int pMaxCharsPerLineSmall) : base(pEncoding) { //Parameters _printer = pPrinter; _encoding = pEncoding; _maxCharsPerLineNormal = pMaxCharsPerLineNormal; _maxCharsPerLineNormalBold = pMaxCharsPerLineNormalBold; _maxCharsPerLineSmall = pMaxCharsPerLineSmall; //Other _line = new String(_lineChar, _maxCharsPerLineNormal); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: public static bool PrintFinanceDocument(SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinanceMaster pDocumentFinanceMaster, List <int> pCopyNames, bool pSecondCopy, string pMotive) { bool result = false; if (pPrinter != null) { //Init Helper Vars bool resultSystemPrint = false; int printCopies = pCopyNames.Count; //Get Hash4Chars from Hash string hash4Chars = ProcessFinanceDocument.GenDocumentHash4Chars(pDocumentFinanceMaster.Hash); try { switch (GetPrinterToken(pPrinter.PrinterType.Token)) { //Impressora SINOCAN em ambiente Windows case "THERMAL_PRINTER_WINDOWS": //Impressora SINOCAN em ambiente Linux case "THERMAL_PRINTER_LINUX": //Impressora SINOCAN em ambiente WindowsLinux/Socket case "THERMAL_PRINTER_SOCKET": //Impressora SINOCAN em ambiente WindowsLinux/USB case "THERMAL_PRINTER_USB": ThermalPrinterFinanceDocumentMaster thermalPrinterFinanceDocument = new ThermalPrinterFinanceDocumentMaster(pPrinter, pDocumentFinanceMaster, pCopyNames, pSecondCopy, pMotive); thermalPrinterFinanceDocument.Print(); //Add to SystemPrint Audit resultSystemPrint = SystemPrintInsert(pDocumentFinanceMaster, pPrinter.Designation, printCopies, pCopyNames, pSecondCopy, pMotive); break; case "GENERIC_PRINTER_WINDOWS": CustomReport.ProcessReportFinanceDocument(CustomReportDisplayMode.Print, pDocumentFinanceMaster.Oid, hash4Chars, pCopyNames, pSecondCopy, pMotive); //Add to SystemPrint Audit resultSystemPrint = SystemPrintInsert(pDocumentFinanceMaster, pPrinter.Designation, printCopies, pCopyNames, pSecondCopy, pMotive); break; case "REPORT_EXPORT_PDF": CustomReport.ProcessReportFinanceDocument(CustomReportDisplayMode.ExportPDF, pDocumentFinanceMaster.Oid, hash4Chars, pCopyNames, pSecondCopy, pMotive); //Add to SystemPrint Audit : Developer : Use here Only to Test SystemPrintInsert resultSystemPrint = SystemPrintInsert(pDocumentFinanceMaster, pPrinter.Designation, printCopies, pCopyNames, pSecondCopy, pMotive); break; } result = true; } catch (Exception ex) { _log.Warn(ex.Message, ex); throw new Exception(ex.Message); } } return(result); }
public DialogConfigurationPrinters(Window pSourceWindow, GenericTreeViewXPO pTreeView, DialogFlags pFlags, DialogMode pDialogMode, XPGuidObject pXPGuidObject) : base(pSourceWindow, pTreeView, pFlags, pDialogMode, pXPGuidObject) { this.Title = Utils.GetWindowTitle(Resx.window_title_edit_dialogconfigurationprinters); SetSizeRequest(500, 448); InitUI(); InitNotes(); ShowAll(); //Tab Visibility Require to be after ShowAll, else always is Visible _configurationPrinter = (_dataSourceRow as SYS_ConfigurationPrinters); _vboxTab2.Visible = (_configurationPrinter.PrinterType != null && _configurationPrinter.PrinterType.ThermalPrinter); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: public static bool PrintFinanceDocumentPayment(SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinancePayment pDocumentFinancePayment) { bool result = false; if (pPrinter != null) { //Init Helper Vars bool resultSystemPrint = false; //Initialize CopyNames List from PrintCopies List <int> copyNames = CustomReport.CopyNames(pDocumentFinancePayment.DocumentType.PrintCopies); int printCopies = copyNames.Count; try { switch (GetPrinterToken(pPrinter.PrinterType.Token)) { //Impressora SINOCAN em ambiente Windows case "THERMAL_PRINTER_WINDOWS": //Impressora SINOCAN em ambiente Linux case "THERMAL_PRINTER_LINUX": //Impressora SINOCAN em ambiente WindowsLinux/Socket case "THERMAL_PRINTER_SOCKET": //Impressora SINOCAN em ambiente WindowsLinux/USB case "THERMAL_PRINTER_USB": ThermalPrinterFinanceDocumentPayment thermalPrinterFinanceDocumentPayment = new ThermalPrinterFinanceDocumentPayment(pPrinter, pDocumentFinancePayment, copyNames, false); thermalPrinterFinanceDocumentPayment.Print(); //Add to SystemPrint Audit resultSystemPrint = SystemPrintInsert(pDocumentFinancePayment, pPrinter.Designation, printCopies, copyNames); break; case "GENERIC_PRINTER_WINDOWS": CustomReport.ProcessReportFinanceDocumentPayment(CustomReportDisplayMode.Print, pDocumentFinancePayment.Oid, copyNames); //Add to SystemPrint Audit resultSystemPrint = SystemPrintInsert(pDocumentFinancePayment, pPrinter.Designation, printCopies, copyNames); break; case "REPORT_EXPORT_PDF": CustomReport.ProcessReportFinanceDocumentPayment(CustomReportDisplayMode.ExportPDF, pDocumentFinancePayment.Oid, copyNames); //Add to SystemPrint Audit : Developer : Use here Only to Test SystemPrintInsert resultSystemPrint = SystemPrintInsert(pDocumentFinancePayment, pPrinter.Designation, printCopies, copyNames); break; } result = true; } catch (Exception ex) { _log.Warn(ex.Message, ex); throw new Exception(ex.Message); } } return(result); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Shared Method to call all other PrintTicketMethods to Check Licence and other Protections public static bool SharedPrintTicket(Window pSourceWindow, SYS_ConfigurationPrinters pPrinter, TicketType pTicketType) { bool result = false; if (!LicenceManagement.IsLicensed || !LicenceManagement.CanPrint) { Utils.ShowMessageTouchErrorUnlicencedFunctionDisabled(pSourceWindow, Resx.global_printing_function_disabled); } else { try { //Notification : Show Message TouchTerminalWithoutAssociatedPrinter and Store user input, to Show Next Time(Yes) or Not (No) if (pPrinter == null) { string ticketTitle = string.Empty; switch (pTicketType) { case TicketType.TableOrder: ticketTitle = Resx.global_documentticket_type_title_tt; break; case TicketType.ArticleOrder: ticketTitle = Resx.global_documentticket_type_title_ar; break; case TicketType.WorkSession: ticketTitle = Resx.global_documentticket_type_title_ws; break; case TicketType.CashDrawer: ticketTitle = Resx.global_documentticket_type_title_cs; break; default: break; } Utils.ShowMessageTouchTerminalWithoutAssociatedPrinter(pSourceWindow, ticketTitle); } else { result = true; } } catch (Exception ex) { _log.Error(ex.Message, ex); } } return(result); }
public ThermalPrinterBaseFinanceTemplate(SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinanceType pDocumentType, List <int> pCopyNames, bool pSecondCopy) : base(pPrinter, SettingsApp.PrinterThermalImageCompanyLogo) { //Assign Parameter Properties _documentType = pDocumentType; _copyNames = pCopyNames; _secondCopy = pSecondCopy; //Generate CopyNamesArray (Original, Duplicate,...) if (_copyNames != null) { _copyNamesArray = CustomReport.CopyNames(pCopyNames); } }
public ThermalPrinterInternalDocumentWorkSession(SYS_ConfigurationPrinters pPrinter, POS_WorkSessionPeriod pWorkSessionPeriod, SplitCurrentAccountMode pSplitCurrentAccountMode) : base(pPrinter) { _workSessionPeriod = pWorkSessionPeriod; _splitCurrentAccountMode = pSplitCurrentAccountMode; //Define TicketTitle for Day if (_workSessionPeriod.PeriodType == WorkSessionPeriodType.Day) { _ticketTitle = (pWorkSessionPeriod.SessionStatus == WorkSessionPeriodStatus.Open) ? Resx.ticket_title_worksession_day_resume : Resx.ticket_title_worksession_day_close; } //Define TicketTitle/TicketSubTitle for Terminal else { _ticketTitle = (pWorkSessionPeriod.SessionStatus == WorkSessionPeriodStatus.Open) ? Resx.ticket_title_worksession_terminal_resume : Resx.ticket_title_worksession_terminal_close; _ticketSubTitle = (pWorkSessionPeriod.PeriodType == WorkSessionPeriodType.Terminal) ? _workSessionPeriod.Terminal.Designation : string.Empty; } //Add Extra text to TicketSubTitle string ticketSubTitleExtra = string.Empty; switch (_splitCurrentAccountMode) { case SplitCurrentAccountMode.All: break; case SplitCurrentAccountMode.NonCurrentAcount: ticketSubTitleExtra = Resx.global_without_current_acount; break; case SplitCurrentAccountMode.CurrentAcount: ticketSubTitleExtra = Resx.global_current_account; break; } //Generate Final TicketSubTitle if (_ticketSubTitle != string.Empty && ticketSubTitleExtra != string.Empty) { _ticketSubTitle = string.Format("{0} : ({1})", _ticketSubTitle, ticketSubTitleExtra); } else if (_ticketSubTitle == string.Empty && ticketSubTitleExtra != string.Empty) { _ticketSubTitle = string.Format("({0})", ticketSubTitleExtra); } }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: public static bool OpenDoor(SYS_ConfigurationPrinters pPrinter) { bool result = false; bool hasPermission = FrameworkUtils.HasPermissionTo("HARDWARE_DRAWER_OPEN"); if (pPrinter != null && hasPermission) { try { switch (pPrinter.PrinterType.Token) { //Impressora SINOCAN em ambiente Windows case "THERMAL_PRINTER_WINDOWS": //Impressora SINOCAN em ambiente Linux case "THERMAL_PRINTER_LINUX": //Impressora SINOCAN em ambiente WindowsLinux/Socket case "THERMAL_PRINTER_SOCKET": //Impressora SINOCAN em ambiente WindowsLinux/USB case "THERMAL_PRINTER_USB": PrintObject printObjectSINOCAN = new PrintObject(0); // Deprecated //int m = Convert.ToInt32(GlobalFramework.Settings["DoorValueM"]); //int t1 = Convert.ToInt32(GlobalFramework.Settings["DoorValueT1"]); //int t2 = Convert.ToInt32(GlobalFramework.Settings["DoorValueT2"]); // Open Drawer int m = GlobalFramework.LoggedTerminal.Printer.ThermalOpenDrawerValueM; int t1 = GlobalFramework.LoggedTerminal.Printer.ThermalOpenDrawerValueT1; int t2 = GlobalFramework.LoggedTerminal.Printer.ThermalOpenDrawerValueT2; printObjectSINOCAN.OpenDoor(pPrinter.PrinterType.Token, pPrinter.NetworkName, m, t1, t2); //Audit FrameworkUtils.Audit("CASHDRAWER_OPEN", Resx.audit_message_cashdrawer_open); break; } result = true; } catch (Exception ex) { _log.Warn(ex.Message, ex); } } return(result); }
//XpoMode public TreeViewConfigurationPrinters(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(SYS_ConfigurationPrinters); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView SYS_ConfigurationPrinters defaultValue = (pDefaultValue != null) ? pDefaultValue as SYS_ConfigurationPrinters : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationPrinters); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Code") { Title = Resx.global_record_code, MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = Resx.global_designation, Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("NetworkName") { Title = Resx.global_networkname }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = Resx.global_record_date_updated, MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria); //Call Base Initializer base.InitObject( pSourceWindow, //Pass parameter defaultValue, //Pass parameter pGenericTreeViewMode, //Pass parameter pGenericTreeViewNavigatorMode, //Pass parameter columnProperties, //Created Here xpoCollection, //Created Here typeDialogClass //Created Here ); }
public static void Print(SYS_ConfigurationPrinters pPrinter) { try { //Test Print Document string ticketTitle = "Saida de Caixa"; decimal totalAmountInCashDrawer = 1280.28m; decimal movementAmount = 28.82m; string movementDescription = "Pagar Fornecedor"; ThermalPrinterInternalDocumentCashDrawer thermalPrinterInternalDocumentCashDrawer = new ThermalPrinterInternalDocumentCashDrawer(pPrinter, ticketTitle, totalAmountInCashDrawer, movementAmount, movementDescription); thermalPrinterInternalDocumentCashDrawer.Print(); Console.WriteLine(string.Format("ThermalPrinterInternalDocumentCashDrawer Printed: {0}", ticketTitle)); } catch (Exception ex) { throw ex; } }
public ThermalPrinterFinanceDocumentPayment(SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinancePayment pDocumentFinancePayment, List <int> pCopyNames, bool pSecondCopy) : base(pPrinter, pDocumentFinancePayment.DocumentType, pCopyNames, pSecondCopy) { try { //Parameters _documentFinancePayment = pDocumentFinancePayment; //Init Fast Reports Business Objects (From FRBOHelper) ResultFRBODocumentFinancePayment fRBOHelperResponseProcessReportFinancePayment = FRBOHelper.GetFRBOFinancePayment(pDocumentFinancePayment.Oid); //Get FRBOs Lists _documentFinancePaymentList = fRBOHelperResponseProcessReportFinancePayment.DocumentFinancePayment.List; _documentFinancePaymentDocumentList = fRBOHelperResponseProcessReportFinancePayment.DocumentFinancePayment.List[0].DocumentFinancePaymentDocument; } catch (Exception ex) { throw ex; } }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //PrintCashDrawerOpenAndMoneyInOut public static bool PrintCashDrawerOpenAndMoneyInOut(Window pSourceWindow, SYS_ConfigurationPrinters pPrinter, String pTicketTitle, decimal pMovementAmount, decimal pTotalAmountInCashDrawer, string pMovementDescription) { bool result = false; SYS_ConfigurationPrintersTemplates template = (SYS_ConfigurationPrintersTemplates)FrameworkUtils.GetXPGuidObject(typeof(SYS_ConfigurationPrintersTemplates), SettingsApp.XpoOidConfigurationPrintersTemplateCashDrawerOpenAndMoneyInOut); try { if (SharedPrintTicket(pSourceWindow, pPrinter, TicketType.CashDrawer)) { result = PrintRouter.PrintCashDrawerOpenAndMoneyInOut(pPrinter, pTicketTitle, pMovementAmount, pTotalAmountInCashDrawer, pMovementDescription); } } catch (Exception ex) { Utils.ShowMessageTouchErrorPrintingTicket(pSourceWindow, pPrinter, ex); } return(result); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //PrintTableTicket public static bool PrintOrderRequest(Window pSourceWindow, SYS_ConfigurationPrinters pPrinter, OrderMain pDocumentOrderMain, FIN_DocumentOrderTicket pOrderTicket) { bool result = false; try { if (SharedPrintTicket(pSourceWindow, pPrinter, TicketType.TableOrder)) { ThermalPrinterInternalDocumentOrderRequest thermalPrinterInternalDocumentOrderRequest = new ThermalPrinterInternalDocumentOrderRequest(pPrinter, pOrderTicket); thermalPrinterInternalDocumentOrderRequest.Print(); } } catch (Exception ex) { Utils.ShowMessageTouchErrorPrintingTicket(pSourceWindow, pPrinter, ex); } return(result); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: public static bool PrintWorkSessionMovement(SYS_ConfigurationPrinters pPrinter, POS_WorkSessionPeriod pWorkSessionPeriod) { bool result = false; if (pPrinter != null) { try { switch (GetPrinterToken(pPrinter.PrinterType.Token)) { //Impressora SINOCAN em ambiente Windows case "THERMAL_PRINTER_WINDOWS": //Impressora SINOCAN em ambiente Linux case "THERMAL_PRINTER_LINUX": //Impressora SINOCAN em ambiente WindowsLinux/Socket case "THERMAL_PRINTER_SOCKET": //Impressora SINOCAN em ambiente WindowsLinux/USB case "THERMAL_PRINTER_USB": //NonCurrentAcount ThermalPrinterInternalDocumentWorkSession thermalPrinterInternalDocumentWorkSession = new ThermalPrinterInternalDocumentWorkSession(pPrinter, pWorkSessionPeriod, SplitCurrentAccountMode.NonCurrentAcount); thermalPrinterInternalDocumentWorkSession.Print(); //CurrentAcount thermalPrinterInternalDocumentWorkSession = new ThermalPrinterInternalDocumentWorkSession(pPrinter, pWorkSessionPeriod, SplitCurrentAccountMode.CurrentAcount); thermalPrinterInternalDocumentWorkSession.Print(); break; case "GENERIC_PRINTER_WINDOWS": break; case "REPORT_EXPORT_PDF": break; } result = true; } catch (Exception ex) { _log.Warn(ex.Message, ex); throw new Exception(ex.Message); } } return(result); }
public ThermalPrinterFinanceDocumentMaster(SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinanceMaster pDocumentMaster, List <int> pCopyNames, bool pSecondCopy, string pMotive) : base(pPrinter, pDocumentMaster.DocumentType, pCopyNames, pSecondCopy) { try { //Parameters _documentMaster = pDocumentMaster; //Init Fast Reports Business Objects (From FRBOHelper) ResultFRBODocumentFinanceMaster fRBOHelperResponseProcessReportFinanceDocument = FRBOHelper.GetFRBOFinanceDocument(_documentMaster.Oid); //Get FRBOs Lists _documentFinanceMasterList = fRBOHelperResponseProcessReportFinanceDocument.DocumentFinanceMaster.List; _documentFinanceDetailList = fRBOHelperResponseProcessReportFinanceDocument.DocumentFinanceMaster.List[0].DocumentFinanceDetail; _documentFinanceMasterTotalList = fRBOHelperResponseProcessReportFinanceDocument.DocumentFinanceMaster.List[0].DocumentFinanceMasterTotal;; } catch (Exception ex) { throw ex; } }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //PrintWorkSessionMovement public static bool PrintWorkSessionMovement(Window pSourceWindow, SYS_ConfigurationPrinters pPrinter, POS_WorkSessionPeriod pWorkSessionPeriod) { bool result = false; SYS_ConfigurationPrintersTemplates template = (SYS_ConfigurationPrintersTemplates)FrameworkUtils.GetXPGuidObject(typeof(SYS_ConfigurationPrintersTemplates), SettingsApp.XpoOidConfigurationPrintersTemplateWorkSessionMovement); try { if (SharedPrintTicket(pSourceWindow, pPrinter, TicketType.WorkSession)) { //PrintWorkSessionMovement result = PrintRouter.PrintWorkSessionMovement(pPrinter, pWorkSessionPeriod); } } catch (Exception ex) { Utils.ShowMessageTouchErrorPrintingTicket(pSourceWindow, pPrinter, ex); } return(result); }
public ThermalPrinterBaseTemplate(SYS_ConfigurationPrinters pPrinter, string pCompanyLogo) { try { //Init Properties _thermalPrinterGeneric = new ThermalPrinterGeneric(pPrinter); _maxCharsPerLineNormal = _thermalPrinterGeneric.MaxCharsPerLineNormal; _maxCharsPerLineNormalBold = _thermalPrinterGeneric.MaxCharsPerLineNormalBold; _maxCharsPerLineSmall = _thermalPrinterGeneric.MaxCharsPerLineSmall; _companyLogo = pCompanyLogo; //Init Custom Vars From FastReport _customVars = GlobalFramework.FastReportCustomVars; //_systemVars = GlobalFramework.FastReportSystemVars; //Test FastReport Helpers with //_customVars["COMPANY_NAME"])) | _systemVars["APP_NAME"])) | CustomFunctions.Res("global_printed_on_date") } catch (Exception ex) { throw ex; } }
public ThermalPrinterGeneric(SYS_ConfigurationPrinters pPrinter) : this(pPrinter, SettingsApp.PrinterThermalEncoding) { }
public ThermalPrinterInternalDocumentCashDrawer(SYS_ConfigurationPrinters pPrinter, string pTicketTitle, decimal pTotalAmountInCashDrawer, decimal pMovementAmount) : this(pPrinter, pTicketTitle, pTotalAmountInCashDrawer, pMovementAmount, string.Empty) { }
public ThermalPrinterBaseFinanceTemplate(SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinanceType pDocumentType, List <int> pCopyNames) : this(pPrinter, pDocumentType, pCopyNames, false) { }
public ThermalPrinterInternalDocumentCashDrawer(SYS_ConfigurationPrinters pPrinter, string pTicketTitle, decimal pTotalAmountInCashDrawer) : this(pPrinter, pTicketTitle, pTotalAmountInCashDrawer, 0.0m) { }
public ThermalPrinterInternalDocumentOrderRequest(SYS_ConfigurationPrinters pPrinter, FIN_DocumentOrderTicket pOrderTicket) : this(pPrinter, pOrderTicket, false) { }
public static void Print(SYS_ConfigurationPrinters pPrinter) { try { //Parameters POS_WorkSessionPeriod workSessionPeriod = (POS_WorkSessionPeriod)GlobalFramework.SessionXpo.GetObjectByKey(typeof(POS_WorkSessionPeriod), SettingsApp.XpoPrintWorkSessionPeriod); //Print WorkSession if (workSessionPeriod != null) { //Get Filter Field : To filter Day or Terminal string periodField = (workSessionPeriod.PeriodType == WorkSessionPeriodType.Day) ? "wspPeriodParent" : "wspPeriod"; string sqlShared = @" SELECT COUNT(*) as Count FROM view_worksessionmovement WHERE (dfmDocument IS NOT NULL AND wmtMovementTypeToken = 'FINANCE_DOCUMENT') AND {0} = '{1}' AND wsmDocumentFinanceType {2} '{3}'; "; //Generate Queries string sqlNonCurrentAccount = string.Format(sqlShared, periodField, workSessionPeriod.Oid, "<>", SettingsApp.XpoOidDocumentFinanceTypeCurrentAccountInput); string sqlCurrentAccount = string.Format(sqlShared, periodField, workSessionPeriod.Oid, "=", SettingsApp.XpoOidDocumentFinanceTypeCurrentAccountInput); //Get Queries Results object totRecsNonCurrentAccount = GlobalFramework.SessionXpo.ExecuteScalar(sqlNonCurrentAccount); object totRecsCurrentAccount = GlobalFramework.SessionXpo.ExecuteScalar(sqlCurrentAccount); //Shared ThermalPrinterInternalDocumentWorkSession thermalPrinterInternalDocumentWorkSession; //Tests bool printSplitCurrentAccountModeNonCurrentAcount = true; bool printSplitCurrentAccountModeCurrentAcount = true; bool printSplitCurrentAccountModeAll = true; //Test Print Document //Always print NonCurrent Account Movements, even if dont have any Movements, Show zero values if (printSplitCurrentAccountModeNonCurrentAcount) { thermalPrinterInternalDocumentWorkSession = new ThermalPrinterInternalDocumentWorkSession(pPrinter, workSessionPeriod, SplitCurrentAccountMode.NonCurrentAcount); thermalPrinterInternalDocumentWorkSession.Print(); } //Test Combine NonCC and CC (All) if (printSplitCurrentAccountModeAll) { thermalPrinterInternalDocumentWorkSession = new ThermalPrinterInternalDocumentWorkSession(pPrinter, workSessionPeriod, SplitCurrentAccountMode.All); thermalPrinterInternalDocumentWorkSession.Print(); } //Only Prints Current Account Movements if if Has Movements if (printSplitCurrentAccountModeCurrentAcount && Convert.ToInt16(totRecsCurrentAccount) > 0) { thermalPrinterInternalDocumentWorkSession = new ThermalPrinterInternalDocumentWorkSession(pPrinter, workSessionPeriod, SplitCurrentAccountMode.CurrentAcount); thermalPrinterInternalDocumentWorkSession.Print(); } Console.WriteLine("ThermalPrinterInternalDocumentWorkSession Printed"); } else { Console.WriteLine("ERROR: ThermalPrinterInternalDocumentWorkSession"); } } catch (Exception ex) { throw ex; } }