AR Received Payment: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1:
{{NavigateDeveloper}}
==Incomplete==
 
===Assemblies version 1.8===
Line 6 ⟶ 7:
</pre>
 
 
 
==Sample Code==
===Source Data Modal (Example Only)===
'''Source''' is the '''DataModel''' of your source data that is to update into AutoCount Accounting.
The Source DataModal is for reference only.
You may either create your own data source, or direct read from your database and assign value to document of AutoCount Accounting.
Example here is to after data is loaded from database, then assign data to data source.
 
<syntaxhighlight lang="csharp">
public class ARPaymentSource
{
public string DebtorCode { get; set; }
public string DocumentNo { get; set; }
public string ReceiptNo2 { get; set; }
public DateTime DocumentDate { get; set; } = DateTime.Today.Date;
public string Description { get; set; }
public string DepositMethod { get; set; }
//When not defined (null), system will apply the Debtor Account's default currency code
public string PaymentCurrencyCode { get; set; }
public decimal? PaymentToHomeCurrencyRate { get; set; }
public decimal? PaymentToDebtorCurrencyRate { get; set; }
public string Project { get; set; }
public string Department { get; set; }
 
public List<ARPaymentDetailSource> PaymentDetail = new List<ARPaymentDetailSource>();
public List<ARPaymentKnockoff> PaymentKnockoff = new List<ARPaymentKnockoff>();
}
 
public class ARPaymentDetailSource
{
public string PaymentMethod { get; set; }
public string ChequeNo { get; set; }
public decimal PaymentAmount { get; set; }
public decimal BankCharge { get; set; }
public string BankChargeTaxCode { get; set; }
public string BankChargeBillNoForGst { get; set; }
public string PaymentBy { get; set; }
/// <summary>
/// If this cheque is returned/bounced cheque
/// Set the returned/bounced date. Otherwise it is null
/// </summary>
public DateTime? ReturnChequeDate { get; set; }
}
 
public class ARPaymentKnockoff
{
public const string ARInvoiceDocType = BCE.AutoCount.Document.DocumentType.ARInvoice;
public const string ARDebitNoteDocType = BCE.AutoCount.Document.DocumentType.ARDN;
 
public string DocType { get; set; }
public string DocNo { get; set; }
public decimal Amount { get; set; }
public BCE.Data.DBDateTime DBDate { get; set; } = DBNull.Value;
}
</syntaxhighlight>
 
===Create New ARPayment===
<syntaxhighlight lang="csharp">
public void NewARPayment(ARPaymentSource source, BCE.Data.DBSetting dbSetting)
Line 43 ⟶ 102:
}
 
====Add New AR Payment Detail====
private void AddARPaymentDetail(ARPaymentDetailSource source, Func<BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity> addPaymentDetail)
{
Line 62 ⟶ 122:
</syntaxhighlight>
 
<syntaxhighlight lang="csharp">
public class ARPaymentSource
{
public string DebtorCode { get; set; }
public string DocumentNo { get; set; }
public string ReceiptNo2 { get; set; }
public DateTime DocumentDate { get; set; } = DateTime.Today.Date;
public string Description { get; set; }
public string DepositMethod { get; set; }
//When not defined (null), system will apply the Debtor Account's default currency code
public string PaymentCurrencyCode { get; set; }
public decimal? PaymentToHomeCurrencyRate { get; set; }
public decimal? PaymentToDebtorCurrencyRate { get; set; }
public string Project { get; set; }
public string Department { get; set; }
 
public List<ARPaymentDetailSource> PaymentDetail = new List<ARPaymentDetailSource>();
public List<ARPaymentKnockoff> PaymentKnockoff = new List<ARPaymentKnockoff>();
}
public class ARPaymentDetailSource
{
public string PaymentMethod { get; set; }
public string ChequeNo { get; set; }
public decimal PaymentAmount { get; set; }
public decimal BankCharge { get; set; }
public string BankChargeTaxCode { get; set; }
public string BankChargeBillNoForGst { get; set; }
public string PaymentBy { get; set; }
/// <summary>
/// If this cheque is returned/bounced cheque
/// Set the returned/bounced date. Otherwise it is null
/// </summary>
public DateTime? ReturnChequeDate { get; set; }
}
 
public class ARPaymentKnockoff
{
public const string ARInvoiceDocType = BCE.AutoCount.Document.DocumentType.ARInvoice;
public const string ARDebitNoteDocType = BCE.AutoCount.Document.DocumentType.ARDN;
 
public string DocType { get; set; }
public string DocNo { get; set; }
public decimal Amount { get; set; }
public BCE.Data.DBDateTime DBDate { get; set; } = DBNull.Value;
}
</syntaxhighlight>
 
==See Also==