AR Deposit - Create New or Update with Refund & Forfeit: Difference between revisions

no edit summary
mNo edit summary
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1:
==Technical Specification==
{{NavigateDeveloper}}
===Rules in AR Deposit Refund & Forfeit===
# One AR Deposit allows only one Refund, and one Payment Voucher is created.
# One AR Deposit allows only one Forfeit
# Refund created in AR Deposit will auto create GL Cash Book Payment Voucher under GL | Cash Book Entry.
<br />
 
===AssembliesReferences of AutoCount Accounting version 1.8=, 1.9==
{{BaseReferenceAC18}}
<pre>
'''BCE.AutoCount.ARAP.dll'''
<br /pre>
==Sample with data model==
 
===Add New or Edit Existing AR Deposit with Deposit Refund and Forfeit===
<syntaxhighlight lang="csharp">
Line 58 ⟶ 57:
else
{
//BCE.Application.AppMessage.ShowErrorMessage(string.Format("Invalid Deposit Payment Method of \"{0}\"", source.DepositMethod));
//log error on Deposit Payment Method error
return retDocNo;
Line 83 ⟶ 82:
if (source.Refund == null)
{
//No refund
doc.HasRefund = false;
}
Line 88:
{
doc.HasRefund = true;
if (doc.RefundDocNo != null && doc.RefundDocNo == source.Refund.DocumentNo)
{
//Do nothing when no changed in Refund Document number
//and doc.RefundDocNo is not null
}
else if (source.Refund.DocumentNo == null && doc.RefundDocNo.Length == 0)
{
//Reference to version 1.8.28.184, the RefundDocNo is empty string, instead of "<<New>>".
//To ensure that RefundDocNo is running number, set it to "<<New>>"
doc.RefundDocNo = "<<New>>";
}
else
{
//If source.Refund.DocumentNo is not null, assign source to RefundDocNo;
//Otherwise, use the existing RefundDocNo.
doc.RefundDocNo = source.Refund.DocumentNo ?? doc.RefundDocNo;
}
Line 109 ⟶ 115:
if (source.Forfeit == null)
{
//No forfeit
doc.HasForfeited = false;
doc.MasterRow["ForfeitedAmt"] = 0.00M;
Line 117 ⟶ 124:
doc.HasForfeited = true;
doc.ForFeitedAccNo = source.Forfeit.ForfeitAccNo ?? doc.ForFeitedAccNo;
//Reference to version 1.8.28.184, doc.ForfeitedAmt is read only field,
//but it is a required amount when forfeited is true.
//Therefore, in this case we have to direct update the DataRow
doc.MasterRow["ForfeitedAmt"] = source.Forfeit.ForfeitAmount;
doc.ForfeitedDate = source.Forfeit.ForfeitDate;
Line 125 ⟶ 135:
doc.Save();
retDocNo = doc.DocNo;
//BCE.Application.AppMessage.ShowMessage(string.Format("{0} is Created/Updated.", doc.DocNo));
//Log Success created
}
catch (BCE.Application.AppException ex)
{
//BCE.Application.AppMessage.ShowErrorMessage(ex.Message);
//Log Error saving
}
 
//Return null if document is not created or updated.
//If successfully saved, Document number is returned.
return retDocNo;
}
Line 360 ⟶ 372:
}
</syntaxhighlight>
<br/>
 
{{SeeAlsoAPIAccount}}
==See Also==
* [[AR Debtor]]
* [[AR Invoice]]
* [[AR Received Payment]]
* [[AR Debit Note]]
* [[AR Credit Note]]
* [[AR Refund]]
* [[AR Deposit]]
* [[AR Deposit - Create New or Update with Refund & Forfeit]]
 
[[Category:Programmer]]
[[Category:API]]
[[Category:Integrate]]
[[Category:Plug-In]]
{{NavigateDeveloper}}