AR Credit Note v2: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | 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. |
# 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. |
|||
⚫ | |||
# Total of '''Knock Off Amount''' must not exceed the amount of Credit Note. |
|||
⚫ | |||
# '''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]]''' |
|||
⚫ | |||
#:Related to Bank or Cash transaction must be created at '''[[AR Received Payment v2|AR Received Payment]]''' |
|||
⚫ | |||
==References of AutoCount Accounting version 2.0== |
==References of AutoCount Accounting version 2.0== |
||
Line 9: | Line 17: | ||
'''AutoCount.ARAP.dll''' |
'''AutoCount.ARAP.dll''' |
||
== |
==API Usage== |
||
===New=== |
===New=== |
||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
Line 18: | Line 26: | ||
AutoCount.ARAP.ARCN.ARCNDTLEntity dtl = null; |
AutoCount.ARAP.ARCN.ARCNDTLEntity dtl = null; |
||
doc. |
//doc.DocNo = "CN-Test-0025"; |
||
doc.DocDate = new DateTime(2018, |
doc.DocDate = new DateTime(2018, 6, 5); |
||
doc.Description = " |
doc.Description = "DISCOUNT"; |
||
doc.Reason = " |
doc.Reason = "Early Payment discount"; |
||
doc.OurInvoiceNo = " |
doc.OurInvoiceNo = "I-000001"; |
||
doc.JournalType = "SALES"; |
|||
doc.CNType = "DISCOUNT"; |
|||
dtl = doc.NewDetail(); |
dtl = doc.NewDetail(); |
||
//Debit A/C (of detail) |
|||
dtl. |
dtl.AccNo = "520-0000"; |
||
dtl. |
dtl.Description = "DISCOUNT ALLOWED"; |
||
⚫ | |||
//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 |
try |
||
{ |
{ |
||
cmd.SaveARCN(doc, userSession.LoginUserID); |
cmd.SaveARCN(doc, userSession.LoginUserID); |
||
//Log success |
|||
⚫ | |||
} |
} |
||
catch (AutoCount.AppException ex) |
catch (AutoCount.AppException ex) |
||
{ |
{ |
||
//Log Failed |
|||
⚫ | |||
⚫ | |||
string.Format("Fail to create new Credit Note.\n{0}", ex.Message)); |
|||
} |
} |
||
} |
} |
||
Line 51: | Line 70: | ||
return; |
return; |
||
doc. |
//doc.DocNo = "CN-Test-0025"; |
||
doc. |
doc.DocDate = new DateTime(2018, 6, 5); |
||
doc. |
doc.Description = "DISCOUNT"; |
||
doc. |
doc.Reason = "Special Discount"; |
||
doc.OurInvoiceNo = "I-000001"; |
|||
doc.JournalType = "SALES"; |
|||
doc.CNType = "DISCOUNT"; |
|||
doc.ClearDetails(); |
doc.ClearDetails(); |
||
⚫ | |||
dtl |
dtl = doc.NewDetail(); |
||
dtl. |
dtl.AccNo = "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 |
try |
||
{ |
{ |
||
cmd.SaveARCN(doc, userSession.LoginUserID); |
cmd.SaveARCN(doc, userSession.LoginUserID); |
||
//Log success |
|||
AutoCount.AppMessage.ShowMessage($"Credit Note '{doc.DocNo}' Updated Successfully."); |
|||
} |
} |
||
catch (AutoCount.AppException ex) |
catch (AutoCount.AppException ex) |
||
{ |
{ |
||
//Log Failed |
|||
⚫ | |||
AutoCount.AppMessage.ShowMessage( |
|||
string.Format("Fail to update Credit Note '{0}'.\n{1}", doc.DocNo, ex.Message)); |
|||
} |
} |
||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
=== |
===Void (Cancel)=== |
||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
public void |
public void CancelARCreditNote(AutoCount.Authentication.UserSession userSession) |
||
{ |
{ |
||
string docNo = "CN-000001"; |
|||
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting); |
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting); |
||
try |
try |
||
{ |
{ |
||
cmd. |
cmd.CancelARCN(docNo, userSession.LoginUserID); |
||
AutoCount.AppMessage.ShowMessage($"{docNo} is cancelled."); |
|||
} |
} |
||
catch (AutoCount.AppException ex) |
catch (AutoCount.AppException ex) |
||
Line 89: | Line 123: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
=== |
===Delete=== |
||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
public void |
public void DeleteARCreditNote(AutoCount.Authentication.UserSession userSession) |
||
{ |
{ |
||
string docNo = "CN-000001"; |
|||
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting); |
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting); |
||
try |
try |
||
{ |
{ |
||
cmd. |
cmd.DeleteARCN(docNo, userSession.LoginUserID); |
||
AutoCount.AppMessage.ShowMessage($"{docNo} is deleted."); |
|||
} |
} |
||
catch (AutoCount.AppException ex) |
catch (AutoCount.AppException ex) |
||
Line 106: | Line 142: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
{{SeeAlsoAPIAccount}} |
|||
{{SeeAlsoAccountV2}} |
|||
[[Category:Programmer]] |
|||
[[Category:API]] |
|||
[[Category:Integrate]] |
|||
[[Category:Plug-In]] |
|||
{{NavigateDeveloper}} |
{{NavigateDeveloper}} |
Latest revision as of 04:28, 14 June 2018
Technical Specification
- 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.
- Total of Knock Off Amount must not exceed the amount of Credit Note.
- 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 A/R and A/P Contra Entry
- Debit A/C (of Detail) does not allow Bank or Cash account
- Related to Bank or Cash transaction must be created at AR Received Payment
- Debit A/C (of Detail) must be a leaf account
References of AutoCount Accounting version 2.0
AutoCount.Accounting.dll AutoCount.Accounting.UI.dll AutoCount.dll AutoCount.MainEntry.dll AutoCount.UI.dll AutoCount.ARAP.dll
API Usage
New
public void NewARCreditNote(AutoCount.Authentication.UserSession userSession)
{
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting);
AutoCount.ARAP.ARCN.ARCNEntity doc = cmd.NewARCN();
AutoCount.ARAP.ARCN.ARCNDTLEntity dtl = null;
//doc.DocNo = "CN-Test-0025";
doc.DocDate = new DateTime(2018, 6, 5);
doc.Description = "DISCOUNT";
doc.Reason = "Early Payment discount";
doc.OurInvoiceNo = "I-000001";
doc.JournalType = "SALES";
doc.CNType = "DISCOUNT";
dtl = doc.NewDetail();
//Debit A/C (of detail)
dtl.AccNo = "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} Created Successfully.");
}
catch (AutoCount.AppException ex)
{
//Log Failed
AutoCount.AppMessage.ShowMessage(
string.Format("Fail to create new Credit Note.\n{0}", ex.Message));
}
}
Edit
public void EditARCreditNote(AutoCount.Authentication.UserSession userSession)
{
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting);
AutoCount.ARAP.ARCN.ARCNEntity doc = cmd.GetARCN("CN-000001");
AutoCount.ARAP.ARCN.ARCNDTLEntity dtl = null;
if (doc == null)
return;
//doc.DocNo = "CN-Test-0025";
doc.DocDate = new DateTime(2018, 6, 5);
doc.Description = "DISCOUNT";
doc.Reason = "Special Discount";
doc.OurInvoiceNo = "I-000001";
doc.JournalType = "SALES";
doc.CNType = "DISCOUNT";
doc.ClearDetails();
dtl = doc.NewDetail();
dtl.AccNo = "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(
string.Format("Fail to update Credit Note '{0}'.\n{1}", doc.DocNo, ex.Message));
}
}
Void (Cancel)
public void CancelARCreditNote(AutoCount.Authentication.UserSession userSession)
{
string docNo = "CN-000001";
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting);
try
{
cmd.CancelARCN(docNo, userSession.LoginUserID);
AutoCount.AppMessage.ShowMessage($"{docNo} is cancelled.");
}
catch (AutoCount.AppException ex)
{
AutoCount.AppMessage.ShowMessage(ex.Message);
}
}
Delete
public void DeleteARCreditNote(AutoCount.Authentication.UserSession userSession)
{
string docNo = "CN-000001";
AutoCount.ARAP.ARCN.ARCNDataAccess cmd = AutoCount.ARAP.ARCN.ARCNDataAccess.Create(userSession, userSession.DBSetting);
try
{
cmd.DeleteARCN(docNo, userSession.LoginUserID);
AutoCount.AppMessage.ShowMessage($"{docNo} is deleted.");
}
catch (AutoCount.AppException ex)
{
AutoCount.AppMessage.ShowMessage(ex.Message);
}
}
See Also
AutoCount Accounting Account API | |||
---|---|---|---|
AR | AP | ||
Transactions | Version | Transactions | Version |
AR Debtor (Customer) | 1.8, 1.9 2.0 |
AP Creditor (Supplier) | 1.8, 1.9 2.0 |
AR Invoice | 1.8, 1.9 2.0 |
AP Invoice | 1.8, 1.9 2.0 |
AR Received Payment | 1.8, 1.9 2.0 |
AP Payment | 1.8, 1.9 2.0 |
AR Debit Note | 1.8, 1.9 2.0 |
AP Debit Note | 1.8, 1.9 2.0 |
AR Credit Note | 1.8, 1.9 2.0 |
AP Credit Note | 1.8, 1.9 2.0 |
AR Refund | 1.8, 1.9 2.0 |
AP Refund | 1.8, 1.9 2.0 |
AR Deposit | 1.8, 1.9 2.0 |
AP Deposit | 1.8, 1.9 2.0 |
AR Deposit - Create New or Update with Refund & Forfeit |
1.8, 1.9 2.0 | ||
A/R and A/P Contra Entry | 1.8, 1.9 2.0 |
Go to top
|
Resources For AutoCount Software Developers
|