GetNewBatchPurchasesDebitNote - accountsIQ/API-Wiki GitHub Wiki
GetNewBatchPurchasesDebitNote
pre-filled with defaults for a given supplier
Note: The returned batch purchases debit note has not yet been stored in the entity and must be saved by calling the CreateBatchPurchasesDebitNote method.
public WSResult2OfBatchPurchasesDebitNote GetNewBatchPurchasesDebitNote(string token, string supplierCode)
Public Function GetNewBatchPurchasesDebitNote(ByVal token As String, ByVal supplierCode As String) As WSResult2OfBatchPurchasesDebitNote
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
upTo | DateTime | The time up to which the customer statement must be run. |
customerCodes | String[] | The list of customers to retrieve the statement for. |
showZeros | Boolean | If set to true, it indicates that all accounts with or without a balance will appear. |
Parameter Type Description token String The session token retrieved during authentication. supplierCode String The supplier code for which a new batch purchases debit note will be created.
Integration ws = new Integration();
String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
accountsIQ.BatchPurchasesDebitNote inv = ws.GetNewBatchPurchasesDebitNote(auth, "TESTINTEGR");
// Get the account code from a listing method instead
inv.Description = "DebitNote number 1";
inv.ExternalReference = "Ext ref 1";
// Create a batch debit note with two lines
inv.Lines = new accountsIQ.BatchPurchasesDebitNoteLine[2];
//*************** First line
inv.Lines[0] = new accountsIQ.BatchPurchasesDebitNoteLine();
inv.Lines[0].Description = "Line 1";
// Get the GL account code from a listing method
inv.Lines[0].GLAccountCode = "2000";
inv.Lines[0].NetAmount = 100;
// Get the tax code & rate from a listing method
inv.Lines[0].TaxCode = "NT";
inv.Lines[0].TaxRate = 0.21;
//*************** Second line
inv.Lines[1] = new accountsIQ.BatchPurchasesDebitNoteLine();
inv.Lines[1].Description = "Line 2";
// Get the GL account code from a listing method
inv.Lines[1].GLAccountCode = "3000";
inv.Lines[1].NetAmount = 100;
// Get the tax code & rate from a listing method
inv.Lines[1].TaxCode = "NT";
inv.Lines[1].TaxRate = 0;
//*************** Save the batch debit note
accountsIQ.WSResult2OfString wsbatch = ws.CreateBatchPurchasesDebitNote(auth, inv);
Assert.IsNotNull(wsbatch);
Assert.IsTrue(!String.IsNullOrEmpty(wsbatch.Result));
}
Dim ws As New Integration_1_1
Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not auth Is Nothing) Then
Dim inv As BatchPurchasesDebitNote
inv = ws.GetNewBatchPurchasesDebitNote(auth, "TESTINTEGR")
' Get the account code from a listing method instead
inv.Description = "DebitNote number 1"
inv.ExternalReference = "Ext ref 1"
inv.DebitNoteDate = DateTime.Now
' Create a batch debit note with two lines
inv.Lines = New BatchPurchasesDebitNoteLine(2 - 1) {}
' *************** First line
inv.Lines(0) = New BatchPurchasesDebitNoteLine
inv.Lines(0).Description = "Line 1"
' Get the GL account code from a listing method
inv.Lines(0).GLAccountCode = "2000"
inv.Lines(0).NetAmount = 100
' Get the tax code & rate from a listing method
inv.Lines(0).TaxCode = "NT"
inv.Lines(0).TaxRate = 0.21
' *************** Second line
inv.Lines(1) = New BatchPurchasesDebitNoteLine
inv.Lines(1).Description = "Line 2"
' Get the GL account code from a listing method
inv.Lines(1).GLAccountCode = "3000"
inv.Lines(1).NetAmount = 100
' Get the tax code & rate from a listing method
inv.Lines(1).TaxCode = "NT"
inv.Lines(1).TaxRate = 0
' *************** Save the batch debit note
Dim wsbatch As WSResult2OfString = ws.CreateBatchPurchasesDebitNote(auth, inv)
Assert.IsNotNull(wsbatch)
Assert.IsTrue(Not String.IsNullOrEmpty(wsbatch.Result))
End If
BatchPurchasesDebitNote WSResultStatus