Making changes to Vault. Hopefully it will work
This commit is contained in:
parent
b1cac9e89d
commit
7f08e9e53b
|
|
@ -39,6 +39,13 @@ class QuotesController extends AppController {
|
|||
$this->data['Quote']['enquiry_id'] = $enquiryid;
|
||||
$this->data['Quote']['date_issued'] = date('Y-m-d');
|
||||
|
||||
$this->data['Quote']['currency_id'] = 2;
|
||||
|
||||
/**
|
||||
* @todo Fix this hard coded default currency. Currently set to '2' for AUD.
|
||||
*/
|
||||
|
||||
|
||||
if ($this->Quote->save($this->data)) {
|
||||
$quoteid = $this->Quote->id;
|
||||
|
||||
|
|
@ -84,7 +91,8 @@ class QuotesController extends AppController {
|
|||
$this->data = $quote;
|
||||
}
|
||||
$enquiry = $this->Quote->Enquiry->findById($quote['Quote']['enquiry_id']);
|
||||
$this->set(compact('enquiry', 'quote'));
|
||||
$currencies = $this->Quote->Currency->find('list');
|
||||
$this->set(compact('enquiry', 'quote', 'currencies'));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -96,15 +104,24 @@ class QuotesController extends AppController {
|
|||
}
|
||||
$quote = $this->Quote->findById($id);
|
||||
//$customer = $this->Quote->Enquiry->Customer->read(null, $quote['Enquiry']['customer_id']);
|
||||
$enquiry = $this->Quote->Enquiry->findById($quote['Quote']['enquiry_id']);
|
||||
$enquiry = $this->Quote->Enquiry->find('first', array('conditions' => array('Enquiry.id' => $quote['Quote']['enquiry_id'])));
|
||||
|
||||
|
||||
$quoteProducts = $this->Quote->QuoteProduct->find('all', array('recursive' => 0, 'conditions' => array('QuoteProduct.quote_id' => $id),
|
||||
'order' => array('QuoteProduct.item_number ASC'))
|
||||
);
|
||||
|
||||
|
||||
$this->set('quote', $quote);
|
||||
$this->set('enquiry', $enquiry);
|
||||
|
||||
$this->set('products', $quoteProducts);
|
||||
|
||||
// $this->set('customer', $customer);
|
||||
//$this->layout = 'pdf';
|
||||
//$this->render();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -18,7 +18,9 @@ class Quote extends AppModel {
|
|||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
),
|
||||
|
||||
'Currency' => array('className' => 'Currency', 'foreignKey' => 'currency_id')
|
||||
);
|
||||
|
||||
var $hasMany = array(
|
||||
|
|
|
|||
2
vendors/shells/vault.php
vendored
2
vendors/shells/vault.php
vendored
|
|
@ -24,7 +24,7 @@ class VaultShell extends Shell {
|
|||
$email_dir = '/var/www/quotenik1.2/app/emails/working';
|
||||
}
|
||||
|
||||
$mbox = imap_open("{saturn:143/novalidate-cert}INBOX", $username, $password) or die("can't connect: " . imap_last_error());
|
||||
$mbox = imap_open("{neptune:143/novalidate-cert}INBOX", $username, $password) or die("can't connect: " . imap_last_error());
|
||||
$MC = imap_check($mbox);
|
||||
$number_of_messages = $MC->Nmsgs;
|
||||
|
||||
|
|
|
|||
226
vendors/xtcpdf.php
vendored
226
vendors/xtcpdf.php
vendored
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
App::import('Vendor','tcpdf/tcpdf');
|
||||
|
||||
class XTCPDF extends TCPDF
|
||||
{
|
||||
class XTCPDF extends TCPDF {
|
||||
|
||||
var $xheadertext = 'PDF created using CakePHP and TCPDF';
|
||||
var $xheadercolor = array(0,0,200);
|
||||
|
|
@ -13,16 +12,15 @@ class XTCPDF extends TCPDF
|
|||
|
||||
|
||||
/**
|
||||
* Overwrites the default header
|
||||
* set the text in the view using
|
||||
* $fpdf->xheadertext = 'YOUR ORGANIZATION';
|
||||
* set the fill color in the view using
|
||||
* $fpdf->xheadercolor = array(0,0,100); (r, g, b)
|
||||
* set the font in the view using
|
||||
* $fpdf->setHeaderFont(array('YourFont','',fontsize));
|
||||
*/
|
||||
function Page1Header()
|
||||
{
|
||||
* Overwrites the default header
|
||||
* set the text in the view using
|
||||
* $fpdf->xheadertext = 'YOUR ORGANIZATION';
|
||||
* set the fill color in the view using
|
||||
* $fpdf->xheadercolor = array(0,0,100); (r, g, b)
|
||||
* set the font in the view using
|
||||
* $fpdf->setHeaderFont(array('YourFont','',fontsize));
|
||||
*/
|
||||
function Page1Header() {
|
||||
|
||||
|
||||
list($r, $b, $g) = $this->xheadercolor;
|
||||
|
|
@ -33,7 +31,7 @@ class XTCPDF extends TCPDF
|
|||
$this->SetFillColor(255, 255, 255);
|
||||
$this->SetTextColor(0 , 0, 152); //Set the Text Color to Blue
|
||||
|
||||
// $this->Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border, $fitbox, $hidden)
|
||||
// $this->Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border, $fitbox, $hidden)
|
||||
|
||||
$this->Image(K_PATH_IMAGES.'cmclogosmall.jpg', 10, 10, 30, 0, null, 'http://www.cmctechnologies.com.au', null, false, null, 'L');
|
||||
$this->Cell(30);
|
||||
|
|
@ -46,9 +44,9 @@ class XTCPDF extends TCPDF
|
|||
$this->Cell(0,0, "PTY LIMITED ACN: 47 085 991 224 ABN: 47 085 991 224", 0, 1, 'C', 1);
|
||||
|
||||
|
||||
$this->Rect($this->GetX()+33, $this->GetY()+2, 157, 2, 'DF', array('width'=>0), array(0, 0, 0));
|
||||
$this->Rect($this->GetX()+33, $this->GetY()+2, 157, 2, 'DF', array('width'=>0), array(0, 0, 0));
|
||||
/* Start the contact details */
|
||||
$this->SetTextColor(0); //Set the Text Color to Black
|
||||
$this->SetTextColor(0); //Set the Text Color to Black
|
||||
$this->MultiCell(18, 0, "Phone:\nFax:\nEmail:\nWeb Site:\n", 0, 'L', 0, 0, 45, 32);
|
||||
|
||||
|
||||
|
|
@ -68,12 +66,11 @@ class XTCPDF extends TCPDF
|
|||
}
|
||||
|
||||
/**
|
||||
* Overwrites the default footer
|
||||
* set the text in the view using
|
||||
* $fpdf->xfootertext = 'Copyright © %d YOUR ORGANIZATION. All rights reserved.';
|
||||
*/
|
||||
function Page1Footer()
|
||||
{
|
||||
* Overwrites the default footer
|
||||
* set the text in the view using
|
||||
* $fpdf->xfootertext = 'Copyright © %d YOUR ORGANIZATION. All rights reserved.';
|
||||
*/
|
||||
function Page1Footer() {
|
||||
$this->SetY(-20);
|
||||
$this->Image(K_PATH_IMAGES.'cmcfooter.jpg', null, 255, 200, 0, null, 'http://www.cmctechnologies.com.au', null, false, null, 'C');
|
||||
}
|
||||
|
|
@ -85,84 +82,62 @@ class XTCPDF extends TCPDF
|
|||
|
||||
$this->SetTextColor(0); //Black Text
|
||||
|
||||
$boxYstart = 45;
|
||||
$boxXstart = 10;
|
||||
$firstColWidth = 40;
|
||||
$secondColWidth = 70;
|
||||
$thirdColWidth = 30;
|
||||
$fourthColWidth = -10;
|
||||
$boxYstart = 45;
|
||||
$boxXstart = 10;
|
||||
$firstColWidth = 40;
|
||||
$secondColWidth = 70;
|
||||
$thirdColWidth = 30;
|
||||
$fourthColWidth = -10;
|
||||
|
||||
$pageNo = $this->PageNoFormatted();
|
||||
//$pageOf = $this->getAliasNbPages();
|
||||
|
||||
/* Debugging Vars
|
||||
$companyName = "LONG COMPANY NAME TRADING AS MR AWESOME PTY LTD LONG COMPANY NAME TRADING AS MR AWESOME PTY LTD ";
|
||||
$emailTo = "theman@theman.com";
|
||||
$attention = "Joe Bloggs";
|
||||
$fromName = "Mr Sales Man";
|
||||
$fromEmail = "SalesMan@cmctechnologies.com.au";
|
||||
$enquiryNumber = "CMC1234NE22656-41";
|
||||
*/
|
||||
$pageNo = $this->PageNoFormatted();
|
||||
//$pageOf = $this->getAliasNbPages();
|
||||
|
||||
|
||||
$this->SetXY($boxXstart, 55);
|
||||
|
||||
$heightNeeded = $this->getNumLines($companyName, $secondColWidth);
|
||||
echo "Height needed: $heightNeeded";
|
||||
|
||||
$lineHeight = 6.40997; //Size of a single line of text. If the company name is more, multiply this by the number of lines it needs.
|
||||
|
||||
// $lineHeight = 0;
|
||||
|
||||
// $this->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml);
|
||||
|
||||
|
||||
$this->MultiCell($firstColWidth, $lineHeight*$heightNeeded, "QUOTATION TO:", 'LTR', 'L', 0, 0);
|
||||
$this->MultiCell($secondColWidth, $lineHeight*$heightNeeded, $companyName, 'LTR', 'L', 0, 0);
|
||||
$this->SetXY($boxXstart, 55);
|
||||
|
||||
$this->MultiCell($thirdColWidth, $lineHeight*$heightNeeded, "FROM:", 'LT', 'L', 0, 0);
|
||||
$this->MultiCell($fourthColWidth, $lineHeight*$heightNeeded, "<a href=\"mailto:$fromEmail\">$fromName</a>", 'TR', 'L', 0, 1, null,null, true,0,true); //Start a new line after this.
|
||||
// echo "Last height: ".$this->getLastH();
|
||||
$heightNeeded = $this->getNumLines($companyName, $secondColWidth);
|
||||
echo "Height needed: $heightNeeded";
|
||||
|
||||
$this->MultiCell($firstColWidth, 0, "EMAIL TO:", 'LR', 'L', 0, 0);
|
||||
$this->MultiCell($secondColWidth, 0, "<a href=\"mailto:$emailTo\">$emailTo</a>", 'LR','L', 0, 0, null, null, true, 0, true);
|
||||
$this->MultiCell($thirdColWidth, 0, "CMC REF#:", 'L', 'L', 0, 0);
|
||||
$this->MultiCell($fourthColWidth, 0, $enquiryNumber, 'R', 'L', 0, 1); //Start a new line after thi
|
||||
$lineHeight = 6.40997; //Size of a single line of text. If the company name is more, multiply this by the number of lines it needs.
|
||||
|
||||
$this->MultiCell($firstColWidth, 0, "ATTENTION:", 'LRB', 'L', 0, 0);
|
||||
$this->MultiCell($secondColWidth, 0, $attention, 'LRB', 'L', 0, 0);
|
||||
$this->MultiCell($thirdColWidth, 0, "PAGE: ", 'LB', 'L', 0, 0);
|
||||
$this->MultiCell($fourthColWidth, 0, "$pageNo of {nb}", 'BR', 'L', 0, 1);
|
||||
// $lineHeight = 0;
|
||||
|
||||
// $this->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml);
|
||||
|
||||
|
||||
$todaysDateString = date('l, j F Y');
|
||||
$this->MultiCell($firstColWidth + $secondColWidth, 0, "DATE: $todaysDateString", 'LRB', 'L', 0, 0);
|
||||
$this->MultiCell($thirdColWidth, 0, "YOUR REF: ", 'LB', 'L', 0, 0);
|
||||
$this->MultiCell($firstColWidth, $lineHeight*$heightNeeded, "QUOTATION TO:", 'LTR', 'L', 0, 0);
|
||||
$this->MultiCell($secondColWidth, $lineHeight*$heightNeeded, $companyName, 'LTR', 'L', 0, 0);
|
||||
|
||||
$this->MultiCell($thirdColWidth, $lineHeight*$heightNeeded, "FROM:", 'LT', 'L', 0, 0);
|
||||
$this->MultiCell($fourthColWidth, $lineHeight*$heightNeeded, "<a href=\"mailto:$fromEmail\">$fromName</a>", 'TR', 'L', 0, 1, null,null, true,0,true); //Start a new line after this.
|
||||
// echo "Last height: ".$this->getLastH();
|
||||
|
||||
$this->MultiCell($firstColWidth, 0, "EMAIL TO:", 'LR', 'L', 0, 0);
|
||||
$this->MultiCell($secondColWidth, 0, "<a href=\"mailto:$emailTo\">$emailTo</a>", 'LR','L', 0, 0, null, null, true, 0, true);
|
||||
$this->MultiCell($thirdColWidth, 0, "CMC REF#:", 'L', 'L', 0, 0);
|
||||
$this->MultiCell($fourthColWidth, 0, $enquiryNumber, 'R', 'L', 0, 1); //Start a new line after thi
|
||||
|
||||
$this->MultiCell($firstColWidth, 0, "ATTENTION:", 'LRB', 'L', 0, 0);
|
||||
$this->MultiCell($secondColWidth, 0, $attention, 'LRB', 'L', 0, 0);
|
||||
$this->MultiCell($thirdColWidth, 0, "PAGE: ", 'LB', 'L', 0, 0);
|
||||
$this->MultiCell($fourthColWidth, 0, "$pageNo of {nb}", 'BR', 'L', 0, 1);
|
||||
|
||||
|
||||
$this->MultiCell($fourthColWidth, 0, $your_reference, 'BR', 'L', 0, 1);
|
||||
$this->SetFontSize(6);
|
||||
$todaysDateString = date('l, j F Y');
|
||||
$this->MultiCell($firstColWidth + $secondColWidth, 0, "DATE: $todaysDateString", 'LRB', 'L', 0, 0);
|
||||
$this->MultiCell($thirdColWidth, 0, "YOUR REF: ", 'LB', 'L', 0, 0);
|
||||
|
||||
//Kinda lame that I cant seem to wrap this text nicer. But Whatever.
|
||||
$this->MultiCell(0, 0, 'The information in this document is confidential and may be privileged. If you are not the indended recipient then access, disclosure, copying or other dissemination of the contents of t his message is unauthorised and may be unlawful. Please inform the sender immediately if you are not the intended addressee.',
|
||||
'', 'L'
|
||||
|
||||
$this->MultiCell($fourthColWidth, 0, $your_reference, 'BR', 'L', 0, 1);
|
||||
$this->SetFontSize(6);
|
||||
|
||||
//Kinda lame that I cant seem to wrap this text nicer. But Whatever.
|
||||
$this->MultiCell(0, 0, 'The information in this document is confidential and may be privileged. If you are not the indended recipient then access, disclosure, copying or other dissemination of the contents of t his message is unauthorised and may be unlawful. Please inform the sender immediately if you are not the intended addressee.',
|
||||
'', 'L'
|
||||
);
|
||||
/*
|
||||
*
|
||||
*
|
||||
$this->Cell($firstColWidth, 0, "ATTENTION:", 'LTRB', 0, 'L', 0, null, 0, false);
|
||||
$this->Cell($secondColWidth, 0, $attention, 'LTRB', 0, 'L', 0, "mailto:$emailTo", 0, false);
|
||||
$this->Cell($thirdColWidth, 0, "PAGE: ", 'LTB', 0, 'L', 0, null, 0, false);
|
||||
$this->Cell($fourthColWidth, 0, "$pageNo of {nb}", 'TBR', 1, 'L', 0, null, 0, false); //Start a new line after thi
|
||||
*/
|
||||
// $this->lastPage();
|
||||
|
||||
//$this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height)
|
||||
// $this->MultiCell($firstColWidth, 0, "QUOTATION TO:", 'LTRB', 'L', 0, 0, $boxXstart, $boxYstart, false, false, true, false, 0);
|
||||
//Next Cell to the right.
|
||||
//$this->MultiCell(50, 0, "COMPANY NAME", 'LTRB', 'L', 0, 0, $boxXstart, $boxYstart+$firstColWidth, true, false, true, true, 0);
|
||||
|
||||
//$this->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml, $autopadding, $maxh)
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -171,14 +146,91 @@ class XTCPDF extends TCPDF
|
|||
$this->SetFontSize(10);
|
||||
$pageNo = $this->PageNoFormatted();
|
||||
$this->MultiCell(0,13.6, "$cmcRef PAGE $pageNo OF {nb}", '', 'R');
|
||||
//$this->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml)
|
||||
//$this->Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi)
|
||||
//$this->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $reseth, $stretch, $ishtml)
|
||||
//$this->Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi)
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param <type> $principleName
|
||||
* @param <type> $currency
|
||||
* @param <type> $products
|
||||
* @param String $docType - the model name of the Products we want to put in the table. ie. QuoteProduct, or InvoiceProduct, etc
|
||||
*/
|
||||
function productPage($principleName, $currency, $products ,$docType) {
|
||||
|
||||
|
||||
$this->SetFontSize(10);
|
||||
|
||||
$lineHeight = 8; //Size of a single line of text. If the company name is more, multiply this by the number of lines it needs
|
||||
|
||||
|
||||
|
||||
$itemColwidth = 15;
|
||||
$qtyColwidth = 15;
|
||||
$descColwidth = 130;
|
||||
$unitpriceColwidth = 15;
|
||||
$totalPricColwidth = -10;
|
||||
|
||||
$this->SetFillColor(240);
|
||||
|
||||
//$heightNeeded = $this->getNumLines("ITEM\NO.", $itemColwidth);
|
||||
//echo "HEADER ROW HEIGHT IS $heightNeeded";
|
||||
|
||||
|
||||
|
||||
//Draw Header Rows
|
||||
$pageNo = $this->PageNoFormatted();
|
||||
$this->MultiCell(0, 0, "PRICING & SPECIFICATIONS (PAGE $pageNo OF {nb})", 0, "C", 0, 1);
|
||||
|
||||
|
||||
$this->MultiCell($itemColwidth, 0, "ITEM\nNO.", 1, "C", 1, 0);
|
||||
|
||||
$heightNeeded = $this->getLastH();
|
||||
/**
|
||||
* @todo this seems like a cleaner way of doing it than I did in the detailsBox(). Revise at some point
|
||||
*/
|
||||
|
||||
|
||||
$this->MultiCell($qtyColwidth, $heightNeeded, "QTY", 1, "C", 1, 0);
|
||||
$this->MultiCell($descColwidth, $heightNeeded, "DESCRIPTION", 1, "C", 1, 0);
|
||||
$this->MultiCell($unitpriceColwidth, $heightNeeded, "UNIT\nPRICE", 1, "C", 1, 0);
|
||||
$this->MultiCell($totalPricColwidth, $heightNeeded, "TOTAL\nPRICE", 1, "C", 1, 1);
|
||||
|
||||
//Header Line 2
|
||||
|
||||
$this->MultiCell($itemColwidth, 0, "", 1, "C", 1, 0);
|
||||
|
||||
$heightNeeded = $this->getLastH();
|
||||
$this->MultiCell($qtyColwidth, $heightNeeded, "", 1, "C", 1, 0);
|
||||
$this->MultiCell($descColwidth, $heightNeeded, $principleName, 1, "C", 1, 0);
|
||||
$this->MultiCell($unitpriceColwidth, $heightNeeded, $currency, 1, "C", 1, 0);
|
||||
$this->MultiCell($totalPricColwidth, $heightNeeded, $currency, 1, "C", 1, 1);
|
||||
|
||||
|
||||
foreach ($products as $product) {
|
||||
//Need to use the getNumLines method to figure out how big to make the cells before the description cell
|
||||
$fullDesc = $product[$docType]['title'].'<br>'.$product[$docType]['description'];
|
||||
|
||||
$linesNeeded = $this->getNumLines($fullDesc, $descColwidth);
|
||||
|
||||
|
||||
$this->MultiCell($itemColwidth, $linesNeeded*$lineHeight, number_format($product[$docType]['item_number'], 1, '.', ''), 1, "C", 0, 0);
|
||||
$this->MultiCell($qtyColwidth, $linesNeeded*$lineHeight, $product[$docType]['quantity'], 1, "C", 0, 0);
|
||||
|
||||
|
||||
$quoteProduct['QuoteProduct']['item_number'];
|
||||
|
||||
$this->MultiCell($descColwidth, $linesNeeded*$lineHeight, $fullDesc, 1, "L", 0, 0, null, null, true, 0, true);
|
||||
|
||||
$this->MultiCell($unitpriceColwidth, $linesNeeded*$lineHeight, "$1000", 1, "C", 0, 0);
|
||||
$this->MultiCell($totalPricColwidth, $linesNeeded*$lineHeight, "$2000", 1, "C", 0, 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function productPage() {
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
77
views/costings/add.ctp
Normal file
77
views/costings/add.ctp
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<div class="costings form">
|
||||
|
||||
|
||||
|
||||
<?php echo $form->create('Costing');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Add Costing');?></legend>
|
||||
<?php
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('quote_product_id');
|
||||
echo $form->input('order_product_id');
|
||||
echo $form->input('invoice_product_id');
|
||||
echo $form->input('purchase_currency_id');
|
||||
echo $form->input('sale_currency_id');
|
||||
echo $form->input('quantity');
|
||||
echo $form->input('unit_cost_price');
|
||||
echo $form->input('exchange_rate');
|
||||
echo $form->input('our_discount_percent');
|
||||
echo $form->input('packing');
|
||||
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('fob_country_of_export', 'F.O.B Country of Export');
|
||||
echo $form->text('fob_country_of_export', array('readonly'=>'readonly', 'id'=>'fob_country_of_export'));
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('convert_to_aud', 'Convert to A$');
|
||||
echo $form->text('convert_to_aud', array('readonly'=>'readonly', 'id'=>'convert_to_aud'));
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo $form->input('shipping_weight');
|
||||
echo $form->input('shipping_cost');
|
||||
echo $form->input('duty_percent');
|
||||
echo $form->input('customs');
|
||||
echo $form->input('finance_percent', array('after'=>'<p id="financeamount"> </p>'));
|
||||
echo $form->input('misc_costs');
|
||||
echo $form->input('gross_sell_price');
|
||||
echo $form->input('sale_discount_percent');
|
||||
echo $form->input('net_sell_price');
|
||||
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('total_landed_cost', 'Total Landed Cost');
|
||||
echo $form->text('total_landed_cost', array('readonly'=>'readonly', 'id'=>'total_landed_cost'));
|
||||
echo '</div>';
|
||||
echo $form->input('sellprice_each', array('label' => 'Sell Price Each', 'id'=>'sellprice_each'));
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('gross_profit_dollars', 'Gross Profit $');
|
||||
echo $form->text('gross_profit_dollars', array('readonly'=>'readonly', 'id'=>'gross_profit_dollars'));
|
||||
echo '</div>';
|
||||
echo '<div class="input text">';
|
||||
echo $form->label('gross_profit_percent', 'Gross Profit %');
|
||||
echo $form->text('gross_profit_prercent', array('readonly'=>'readonly', 'id'=>'gross_profit_percent'));
|
||||
echo '</div>';
|
||||
|
||||
|
||||
//echo $ajax->observeForm('CostingAddForm', array('frequency' => 0.5, 'complete'=>'buildup()'));
|
||||
|
||||
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
|
||||
<?php echo $javascript->link('quotenik/add_costing', true); ?>
|
||||
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('List Costings', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
42
views/costings/edit.ctp
Normal file
42
views/costings/edit.ctp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<div class="costings form">
|
||||
<?php echo $form->create('Costing');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit Costing');?></legend>
|
||||
<?php
|
||||
echo $form->input('id');
|
||||
echo $form->input('product_id');
|
||||
echo $form->input('quote_product_id');
|
||||
echo $form->input('order_product_id');
|
||||
echo $form->input('invoice_product_id');
|
||||
echo $form->input('purchase_currency_id');
|
||||
echo $form->input('sale_currency_id');
|
||||
echo $form->input('quantity');
|
||||
echo $form->input('unit_cost_price');
|
||||
echo $form->input('exchange_rate');
|
||||
echo $form->input('our_discount_percent');
|
||||
echo $form->input('packing');
|
||||
echo $form->input('shipping_weight');
|
||||
echo $form->input('shipping_cost');
|
||||
echo $form->input('duty_percent');
|
||||
echo $form->input('customs');
|
||||
echo $form->input('finance_percent');
|
||||
echo $form->input('misc_costs');
|
||||
echo $form->input('gross_sell_price');
|
||||
echo $form->input('sale_discount_percent');
|
||||
echo $form->input('net_sell_price');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('Costing.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Costing.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List Costings', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
134
views/costings/index.ctp
Normal file
134
views/costings/index.ctp
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
<div class="costings index">
|
||||
<h2><?php __('Costings');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('id');?></th>
|
||||
<th><?php echo $paginator->sort('created');?></th>
|
||||
<th><?php echo $paginator->sort('product_id');?></th>
|
||||
<th><?php echo $paginator->sort('quote_product_id');?></th>
|
||||
<th><?php echo $paginator->sort('order_product_id');?></th>
|
||||
<th><?php echo $paginator->sort('invoice_product_id');?></th>
|
||||
<th><?php echo $paginator->sort('purchase_currency_id');?></th>
|
||||
<th><?php echo $paginator->sort('sale_currency_id');?></th>
|
||||
<th><?php echo $paginator->sort('quantity');?></th>
|
||||
<th><?php echo $paginator->sort('unit_cost_price');?></th>
|
||||
<th><?php echo $paginator->sort('exchange_rate');?></th>
|
||||
<th><?php echo $paginator->sort('our_discount_percent');?></th>
|
||||
<th><?php echo $paginator->sort('packing');?></th>
|
||||
<th><?php echo $paginator->sort('shipping_weight');?></th>
|
||||
<th><?php echo $paginator->sort('shipping_cost');?></th>
|
||||
<th><?php echo $paginator->sort('duty_percent');?></th>
|
||||
<th><?php echo $paginator->sort('customs');?></th>
|
||||
<th><?php echo $paginator->sort('finance_percent');?></th>
|
||||
<th><?php echo $paginator->sort('misc_costs');?></th>
|
||||
<th><?php echo $paginator->sort('gross_sell_price');?></th>
|
||||
<th><?php echo $paginator->sort('sale_discount_percent');?></th>
|
||||
<th><?php echo $paginator->sort('net_sell_price');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($costings as $costing):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['created']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($costing['Product']['title'], array('controller' => 'products', 'action' => 'view', $costing['Product']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($costing['QuoteProduct']['title'], array('controller' => 'quote_products', 'action' => 'view', $costing['QuoteProduct']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['order_product_id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['invoice_product_id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($costing['PurchaseCurrency']['name'], array('controller' => 'currencies', 'action' => 'view', $costing['PurchaseCurrency']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($costing['SaleCurrency']['name'], array('controller' => 'currencies', 'action' => 'view', $costing['SaleCurrency']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['quantity']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['unit_cost_price']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['exchange_rate']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['our_discount_percent']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['packing']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['shipping_weight']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['shipping_cost']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['duty_percent']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['customs']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['finance_percent']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['misc_costs']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['gross_sell_price']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['sale_discount_percent']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $costing['Costing']['net_sell_price']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $costing['Costing']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $costing['Costing']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $costing['Costing']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $costing['Costing']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paging">
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Costing', true), array('action' => 'add')); ?></li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
129
views/costings/view.ctp
Normal file
129
views/costings/view.ctp
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
<div class="costings view">
|
||||
<h2><?php __('Costing');?></h2>
|
||||
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['created']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Product'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($costing['Product']['title'], array('controller' => 'products', 'action' => 'view', $costing['Product']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote Product'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($costing['QuoteProduct']['title'], array('controller' => 'quote_products', 'action' => 'view', $costing['QuoteProduct']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Order Product Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['order_product_id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Product Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['invoice_product_id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Purchase Currency'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($costing['PurchaseCurrency']['name'], array('controller' => 'currencies', 'action' => 'view', $costing['PurchaseCurrency']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sale Currency'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($costing['SaleCurrency']['name'], array('controller' => 'currencies', 'action' => 'view', $costing['SaleCurrency']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quantity'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['quantity']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Unit Cost Price'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['unit_cost_price']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Exchange Rate'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['exchange_rate']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Our Discount Percent'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['our_discount_percent']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Packing'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['packing']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Weight'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['shipping_weight']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Cost'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['shipping_cost']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Duty Percent'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['duty_percent']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customs'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['customs']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Finance Percent'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['finance_percent']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Misc Costs'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['misc_costs']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Gross Sell Price'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['gross_sell_price']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sale Discount Percent'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['sale_discount_percent']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Sell Price'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $costing['Costing']['net_sell_price']; ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Costing', true), array('action' => 'edit', $costing['Costing']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete Costing', true), array('action' => 'delete', $costing['Costing']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $costing['Costing']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('List Costings', true), array('action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Costing', true), array('action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quote Products', true), array('controller' => 'quote_products', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote Product', true), array('controller' => 'quote_products', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Purchase Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -2,7 +2,9 @@
|
|||
<table cellpadding = "0" cellspacing = "0" class="quotetable">
|
||||
<tr>
|
||||
<th><?php __('Revision'); ?></th>
|
||||
<th><?php __('Created'); ?></th>
|
||||
<th><?php __('Sale Currency'); ?></th>
|
||||
<th><?php __('Date / Time Created'); ?></th>
|
||||
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
|
@ -20,9 +22,13 @@
|
|||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td><?php echo $quote['Quote']['revision'];?></td>
|
||||
<td><?php echo $quote['Currency']['iso4217'];?></td>
|
||||
<td><?php echo $time->nice($quote['Quote']['created']);?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'quotes', 'action'=>'view', $quote['Quote']['id'])); ?>
|
||||
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'quotes', 'action'=>'view', $quote['Quote']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller'=>'quotes', 'action'=>'edit', $quote['Quote']['id'])); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
|
|||
|
|
@ -136,3 +136,6 @@ $boxdata['enquirynumber'] = $enquiry['Enquiry']['title'];
|
|||
<h3><?php __($number_of_quotes.' Quotes in this Enquiry');?></h3>
|
||||
<?php echo $this->element('quote_table', $quotes); ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php debug($quotes); ?>
|
||||
|
|
@ -35,6 +35,8 @@
|
|||
echo $ajax->divEnd('productoptions');
|
||||
|
||||
|
||||
echo $form->input('unit_price');
|
||||
|
||||
//echo '<div id="productoptions"></div>';
|
||||
//echo $form->select('QuoteProduct.product_id', null, null, array('id'=>'products'));
|
||||
//*/
|
||||
|
|
|
|||
|
|
@ -14,10 +14,11 @@
|
|||
|
||||
echo $form->input('enquiry_id', array('type'=>'hidden', 'value' => $enquiry['Enquiry']['id']));
|
||||
echo $form->input('delivery_time');
|
||||
echo $form->input('payment_terms');
|
||||
echo $this->element('payment_terms_box');
|
||||
echo $form->input('date_issued');
|
||||
echo $form->input('days_valid');
|
||||
echo $form->input('valid_until');
|
||||
echo $form->input('currency_id', array('label' => 'Sale Currency'));
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
|
|
|
|||
|
|
@ -85,11 +85,14 @@ foreach ($quote['QuotePage'] as $page) {
|
|||
|
||||
}
|
||||
|
||||
$tcpdf->AddPage();
|
||||
|
||||
print_r($products);
|
||||
|
||||
$principle_name = strtoupper($enquiry['Principle']['name']);
|
||||
|
||||
$tcpdf->productPage($principle_name, $quote['Currency']['iso4217'], $products, 'QuoteProduct');
|
||||
|
||||
//DetailsBox($companyName, $emailTo, $attention, $fromName, $fromEmail, $enquiryNumber)
|
||||
|
||||
|
||||
$tcpdf->AliasNbPages();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
__('Quote: '.$enquirynumber_link. ' for '. $customer_link);
|
||||
}
|
||||
else {
|
||||
__('Quote: '.$enquirynumber_link.' Revision '.$quote['Quote']['revision'].' for'. $customer_link);
|
||||
__('Quote: '.$enquirynumber_link.' Revision '.$quote['Quote']['revision'].' for '. $customer_link);
|
||||
}
|
||||
?></h2>
|
||||
|
||||
|
|
@ -65,12 +65,19 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
<th><?php __('Quantity'); ?></th>
|
||||
<th><?php __('Title'); ?></th>
|
||||
<th><?php __('Description'); ?></th>
|
||||
<th>Unit Price (<?php echo $quote['Currency']['iso4217']; ?>)</th>
|
||||
|
||||
<th><?php __('Total Price'); ?> (<?php echo $quote['Currency']['iso4217']; ?>)</th>
|
||||
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
|
||||
|
||||
<?php
|
||||
$i = 0;
|
||||
|
||||
$subTotal = 0;
|
||||
|
||||
foreach ($quoteProducts as $quoteProduct):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
|
|
@ -88,6 +95,14 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
<td><?php echo $quoteProduct['QuoteProduct']['quantity'];?></td>
|
||||
<td><?php echo $quoteProduct['QuoteProduct']['title'];?></td>
|
||||
<td><?php echo $quoteProduct['QuoteProduct']['description'];?></td>
|
||||
<td><?php echo $quote['Currency']['symbol'].$quoteProduct['QuoteProduct']['unit_price'];?></td>
|
||||
<td><?php
|
||||
|
||||
$thisNetPrice = $quoteProduct['QuoteProduct']['unit_price']*$quoteProduct['QuoteProduct']['quantity'];
|
||||
|
||||
$subTotal += $thisNetPrice;
|
||||
|
||||
echo $quote['Currency']['symbol'].$thisNetPrice; ?></td>
|
||||
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller'=> 'quote_products', 'action'=>'view', $quoteProduct['QuoteProduct']['id'])); ?>
|
||||
|
|
@ -98,6 +113,59 @@ foreach ($quote['QuotePage'] as $quotePage):
|
|||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<tr class="divider">
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>SUB-TOTAL (Excluding GST)</td>
|
||||
<td></td>
|
||||
<td><?php echo $quote['Currency']['symbol'].$subTotal; ?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>GST (10%)</td>
|
||||
<td></td>
|
||||
<td><?php
|
||||
if($quote['Enquiry']['gst'] == 1 ) {
|
||||
$gst = 0.1 * $subTotal;
|
||||
echo $quote['Currency']['symbol'].$gst;
|
||||
|
||||
}
|
||||
else {
|
||||
$gst = 0;
|
||||
echo "N/A";
|
||||
|
||||
}
|
||||
|
||||
?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>TOTAL PAYABLE</td>
|
||||
<td></td>
|
||||
<td><?php
|
||||
$total = $subTotal + $gst;
|
||||
echo $quote['Currency']['symbol'].$total;
|
||||
?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -380,6 +380,11 @@ table tr.customer-customer td {
|
|||
background: #63D463;
|
||||
}
|
||||
|
||||
table tr.divider td {
|
||||
border-top: 2px solid black;
|
||||
}
|
||||
|
||||
|
||||
td.actions {
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
|
|
@ -387,6 +392,13 @@ td.actions {
|
|||
td.actions a {
|
||||
margin: 0px 6px;
|
||||
}
|
||||
|
||||
td.PriceSummary {
|
||||
|
||||
background: #ff9900;
|
||||
|
||||
}
|
||||
|
||||
.cake-sql-log table {
|
||||
background: #f4f4f4;
|
||||
}
|
||||
|
|
@ -534,7 +546,7 @@ table.productoptions tr.defaultoption {
|
|||
}
|
||||
|
||||
table.quoteproducts {
|
||||
width: 50%;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
|
||||
function buildup() {
|
||||
|
||||
//Fetch all the relevent inputs from the form
|
||||
|
||||
|
||||
quantity = +($F('CostingQuantity'));
|
||||
|
||||
costprice = +($F('CostingUnitCostPrice'));
|
||||
ourdiscount_percentage = +($F('OurDiscountPercent'));
|
||||
ourdiscount_percentage = +($F('CostingOurDiscountPercent'));
|
||||
packing_each = +($F('CostingPacking'));
|
||||
exchange_rate = +($F('CostingExchangeRate'));
|
||||
shipping_cost = +($F('CostingShippingCost'));
|
||||
|
|
@ -31,7 +32,7 @@ net_foreign_price = costprice - discountamount;
|
|||
total_foreign_price = net_foreign_price + packing_each;
|
||||
|
||||
|
||||
$('fob_country_of_export').value = total_foreign_price;
|
||||
$F('CostingFobCountryOfExport').value = total_foreign_price;
|
||||
domestic_cost = total_foreign_price / exchange_rate;
|
||||
$('convert_to_aud').value = domestic_cost.toFixed(2);
|
||||
dutyamount = (duty / 100) * domestic_cost;
|
||||
|
|
@ -44,9 +45,13 @@ $('financeamount').update('Finance amount: ' + financeamount);
|
|||
total_landed_cost += (+financeamount);
|
||||
total_landed_cost = total_landed_cost.toFixed(2);
|
||||
$('total_landed_cost').value = total_landed_cost;
|
||||
gross_profit_dollars = sellprice_each - total_landed_cost
|
||||
gross_profit_dollars = sellprice_each - total_landed_cost;
|
||||
$('gross_profit_dollars').value = gross_profit_dollars;
|
||||
$('gross_profit_percent').value = ((gross_profit_dollars / sellprice_each)*100).toFixed(2);
|
||||
|
||||
}
|
||||
|
||||
new Form.Observer('CostingAddForm', 0.5, buildup());
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue