AR Refund: Difference between revisions

From AutoCount Resource Center
Content added Content deleted
mNo edit summary
mNo edit summary
Line 1: Line 1:
===Assemblies version 1.8===
===Assemblies version 1.8===
{{BaseReferenceAC18}}
<pre>
BCE.AutoCount.dll
'''BCE.AutoCount.ARAP.dll'''
<br /><br />
BCE.AutoCount.ARAP.dll
BCE.Utils.dll
</pre>

===Create new AR Refund===
===Create new AR Refund===
<syntaxhighlight lang="csharp">
<syntaxhighlight lang="csharp">

Revision as of 07:01, 22 January 2018

Assemblies version 1.8

BCE.AutoCount.dll
BCE.AutoCount.CommonAccounting.dll
BCE.AutoCount.MainEntry.dll
BCE.Utils.dll
BCE.Utils.UI.dll
BCE.AutoCount.ARAP.dll



Create new AR Refund

public void CreateNewARRefund(BCE.Data.DBSetting dbSetting, RefundSource source)
{
    string userID = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
    BCE.AutoCount.ARAP.ARRefund.ARRefundDataAccess cmd = BCE.AutoCount.ARAP.ARRefund.ARRefundDataAccess.Create(dbSetting);
    BCE.AutoCount.ARAP.ARRefund.ARRefundEntity doc = cmd.NewARRefund();

    doc.DocNo = source.DocNo;
    doc.DocDate = source.Date;
    doc.Description = source.Description;

    BCE.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(BCE.AutoCount.Document.DocumentType.ARPayment, source.PaymentToRefund, source.RefundAmount);

    try
    {
        cmd.SaveARRefund(doc, userID);
    }
    catch (BCE.Application.AppException ex)
    {
        BCE.Application.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; }
}

See Also

Go to menu

Go to top
Resources For AutoCount Software Developers