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; } }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //FinanceDocumentPayments public static FIN_DocumentFinancePayment PersistFinanceDocumentPayment() { //All Documents, usefull to Split into Invoices and CreditNotes List <Guid> listDocuments = new List <Guid>(); List <FIN_DocumentFinanceMaster> listInvoices = new List <FIN_DocumentFinanceMaster>(); List <FIN_DocumentFinanceMaster> listCreditNotes = new List <FIN_DocumentFinanceMaster>(); //listDocuments.Add(new Guid("a067b55b-09b5-4a48-a386-e9d04777540b"));//NC NCCKOQ5R5012016S001/1 //listDocuments.Add(new Guid("92c5c809-0387-4d1f-93c6-afeb6f291149"));//FT FTCKOQ5R5012016S001/1 //Used listDocuments.Add(new Guid("e00cde4c-2218-4c03-ac4b-161b2b89032b")); //NC NCCKOQ5R5012016S001/2 listDocuments.Add(new Guid("ed8e5198-f253-4198-be18-fff188a7d3b4")); //NC NCCKOQ5R5012016S001/3 listDocuments.Add(new Guid("dc4b8170-2b61-4ed4-ad8b-77aaf8a4c695")); //FT FTCKOQ5R5012016S001/3 listDocuments.Add(new Guid("36e49eb1-5e94-47e4-9467-8365ec71e099")); //FT FTCKOQ5R5012016S001/4 listDocuments.Add(new Guid("529f5d2d-4202-4207-b15f-2d58d56c4ebe")); //FT FTCKOQ5R5012016S001/6 //Force Errors : Invalid Documents listDocuments.Add(new Guid("41ba3dfa-8afa-48bd-aa56-1b51015e7c0c")); //GT GTCKOQ5R5012016S001/1 Mário Fernandes invalid document + diferent customer listDocuments.Add(new Guid("a067b55b-09b5-4a48-a386-e9d04777540b")); //NC NCCKOQ5R5012016S001/1 Carlos Fernandes Payed listDocuments.Add(new Guid("92c5c809-0387-4d1f-93c6-afeb6f291149")); //FT FTCKOQ5R5012016S001/1 Carlos Fernandes Payed listDocuments.Add(new Guid("2813d769-3065-44fb-b48f-a8f7a42a0456")); //FT FTCKOQ5R5012016S001/5 Carlos DocumentStatusStatus = A //Other Parameters //decimal paymentAmount = 28.17m;//Euro decimal paymentAmount = 517.06m;//Kwanza string paymentNotes = "$#%#$&%»»'@£§€"; //Prepare listInvoices and listCreditNotes foreach (Guid item in listDocuments) { FIN_DocumentFinanceMaster documentFinanceMaster = (FIN_DocumentFinanceMaster)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_DocumentFinanceMaster), item); if (documentFinanceMaster.DocumentType.Credit) { listInvoices.Add(documentFinanceMaster); } else { listCreditNotes.Add(documentFinanceMaster); } } FIN_DocumentFinancePayment documentFinancePayment = ProcessFinanceDocument.PersistFinanceDocumentPayment(listInvoices, listCreditNotes, SettingsApp.XpoOidDocumentCustomer, SettingsApp.XpoOidDocumentPaymentMethod, SettingsApp.XpoOidDocumentCurrency, paymentAmount, paymentNotes); if (documentFinancePayment != null) { Console.WriteLine(string.Format("documentFinancePayment.PaymentRefNo: [{0}]", documentFinancePayment.PaymentRefNo)); SYS_ConfigurationPrintersTemplates template = ProcessFinanceDocumentSeries.GetDocumentFinanceYearSerieTerminal(GlobalFramework.SessionXpo, documentFinancePayment.DocumentType.Oid).Template; PrintRouter.PrintFinanceDocumentPayment(GlobalFramework.LoggedTerminal.Printer, documentFinancePayment); } return(documentFinancePayment); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: /// <summary> /// Generate Fast Report Business Objects for ProcessReportFinanceDocumentPayment /// </summary> public static ResultFRBODocumentFinancePayment GetFRBOFinancePayment(Guid pDocumentFinancePaymentOid) { ResultFRBODocumentFinancePayment result = new ResultFRBODocumentFinancePayment(); try { FIN_DocumentFinancePayment documentFinancePayment = (FIN_DocumentFinancePayment)FrameworkUtils.GetXPGuidObject(GlobalFramework.SessionXpo, typeof(FIN_DocumentFinancePayment), pDocumentFinancePaymentOid); string sqlFilter = string.Format("fpaOid = '{0}'", pDocumentFinancePaymentOid.ToString()); //Prepare and Declare FRBOGenericCollections FRBOGenericCollection <FRBODocumentFinancePaymentView> gcDocumentFinancePayment = new FRBOGenericCollection <FRBODocumentFinancePaymentView>(sqlFilter); FRBOGenericCollection <FRBODocumentFinancePaymentDocumentView> gcDocumentFinancePaymentDocument; //Decrypt Values gcDocumentFinancePayment.List[0].EntityName = XPGuidObject.DecryptIfNeeded(gcDocumentFinancePayment.List[0].EntityName).ToString(); gcDocumentFinancePayment.List[0].EntityAddress = XPGuidObject.DecryptIfNeeded(gcDocumentFinancePayment.List[0].EntityAddress).ToString(); gcDocumentFinancePayment.List[0].EntityZipCode = XPGuidObject.DecryptIfNeeded(gcDocumentFinancePayment.List[0].EntityZipCode).ToString(); gcDocumentFinancePayment.List[0].EntityCity = XPGuidObject.DecryptIfNeeded(gcDocumentFinancePayment.List[0].EntityCity).ToString(); gcDocumentFinancePayment.List[0].EntityFiscalNumber = XPGuidObject.DecryptIfNeeded(gcDocumentFinancePayment.List[0].EntityFiscalNumber).ToString(); //If FinalConsumer - Clean Output Data if (gcDocumentFinancePayment.List[0].EntityFiscalNumber == SettingsApp.FinanceFinalConsumerFiscalNumber) { gcDocumentFinancePayment.List[0].EntityName = string.Empty; gcDocumentFinancePayment.List[0].EntityAddress = string.Empty; gcDocumentFinancePayment.List[0].EntityZipCode = string.Empty; gcDocumentFinancePayment.List[0].EntityCity = string.Empty; gcDocumentFinancePayment.List[0].EntityFiscalNumber = SettingsApp.FinanceFinalConsumerFiscalNumberDisplay; } //Render Child Bussiness Objects foreach (FRBODocumentFinancePaymentView documentFinanceMasterPayment in gcDocumentFinancePayment) { //Get FinanceDetail gcDocumentFinancePaymentDocument = new FRBOGenericCollection <FRBODocumentFinancePaymentDocumentView>(string.Format("fpaOid = '{0}'", documentFinanceMasterPayment.Oid), "ftpCode, fmaDocumentNumber"); documentFinanceMasterPayment.DocumentFinancePaymentDocument = gcDocumentFinancePaymentDocument.List; } result.DocumentFinancePayment = gcDocumentFinancePayment; } catch (Exception ex) { _log.Error(ex.Message, ex); } return(result); }
public static string DocumentPaymentCreatePDF(FIN_DocumentFinancePayment pDocumentFinancePayment, string pDestinationFileName, CustomReportDisplayMode pCustomReportDisplayMode) { string result = String.Empty; try { //Generate Default CopyNames from DocumentType List <int> copyNames = CopyNames(pDocumentFinancePayment.DocumentType.PrintCopies); result = ProcessReportFinanceDocumentPayment(pCustomReportDisplayMode, pDocumentFinancePayment.Oid, copyNames, pDestinationFileName); } catch (Exception ex) { _log.Error(ex.Message, ex); } return(result); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //ProcessFinanceDocument //Use: DocumentFinanceMaster resultDocument = FrameworkCalls.ProcessFinanceDocument(SourceWindow, Invoices, CreditNotes, Customer, PaymentMethod, pPaymentAmount, pPaymentNotes); public static FIN_DocumentFinancePayment PersistFinanceDocumentPayment(Window pSourceWindow, List <FIN_DocumentFinanceMaster> pInvoices, List <FIN_DocumentFinanceMaster> pCreditNotes, Guid pCustomer, Guid pPaymentMethod, Guid pConfigurationCurrency, decimal pPaymentAmount, string pPaymentNotes = "") { FIN_DocumentFinancePayment result = null; try { FIN_DocumentFinancePayment documentFinancePayment = ProcessFinanceDocument.PersistFinanceDocumentPayment(pInvoices, pCreditNotes, pCustomer, pPaymentMethod, pConfigurationCurrency, pPaymentAmount, pPaymentNotes); if (documentFinancePayment != null) { //Always send back the Valid Document result = documentFinancePayment; //Print Document PrintFinanceDocumentPayment(pSourceWindow, documentFinancePayment); } } catch (ProcessFinanceDocumentValidationException ex) { string errorMessage = string.Empty; switch (ex.Message) { case "ERROR_MISSING_SERIE": errorMessage = string.Format(Resx.dialog_message_error_creating_financial_document, Resx.dialog_message_error_creating_financial_document_missing_series); break; case "ERROR_COMMIT_FINANCE_DOCUMENT_PAYMENT": default: errorMessage = string.Format(Resx.dialog_message_error_creating_financial_document, ex.Exception.Message); break; } Utils.ShowMessageTouch( pSourceWindow, DialogFlags.Modal, _sizeDefaultWindowSize, MessageType.Error, ButtonsType.Close, Resx.global_error, errorMessage ); } return(result); }
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; } }
public static string DocumentPaymentCreatePDF(FIN_DocumentFinancePayment pDocumentFinancePayment, string pDestinationFileName) { return(DocumentPaymentCreatePDF(pDocumentFinancePayment, pDestinationFileName, CustomReportDisplayMode.ExportPDFSilent)); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //Generate FinanceDocumentPayment PDFs public static string DocumentPaymentCreatePDF(FIN_DocumentFinancePayment pDocumentFinancePayment) { return(DocumentPaymentCreatePDF(pDocumentFinancePayment, String.Empty, CustomReportDisplayMode.ExportPDFSilent)); }
private static bool SystemPrintInsert(FIN_DocumentFinanceMaster pDocumentFinanceMaster, FIN_DocumentFinancePayment pDocumentFinancePayment, string pPrinterDesignation, int pPrintCopies, List <int> pCopyNames, bool pSecondPrint, string pPrintMotive, SYS_UserDetail pUserDetail, POS_ConfigurationPlaceTerminal pConfigurationPlaceTerminal) { bool result = false; try { //Start UnitOfWork using (UnitOfWork uowSession = new UnitOfWork()) { string designation = String.Empty; //Get Objects into Current UOW Session SYS_UserDetail userDetail = (SYS_UserDetail)FrameworkUtils.GetXPGuidObject(uowSession, typeof(SYS_UserDetail), pUserDetail.Oid); POS_ConfigurationPlaceTerminal configurationPlaceTerminal = (POS_ConfigurationPlaceTerminal)FrameworkUtils.GetXPGuidObject(uowSession, typeof(POS_ConfigurationPlaceTerminal), pConfigurationPlaceTerminal.Oid); //Convert CopyNames List to Comma Delimited String string copyNamesCommaDelimited = CustomReport.CopyNamesCommaDelimited(pCopyNames); //SystemPrint SYS_SystemPrint systemPrint = new SYS_SystemPrint(uowSession) { Date = FrameworkUtils.CurrentDateTimeAtomic(), Designation = designation, PrintCopies = pPrintCopies, CopyNames = copyNamesCommaDelimited, SecondPrint = pSecondPrint, UserDetail = userDetail, Terminal = configurationPlaceTerminal }; if (pPrintMotive != String.Empty) { systemPrint.PrintMotive = pPrintMotive; } //Mode: DocumentFinanceMaster if (pDocumentFinanceMaster != null) { FIN_DocumentFinanceMaster documentFinanceMaster = (FIN_DocumentFinanceMaster)FrameworkUtils.GetXPGuidObject(uowSession, typeof(FIN_DocumentFinanceMaster), pDocumentFinanceMaster.Oid); systemPrint.DocumentMaster = documentFinanceMaster; designation = string.Format("{0} {1} : {2}", Resx.global_printed, documentFinanceMaster.DocumentType.Designation, documentFinanceMaster.DocumentNumber); //Update DocumentFinanceMaster if (!documentFinanceMaster.Printed) { documentFinanceMaster.Printed = true; } } //Mode: DocumentFinancePayment if (pDocumentFinancePayment != null) { FIN_DocumentFinancePayment documentFinancePayment = (FIN_DocumentFinancePayment)FrameworkUtils.GetXPGuidObject(uowSession, typeof(FIN_DocumentFinancePayment), pDocumentFinancePayment.Oid); systemPrint.DocumentPayment = documentFinancePayment; designation = string.Format("{0} {1} : {2}", Resx.global_printed, documentFinancePayment.DocumentType.Designation, documentFinancePayment.PaymentRefNo); } systemPrint.Designation = designation; try { //Commit UOW Changes : Before get current OrderMain uowSession.CommitChanges(); //Audit FrameworkUtils.Audit("SYSTEM_PRINT_FINANCE_DOCUMENT", designation); result = true; } catch (Exception ex) { _log.Error(ex.Message, ex); uowSession.RollbackTransaction(); } } } catch (Exception ex) { _log.Error(ex.Message, ex); } return(result); }
private static bool SystemPrintInsert(FIN_DocumentFinancePayment pDocumentFinancePayment, string pPrinterDesignation, int pPrintCopies, List <int> pCopyNames) { return(SystemPrintInsert(null, pDocumentFinancePayment, pPrinterDesignation, pPrintCopies, pCopyNames, false, String.Empty, GlobalFramework.LoggedUser, GlobalFramework.LoggedTerminal)); }
//OverLoads DocumentFinancePayment private static bool SystemPrintInsert(FIN_DocumentFinancePayment pDocumentFinancePayment, string PrinterDesignation) { List <int> copyNames = CustomReport.CopyNames(pDocumentFinancePayment.DocumentType.PrintCopies); return(SystemPrintInsert(null, pDocumentFinancePayment, PrinterDesignation, 1, copyNames, false, String.Empty, GlobalFramework.LoggedUser, GlobalFramework.LoggedTerminal)); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 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); }
//Main Method - With and Without Session public static bool PersistWorkSessionMovement(POS_WorkSessionPeriod pWorkSessionPeriod, POS_WorkSessionMovementType pWorkSessionMovementType, FIN_DocumentFinanceMaster pDocumentFinanceMaster, FIN_DocumentFinancePayment pDocumentFinancePayment, SYS_UserDetail pUserDetail, POS_ConfigurationPlaceTerminal pTerminal, DateTime pDate, decimal pMovementAmount, string pDescription, uint pOrd = 1) { return(PersistWorkSessionMovement(GlobalFramework.SessionXpo, pWorkSessionPeriod, pWorkSessionMovementType, pDocumentFinanceMaster, pDocumentFinancePayment, pUserDetail, pTerminal, pDate, pMovementAmount, pDescription)); }
//XpoMode public TreeViewDocumentFinancePayment(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(FIN_DocumentFinancePayment); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView FIN_DocumentFinancePayment defaultValue = (pDefaultValue != null) ? pDefaultValue as FIN_DocumentFinancePayment : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : null; //Config int fontGenericTreeViewColumn = Convert.ToInt16(GlobalFramework.Settings["fontGenericTreeViewColumn"]); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("CreatedAt") { Title = Resx.global_document_date, MinWidth = 180 }); columnProperties.Add(new GenericTreeViewColumnProperty("PaymentRefNo") { Title = Resx.global_document_number, MinWidth = 180 }); columnProperties.Add(new GenericTreeViewColumnProperty("PaymentStatus") { Title = Resx.global_document_status, MinWidth = 50, MaxWidth = 50 }); //Shared Query string query = "SELECT {0} as Result FROM view_documentfinancepayment WHERE fpaOid = '{1}' GROUP BY fpaOid;"; columnProperties.Add(new GenericTreeViewColumnProperty("EntityName") { Title = Resx.global_entity, MinWidth = 260, MaxWidth = 260, Query = string.Format(query, "cusName", "{0}"), DecryptValue = true }); columnProperties.Add(new GenericTreeViewColumnProperty("EntityFiscalNumber") { Title = Resx.global_fiscal_number, MinWidth = 70, MaxWidth = 120, Query = string.Format(query, "cusFiscalNumber", "{0}"), DecryptValue = true }); columnProperties.Add(new GenericTreeViewColumnProperty("PaymentAmount") { Title = Resx.global_total, MinWidth = 100, //Alignment = 1.0F, FormatProvider = new FormatterDecimalCurrency(), //CellRenderer = new CellRendererText() //{ // FontDesc = new Pango.FontDescription() { Size = fontGenericTreeViewColumn }, // Alignment = Pango.Alignment.Right, // Xalign = 1.0F //} }); //Configure Criteria/XPCollection/Model //CriteriaOperator.Parse("Code >= 100 and Code <= 9999"); CriteriaOperator criteria = pXpoCriteria; SortProperty[] sortProperty = new SortProperty[1]; sortProperty[0] = new SortProperty("CreatedAt", SortingDirection.Ascending); XPCollection xpoCollection = new XPCollection(GlobalFramework.SessionXpo, xpoGuidObjectType, criteria, sortProperty); //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 bool PrintFinanceDocumentPayment(Window pSourceWindow, SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinancePayment pDocumentFinancePayment) { bool result = false; if (!LicenceManagement.IsLicensed || !LicenceManagement.CanPrint) { Utils.ShowMessageTouchErrorUnlicencedFunctionDisabled(pSourceWindow, Resx.global_printing_function_disabled); return(false); } SYS_ConfigurationPrinters printer = (pPrinter != null) ? pPrinter : GlobalFramework.LoggedTerminal.Printer; try { //Notification : Show Message TouchTerminalWithoutAssociatedPrinter and Store user input, to Show Next Time(Yes) or Not (No) if (printer == null) { Utils.ShowMessageTouchTerminalWithoutAssociatedPrinter(pSourceWindow, Resx.global_documentfinance_type_title_rc); } else { //ProtectedFiles Protection bool validFiles = true; string extraMessage = string.Format(Resx.dialog_message_error_protected_files_invalid_files_detected_print_document_ignored, pDocumentFinancePayment.PaymentRefNo); switch (PrintRouter.GetPrinterToken(printer.PrinterType.Token)) { //ThermalPrinter : Ticket Files case "THERMAL_PRINTER_WINDOWS": case "THERMAL_PRINTER_LINUX": case "THERMAL_PRINTER_SOCKET": case "THERMAL_PRINTER_USB": break; //FastReport : Report Files case "GENERIC_PRINTER_WINDOWS": case "REPORT_EXPORT_PDF": //validFiles = (IsValidProtectedFile(FrameworkUtils.OSSlash(@"Resources/Reports/UserReports/ReportDocumentFinancePayment.frx"), extraMessage)); break; case "VIRTUAL_SCREEN": break; } //ProtectedFiles Protection if (!validFiles) { return(false); } //Call Print Document result = PrintRouter.PrintFinanceDocumentPayment(printer, pDocumentFinancePayment); } } catch (Exception ex) { Utils.ShowMessageTouchErrorPrintingTicket(pSourceWindow, printer, ex); } return(result); }
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //PrintFinanceDocumentPayment public static bool PrintFinanceDocumentPayment(Window pSourceWindow, FIN_DocumentFinancePayment pDocumentFinancePayment) { return(PrintFinanceDocumentPayment(pSourceWindow, null, pDocumentFinancePayment)); }
public static bool PersistWorkSessionMovement(Session pSession, POS_WorkSessionPeriod pWorkSessionPeriod, POS_WorkSessionMovementType pWorkSessionMovementType, FIN_DocumentFinanceMaster pDocumentFinanceMaster, FIN_DocumentFinancePayment pDocumentFinancePayment, SYS_UserDetail pUserDetail, POS_ConfigurationPlaceTerminal pTerminal, DateTime pDate, decimal pMovementAmount, string pDescription, uint pOrd = 1) { //Prevent Deleted Objects, Get Fresh Objects SYS_UserDetail userDetail = pSession.GetObjectByKey <SYS_UserDetail>(GlobalFramework.LoggedUser.Oid); POS_ConfigurationPlaceTerminal terminal = pSession.GetObjectByKey <POS_ConfigurationPlaceTerminal>(GlobalFramework.LoggedTerminal.Oid); POS_WorkSessionMovementType workSessionMovementType = pSession.GetObjectByKey <POS_WorkSessionMovementType>(pWorkSessionMovementType.Oid); try { POS_WorkSessionMovement workSessionMovement = new POS_WorkSessionMovement(pSession) { Ord = pOrd, WorkSessionPeriod = pWorkSessionPeriod, WorkSessionMovementType = workSessionMovementType, UserDetail = userDetail, Terminal = terminal, Date = pDate, MovementAmount = pMovementAmount, Description = pDescription }; //Assign parent DocumentFinanceMaster and PaymentMethod if (pDocumentFinanceMaster != null) { workSessionMovement.DocumentFinanceMaster = pDocumentFinanceMaster; workSessionMovement.DocumentFinanceType = pDocumentFinanceMaster.DocumentType; workSessionMovement.PaymentMethod = pDocumentFinanceMaster.PaymentMethod; } //Assign parent DocumentFinancePayment and PaymentMethod if (pDocumentFinancePayment != null) { workSessionMovement.DocumentFinancePayment = pDocumentFinancePayment; workSessionMovement.DocumentFinanceType = pDocumentFinancePayment.DocumentType; workSessionMovement.PaymentMethod = pDocumentFinancePayment.PaymentMethod; } //Save WorkSessionMovement if not in UOW if (pSession.GetType() == typeof(Session)) { workSessionMovement.Save(); } return(true); } catch (Exception ex) { _log.Error(ex.Message, ex); return(false); } }