AR Refund v2
Assemblies version 2.0
AutoCount.Accounting.dll AutoCount.Accounting.UI.dll AutoCount.dll AutoCount.MainEntry.dll AutoCount.UI.dll AutoCount.ARAP.dll
Create new AR Refund
public void CreateNewARRefund(AutoCount.Authentication.UserSession userSession, RefundSource source)
{
string userID = userSession.LoginUserID;
AutoCount.ARAP.ARRefund.ARRefundDataAccess cmd =
AutoCount.ARAP.ARRefund.ARRefundDataAccess.Create(userSession, userSession.DBSetting);
AutoCount.ARAP.ARRefund.ARRefundEntity doc = cmd.NewARRefund();
doc.DocNo = source.DocNo;
doc.DocDate = source.Date;
doc.Description = source.Description;
AutoCount.ARAP.ARRefund.ARRefundDTLEntity dtl = doc.NewDetail();
dtl.PaymentMethod = "CASH";
dtl.PaymentAmt = source.RefundAmount;
dtl.BankCharge = source.BankCharge;
//Only ARPayment & ARCreditNote allowed to knockoff by ARRefund
doc.KnockOff(AutoCount.Document.DocumentType.ARPayment, source.PaymentToRefund, source.RefundAmount);
try
{
cmd.SaveARRefund(doc, userID);
}
catch (AutoCount.AppException ex)
{
AutoCount.AppMessage.ShowMessage(ex.Message);
}
}
Class of source data
public class RefundSource
{
public string DocNo { get; set; }
public DateTime Date { get; set; }
public string Description { get; set; }
public decimal RefundAmount { get; set; }
public decimal BankCharge { get; set; }
public string PaymentToRefund { get; set; }
}
Go to top
|
Resources For AutoCount Software Developers
|