Difference between revisions of "AP Deposit API v2"

Jump to navigation Jump to search
no edit summary
 
(One intermediate revision by the same user not shown)
catch (AutoCount.AppException ex)
{
AutoCount.AppMessage.ShowMessage("Error when create new AP Deposit.\n" + ex.Message);
}
}
</syntaxhighlight>
====New AP Deposit with Refund====
<syntaxhighlight lang="csharp" highlight="21-27">
public void NewWithRefund(AutoCount.Authentication.UserSession userSession)
{
AutoCount.ARAP.APDeposit.APDepositCommand cmd =
AutoCount.ARAP.APDeposit.APDepositCommand.Create(userSession, userSession.DBSetting);
AutoCount.ARAP.APDeposit.APDeposit doc = cmd.AddNew();
AutoCount.ARAP.APDeposit.APDepositDetail dtl = null;
AutoCount.ARAP.APDeposit.APDepositRefund refund = null;
AutoCount.ARAP.APDeposit.APDepositRefundDetail refundDtl = null;
 
doc.DepositPaymentMethod = "DEPOSIT PAYABLE";
doc.DocDate = new DateTime(2018, 6, 25);
doc.CreditorCode = "400-X001";
doc.Attention = "Jerry";
doc.Description = "Deposit to ordering of books";
 
//Add a payment that is made for this deposit
dtl = doc.AddDetail();
dtl.PaymentMethod = "BANK";
dtl.PaymentAmt = 200M;
 
//Refund
refund = doc.AddRefund();
refund.DocDate = new DateTime(2018, 6, 25);
refund.Description = "Refund received from Jerry";
refundDtl = refund.AddRefundDetail();
refundDtl.PaymentMethod = "CASH";
refundDtl.PaymentAmount = 50.00M;
 
try
{
doc.Save();
//Log success
AutoCount.AppMessage.ShowMessage($"New AP Deposit '{doc.DocNo}' is created.");
}
catch (AutoCount.AppException ex)
{
//Log error
AutoCount.AppMessage.ShowMessage("Error when create new AP Deposit.\n" + ex.Message);
}
authors, Bureaucrats, Confirmed users, Rollbackers, Administrators
2,373

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu