AP Debit Note

From AutoCount Resource Center
Jump to navigation Jump to search

References of AutoCount Accounting version 1.8, 1.9

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

AP Debit Note API Usage

New

public void NewAPDebitNoteEntry(BCE.Data.DBSetting dbSetting)
{
    string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
    BCE.AutoCount.ARAP.APDN.APDNDataAccess cmd =
        BCE.AutoCount.ARAP.APDN.APDNDataAccess.Create(dbSetting);
    BCE.AutoCount.ARAP.APDN.APDNEntity doc = cmd.NewAPDN();
    BCE.AutoCount.ARAP.APDN.APDNDTLEntity dtl = null;


    dtl = doc.NewDetail();
    dtl.AccNo = "700-1010";
    dtl.Description = "INTEREST CHARGE";
    dtl.Amount = 10M;

    try
    {
        cmd.SaveAPDN(doc, userId);
        //Log success
        BCE.Application.AppMessage.ShowMessage(string.Format("AP Debit Note '{0}' is created.", doc.DocNo));
    }
    catch (BCE.Application.AppException ex)
    {
        //Log Error
        BCE.Application.AppMessage.ShowMessage("Fail to create new AP Debit Note.\n" + ex.Message);
    }
}

Edit

public void EditAPDebitNoteEntry(BCE.Data.DBSetting dbSetting)
{
    string docNo = "DN-000001";
    string userId = BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID;
    BCE.AutoCount.ARAP.APDN.APDNDataAccess cmd =
        BCE.AutoCount.ARAP.APDN.APDNDataAccess.Create(dbSetting);
    BCE.AutoCount.ARAP.APDN.APDNEntity doc = cmd.GetAPDN(docNo);
    BCE.AutoCount.ARAP.APDN.APDNDTLEntity dtl = null;

    if (doc == null)
        return;

    doc.ClearDetails();

    dtl = doc.NewDetail();
    dtl.AccNo = "700-1010";
    dtl.Description = "INTEREST CHARGE";
    dtl.Amount = 10.5M;

    try
    {
        cmd.SaveAPDN(doc, userId);
        //Log success
        BCE.Application.AppMessage.ShowMessage(string.Format("AP Debit Note '{0}' is updated.", doc.DocNo));
    }
    catch (BCE.Application.AppException ex)
    {
        //Log Error
        BCE.Application.AppMessage.ShowMessage("Fail to update AP Debit Note.\n" + ex.Message);
    }
}

Cancel (Void)

public void CancelAPDebitNote(BCE.Data.DBSetting dbSetting)
{
    string docNo = "DN-000001";
    BCE.AutoCount.ARAP.APDN.APDNDataAccess cmd =
        BCE.AutoCount.ARAP.APDN.APDNDataAccess.Create(dbSetting);
    try
    {
        cmd.CancelAPDN(docNo, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
    }
    catch (BCE.Application.AppException ex)
    {
        //log error
    }
}

Delete

public void DeleteAPDebitNote(BCE.Data.DBSetting dbSetting)
{
    string docNo = "DN-000001";
    BCE.AutoCount.ARAP.APDN.APDNDataAccess cmd =
        BCE.AutoCount.ARAP.APDN.APDNDataAccess.Create(dbSetting);
    try
    {
        cmd.DeleteAPDN(docNo, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
    }
    catch (BCE.Application.AppException ex)
    {
        //log error
    }
}


See Also

AutoCount Accounting Account API
AR AP
Transactions Version Transactions Version
AR Debtor (Customer) 1.8, 1.9
2.0
AP Creditor (Supplier) 1.8, 1.9
2.0
AR Invoice 1.8, 1.9
2.0
AP Invoice 1.8, 1.9
2.0
AR Received Payment 1.8, 1.9
2.0
AP Payment 1.8, 1.9
2.0
AR Debit Note 1.8, 1.9
2.0
AP Debit Note 1.8, 1.9
2.0
AR Credit Note 1.8, 1.9
2.0
AP Credit Note 1.8, 1.9
2.0
AR Refund 1.8, 1.9
2.0
AP Refund 1.8, 1.9
2.0
AR Deposit 1.8, 1.9
2.0
AP Deposit 1.8, 1.9
2.0
AR Deposit - Create New or Update
with Refund & Forfeit
1.8, 1.9
2.0
A/R and A/P Contra Entry 1.8, 1.9
2.0

Go to menu

IconAC81.png Go to top
ProgrammerGo.jpg Resources For AutoCount Software Developers