Ejemplo n.º 1
0
 private void ReceivePayments(ListInvoiceItemsViewModel invoiceItem)
 {
     if (!CanReceivePayments)
     {
         MessageBox.Show("Sorry, you do not have sufficient rights to perform this action.", "Distributr: Payments Module",
                          MessageBoxButton.OK);
         return;
     }
     else
     {
         if (invoiceItem.HasUnconfirmedPayment)
         {
             MessageBox.Show("NOTE: \nThere are unconfirmed payments for this invoice.", "Distributr: Payments Module",
                         MessageBoxButton.OK);
         }
         Submitpayments(invoiceItem);
     }
 }
Ejemplo n.º 2
0
        void Submitpayments(ListInvoiceItemsViewModel invoiceItem)
        {
            PaymentInfoList.Clear();
            try
            {
                using (var container = NestedContainer)
                {
                    BasicConfig config = container.GetInstance<IConfigService>().Load();
                    var payInfo = Using<IPaymentPopup>(container).GetPayments(invoiceItem.AmountDue, invoiceItem.InvoiceOrderId);
                    foreach (var paymentInfo in payInfo)
                    {
                        if (!PaymentInfoList.Contains(paymentInfo))
                            PaymentInfoList.Add(paymentInfo);
                    }
                    var order = Using<IMainOrderRepository>(container).GetById(invoiceItem.InvoiceOrderId);
                    var posWorkflow = Using<IOrderPosWorkflow>(container);
                    if (order != null)
                    {
                        foreach (var paymentInfo in PaymentInfoList.Where(p => p.PaymentModeUsed != PaymentMode.Credit))
                        {
                            paymentInfo.InvoiceId = invoiceItem.Id;
                            order.AddPayment(paymentInfo);
                        }
                        posWorkflow.Submit(order,config);
                        RunLoadInvoices();
                    }

                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
 private void ViewSelectedInvoice(ListInvoiceItemsViewModel selectedItem)
 {
     const string uri = "/views/invoicedocument/invoicedocument.xaml";
     Messenger.Default.Send<ViewModelMessage>(new ViewModelMessage { Id = selectedItem.InvoiceOrderId });
     NavigateCommand.Execute(uri);
 }