|
|
|
@ -123,11 +123,15 @@ class Vendor_money extends CI_Controller {
|
|
|
|
|
$result["money"][strval($vendor)]["vendor_code"] = $vendor;
|
|
|
|
|
$result["money"][strval($vendor)]["vendor_name"] = $vendor_sourcetype[strval($vendor)]["vendor_name"];
|
|
|
|
|
/** 团款合计 */
|
|
|
|
|
$result['col_sum']['trippest']['sum_trippest_sum'] = bcadd($result['col_sum']['trippest']['sum_trippest_sum'], $ret["trippest"]['trippest_sum']);
|
|
|
|
|
$result['col_sum']['trippest']['sum_trippest_sum'] = bcadd(
|
|
|
|
|
bcadd($result['col_sum']['trippest']['sum_trippest_sum'], $ret["trippest"]['trippest_sum'])
|
|
|
|
|
,$ret['trippest']['other_sum']);
|
|
|
|
|
$result['col_sum']['trippest']['sum_vendor_sum'] = bcadd($result['col_sum']['trippest']['sum_vendor_sum'], $ret["trippest"]['vendor_sum']);
|
|
|
|
|
$result['col_sum']['trippest']['sum_other'] = bcadd($result['col_sum']['trippest']['sum_other'], $ret['trippest']['other_sum']);
|
|
|
|
|
|
|
|
|
|
$result['col_sum']['vendor']['sum_trippest_sum'] = bcadd($result['col_sum']['vendor']['sum_trippest_sum'], $ret["vendor"]['trippest_sum']);
|
|
|
|
|
$result['col_sum']['vendor']['sum_trippest_sum'] = bcadd(
|
|
|
|
|
bcadd($result['col_sum']['vendor']['sum_trippest_sum'], $ret["vendor"]['trippest_sum'])
|
|
|
|
|
,$ret['vendor']['other_sum']);
|
|
|
|
|
$result['col_sum']['vendor']['sum_vendor_sum'] = bcadd($result['col_sum']['vendor']['sum_vendor_sum'], $ret["vendor"]['vendor_sum']);
|
|
|
|
|
$result['col_sum']['vendor']['sum_other'] = bcadd($result['col_sum']['vendor']['sum_other'], $ret['vendor']['other_sum']);
|
|
|
|
|
}
|
|
|
|
@ -142,16 +146,18 @@ class Vendor_money extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
// 成本总计
|
|
|
|
|
$result['col_sum']['trippest']['sum_trippest_cost'] = $result['col_sum']['vendor']['sum_trippest_cost'] = bcadd($result['col_sum']['trippest']['sum_trippest_cost'], $vm['trippest_cost']);
|
|
|
|
|
$result['col_sum']['trippest']['sum_vendor_cost'] = $result['col_sum']['vendor']['sum_vendor_cost'] = bcadd($result['col_sum']['trippest']['sum_vendor_cost'], $vm['vendor_cost']);
|
|
|
|
|
$result['col_sum']['trippest']['sum_vendor_cost'] = $result['col_sum']['vendor']['sum_vendor_cost'] = bcadd(
|
|
|
|
|
bcadd($result['col_sum']['trippest']['sum_vendor_cost'], $vm['vendor_cost'])
|
|
|
|
|
,$vm['trippest']['other_sum_cost']);
|
|
|
|
|
}
|
|
|
|
|
foreach ($result['money'] as $kmi => &$vmi) {
|
|
|
|
|
/** 利润 */
|
|
|
|
|
$vmi['trippest']['total_profit'] = bcsub(
|
|
|
|
|
bcadd($vmi['trippest']['trippest_sum'], $vmi['trippest']['vendor_sum']),
|
|
|
|
|
bcadd($vmi['trippest_cost'], $vmi['vendor_cost']));
|
|
|
|
|
bcadd(bcadd($vmi['trippest']['trippest_sum'], $vmi['trippest']['vendor_sum']),$vmi['trippest']['other_sum']),
|
|
|
|
|
bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['trippest']['other_sum_cost']));
|
|
|
|
|
$vmi['vendor']['total_profit'] = bcsub(
|
|
|
|
|
bcadd($vmi['vendor']['trippest_sum'], $vmi['vendor']['vendor_sum']),
|
|
|
|
|
bcadd($vmi['trippest_cost'], $vmi['vendor_cost']));
|
|
|
|
|
bcadd(bcadd($vmi['vendor']['trippest_sum'], $vmi['vendor']['vendor_sum']),$vmi['vendor']['other_sum']),
|
|
|
|
|
bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['vendor']['other_sum_cost']));
|
|
|
|
|
/** 利润分成 */
|
|
|
|
|
$vmi['trippest']['vendor_profit'] = bcmul($vmi['trippest']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]);
|
|
|
|
|
$vmi['trippest']['trippest_profit'] = bcmul($vmi['trippest']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) );
|
|
|
|
|