mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-30 00:26:49 -04:00
Stock locations are now shown on receivings and sales receipts
Database migration script now defines a default stock location name Rmeove obsolete constraints from migration script git-svn-id: svn+ssh://svn.code.sf.net/p/opensourcepos/code/@125 c3eb156b-1dc0-44e1-88ae-e38439141b53
This commit is contained in:
@@ -141,6 +141,8 @@ class Receivings extends Secure_area
|
||||
$data['receipt_title']=$this->lang->line('recvs_receipt');
|
||||
$data['transaction_time']= date('m/d/Y h:i:s a');
|
||||
$data['mode']=$this->receiving_lib->get_mode();
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
$data['show_stock_locations'] = count($stock_locations) > 1;
|
||||
$supplier_id=$this->receiving_lib->get_supplier();
|
||||
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
|
||||
$comment = $this->input->post('comment');
|
||||
@@ -204,6 +206,8 @@ class Receivings extends Secure_area
|
||||
$data['mode']=$this->receiving_lib->get_mode();
|
||||
$data['receipt_title']=$this->lang->line('recvs_receipt');
|
||||
$data['transaction_time']= date('m/d/Y h:i:s a', strtotime($receiving_info['receiving_time']));
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
$data['show_stock_locations'] = count($stock_locations) > 1;
|
||||
$supplier_id=$this->receiving_lib->get_supplier();
|
||||
$emp_info=$this->Employee->get_info($receiving_info['employee_id']);
|
||||
$data['payment_type']=$receiving_info['payment_type'];
|
||||
|
||||
@@ -197,6 +197,8 @@ class Sales extends Secure_area
|
||||
$data['total']=$this->sale_lib->get_total();
|
||||
$data['receipt_title']=$this->lang->line('sales_receipt');
|
||||
$data['transaction_time']= date('m/d/Y h:i:s a');
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
$data['show_stock_locations'] = count($stock_locations) > 1;
|
||||
$customer_id=$this->sale_lib->get_customer();
|
||||
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
|
||||
$comment = $this->sale_lib->get_comment();
|
||||
@@ -241,6 +243,8 @@ class Sales extends Secure_area
|
||||
{
|
||||
$sale_info = $this->Sale->get_info($sale_id)->row_array();
|
||||
$this->sale_lib->copy_entire_sale($sale_id);
|
||||
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
|
||||
$data['show_stock_locations'] = count($stock_locations) > 1;
|
||||
$data['cart']=$this->sale_lib->get_cart();
|
||||
$data['payments']=$this->sale_lib->get_payments();
|
||||
$data['subtotal']=$this->sale_lib->get_subtotal();
|
||||
|
||||
@@ -41,9 +41,8 @@ if (isset($error_message))
|
||||
<tr>
|
||||
<td><span class='long_name'><?php echo $item['name']; ?></span><span class='short_name'><?php echo character_limiter($item['name'],10); ?></span></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td style='text-align:center;'>
|
||||
<?php
|
||||
echo $item['quantity'];
|
||||
<td style='text-align:center;'><?php
|
||||
echo $item['quantity'] . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : "");
|
||||
?></td>
|
||||
<td style='text-align:center;'><?php echo $item['discount']; ?></td>
|
||||
<td style='text-align:right;'><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
|
||||
@@ -62,16 +61,14 @@ if (isset($error_message))
|
||||
<td colspan="2" style='text-align:right'><?php echo to_currency($total); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
if($mode=='requisition')
|
||||
if($mode!='requisition')
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="3" style='text-align:right;'><?php echo $this->lang->line('sales_payment'); ?></td>
|
||||
<td colspan="2" style='text-align:right'><?php echo $payment_type; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<?php if(isset($amount_change))
|
||||
{
|
||||
@@ -88,6 +85,9 @@ if (isset($error_message))
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
<div id="sale_return_policy">
|
||||
|
||||
@@ -43,7 +43,9 @@ if (isset($error_message))
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td><span class='long_name'><?php echo $item['name']; ?></span><span class='short_name'><?php echo character_limiter($item['name'],10); ?></span></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td style='text-align:center;'><?php echo $item['quantity']; ?></td>
|
||||
<td style='text-align:center;'><?php
|
||||
echo $item['quantity'] . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : "");
|
||||
?></td>
|
||||
<td style='text-align:center;'><?php echo $item['discount']; ?></td>
|
||||
<td style='text-align:right;'><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -21,7 +21,7 @@ ALTER TABLE ospos_inventory
|
||||
|
||||
ALTER TABLE ospos_items DROP COLUMN location;
|
||||
|
||||
INSERT INTO `ospos_stock_locations` ( `deleted` ) VALUES ('0');
|
||||
INSERT INTO `ospos_stock_locations` ( `deleted`, `location_name` ) VALUES ('0', 'stock');
|
||||
|
||||
ALTER TABLE ospos_receivings_items
|
||||
ADD COLUMN item_location int(11) NOT NULL,
|
||||
@@ -33,7 +33,6 @@ ALTER TABLE ospos_sales_items
|
||||
ADD COLUMN item_location int(11) NOT NULL,
|
||||
ADD KEY `item_location` (`item_location`),
|
||||
ADD KEY `sale_id` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
ALTER TABLE ospos_sales_items_taxes
|
||||
@@ -46,7 +45,6 @@ ALTER TABLE ospos_sales_suspended_items
|
||||
ADD COLUMN item_location int(11) NOT NULL,
|
||||
ADD KEY `item_location` (`item_location`),
|
||||
ADD KEY `sale_id` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
ALTER TABLE `ospos_item_quantities`
|
||||
|
||||
Reference in New Issue
Block a user