async void ShowInvoiceLines(CreditorTransOpenClient 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));
            }
        }
        async void Settle()
        {
            if (transOpenMaster != null && settles != null && settles.Count > 0)
            {
                TransactionAPI transApi = new TransactionAPI(api);
                var            err      = await transApi.Settle(transOpenMaster, settles);

                transOpenMaster = null;
                settles         = null;
                UtilDisplay.ShowErrorCode(err);
                InitQuery();
            }
        }
 private void CheckBoxClick(CreditorTransOpenClient rec)
 {
     if (!rec.IsSettled)
     {
         if (transOpenMaster == rec)
         {
             transOpenMaster = null;
             settles         = null;
             var openTrans = dgCreditorTranOpenGrid.ItemsSource as List <CreditorTransOpenClient>;
             foreach (CreditorTransOpenClient openTran in openTrans)
             {
                 openTran.IsSettled = false;
             }
         }
         else if (settles != null && settles.Contains(rec))
         {
             settles.Remove(rec);
         }
     }
     else
     {
         if (transOpenMaster == null)
         {
             transOpenMaster = rec;
         }
         else
         {
             if (settles == null)
             {
                 settles = new List <CreditorTransOpenClient>();
             }
             settles.Add(rec);
         }
     }
     SetStatusText();
 }