Merge branch 'master' of github.com:kzrl/CMC-Sales

This commit is contained in:
Karl Cordes 2011-11-14 13:40:41 +11:00
commit 0c37d1ee3a
6 changed files with 729 additions and 720 deletions

View file

@ -99,14 +99,5 @@ echo $form->input('sale_discount_amount', array('type'=>'hidden'));
echo $form->end('Submit');?> echo $form->end('Submit');?>
</div> </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 Line Items', true), array('controller' => 'line_items', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Line Item', true), array('controller' => 'line_items', '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>

View file

@ -1,42 +1,40 @@
<?php /* Quotenik 1.2 - Default Layout. Some Markup retained from CakePHP Default <?php // Quotenik 1.2 - Default Layout. Some Markup retained from CakePHP Default ?>
*/ ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title> <title>
<?php __('CMC'); ?> <?php __('CMC'); ?>
<?php echo $title_for_layout; ?> <?php echo $title_for_layout; ?>
</title> </title>
<?php <?php
$debugLevel = Configure::read('debug'); $debugLevel = Configure::read('debug');
if ($debugLevel > 0) { if ($debugLevel > 0) {
echo $html->meta('favicon.ico', '/img/core.png', array('type' => 'icon')); echo $html->meta('favicon.ico', '/img/core.png', array('type' => 'icon'));
} else { } else {
echo $html->meta('icon'); echo $html->meta('icon');
} }
echo $html->css('quotenik'); echo $html->css('quotenik');
echo $html->css('jquery-ui.custom.css'); echo $html->css('jquery-ui.custom.css');
//echo $javascript->link('ckeditor/ckeditor'); //echo $javascript->link('ckeditor/ckeditor');
echo $javascript->link('jquery'); echo $javascript->link('jquery');
echo $javascript->link('jquery-ui'); echo $javascript->link('jquery-ui');
echo $javascript->link('jquery.form'); echo $javascript->link('jquery.form');
echo $javascript->link('menu'); echo $javascript->link('menu');
echo $javascript->link('global'); echo $javascript->link('global');
echo $javascript->link('search'); echo $javascript->link('search');
echo $javascript->link('jquery.jeditable.mini'); echo $javascript->link('jquery.jeditable.mini');
echo $javascript->link('jquery.validate'); echo $javascript->link('jquery.validate');
echo $scripts_for_layout; echo $scripts_for_layout;
?> ?>
</head> </head>
@ -48,14 +46,14 @@
<div id="username"> <div id="username">
<?php <?php
if (isset($currentuser) == FALSE) { if (isset($currentuser) == FALSE) {
echo $html->link('Login', '/users/login'); echo $html->link('Login', '/users/login');
} else { } else {
$logoutlink = $html->link('Logout', '/users/logout'); $logoutlink = $html->link('Logout', '/users/logout');
echo $html->link($currentuser['User']['username'], '/users/view/' . $currentuser['User']['id']) . ' (' . $logoutlink . ')'; echo $html->link($currentuser['User']['username'], '/users/view/' . $currentuser['User']['id']) . ' (' . $logoutlink . ')';
} }
?> ?>
</div> </div>
<div id="navdiv"> <div id="navdiv">
@ -67,7 +65,7 @@
</ul> </ul>
</li> </li>
<li><?php echo $html->link('Documents', '/documents/index'); ?> <li><?php echo $html->link('Documents', '/documents/index'); ?>
<ul> <ul>
<li class="last"><?php echo $html->link('Documents Index', '/documents/index'); ?></li> <li class="last"><?php echo $html->link('Documents Index', '/documents/index'); ?></li>
</ul> </ul>
@ -76,12 +74,12 @@
<li><?php echo $html->link('Jobs', '/jobs/index'); ?> <li><?php echo $html->link('Jobs', '/jobs/index'); ?>
<ul> <ul>
<? <?
if ($currentuser['User']['access_level'] == 'manager' || $currentuser['User']['access_level'] == 'admin'): if ($currentuser['User']['access_level'] == 'manager' || $currentuser['User']['access_level'] == 'admin'):
?> ?>
<li><?= $html->link('Reports', '/jobs/reports'); ?></li> <li><?= $html->link('Reports', '/jobs/reports'); ?></li>
<? endif; ?> <? endif; ?>
<li class="last"><?php echo $html->link('Job List', '/jobs/index'); ?></li> <li class="last"><?php echo $html->link('Job List', '/jobs/index'); ?></li>
</ul> </ul>
@ -94,8 +92,8 @@
<li class=""><?php echo $html->link('Direct Shipments', '/shipments/index/direct'); ?></li> <li class=""><?php echo $html->link('Direct Shipments', '/shipments/index/direct'); ?></li>
<li class=""><?php echo $html->link('Export Shipments', '/shipments/index/export'); ?></li> <li class=""><?php echo $html->link('Export Shipments', '/shipments/index/export'); ?></li>
<li class=""><?php echo $html->link('Local Shipments', '/shipments/index/local'); ?></li> <li class=""><?php echo $html->link('Local Shipments', '/shipments/index/local'); ?></li>
<li class=""><?php echo $html->link('Monthly Deferred GST', '/shipments/reports'); ?></li> <li class=""><?php echo $html->link('Monthly Deferred GST', '/shipments/reports'); ?></li>
<li class="last"><?php echo $html->link('Freight Forwarders', '/freight_forwarders'); ?></li> <li class="last"><?php echo $html->link('Freight Forwarders', '/freight_forwarders'); ?></li>
</ul> </ul>
</li> </li>
@ -137,7 +135,7 @@
</ul> </ul>
</li> </li>
<?php /* <li> echo $html->link('Users', '/users/index'); ?> <?php /* <li> echo $html->link('Users', '/users/index'); ?>
<ul> <ul>
<li> echo $html->link('Users Index', '/users/index'); </li> <li> echo $html->link('Users Index', '/users/index'); </li>
<li class="last"><?php echo $html->link('Add User', '/users/add'); </li> <li class="last"><?php echo $html->link('Add User', '/users/add'); </li>
@ -152,12 +150,12 @@
</ul> </ul>
</li> </li>
<? <?
if ($currentuser['User']['access_level'] == 'manager' || $currentuser['User']['access_level'] == 'admin'): if ($currentuser['User']['access_level'] == 'manager' || $currentuser['User']['access_level'] == 'admin'):
?> ?>
<li class="extra"><?=$html->link('Admin', '/admin'); ?> <li class="extra"><?=$html->link('Admin', '/admin'); ?>
</li> </li>
<? endif; ?> <? endif; ?>
</ul> </ul>
@ -166,24 +164,24 @@
</div> </div>
<div id="content"> <div id="content">
<?php <?php
if ($session->check('Message.flash')): if ($session->check('Message.flash')):
$session->flash(); $session->flash();
endif; endif;
?> ?>
<div id="globalAjaxLoading"> <div id="globalAjaxLoading">
<h3>Loading, please wait</h3> <h3>Loading, please wait</h3>
<?php echo $html->image('ajax-loader.gif'); ?> <?php echo $html->image('ajax-loader.gif'); ?>
</div> </div>
<?php echo $content_for_layout; ?> <?php echo $content_for_layout; ?>
</div> </div>
<div id="footer"> <div id="footer">
<?php <?php
echo $html->link( echo $html->link(
$html->image('cake.power.gif', array('alt' => __("CakePHP: the rapid development php framework", true), 'border' => "0")), 'http://www.cakephp.org/', array('target' => '_new'), null, false $html->image('cake.power.gif', array('alt' => __("CakePHP: the rapid development php framework", true), 'border' => "0")), 'http://www.cakephp.org/', array('target' => '_new'), null, false
); );
?> ?>
</div> </div>
</div> </div>
@ -191,51 +189,52 @@
<?php <?php
echo $form->create('Enquiry', array('default' => false, 'id' => 'searchForm', 'default' => 'false')); echo $form->create('Enquiry', array('default' => false, 'id' => 'searchForm', 'default' => 'false'));
echo '<h2>Search'; echo '<h2>Search';
echo $html->image('system-search.png'); echo $html->image('system-search.png');
echo '</h2>'; echo '</h2>';
echo "<p>Search for: Enquiry Number, Job Number, Customer, Contact or Customer Order Number</p>"; echo "<p>Search for: Enquiry Number, Job Number, Customer, Contact or Customer Order Number</p>";
echo $form->input('Enquiry.search_string', array('label' => false, 'id' => 'searchString')); echo $form->input('Enquiry.search_string', array('label' => false, 'id' => 'searchString'));
?> ?>
<div class ="ui-widget"> <div class ="ui-widget">
<button id="searchButton">Search</button> <button id="searchButton">Search</button>
</div> </div>
<? <?
echo $form->end(); echo $form->end();
?> ?>
<div id="ajaxLoading"> <div id="ajaxLoading">
<h2>Loading, please wait..</h2> <h2>Loading, please wait..</h2>
<?php echo $html->image('ajax-loader.gif'); ?> <?php echo $html->image('ajax-loader.gif'); ?>
</div> </div>
<div id="results"></div> <div id="results"></div>
</div> </div>
<?php <?php
$mem_usage = memory_get_usage(true);
if ($mem_usage < 1024) $mem_usage = memory_get_usage(true);
echo $mem_usage . " bytes";
elseif ($mem_usage < 1048576) if ($mem_usage < 1024)
echo round($mem_usage / 1024, 2) . " kilobytes"; echo $mem_usage . " bytes";
else elseif ($mem_usage < 1048576)
echo round($mem_usage / 1048576, 2) . " megabytes"; echo round($mem_usage / 1024, 2) . " kilobytes";
echo "<br/>"; else
?> echo round($mem_usage / 1048576, 2) . " megabytes";
echo "<br/>";
?>
<?php // debug($currentuser); ?> <?php // debug($currentuser); ?>
<?php echo $cakeDebug; ?> <?php echo $cakeDebug; ?>
</body> </body>
</html> </html>

View file

@ -1,143 +1,152 @@
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
$('button').button(); $('button').button();
}); });
</script> </script>
<table class="lineItems"> <table class="lineItems">
<thead> <thead>
<tr> <tr>
<th>ITEM<br>NO.</th> <th>ITEM<br>NO.</th>
<th>QTY</th> <th>QTY</th>
<th>DESCRIPTION</th> <th>DESCRIPTION</th>
<th>UNIT<br>PRICE</th> <th>UNIT<br>PRICE</th>
<th>TOTAL<br>PRICE</th> <th>TOTAL<br>PRICE</th>
<th>ACTIONS</th> <th>ACTIONS</th>
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
<th><?=$currencyCode?></th> <th><?=$currencyCode?></th>
<th><?=$currencyCode?></th> <th><?=$currencyCode?></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<? <?
$hasOptions = false; $hasOptions = false;
foreach($document['LineItem'] as $li):?> if(count($document['LineItem']) == 0):
<tr class="lineItem"> ?>
<td> <tr class="no_items">
<? if($li['option'] == 1) { <td colspan="6"> No Line Items have been Added Yet!</td>
echo 'Option<br>'; </tr>
<?
endif;
?>
<?
foreach($document['LineItem'] as $li):?>
<tr class="lineItem">
<td>
<? if($li['option'] == 1) {
echo 'Option<br>';
$hasOptions = true; $hasOptions = true;
} }
?> ?>
<?=$li['item_number'];?></td> <?=$li['item_number'];?></td>
<td><?=$li['quantity'];?></td> <td><?=$li['quantity'];?></td>
<td class="description"> <td class="description">
<?=$li['title'];?><br> <?=$li['title'];?><br>
<?=$li['description'];?> <?=$li['description'];?>
</td> </td>
<td class="price"> <td class="price">
<? <?
if($li['has_text_prices']): if($li['has_text_prices']):
echo $li['unit_price_string']; echo $li['unit_price_string'];
?> ?>
<? <?
else: else:
?> ?>
<?=$number->currency($li['gross_unit_price'], $currencyCode);?> <?=$number->currency($li['gross_unit_price'], $currencyCode);?>
<? if($li['discount_percent']):?> <? if($li['discount_percent']):?>
<br>less<br><?=$li['discount_percent']?>%<br> <br>less<br><?=$li['discount_percent']?>%<br>
discount<br> discount<br>
(-<?=$number->currency($li['discount_amount_unit'], $currencyCode);?>)<br> (-<?=$number->currency($li['discount_amount_unit'], $currencyCode);?>)<br>
=<br> =<br>
<?=$number->currency($li['net_unit_price'], $currencyCode);?> <?=$number->currency($li['net_unit_price'], $currencyCode);?>
<?endif;?> <?endif;?>
<? endif;?> <? endif;?>
</td> </td>
<td class="price"> <td class="price">
<? <?
if($li['has_text_prices']): if($li['has_text_prices']):
echo $li['gross_price_string']; echo $li['gross_price_string'];
?> ?>
<? <?
else: else:
?> ?>
<?=$number->currency($li['gross_price'], $currencyCode);?> <?=$number->currency($li['gross_price'], $currencyCode);?>
<? if($li['discount_percent']):?> <? if($li['discount_percent']):?>
<br>less<br><?=$li['discount_percent']?>%<br> <br>less<br><?=$li['discount_percent']?>%<br>
discount<br> discount<br>
<?=$number->currency($li['discount_amount_total'], $currencyCode);?>)<br> <?=$number->currency($li['discount_amount_total'], $currencyCode);?>)<br>
=<br> =<br>
<?=$number->currency($li['net_price'], $currencyCode);?> <?=$number->currency($li['net_price'], $currencyCode);?>
<?endif;?> <?endif;?>
<?endif;?> <?endif;?>
</td> </td>
<td id="<?=$li['id'];?>"> <td id="<?=$li['id'];?>">
<button class="editLineItem">Edit</button><br> <button class="editLineItem">Edit</button><br>
<button class="removeLineItem">Remove</button> <button class="removeLineItem">Remove</button>
</td> </td>
</tr> </tr>
<?endforeach;?> <?endforeach;?>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td class="leftAlign">SUB-TOTAL (Excluding GST)</td> <td class="leftAlign">SUB-TOTAL (Excluding GST)</td>
<td></td> <td></td>
<td><? <td><?
if(!$hasOptions) { if(!$hasOptions) {
echo $number->currency($totals['subtotal'], $currencyCode); echo $number->currency($totals['subtotal'], $currencyCode);
} }
else { else {
echo $currencySymbol.'TBA'; echo $currencySymbol.'TBA';
} }
?> ?>
</td> </td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td class="leftAlign">GST (10%)</td> <td class="leftAlign">GST (10%)</td>
<td></td> <td></td>
<td> <td>
<? <?
if(!$hasOptions) { if(!$hasOptions) {
echo $number->currency($totals['gst'], $currencyCode); echo $number->currency($totals['gst'], $currencyCode);
} }
else { else {
echo $currencySymbol.'TBA'; echo $currencySymbol.'TBA';
} }
?> ?>
</td> </td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td></td> <td></td>
<td class="leftAlign">TOTAL PAYABLE (INCLUDING GST)</td> <td class="leftAlign">TOTAL PAYABLE (INCLUDING GST)</td>
<td></td> <td></td>
<td><? <td><?
if(!$hasOptions) { if(!$hasOptions) {
echo $number->currency($totals['total'], $currencyCode); echo $number->currency($totals['total'], $currencyCode);
} }
else { else {
echo $currencySymbol.'TBA'; echo $currencySymbol.'TBA';
} }
?></td> ?></td>
<td></td> <td></td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View file

@ -1,3 +1,6 @@
<div>
<fieldset>
<legend>Login</legend>
<?php <?php
if ($session->check('Message.auth')) $session->flash('auth'); if ($session->check('Message.auth')) $session->flash('auth');
echo $form->create('User', array('action' => 'login')); echo $form->create('User', array('action' => 'login'));
@ -6,3 +9,5 @@ echo $form->input('password');
echo $form->input('remember_me', array('label' => 'Keep me logged in on this Computer', 'type' => 'checkbox')); echo $form->input('remember_me', array('label' => 'Keep me logged in on this Computer', 'type' => 'checkbox'));
echo $form->end('Login'); echo $form->end('Login');
?> ?>
</fieldset>
</div>

View file

@ -1642,4 +1642,10 @@ div.warning {
#extraModels li { #extraModels li {
font-size: 1.5em; font-size: 1.5em;
} }
tr.no_items {
font-size: 2em;
padding: 0.5em;
}

File diff suppressed because it is too large Load diff