void LoadOrgs()
        {
            try
            {
                CashMode mode = FilterSuppliers.IsChecked == true ? CashMode.Expense : CashMode.Neutral;

                switch (mode)
                {
                case CashMode.Expense:
                    textAccountCode.ItemsSource = tcBitcoin.NodeCash.vwOrgLists
                                                  .Where(tb => tb.CashModeCode == (short)mode && (tb.OrganisationStatusCode == 1 || tb.OrganisationStatusCode == 2))
                                                  .OrderBy(tb => tb.AccountCode)
                                                  .Select(account => TCBitcoin.EmbedKey(account.AccountCode, $"{account.AccountName} ({account.OrganisationType})"))
                                                  .ToList();
                    break;

                default:
                    textAccountCode.ItemsSource = tcBitcoin.NodeCash.vwOrgLists
                                                  .OrderBy(tb => tb.AccountCode)
                                                  .Select(account => TCBitcoin.EmbedKey(account.AccountCode, $"{account.AccountName} ({account.OrganisationType})"))
                                                  .ToList();
                    break;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show($"{err.Message}", $"{err.Source}.{err.TargetSite.Name}", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Beispiel #2
0
        public InvoicesControl(TreeView treeView, TCBitcoin bitcoin, CashMode cashMode)
        {
            tvWallet  = treeView;
            tcBitcoin = bitcoin;
            Polarity  = cashMode;

            InitializeComponent();
        }
Beispiel #3
0
        public InvoiceType GetInvoiceType(CashMode invoicePolarity, CashMode paymentPolarity)
        {
            switch (invoicePolarity)
            {
            case CashMode.Expense:
                return(paymentPolarity == CashMode.Expense ? InvoiceType.PurchaseInvoice : InvoiceType.DebitNote);

            case CashMode.Income:
                return(paymentPolarity == CashMode.Income ? InvoiceType.SalesInvoice : InvoiceType.CreditNote);

            default:
                return(InvoiceType.SalesInvoice);
            }
        }