-
Notifications
You must be signed in to change notification settings - Fork 2
PostPurchasesCreditJournal
Arivetti edited this page Feb 23, 2022
·
5 revisions
The PostPurchasesCreditJournal
function posts a ledger journal.
public WSResultStatus PostPurchasesCreditJournal(String token, WSLedgerJournal journal)
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
journal | WSLedgerJournal | The journal to be posted. |
Integration ws = new Integration();
String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
var wsledsgerJournal = new WSLedgerJournal();
wsledsgerJournal.AccountCode = "AMAZ01";
wsledsgerJournal.ExchangeRate = 1;
wsledsgerJournal.JournalNumber = "Example journal";
wsledsgerJournal.TransactionDate = DateTime.Now;
wsledsgerJournal.Lines = new WSLedgerJournalLine[2];
wsledsgerJournal.Lines[0] = new WSLedgerJournalLine()
{
Amount = 200,
BankExchangeRate = 1,
DepartmentID = "Dept 1",
Description = "An example line in a jounal",
GLAccountCode = "10000"
};
wsledsgerJournal.Lines[1] = new WSLedgerJournalLine()
{
Amount = 15,
BankExchangeRate = 1,
DepartmentID = "Dept 1",
Description = "Another example line in a jounal",
GLAccountCode = "10000"
};
var result = ws.PostPurchasesCreditJournal(auth, wsledsgerJournal);
Console.WriteLine(
$"Result status: {result.Status} " +
$"\r\n----------------------------------\r\n");
}