Beispiel #1
0
        //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 = 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_vat_rate
            });
            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
                );

            //Protected Records
            ProtectedRecords.Add(SettingsApp.XpoOidConfigurationVatExemptionReasonM99);//M99
        }
Beispiel #2
0
        //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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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();

            //SelectArticle
            CriteriaOperator criteriaOperatorSelectArticle = CriteriaOperator.Parse("(Disabled IS NULL OR Disabled  <> 1)");

            _entryBoxSelectArticle = new XPOEntryBoxSelectRecord <FIN_Article, TreeViewArticle>(this, Resx.global_article, "Designation", "Oid", initialValueSelectArticle, criteriaOperatorSelectArticle);
            _entryBoxSelectArticle.Entry.IsEditable = false;
            //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.Numeric, 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, Resx.global_price, KeyboardMode.Numeric, 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, Resx.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, Resx.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); };

            //TotalGross
            _entryBoxValidationTotalNet = new EntryBoxValidation(this, Resx.global_totalnet, KeyboardMode.None);
            _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, Resx.global_total, KeyboardMode.None);
            _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"));

            //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, Resx.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, Resx.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(_entryBoxSelectArticle);
            _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;
            }
        }
Beispiel #5
0
        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);
        }