AR Credit Note: Difference between revisions
Content added Content deleted
m (Protected "AR Credit Note" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite) [Delete=Allow only administrators] (indefinite))) |
No edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Technical Specification== |
|||
{{NavigateDeveloper}} |
|||
# 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 v18|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''' |
|||
<br /> |
|||
===Assemblies version 1.8=== |
|||
==Assemblies version 1.8, 1.9== |
|||
<pre> |
|||
{{BaseReferenceAC18}} |
|||
BCE.AutoCount.ARAP.dll |
|||
'''BCE.AutoCount.ARAP.dll''' |
|||
</pre> |
|||
==API Usage== |
|||
===New=== |
|||
<syntaxhighlight lang="csharp"> |
|||
public void NewARCN(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID; |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd = |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting); |
|||
BCE.AutoCount.ARAP.ARCN.ARCNEntity doc = cmd.NewARCN(); |
|||
BCE.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(); |
|||
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(BCE.AutoCount.Document.DocumentType.ARInvoice, "I-000001", 10); |
|||
try |
|||
{ |
|||
cmd.SaveARCN(doc, userId); |
|||
//Log success |
|||
BCE.Application.AppMessage.ShowMessage($"Credit Note {doc.DocNo} Created Successfully."); |
|||
} |
|||
catch (BCE.Application.AppException ex) |
|||
{ |
|||
//Log Failed |
|||
BCE.Application.AppMessage.ShowMessage( |
|||
string.Format("Fail to create new Credit Note.\n{0}", ex.Message)); |
|||
} |
|||
} |
|||
</syntaxhighlight> |
|||
===Edit=== |
|||
<syntaxhighlight lang="csharp"> |
|||
public void EditARCN(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID; |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd = |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting); |
|||
BCE.AutoCount.ARAP.ARCN.ARCNEntity doc = cmd.GetARCN("CN-Test-0025"); |
|||
BCE.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(BCE.AutoCount.Document.DocumentType.ARInvoice, "I-000001", 10); |
|||
try |
|||
{ |
|||
cmd.SaveARCN(doc, userId); |
|||
//Log success |
|||
BCE.Application.AppMessage.ShowMessage($"Credit Note '{doc.DocNo}' Updated Successfully."); |
|||
} |
|||
catch (BCE.Application.AppException ex) |
|||
{ |
|||
//Log Failed |
|||
BCE.Application.AppMessage.ShowMessage( |
|||
string.Format("Fail to update Credit Note '{0}'.\n{1}", doc.DocNo, ex.Message)); |
|||
} |
|||
} |
|||
</syntaxhighlight> |
|||
===Cancel (void)=== |
|||
<syntaxhighlight lang="csharp"> |
|||
public void CancelARCN(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
string docNo = "CN-Test-0025"; |
|||
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID; |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd = |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting); |
|||
try |
|||
{ |
|||
cmd.CancelARCN(docNo, userId); |
|||
//Log success |
|||
BCE.Application.AppMessage.ShowMessage($"Credit Note '{docNo}' is cancelled."); |
|||
} |
|||
catch (BCE.Application.AppException ex) |
|||
{ |
|||
//Log fail |
|||
BCE.Application.AppMessage.ShowMessage( |
|||
string.Format("Error cancel Credit Note '{0}'.\n{1}", docNo, ex.Message)); |
|||
} |
|||
} |
|||
</syntaxhighlight> |
|||
===Delete=== |
|||
<syntaxhighlight lang="csharp"> |
|||
public void DeleteARCN(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
string docNo = "CN-Test-0025"; |
|||
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID; |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd = |
|||
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting); |
|||
try |
|||
{ |
|||
cmd.DeleteARCN(docNo, userId); |
|||
//Log success |
|||
BCE.Application.AppMessage.ShowMessage($"Credit Note '{docNo}' is deleted."); |
|||
} |
|||
catch (BCE.Application.AppException ex) |
|||
{ |
|||
//Log fail |
|||
BCE.Application.AppMessage.ShowMessage( |
|||
string.Format("Error delete Credit Note '{0}'.\n{1}", docNo, ex.Message)); |
|||
} |
|||
} |
|||
</syntaxhighlight> |
|||
{{SeeAlsoAPIAccount}} |
|||
[[Category:Programmer]] |
[[Category:Programmer]] |
||
[[Category:API]] |
[[Category:API]] |
||
[[Category:Integrate]] |
[[Category:Integrate]] |
||
[[Category:Plug-In]] |
[[Category:Plug-In]] |
||
{{NavigateDeveloper}} |
Latest revision as of 04:01, 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
Assemblies version 1.8, 1.9
BCE.AutoCount.dll BCE.AutoCount.CommonAccounting.dll BCE.AutoCount.MainEntry.dll BCE.Utils.dll BCE.Utils.UI.dll BCE.AutoCount.ARAP.dll
API Usage
New
public void NewARCN(BCE.Data.DBSetting dbSetting)
{
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd =
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting);
BCE.AutoCount.ARAP.ARCN.ARCNEntity doc = cmd.NewARCN();
BCE.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();
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(BCE.AutoCount.Document.DocumentType.ARInvoice, "I-000001", 10);
try
{
cmd.SaveARCN(doc, userId);
//Log success
BCE.Application.AppMessage.ShowMessage($"Credit Note {doc.DocNo} Created Successfully.");
}
catch (BCE.Application.AppException ex)
{
//Log Failed
BCE.Application.AppMessage.ShowMessage(
string.Format("Fail to create new Credit Note.\n{0}", ex.Message));
}
}
Edit
public void EditARCN(BCE.Data.DBSetting dbSetting)
{
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd =
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting);
BCE.AutoCount.ARAP.ARCN.ARCNEntity doc = cmd.GetARCN("CN-Test-0025");
BCE.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(BCE.AutoCount.Document.DocumentType.ARInvoice, "I-000001", 10);
try
{
cmd.SaveARCN(doc, userId);
//Log success
BCE.Application.AppMessage.ShowMessage($"Credit Note '{doc.DocNo}' Updated Successfully.");
}
catch (BCE.Application.AppException ex)
{
//Log Failed
BCE.Application.AppMessage.ShowMessage(
string.Format("Fail to update Credit Note '{0}'.\n{1}", doc.DocNo, ex.Message));
}
}
Cancel (void)
public void CancelARCN(BCE.Data.DBSetting dbSetting)
{
string docNo = "CN-Test-0025";
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd =
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting);
try
{
cmd.CancelARCN(docNo, userId);
//Log success
BCE.Application.AppMessage.ShowMessage($"Credit Note '{docNo}' is cancelled.");
}
catch (BCE.Application.AppException ex)
{
//Log fail
BCE.Application.AppMessage.ShowMessage(
string.Format("Error cancel Credit Note '{0}'.\n{1}", docNo, ex.Message));
}
}
Delete
public void DeleteARCN(BCE.Data.DBSetting dbSetting)
{
string docNo = "CN-Test-0025";
string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess cmd =
BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(dbSetting);
try
{
cmd.DeleteARCN(docNo, userId);
//Log success
BCE.Application.AppMessage.ShowMessage($"Credit Note '{docNo}' is deleted.");
}
catch (BCE.Application.AppException ex)
{
//Log fail
BCE.Application.AppMessage.ShowMessage(
string.Format("Error delete Credit Note '{0}'.\n{1}", docNo, 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
|