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

View file

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

View file

@ -22,9 +22,8 @@
<tr nobr="true">
<td width="<?=$colWidths['item'];?>" align="center" valign="top">
<? if($li['option'] == 1) {
echo 'Option';
echo 'Option<br>';
$hasOptions = true;
}
?>
<?=$li['item_number'];?>
@ -67,7 +66,7 @@
echo $number->currency($totals['subtotal'], $currencyCode);
}
else {
echo $number->currency('TBA', $currencyCode);
echo $currencySymbol.'TBA';
}
?></td>
</tr>
@ -76,19 +75,15 @@
<td width="<?=$colWidths['qty'];?>"></td>
<td width="<?=$colWidths['desc'];?>"><?=$totalsDescText['gst'];?></td>
<td width="<?=$colWidths['unit'];?>"></td>
<td width="<?=$colWidths['total'];?>" align="center"><?
<td width="<?=$colWidths['total'];?>" align="center">
<?
if(!$hasOptions) {
if($gst ==1) {
echo $number->currency($totals['gst'], $currencyCode);
}
else {
echo 'N/A';
}
echo $number->currency($totals['gst'], $currencyCode);
}
else {
echo $number->currency('TBA', $currencyCode);
echo $currencySymbol.'TBA';
}
?>
</td>
</tr>
@ -103,7 +98,7 @@
echo $number->currency($totals['total'], $currencyCode);
}
else {
echo $number->currency('TBA', $currencyCode);
echo $currencySymbol.'TBA';
}
?></td>
</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) {
$class = ' class="jobwon"';
} 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'])); ?>
&nbsp;
</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>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<span class="enquiry-view-comments">

View file

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

View file

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