paid invoices support
This commit is contained in:
@@ -39,7 +39,7 @@ namespace CebelcaAPI
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<string> AddInvoiceHead(string partnerId, string idDocumentExt, DateTime dateSent, DateTime dateServed, DateTime dateToPay)
|
||||
public async Task<string> AddInvoiceHead(string partnerId, string idDocumentExt, DateTime dateSent, DateTime dateServed, DateTime dateToPay, bool paid = false)
|
||||
{
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo("sl-SI");
|
||||
var values = new Dictionary<string, string>
|
||||
@@ -50,6 +50,11 @@ namespace CebelcaAPI
|
||||
{ "id_partner", partnerId },
|
||||
{ "id_document_ext", idDocumentExt }
|
||||
};
|
||||
if (paid)
|
||||
{
|
||||
values.Add("payment", "paid");
|
||||
values.Add("payment_act", "1");
|
||||
}
|
||||
var ret = await APICall("invoice-sent", "insert-smart-2", values);
|
||||
var json = JArray.Parse(ret);
|
||||
var retname = (json[0][0] as JObject).Properties().First().Name;
|
||||
|
||||
Reference in New Issue
Block a user