Пример #1
0
        async private void JournalPosted(CreditorTransClient 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();
            }
        }
Пример #2
0
        async void ShowInvoiceLines(CreditorTransClient creditorTrans)
        {
            var creditorInvoice = await api.Query <CreditorInvoiceClient>(new UnicontaBaseEntity[] { creditorTrans }, null);

            if (creditorInvoice != null && creditorInvoice.Length > 0)
            {
                var credInv = creditorInvoice[0];
                AddDockItem(TabControls.CreditorInvoiceLine, credInv, string.Format("{0}: {1}", Uniconta.ClientTools.Localization.lookup("InvoiceNumber"), credInv.InvoiceNum));
            }
        }
        private void Initialize(UnicontaBaseEntity master)
        {
            InitializeComponent();
            rApi        = new ReportAPI(api);
            this.master = new CreditorTransClient();
            StreamingManager.Copy(master, this.master);
            localMenu.dataGrid = dgSettlements;
            dgSettlements.api  = api;
            SetRibbonControl(localMenu, dgSettlements);
            localMenu.OnItemClicked    += localMenu_OnItemClicked;
            dgSettlements.BusyIndicator = busyIndicator;
            var Comp = api.CompanyEntity;

            if (Comp.RoundTo100)
            {
                Amount.HasDecimals = Remaining.HasDecimals = Debit.HasDecimals = Credit.HasDecimals = false;
            }
        }
        private void localMenu_OnItemClicked(string ActionType)
        {
            CreditorTransClient trans = dgSettlements.SelectedItem as CreditorTransClient;

            switch (ActionType)
            {
            case "ReOpen":
                if (trans != null)
                {
                    Settle(trans);
                }
                break;

            case "RefreshGrid":
                InitQuery();
                break;

            default:
                gridRibbon_BaseActions(ActionType);
                break;
            }
        }
        async void Settle(CreditorTransClient trans)
        {
            TransactionAPI tranApi = new TransactionAPI(api);
            ErrorCodes     err;

            if (trans.IsSettled)
            {
                err = await tranApi.ReOpen(master, trans);
            }
            else
            {
                err = await tranApi.ReOpen(trans, master);
            }
            if (err != ErrorCodes.Succes)
            {
                UtilDisplay.ShowErrorCode(err);
            }
            else
            {
                InitQuery();
            }
        }
Пример #6
0
        private void localMenu_OnItemClicked(string ActionType)
        {
            CreditorTransClient selectedItem = dgCreditorTrans.SelectedItem as CreditorTransClient;

            switch (ActionType)
            {
            case "ViewDownloadRow":
                if (selectedItem != null)
                {
                    DebtorTransactions.ShowVoucher(dgCreditorTrans.syncEntity, api, busyIndicator);
                }
                break;

            case "Settlements":
                if (selectedItem != null)
                {
                    string header = string.Format("{0} ({1})", Uniconta.ClientTools.Localization.lookup("Settlements"), selectedItem._Voucher);
                    AddDockItem(TabControls.CreditorSettlements, dgCreditorTrans.syncEntity, true, header);
                }
                break;

            case "VoucherTransactions":
                if (selectedItem != null)
                {
                    string vheader = string.Format("{0} ({1})", Uniconta.ClientTools.Localization.lookup("VoucherTransactions"), selectedItem._Voucher);
                    AddDockItem(TabControls.AccountsTransaction, dgCreditorTrans.syncEntity, vheader);
                }
                break;

            case "SaveGrid":
                Save();
                break;

            case "PostedBy":
                if (selectedItem != null)
                {
                    JournalPosted(selectedItem);
                }
                break;

            case "RefreshGrid":
                FilterGrid(gridControl, master == null, false);
                break;

            case "Invoices":
                if (selectedItem != null)
                {
                    string header = string.Format("{0}/{1}", Uniconta.ClientTools.Localization.lookup("CreditorInvoice"), selectedItem._Account);
                    AddDockItem(TabControls.CreditorInvoice, dgCreditorTrans.syncEntity, header);
                }
                break;

            case "InvoiceLine":
                if (selectedItem != null)
                {
                    ShowInvoiceLines(selectedItem);
                }
                break;

            default:
                gridRibbon_BaseActions(ActionType);
                break;
            }
        }