//XpoMode public TreeViewConfigurationVatExceptionReason(Window pSourceWindow, XPGuidObject pDefaultValue, CriteriaOperator pXpoCriteria, Type pDialogType, GenericTreeViewMode pGenericTreeViewMode = GenericTreeViewMode.Default, GenericTreeViewNavigatorMode pGenericTreeViewNavigatorMode = GenericTreeViewNavigatorMode.Default) { //Init Vars Type xpoGuidObjectType = typeof(fin_configurationvatexemptionreason); //Override Default Value with Parameter Default Value, this way we can have diferent Default Values for GenericTreeView fin_configurationvatexemptionreason defaultValue = (pDefaultValue != null) ? pDefaultValue as fin_configurationvatexemptionreason : null; //Override Default DialogType with Parameter Dialog Type, this way we can have diferent DialogTypes for GenericTreeView Type typeDialogClass = (pDialogType != null) ? pDialogType : typeof(DialogConfigurationVatExemptionReason); //Configure columnProperties List <GenericTreeViewColumnProperty> columnProperties = new List <GenericTreeViewColumnProperty>(); columnProperties.Add(new GenericTreeViewColumnProperty("Code") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_record_code"), MinWidth = 100 }); columnProperties.Add(new GenericTreeViewColumnProperty("Designation") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_designation"), Expand = true }); columnProperties.Add(new GenericTreeViewColumnProperty("Acronym") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_vat_rate") }); columnProperties.Add(new GenericTreeViewColumnProperty("UpdatedAt") { Title = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "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 ); //Protected Records ProtectedRecords.Add(SettingsApp.XpoOidConfigurationVatExemptionReasonM99);//M99 }
//FT: Vats void buttonPrintInvoiceVat_Clicked(object sender, EventArgs e) { Guid documentTypeGuid = SettingsApp.XpoOidDocumentFinanceTypeInvoice; Guid customerGuid = new Guid("6223881a-4d2d-4de4-b254-f8529193da33"); Guid vatExemptionReasonGuid = new Guid("8311ce58-50ee-4115-9cf9-dbca86538fdd"); fin_configurationvatexemptionreason vatExemptionReason = (fin_configurationvatexemptionreason)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_configurationvatexemptionreason), vatExemptionReasonGuid); //Article:Line1 Guid articleREDGuid = new Guid("72e8bde8-d03b-4637-90f1-fcb265658af0"); fin_article articleRED = (fin_article)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_article), articleREDGuid); //Article:Line2 Guid articleISEGuid = new Guid("78638720-e728-4e96-8643-6d6267ff817b"); fin_article articleISE = (fin_article)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_article), articleISEGuid); //Article:Line3 Guid articleINTGuid = new Guid("bf99351b-1556-43c4-a85c-90082fb02d05"); fin_article articleINT = (fin_article)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_article), articleINTGuid); //Article:Line4 Guid articleNORGuid = new Guid("6b547918-769e-4f5b-bcd6-01af54846f73"); fin_article articleNOR = (fin_article)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_article), articleNORGuid); //Place Guid placeGuid = new Guid("dd5a3869-db52-42d4-bbed-dec4adfaf62b"); //Table Guid tableGuid = new Guid("64d417f6-ff97-4f4b-bded-4bc9bf9f18d9"); //Get ArticleBag ArticleBag articleBag = new ArticleBag(); articleBag.Add(articleRED, placeGuid, tableGuid, PriceType.Price1, 1.0m); articleBag.Add(articleISE, placeGuid, tableGuid, PriceType.Price1, 1.0m, vatExemptionReason); articleBag.Add(articleINT, placeGuid, tableGuid, PriceType.Price1, 1.0m); articleBag.Add(articleNOR, placeGuid, tableGuid, PriceType.Price1, 1.0m); //Prepare ProcessFinanceDocumentParameter ProcessFinanceDocumentParameter processFinanceDocumentParameter = new ProcessFinanceDocumentParameter( documentTypeGuid, articleBag) { Customer = customerGuid, SourceMode = PersistFinanceDocumentSourceMode.CustomArticleBag }; fin_documentfinancemaster resultDocument = FrameworkCalls.PersistFinanceDocument(SourceWindow, processFinanceDocumentParameter); }
public void Add(fin_article pArticle, Guid pPlaceOid, Guid pTableOid, PriceType pPriceType, decimal pQuantity, fin_configurationvatexemptionreason pVatExemptionReason) { ArticleBagKey articleBagKey; ArticleBagProperties articleBagProps; //Get Place Object to extract TaxSellType Normal|TakeWay pos_configurationplace configurationPlace = (pos_configurationplace)GlobalFramework.SessionXpo.GetObjectByKey(typeof(pos_configurationplace), pPlaceOid); TaxSellType taxSellType = (configurationPlace.MovementType.VatDirectSelling) ? TaxSellType.TakeAway : TaxSellType.Normal; PriceProperties priceProperties = FrameworkUtils.GetArticlePrice(pArticle, taxSellType); //Prepare articleBag Key and Props articleBagKey = new ArticleBagKey( pArticle.Oid, pArticle.Designation, priceProperties.PriceNet, priceProperties.DiscountArticle, priceProperties.Vat, pVatExemptionReason.Oid ); articleBagProps = new ArticleBagProperties( pPlaceOid, pTableOid, pPriceType, pArticle.Code, pQuantity, pArticle.UnitMeasure.Acronym ); //Send to Bag Add(articleBagKey, articleBagProps); }
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 = resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_insert_articles"); //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); }
private void InitUI() { //Init Local Vars //Default Values (INSERT) fin_article initialValueSelectArticle = (_dataSourceRow["Article.Code"] as fin_article); string initialValuePrice = FrameworkUtils.DecimalToString(0); string initialValuePriceDisplay = FrameworkUtils.DecimalToString(0); string initialValueQuantity = FrameworkUtils.DecimalToString(0); string initialValueDiscount = FrameworkUtils.DecimalToString(0); string initialValueTotalNet = FrameworkUtils.DecimalToString(0); string initialValueTotalFinal = FrameworkUtils.DecimalToString(0); string initialValueNotes = string.Empty; fin_configurationvatrate initialValueSelectConfigurationVatRate = (fin_configurationvatrate)GlobalFramework.SessionXpo.GetObjectByKey(typeof(fin_configurationvatrate), SettingsApp.XpoOidArticleDefaultVatDirectSelling); fin_configurationvatexemptionreason initialValueSelectConfigurationVatExemptionReason = null; //Update Record : Override Default Values if (initialValueSelectArticle != null && initialValueSelectArticle.Oid != Guid.Empty) { //Always display Values from DataRow, for Both INSERT and UPDATE Modes, We Have defaults comming from ColumnProperties initialValuePrice = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["Price"].ToString()); initialValuePriceDisplay = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["PriceDisplay"].ToString()); initialValueQuantity = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["Quantity"].ToString()); initialValueDiscount = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["Discount"].ToString()); initialValueTotalNet = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["TotalNet"].ToString()); initialValueTotalFinal = FrameworkUtils.StringToDecimalAndToStringAgain(_dataSourceRow["TotalFinal"].ToString()); initialValueSelectConfigurationVatRate = (_dataSourceRow["ConfigurationVatRate.Value"] as fin_configurationvatrate); initialValueSelectConfigurationVatExemptionReason = (_dataSourceRow["VatExemptionReason.Acronym"] as fin_configurationvatexemptionreason); initialValueNotes = _dataSourceRow["Notes"].ToString(); //Required, Else Wrong Calculation in UPDATES, when Price is not Defined : //Reverse Price if not in default System Currency, else use value from Input _articlePrice = (_currencyDefaultSystem == _currencyDisplay) ? FrameworkUtils.StringToDecimal(initialValuePriceDisplay) : (FrameworkUtils.StringToDecimal(initialValuePriceDisplay) / _currencyDisplay.ExchangeRate) ; } //Initialize crudWidgetsList _crudWidgetList = new GenericCRUDWidgetListDataTable(); //TK016251 - FrontOffice - Criar novo documento com auto-complete para artigos e clientes //Select ArticleCode fin_article articles = null; SortingCollection sortCollection = new SortingCollection(); sortCollection.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending)); CriteriaOperator criteria = CriteriaOperator.Parse(string.Format("(Disabled = 0 OR Disabled IS NULL)")); ICollection collectionCustomers = GlobalFramework.SessionXpo.GetObjects(GlobalFramework.SessionXpo.GetClassInfo(typeof(fin_article)), criteria, sortCollection, int.MaxValue, false, true); foreach (fin_article item in collectionCustomers) { articles = item; } articles.Code = ""; CriteriaOperator criteriaOperatorSelectArticle = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled <> 1)"); _entryBoxSelectArticleCode = new XPOEntryBoxSelectRecord <fin_article, TreeViewArticle>(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_article_code"), "Code", "Oid", articles, criteriaOperatorSelectArticle); _entryBoxSelectArticleCode.Entry.IsEditable = true; _entryBoxSelectArticleCode.WidthRequest = 149; //Add to WidgetList _crudWidgetSelectArticleCode = new GenericCRUDWidgetDataTable(_entryBoxSelectArticleCode, _entryBoxSelectArticleCode.Label, _dataSourceRow, "Oid", _regexGuid, true); _crudWidgetList.Add(_crudWidgetSelectArticleCode); //Used only to Update DataRow Column from Widget : Used to force Assign XPGuidObject ChildNames to Columns _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxSelectArticleCode, new Label(), _dataSourceRow, "Article.Code")); _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxSelectArticleCode, new Label(), _dataSourceRow, "Article.Designation")); //Events _entryBoxSelectArticleCode.ClosePopup += _entryBoxSelectArticleCode_ClosePopup; //Select Article Name _entryBoxSelectArticle = new XPOEntryBoxSelectRecord <fin_article, TreeViewArticle>(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_article"), "Designation", "Oid", initialValueSelectArticle, criteriaOperatorSelectArticle); _entryBoxSelectArticle.Entry.IsEditable = true; //Add to WidgetList _crudWidgetSelectArticle = new GenericCRUDWidgetDataTable(_entryBoxSelectArticle, _entryBoxSelectArticle.Label, _dataSourceRow, "Oid", _regexGuid, true); _crudWidgetList.Add(_crudWidgetSelectArticle); //Used only to Update DataRow Column from Widget : Used to force Assign XPGuidObject ChildNames to Columns _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxSelectArticle, new Label(), _dataSourceRow, "Article.Code")); _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxSelectArticle, new Label(), _dataSourceRow, "Article.Designation")); //Events _entryBoxSelectArticle.ClosePopup += _entryBoxSelectArticle_ClosePopup; //Price : Used only in Debug Mode, to Inspect SystemCurrency Values : To View add it to hboxPriceQuantityDiscountAndTotals.PackStart //Note #1 //Removed. this will trigger an error when use a zero Price WayBill to issue an Invoice, better use discount 100% //If not Saft Document Type 2, required greater than zero in Price, else we can have zero or greater from Document Type 2 (ex Transportation Guide) //string regExPrice = (!_listSaftDocumentType2.Contains(_documentFinanceType.Oid.ToString())) ? _regexDecimalGreaterThanZero : _regexDecimalGreaterEqualThanZero; // Now all regExPrice must be greater than Zero string regExPrice = _regexDecimalGreaterThanZero; _entryBoxValidationPrice = new EntryBoxValidation(this, "Price EUR(*)", KeyboardMode.Money, regExPrice, true); _entryBoxValidationPrice.EntryValidation.Text = initialValuePrice; _entryBoxValidationPrice.EntryValidation.Sensitive = false; //Add to WidgetList _crudWidgetPrice = new GenericCRUDWidgetDataTable(_entryBoxValidationPrice, _entryBoxValidationPrice.Label, _dataSourceRow, "Price", regExPrice, true); _crudWidgetList.Add(_crudWidgetPrice); //PriceDisplay //Note #1 //If not Saft Document Type 2, required greater than zero in Price, else we can have zero or greater from Document Type 2 (ex Transportation Guide) _entryBoxValidationPriceDisplay = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_price"), KeyboardMode.Money, regExPrice, true); _entryBoxValidationPriceDisplay.EntryValidation.Text = initialValuePriceDisplay; //Add to WidgetList _crudWidgetPriceDisplay = new GenericCRUDWidgetDataTable(_entryBoxValidationPriceDisplay, _entryBoxValidationPriceDisplay.Label, _dataSourceRow, "PriceDisplay", regExPrice, true); _crudWidgetList.Add(_crudWidgetPriceDisplay); //Events _entryBoxValidationPriceDisplay.EntryValidation.Changed += delegate { if (_crudWidgetPriceDisplay.Validated) { //Reverse Price if not in default System Currency, else use value from Input _articlePrice = (_currencyDefaultSystem == _currencyDisplay) ? FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) : (FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) / _currencyDisplay.ExchangeRate); //Assign to System Currency Price _entryBoxValidationPrice.EntryValidation.Text = FrameworkUtils.DecimalToString(_articlePrice); UpdatePriceProperties(); } }; _entryBoxValidationPriceDisplay.EntryValidation.FocusOutEvent += delegate { _entryBoxValidationPriceDisplay.EntryValidation.Text = FrameworkUtils.StringToDecimalAndToStringAgain(_entryBoxValidationPriceDisplay.EntryValidation.Text); }; //Start with _articlePrice Assigned: DISABLED //_articlePrice = (_currencyDefaultSystem == _currencyDisplay) // ? FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) // : (FrameworkUtils.StringToDecimal(_entryBoxValidationPriceDisplay.EntryValidation.Text) / _currencyDisplay.ExchangeRate) // ; //Quantity _entryBoxValidationQuantity = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_quantity"), KeyboardMode.Numeric, _regexDecimalGreaterThanZero, true); _entryBoxValidationQuantity.EntryValidation.Text = initialValueQuantity; //Add to WidgetList _crudWidgetQuantity = new GenericCRUDWidgetDataTable(_entryBoxValidationQuantity, _entryBoxValidationQuantity.Label, _dataSourceRow, "Quantity", _regexDecimalGreaterThanZero, true); _crudWidgetList.Add(_crudWidgetQuantity); //Events _entryBoxValidationQuantity.EntryValidation.Changed += delegate { UpdatePriceProperties(); }; _entryBoxValidationQuantity.EntryValidation.FocusOutEvent += delegate { _entryBoxValidationQuantity.EntryValidation.Text = FrameworkUtils.StringToDecimalAndToStringAgain(_entryBoxValidationQuantity.EntryValidation.Text); }; //Discount _entryBoxValidationDiscount = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_discount"), KeyboardMode.Numeric, _regexPercentage, true); _entryBoxValidationDiscount.EntryValidation.Text = initialValueDiscount; //Add to WidgetList _crudWidgetDiscount = new GenericCRUDWidgetDataTable(_entryBoxValidationDiscount, _entryBoxValidationDiscount.Label, _dataSourceRow, "Discount", _regexPercentage, true); _crudWidgetList.Add(_crudWidgetDiscount); //Events _entryBoxValidationDiscount.EntryValidation.Changed += delegate { UpdatePriceProperties(); }; _entryBoxValidationDiscount.EntryValidation.FocusOutEvent += delegate { _entryBoxValidationDiscount.EntryValidation.Text = FrameworkUtils.StringToDecimalAndToStringAgain(_entryBoxValidationDiscount.EntryValidation.Text); }; //TotalNet _entryBoxValidationTotalNet = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_total_article_tab"), KeyboardMode.None);/* IN009206 */ _entryBoxValidationTotalNet.EntryValidation.Text = initialValueTotalNet; _entryBoxValidationTotalNet.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationTotalNet, new Label(), _dataSourceRow, "TotalNet")); //TotalFinal _entryBoxValidationTotalFinal = new EntryBoxValidation(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_total_per_item_vat"), KeyboardMode.None); /* IN009206 */ _entryBoxValidationTotalFinal.EntryValidation.Text = initialValueTotalFinal; _entryBoxValidationTotalFinal.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationTotalFinal, new Label(), _dataSourceRow, "TotalFinal")); //TK016251 - FrontOffice - Criar novo documento com auto-complete para artigos e clientes //HBox ArticleCodeAndArticleName HBox ArticleCodeAndArticleName = new HBox(false, 0); //Invisible, only used to Debug, to View Values in System Currency //hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationPrice, true, true, 0); ArticleCodeAndArticleName.PackStart(_entryBoxSelectArticleCode, false, false, 0); ArticleCodeAndArticleName.PackStart(_entryBoxSelectArticle, true, true, 0); //HBox PriceQuantityDiscountAndTotals HBox hboxPriceQuantityDiscountAndTotals = new HBox(true, 0); //Invisible, only used to Debug, to View Values in System Currency //hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationPrice, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationPriceDisplay, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationQuantity, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationDiscount, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationTotalNet, true, true, 0); hboxPriceQuantityDiscountAndTotals.PackStart(_entryBoxValidationTotalFinal, true, true, 0); //SelectVatRate CriteriaOperator criteriaOperatorSelectVatRate = CriteriaOperator.Parse("(Disabled = 0 OR Disabled IS NULL)"); _entryBoxSelectVatRate = new XPOEntryBoxSelectRecord <fin_configurationvatrate, TreeViewConfigurationVatRate>(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_vat_rate"), "Designation", "Oid", initialValueSelectConfigurationVatRate, criteriaOperatorSelectVatRate); _entryBoxSelectVatRate.WidthRequest = 149; _entryBoxSelectVatRate.Entry.IsEditable = false; _entryBoxSelectVatRate.Entry.Changed += _entryBoxSelectVatRate_EntryValidation_Changed; //Add to WidgetList _crudWidgetSelectVatRate = new GenericCRUDWidgetDataTable(_entryBoxSelectVatRate, _entryBoxSelectVatRate.Label, _dataSourceRow, "ConfigurationVatRate.Value", _regexGuid, true); _crudWidgetList.Add(_crudWidgetSelectVatRate); //SelectVatExemptionReason CriteriaOperator criteriaOperatorSelectVatExemptionReason = CriteriaOperator.Parse("(Disabled = 0 OR Disabled IS NULL)"); _entryBoxSelectVatExemptionReason = new XPOEntryBoxSelectRecord <fin_configurationvatexemptionreason, TreeViewConfigurationVatExceptionReason>(this, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_vat_exemption_reason"), "Designation", "Oid", initialValueSelectConfigurationVatExemptionReason, criteriaOperatorSelectVatExemptionReason); _entryBoxSelectVatExemptionReason.Entry.IsEditable = false; //Add to WidgetList _crudWidgetSelectVatExemptionReason = new GenericCRUDWidgetDataTable(_entryBoxSelectVatExemptionReason, _entryBoxSelectVatExemptionReason.Label, _dataSourceRow, "VatExemptionReason.Acronym", _regexGuid, true); _crudWidgetList.Add(_crudWidgetSelectVatExemptionReason); //ToggleMode: Edit Active/Inactive ToggleVatExemptionReasonEditMode(); //HBox VatRateAndVatExemptionReason HBox hboxVatRateAndVatExemptionReason = new HBox(false, 0); hboxVatRateAndVatExemptionReason.PackStart(_entryBoxSelectVatRate, false, false, 0); hboxVatRateAndVatExemptionReason.PackStart(_entryBoxSelectVatExemptionReason, true, true, 0); //Token1 _entryBoxValidationToken1 = new EntryBoxValidation(this, "Token1", KeyboardMode.None); _entryBoxValidationToken1.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationToken1, new Label(), _dataSourceRow, "Token1")); //Token2 _entryBoxValidationToken2 = new EntryBoxValidation(this, "Token2", KeyboardMode.None); _entryBoxValidationToken2.EntryValidation.Sensitive = false; //Used only to Update DataRow Column from Widget _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationToken2, new Label(), _dataSourceRow, "Token2")); //Notes _entryBoxValidationNotes = new EntryBoxValidation(this, "Notes", KeyboardMode.AlfaNumeric, SettingsApp.RegexAlfaNumericExtended, false); _entryBoxValidationNotes.EntryValidation.Text = initialValueNotes; _crudWidgetList.Add(new GenericCRUDWidgetDataTable(_entryBoxValidationNotes, new Label(), _dataSourceRow, "Notes")); //Uncomment to Show Invisible Widgets //HBox Token1AndToken2 //HBox hboxToken1AndToken2 = new HBox(false, 0); //hboxToken1AndToken2.PackStart(_entryBoxToken1, false, false, 0); //hboxToken1AndToken2.PackStart(_entryBoxToken2, true, true, 0); //Pack in VBox _vboxEntrys = new VBox(true, 0); _vboxEntrys.PackStart(ArticleCodeAndArticleName); _vboxEntrys.PackStart(hboxPriceQuantityDiscountAndTotals); _vboxEntrys.PackStart(hboxVatRateAndVatExemptionReason); //Uncomment to Show Invisible Widgets //_vboxEntrys.PackStart(hboxToken1AndToken2); _vboxEntrys.PackStart(_entryBoxValidationNotes); _vboxEntrys.WidthRequest = _windowSize.Width - 13; // CreditNote : Protect all components, only Quantity is Editable in CreditMode if (_documentFinanceType.Oid == SettingsApp.XpoOidDocumentFinanceTypeCreditNote) { //Article _entryBoxSelectArticle.Entry.Sensitive = false; _entryBoxSelectArticle.ButtonSelectValue.Sensitive = false; //PriceDisplay _entryBoxValidationPriceDisplay.EntryValidation.Sensitive = false; _entryBoxValidationPriceDisplay.ButtonKeyBoard.Sensitive = false; //Discount _entryBoxValidationDiscount.EntryValidation.Sensitive = false; _entryBoxValidationDiscount.ButtonKeyBoard.Sensitive = false; //VatRate _entryBoxSelectVatRate.Entry.Sensitive = false; _entryBoxSelectVatRate.ButtonSelectValue.Sensitive = false; //VatExemptionReason _entryBoxSelectVatExemptionReason.Entry.Sensitive = false; _entryBoxSelectVatExemptionReason.ButtonSelectValue.Sensitive = false; } }