2,743
edits
mNo edit summary |
No edit summary |
||
(16 intermediate revisions by the same user not shown) | |||
Line 1:
==Technical Specification==
{{NavigateDeveloper}}▼
# 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 />
==
{{BaseReferenceAC18}}
'''BCE.AutoCount.ARAP.dll'''
<br /
==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 124 ⟶ 134:
{
doc.Save();
BCE.Application.AppMessage.ShowMessage(string.Format("{0} is Created/Updated.", doc.DocNo));▼
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 202 ⟶ 214:
new BCE.AutoCount.XtraUtils.LookupEditBuilder.DepositPaymentMethodLookupEditBuilder();
//The return table contains of 3 columns: (1) PaymentMethod, (2) BankAccount, (3) CurrencyCode (
return depositBuilder.BuildDataTable(dbSetting);
}
Line 226 ⟶ 238:
public string Department { get; set; }
//IsSecurityDeposit is to decide whether this deposit is subject to GST
//true: not subject to GST
//false: subject to GST and is considered as "Advance Payment"
public bool IsSecurityDeposit { get; set; }
Line 319 ⟶ 331:
DepositMethod = "DEPOSIT RECEIVED",
Description = "DEPOSIT",
//Assign an existing document number to "DocumentNo" will edit & update this deposit.
DocumentNo = docNo,
DocumentDate = new DateTime(2017, 11, 25)
Line 360 ⟶ 372:
}
</syntaxhighlight>
<br/>
{{SeeAlsoAPIAccount}}
[[Category:Programmer]]
[[Category:API]]
[[Category:Integrate]]
[[Category:Plug-In]]
▲{{NavigateDeveloper}}
|