//Get DocumentFinanceYearSerieTerminal for Terminal public static FIN_DocumentFinanceYearSerieTerminal GetDocumentFinanceYearSerieTerminal(Session pSession, Guid pDocumentType, Guid pLoggedTerminal) { DateTime currentDateTime = FrameworkUtils.CurrentDateTimeAtomic(); FIN_DocumentFinanceYearSerieTerminal documentFinanceYearSerieTerminal = null; FIN_DocumentFinanceType documentFinanceType = (FIN_DocumentFinanceType)FrameworkUtils.GetXPGuidObject(pSession, typeof(FIN_DocumentFinanceType), pDocumentType); //If DocumentTypeInvoiceWayBill Replace/Override Helper Document Type InvoiceWayBill with InvoiceWay to get Invoice Serie, //this way we have Invoice Serie but DocumentMaster keeps DocumentFinanceType has DocumentFinanceTypeInvoiceWayBill //Usefull for Future Documents WayBill distinct code, ex have WayBill, ex Re-Print Documents in WayBillMode etc Guid documentFinanceTypeSerieGuid = (documentFinanceType.Oid == SettingsApp.XpoOidDocumentFinanceTypeInvoiceWayBill) ? SettingsApp.XpoOidDocumentFinanceTypeInvoice : documentFinanceType.Oid ; //Get Document Serie SortingCollection sortCollection = new SortingCollection(); sortCollection.Add(new SortProperty("FiscalYear", DevExpress.Xpo.DB.SortingDirection.Ascending)); CriteriaOperator criteria = CriteriaOperator.Parse(string.Format("(Disabled = 0 OR Disabled IS NULL) AND DocumentType == '{0}'", documentFinanceTypeSerieGuid.ToString())); ICollection collectionDocumentFinanceSeries = pSession.GetObjects(pSession.GetClassInfo(typeof(FIN_DocumentFinanceYearSerieTerminal)), criteria, sortCollection, int.MaxValue, false, true); foreach (FIN_DocumentFinanceYearSerieTerminal item in collectionDocumentFinanceSeries) { if (currentDateTime.Year >= item.FiscalYear.FiscalYear) { if (item.Terminal.Oid == pLoggedTerminal) { documentFinanceYearSerieTerminal = item; } } } return(documentFinanceYearSerieTerminal); }
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); } }
//XpoMode public TreeViewDocumentFinanceType(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(FIN_DocumentFinanceType); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView FIN_DocumentFinanceType defaultValue = (pDefaultValue != null) ? pDefaultValue as FIN_DocumentFinanceType : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogDocumentFinanceType); //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("Acronym") { Title = Resx.global_acronym }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = Resx.global_record_date_updated, MinWidth = 150, MaxWidth = 150 }); //Configure Criteria/XPCollection/Model CriteriaOperator criteria = (ReferenceEquals(pXpoCriteria, null)) ? null : pXpoCriteria; SortProperty[] sortProperty = new SortProperty[1]; sortProperty[0] = new SortProperty("Designation", SortingDirection.Ascending); 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 ThermalPrinterBaseFinanceTemplate(SYS_ConfigurationPrinters pPrinter, FIN_DocumentFinanceType pDocumentType, List <int> pCopyNames) : this(pPrinter, pDocumentType, pCopyNames, false) { }
private void InitUI1() { //EntryBoxValidation with KeyBoard Input EntryBoxValidation entryBoxValidation = new EntryBoxValidation(this, "EntryBoxValidation", KeyboardMode.Alfa, SettingsApp.RegexAlfaNumericExtended, true); entryBoxValidation.EntryValidation.Sensitive = false; entryBoxValidation.ButtonKeyBoard.Sensitive = false; _vbox.PackStart(entryBoxValidation, true, true, _padding); //EntryBoxValidation with KeyBoard Input and Custom Buttons : Start without KeyBoard, and KeyBoard Button After all Others _entryBoxValidationCustomButton1 = new EntryBoxValidation(this, "EntryBoxValidationCustomButton", KeyboardMode.None, SettingsApp.RegexAlfaNumericExtended, false); TouchButtonIcon customButton1 = _entryBoxValidationCustomButton1.AddButton("CustomButton1", @"Icons/Windows/icon_window_orders.png"); TouchButtonIcon customButton2 = _entryBoxValidationCustomButton1.AddButton("CustomButton2", @"Icons/Windows/icon_window_pay_invoice.png"); TouchButtonIcon customButton3 = _entryBoxValidationCustomButton1.AddButton("CustomButton3", @"Icons/Windows/icon_window_orders.png"); //Now we manually Init Keyboard _entryBoxValidationCustomButton1.EntryValidation.KeyboardMode = KeyboardMode.AlfaNumeric; _entryBoxValidationCustomButton1.InitKeyboard(_entryBoxValidationCustomButton1.EntryValidation); //Test Required Rule customButton1.Clicked += customButton1_Clicked; customButton2.Clicked += customButton2_Clicked; customButton3.Clicked += customSharedButton_Clicked; _vbox.PackStart(_entryBoxValidationCustomButton1, true, true, _padding); //EntryBoxValidationButton EntryBoxValidationButton entryBoxValidationButton = new EntryBoxValidationButton(this, "EntryBoxValidationButton", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true); entryBoxValidationButton.Button.Clicked += customSharedButton_Clicked; _vbox.PackStart(entryBoxValidationButton, true, true, _padding); //Test XPOEntryBoxSelectRecordValidation without KeyBoard Input FIN_DocumentFinanceType defaultValueDocumentFinanceType = (FIN_DocumentFinanceType)FrameworkUtils.GetXPGuidObject(GlobalFramework.SessionXpo, typeof(FIN_DocumentFinanceType), SettingsApp.XpoOidDocumentFinanceTypeInvoice); CriteriaOperator criteriaOperatorDocumentFinanceType = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled <> 1)"); XPOEntryBoxSelectRecordValidation <FIN_DocumentFinanceType, TreeViewDocumentFinanceType> entryBoxSelectDocumentFinanceType = new XPOEntryBoxSelectRecordValidation <FIN_DocumentFinanceType, TreeViewDocumentFinanceType>(this, Resx.global_documentfinanceseries_documenttype, "Designation", "Oid", defaultValueDocumentFinanceType, criteriaOperatorDocumentFinanceType, SettingsApp.RegexGuid, true); //entryBoxSelectDocumentFinanceType.EntryValidation.IsEditable = false; entryBoxSelectDocumentFinanceType.ClosePopup += delegate { }; _vbox.PackStart(entryBoxSelectDocumentFinanceType, true, true, _padding); //Test XPOEntryBoxSelectRecordValidation with KeyBoard Input CriteriaOperator criteriaOperatorXPOEntryBoxSelectRecordValidationTextMode = null; _xPOEntryBoxSelectRecordValidationTextMode = new XPOEntryBoxSelectRecordValidation <ERP_Customer, TreeViewCustomer>(this, "XPOEntryBoxSelectRecordValidationTextMode", "Name", "Name", null, criteriaOperatorXPOEntryBoxSelectRecordValidationTextMode, KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, false); //_xPOEntryBoxSelectRecordValidationTextMode.EntryValidation.Sensitive = false; //Start Disabled //_xPOEntryBoxSelectRecordValidationTextMode.ButtonKeyBoard.Sensitive = false; _xPOEntryBoxSelectRecordValidationTextMode.ClosePopup += delegate { }; _vbox.PackStart(_xPOEntryBoxSelectRecordValidationTextMode, true, true, _padding); //Test XPOEntryBoxSelectRecordValidation without KeyBoard Input / Guid CriteriaOperator criteriaOperatorXPOEntryBoxSelectRecordValidationGuidMode = null; XPOEntryBoxSelectRecordValidation <ERP_Customer, TreeViewCustomer> xPOEntryBoxSelectRecordValidationGuidMode = new XPOEntryBoxSelectRecordValidation <ERP_Customer, TreeViewCustomer>(this, "XPOEntryBoxSelectRecordValidationGuidMode", "Name", "Oid", null, criteriaOperatorXPOEntryBoxSelectRecordValidationGuidMode, KeyboardMode.None, SettingsApp.RegexGuid, true); _xPOEntryBoxSelectRecordValidationTextMode.ClosePopup += delegate { }; _vbox.PackStart(xPOEntryBoxSelectRecordValidationGuidMode, true, true, _padding); //Test DateTime Picker DateTime initalDateTime = DateTime.Now; EntryBoxValidationDatePickerDialog entryBoxShipToDeliveryDate = new EntryBoxValidationDatePickerDialog(this, Resx.global_ship_to_delivery_date, "dateFormat", DateTime.Now, SettingsApp.RegexDate, true, SettingsApp.DateFormat); //entryBoxShipToDeliveryDate.EntryValidation.Sensitive = true; entryBoxShipToDeliveryDate.EntryValidation.Text = initalDateTime.ToString(SettingsApp.DateFormat); //entryBoxShipToDeliveryDate.EntryValidation.Validate(); //entryBoxShipToDeliveryDate.ClosePopup += delegate { }; _vbox.PackStart(entryBoxShipToDeliveryDate, true, true, _padding); //Test DateTime Picker with KeyBoard EntryBoxValidationDatePickerDialog entryBoxShipToDeliveryDateKeyboard = new EntryBoxValidationDatePickerDialog(this, Resx.global_ship_to_delivery_date, SettingsApp.DateTimeFormat, DateTime.Now, KeyboardMode.AlfaNumeric, SettingsApp.RegexDateTime, true, SettingsApp.DateTimeFormat); entryBoxShipToDeliveryDateKeyboard.EntryValidation.Sensitive = false; entryBoxShipToDeliveryDateKeyboard.ButtonKeyBoard.Sensitive = false; //entryBoxShipToDeliveryDate.EntryValidation.Sensitive = true; entryBoxShipToDeliveryDateKeyboard.EntryValidation.Text = initalDateTime.ToString(SettingsApp.DateTimeFormat); _vbox.PackStart(entryBoxShipToDeliveryDateKeyboard, true, true, _padding); //Simple ListView List <string> itemList = new List <string>(); itemList.Add("Looking for Kiosk mode in Android Lollipop 5.0"); itemList.Add("Think of a hypothetical ATM machine that is running Android"); itemList.Add("In this article we provide a brief overview of how"); itemList.Add("Kiosk Mode can be implemented without any modifications"); itemList.Add("The Home key brings you back to the Home screen"); //ListComboBox ListComboBox listComboBox = new ListComboBox(itemList, itemList[3]); _vbox.PackStart(listComboBox, true, true, _padding); //ListComboBoxTouch ListComboBoxTouch listComboBoxTouch = new ListComboBoxTouch(this, "ListComboBoxTouch (Todo: Highlight Validation in Component)", itemList, itemList[4]); _vbox.PackStart(listComboBoxTouch, true, true, _padding); //EntryMultiline entryTouchMultiline = new EntryMultiline(this, KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true, 100, 10); //vbox.PackStart(entryTouchMultiline, true, true, padding); EntryBoxValidationMultiLine entryBoxMultiLine = new EntryBoxValidationMultiLine(this, "EntryBoxMultiLine", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, true, 18, 6) { HeightRequest = 200 }; //Start Disabled entryBoxMultiLine.EntryMultiline.Sensitive = false; entryBoxMultiLine.ButtonKeyBoard.Sensitive = false; _vbox.PackStart(entryBoxMultiLine, true, true, _padding); /* * ListRadioButtonTouch listRadioButtonTouch = new ListRadioButtonTouch(this, "Label", itemList, itemList[4]); * _fixedContent.Put(listRadioButtonTouch, 100, 320); * * string initialShipFromDeliveryDate = FrameworkUtils.CurrentDateTimeAtomic().ToString(SettingsApp.DateFormat); * //EntryBoxValidationButton entryBoxDate = new EntryBoxValidationButton(this, Resx.global_ship_from_delivery_date, KeyboardModes.Alfa, regexDate, false); * //entryBoxDate.EntryValidation.Text = initialShipFromDeliveryDate; * //entryBoxDate.EntryValidation.Validate(); * * EntryBoxValidationDatePickerDialog entryBoxDate = new EntryBoxValidationDatePickerDialog(this, Resx.global_ship_from_delivery_date, SettingsApp.RegexDate, false); * entryBoxDate.EntryValidation.Text = initialShipFromDeliveryDate; * entryBoxDate.EntryValidation.Validate(); * entryBoxDate.ClosePopup += delegate * { * _log.Debug(string.Format("entryBoxDate.Value: [{0}]", entryBoxDate.Value)); * }; * vbox.PackStart(entryBoxDate, true, true, padding); */ }
public PosDocumentFinanceArticleDialog(Window pSourceWindow, GenericTreeViewDataTable pTreeView, DialogFlags pDialogFlags, DialogMode pDialogMode, DataRow pDataSourceRow) : base(pSourceWindow, pDialogFlags, pDialogMode, pDataSourceRow) { //Parameters _sourceWindow = pSourceWindow; _dialogMode = pDialogMode; _dataSourceRow = pDataSourceRow; //References _posDocumentFinanceDialog = (_sourceWindow as PosDocumentFinanceDialog); _currencyDisplay = (_posDocumentFinanceDialog.PagePad.Pages[0] as DocumentFinanceDialogPage1).EntryBoxSelectConfigurationCurrency.Value; //Require to Update ExchangeRate after create Database _currencyDisplay.Reload(); //Get Reference for documentFinanceType _documentFinanceType = ((_sourceWindow as PosDocumentFinanceDialog).PagePad.Pages[0] as DocumentFinanceDialogPage1).EntryBoxSelectDocumentFinanceType.Value; //Init Local Vars String windowTitle = Resx.window_title_edit_article; //Get Default System Currency _currencyDefaultSystem = SettingsApp.ConfigurationSystemCurrency; //Consignation Invoice default values _vatRateConsignationInvoice = (FIN_ConfigurationVatRate)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_ConfigurationVatRate), SettingsApp.XpoOidConfigurationVatRateDutyFree); _vatRateConsignationInvoiceExemptionReason = (FIN_ConfigurationVatExemptionReason)GlobalFramework.SessionXpo.GetObjectByKey(typeof(FIN_ConfigurationVatExemptionReason), SettingsApp.XpoOidConfigurationVatExemptionReasonM99); //TODO:THEME _windowSize = new Size(760, 360); String fileDefaultWindowIcon = FrameworkUtils.OSSlash(GlobalFramework.Path["images"] + @"Icons\Windows\icon_window_finance_article.png"); //Get Discount from Select Customer _discountGlobal = FrameworkUtils.StringToDecimal(((pSourceWindow as PosDocumentFinanceDialog).PagePad.Pages[1] as DocumentFinanceDialogPage2).EntryBoxCustomerDiscount.EntryValidation.Text); //Get PriceType from Customer var customerObject = ((pSourceWindow as PosDocumentFinanceDialog).PagePad.Pages[1] as DocumentFinanceDialogPage2).EntryBoxSelectCustomerName; if (customerObject.Value != null) { Guid customerOid = customerObject.Value.Oid; _customer = (ERP_Customer)GlobalFramework.SessionXpo.GetObjectByKey(typeof(ERP_Customer), customerOid); } //ActionArea Buttons _buttonOk = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Ok); _buttonCancel = ActionAreaButton.FactoryGetDialogButtonType(PosBaseDialogButtonType.Cancel); //ActionArea ActionAreaButtons actionAreaButtons = new ActionAreaButtons(); actionAreaButtons.Add(new ActionAreaButton(_buttonOk, ResponseType.Ok)); actionAreaButtons.Add(new ActionAreaButton(_buttonCancel, ResponseType.Cancel)); //Init Content Fixed fixedContent = new Fixed(); //Init Transport Documents Lists _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeDeliveryNote.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeTransportationGuide.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeOwnAssetsDriveGuide.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeConsignmentGuide.ToString()); _listSaftDocumentType.Add(SettingsApp.XpoOidDocumentFinanceTypeReturnGuide.ToString()); //Init Components InitUI(); //Put fixedContent.Put(_vboxEntrys, 0, 0); //Init Object this.InitObject(this, pDialogFlags, fileDefaultWindowIcon, windowTitle, _windowSize, fixedContent, actionAreaButtons); }