ARAP Contra Entry v2: Difference between revisions

no edit summary
(Created page with " ==Technical Specification== # Debtor and Creditor must be same currency code # Programmer can assign decimal value to '''NetTotal''' in '''ARAP Contra Entry''' # '''NetTotal'...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 3:
# Debtor and Creditor must be same currency code
# Programmer can assign decimal value to '''NetTotal''' in '''ARAP Contra Entry'''
# '''NetTotal''' must be larger than total knockoff amount(s)
 
==References of AutoCount Accounting version 2.0==
Line 25:
doc.NetTotal = 100;
 
//Knockoff AR Invoice (customer)
doc.KnockOff(AutoCount.Document.DocumentType.ARInvoice, "I-000001", 100);
//Knockoff AP Invoice (supplier)
doc.KnockOff(AutoCount.Document.DocumentType.APInvoice, "PI-000001", 100);
 
Line 43 ⟶ 45:
</syntaxhighlight>
 
===Edit===
{{SeeAlsoAccountV2}}
<syntaxhighlight lang="csharp">
public void EditARAPContra(AutoCount.Authentication.UserSession userSession)
{
AutoCount.ARAP.Contra.ContraDataAccess cmd =
AutoCount.ARAP.Contra.ContraDataAccess.Create(userSession, userSession.DBSetting);
AutoCount.ARAP.Contra.ContraEntity doc = cmd.GetContra("JV-000001");
 
if (doc == null)
return;
 
doc.DebtorCode = "300-A001";
doc.CreditorCode = "400-X001";
doc.DocDate = new DateTime(2018, 6, 5);
doc.Description = "Edited Generated ARAP CONTRA";
doc.JournalType = "GENERAL";
doc.NetTotal = 80;
 
//Knockoff AR Invoice (customer)
doc.KnockOff(AutoCount.Document.DocumentType.ARInvoice, "I-000001", 80);
//Knockoff AP Invoice (supplier)
doc.KnockOff(AutoCount.Document.DocumentType.APInvoice, "PI-000001", 80);
 
try
{
cmd.SaveContra(doc, userSession.LoginUserID);
//Log Success
AutoCount.AppMessage.ShowMessage($"Contra '{doc.DocNo}' is updated");
}
catch (AutoCount.AppException ex)
{
//Log Fail
AutoCount.AppMessage.ShowMessage(
string.Format("Fail to update Contra.\n{0}", ex.Message));
}
}
</syntaxhighlight>
 
===Cancel (void)===
<syntaxhighlight lang="csharp">
public void CancelARAPContra(AutoCount.Authentication.UserSession userSession)
{
string docNo = "JV-000001";
AutoCount.ARAP.Contra.ContraDataAccess cmd =
AutoCount.ARAP.Contra.ContraDataAccess.Create(userSession, userSession.DBSetting);
 
try
{
cmd.CancelContra(docNo, userSession.LoginUserID);
//Log Success
AutoCount.AppMessage.ShowMessage($"Contra '{docNo}' is cancelled.");
}
catch (AutoCount.AppException ex)
{
//Log Fail
AutoCount.AppMessage.ShowMessage(
string.Format("Fail to cancel Contra.\n{0}", ex.Message));
}
}
</syntaxhighlight>
 
===Delete===
<syntaxhighlight lang="csharp">
public void DeleteARAPContra(AutoCount.Authentication.UserSession userSession)
{
string docNo = "JV-000001";
AutoCount.ARAP.Contra.ContraDataAccess cmd =
AutoCount.ARAP.Contra.ContraDataAccess.Create(userSession, userSession.DBSetting);
 
try
{
cmd.DeleteContra(docNo, userSession.LoginUserID);
//Log Success
AutoCount.AppMessage.ShowMessage($"Contra '{docNo}' is deleted.");
}
catch (AutoCount.AppException ex)
{
//Log Fail
AutoCount.AppMessage.ShowMessage(
string.Format("Fail to delete Contra.\n{0}", ex.Message));
}
}
</syntaxhighlight>
 
{{SeeAlsoAPIAccount}}
{{NavigateDeveloper}}
[[Category:Programmer]]
[[Category:API]]
[[Category:Integrate]]
[[Category:Plug-In]]