AR Credit Note v2: Difference between revisions

no edit summary
(Created page with " ==Rules in AR Note== # Net Total of the document is read-only. The calculation of net total is from amount total. # Account No. must not be '''Creditor Code''' and '''Bank or...")
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1:
 
==Technical Specification==
==Rules in AR Note==
# Net Total of the document is read-only. The calculation of net total is from amount total.
# '''Knock Off Date''' must be equal or greater than the document date.
# Account No. must not be '''Creditor Code''' and '''Bank or Cash account'''
# Total of '''Knock Off Amount''' must not exceed the amount of Credit Note.
# Account No. must be a '''leaf account'''
# '''Knock Off Amount''' of the AR Invoice or AR Debit Note must not exceed its remain outstanding.
# '''CN Type''' must be specified.
# Debit A/C (of Detail) does not allow Debtor or Creditor Account.
#:The common reason to select Creditor in Debit A/C of Credit Note is for Contra.
#:To do Contra, create '''[[ARAP Contra Entry v2|A/R and A/P Contra Entry]]'''
# AccountDebit No.A/C must(of notDetail) bedoes '''Creditor Code'''not andallow '''Bank or Cash account'''
#:Related to Bank or Cash transaction must be created at '''[[AR Received Payment v2|AR Received Payment]]'''
# AccountDebit No.A/C (of Detail) must be a '''leaf account'''
 
==References of AutoCount Accounting version 2.0==
Line 9 ⟶ 17:
'''AutoCount.ARAP.dll'''
 
==Item Group API Usage==
===New===
<syntaxhighlight lang="csharp">
Line 18 ⟶ 26:
AutoCount.ARAP.ARCN.ARCNDTLEntity dtl = null;
 
//doc.DebtorCodeDocNo = "300CN-A001Test-0025";
doc.DocDate = new DateTime(2018, 56, 235);
doc.Description = "Interest ChargeDISCOUNT";
doc.Reason = "LateEarly Payment discount";
doc.OurInvoiceNo = "IVI-0001000001";
doc.JournalType = "SALES";
doc.CNType = "DISCOUNT";
 
dtl = doc.NewDetail();
dtl.AccNo//Debit =A/C "580-0002";(of detail)
dtl.DescriptionAccNo = "INTEREST CHARGE520-0000";
dtl.AmountDescription = 0.10M"DISCOUNT ALLOWED";
dtl.AccNoAmount = "580-0002"10M;
 
//Knockoff AR Invoice
//If knockoff date is not defined, it follows system settings in Tools | Options
doc.KnockOff(AutoCount.Document.DocumentType.ARInvoice, "I-000001", 10);
 
try
{
cmd.SaveARCN(doc, userSession.LoginUserID);
//Log success
AutoCount.AppMessage.ShowMessage(ex$"Credit Note {doc.MessageDocNo} Created Successfully.");
}
catch (AutoCount.AppException ex)
{
//Log Failed
AutoCount.AppMessage.ShowMessage(ex.Message);
AutoCount.AppMessage.ShowMessage(ex.Message);
string.Format("Fail to create new Credit Note.\n{0}", ex.Message));
}
}
Line 51 ⟶ 70:
return;
 
//doc.DocDateDocNo = new DateTime(2018, 5, 23)"CN-Test-0025";
doc.DescriptionDocDate = "Interestnew Charge"DateTime(2018, 6, 5);
doc.ReasonDescription = "Late PaymentDISCOUNT";
doc.OurInvoiceNoReason = "IV-000001Special Discount";
doc.OurInvoiceNo = "I-000001";
doc.JournalType = "SALES";
doc.CNType = "DISCOUNT";
 
doc.ClearDetails();
 
dtl.AccNo = "580-0002";
dtl.Description = "INTEREST CHARGE"doc.NewDetail();
dtl.AmountAccNo = 0.50M"520-0000";
dtl.Description = "DISCOUNT ALLOWED";
dtl.Amount = 10M;
 
//Knockoff AR Invoice
//If knockoff date is not defined, it follows system settings in Tools | Options
doc.KnockOff(AutoCount.Document.DocumentType.ARInvoice, "I-000001", 10);
 
try
{
cmd.SaveARCN(doc, userSession.LoginUserID);
//Log success
AutoCount.AppMessage.ShowMessage($"Credit Note '{doc.DocNo}' Updated Successfully.");
}
catch (AutoCount.AppException ex)
{
//Log Failed
AutoCount.AppMessage.ShowMessage(ex.Message);
AutoCount.AppMessage.ShowMessage(
string.Format("Fail to update Credit Note '{0}'.\n{1}", doc.DocNo, ex.Message));
}
}
</syntaxhighlight>
 
===DeleteVoid (Cancel)===
<syntaxhighlight lang="csharp">
public void DeleteARCreditNoteCancelARCreditNote(AutoCount.Authentication.UserSession userSession)
{
string docNo = "CN-000001";
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting);
 
try
{
cmd.DeleteARCNCancelARCN("CN-000001"docNo, userSession.LoginUserID);
AutoCount.AppMessage.ShowMessage($"{docNo} is cancelled.");
}
catch (AutoCount.AppException ex)
Line 89 ⟶ 123:
</syntaxhighlight>
 
===Void (Cancel)Delete===
<syntaxhighlight lang="csharp">
public void CancelARCreditNoteDeleteARCreditNote(AutoCount.Authentication.UserSession userSession)
{
string docNo = "CN-000001";
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting);
 
try
{
cmd.CancelARCNDeleteARCN("CN-000001"docNo, userSession.LoginUserID);
AutoCount.AppMessage.ShowMessage($"{docNo} is deleted.");
}
catch (AutoCount.AppException ex)
Line 106 ⟶ 142:
</syntaxhighlight>
 
{{SeeAlsoAPIAccount}}
{{SeeAlsoAPIAR}}
 
[[Category:Programmer]]
[[Category:API]]
[[Category:Integrate]]
[[Category:Plug-In]]
{{NavigateDeveloper}}