AR Invoice: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
 
(18 intermediate revisions by the same user not shown)
Line 1:
==Technical Specification==
{{NavigateDeveloper}}
===Rules in ARInvoice===
# AccNo (Sales A/C) cannot be empty or null.
# AccNo (Sales A/C) cannot be Debtor or Creditor Account No.
# NetTotal cannot be in negative value.
# '''NetTotal''' is the sum of amount & GST from details, thethis field is '''ReadOnly'''.
# Total '''GST''' is the sum of GST & GST Adjustment from details, thethis field is '''ReadOnly'''.
# Do not set '''empty string''' to '''ProjNo''' and '''DeptNo''', when it is empty, set to '''DBNull.Value'''.
 
<br />
===Assemblies version 1.8===
==References of AutoCount Accounting version 1.8, 1.9==
<pre>
{{BaseReferenceAC18}}
'''BCE.AutoCount.ARAP.dll'''
</pre>
 
<br />
==Sample with data model==
===Create new AR Invoice===
<syntaxhighlight lang="csharp">
Line 16 ⟶ 19:
{
string userID = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess cmd = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(dbSetting);
BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(dbSetting);
 
BCE.AutoCount.ARAP.ARInvoice.ARInvoiceEntity doc = cmd.NewARInvoice();
BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDTLEntity dtl = null;
Line 27 ⟶ 32:
doc.SalesAgent = source.SalesPerson;
doc.JournalType = source.JournalType;
 
//Set whether to apply rounding method of either by Document or by Each Line,
//this may affect different result in GST Calculation due to decimal point rounding.
doc.RoundingMethod = source.RoundMethod;
 
//Document Level Inclusive Tax
doc.InclusiveTax = source.Inclusive;
Line 50 ⟶ 57:
cmd.SaveARInvoice(doc, userID);
//log success
//BCE.ApplicationAutoCount.AppMessage.ShowMessage(string.Format("{0} is created.", doc.DocNo));
}
catch (BCE.Application.AppException ex)
{
//log ex.Message
//BCE.ApplicationAutoCount.AppMessage.ShowMessage(ex.Message);
}
}
Line 85 ⟶ 92:
public decimal? Amount { get; set; }
public string GSTCode { get; set; }
public decimal GSTAdjustment { get; set; } = 0;
}
</syntaxhighlight>
Line 91 ⟶ 98:
===Implementation===
[[File:GenerateSaleInAR.PNG|link=]]
<syntaxhighlight lang="csharp" highlight="15,16,17">
public void MainEntry(BCE.Data.DBSetting dbSetting)
{
Line 105 ⟶ 112:
newDoc.Details.Add(new ARInvoiceDetail(){ Account = "500-0000", Description = "APPLE IPHONE X", Amount = 5000, GSTCode = "SR-S" });
newDoc.Details.Add(new ARInvoiceDetail(){ Account = "520-0000", Description = "Discount 10%", Amount = -500, GSTCode = "SR-S" });
//No error while the Account is empty, because the amount is zero.;
//Hence no posting to account is required.
newDoc.Details.Add(new ARInvoiceDetail(){ Description = "GIFT", Amount = 0, GSTCode = "SR-S" });
newDoc.Details.Add(new ARInvoiceDetail(){ Account = "500-0000", Description = "FREE Screen Protector", GSTCode = "SR-S" });
Line 113 ⟶ 121:
</syntaxhighlight>
 
{{SeeAlsoAPIAccount}}
==See Also==
* [[AR Debtor]]
* [[AR Invoice]]
* [[AR Received Payment]]
* [[AR Debit Note]]
* [[AR Credit Note]]
* [[AR Refund]]
[[Category:Programmer]]
[[Category:API]]
[[Category:Integrate]]
[[Category:Plug-In]]
{{NavigateDeveloper}}