sales/register bootstrapisation (#116)

This commit is contained in:
FrancescoUK
2016-03-09 23:55:14 +00:00
parent e175a96acb
commit 70938f7b41
4 changed files with 412 additions and 374 deletions

View File

@@ -11,57 +11,71 @@ if (isset($error))
<div id="register_wrapper">
<?php echo form_open("receivings/change_mode", array('id'=>'mode_form', 'class'=>'form-horizontal panel panel-default')); ?>
<div class="panel-body form-group-sm">
<label class='col-sm-2 control-label'><?php echo $this->lang->line('recvs_mode'); ?></label>
<div class="col-sm-2">
<?php echo form_dropdown('mode', $modes, $mode, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</div>
<div class="panel-body form-group">
<ul>
<li class="float_left">
<label class="control-label"><?php echo $this->lang->line('recvs_mode'); ?></label>
</li>
<li class="float_left">
<?php echo form_dropdown('mode', $modes, $mode, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</li>
<?php
if ($show_stock_locations)
{
?>
<label class='col-sm-2 control-label'><?php echo $this->lang->line('recvs_stock_source'); ?></label>
<div class="col-sm-2">
<?php echo form_dropdown('stock_source', $stock_locations, $stock_source, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</div>
<?php
if($mode=='requisition')
<?php
if ($show_stock_locations)
{
?>
<label class='col-sm-2 control-label'><?php echo $this->lang->line('recvs_stock_destination'); ?></label>
<div class="col-sm-2">
<?php echo form_dropdown('stock_destination', $stock_locations, $stock_destination, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</div>
<?php
<li class="float_left">
<label class="control-label"><?php echo $this->lang->line('recvs_stock_source'); ?></label>
</li>
<li class="float_left">
<?php echo form_dropdown('stock_source', $stock_locations, $stock_source, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</li>
<?php
if($mode=='requisition')
{
?>
<li class="float_left">
<label class="control-label"><?php echo $this->lang->line('recvs_stock_destination'); ?></label>
</li>
<li class="float_left">
<?php echo form_dropdown('stock_destination', $stock_locations, $stock_destination, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</li>
<?php
}
}
}
?>
?>
</ul>
</div>
<?php echo form_close(); ?>
<?php echo form_open("receivings/add", array('id'=>'add_item_form', 'class'=>'form-horizontal panel panel-default')); ?>
<div class="panel-body form-group-sm">
<label id="item_label" for="item", class='col-sm-2 control-label'>
<?php
if($mode=='receive' or $mode=='requisition')
{
echo $this->lang->line('recvs_find_or_scan_item');
}
else
{
echo $this->lang->line('recvs_find_or_scan_item_or_receipt');
}
?>
</label>
<div class="col-sm-6">
<?php echo form_input(array('name'=>'item', 'id'=>'item', 'class'=>'form-control input-sm', 'tabindex'=>'1')); ?>
</div>
<div class="panel-body form-group">
<ul>
<li class="float_left">
<label for="item", class='control-label'>
<?php
if($mode=='receive' or $mode=='requisition')
{
echo $this->lang->line('recvs_find_or_scan_item');
}
else
{
echo $this->lang->line('recvs_find_or_scan_item_or_receipt');
}
?>
</label>
</li>
<li class="float_left">
<?php echo form_input(array('name'=>'item', 'id'=>'item', 'class'=>'form-control input-sm', 'size'=>'50', 'tabindex'=>'1')); ?>
</li>
<?php echo anchor("items/view/-1", $this->lang->line('sales_new_item'),
array('class'=>'btn btn-info btn-sm pull-right modal-dlg modal-btn-new modal-btn-submit', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item'))); ?>
<li class="float_right">
<?php echo anchor("items/view/-1", $this->lang->line('sales_new_item'),
array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-new modal-btn-submit', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item'))); ?>
</li>
</ul>
</div>
<?php echo form_close(); ?>
@@ -70,14 +84,14 @@ if (isset($error))
<table id="register">
<thead>
<tr>
<th style="width:11%;"><?php echo $this->lang->line('common_delete'); ?></th>
<th style="width:30%;"><?php echo $this->lang->line('recvs_item_name'); ?></th>
<th style="width:11%;"><?php echo $this->lang->line('recvs_cost'); ?></th>
<th style="width:5%;"><?php echo $this->lang->line('recvs_quantity'); ?></th>
<th style="width:6%;"></th>
<th style="width:11%;"><?php echo $this->lang->line('recvs_discount'); ?></th>
<th style="width:15%;"><?php echo $this->lang->line('recvs_total'); ?></th>
<th style="width:11%;"><?php echo $this->lang->line('recvs_edit'); ?></th>
<th style="width:10%;"><?php echo $this->lang->line('common_delete'); ?></th>
<th style="width:35%;"><?php echo $this->lang->line('recvs_item_name'); ?></th>
<th style="width:10%;"><?php echo $this->lang->line('recvs_cost'); ?></th>
<th style="width:10%;"><?php echo $this->lang->line('recvs_quantity'); ?></th>
<th style="width:5%;"></th>
<th style="width:10%;"><?php echo $this->lang->line('recvs_discount'); ?></th>
<th style="width:10%;"><?php echo $this->lang->line('recvs_total'); ?></th>
<th style="width:10%;"><?php echo $this->lang->line('recvs_edit'); ?></th>
</tr>
</thead>
@@ -86,75 +100,76 @@ if (isset($error))
if(count($cart)==0)
{
?>
<tr><td colspan='8'>
<div class='alert alert-dismissible alert-info'><?php echo $this->lang->line('sales_no_items_in_cart'); ?></div>
</td></tr>
<tr>
<td colspan='8'><div class='alert alert-dismissible alert-info'><?php echo $this->lang->line('sales_no_items_in_cart'); ?></div></td>
</tr>
<?php
}
else
{
foreach(array_reverse($cart, true) as $line=>$item)
{
echo form_open("receivings/edit_item/$line");
echo form_open("receivings/edit_item/$line", array('class'=>'form-horizontal'));
?>
<tr>
<td><?php echo anchor("receivings/delete_item/$line",'['.$this->lang->line('common_delete').']');?></td>
<td><?php echo anchor("receivings/delete_item/$line", '<span class="glyphicon glyphicon-trash"></span>');?></td>
<td style="align: center;"><?php echo base64_decode($item['name']); ?><br /> [<?php echo $item['in_stock']; ?> in <?php echo $item['stock_name']; ?>]
<?php echo form_hidden('location', $item['item_location']); ?></td>
<?php if ($items_module_allowed && $mode !='requisition')
{
?>
<td><?php echo form_input(array('name'=>'price','value'=>$item['price'],'size'=>'6'));?></td>
<?php
}
else
{
?>
<td><?php echo $item['price']; ?></td>
<?php echo form_hidden('price',$item['price']); ?>
<?php
}
?>
<td>
<?php
echo form_input(array('name'=>'quantity','value'=>$item['quantity'],'size'=>'2'));
if ($item['receiving_quantity'] > 1)
<?php if ($items_module_allowed && $mode !='requisition')
{
?>
</td>
<td>x <?php echo $item['receiving_quantity']; ?></td>
<?php
?>
<td><?php echo form_input(array('name'=>'price', 'class'=>'form-control input-sm', 'value'=>$item['price']));?></td>
<?php
}
else
{
?>
<td></td>
<?php
?>
<td><?php echo $item['price']; ?></td>
<?php echo form_hidden('price',$item['price']); ?>
<?php
}
?>
?>
<td>
<?php
echo form_input(array('name'=>'quantity', 'class'=>'form-control input-sm', 'value'=>$item['quantity']));
if ($item['receiving_quantity'] > 1)
{
?>
</td>
<td>x <?php echo $item['receiving_quantity']; ?></td>
<?php
}
else
{
?>
</td>
<td></td>
<?php
}
?>
<?php
if ($items_module_allowed && $mode!='requisition')
{
?>
<td><?php echo form_input(array('name'=>'discount','value'=>$item['discount'],'size'=>'3'));?></td>
<?php
}
else
{
?>
<td><?php echo $item['discount']; ?></td>
<?php echo form_hidden('discount',$item['discount']); ?>
<?php
}
?>
<td><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
<td><?php echo form_submit(array('name'=>'edit_item', 'value'=>$this->lang->line('sales_edit_item'), 'class'=>'btn btn-default btn-sm pull-right'));?></td>
<?php
if ($items_module_allowed && $mode!='requisition')
{
?>
<td><?php echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>$item['discount']));?></td>
<?php
}
else
{
?>
<td><?php echo $item['discount']; ?></td>
<?php echo form_hidden('discount',$item['discount']); ?>
<?php
}
?>
<td><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
<td><?php echo form_submit(array('name'=>'edit_item', 'value'=>$this->lang->line('sales_edit_item'), 'class'=>'btn btn-default btn-xs'));?></td>
</tr>
<tr>
<?php
<?php
if($item['allow_alt_description']==1)
{
?>
@@ -167,7 +182,7 @@ if (isset($error))
<?php
if($item['allow_alt_description']==1)
{
echo form_input(array('name'=>'description','value'=>base64_decode($item['description']),'size'=>'20'));
echo form_input(array('name'=>'description', 'class'=>'form-control input-sm', 'value'=>base64_decode($item['description'])));
}
else
{

View File

@@ -21,47 +21,63 @@ if (isset($success))
<div id="register_wrapper">
<?php echo form_open("sales/change_mode", array('id'=>'mode_form', 'class'=>'form-horizontal panel panel-default')); ?>
<div class="panel-body form-group-sm">
<label class='col-sm-2 control-label'><?php echo $this->lang->line('sales_mode'); ?></label>
<div class="col-sm-2">
<?php echo form_dropdown('mode', $modes, $mode, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</div>
<div class="panel-body form-group">
<ul>
<li class="float_left">
<label class="control-label"><?php echo $this->lang->line('sales_mode'); ?></label>
</li>
<li class="float_left">
<?php echo form_dropdown('mode', $modes, $mode, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</li>
<?php
if (count($stock_locations) > 1)
{
?>
<label class='col-sm-2 control-label'><?php echo $this->lang->line('sales_stock_location'); ?></label>
<div class="col-sm-2">
<?php echo form_dropdown('stock_location', $stock_locations, $stock_location, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</div>
<?php
}
?>
<?php
if (count($stock_locations) > 1)
{
?>
<li class="float_left">
<label class="control-label"><?php echo $this->lang->line('sales_stock_location'); ?></label>
</li>
<li class="float_left">
<?php echo form_dropdown('stock_location', $stock_locations, $stock_location, array('onchange'=>"$('#mode_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?>
</li>
<?php
}
?>
<?php echo anchor("sales/suspended", $this->lang->line('sales_suspended_sales'),
array('class'=>'btn btn-default btn-sm pull-right modal-dlg none', 'id'=>'show_suspended_sales_button', 'title'=>$this->lang->line('sales_suspended_sales'))); ?>
<?php
if ($this->Employee->has_grant('reports_sales', $this->session->userdata('person_id')))
{
echo anchor("sales/manage", $this->lang->line('sales_takings'),
array('class'=>'btn btn-primary btn-sm pull-right', 'id'=>'sales_takings_button', 'title'=>$this->lang->line('sales_takings')));
}
?>
<li class="float_right">
<?php echo anchor("sales/suspended", $this->lang->line('sales_suspended_sales'),
array('class'=>'btn btn-default btn-sm modal-dlg none', 'id'=>'show_suspended_sales_button', 'title'=>$this->lang->line('sales_suspended_sales'))); ?>
</li>
<?php
if ($this->Employee->has_grant('reports_sales', $this->session->userdata('person_id')))
{
?>
<li class="float_right">
<?php echo anchor("sales/manage", $this->lang->line('sales_takings'),
array('class'=>'btn btn-primary btn-sm', 'id'=>'sales_takings_button', 'title'=>$this->lang->line('sales_takings'))); ?>
</li>
<?php
}
?>
</ul>
</div>
<?php echo form_close(); ?>
<?php echo form_open("sales/add", array('id'=>'add_item_form', 'class'=>'form-horizontal panel panel-default')); ?>
<div class="panel-body form-group-sm">
<label id="item_label" for="item", class='col-sm-2 control-label'><?php echo $this->lang->line('sales_find_or_scan_item_or_receipt'); ?></label>
<div class="col-sm-6">
<?php echo form_input(array('name'=>'item', 'id'=>'item', 'class'=>'form-control input-sm', 'tabindex'=>'1')); ?>
<span class="ui-helper-hidden-accessible" role="status"></span>
</div>
<div class="panel-body form-group">
<ul>
<li class="float_left"><label for="item", class='control-label'><?php echo $this->lang->line('sales_find_or_scan_item_or_receipt'); ?></label></li>
<li class="float_left">
<?php echo form_input(array('name'=>'item', 'id'=>'item', 'class'=>'form-control input-sm', 'size'=>'50', 'tabindex'=>'1')); ?>
<span class="ui-helper-hidden-accessible" role="status"></span>
</li>
<?php echo anchor("items/view/-1", $this->lang->line('sales_new_item'),
array('class'=>'btn btn-info btn-sm pull-right modal-dlg modal-btn-new modal-btn-submit', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item'))); ?>
<li class="float_right">
<?php echo anchor("items/view/-1", $this->lang->line('sales_new_item'),
array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-new modal-btn-submit', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item'))); ?>
</li>
</ul>
</div>
<?php echo form_close(); ?>
@@ -70,14 +86,14 @@ if (isset($success))
<table id="register">
<thead>
<tr>
<th style="width: 11%;"><?php echo $this->lang->line('common_delete'); ?></th>
<th style="width: 30%;"><?php echo $this->lang->line('sales_item_number'); ?></th>
<th style="width: 30%;"><?php echo $this->lang->line('sales_item_name'); ?></th>
<th style="width: 11%;"><?php echo $this->lang->line('sales_price'); ?></th>
<th style="width: 11%;"><?php echo $this->lang->line('sales_quantity'); ?></th>
<th style="width: 11%;"><?php echo $this->lang->line('sales_discount'); ?></th>
<th style="width: 15%;"><?php echo $this->lang->line('sales_total'); ?></th>
<th style="width: 11%;"><?php echo $this->lang->line('sales_edit'); ?></th>
<th style="width: 10%;"><?php echo $this->lang->line('common_delete'); ?></th>
<th style="width: 15%;"><?php echo $this->lang->line('sales_item_number'); ?></th>
<th style="width: 25%;"><?php echo $this->lang->line('sales_item_name'); ?></th>
<th style="width: 10%;"><?php echo $this->lang->line('sales_price'); ?></th>
<th style="width: 10%;"><?php echo $this->lang->line('sales_quantity'); ?></th>
<th style="width: 10%;"><?php echo $this->lang->line('sales_discount'); ?></th>
<th style="width: 10%;"><?php echo $this->lang->line('sales_total'); ?></th>
<th style="width: 10%;"><?php echo $this->lang->line('sales_edit'); ?></th>
</tr>
</thead>
<tbody id="cart_contents">
@@ -102,10 +118,10 @@ if (isset($success))
$tabindex = 5;
}
echo form_open("sales/edit_item/$line");
echo form_open("sales/edit_item/$line", array('class'=>'form-horizontal'));
?>
<tr>
<td><?php echo anchor("sales/delete_item/$line",'['.$this->lang->line('common_delete').']');?></td>
<td><?php echo anchor("sales/delete_item/$line", '<span class="glyphicon glyphicon-trash"></span>');?></td>
<td><?php echo $item['item_number']; ?></td>
<td style="align: center;"><?php echo base64_decode($item['name']); ?><br /> [<?php echo $item['in_stock'] ?> in <?php echo $item['stock_name']; ?>]
<?php echo form_hidden('location', $item['item_location']); ?>
@@ -114,7 +130,7 @@ if (isset($success))
<?php if ($items_module_allowed)
{
?>
<td><?php echo form_input(array('name'=>'price','value'=>$item['price'],'size'=>'6'));?></td>
<td><?php echo form_input(array('name'=>'price', 'class'=>'form-control input-sm', 'value'=>$item['price']));?></td>
<?php
}
else
@@ -135,14 +151,14 @@ if (isset($success))
}
else
{
echo form_input(array('name'=>'quantity','value'=>$item['quantity'],'size'=>'2','tabindex'=>$tabindex));
echo form_input(array('name'=>'quantity', 'class'=>'form-control input-sm', 'value'=>$item['quantity'], 'tabindex'=>$tabindex));
}
?>
</td>
<td><?php echo form_input(array('name'=>'discount','value'=>$item['discount'],'size'=>'3'));?></td>
<td><?php echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>$item['discount']));?></td>
<td><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
<td><?php echo form_submit(array('name'=>'edit_item', 'value'=>$this->lang->line('sales_edit_item'), 'class'=>'btn btn-default btn-sm pull-right'));?></td>
<td><?php echo form_submit(array('name'=>'edit_item', 'value'=>$this->lang->line('sales_edit_item'), 'class'=>'btn btn-default btn-xs'));?></td>
</tr>
<tr>
<?php
@@ -158,14 +174,14 @@ if (isset($success))
<?php
if($item['allow_alt_description']==1)
{
echo form_input(array('name'=>'description','value'=>base64_decode($item['description']),'size'=>'20'));
echo form_input(array('name'=>'description', 'class'=>'form-control input-sm', 'value'=>base64_decode($item['description'])));
}
else
{
if (base64_decode($item['description'])!='')
{
echo base64_decode($item['description']);
echo form_hidden('description',base64_decode($item['description']));
echo form_hidden('description', base64_decode($item['description']));
}
else
{
@@ -188,7 +204,7 @@ if (isset($success))
<?php
if($item['is_serialized']==1)
{
echo form_input(array('name'=>'serialnumber','value'=>$item['serialnumber'],'size'=>'20'));
echo form_input(array('name'=>'serialnumber', 'class'=>'form-control input-sm', 'value'=>$item['serialnumber']));
}
else
{
@@ -209,229 +225,216 @@ if (isset($success))
<!-- Overall Sale -->
<div id="overall_sale">
<?php
if(isset($customer))
{
echo $this->lang->line("sales_customer").': <b>'.$customer. '</b><br />';
echo anchor("sales/remove_customer",'['.$this->lang->line('common_remove').' '.$this->lang->line('customers_customer').']');
}
else
{
echo form_open("sales/select_customer", array('id'=>'select_customer_form'));
?>
<label id="customer_label" for="customer"><?php echo $this->lang->line('sales_select_customer'); ?></label>
<?php echo form_input(array('name'=>'customer', 'id'=>'customer', 'size'=>'30', 'value'=>$this->lang->line('sales_start_typing_customer_name')));?>
<?php echo form_close(); ?>
<div style="margin-top: 5px; text-align: center;">
<h3 style="margin: 5px 0 5px 0"><?php echo $this->lang->line('common_or'); ?></h3>
<?php
echo anchor("customers/view/-1", $this->lang->line('sales_new_customer'),
array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-submit none', 'id'=>'new_customer_button', 'title'=>$this->lang->line('sales_new_customer')));
?>
</div>
<div class="clearfix">&nbsp;</div>
<?php
}
?>
<div id='sale_details'>
<div class="float_left" style="width: 55%;"><?php echo $this->lang->line('sales_sub_total'); ?>:</div>
<div class="float_left" style="width: 45%; font-weight: bold;"><?php echo to_currency($this->config->item('tax_included') ? $tax_exclusive_subtotal : $subtotal); ?></div>
<?php foreach($taxes as $name=>$value) { ?>
<div class="float_left" style='width: 55%;'><?php echo $name; ?>:</div>
<div class="float_left" style="width: 45%; font-weight: bold;"><?php echo to_currency($value); ?></div>
<?php }; ?>
<div class="float_left" style='width: 55%;'><?php echo $this->lang->line('sales_total'); ?>:</div>
<div class="float_left" style="width: 45%; font-weight: bold;"><?php echo to_currency($total); ?></div>
</div>
<?php
// Only show this part if there are Items already in the sale.
if(count($cart) > 0)
{
?>
<?php echo form_open("sales/cancel_sale", array('id'=>'cancel_sale_form')); ?>
<div id="cancel_sale">
<div class='btn btn-sm btn-danger pull-left' id='cancel_sale_button' style='margin-top: 5px;'>
<?php echo $this->lang->line('sales_cancel_sale'); ?>
</div>
<div class='btn btn-sm btn-default pull-right' id='suspend_sale_button' style='margin-top: 5px;'>
<?php echo $this->lang->line('sales_suspend_sale'); ?>
</div>
</div>
<?php echo form_close(); ?>
<div class="clearfix" style="margin-bottom: 1px;">&nbsp;</div>
<div id="overall_sale" class="panel panel-default">
<div class="panel-body">
<?php
// Only show this part if there is at least one payment entered.
if(count($payments) > 0)
if(isset($customer))
{
echo form_open("sales/complete", array('id'=>'finish_sale_form'));
echo '<label class="control-label">' . $this->lang->line("sales_customer") . ': <b>' . $customer . '</b></label><br />';
echo anchor("sales/remove_customer",'['.$this->lang->line('common_remove').' '.$this->lang->line('customers_customer').']');
}
else
{
echo form_open("sales/select_customer", array('id'=>'select_customer_form', 'class'=>'form-horizontal'));
?>
<div id="finish_sale">
<label id="comment_label" for="comment"><?php echo $this->lang->line('common_comments'); ?>:</label>
<?php echo form_textarea(array('name'=>'comment', 'id'=>'comment', 'value'=>$comment, 'rows'=>'4', 'cols'=>'23')); ?>
<br />
<br />
<?php
if(!empty($customer_email))
{
echo $this->lang->line('sales_email_receipt'). ': '
. form_checkbox(array(
'name' => 'email_receipt',
'id' => 'email_receipt',
'value' => '1',
'checked' => (boolean)$email_receipt,
)).'<br />('.$customer_email.')<br />';
}
if ($payments_cover_total)
{
echo "<div class='btn btn-sm btn-success' id='finish_sale_button' style='float:left; margin-top:5px;' tabindex='3'><span>".$this->lang->line('sales_complete_sale')."</span></div>";
}
?>
<div class="form-group" style="margin: 0">
<label id="customer_label" for="customer" class="control-label" style="margin-bottom: 1em;"><?php echo $this->lang->line('sales_select_customer'); ?></label>
<?php echo form_input(array('name'=>'customer', 'id'=>'customer', 'class'=>'form-control input-sm', 'value'=>$this->lang->line('sales_start_typing_customer_name')));?>
</div>
<?php
echo form_close();
<?php echo form_close(); ?>
<h4 style="margin-top: 0.4em; margin-bottom: 0;"><?php echo $this->lang->line('common_or'); ?></h4>
<?php echo anchor("customers/view/-1", $this->lang->line('sales_new_customer'),
array('class'=>'btn btn-info btn-sm modal-dlg modal-btn-submit none', 'id'=>'new_customer_button', 'title'=>$this->lang->line('sales_new_customer'))); ?>
<?php
}
?>
<table width="100%">
<table id="sale_details">
<tr>
<td style="width: 55%;"><div class="float_left"><?php echo $this->lang->line('sales_payments_total').':';?></div></td>
<td style="width: 45%; text-align: right;"><div class="float_left"
style="text-align: right; font-weight: bold;"><?php echo to_currency($payments_total); ?></div></td>
<th style="width: 55%;"><?php echo $this->lang->line('sales_sub_total'); ?>:</th>
<th style="width: 45%; text-align: right;"><?php echo to_currency($this->config->item('tax_included') ? $tax_exclusive_subtotal : $subtotal); ?></th>
</tr>
<?php
foreach($taxes as $name=>$value)
{
?>
<tr>
<th style='width: 55%;'><?php echo $name; ?>:</th>
<th style="width: 45%; text-align: right;"><?php echo to_currency($value); ?></th>
</tr>
<?php
}
?>
<tr>
<td style="width: 55%;"><div class="float_left"><?php echo $this->lang->line('sales_amount_due').':';?></div></td>
<td style="width: 45%; text-align: right;"><div class="float_left"
style="text-align: right; font-weight: bold;"><?php echo to_currency($amount_due); ?></div></td>
<th style='width: 55%;'><?php echo $this->lang->line('sales_total'); ?>:</th>
<th style="width: 45%; text-align: right;"><?php echo to_currency($total); ?></th>
</tr>
</table>
<div id="payment_details">
<div>
<?php echo form_open("sales/add_payment", array('id'=>'add_payment_form')); ?>
<table width="100%">
<tr>
<td>
<?php echo $this->lang->line('sales_print_after_sale'); ?>
</td>
<td>
<?php
if ($print_after_sale)
{
echo form_checkbox(array('name'=>'sales_print_after_sale','id'=>'sales_print_after_sale','checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'sales_print_after_sale','id'=>'sales_print_after_sale'));
}
?>
</td>
</tr>
<?php
if ($mode == "sale")
{
?>
<tr>
<td>
<?php echo $this->lang->line('sales_invoice_enable'); ?>
</td>
<td>
<?php if ($invoice_number_enabled)
{
echo form_checkbox(array('name'=>'sales_invoice_enable','id'=>'sales_invoice_enable','checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'sales_invoice_enable','id'=>'sales_invoice_enable'));
}
?>
</td>
</tr>
<tr>
<td>
<?php echo $this->lang->line('sales_invoice_number').': ';?>
</td>
<td>
<?php echo form_input(array('name'=>'sales_invoice_number','id'=>'sales_invoice_number','value'=>$invoice_number,'size'=>10));?>
</td>
</tr>
<?php
}
?>
<tr>
<td>
<?php echo $this->lang->line('sales_payment').': ';?>
</td>
<td>
<?php echo form_dropdown( 'payment_type', $payment_options, array(), 'id="payment_types"' ); ?>
</td>
</tr>
<tr>
<td>
<span id="amount_tendered_label"><?php echo $this->lang->line( 'sales_amount_tendered' ).': '; ?></span>
</td>
<td>
<?php echo form_input( array( 'name'=>'amount_tendered', 'id'=>'amount_tendered', 'value'=>to_currency_no_money($amount_due), 'size'=>'10','tabindex'=>4 ) ); ?>
</td>
</tr>
</table>
<?php
// Only show this part if there are Items already in the sale.
if(count($cart) > 0)
{
?>
<?php echo form_open("sales/cancel_sale", array('id'=>'cancel_sale_form', 'class'=>'form-horizontal')); ?>
<div id="cancel_sale">
<div class='btn btn-sm btn-danger pull-left' id='cancel_sale_button'><?php echo $this->lang->line('sales_cancel_sale'); ?></div>
<div class='btn btn-sm btn-success pull-left' id='add_payment_button' style=' margin-top: 5px;'>
<?php echo $this->lang->line('sales_add_payment'); ?>
</div>
<?php echo form_close(); ?>
</div>
<div class='btn btn-sm btn-default pull-right' id='suspend_sale_button'><?php echo $this->lang->line('sales_suspend_sale'); ?></div>
</div>
<?php echo form_close(); ?>
<?php
// Only show this part if there is at least one payment entered.
if(count($payments) > 0)
{
echo form_open("sales/complete", array('id'=>'finish_sale_form', 'class'=>'form-horizontal'));
?>
<table id="register">
<thead>
<tr>
<th style="width: 11%;"><?php echo $this->lang->line('common_delete'); ?></th>
<th style="width: 60%;"><?php echo $this->lang->line('sales_payment_type'); ?></th>
<th style="width: 18%;"><?php echo $this->lang->line('sales_payment_amount'); ?></th>
</tr>
</thead>
<tbody id="payment_contents">
<div id="finish_sale">
<label id="comment_label" for="comment"><?php echo $this->lang->line('common_comments'); ?>:</label>
<?php echo form_textarea(array('name'=>'comment', 'id'=>'comment', 'class'=>'form-control input-sm', 'value'=>$comment, 'rows'=>'4', 'cols'=>'23')); ?>
<?php
foreach($payments as $payment_id=>$payment)
if(!empty($customer_email))
{
echo form_open("sales/edit_payment/$payment_id", array('id'=>'edit_payment_form'.$payment_id));
?>
<tr>
<td><?php echo anchor( "sales/delete_payment/$payment_id", '['.$this->lang->line('common_delete').']' ); ?></td>
<td><?php echo $payment['payment_type']; ?></td>
<td style="text-align: right;"><?php echo to_currency( $payment['payment_amount'] ); ?></td>
</tr>
<?php
echo form_close();
echo $this->lang->line('sales_email_receipt'). ': '
. form_checkbox(array(
'name' => 'email_receipt',
'id' => 'email_receipt',
'value' => '1',
'checked' => (boolean)$email_receipt,
)).'<br />('.$customer_email.')<br />';
}
if ($payments_cover_total)
{
echo "<div class='btn btn-sm btn-success pull-right' id='finish_sale_button' tabindex='3'><span>".$this->lang->line('sales_complete_sale')."</span></div>";
}
?>
</tbody>
</table>
<br />
<?php
</div>
<?php
echo form_close();
}
?>
</div>
<?php
}
?>
<table width="100%">
<tr>
<th style="width: 55%;"><?php echo $this->lang->line('sales_payments_total').':';?></th>
<th style="width: 45%; text-align: right;"><?php echo to_currency($payments_total); ?></th>
</tr>
<tr>
<th style="width: 55%;"><?php echo $this->lang->line('sales_amount_due').':';?></th>
<th style="width: 45%; text-align: right;"><?php echo to_currency($amount_due); ?></th>
</tr>
</table>
<div id="payment_details" class="panel-footer">
<div>
<?php echo form_open("sales/add_payment", array('id'=>'add_payment_form', 'class'=>'form-horizontal')); ?>
<table width="100%">
<tr>
<td><?php echo $this->lang->line('sales_print_after_sale'); ?></td>
<td>
<?php
if ($print_after_sale)
{
echo form_checkbox(array('name'=>'sales_print_after_sale', 'id'=>'sales_print_after_sale', 'class'=>'checkbox', 'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'sales_print_after_sale', 'id'=>'sales_print_after_sale', 'class'=>'checkbox'));
}
?>
</td>
</tr>
<?php
if ($mode == "sale")
{
?>
<tr>
<td><?php echo $this->lang->line('sales_invoice_enable'); ?></td>
<td>
<?php if ($invoice_number_enabled)
{
echo form_checkbox(array('name'=>'sales_invoice_enable', 'id'=>'sales_invoice_enable', 'class'=>'checkbox', 'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'sales_invoice_enable', 'id'=>'sales_invoice_enable', 'class'=>'checkbox'));
}
?>
</td>
</tr>
<tr>
<td><?php echo $this->lang->line('sales_invoice_number').': ';?></td>
<td>
<?php echo form_input(array('name'=>'sales_invoice_number', 'id'=>'sales_invoice_number', 'class'=>'form-control input-sm', 'value'=>$invoice_number, 'size'=>10));?>
</td>
</tr>
<?php
}
?>
<tr>
<td><?php echo $this->lang->line('sales_payment').': ';?></td>
<td>
<?php echo form_dropdown('payment_type', $payment_options, array(), array('id'=>'payment_types', 'class'=>'form-control input-sm')); ?>
</td>
</tr>
<tr>
<td><span id="amount_tendered_label"><?php echo $this->lang->line('sales_amount_tendered') . ': '; ?></span></td>
<td>
<?php echo form_input(array('name'=>'amount_tendered', 'id'=>'amount_tendered', 'class'=>'form-control input-sm', 'value'=>to_currency_no_money($amount_due), 'size'=>'10', 'tabindex'=>4)); ?>
</td>
</tr>
</table>
<div class='btn btn-sm btn-success pull-right' id='add_payment_button'><?php echo $this->lang->line('sales_add_payment'); ?></div>
<?php echo form_close(); ?>
</div>
<?php
// Only show this part if there is at least one payment entered.
if(count($payments) > 0)
{
?>
<table id="register">
<thead>
<tr>
<th style="width: 11%;"><?php echo $this->lang->line('common_delete'); ?></th>
<th style="width: 60%;"><?php echo $this->lang->line('sales_payment_type'); ?></th>
<th style="width: 18%;"><?php echo $this->lang->line('sales_payment_amount'); ?></th>
</tr>
</thead>
<tbody id="payment_contents">
<?php
foreach($payments as $payment_id=>$payment)
{
echo form_open("sales/edit_payment/$payment_id", array('id'=>'edit_payment_form'.$payment_id));
?>
<tr>
<td><?php echo anchor( "sales/delete_payment/$payment_id", '<span class="glyphicon glyphicon-trash"></span>' ); ?></td>
<td><?php echo $payment['payment_type']; ?></td>
<td style="text-align: right;"><?php echo to_currency( $payment['payment_amount'] ); ?></td>
</tr>
<?php
echo form_close();
}
?>
</tbody>
</table>
<br />
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
<div class="clearfix" style="margin-bottom: 30px;">&nbsp;</div>

View File

@@ -12,7 +12,8 @@
#mode_form .panel-body, #add_item_form .panel-body
{
padding: 10px;
padding: 0.7em;
margin: 0;
}
#mode_form
@@ -20,26 +21,33 @@
background-color: #DDD;
}
#mode_form ul, #add_item_form ul
{
list-style: none;
padding: 0;
margin: 0;
}
#mode_form ul.dropdown-menu.inner, #add_item_form ul.dropdown-menu.inner
{
margin-left: -1em !important;
}
#mode_form ul li, #add_item_form ul li
{
margin-left: 1em;
}
#add_item_form
{
background-color: #BBB;
}
#item_label
{
padding-top: 0;
}
#sales_takings_button
{
margin-right: 5px;
}
#register
{
position: relative;
width: 100%;
padding: 0px;
padding: 0;
border-collapse: collapse;
}
@@ -60,19 +68,30 @@
#overall_sale
{
float: left;
margin-left: 4px;
background-color: #BBB;
width: 28%;
padding: 5px;
float: left;
margin-left: 0.1em;
background-color: #BBB;
font-size: 13px;
text-align: center;
}
#overall_sale .panel-body
{
padding-top: 0;
padding-bottom: 0;
}
#overall_sale .btn
{
margin-top: 0.5em;
margin-bottom: 0.5em;
}
#sale_details
{
position: relative;
width: 100%;
margin-top: 5px;
border-top: 2px solid #000;
}
@@ -85,10 +104,12 @@
{
float: left;
width: 100%;
margin-top: 5px;
border-top: 2px solid #000;
background-color: #DDD;
margin-bottom: 0px;
margin-top: 0.2em;
margin-bottom: 1em;
padding: 0.5em;
text-align: left;
clear: both;
}
@@ -96,7 +117,6 @@
{
float: left;
width: 100%;
margin-top: 5px;
clear: both;
}

View File

File diff suppressed because one or more lines are too long