AR Received Payment: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 7: Line 7:
# Payment net total must be the sum of Payment Amount in '''Payment Detail'''
# Payment net total must be the sum of Payment Amount in '''Payment Detail'''
# Total of '''knockoff Amount''' must not exceed the sum of Payment Amount.
# Total of '''knockoff Amount''' must not exceed the sum of Payment Amount.
# '''Payment Method''' is created in ''General Maintenance | '''Payment Method Maintenance'''''.


==Assemblies in AutoCount Accounting version 1.8==
==Assemblies in AutoCount Accounting version 1.8==
Line 20: Line 21:
==AR Payment API Usage==
==AR Payment API Usage==
===New===
===New===
<syntaxhighlight lang="csharp">
public void NewARPayment(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting);
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPayment = arPaymentDA.NewARPayment();
// If you want to set your own Payment No, uncomment the next line, otherwise, the system will use automatic running number.
// arPayment.DocNo = “TEST-0001″;
arPayment.DebtorCode = "300-A001";

// Add one payment detail
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetail = arPayment.NewDetail();
arPaymentDetail.PaymentMethod = "CASH";
arPaymentDetail.PaymentAmt = 100;
arPaymentDetail.ChequeNo = "MBB 123456";
arPayment.KnockOff(BCE.AutoCount.Document.DocumentType.ARInvoice, "TEST - 0001", 100);
arPaymentDA.SaveARPayment(arPayment, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
}
</syntaxhighlight>
===Edit===
===Edit===
<syntaxhighlight lang="csharp">
public void EditARPayment(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting);
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPayment = arPaymentDA.GetARPayment("TEST-0001");
// if arPayment == null, it means the AR Payment is not found.
if (arPayment == null)
return;

arPayment.ClearDetails();
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetail = arPayment.NewDetail();
arPaymentDetail.PaymentMethod = "CARD";
arPaymentDetail.PaymentAmt = 600;
arPaymentDA.SaveARPayment(arPayment, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
}
</syntaxhighlight>
===Delete===
===Delete===
===Cancel===
===Cancel===


==Sample Code for Testing==
==Sample Code with Data Model for Testing==
In this sample code provide the concept of how to create a new AR Payment with tested data.
In this sample code provide the concept of how to create a new AR Payment with tested data.
===Test Sample Result===
===Test Sample Result===