From 14c8d56a3726e3a9e9c079ba83b8544d8a55ea81 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Mon, 14 Nov 2011 15:02:49 +1100 Subject: [PATCH] Added myob fields to products table. Are appended to the description for PDF generation with in document_add_edit.js --- webroot/js/document_add_edit.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/webroot/js/document_add_edit.js b/webroot/js/document_add_edit.js index b94f0f92..b4869267 100644 --- a/webroot/js/document_add_edit.js +++ b/webroot/js/document_add_edit.js @@ -258,12 +258,26 @@ $(function() { var productID = getSelectedID('#productSelect'); + $.get('/documents/getProductDetails/'+productID, function(data) { $("#lineItemDetails").show(); $("#LineItemProductId").val(data.id); $("#LineItemTitle").val(data.title); - $("#LineItemDescription").val(data.description); + + var descText = ''; + if(data.item_code) { + descText = descText + 'Item Code: ' + data.item_code; + } + + if(data.item_description) { + descText = descText + '
Item Description: ' + data.item_description + '
'; + + } + + descText = descText + data.description; + + $("#LineItemDescription").val(descText); }, "json");