@ -301,6 +301,30 @@ class Vendor_money_model extends CI_Model {
return $query->result_array();
}
public function cost_debug_detail($start_date, $end_date, $all_vendor)
{
$sql = "SELECT
ordernumber,RPT_Total
,round(tourCost/case isnull(tourRSd,0)+ISNULL(tourRSx,0) when 0 then 1 else isnull(tourRSd,0)+ISNULL(tourRSx,0) end *case isnull(RPT_PersonGrade,1) when 0 then 1 else isnull(RPT_PersonGrade,1) end,2) as cal_total