fix sales/register and receiving button, styles, alignment and code tidy up (#116)

This commit is contained in:
FrancescoUK
2016-02-18 21:16:07 +00:00
parent f19e7142cd
commit ee4297e22c
3 changed files with 239 additions and 254 deletions

View File

@@ -1,35 +1,30 @@
<?php $this->load->view("partial/header"); ?>
<div id="page_title" style="margin-bottom:8px;"><?php echo $this->lang->line('recvs_register'); ?></div>
<div id="page_title" style="margin-bottom: 8px;"><?php echo $this->lang->line('recvs_register'); ?></div>
<?php
if(isset($error))
if (isset($error))
{
echo "<div class='alert alert-dismissible alert-danger'>".$error."</div>";
}
?>
<div id="register_wrapper">
<?php echo form_open("receivings/change_mode",array('id'=>'mode_form')); ?>
<?php echo form_open("receivings/change_mode", array('id'=>'mode_form')); ?>
<label><?php echo $this->lang->line('recvs_mode') ?></label>
<?php
echo form_dropdown('mode', $modes, $mode, 'onchange="$(\'#mode_form\').submit();"');
<?php echo form_dropdown('mode',$modes,$mode,'onchange="$(\'#mode_form\').submit();"'); ?>
<?php
if ($show_stock_locations)
{
?>
<span><?php echo $this->lang->line('recvs_stock_source') ?></span>
<?php echo form_dropdown('stock_source',$stock_locations,$stock_source,'onchange="$(\'#mode_form\').submit();"'); ?>
<?php
if($mode=='requisition')
{
?>
<span><?php echo $this->lang->line('recvs_stock_destination') ?></span>
<?php echo form_dropdown('stock_destination',$stock_locations,$stock_destination,'onchange="$(\'#mode_form\').submit();"');
}
echo $this->lang->line('recvs_stock_source');
echo form_dropdown('stock_source', $stock_locations, $stock_source, 'onchange="$(\'#mode_form\').submit();"');
if($mode=='requisition')
{
echo $this->lang->line('recvs_stock_destination');
echo form_dropdown('stock_destination', $stock_locations, $stock_destination, 'onchange="$(\'#mode_form\').submit();"');
}
}
?>
<?php echo form_close(); ?>
@@ -48,14 +43,12 @@ if(isset($error))
?>
</label>
<?php echo form_input(array('name'=>'item','id'=>'item','size'=>'40'));?>
<?php
echo form_input(array('name'=>'item','id'=>'item','size'=>'40'));
<div id="new_item_button_register" >
<?php echo anchor("items/view/-1/width:450",
"<div class='btn btn-sm btn-info'><span>".$this->lang->line('sales_new_item')."</span></div>",
array('class'=>'thickbox none','title'=>$this->lang->line('sales_new_item')));
?>
</div>
echo anchor("items/view/-1/width:450", $this->lang->line('sales_new_item'),
array('class'=>'btn btn-info btn-sm pull-right thickbox none', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item')));
?>
<?php echo form_close(); ?>
<!-- Receiving Items List -->
@@ -92,7 +85,7 @@ if(isset($error))
?>
<tr>
<td><?php echo anchor("receivings/delete_item/$line",'['.$this->lang->line('common_delete').']');?></td>
<td style="align:center;"><?php echo base64_decode($item['name']); ?><br /> [<?php echo $item['in_stock']; ?> in <?php echo $item['stock_name']; ?>]
<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')
@@ -144,7 +137,7 @@ if(isset($error))
}
?>
<td><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
<td><?php echo form_submit("edit_item", $this->lang->line('sales_edit_item'));?></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>
</tr>
<tr>
<?php
@@ -199,40 +192,45 @@ if(isset($error))
}
else
{
echo form_open("receivings/select_supplier",array('id'=>'select_supplier_form')); ?>
echo form_open("receivings/select_supplier",array('id'=>'select_supplier_form'));
?>
<label id="supplier_label" for="supplier"><?php echo $this->lang->line('recvs_select_supplier'); ?></label>
<?php echo form_input(array('name'=>'supplier','id'=>'supplier','size'=>'30','value'=>$this->lang->line('recvs_start_typing_supplier_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("suppliers/view/-1/width:400",
"<div class='btn btn-sm btn-info' style='margin:0 auto;'><span>".$this->lang->line('recvs_new_supplier')."</span></div>",
array('class'=>'thickbox none','title'=>$this->lang->line('recvs_new_supplier')));
?>
<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("suppliers/view/-1/width:400", $this->lang->line('recvs_new_supplier'),
array('class'=>'btn btn-info btn-sm thickbox none', 'id'=>'new_supplier_button', 'title'=>$this->lang->line('recvs_new_supplier')));
?>
</div>
<div class="clearfix">&nbsp;</div>
<?php
<?php
}
?>
<?php
if($mode != 'requisition')
{
if($mode != 'requisition')
{
?>
<div id='sale_details'>
<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>
<div id='sale_details'>
<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
}
}
?>
<?php
if(count($cart) > 0)
{
if($mode == 'requisition')
{
?>
<div style='border-top:2px solid #000;' />
<div style='border-top:2px solid #000;' />
<div id="finish_sale">
<?php echo form_open("receivings/requisition_complete",array('id'=>'finish_receiving_form')); ?>
<br />
@@ -240,113 +238,117 @@ if(isset($error))
<?php echo form_textarea(array('name'=>'comment','id'=>'comment','value'=>$comment,'rows'=>'4','cols'=>'23'));?>
<br /><br />
<div class="btn btn-sm btn-success" id='finish_receiving_button' style='float:right;margin-top:5px;'>
<span><?php echo $this->lang->line('recvs_complete_receiving') ?></span>
<div class="btn btn-sm btn-success pull-right" id='finish_receiving_button' style='margin-top:5px;'>
<?php echo $this->lang->line('recvs_complete_receiving') ?>
</div>
</form>
<?php echo form_open("receivings/cancel_receiving",array('id'=>'cancel_receiving_form')); ?>
<div class="btn btn-sm btn-danger" id='cancel_receiving_button' style='float:left;margin-top:5px;'>
<span><?php echo $this->lang->line('recvs_cancel_receiving')?></span>
<?php echo form_close(); ?>
<?php echo form_open("receivings/cancel_receiving",array('id'=>'cancel_receiving_form')); ?>
<div class="btn btn-sm btn-danger pull-left" id='cancel_receiving_button' style='margin-top:5px;'>
<?php echo $this->lang->line('recvs_cancel_receiving')?>
</div>
<?php echo form_close(); ?>
</div>
<?php
}
else
{
?>
<div id="finish_sale">
<?php echo form_open("receivings/complete",array('id'=>'finish_receiving_form')); ?>
<br />
<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 />
<table width="100%">
<tr>
<td>
<?php echo $this->lang->line('recvs_print_after_sale'); ?>
</td>
<td>
<?php if ($print_after_sale)
{
echo form_checkbox(array('name'=>'recv_print_after_sale','id'=>'recv_print_after_sale','checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'recv_print_after_sale','id'=>'recv_print_after_sale'));
}
<?php
}
else
{
?>
<div id="finish_sale">
<?php echo form_open("receivings/complete",array('id'=>'finish_receiving_form')); ?>
<br />
<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 />
<table width="100%">
<tr>
<td>
<?php echo $this->lang->line('recvs_print_after_sale'); ?>
</td>
<td>
<?php if ($print_after_sale)
{
echo form_checkbox(array('name'=>'recv_print_after_sale','id'=>'recv_print_after_sale','checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'recv_print_after_sale','id'=>'recv_print_after_sale'));
}
?>
</td>
</tr>
<?php
if ($mode == "receive")
{
?>
<tr>
<td>
<?php echo $this->lang->line('recvs_invoice_enable'); ?>
</td>
<td>
<?php
if ($invoice_number_enabled)
{
echo form_checkbox(array('name'=>'recv_invoice_enable','id'=>'recv_invoice_enable','size'=>10,'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'recv_invoice_enable','id'=>'recv_invoice_enable','size'=>10));
}
?>
</td>
</tr>
<tr>
<td>
<?php echo $this->lang->line('recvs_invoice_number').': ';?>
</td>
<td>
<?php echo form_input(array('name'=>'recv_invoice_number','id'=>'recv_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);?>
</td>
</tr>
<tr>
<td>
<?php
echo $this->lang->line('sales_amount_tendered').': ';?>
</td>
<td>
<?php
echo form_input(array('name'=>'amount_tendered','value'=>'','size'=>'10'));
?>
</td>
</tr>
<?php if ($mode == "receive")
{
?>
<tr>
<td>
<?php echo $this->lang->line('recvs_invoice_enable'); ?>
</td>
<td>
<?php if ($invoice_number_enabled)
{
echo form_checkbox(array('name'=>'recv_invoice_enable','id'=>'recv_invoice_enable','size'=>10,'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'recv_invoice_enable','id'=>'recv_invoice_enable','size'=>10));
}
?>
</td>
</tr>
<tr>
<td>
<?php echo $this->lang->line('recvs_invoice_number').': ';?>
</td>
<td>
<?php echo form_input(array('name'=>'recv_invoice_number','id'=>'recv_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);?>
</td>
</tr>
</td>
</tr>
<tr>
<td>
<?php
echo $this->lang->line('sales_amount_tendered').': ';?>
</td><td>
<?php
echo form_input(array('name'=>'amount_tendered','value'=>'','size'=>'10'));
?>
</td>
</tr>
</table>
<br />
<div class='btn btn-sm btn-success' id='finish_receiving_button' style='float:right;margin-top:5px;'>
<span><?php echo $this->lang->line('recvs_complete_receiving') ?></span>
</div>
<?php echo form_close(); ?>
<?php echo form_open("receivings/cancel_receiving",array('id'=>'cancel_receiving_form')); ?>
<div class='btn btn-sm btn-danger' id='cancel_receiving_button' style='float:left;margin-top:5px;'>
<span><?php echo $this->lang->line('recvs_cancel_receiving')?></span>
</table>
<br />
<div class='btn btn-sm btn-success pull-right' id='finish_receiving_button' style='margin-top:5px;'>
<?php echo $this->lang->line('recvs_complete_receiving') ?>
</div>
<?php echo form_close(); ?>
</div>
<?php
}
}
?>
<?php echo form_close(); ?>
<?php echo form_open("receivings/cancel_receiving",array('id'=>'cancel_receiving_form')); ?>
<div class='btn btn-sm btn-danger pull-left' id='cancel_receiving_button' style='margin-top:5px;'>
<?php echo $this->lang->line('recvs_cancel_receiving')?>
</div>
<?php echo form_close(); ?>
</div>
<?php
}
}
?>
</div>
<div class="clearfix" style="margin-bottom:30px;">&nbsp;</div>

View File

@@ -21,50 +21,39 @@ if (isset($success))
<div id="register_wrapper">
<?php echo form_open("sales/change_mode", array('id'=>'mode_form')); ?>
<label><?php echo $this->lang->line('sales_mode') ?></label>
<?php echo form_dropdown('mode', $modes, $mode, 'onchange="$(\'#mode_form\').submit();"'); ?>
<label id="mode_label"><?php echo $this->lang->line('sales_mode') ?></label>
<?php
echo form_dropdown('mode', $modes, $mode, 'onchange="$(\'#mode_form\').submit();"');
<?php
if (count($stock_locations) > 1)
{
?>
<span><?php echo $this->lang->line('sales_stock_location') ?></span>
<?php echo form_dropdown('stock_location',$stock_locations,$stock_location,'onchange="$(\'#mode_form\').submit();"'); ?>
<?php
echo $this->lang->line('sales_stock_location');
echo form_dropdown('stock_location', $stock_locations, $stock_location, 'onchange="$(\'#mode_form\').submit();"');
}
?>
<?php
echo anchor("sales/suspended/width:425", $this->lang->line('sales_suspended_sales'),
array('class'=>'btn btn-default btn-sm pull-right thickbox none', 'id'=>'show_suspended_sales_button', 'title'=>$this->lang->line('sales_suspended_sales')));
if ($this->Employee->has_grant('reports_sales', $this->session->userdata('person_id')))
{
?>
<a href="<?=site_url($controller_name . '/manage')?>"><div class="btn btn-primary btn-sm" id="sales_overview"><span><?php echo $this->lang->line('sales_takings'); ?><span></div></a>
<?php
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')));
}
?>
<?php echo anchor("sales/suspended/width:425",
"<div class='btn btn-default btn-sm' id='show_suspended_sales_button'><span>".$this->lang->line('sales_suspended_sales')."</span></div>",
array('class'=>'thickbox none','title'=>$this->lang->line('sales_suspended_sales')));
?>
<?php echo form_close(); ?>
<?php echo form_open("sales/add", array('id'=>'add_item_form')); ?>
<label id="item_label" for="item">
<?php echo $this->lang->line('sales_find_or_scan_item_or_receipt'); ?>
</label>
<?php echo form_input(array('name'=>'item','id'=>'item','size'=>'40','tabindex'=>'1')); ?>
<label id="item_label" for="item"><?php echo $this->lang->line('sales_find_or_scan_item_or_receipt'); ?></label>
<?php
echo form_input(array('name'=>'item', 'id'=>'item', 'size'=>'40', 'tabindex'=>'1'));
<div id="new_item_button_register" >
<?php echo anchor("items/view/-1/width:450",
"<div class='btn btn-info btn-sm'><span>".$this->lang->line('sales_new_item')."</span></div>",
array('class'=>'thickbox none','title'=>$this->lang->line('sales_new_item')));
?>
</div>
echo anchor("items/view/-1/width:450", $this->lang->line('sales_new_item'),
array('class'=>'btn btn-info btn-sm pull-right thickbox none', 'id'=>'new_item_button', 'title'=>$this->lang->line('sales_new_item')));
?>
<?php echo form_close(); ?>
<!-- Sale Items List -->
<table id="register">
<thead>
<tr>
@@ -209,6 +198,8 @@ if (isset($success))
</table>
</div>
<!-- Overall Sale -->
<div id="overall_sale">
<?php
if(isset($customer))
@@ -222,14 +213,14 @@ if (isset($success))
?>
<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/width:400",
"<div class='btn btn-sm btn-info' style='margin:0 auto;'><span>".$this->lang->line('sales_new_customer')."</span></div>",
array('class'=>'thickbox none','title'=>$this->lang->line('sales_new_customer')));
<?php
echo anchor("customers/view/-1/width:400", $this->lang->line('sales_new_customer'),
array('class'=>'btn btn-info btn-sm thickbox none', 'id'=>'new_customer_button', 'title'=>$this->lang->line('sales_new_customer')));
?>
</div>
@@ -257,17 +248,15 @@ if (isset($success))
{
?>
<?php echo form_open("sales/cancel_sale", array('id'=>'cancel_sale_form')); ?>
<div id="Cancel_sale">
<div class='btn btn-sm btn-danger' id='cancel_sale_button' style='float:left; margin-top: 5px;'>
<span><?php echo $this->lang->line('sales_cancel_sale'); ?></span>
<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>
<div class='btn btn-sm btn-default' id='suspend_sale_button' style='float:right; margin-top: 5px;'>
<span><?php echo $this->lang->line('sales_suspend_sale'); ?></span>
</div>
</div>
<?php echo form_close(); ?>
<div class="clearfix" style="margin-bottom: 1px;">&nbsp;</div>
@@ -389,8 +378,8 @@ if (isset($success))
</tr>
</table>
<div class='btn btn-sm btn-success' id='add_payment_button' style='float: left; margin-top: 5px;'>
<span><?php echo $this->lang->line('sales_add_payment'); ?></span>
<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>

View File

@@ -1,136 +1,130 @@
#register_wrapper
{
float:left;
width:70%;
font-size:13px;
float: left;
width: 70%;
font-size: 13px;
}
#mode_form, #add_item_form
{
position: relative;
width: 100%;
padding: 10px 5px 10px 5px;
}
#mode_form
{
position:relative;
background-color:#DDD;
width:100%;
padding: 8px 5px 8px 5px;
background-color: #DDD;
padding-bottom: 15px;
}
#sales_overview
#mode_form label
{
position:absolute;
top:3px;
right:130px;
font-weight: bold;
margin: 0px 5px 0px 5px;
}
#show_suspended_sales_button
#sales_takings_button, #show_suspended_sales_button, #new_item_button
{
position:absolute;
top:3px;
right:4px;
position: relative;
bottom: 4px;
}
#mode_form span
#sales_takings_button
{
font-weight:bold;
margin-right: 5px;
}
#add_item_form
{
position:relative;
background-color:#BBBBBB;
width:100%;
padding: 8px 0px 8px 0px;
}
#new_item_button_register
{
position:absolute;
top:3px;
right:4px;
background-color: #BBB;
}
#add_item_form input
{
border: 1px solid #ccc;
border: 1px solid #CCC;
padding: 2px;
}
#item_label,#customer_label
{
font-weight:bold;
}
#add_item_form label
{
font-weight: bold;
margin: 0px 5px 0px 5px;
}
#customer_label
{
font-weight: bold;
}
#register
{
position:relative;
width:100%;
padding:0px;
border-collapse:collapse;
position: relative;
width: 100%;
padding: 0px;
border-collapse: collapse;
}
#register th
{
background-color: #999999;
background-color: #999;
padding: 5px;
text-align: center;
color: #FFFFFF;
color: #FFF;
}
#register td
{
background-color:#EEEEEE;
padding:3px;
text-align:center;
background-color: #EEE;
padding: 3px;
text-align: center;
}
#overall_sale
{
float:left;
margin-left:4px;
background-color:#BBBBBB;
width:28%;
padding:5px;
font-size:13px;
float: left;
margin-left: 4px;
background-color: #BBB;
width: 28%;
padding: 5px;
font-size: 13px;
}
#sale_details
{
position:relative;
width:100%;
margin-top:5px;
border-top:2px solid #000;
position: relative;
width: 100%;
margin-top: 5px;
border-top: 2px solid #000;
}
#finish_sale
{
position:relative;
position: relative;
}
#payment_details
{
float:left;
width:100%;
margin-top:5px;
border-top:2px solid #000;
background-color:#DDD;
margin-bottom:0px;
clear:both;
float: left;
width: 100%;
margin-top: 5px;
border-top: 2px solid #000;
background-color: #DDD;
margin-bottom: 0px;
clear: both;
}
#Cancel_sale
#cancel_sale
{
float:left;
width:100%;
margin-top:5px;
clear:both;
float: left;
width: 100%;
margin-top: 5px;
clear: both;
}
#suspended_sales_table
{
width:100%;
width: 100%;
}
#credit_card_form fieldset