Esempio n. 1
0
        private CalCommissionClient CalculateCommissionInvTran(InvTransClient tran, EmployeeCommission commission)
        {
            double amount;

            if (commission._FixedPrice != 0)
            {
                amount = -commission._FixedPrice * tran._Qty;
            }
            else
            {
                if (commission._IsRevenue)
                {
                    amount = tran._NetAmount() * commission._Rate / -100d;
                }
                else
                {
                    amount = tran.Margin * commission._Rate / -100d;
                }
            }
            if (amount == 0)
            {
                return(null);
            }

            var calCom = new CalCommissionClient();

            calCom.SetMaster(tran);
            calCom._InvoiceNumber = tran._InvoiceNumber;
            calCom._Commission    = Math.Round(amount, 2);
            return(calCom);
        }
Esempio n. 2
0
        private async void MarkOrderLineAgainstIT(InvTransClient selectedItem)
        {
            busyIndicator.IsBusy = true;
            Task <ErrorCodes> t;

            if (debtorOrderLine != null)
            {
                t = (new Uniconta.API.DebtorCreditor.OrderAPI(api)).MarkedOrderLineAgainstInvTrans(debtorOrderLine, selectedItem);
            }
            else
            {
                t = (new Uniconta.API.Inventory.TransactionsAPI(api)).MarkInvTransAgainstInvTrans(invtrans, selectedItem);
            }
            var err = await t;

            busyIndicator.IsBusy = false;
            if (err != ErrorCodes.Succes)
            {
                UtilDisplay.ShowErrorCode(err);
            }
            else
            {
                CloseDockItem();
            }
        }
        async private void JournalPosted(InvTransClient selectedItem)
        {
            var result = await api.Query(new GLDailyJournalPostedClient(), new UnicontaBaseEntity[] { selectedItem }, null);

            if (result != null && result.Length == 1)
            {
                CWGLPostedClientFormView cwPostedClient = new CWGLPostedClientFormView(result[0]);
                cwPostedClient.Show();
            }
        }
Esempio n. 4
0
        public InvTransMarkedPage(BaseAPI api, InvTransClient line) : base(api, null)
        {
            InitializeComponent();
            var lines = new List <InvTransClient>()
            {
                line
            };

            dgInvTransGrid.IsProject = false;
            dgInvTransGrid.SetSource(lines.ToArray());
            SetRibbonControl(localMenu, dgInvTransGrid);
            dgInvTransGrid.Readonly = true;
        }
        async void MarkedInvTrans(ProductionOrderLineClient selectedItem)
        {
            busyIndicator.IsBusy = true;
            var      invTrans = new InvTransClient();
            OrderAPI orderApi = new OrderAPI(api);
            var      res      = await orderApi.GetMarkedInvTrans(selectedItem, invTrans);

            busyIndicator.IsBusy = false;
            if (res == ErrorCodes.Succes)
            {
                AddDockItem(TabControls.InvTransMarkedPage, new object[] { api, invTrans }, string.Format("{0}: {1}", Uniconta.ClientTools.Localization.lookup("InvTransactions"), invTrans._OrderNumber));
            }
            else
            {
                UtilDisplay.ShowErrorCode(res);
            }
        }
        private async void MarkOrderLineAgainstIT(InvTransClient selectedItem)
        {
            OrderAPI orderApi = new OrderAPI(api);

            busyIndicator.IsBusy = true;
            var err = await orderApi.MarkedOrderLineAgainstInvTrans(debtorOrderLine, selectedItem);

            busyIndicator.IsBusy = false;
            if (err != ErrorCodes.Succes)
            {
                UtilDisplay.ShowErrorCode(err);
            }
            else
            {
                dockCtrl.CloseDockItem();
            }
        }