From e7a6c9ebfc7d16467920659caee7b58464020171 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Wed, 31 Mar 2010 15:09:27 +1100 Subject: [PATCH] Gotta refactor xtcpdf because of stupid spec changes. Need to turn on recursion which changes the datastructure format of the Products.. .GHUweghwegw --- controllers/costings_controller.php | 19 +- controllers/principles_controller.php | 2 +- controllers/quotes_controller.php | 68 +----- vendors/shells/vault.php | 21 +- vendors/xtcpdf.php | 143 ++++-------- views/costings/add.ctp | 16 +- views/line_items/view_table.ctp | 299 +++++++++++++------------- views/products/view.ctp | 10 +- views/quotes/ajaxpdf.ctp | 4 +- views/quotes/pdf.ctp | 9 +- views/quotes/view.ctp | 26 ++- webroot/js/addLineItem.js | 21 +- 12 files changed, 291 insertions(+), 347 deletions(-) diff --git a/controllers/costings_controller.php b/controllers/costings_controller.php index af3d18a1..6db944fb 100755 --- a/controllers/costings_controller.php +++ b/controllers/costings_controller.php @@ -27,11 +27,24 @@ class CostingsController extends AppController { $this->Session->setFlash(__('The Costing could not be saved. Please, try again.', true)); } } - $products = $this->Costing->Product->find('list'); - $lineItems = $this->Costing->LineItem->find('list'); + if(isset($this->params['named']['productid'])) { + $product = $this->Costing->Product->findById($this->params['named']['productid']); + + $this->set('product', $product); + } + + if(isset($this->params['named']['lineitemid'])) { + $line_item = $this->Costing->LineItem->findById($this->params['named']['lineitem']); + + $this->set('line_item', $line_item); + + } + + + $purchaseCurrencies = $this->Costing->PurchaseCurrency->find('list'); $saleCurrencies = $this->Costing->SaleCurrency->find('list'); - $this->set(compact('products', 'lineItems', 'purchaseCurrencies', 'saleCurrencies')); + $this->set(compact('purchaseCurrencies', 'saleCurrencies')); } function edit($id = null) { diff --git a/controllers/principles_controller.php b/controllers/principles_controller.php index 5aca7c28..5240c761 100755 --- a/controllers/principles_controller.php +++ b/controllers/principles_controller.php @@ -6,7 +6,7 @@ class PrinciplesController extends AppController { var $paginate = array( 'Principle' => array('limit' => 50, 'order' => array('Principle.name' => 'asc')), - 'Enquiry' => array('limit' => 200, 'order' => array('Enquiry.id' => 'desc')) + 'Enquiry' => array('limit' => 150, 'order' => array('Enquiry.id' => 'desc')) ); function index() { diff --git a/controllers/quotes_controller.php b/controllers/quotes_controller.php index 1cbdecb1..3e55e572 100755 --- a/controllers/quotes_controller.php +++ b/controllers/quotes_controller.php @@ -189,7 +189,7 @@ class QuotesController extends AppController { $this->set('quote', $quote); $this->set('enquiry', $enquiry); - + $this->set('principlesList', $this->Quote->Enquiry->Principle->find('list')); $this->set('products', $quoteProducts); @@ -218,7 +218,7 @@ class QuotesController extends AppController { $user = $this->Quote->Enquiry->User->find('first', array('conditions' => array('User.id' => $enquiry['Enquiry']['user_id']))); - + $this->set('principlesList', $this->Quote->Enquiry->Principle->find('list')); /** @@ -275,8 +275,8 @@ class QuotesController extends AppController { $this->set('quote', $quote); $this->set('enquiry', $enquiry); - - + + $this->set('products', $quoteProducts); } @@ -284,66 +284,6 @@ class QuotesController extends AppController { } - function BROKENajaxpdf() { - Configure::write('debug',0); - - if($this->RequestHandler->isAjax()) { - - $quoteid = $this->data['Quote']['id']; - $quote = $this->Quote->findById($quoteid); - - //$customer = $this->Quote->Enquiry->Customer->read(null, $quote['Enquiry']['customer_id']); - $enquiry = $this->Quote->Enquiry->find('first', array('conditions' => array('Enquiry.id' => $quote['Quote']['enquiry_id']))); - - - $quoteProducts = $this->Quote->LineItem->find('all', array('recursive' => 0, 'conditions' => array('LineItem.quote_id' => $id), - 'order' => array('LineItem.item_number ASC')) - ); - - $user = $this->Quote->Enquiry->User->find('first', array('conditions' => array('User.id' => $enquiry['Enquiry']['user_id']))); - - if($enquiry['Enquiry']['gst'] == 1) { - $gstPhrase = "10% EXTRA"; - } - else { - $gstPhrase = "Not Applicable for Export"; - } - - $commercialDetails = array ( - 'deliveryTime' => strtoupper($quote['Quote']['delivery_time']), - 'paymentTerms' => strtoupper($quote['Quote']['payment_terms']), - 'dateIssued' => $quote['Quote']['date_issued'], - 'validFor' => $quote['Quote']['days_valid'], - 'deliveryPoint' => strtoupper($quote['Quote']['delivery_point']), - 'exchangeRate' => strtoupper($quote['Quote']['exchange_rate']), - 'customsDuty' => strtoupper($quote['Quote']['customs_duty']), - 'gst' => strtoupper($gstPhrase), - 'salesEngineer' => strtoupper($user['User']['first_name'].' '.$user['User']['last_name']) - - - - - - ); - - $this->set('commercialDetails', $commercialDetails); - - //debug($quote); - //debug($commercialDetails); - - - - $this->set('quote', $quote); - $this->set('enquiry', $enquiry); - - - - $this->set('products', $quoteProducts); - - - } - - } /** diff --git a/vendors/shells/vault.php b/vendors/shells/vault.php index 3d7caa0f..11cb8a26 100755 --- a/vendors/shells/vault.php +++ b/vendors/shells/vault.php @@ -49,7 +49,7 @@ class VaultShell extends Shell { //echo "Checking msg number: $i \tSubject: ".$message['subject']."\n"; $enquiry = $this->checkIfValidEnquiry($message['subject'], $testing); if($enquiry) { - echo "Found Enquiry number: ".$enquiry['Enquiry']['title']." Processing.\n"; + //echo "Found Enquiry number: ".$enquiry['Enquiry']['title']." Processing.\n"; //Process it and store the message and its attachments. //Generate a Uniqid for this email. @@ -127,17 +127,12 @@ class VaultShell extends Shell { } echo "Email stored in the DB under enquiry ".$enquiry['Enquiry']['title']." Will be moved to the stored folder\n"; - $stored_msgs[] = imap_uid($mbox,$i); - - - - - // if($attachments != 1) { - // $this->clearEmailAttachmentDirs($email_dir, $temp_filename, $attachments); - //unlink($email_dir.'/'.$temp_filename); #remove the temp email. start again - // } - + //$stored_msgs[] = imap_uid($mbox,$i); + if($testing == 0) { + imap_mail_move($mbox, $no, 'INBOX/Stored'); + } + } else { @@ -166,7 +161,7 @@ class VaultShell extends Shell { - if(isset($stored_msgs)) { + /* if(isset($stored_msgs)) { foreach($stored_msgs as $msg) { $no = imap_msgno($mbox,$msg); @@ -190,6 +185,8 @@ class VaultShell extends Shell { } } + * */ + /* Finished working with the IMAP server. Make the changes and close the connection */ imap_expunge($mbox); imap_close($mbox); diff --git a/vendors/xtcpdf.php b/vendors/xtcpdf.php index d505da97..c39f31fc 100755 --- a/vendors/xtcpdf.php +++ b/vendors/xtcpdf.php @@ -179,85 +179,6 @@ class XTCPDF extends TCPDF { } - /** - * Product Pages, made using writeHTML Cell. - * - * - * - * @param $principleName - * @param $currency - * @param $gst - * @param $products - * @param $docType - * @param $commercialDetails - */ - function productPageHTML($principleName, $currency,$gst, $products ,$docType, $commercialDetails) { - $this->SetAutoPageBreak(true, 20); - $this->setPrintHeader(true); - $this->SetTopMargin(20); - $this->AddPage(); - - $currencyISOcode = $currency['iso4217']; - - $item_width = 40; - $qty_width = 40; - $desc_width = 340; - $unitprice_width = 60; - $totalprice_width = 60; - - - $tbl = << - - - ITEM NO. - QTY - DESCRIPTION - UNIT PRICE - TOTAL PRICE - - - - - - - $currencyISOcode - $currencyISOcode - - - -EOD; - - - foreach ($products as $product) { - $fullDesc = "".$product[$docType]['title'].'
'.$product[$docType]['description']; - // echo $fullDesc; - $itemno = number_format($product[$docType]['item_number'], 1, '.', ''); - $qty = $product[$docType]['quantity']; - - $unit_price = $this->formatCurrency($currency['symbol'], $product[$docType]['unit_price']); - $thisTotalPrice = $product[$docType]['quantity']*$product[$docType]['unit_price']; - $total_price = $this->formatCurrency($currency['symbol'],$thisTotalPrice); - - - - $tbl .= << - $itemno - $qty - $fullDesc - $unit_price - $total_price - - -ENDPRODUCT; - } - $tbl .= ""; - - $this->writeHTML($tbl, true, false, false, false, ""); - - } /** @@ -269,7 +190,7 @@ ENDPRODUCT; * @param $docType * @param $commercialDetails */ - function calculateProductPage($principleName, $currency,$gst, $products ,$docType, $commercialDetails) { + function calculateProductPage($principlesList, $currency,$gst, $products ,$docType, $commercialDetails) { $itemColwidth = 12; $qtyColwidth = 10; @@ -289,7 +210,7 @@ ENDPRODUCT; $this->startTransaction(); - $fullDesc = "".$product[$docType]['title'].'GG
'.$product[$docType]['description']; + $fullDesc = "".$principlesList[$product[$docType]['principle_id']]."
"."".$product[$docType]['title'].'
'.$product[$docType]['description']; $this->MultiCell($descColwidth, 0, $fullDesc, 1, "L", 0, 0, null, null, true, 0, true); $lasth = $this->getLastH(); @@ -298,18 +219,18 @@ ENDPRODUCT; - echo $product[$docType]['id']." needs ".$lasth." has $heightLeft left
"; + //echo $product[$docType]['id']." needs ".$lasth." has $heightLeft left
"; $itemno = $product[$docType]['item_number']; if($heightLeft - $lasth <= 0) { - echo "
OUT OF SPACE ON PAGE $pagesRequired making a new one
"; + // echo "
OUT OF SPACE ON PAGE $pagesRequired making a new one
"; $pagesRequired++; $heightLeft = $availableHeight; //Start checking the next page; - echo "
remaining height on new one = ".$heightLeft."
"; + // echo "
remaining height on new one = ".$heightLeft."
"; $heightLeft -= $lasth; $itemno = $product[$docType]['item_number']; - echo "
Using $lasth for $itemno so now have $heightLeft left
"; + // echo "
Using $lasth for $itemno so now have $heightLeft left
"; $pageProducts[$pagesRequired][] = $product[$docType]['id']; @@ -336,12 +257,12 @@ ENDPRODUCT; $this->rollbackTransaction($this); - echo "Currently have $heightLeft Comm details height is ".$commDetailsHeight." totals height is: ".$totalsHeight."
"; + //echo "Currently have $heightLeft Comm details height is ".$commDetailsHeight." totals height is: ".$totalsHeight."
"; if($heightLeft - $totalsHeight <= 0) { - echo "
Need a new page for last item and totals"; + // echo "
Need a new page for last item and totals"; array_pop($pageProducts[$pagesRequired]); $pagesRequired++; $heightLeft = $availableHeight; @@ -361,14 +282,15 @@ ENDPRODUCT; /** * - * @param $principleName + * @param Map $principles - list of principles. A hack so we can show a products principle name on it, without rewriting + * lots of code. * @param $currency * @param int $gst - 0 or 1 if GST is applicable. * @param $products * @param String $docType - the model name of the Products we want to put in the table. ie. QuoteProduct, or InvoiceProduct, etc * @param Map $commercialDetails - the details array/map - passed to commercialComments() */ - function productPage($principleName, $currency,$gst, $products ,$docType, $commercialDetails, $pageProducts) { + function productPage($principlesList, $currency,$gst, $products ,$docType, $commercialDetails, $pageProducts) { $this->SetFontSize(10); @@ -391,8 +313,8 @@ ENDPRODUCT; $options = 0; //Toggled to 1 when we encounter an Optional product. Stops the totals being printed. - print_r($pageProducts); - // print_r($products); + echo "FUCK"; + print_r($principlesList); foreach ($pageProducts as $page) { $this->AddPage(); @@ -435,7 +357,7 @@ ENDPRODUCT; foreach($page as $productID) { $product = array_shift($products); - $fullDesc = "".$product['Principle']['name']."
"."".$product[$docType]['title'].'
'.$product[$docType]['description']; + $fullDesc = "".$principlesList[$product[$docType]['id']]."
"."".$product[$docType]['title'].'
'.$product[$docType]['description']; if($product[$docType]['option'] == 1) { $options = 1; @@ -456,13 +378,40 @@ ENDPRODUCT; $this->SetX($endOfDesc); - $this->MultiCell($unitpriceColwidth, $heightNeeded, $this->formatCurrency($currency['symbol'], $product[$docType]['unit_price']), 1, "C", 0, 0); - $thisTotalPrice = $product[$docType]['quantity']*$product[$docType]['unit_price']; - $this->MultiCell($totalPricColwidth, $heightNeeded, $this->formatCurrency($currency['symbol'],$thisTotalPrice), 1, "C", 0, 1); + if($product[$docType]['discount_percent'] != 0) { + + + + + $unitPriceString = $this->formatCurrency($currency['symbol'], $product[$docType]['unit_price']); + $unitPriceString .= "
less ".$product[$docType]['discount_percent']."% discount
(-" + .$this->formatCurrency($currency['symbol'], $product[$docType]['discount_amount_each']).")
=
"; + $unitPriceString .= $this->formatCurrency($currency['symbol'], $product[$docType]['net_price_each']); + + $totalPriceString = $this->formatCurrency($currency['symbol'], $product[$docType]['gross_price']); + $totalPriceString .= "
less ".$product[$docType]['discount_percent']."% discount
(-" + .$this->formatCurrency($currency['symbol'], $product[$docType]['total_discount_amount']).")
=
"; + $totalPriceString .= $this->formatCurrency($currency['symbol'], $product[$docType]['net_price']); + + } + else { + $unitPriceString = $this->formatCurrency($currency['symbol'], $product[$docType]['unit_price']); + $totalPriceString = $this->formatCurrency($currency['symbol'], $product[$docType]['net_price']); + + } + + //Unit Price Column + $this->MultiCell($unitpriceColwidth, $heightNeeded, $unitPriceString , 1, "C", 0, 0, null, null, true, 0, true); - $subTotal += $thisTotalPrice; + + //Net Price Column + $this->MultiCell($totalPricColwidth, $heightNeeded, $totalPriceString, 1, "C", 0, 1, null, null, true, 0, true); + + + + $subTotal += $product[$docType]['net_price']; $lastY = $this->GetY(); $lastX = $this->GetX(); //echo $product[$docType]['item_number']." Last X is $lastX, Last Y is $lastY
"; @@ -610,7 +559,7 @@ ENDHTMLCONTENTS; $totalPricColwidth = -10; $totalHeight = 0; - echo "desc col wdith : ".$descColwidth; + // echo "desc col wdith : ".$descColwidth; $this->MultiCell($itemColwidth, 6, "", 1, 'C', 0, 0); $totalHeight += $this->getLastH(); $this->MultiCell($qtyColwidth, 6, "", 1, 'C', 0, 0); diff --git a/views/costings/add.ctp b/views/costings/add.ctp index 045c25fe..6a2e631b 100755 --- a/views/costings/add.ctp +++ b/views/costings/add.ctp @@ -3,12 +3,21 @@
create('Costing', array('class'=>'cmxform'));?> - + input('product_id', array('type'=>'hidden', 'value'=>$product['Product']['id'])); + } + + elseif(isset($line_item)) { + $form->input('line_item_id', array('type'=>'hidden', 'value'=>$line_item['LineItem']['id'])); + + } + ?> + +
Quantity, Unit price, Packing costs input('product_id'); - echo $form->input('line_item_id'); + echo $form->input('purchase_currency_id'); echo $form->input('sale_currency_id', array('default'=>2)); echo $form->input('quantity'); @@ -81,7 +90,6 @@ -
input('duty_amount', array('type'=>'hidden')); echo $form->input('finance_amount', array('type'=>'hidden')); diff --git a/views/line_items/view_table.ctp b/views/line_items/view_table.ctp index 07c59e5c..3cc00d43 100644 --- a/views/line_items/view_table.ctp +++ b/views/line_items/view_table.ctp @@ -1,151 +1,158 @@ -

+

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - - - - - + + + + + + + + + - + -
Unit Price () ()
SUB-TOTAL (Excluding GST)
GST (10%)
TOTAL PAYABLE -
'; - } - echo number_format($lineItem['LineItem']['item_number'], 1, '.', '');?> - link(__('View', true), array('controller'=> 'line_items', 'action'=>'view', $lineItem['LineItem']['id'])); ?> - link(__('Edit', true), array('controller'=> 'line_items', 'action'=>'edit', $lineItem['LineItem']['id'])); ?> - link(__('Delete', true), array('controller'=> 'line_items', 'action'=>'delete', $lineItem['LineItem']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $lineItem['LineItem']['id'])); ?> -
Unit Price () ()
\ No newline at end of file + + + + + + + SUB-TOTAL (Excluding GST) + + + + + + + + + + GST (10%) + + + + + + + + + + + TOTAL PAYABLE + + + + + + + + + + > + + '; + } + echo number_format($lineItem['LineItem']['item_number'], 1, '.', '');?> + + + + + + less ".$lineItem['LineItem']['discount_percent']."% discount (-". + $quote['Currency']['symbol'].$lineItem['LineItem']['discount_amount_each'].")
"; + echo "=
".$quote['Currency']['symbol'].$lineItem['LineItem']['net_price_each']; + } + + ?> + + + + link(__('View', true), array('controller'=> 'line_items', 'action'=>'view', $lineItem['LineItem']['id'])); ?> + link(__('Edit', true), array('controller'=> 'line_items', 'action'=>'edit', $lineItem['LineItem']['id'])); ?> + link(__('Delete', true), array('controller'=> 'line_items', 'action'=>'delete', $lineItem['LineItem']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $lineItem['LineItem']['id'])); ?> + + + + + + + \ No newline at end of file diff --git a/views/products/view.ctp b/views/products/view.ctp index 1e6c7698..fe9b989b 100755 --- a/views/products/view.ctp +++ b/views/products/view.ctp @@ -36,7 +36,9 @@
  • link(__('Edit Product', true), array('action'=>'edit', $product['Product']['id'])); ?>
  • - +
  • link(__('Add Costing', true), array('controller'=>'costings', 'action'=>'add/productid:'.$product['Product']['id']));?>
  • + +
@@ -103,6 +105,12 @@
+ +
+ + + + diff --git a/views/quotes/ajaxpdf.ctp b/views/quotes/ajaxpdf.ctp index 066da819..263072be 100644 --- a/views/quotes/ajaxpdf.ctp +++ b/views/quotes/ajaxpdf.ctp @@ -26,7 +26,7 @@ $tcpdf->SetHeaderMargin(2); $tcpdf->setPrintHeader(false); $tcpdf->setPrintFooter(false); -$principle_name = strtoupper($enquiry['Principle']['name']); + $pageProducts = $tcpdf->calculateProductPage($principle_name, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails); @@ -100,7 +100,7 @@ foreach ($quote['QuotePage'] as $page) { -$tcpdf->productPage($principle_name, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails, +$tcpdf->productPage($principlesList, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails, $pageProducts); diff --git a/views/quotes/pdf.ctp b/views/quotes/pdf.ctp index 079bdc17..195762ee 100755 --- a/views/quotes/pdf.ctp +++ b/views/quotes/pdf.ctp @@ -27,8 +27,8 @@ $tcpdf->SetHeaderMargin(2); $tcpdf->setPrintHeader(false); $tcpdf->setPrintFooter(false); -$principle_name = strtoupper($enquiry['Principle']['name']); -$pageProducts = $tcpdf->calculateProductPage($principle_name, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails); + +$pageProducts = $tcpdf->calculateProductPage($principlesList, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails); $page1done = false; //Have we already made the first page? If so, don't show the CMC header/footer @@ -90,7 +90,7 @@ foreach ($quote['QuotePage'] as $page) { //print_r($products); - +print_r($principlesList); //debug($commercialDetails); @@ -100,10 +100,11 @@ foreach ($quote['QuotePage'] as $page) { -$tcpdf->productPage($principle_name, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails, +$tcpdf->productPage($principlesList, $quote['Currency'], $enquiry['Enquiry']['gst'], $products, 'LineItem', $commercialDetails, $pageProducts); +//print_r($products); $output_dir = '/Users/karlcordes/Sites/quotenik/app/webroot/pdf/'; diff --git a/views/quotes/view.ctp b/views/quotes/view.ctp index 5f2cf4f9..e6fb4964 100755 --- a/views/quotes/view.ctp +++ b/views/quotes/view.ctp @@ -1,10 +1,11 @@ link('addLineItem'); ?> +link('lineItemPriceNoCosting'); ?>

link($quote['Enquiry']['title'], - array('controller'=>'enquiries', 'action'=>'view', $quote['Enquiry']['id'])); + array('controller'=>'enquiries', 'action'=>'view', $quote['Enquiry']['id'])); $customer_link = $html->link( $customer['Customer']['name'], array('controller'=>'customers', 'action' => 'view', $customer['Customer']['id'])); @@ -57,7 +58,7 @@ foreach ($quote['QuotePage'] as $quotePage):
- +
@@ -66,7 +67,7 @@ foreach ($quote['QuotePage'] as $quotePage): - +
@@ -130,7 +131,7 @@ foreach ($quote['QuotePage'] as $quotePage): echo $form->input('item_number'); echo $form->input('option', array('label'=>'Optional Item')); - echo $form->input('quantity'); + echo $form->input('quantity', array('class'=>'nocostinput')); echo $form->input('principle_id', array('options'=>$principles, 'empty' =>'Select the Principle for this Product')); @@ -140,11 +141,18 @@ foreach ($quote['QuotePage'] as $quotePage):
- input('unit_price', array('id'=>"unitPrice")); ?> + input('unit_price', array('id'=>"unitPrice", 'div'=>'nocosting', 'class'=>'nocostinput')); ?> + input('discount_percent', array('id'=>'discountPercent', 'div'=>'nocosting', 'class'=>'nocostinput')); + echo $form->input('discount_amount_each', array('id'=>'discountAmountEach', 'readonly'=>'readonly', 'div'=>'nocosting')); + echo $form->input('net_price_each', array('id'=>'net_price_each', 'readonly'=>'readonly', 'div'=>'nocosting')); + echo $form->input('total_discount_amount', array('id'=>'total_discountAmount', 'readonly'=>'readonly', 'div'=>'nocosting')); + echo $form->input('gross_price', array('id'=>'grossPrice', 'readonly'=>'readonly', 'div'=>'nocosting')); + echo $form->input('net_price', array('id'=>'netPrice', 'readonly'=>'readonly', 'div'=>'nocosting')); + ?>
input('title'); echo $form->input('description'); @@ -153,7 +161,7 @@ foreach ($quote['QuotePage'] as $quotePage): echo $form->input('product_id'); echo $form->input('costing_id'); echo $form->input('unit_price'); - */ + */ ?>
@@ -162,4 +170,6 @@ foreach ($quote['QuotePage'] as $quotePage): ?>

-
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/webroot/js/addLineItem.js b/webroot/js/addLineItem.js index b52ec3f3..60a4c7d5 100644 --- a/webroot/js/addLineItem.js +++ b/webroot/js/addLineItem.js @@ -16,7 +16,12 @@ $(function() { fetchTable(); var quoteID = $("#QuoteId").serialize(); - $("#unitPrice").hide(); + + + $(".nocosting").hide(); + + + $("#addLineItem-form").dialog({ autoOpen: false, height: 800, @@ -29,10 +34,10 @@ $(function() { fetchTable(); } - ); + ); - $("#LineItemAddForm").resetForm(); - $(this).dialog('close'); + $("#LineItemAddForm").resetForm(); + $(this).dialog('close'); }, Cancel: function() { $(this).dialog('close'); @@ -73,7 +78,11 @@ $(function() { altField: '#QuoteDateIssued' }); + + + + }); @@ -105,7 +114,8 @@ function getProductOptions() { }); - $("#unitPrice").show(); + $(".nocosting").show(); + } @@ -120,3 +130,4 @@ function fetchTable() { } +