AR Received Payment: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 79:
==Sample Code with Data Model for Testing==
This sample code provides the example of creating new AR Payment with tested data.
===Test Data Result Screenshot===
[[File:ProgrammerNewARPayment1.PNG|link=]]
 
===AssignHome Testcurrency Dataonly sample===
====Test Data Result Screenshot====
[[File:ProgrammerNewARPayment1.PNG|link=]]
====Test Data====
<syntaxhighlight lang="csharp">
public void MainEntry(BCE.Data.DBSetting dbSetting)
Line 113 ⟶ 114:
 
//Create New ARPayment in AutoCount Accounting
NewARPayment(source, dbSetting);
}
</syntaxhighlight>
----
===Foreign Customer and payment in customer currency===
====Test Data Result Screenshot====
[[File:ProgrammerNewARPayment2.PNG|link=]]<br/>
A payment of SGD100.00 knockoff 2 outstanding invoices, which both invoices currency rate is 3.2.
 
[[File:ProgrammerNewARPayment3.PNG|link=]]<br />
AutoCount Accounting auto generate Loss in foreign currency transaction.<br />
This is because the currency rate when invoice was issued is 3.2, whereas the payment currency rate is 3.1.
====Test Data====
<syntaxhighlight lang="csharp">
public void MainEntry(BCE.Data.DBSetting dbSetting)
{
ARPaymentSource source = new ARPaymentSource()
{
//Singapore customer, payment in Singapore Dollar
DebtorCode = "300-S001",
Description = "Payment Received - Test Data",
DocumentDate = new DateTime(2017, 12, 21),
 
//If Payment Currency is same as Debtor Currency,
//"PaymentCurrencyCode" can be excluded
PaymentCurrencyCode = "SGD",
PaymentToHomeCurrencyRate = 3.1M,
};
 
source.PaymentDetail.Add(new ARPaymentDetailSource()
{
PaymentMethod = "BANK",
ChequeNo = "SGB0009",
PaymentAmount = 100, //Currency in SGD
});
 
//Document type is required for document knockoff
source.PaymentKnockoff.Add(new PaymentKnockoffSource()
{
DocType = PaymentKnockoffSource.ARInvoiceDocType, DocNo = "I-000017", Amount = 70
});
source.PaymentKnockoff.Add(new PaymentKnockoffSource()
{
DocType = PaymentKnockoffSource.ARInvoiceDocType, DocNo = "I-000018", Amount = 30
});
 
NewARPayment(source, dbSetting);
}