mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-06 16:18:14 -05:00
Add Employee name to suspended form (#2678)
This commit is contained in:
@@ -1427,14 +1427,13 @@ class Sales extends Secure_Controller
|
||||
*/
|
||||
public function suspended()
|
||||
{
|
||||
$customer_id = $this->sale_lib->get_customer();
|
||||
$data = array();
|
||||
$customer_id = $this->sale_lib->get_customer();
|
||||
$data['suspended_sales'] = $this->xss_clean($this->Sale->get_all_suspended($customer_id));
|
||||
$data['dinner_table_enable'] = $this->config->item('dinner_table_enable');
|
||||
$this->load->view('sales/suspended', $data);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Unsuspended sales are now left in the tables and are only removed
|
||||
* when they are intentionally cancelled.
|
||||
*/
|
||||
|
||||
@@ -1228,17 +1228,16 @@ class Sale extends CI_Model
|
||||
{
|
||||
if($customer_id == -1)
|
||||
{
|
||||
$query = $this->db->query("select sale_id, case when sale_type = '".SALE_TYPE_QUOTE."' then quote_number when sale_type = '".SALE_TYPE_WORK_ORDER."' then work_order_number else sale_id end as doc_id, sale_id as suspended_sale_id, sale_status, sale_time, dinner_table_id, customer_id, comment from "
|
||||
$query = $this->db->query("SELECT sale_id, case when sale_type = '".SALE_TYPE_QUOTE."' THEN quote_number WHEN sale_type = '".SALE_TYPE_WORK_ORDER."' THEN work_order_number else sale_id end as doc_id, sale_id as suspended_sale_id, sale_status, sale_time, dinner_table_id, customer_id, employee_id, comment FROM "
|
||||
. $this->db->dbprefix('sales') . ' where sale_status = ' . SUSPENDED);
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = $this->db->query("select sale_id, case when sale_type = '".SALE_TYPE_QUOTE."' then quote_number when sale_type = '".SALE_TYPE_WORK_ORDER."' then work_order_number else sale_id end as doc_id, sale_status, sale_time, dinner_table_id, customer_id, comment from "
|
||||
$query = $this->db->query("SELECT sale_id, case when sale_type = '".SALE_TYPE_QUOTE."' THEN quote_number WHEN sale_type = '".SALE_TYPE_WORK_ORDER."' THEN work_order_number else sale_id end as doc_id, sale_status, sale_time, dinner_table_id, customer_id, employee_id, comment FROM "
|
||||
. $this->db->dbprefix('sales') . ' where sale_status = '. SUSPENDED .' AND customer_id = ' . $customer_id);
|
||||
}
|
||||
|
||||
return $query->result_array();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1250,6 +1249,7 @@ class Sale extends CI_Model
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$this->db->from('sales');
|
||||
$this->db->where('sale_id', $sale_id);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ if (isset($error_message))
|
||||
<?php
|
||||
if(isset($customer))
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<textarea id="customer" rows="5" cols="6"><?php echo $customer_info ?></textarea>
|
||||
<?php
|
||||
}
|
||||
@@ -108,9 +108,9 @@ if (isset($error_message))
|
||||
if($discount > 0)
|
||||
{
|
||||
$quote_columns = $quote_columns + 1;
|
||||
?>
|
||||
?>
|
||||
<th><?php echo $this->lang->line('sales_customer_discount'); ?></th>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th><?php echo $this->lang->line('sales_total'); ?></th>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<style>
|
||||
@media (min-width: 768px)
|
||||
{
|
||||
.modal-dlg .modal-dialog
|
||||
{
|
||||
width: 750px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<table id="suspended_sales_table" class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr bgcolor="#CCC">
|
||||
@@ -12,29 +21,30 @@
|
||||
}
|
||||
?>
|
||||
<th><?php echo $this->lang->line('sales_customer'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_employee'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_comments'); ?></th>
|
||||
<th><?php echo $this->lang->line('sales_unsuspend_and_delete'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($suspended_sales as $suspended_sale)
|
||||
foreach($suspended_sales as $suspended_sale)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $suspended_sale['doc_id'];?></td>
|
||||
<td><?php echo date($this->config->item('dateformat'), strtotime($suspended_sale['sale_time']));?></td>
|
||||
<td><?php echo $suspended_sale['doc_id']; ?></td>
|
||||
<td><?php echo date($this->config->item('dateformat'), strtotime($suspended_sale['sale_time'])); ?></td>
|
||||
<?php
|
||||
if($this->config->item('dinner_table_enable') == TRUE)
|
||||
{
|
||||
?>
|
||||
<td><?php echo $this->Dinner_table->get_name($suspended_sale['dinner_table_id']);?></td>
|
||||
<td><?php echo $this->Dinner_table->get_name($suspended_sale['dinner_table_id']); ?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
if (isset($suspended_sale['customer_id']))
|
||||
if(isset($suspended_sale['customer_id']))
|
||||
{
|
||||
$customer = $this->Customer->get_info($suspended_sale['customer_id']);
|
||||
echo $customer->first_name . ' ' . $customer->last_name;
|
||||
@@ -47,11 +57,25 @@
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $suspended_sale['comment'];?></td>
|
||||
<td>
|
||||
<?php echo form_open('sales/unsuspend');
|
||||
echo form_hidden('suspended_sale_id', $suspended_sale['sale_id']);
|
||||
<?php
|
||||
if(isset($suspended_sale['employee_id']))
|
||||
{
|
||||
$employee = $this->Employee->get_info($suspended_sale['employee_id']);
|
||||
echo $employee->first_name . ' ' . $employee->last_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $suspended_sale['comment']; ?></td>
|
||||
<td>
|
||||
<?php echo form_open('sales/unsuspend'); ?>
|
||||
<?php echo form_hidden('suspended_sale_id', $suspended_sale['sale_id']); ?>
|
||||
<input type="submit" name="submit" value="<?php echo $this->lang->line('sales_unsuspend'); ?>" id="submit" class="btn btn-primary btn-xs pull-right">
|
||||
<?php echo form_close(); ?>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user