コード例 #1
0
ファイル: Invoice.cs プロジェクト: saeidghoreshi/partition1
        /*cancelling one payment od invoice at the time*/
        public void cancelInvoicePaymentEXT(int paymentID)
        {
            using (var ctx = new AccContexts())
            using (var ts = new TransactionScope())
            {
                accounting.classes.externalPayment payment = new accounting.classes.externalPayment();
                payment.loadByPaymentID(paymentID);

                List<int> transactions = payment.cancelPayment(enums.paymentAction.Void);

                /*Record Invoice Payment transactions*/
                this.RecordInvoicePaymentTransactions(transactions, paymentID, enums.paymentStat.VoidApproved);

                /*Record Invoice Transaction*/
                if(payment.extPaymentTypeID==(int)enums.extPaymentType.CreditPayment)
                    this.RecordInvoiceTransaction(transactions, enums.invoiceStat.partialCreditCardPaymantCancelled);

                if (payment.extPaymentTypeID == (int)enums.extPaymentType.InteracPayment)
                    this.RecordInvoiceTransaction(transactions, enums.invoiceStat.partialInteracPaymantCancelled);

                ts.Complete();
            }
        }