-
Notifications
You must be signed in to change notification settings - Fork 1
/
putsbinvoices.php
52 lines (51 loc) · 1.48 KB
/
putsbinvoices.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
Author: Sunil Bhatt
App: Myob Api
*/
session_start();
include_once('config.php');
include_once('myobsbfunctions.php');
$putsbinvoicesclass = new myobsbfunctions($_SESSION['access_token'],api_key);
$addsbInvoiceJsonData = '{
"uid" : "{invoice_uid}",
"contact" : {
"uid" : "{contact_uid}"
},
"invoiceNumber" : "IVSB00000229",
"issueDate" : "2014-08-19",
"dueDate" : "2014-08-26",
"gstInclusive" : true,
"lines" : [
{
"account" : {
"uid" : "{account_uid}"
},
"item" : {
"uid" : "{item_uid}"
},
"taxType" : {
"uid" : "{account_type_uid}"
},
"unitOfMeasure" : "Qty",
"description" : "Hammers Test",
"quantity" : 50,
"unitPrice" : 25.99,
"total" : 15.98
}
],
"notes" : "An invoice note",
"purchaseOrderNumber" : "PO0000056",
"total" : 15.98,
"gst" : 1.09,
"amountPaid" : 0,
"amountDue" : 15.98,
"status" : "Open",
"displayStatus" : "Not Paid"
}';
$putsbinvoices = $putsbinvoicesclass->putData(api_url."{business_uid}/sale/invoices/{invoice_uid}", $addsbInvoiceJsonData);
$putsbinvoices = json_decode($putsbinvoices);
echo "<pre>";
print_r($putsbinvoices);
echo "</pre>";
echo "Update Done";