|
|
|
|
@ -197,30 +197,6 @@ class Vendor_money extends CI_Controller {
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function detail($download_vendor=null)
|
|
|
|
|
{
|
|
|
|
|
// $this->permission->is_admin(true); // test:
|
|
|
|
|
$date_range = $this->input->post("date_range");
|
|
|
|
|
preg_match_all('/\d{4}\-\d{2}\-\d{2}/', $date_range, $date_range_arr);
|
|
|
|
|
if (empty($date_range_arr[0])) {
|
|
|
|
|
return $this->settlement();
|
|
|
|
|
}
|
|
|
|
|
$start_date = $date_range_arr[0][0];
|
|
|
|
|
$end_date =$date_range_arr[0][1] . " 23:59:59";
|
|
|
|
|
if ($end_date == null) {
|
|
|
|
|
$end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1);
|
|
|
|
|
}
|
|
|
|
|
$vendors = $this->input->post("vendors");
|
|
|
|
|
if ($download_vendor !== null) {
|
|
|
|
|
$vendors = array($download_vendor);
|
|
|
|
|
}
|
|
|
|
|
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
|
|
|
|
|
$sourcetype = $vendor_sourcetype[strval($download_vendor)]["sourcetype"];
|
|
|
|
|
$vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors));
|
|
|
|
|
return $this->output->set_content_type('application/json')->set_output(json_encode($vendor_data));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function download_output($export_list, $file_name)
|
|
|
|
|
{
|
|
|
|
|
if (empty($export_list)) {
|
|
|
|
|
|