AP Debit Note v2

From AutoCount Resource Center
Jump to navigation Jump to search

References of AutoCount Accounting version 2.0

AutoCount.Accounting.dll
AutoCount.Accounting.UI.dll
AutoCount.dll
AutoCount.MainEntry.dll
AutoCount.UI.dll
AutoCount.ARAP.dll

AP Debit Note API Usage

New

public void NewAPDebitNoteEntry(AutoCount.Authentication.UserSession userSession)
{
    AutoCount.ARAP.APDN.APDNDataAccess cmd =
        AutoCount.ARAP.APDN.APDNDataAccess.Create(userSession, userSession.DBSetting);
    AutoCount.ARAP.APDN.APDNEntity doc = cmd.NewAPDN();
    AutoCount.ARAP.APDN.APDNDTLEntity dtl = null;


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

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

Edit

public void EditAPDebitNoteEntry(AutoCount.Authentication.UserSession userSession)
{
    string docNo = "DN-000001";
    AutoCount.ARAP.APDN.APDNDataAccess cmd =
        AutoCount.ARAP.APDN.APDNDataAccess.Create(userSession, userSession.DBSetting);
    AutoCount.ARAP.APDN.APDNEntity doc = cmd.GetAPDN(docNo);
    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, userSession.LoginUserID);
        //Log success
        AutoCount.AppMessage.ShowMessage(string.Format("AP Debit Note '{0}' is updated.", doc.DocNo));
    }
    catch (AutoCount.AppException ex)
    {
        //Log Error
        AutoCount.AppMessage.ShowMessage("Fail to update AP Debit Note.\n" + ex.Message);
    }
}

Cancel (Void)

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

Delete

public void DeleteAPDebitNote(AutoCount.Authentication.UserSession userSession)
{
    string docNo = "DN-000001";
    AutoCount.ARAP.APDN.APDNDataAccess cmd =
        AutoCount.ARAP.APDN.APDNDataAccess.Create(userSession, userSession.DBSetting);
    try
    {
        cmd.DeleteAPDN(docNo, userSession.LoginUserID);
    }
    catch (AutoCount.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