AR Received Payment: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 24:
public void NewARPayment(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDAcmd = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting);
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPaymentdoc = arPaymentDAcmd.NewARPayment();
// If you want to set your own Payment NoVoucher number, uncomment the next line, otherwise, the system will use automatic running number.
// arPaymentdoc.DocNo = “TEST“RC-0001″;
arPaymentdoc.DebtorCode = "300-A001";
 
// Add one payment detail
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetailpaymentDetail = arPaymentdoc.NewDetail();
arPaymentDetailpaymentDetail.PaymentMethod = "CASH";
arPaymentDetailpaymentDetail.PaymentAmt = 100;
arPaymentDetailpaymentDetail.ChequeNo = "MBB 123456";
//Knockoff Invoice
arPaymentdoc.KnockOff(BCE.AutoCount.Document.DocumentType.ARInvoice, "TEST IV- 0001", 100);
arPaymentDA.SaveARPayment(arPayment, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
 
arPaymentDAcmd.SaveARPayment(arPaymentdoc, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
}
</syntaxhighlight>
Line 43 ⟶ 45:
public void EditARPayment(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDAcmd = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(dbSetting);
BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPaymentdoc = arPaymentDAcmd.GetARPayment("TESTRC-0001");
//If ifdoc (arPayment) ==is null, itdoc means(arPayment) thedoes ARnot Paymentexist isin notAR found.Payment;
//Then exit this function
if (arPaymentdoc == null)
return;
 
arPaymentdoc.ClearDetails();
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetailpaymentDetail = arPaymentdoc.NewDetail();
arPaymentDetailpaymentDetail.PaymentMethod = "CARD";
arPaymentDetailpaymentDetail.PaymentAmt = 600;
arPaymentDAcmd.SaveARPayment(arPaymentdoc, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
}
</syntaxhighlight>
===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===
<syntaxhighlight lang="csharp">
 
</syntaxhighlight>
 
 
==Sample Code with Data Model for Testing==
Line 80 ⟶ 94:
public string Description { get; set; }
public string DepositMethod { get; set; }
 
//PaymentCurrencyCode will be the currency code of Debtor's Account.
//Need to define only when PaymentCurrencyCode is different from Debtor's Account Currency
public string PaymentCurrencyCode { get; set; }
 
//Require PaymentToHomeCurrencyRate,
//when PaymentCurrencyCode is in Foreign Currency
public decimal? PaymentToHomeCurrencyRate { get; set; }
 
//Require PaymentToDebtorCurrencyRate, when PaymentCurrencyCode is different from Debtor CurrencyCode
//Require PaymentToDebtorCurrencyRate,
//Require PaymentToDebtorCurrencyRate, when PaymentCurrencyCode is different from Debtor CurrencyCode
public decimal? PaymentToDebtorCurrencyRate { get; set; }
 
public string Project { get; set; }
public string Department { get; set; }