diff --git a/controllers/jobs_controller.php b/controllers/jobs_controller.php index 085e6d83..acaf44e0 100755 --- a/controllers/jobs_controller.php +++ b/controllers/jobs_controller.php @@ -228,7 +228,8 @@ class JobsController extends AppController { $this->set('gst_options', $this->gst_options()); $this->set('totals', $this->getTotals($jobs)); - //print_r($jobs); + print_r($totals); +//print_r($jobs); } else { @@ -261,7 +262,7 @@ class JobsController extends AppController { 'gross_profit_aud' => 'total', 'net_export_sales_aud' => 'total', 'gross_profit_exports_aud' => 'total', - 'gp_percent' => 'average', + 'gp_percent' => 'average_gp', 'gross_australian_sales_foreign_currency' => 'total', 'net_australian_sales_foreign_currency' => 'total', 'gross_profit_value_australian_sales_foreign_currency' => 'total', diff --git a/webroot/js/document_add_edit.js b/webroot/js/document_add_edit.js index 9d64443e..cd2e8c58 100644 --- a/webroot/js/document_add_edit.js +++ b/webroot/js/document_add_edit.js @@ -29,7 +29,6 @@ $(function() { $('#LineItemDescription').ckeditor(function() { this.updateElement(); - this.destroy(); }); @@ -52,10 +51,12 @@ $(function() { }, Cancel: function() { - loadLineItems(); $( this ).dialog( "close" ); - - } + }, + close: function() { + loadLineItems(); + + } } }); @@ -68,7 +69,6 @@ $(function() { "Edit Line Item": function() { $('#LineItemDescription').ckeditor(function() { this.updateElement(); - this.destroy(); }); var thisLineItemInputs = $('#LineItemEditForm').find('input,select,textarea'); @@ -90,10 +90,6 @@ $(function() { } }, close: function() { - $('#LineItemDescription').ckeditor(function() { - this.destroy(); - }); - loadLineItems(); } @@ -150,13 +146,15 @@ $(function() { - $('#LineItemDescription').ckeditor(function() { this.destroy(); }); + $("#editLineItemModal").empty(); + + var nextItemNo = $(".lineItem").length; nextItemNo++; @@ -168,6 +166,7 @@ $(function() { $("#productDetails").hide(); + $('#LineItemDescription').ckeditor(config); $( "#addLineItemModal" ).dialog('open'); @@ -483,6 +482,7 @@ function calcNetPrice() { } + function checkNaN(value) { if( isNaN(value) == true) { return 0;