Fixed 0.00 displaying in PDF totals for quotes with options

This commit is contained in:
Karl Cordes 2011-08-10 13:18:32 +10:00
parent c53cfebe6b
commit c0462d0160
6 changed files with 17 additions and 31 deletions

View file

@ -19,10 +19,10 @@ switch($docType) {
} }
?> ?>
<button class="addLineItem">Add Line Item</button>
<div id="lineItems"> <div id="lineItems">
</div> </div>
<button class="addLineItem">Add Line Item</button>
<div id="pageContentFactory"> <div id="pageContentFactory">
@ -44,7 +44,7 @@ switch($docType) {
<div id="InvoiceDetails"> <div id="InvoiceDetails">
</div> </div>
<span id="documentID" style="display:none;"><?=$document['Document']['id']?></span> <span id="documentID" style="display:none;"><?=$document['Document']['id']?></span>

View file

@ -17,7 +17,6 @@ echo $form->input('Document.id');
<div class="docButtons"> <div class="docButtons">
<button id="generateFirstPage">(re)Generate First Page</button> <button id="generateFirstPage">(re)Generate First Page</button>
<button id="addPage">Add Content Page</button> <button id="addPage">Add Content Page</button>
<button id="addLineItem">Add Line Item</button>
<button id="editQuoteDetails">View/Edit Quote Details</button> <button id="editQuoteDetails">View/Edit Quote Details</button>
<?=$html->link('Generate PDF of this Quote', '/documents/pdf/'.$document['Document']['id']);?> <?=$html->link('Generate PDF of this Quote', '/documents/pdf/'.$document['Document']['id']);?>
</div> </div>

View file

@ -22,9 +22,8 @@
<tr nobr="true"> <tr nobr="true">
<td width="<?=$colWidths['item'];?>" align="center" valign="top"> <td width="<?=$colWidths['item'];?>" align="center" valign="top">
<? if($li['option'] == 1) { <? if($li['option'] == 1) {
echo 'Option'; echo 'Option<br>';
$hasOptions = true; $hasOptions = true;
} }
?> ?>
<?=$li['item_number'];?> <?=$li['item_number'];?>
@ -67,7 +66,7 @@
echo $number->currency($totals['subtotal'], $currencyCode); echo $number->currency($totals['subtotal'], $currencyCode);
} }
else { else {
echo $number->currency('TBA', $currencyCode); echo $currencySymbol.'TBA';
} }
?></td> ?></td>
</tr> </tr>
@ -76,19 +75,15 @@
<td width="<?=$colWidths['qty'];?>"></td> <td width="<?=$colWidths['qty'];?>"></td>
<td width="<?=$colWidths['desc'];?>"><?=$totalsDescText['gst'];?></td> <td width="<?=$colWidths['desc'];?>"><?=$totalsDescText['gst'];?></td>
<td width="<?=$colWidths['unit'];?>"></td> <td width="<?=$colWidths['unit'];?>"></td>
<td width="<?=$colWidths['total'];?>" align="center"><? <td width="<?=$colWidths['total'];?>" align="center">
<?
if(!$hasOptions) { if(!$hasOptions) {
if($gst ==1) { echo $number->currency($totals['gst'], $currencyCode);
echo $number->currency($totals['gst'], $currencyCode);
}
else {
echo 'N/A';
}
} }
else { else {
echo $number->currency('TBA', $currencyCode); echo $currencySymbol.'TBA';
} }
?> ?>
</td> </td>
</tr> </tr>
@ -103,7 +98,7 @@
echo $number->currency($totals['total'], $currencyCode); echo $number->currency($totals['total'], $currencyCode);
} }
else { else {
echo $number->currency('TBA', $currencyCode); echo $currencySymbol.'TBA';
} }
?></td> ?></td>
</tr> </tr>

View file

@ -14,7 +14,7 @@
<? <?
/* Copy+pasta. Should be a helper of an element or something. Aug_2011_Hackfest_for_victory_and_liberation_from_this_project! */ /* Copy+pasta. Should be a helper or an element or something. #Aug_2011_Hackfest_for_victory_and_liberation_from_this_project! */
if ($enquiry['Status']['id'] == 3) { if ($enquiry['Status']['id'] == 3) {
$class = ' class="jobwon"'; $class = ' class="jobwon"';
} else if ($enquiry['Status']['id'] == 4) { } else if ($enquiry['Status']['id'] == 4) {
@ -78,11 +78,6 @@
<?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?> <?php echo $html->link($enquiry['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiry['Principle']['id'])); ?>
&nbsp; &nbsp;
</dd> </dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Status'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($enquiry['Status']['name'], array('controller'=> 'statuses', 'action'=>'view', $enquiry['Status']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt> <dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Comments'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>> <dd<?php if ($i++ % 2 == 0) echo $class;?>>
<span class="enquiry-view-comments"> <span class="enquiry-view-comments">

View file

@ -1611,10 +1611,10 @@ table.lineItems tr td.price {
div.pdfGeneratedMessage { div.pdfGeneratedMessage {
margin-top: 2em; margin-top: 1em;
margin-bottom: 2em; margin-bottom: 1em;
padding: 1em; padding: 0.5em;
border: 2px dashed; border: 2px dashed;
width: 50%; width: 50%;
font-size: 140%; font-size: 120%;
} }

View file

@ -39,8 +39,6 @@ $(function() {
if(data == 'SUCCESS') { if(data == 'SUCCESS') {
loadLineItems(); loadLineItems();
$( "#addLineItemModal" ).dialog('close'); $( "#addLineItemModal" ).dialog('close');
} }
else { else {
alert("Line Item could not be saved") alert("Line Item could not be saved")
@ -56,7 +54,6 @@ $(function() {
}, },
close: function() { close: function() {
loadLineItems(); loadLineItems();
} }
}); });
@ -143,7 +140,7 @@ $(function() {
//Open the LineItem dialog //Open the LineItem dialog
$("#addLineItem").button().click(function() { $(".addLineItem").button().click(function() {