Minor fixes

This commit is contained in:
FrancescoUK
2018-04-22 09:12:01 +01:00
parent cdd966878d
commit 0e14d5390f
9 changed files with 133 additions and 127 deletions

View File

@@ -29,7 +29,8 @@ class Item_kits extends Secure_Controller
$item_kit->total_cost_price += $item_info->cost_price * $item_kit_item['quantity'];
if($item_kit->price_option == PRICE_OPTION_ALL || ($item_kit->price_option == PRICE_OPTION_KIT_STOCK && $item_info->stock_type == HAS_STOCK )) {
if($item_kit->price_option == PRICE_OPTION_ALL || ($item_kit->price_option == PRICE_OPTION_KIT_STOCK && $item_info->stock_type == HAS_STOCK ))
{
$item_kit->total_unit_price += $item_info->unit_price * $item_kit_item['quantity'];
}
}
@@ -58,8 +59,6 @@ class Item_kits extends Secure_Controller
$sort = $this->input->get('sort');
$order = $this->input->get('order');
error_log('>>>search started');
$item_kits = $this->Item_kit->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->Item_kit->get_found_rows($search);

View File

@@ -802,7 +802,7 @@ class Sale_lib
}
else
{
if ($print_option != NULL)
if($print_option != NULL)
{
$print_option_selected = $print_option;
}

View File

@@ -108,8 +108,8 @@ $(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 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>
@@ -119,7 +119,7 @@ $(document).ready(function()
{
if($item['print_option'] == PRINT_YES)
{
?>
?>
<tr class="item-row">
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><textarea rows="4" cols="6"><?php echo $item['name']; ?></textarea></td>
@@ -130,7 +130,7 @@ $(document).ready(function()
<td style='text-align:center;'><textarea rows="4"
cols="6"><?php echo $item['discount'] . '%'; ?></textarea>
</td>
<?php if ($item['discount'] > 0): ?>
<?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>
@@ -140,8 +140,9 @@ $(document).ready(function()
</td>
</tr>
<?php
if ($item['is_serialized'] || $item['allow_alt_description'] && !empty($item['description'])) {
?>
if($item['is_serialized'] || $item['allow_alt_description'] && !empty($item['description']))
{
?>
<tr class="item-row">
<td></td>
<td class="item-description" colspan="4">
@@ -149,7 +150,7 @@ $(document).ready(function()
</td>
<td style='text-align:center;'><textarea><?php echo $item['serialnumber']; ?></textarea></td>
</tr>
<?php
<?php
}
}
}

View File

@@ -73,7 +73,7 @@ if (isset($error_message))
?>
<div>&nbsp</div>
<?php
if ($this->Appconfig->get('receipt_show_company_name'))
if($this->Appconfig->get('receipt_show_company_name'))
{
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
@@ -108,8 +108,8 @@ 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 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>
@@ -117,42 +117,42 @@ if (isset($error_message))
<?php
foreach($cart as $line=>$item)
{
if($item['print_option'] == PRINT_YES)
{
?>
<tr class="item-row">
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><textarea rows="4" cols="6"><?php echo $item['name']; ?></textarea></td>
<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 if ($item['is_serialized'] || $item['allow_alt_description'] && !empty($item['description']))
if($item['print_option'] == PRINT_YES)
{
?>
?>
<tr class="item-row">
<td></td>
<td class="item-name" colspan="4">
<div><?php echo $item['description']; ?></div>
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><textarea rows="4" cols="6"><?php echo $item['name']; ?></textarea></td>
<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>
<td style='text-align:center;'><textarea><?php echo $item['serialnumber']; ?></textarea></td>
</tr>
<?php if($item['is_serialized'] || $item['allow_alt_description'] && !empty($item['description']))
{
?>
<tr class="item-row">
<td></td>
<td class="item-name" colspan="4">
<div><?php echo $item['description']; ?></div>
</td>
<td style='text-align:center;'><textarea><?php echo $item['serialnumber']; ?></textarea></td>
</tr>
<?php
}
}
}
}
?>
<tr>
@@ -218,22 +218,24 @@ if (isset($error_message))
// install firefox addon in order to use this plugin
if (window.jsPrintSetup)
{
<?php if (!$this->Appconfig->get('print_header'))
<?php
if(!$this->Appconfig->get('print_header'))
{
?>
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
<?php
}
if (!$this->Appconfig->get('print_footer'))
if(!$this->Appconfig->get('print_footer'))
{
?>
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
<?php
}
?>

View File

@@ -72,8 +72,8 @@
<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 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>
@@ -83,19 +83,19 @@
{
if($item['print_option'] == PRINT_YES)
{
?>
?>
<tr class="item-row">
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><?php echo $item['name']; ?></td>
<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): ?>
<?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
<?php
}
}
?>

View File

@@ -67,7 +67,7 @@
{
if($item['print_option'] == PRINT_YES)
{
?>
?>
<tr>
<td><?php echo ucfirst($item['name']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
@@ -76,29 +76,31 @@
</tr>
<tr>
<?php
if ($this->config->item('receipt_show_description')) {
?>
<td colspan="2"><?php echo $item['description']; ?></td>
<?php
}
if($this->config->item('receipt_show_description'))
{
?>
<td colspan="2"><?php echo $item['description']; ?></td>
<?php
if ($this->config->item('receipt_show_serialnumber')) {
?>
}
if($this->config->item('receipt_show_serialnumber'))
{
?>
<td><?php echo $item['serialnumber']; ?></td>
<?php
<?php
}
?>
</tr>
<?php
if ($item['discount'] > 0) {
?>
if($item['discount'] > 0)
{
?>
<tr>
<td colspan="3"
class="discount"><?php echo number_format($item['discount'], 0) . " " . $this->lang->line("sales_discount_included") ?></td>
<td class="total-value"><?php echo to_currency($item['discounted_total']); ?></td>
</tr>
<?php
<?php
}
}
}
@@ -181,10 +183,10 @@
if(isset($cur_giftcard_value) && $show_giftcard_remainder)
{
?>
<tr>
<td colspan="3" style="text-align:right;"><?php echo $this->lang->line('sales_giftcard_balance'); ?></td>
<td class="total-value"><?php echo to_currency($cur_giftcard_value); ?></td>
</tr>
<tr>
<td colspan="3" style="text-align:right;"><?php echo $this->lang->line('sales_giftcard_balance'); ?></td>
<td class="total-value"><?php echo to_currency($cur_giftcard_value); ?></td>
</tr>
<?php
}
?>

View File

@@ -62,7 +62,7 @@
{
if($item['print_option'] == PRINT_YES)
{
?>
?>
<tr>
<td><?php echo ucfirst($item['name']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
@@ -71,32 +71,34 @@
</tr>
<tr>
<?php
if ($this->config->item('receipt_show_description')) {
?>
<td colspan="2"><?php echo $item['description']; ?></td>
<?php
}
if($this->config->item('receipt_show_description'))
{
?>
<td colspan="2"><?php echo $item['description']; ?></td>
<?php
if ($this->config->item('receipt_show_serialnumber')) {
?>
}
if($this->config->item('receipt_show_serialnumber'))
{
?>
<td><?php echo $item['serialnumber']; ?></td>
<?php
<?php
}
?>
</tr>
<?php
if ($item['discount'] > 0) {
?>
if($item['discount'] > 0)
{
?>
<tr>
<td colspan="3"
style="font-weight: bold;"><?php echo number_format($item['discount'], 0) . " " . $this->lang->line("sales_discount_included") ?></td>
<td colspan="3" style="font-weight: bold;"><?php echo number_format($item['discount'], 0) . " " . $this->lang->line("sales_discount_included") ?></td>
<td style="text-align:right;"><?php echo to_currency($item['discounted_total']); ?></td>
</tr>
<?php
<?php
}
}
}
if($this->config->item('receipt_show_total_discount') && $discount > 0)
{
?>

View File

@@ -1,7 +1,7 @@
<?php $this->load->view("partial/header"); ?>
<?php
if (isset($error_message))
if(isset($error_message))
{
echo "<div class='alert alert-dismissible alert-danger'>".$error_message."</div>";
exit;
@@ -50,9 +50,9 @@ if (isset($error_message))
<?php
if(isset($customer))
{
?>
?>
<textarea id="customer" rows="5" cols="6"><?php echo $customer_info ?></textarea>
<?php
<?php
}
?>
</div>
@@ -61,18 +61,18 @@ if (isset($error_message))
<?php
if($this->Appconfig->get('company_logo') != '')
{
?>
?>
<img id="image" src="<?php echo base_url('uploads/' . $this->Appconfig->get('company_logo')); ?>" alt="company_logo" />
<?php
<?php
}
?>
<div>&nbsp</div>
<?php
if ($this->Appconfig->get('receipt_show_company_name'))
if($this->Appconfig->get('receipt_show_company_name'))
{
?>
?>
<div id="company_name"><?php echo $this->config->item('company'); ?></div>
<?php
<?php
}
?>
</div>
@@ -90,13 +90,16 @@ if (isset($error_message))
<td><textarea rows="5" cols="6"><?php echo $transaction_date; ?></textarea></td>
</tr>
<?php
if($print_price_info) {
?>
if($print_price_info)
{
?>
<tr>
<td class="meta-head"><?php echo $this->lang->line('sales_amount_due'); ?></td>
<td><textarea rows="5" cols="6"><?php echo to_currency($total); ?></textarea></td>
</tr>
<?php } ?>
<?php
}
?>
</table>
</div>
@@ -118,27 +121,22 @@ if (isset($error_message))
<tr class="item-row">
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><textarea rows="4" cols="6"><?php echo $item['name']; ?></textarea></td>
<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 if ($print_price_info) echo to_currency($item['price']); ?></textarea></td>
<td style='text-align:center;'><textarea rows="4"
cols="6"><?php echo $item['discount'] . '%'; ?></textarea></td>
<td style='border-right: solid 1px; text-align:right;'><textarea rows="4"
cols="6"><?php if ($print_price_info) echo to_currency($item['discounted_total']); ?></textarea>
</td>
<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 if($print_price_info) echo to_currency($item['price']); ?></textarea></td>
<td style='text-align:center;'><textarea rows="4" cols="6"><?php echo $item['discount'] . '%'; ?></textarea></td>
<td style='border-right: solid 1px; text-align:right;'><textarea rows="4" cols="6"><?php if($print_price_info) echo to_currency($item['discounted_total']); ?></textarea></td>
</tr>
<?php if ($item['is_serialized'] || $item['allow_alt_description'] && !empty($item['description']))
<?php
if($item['is_serialized'] || $item['allow_alt_description'] && !empty($item['description']))
{
?>
?>
<tr class="item-row">
<td></td>
<td class="item-name" colspan="4">
<div><?php echo $item['description']; ?></div>
</td>
<td class="item-name" colspan="4"><div><?php echo $item['description']; ?></div></td>
<td style='text-align:center;'><textarea><?php echo $item['serialnumber']; ?></textarea></td>
</tr>
<?php
<?php
}
}
}
@@ -201,24 +199,25 @@ if (isset($error_message))
$(window).on("load", function()
{
// install firefox addon in order to use this plugin
if (window.jsPrintSetup)
if(window.jsPrintSetup)
{
<?php if (!$this->Appconfig->get('print_header'))
<?php if(!$this->Appconfig->get('print_header'))
{
?>
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
// set page header
jsPrintSetup.setOption('headerStrLeft', '');
jsPrintSetup.setOption('headerStrCenter', '');
jsPrintSetup.setOption('headerStrRight', '');
<?php
}
if (!$this->Appconfig->get('print_footer'))
if(!$this->Appconfig->get('print_footer'))
{
?>
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
// set empty page footer
jsPrintSetup.setOption('footerStrLeft', '');
jsPrintSetup.setOption('footerStrCenter', '');
jsPrintSetup.setOption('footerStrRight', '');
<?php
}
?>

View File

@@ -22,7 +22,8 @@
<table id="info">
<tr>
<td id="logo">
<?php if($this->config->item('company_logo') != '')
<?php
if($this->config->item('company_logo') != '')
{
?>
<img id="image" src="<?php echo 'uploads/' . $this->config->item('company_logo'); ?>" alt="company_logo" />
@@ -80,7 +81,7 @@
{
if($item['print_option'] == PRINT_YES)
{
?>
?>
<tr class="item-row">
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><?php echo $item['name']; ?></td>
@@ -89,7 +90,7 @@
<td><?php echo $item['discount'] . '%'; ?></td>
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
</tr>
<?php
<?php
}
}
?>