From a6f9444661edf960eb80c59702852a1bf0cacc07 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Mon, 14 Nov 2011 13:40:06 +1100 Subject: [PATCH] Added myob fields to Products table --- 14_11_2011_add_myob_fields_to_products.sql | 2 ++ models/costing.php | 4 ++-- models/currency.php | 2 +- views/products/add.ctp | 7 +++++-- views/products/edit.ctp | 5 +++++ views/products/view.ctp | 21 ++++++++++----------- 6 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 14_11_2011_add_myob_fields_to_products.sql diff --git a/14_11_2011_add_myob_fields_to_products.sql b/14_11_2011_add_myob_fields_to_products.sql new file mode 100644 index 00000000..6185b817 --- /dev/null +++ b/14_11_2011_add_myob_fields_to_products.sql @@ -0,0 +1,2 @@ +ALTER TABLE `products` ADD `item_code` VARCHAR( 255 ) NOT NULL , +ADD `item_description` VARCHAR( 255 ) NOT NULL; diff --git a/models/costing.php b/models/costing.php index 8e86bb87..d35078fa 100755 --- a/models/costing.php +++ b/models/costing.php @@ -16,8 +16,8 @@ class Costing extends AppModel { 'LineItem' => array('className'=>'LineItem','foreignKey' => 'line_item_id' ), - 'PurchaseCurrency' => array('className' => 'Currency', 'foreignKey' => 'purchase_currency_id'), - 'SaleCurrency' => array('className' => 'Currency', 'foreignKey' => 'sale_currency_id') + 'PurchaseCurrency' => array('className' => 'Currency', 'foreignKey' => 'purchase_currency_id', 'order'=>'PurchaseCurrency.name ASC'), + 'SaleCurrency' => array('className' => 'Currency', 'foreignKey' => 'sale_currency_id', 'order'=>'SaleCurrency.name ASC') diff --git a/models/currency.php b/models/currency.php index 5e985103..9e19a6c3 100755 --- a/models/currency.php +++ b/models/currency.php @@ -32,7 +32,7 @@ class Currency extends AppModel { ); - var $order = "Currency.name ASC"; + var $order = "name ASC"; } ?> diff --git a/views/products/add.ctp b/views/products/add.ctp index 24748d84..8f74998c 100755 --- a/views/products/add.ctp +++ b/views/products/add.ctp @@ -17,11 +17,14 @@ $('.ckeditor').ckeditor(config); echo $form->input('title', array('class' => 'required', 'title'=>'Please Enter the Title for the Product')); echo $form->input('description', array('id' => 'description', 'class'=>'ckeditor')); + + echo $form->input('item_code'); + echo $form->input('item_description'); + + echo $form->input('notes'); - echo $html->image('calculator.png'); - ?> diff --git a/views/products/edit.ctp b/views/products/edit.ctp index f1016720..57a6ea92 100755 --- a/views/products/edit.ctp +++ b/views/products/edit.ctp @@ -15,6 +15,11 @@ echo $javascript->link('edit_product'); echo $form->input('description'); echo $form->input('notes'); + + echo $form->input('item_code'); + echo $form->input('item_description'); + + ?> end(array('label' => 'Edit Product', 'class'=>'wymupdate'));?> diff --git a/views/products/view.ctp b/views/products/view.ctp index ddd07c73..28a17e74 100755 --- a/views/products/view.ctp +++ b/views/products/view.ctp @@ -21,18 +21,17 @@   + > + > + +   + + > + > + +   + - > - > - -   - - - > - > - -   -