Overview

If the purchase order is edited after the export, clicking Export To WIISE again will update the existing Purchase order in WIISE only if the record has remained open and hasn’t been posted.
Any attachments to the Gearbox Purchase order will also be attached to the WIISE Purchase Order.
Purchase_Order - POST
{
'No' => "GB_#{purchase_order.number}",
'Document_Type' => 'Order',
'Buy_from_Vendor_No' => purchase_order.repairer_name,
'Document_Date' => purchase_order.date,
'Posting_Date' => purchase_order.date,
'Vendor_Invoice_No' => purchase_order.invoice,
'Prices_Including_VAT' => true
}
Purchase_OrderPurchLines - POST
{
'Document_Type' => 'Order',
'Document_No' => wiise_purchase_order[:no], # Returned after creating a purchase order
'Type' => 'G/L Account',
'FilteredTypeField': 'G/L Account',
'No' => purchase_order.general_ledger_code,
'Description' => purchase_order_item.part_description,
'Quantity' => purchase_order_item.quantity,
'Direct_Unit_Cost' => purchase_order_item.cost_of_each_unit,
'VAT_Prod_Posting_Group' => (purchase_order_item.tax_rate == 'Not Applicable' ? 'GST-FREE' : 'GST-10'),
'Shortcut_Dimension_2_Code' => (purchase_order_item.vehicle.fleet_number OR purchase_order_item.vehicle.rego) # Pulled from Dimension_Values
}