private void localMenu_OnItemClicked(string ActionType) { DebtorTransClient selectedItem = dgDebtorTran.SelectedItem as DebtorTransClient; switch (ActionType) { case "ViewDownloadRow": if (selectedItem != null) { ShowVoucher(dgDebtorTran.syncEntity, api, busyIndicator); } break; case "Settlements": if (selectedItem != null) { string header = string.Format("{0} ({1})", Uniconta.ClientTools.Localization.lookup("Settlements"), selectedItem._Voucher); AddDockItem(TabControls.DebtorSettlements, dgDebtorTran.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, dgDebtorTran.syncEntity, vheader); } break; case "InvoiceLine": if (selectedItem != null) { ShowInvoiceLines(selectedItem); } break; case "SaveGrid": Save(); break; case "PostedBy": if (selectedItem != null) { JournalPosted(selectedItem); } break; case "RefreshGrid": FilterGrid(gridControl, master == null, false); break; default: gridRibbon_BaseActions(ActionType); break; } }
async void ShowInvoiceLines(DebtorTransClient debTrans) { var debInvoice = await api.Query <DebtorInvoiceClient>(new UnicontaBaseEntity[] { debTrans }, null); if (debInvoice != null && debInvoice.Length > 0) { var debInv = debInvoice[0]; AddDockItem(TabControls.DebtorInvoiceLines, debInv, string.Format("{0}: {1}", Uniconta.ClientTools.Localization.lookup("InvoiceNumber"), debInv.InvoiceNum)); } }
async private void JournalPosted(DebtorTransClient 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(); } }
private void Initialize(UnicontaBaseEntity master) { InitializeComponent(); rApi = new ReportAPI(api); this.master = new DebtorTransClient(); 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) { DebtorTransClient trans = dgSettlements.SelectedItem as DebtorTransClient; switch (ActionType) { case "ReOpen": if (trans != null) { Settle(trans); } break; case "RefreshGrid": InitQuery(); break; default: gridRibbon_BaseActions(ActionType); break; } }
async void Settle(DebtorTransClient 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(); } }