Hide discount / item if no discount for that item (#1924)

This commit is contained in:
jekkos
2018-04-05 08:46:57 +02:00
parent 9f2e39711f
commit 50c4b30df2
5 changed files with 17 additions and 1 deletions

View File

@@ -108,7 +108,9 @@ $(document).ready(function()
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
<th><?php echo $this->lang->line('sales_price'); ?></th>
<th><?php echo $this->lang->line('sales_discount'); ?></th>
<?php if ($item['discount'] > 0): ?>
<th><?php echo $this->lang->line('sales_customer_discount');?></th>
<?php endif; ?>
<th><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
@@ -122,7 +124,9 @@ $(document).ready(function()
<td style='text-align:center;'><textarea rows="5" cols="6"><?php echo to_quantity_decimals($item['quantity']); ?></textarea></td>
<td><textarea rows="4" cols="6"><?php echo to_currency($item['price']); ?></textarea></td>
<td style='text-align:center;'><textarea rows="4" cols="6"><?php echo $item['discount'] . '%'; ?></textarea></td>
<?php if ($item['discount'] > 0): ?>
<td style='text-align:center;'><textarea rows="4" cols="6"><?php echo to_currency($item['discounted_total'] / $item['quantity']); ?></textarea></td>
<?php endif; ?>
<td style='border-right: solid 1px; text-align:right;'><textarea rows="4" cols="6"><?php echo to_currency($item['discounted_total']); ?></textarea></td>
</tr>
<?php

View File

@@ -72,7 +72,9 @@
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
<th><?php echo $this->lang->line('sales_price'); ?></th>
<th><?php echo $this->lang->line('sales_discount'); ?></th>
<?php if ($item['discount'] > 0): ?>
<th><?php echo $this->lang->line('sales_customer_discount');?></th>
<?php endif; ?>
<th><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
@@ -86,7 +88,9 @@
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo $item['discount'] .'%'; ?></td>
<?php if ($item['discount'] > 0): ?>
<td><?php echo to_currency($item['discounted_total'] / $item['quantity']); ?></td>
<?php endif; ?>
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
</tr>
<?php

View File

@@ -108,7 +108,9 @@ if (isset($error_message))
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
<th><?php echo $this->lang->line('sales_price'); ?></th>
<th><?php echo $this->lang->line('sales_discount'); ?></th>
<?php if ($item['discount'] > 0): ?>
<th><?php echo $this->lang->line('sales_customer_discount');?></th>
<?php endif; ?>
<th><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
@@ -122,7 +124,9 @@ if (isset($error_message))
<td style='text-align:center;'><textarea rows="5" cols="6"><?php echo to_quantity_decimals($item['quantity']); ?></textarea></td>
<td><textarea rows="4" cols="6"><?php echo to_currency($item['price']); ?></textarea></td>
<td style='text-align:center;'><textarea rows="4" cols="6"><?php echo $item['discount'] . '%'; ?></textarea></td>
<?php if ($item['discount'] > 0): ?>
<td style='text-align:center;'><textarea rows="4" cols="6"><?php echo to_currency($item['discounted_total'] / $item['quantity']); ?></textarea></td>
<?php endif; ?>
<td style='border-right: solid 1px; text-align:right;'><textarea rows="4" cols="6"><?php echo to_currency($item['discounted_total']); ?></textarea></td>
</tr>

View File

@@ -72,7 +72,9 @@
<th><?php echo $this->lang->line('sales_quantity'); ?></th>
<th><?php echo $this->lang->line('sales_price'); ?></th>
<th><?php echo $this->lang->line('sales_discount'); ?></th>
<?php if ($item['discount'] > 0): ?>
<th><?php echo $this->lang->line('sales_customer_discount');?></th>
<?php endif; ?>
<th><?php echo $this->lang->line('sales_total'); ?></th>
</tr>
@@ -86,7 +88,9 @@
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo $item['discount'] .'%'; ?></td>
<?php if ($item['discount'] > 0): ?>
<td><?php echo to_currency($item['discounted_total'] / $item['quantity']); ?></td>
<?php endif; ?>
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
</tr>
<?php

View File

@@ -27,7 +27,7 @@
.edit #save-logo, .edit #cancel-logo { display: inline; }
.edit #image, #save-logo, #cancel-logo, .edit #change-logo, .edit #delete-logo { display: none; }
#customer-title { height: 100px; float: right; margin-top:40px;}
#customer-title textarea { width: 150px; }
#customer-title textarea { width: 200px; }
/* second row */
#block2 { overflow: hidden; width: 100%; }