2,743
edits
mNo edit summary |
No edit summary |
||
Line 54:
}
</syntaxhighlight>
===Cancel===
<syntaxhighlight lang="csharp">
Line 71 ⟶ 64:
</syntaxhighlight>
===Delete===
<syntaxhighlight lang="csharp">
{
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess cmd = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting);
cmd.DeleteARPayment("RC-0001", BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
}
</syntaxhighlight>
<br /><br />
==Sample Code with Data for Testing==
This sample code provides the example of creating new AR Payment with tested data.
===Source Data (Example for reference Only)===
'''Source Data''' is
The Source Data designed here is for reference only.
You may either create your own data source, or read from your database and assign value to transaction/document of AutoCount Accounting without source data.
Line 237 ⟶ 155:
//Get the login user id
string userID = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
//Create command object of ARPayment
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess cmd =
Line 305 ⟶ 224:
</syntaxhighlight>
===Home currency only sample===
====Test Data Result Screenshot====
[[File:ProgrammerNewARPayment1.PNG|link=]]
====Test Data====
<syntaxhighlight lang="csharp">
public void MainEntry(BCE.Data.DBSetting dbSetting)
{
ARPaymentSource source = new ARPaymentSource()
{
//Home Currency Debtor, payment with home currency
DebtorCode = "300-A001",
Description = "Payment Received",
DocumentDate = new DateTime(2017, 12, 20),
};
source.PaymentDetail.Add(new ARPaymentDetailSource()
{
PaymentMethod = "BANK",
ChequeNo = "CHQ00012",
PaymentAmount = 100,
BankCharge = 0.50M
});
//Document type is required for document knockoff
source.PaymentKnockoff.Add(new PaymentKnockoffSource()
{
DocType = PaymentKnockoffSource.ARInvoiceDocType, DocNo = "I-000002", Amount = 70
});
source.PaymentKnockoff.Add(new PaymentKnockoffSource()
{
DocType = PaymentKnockoffSource.ARInvoiceDocType, DocNo = "I-000003", Amount = 30
});
//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);
}
</syntaxhighlight>
<br /><br />
==See Also==
* [[AR Debtor]]
|