mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-03 05:12:50 -04:00
Add Customer get_row function in order to refresh the table row correctly (#1369)
This commit is contained in:
@@ -24,6 +24,32 @@ class Customers extends Persons
|
||||
$this->load->view('people/manage', $data);
|
||||
}
|
||||
|
||||
/*
|
||||
Gets one row for a customer manage table. This is called using AJAX to update one row.
|
||||
*/
|
||||
public function get_row($row_id)
|
||||
{
|
||||
$person = $this->Customer->get_info($row_id);
|
||||
|
||||
// retrieve the total amount the customer spent so far together with min, max and average values
|
||||
$stats = $this->Customer->get_stats($person->person_id);
|
||||
if(empty($stats))
|
||||
{
|
||||
//create object with empty properties.
|
||||
$stats = new stdClass;
|
||||
$stats->total = 0;
|
||||
$stats->min = 0;
|
||||
$stats->max = 0;
|
||||
$stats->average = 0;
|
||||
$stats->avg_discount = 0;
|
||||
$stats->quantity = 0;
|
||||
}
|
||||
|
||||
$data_row = $this->xss_clean(get_customer_data_row($person, $stats, $this));
|
||||
|
||||
echo json_encode($data_row);
|
||||
}
|
||||
|
||||
/*
|
||||
Returns customer table data rows. This will be called with AJAX.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user