AR Received Payment: Difference between revisions
Content added Content deleted
mNo edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
public void NewARPayment(BCE.Data.DBSetting dbSetting) |
public void NewARPayment(BCE.Data.DBSetting dbSetting) |
||
{ |
{ |
||
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess |
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess cmd = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting); |
||
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity |
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity doc = cmd.NewARPayment(); |
||
// |
//If you want to set your own Payment Voucher number, uncomment the next line, otherwise, the system will use running number. |
||
// |
//doc.DocNo = “RC-0001″; |
||
doc.DebtorCode = "300-A001"; |
|||
// Add one payment detail |
// Add one payment detail |
||
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity |
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity paymentDetail = doc.NewDetail(); |
||
paymentDetail.PaymentMethod = "CASH"; |
|||
paymentDetail.PaymentAmt = 100; |
|||
paymentDetail.ChequeNo = "MBB 123456"; |
|||
//Knockoff Invoice |
|||
doc.KnockOff(BCE.AutoCount.Document.DocumentType.ARInvoice, "IV-0001", 100); |
|||
⚫ | |||
⚫ | |||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
Line 43: | Line 45: | ||
public void EditARPayment(BCE.Data.DBSetting dbSetting) |
public void EditARPayment(BCE.Data.DBSetting dbSetting) |
||
{ |
{ |
||
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess |
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess cmd = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting); |
||
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity |
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity doc = cmd.GetARPayment("RC-0001"); |
||
// |
//If doc (arPayment) is null, doc (arPayment) does not exist in AR Payment; |
||
//Then exit this function |
|||
if ( |
if (doc == null) |
||
return; |
return; |
||
doc.ClearDetails(); |
|||
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity |
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity paymentDetail = doc.NewDetail(); |
||
paymentDetail.PaymentMethod = "CARD"; |
|||
paymentDetail.PaymentAmt = 600; |
|||
cmd.SaveARPayment(doc, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID); |
|||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
===Delete=== |
===Delete=== |
||
<syntaxhighlight lang="csharp"> |
|||
private void DeleteARPayment(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess cmd = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting); |
|||
cmd.DeleteARPayment("RC-0001", BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID); |
|||
} |
|||
</syntaxhighlight> |
|||
===Cancel=== |
===Cancel=== |
||
<syntaxhighlight lang="csharp"> |
|||
</syntaxhighlight> |
|||
==Sample Code with Data Model for Testing== |
==Sample Code with Data Model for Testing== |
||
Line 80: | Line 94: | ||
public string Description { get; set; } |
public string Description { get; set; } |
||
public string DepositMethod { get; set; } |
public string DepositMethod { get; set; } |
||
//PaymentCurrencyCode will be the currency code of Debtor's Account. |
//PaymentCurrencyCode will be the currency code of Debtor's Account. |
||
//Need to define only when PaymentCurrencyCode is different from Debtor's Account Currency |
//Need to define only when PaymentCurrencyCode is different from Debtor's Account Currency |
||
public string PaymentCurrencyCode { get; set; } |
public string PaymentCurrencyCode { get; set; } |
||
//Require PaymentToHomeCurrencyRate, |
//Require PaymentToHomeCurrencyRate, |
||
//when PaymentCurrencyCode is in Foreign Currency |
//when PaymentCurrencyCode is in Foreign Currency |
||
public decimal? PaymentToHomeCurrencyRate { get; set; } |
public decimal? PaymentToHomeCurrencyRate { get; set; } |
||
⚫ | |||
//Require PaymentToDebtorCurrencyRate, |
|||
⚫ | |||
public decimal? PaymentToDebtorCurrencyRate { get; set; } |
public decimal? PaymentToDebtorCurrencyRate { get; set; } |
||
public string Project { get; set; } |
public string Project { get; set; } |
||
public string Department { get; set; } |
public string Department { get; set; } |