|
@ -1,4 +1,7 @@ |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Support\Arr; |
|
|
|
|
|
|
|
|
include "header.php"; |
|
|
include "header.php"; |
|
|
|
|
|
|
|
|
$sum_facility = 0; |
|
|
$sum_facility = 0; |
|
@ -42,7 +45,7 @@ ON a.BillNo=c.BillNo |
|
|
WHERE DATALENGTH(c.OrderBillNo) >0"; |
|
|
WHERE DATALENGTH(c.OrderBillNo) >0"; |
|
|
|
|
|
|
|
|
//T8 銷售訂單 階段收款計畫 |
|
|
//T8 銷售訂單 階段收款計畫 |
|
|
$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt, a.PlanPayDate,s.BizPartnerId,c.BizPartnerName, s.PersonId, |
|
|
$sql_contract = "SELECT a.BillNo,s.BillDate, a.PayStage, a.PlanPayAmt, a.PlanPayDate,s.BizPartnerId,c.BizPartnerName, s.PersonId, |
|
|
c.EnterpriseName, c.TaxNo, c.ContactAddress FROM salOrderStagePay AS a |
|
|
c.EnterpriseName, c.TaxNo, c.ContactAddress FROM salOrderStagePay AS a |
|
|
LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo |
|
|
LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo |
|
|
LEFT JOIN comBusinessPartner AS c ON s.BizPartnerId=c.BizPartnerId |
|
|
LEFT JOIN comBusinessPartner AS c ON s.BizPartnerId=c.BizPartnerId |
|
@ -95,9 +98,11 @@ ON d.department_id = tmp2.department_id "; |
|
|
// 期初收款資訊 |
|
|
// 期初收款資訊 |
|
|
$sql_opening = " |
|
|
$sql_opening = " |
|
|
SELECT * FROM account_received "; |
|
|
SELECT * FROM account_received "; |
|
|
|
|
|
|
|
|
// 設定權限:看到自己的/下屬的,資訊處跟財會處可以看全部的 |
|
|
// 設定權限:看到自己的/下屬的,資訊處跟財會處可以看全部的 |
|
|
if (!(in_array(accountidToDepartId($user_id), array('220', '210')))) { |
|
|
if ((in_array($user_id, array('M0060', 'M0175'))) || (in_array(accountidToDepartId($user_id), array('220', '210')))) { |
|
|
|
|
|
$sql .= " ORDER BY contractno"; |
|
|
|
|
|
$sql_contract_budget .= "ORDER BY BillNo, CU_MaterialId"; |
|
|
|
|
|
} else { |
|
|
$sql_contract .= "AND (s.PersonId = '$user_id'"; |
|
|
$sql_contract .= "AND (s.PersonId = '$user_id'"; |
|
|
// $sql_received .= " AND (PersonId = '$user_id'"; |
|
|
// $sql_received .= " AND (PersonId = '$user_id'"; |
|
|
$sql_opening .= " OR person_id = '$user_id'"; |
|
|
$sql_opening .= " OR person_id = '$user_id'"; |
|
@ -111,7 +116,7 @@ if (!(in_array(accountidToDepartId($user_id), array('220', '210')))) { |
|
|
// $sql_received .= " OR PersonId IN $column_str)"; |
|
|
// $sql_received .= " OR PersonId IN $column_str)"; |
|
|
$sql_opening .= " OR person_id IN $column_str)"; |
|
|
$sql_opening .= " OR person_id IN $column_str)"; |
|
|
$sql .= " OR salesid IN $column_str ORDER BY contractno"; |
|
|
$sql .= " OR salesid IN $column_str ORDER BY contractno"; |
|
|
$sql_contract_budget .= " OR PersonId IN $column_str ORDER BY BillNo, CU_MaterialId)"; |
|
|
$sql_contract_budget .= " OR PersonId IN $column_str )ORDER BY BillNo, CU_MaterialId"; |
|
|
} else { |
|
|
} else { |
|
|
$sql_contract .= ")"; |
|
|
$sql_contract .= ")"; |
|
|
// $sql_received .= ")"; |
|
|
// $sql_received .= ")"; |
|
@ -119,9 +124,6 @@ if (!(in_array(accountidToDepartId($user_id), array('220', '210')))) { |
|
|
$sql .= " ORDER BY contractno"; |
|
|
$sql .= " ORDER BY contractno"; |
|
|
$sql_contract_budget .= ")"; |
|
|
$sql_contract_budget .= ")"; |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
|
|
|
$sql .= " ORDER BY contractno"; |
|
|
|
|
|
$sql_contract_budget .= "ORDER BY BillNo, CU_MaterialId"; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$contract = $conn->query($sql_contract); |
|
|
$contract = $conn->query($sql_contract); |
|
@ -141,6 +143,8 @@ foreach ($contract_budget_data as $cont) { |
|
|
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['total'] += $cont['OAmountWithTax']; |
|
|
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['total'] += $cont['OAmountWithTax']; |
|
|
} else { |
|
|
} else { |
|
|
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['total'] = $cont['OAmountWithTax']; |
|
|
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['total'] = $cont['OAmountWithTax']; |
|
|
|
|
|
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['A40001'] = 0; |
|
|
|
|
|
$contract_budget[$cont['BillNo']][$cont['CU_MaterialId']]['A40008'] = 0; |
|
|
}; |
|
|
}; |
|
|
if (isset($contract_budget[$cont['BillNo']][$cont['MaterialId']])) { |
|
|
if (isset($contract_budget[$cont['BillNo']][$cont['MaterialId']])) { |
|
|
$contract_budget[$cont['BillNo']][$cont['MaterialId']] += $cont['OAmountWithTax']; |
|
|
$contract_budget[$cont['BillNo']][$cont['MaterialId']] += $cont['OAmountWithTax']; |
|
@ -184,6 +188,7 @@ foreach ($contract as $cont) { |
|
|
} else { |
|
|
} else { |
|
|
$BillNo = $cont['BillNo']; |
|
|
$BillNo = $cont['BillNo']; |
|
|
}; |
|
|
}; |
|
|
|
|
|
$BillDate = $cont['BillDate']; |
|
|
$PayStage = $cont['PayStage']; |
|
|
$PayStage = $cont['PayStage']; |
|
|
$PlanPayDate = $cont['PlanPayDate']; |
|
|
$PlanPayDate = $cont['PlanPayDate']; |
|
|
$PayAmount = $cont['PlanPayAmt']; |
|
|
$PayAmount = $cont['PlanPayAmt']; |
|
@ -195,12 +200,13 @@ foreach ($contract as $cont) { |
|
|
//['tryrun'] 0 試車款名 1試車金額 2 試車收款日期 ['check'] 0 官檢款名 1 官檢金額 2 官檢收款日期 ['delivery'] 0 交車款名 1 交車金額 2 交車收款日期 ['final'] 0 尾款名 1 尾款金額 2 尾款收款日期 |
|
|
//['tryrun'] 0 試車款名 1試車金額 2 試車收款日期 ['check'] 0 官檢款名 1 官檢金額 2 官檢收款日期 ['delivery'] 0 交車款名 1 交車金額 2 交車收款日期 ['final'] 0 尾款名 1 尾款金額 2 尾款收款日期 |
|
|
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 |
|
|
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 |
|
|
if (!(isset($arrayData[$BillNo]))) { |
|
|
if (!(isset($arrayData[$BillNo]))) { |
|
|
// 0 部門id 1 部門名稱 2 經理名稱 3 營業員id 4 營業員名稱 5 客戶名稱 6 抬頭 7 統編 8 通訊地址 |
|
|
// 0 部門id 1 部門名稱 2 經理名稱 3 營業員id 4 營業員名稱 5 客戶名稱 6 抬頭 7 統編 8 通訊地址 9 T8單據日期 |
|
|
$arrayData[$BillNo] = [0, 0, 0, 0, 0, 0, 0, 0, 0]; |
|
|
$arrayData[$BillNo] = [0, 0, 0, 0, 0, 0, 0, 0, 0]; |
|
|
$arrayData[$BillNo][5] = $partnerName; |
|
|
$arrayData[$BillNo][5] = $partnerName; |
|
|
$arrayData[$BillNo][6] = $EnterpriseName; |
|
|
$arrayData[$BillNo][6] = $EnterpriseName; |
|
|
$arrayData[$BillNo][7] = $TaxNo; |
|
|
$arrayData[$BillNo][7] = $TaxNo; |
|
|
$arrayData[$BillNo][8] = $ContactAddress; |
|
|
$arrayData[$BillNo][8] = $ContactAddress; |
|
|
|
|
|
$arrayData[$BillNo][9] = $BillDate; |
|
|
$arrayData[$BillNo]['total_budget'] = 0; |
|
|
$arrayData[$BillNo]['total_budget'] = 0; |
|
|
$arrayData[$BillNo]['invoice'] = array(); |
|
|
$arrayData[$BillNo]['invoice'] = array(); |
|
|
$arrayData[$BillNo]['received_budget'] = 0; |
|
|
$arrayData[$BillNo]['received_budget'] = 0; |
|
@ -212,7 +218,7 @@ foreach ($contract as $cont) { |
|
|
$arrayData[$BillNo]['total_facility_num'] = $arrayData[$BillNo]['delivery_num'] = $arrayData[$BillNo]['check_num'] = $arrayData[$BillNo]['tryrun_num'] = $arrayData[$BillNo]['install_num'] = $arrayData[$BillNo]['arrive_num'] = $arrayData[$BillNo]['second_num'] = $arrayData[$BillNo]['sign_num'] = $arrayData[$BillNo]['receivable_budget'] = 0; |
|
|
$arrayData[$BillNo]['total_facility_num'] = $arrayData[$BillNo]['delivery_num'] = $arrayData[$BillNo]['check_num'] = $arrayData[$BillNo]['tryrun_num'] = $arrayData[$BillNo]['install_num'] = $arrayData[$BillNo]['arrive_num'] = $arrayData[$BillNo]['second_num'] = $arrayData[$BillNo]['sign_num'] = $arrayData[$BillNo]['receivable_budget'] = 0; |
|
|
$arrayData[$BillNo]['total_list'] = $arrayData[$BillNo]['sign_list'] = $arrayData[$BillNo]['second_list'] = $arrayData[$BillNo]['arrive_list'] = $arrayData[$BillNo]['install_list'] = $arrayData[$BillNo]['tryrun_list'] = $arrayData[$BillNo]['check_list'] = $arrayData[$BillNo]['delivery_list'] = $arrayData[$BillNo]['final_list'] = []; |
|
|
$arrayData[$BillNo]['total_list'] = $arrayData[$BillNo]['sign_list'] = $arrayData[$BillNo]['second_list'] = $arrayData[$BillNo]['arrive_list'] = $arrayData[$BillNo]['install_list'] = $arrayData[$BillNo]['tryrun_list'] = $arrayData[$BillNo]['check_list'] = $arrayData[$BillNo]['delivery_list'] = $arrayData[$BillNo]['final_list'] = []; |
|
|
} |
|
|
} |
|
|
if (stristr($PayStage, '二次款') || (stristr($PayStage, '出貨前') && $PayStage != "寶佳出貨前30天") || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60') || stristr($PayStage, '寶佳出貨後10天')) { |
|
|
if (stristr($PayStage, '二次款') || (stristr($PayStage, '出貨前') && $PayStage != "寶佳出貨前30天") || stristr($PayStage, '簽約後') || stristr($PayStage, '訂金支付後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60') || stristr($PayStage, '寶佳出貨後10天')) { |
|
|
$arrayData[$BillNo]['second'][0] = $PayStage; |
|
|
$arrayData[$BillNo]['second'][0] = $PayStage; |
|
|
$arrayData[$BillNo]['second'][1] = $PayAmount; |
|
|
$arrayData[$BillNo]['second'][1] = $PayAmount; |
|
|
$arrayData[$BillNo]['second'][2] = $PlanPayDate; |
|
|
$arrayData[$BillNo]['second'][2] = $PlanPayDate; |
|
@ -300,8 +306,8 @@ foreach ($wipwhole_array as $wip) { |
|
|
$arrayData[$wip['contractno']][4] = $wip['name']; |
|
|
$arrayData[$wip['contractno']][4] = $wip['name']; |
|
|
$arrayData[$wip['contractno']][10] = $wip['contractno']; |
|
|
$arrayData[$wip['contractno']][10] = $wip['contractno']; |
|
|
$arrayData[$wip['contractno']]['total_facility_num'] += 1; |
|
|
$arrayData[$wip['contractno']]['total_facility_num'] += 1; |
|
|
$arrayData[$wip['contractno']]['A40001'] = $contract_budget[$wip['contractno']]['A40001']; |
|
|
$arrayData[$wip['contractno']]['A40001'] = (isset($contract_budget[$wip['contractno']]['A40001']) && !is_null($contract_budget[$wip['contractno']]['A40001'])) ? $contract_budget[$wip['contractno']]['A40001'] : 0; |
|
|
$arrayData[$wip['contractno']]['A40008'] = $contract_budget[$wip['contractno']]['A40008']; |
|
|
$arrayData[$wip['contractno']]['A40008'] = (isset($contract_budget[$wip['contractno']]['A40008']) && !is_null($contract_budget[$wip['contractno']]['A40008'])) ? $contract_budget[$wip['contractno']]['A40008'] : 0; |
|
|
// [合約號]['facility'][作番號]['no'] |
|
|
// [合約號]['facility'][作番號]['no'] |
|
|
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['no'] = $wip['facilityno']; |
|
|
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['no'] = $wip['facilityno']; |
|
|
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = ""; |
|
|
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = ""; |
|
@ -896,19 +902,21 @@ foreach ($arrayData as &$value) { |
|
|
} |
|
|
} |
|
|
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 |
|
|
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 |
|
|
// 計算每台作番金額與各階段應收金額 |
|
|
// 計算每台作番金額與各階段應收金額 |
|
|
foreach ($value['facility'] as &$val) { |
|
|
if (isset($value['facility'])) { |
|
|
foreach ($contractstage as $stage) { |
|
|
foreach ($value['facility'] as &$val) { |
|
|
if (isset($value[$stage][0]) && !empty($value[$stage][0])) { |
|
|
foreach ($contractstage as $stage) { |
|
|
$val[$stage][0] = $value[$stage][0]; |
|
|
if (isset($value[$stage][0]) && !empty($value[$stage][0])) { |
|
|
if (isset($contract_budget[$value[10]]['total']) && isset($contract_budget[$value[10]][$val['no']]['total'])) { |
|
|
$val[$stage][0] = $value[$stage][0]; |
|
|
$ratio = $contract_budget[$value[10]][$val['no']]['total'] / $contract_budget[$value[10]]['total']; |
|
|
if (isset($contract_budget[$value[10]]['total']) && isset($contract_budget[$value[10]][$val['no']]['total'])) { |
|
|
} else { |
|
|
$ratio = $contract_budget[$value[10]][$val['no']]['total'] / $contract_budget[$value[10]]['total']; |
|
|
$ratio = 0; |
|
|
} else { |
|
|
|
|
|
$ratio = 0; |
|
|
|
|
|
} |
|
|
|
|
|
$val[$stage][1] = $value[$stage][1] * $ratio; |
|
|
|
|
|
$val[$stage][3] = (!(isset($val[$stage][6])) || $val[$stage][6] == 0) ? 0 : $val[$stage][1]; |
|
|
|
|
|
$val['total_budget'] += $val[$stage][1]; |
|
|
|
|
|
$val['receivable_budget'] += $val[$stage][3]; |
|
|
} |
|
|
} |
|
|
$val[$stage][1] = $value[$stage][1] * $ratio; |
|
|
|
|
|
$val[$stage][3] = (!(isset($val[$stage][6])) || $val[$stage][6] == 0) ? 0 : $val[$stage][1]; |
|
|
|
|
|
$val['total_budget'] += $val[$stage][1]; |
|
|
|
|
|
$val['receivable_budget'] += $val[$stage][3]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -986,22 +994,90 @@ foreach ($received_array as $received) { |
|
|
|
|
|
|
|
|
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 4 已收金額 5 催收金額 6 已開發票金額 7 未開發票金額 min 最早應收月份 max 最晚應收月份 |
|
|
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 4 已收金額 5 催收金額 6 已開發票金額 7 未開發票金額 min 最早應收月份 max 最晚應收月份 |
|
|
foreach ($arrayData as $key => &$data) { |
|
|
foreach ($arrayData as $key => &$data) { |
|
|
|
|
|
//['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 |
|
|
|
|
|
//作番 |
|
|
|
|
|
$facilities = array(); |
|
|
|
|
|
if (isset($data['facility'])) { |
|
|
|
|
|
foreach ($data['facility'] as $fakey => $val) { |
|
|
|
|
|
array_push($facilities, $fakey); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$tmp_data = $data['received_budget']; |
|
|
$tmp_data = $data['received_budget']; |
|
|
$tmp_invoice = $data['invoice_budget']; |
|
|
$tmp_invoice = $data['invoice_budget']; |
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------------------------------ |
|
|
if ($data['sign'][3] > 0) { |
|
|
if (isset($data['sign'][3]) && $data['sign'][3] > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['sign'][3]) >= 0) { |
|
|
if (($tmp_data - $data['sign'][3]) >= 0) { |
|
|
$data['sign'][4] = $data['sign'][3]; |
|
|
$data['sign'][4] = $data['sign'][3]; |
|
|
$tmp_data -= $data['sign'][3]; |
|
|
$tmp_data -= $data['sign'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['sign'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['sign'][3]) && $data['facility'][$this_facility]['sign'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['sign'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = $data['facility'][$this_facility]['sign'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['sign'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] =$data['facility'][$this_facility]['sign'][3] -$data['facility'][$this_facility]['sign'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] = $data['facility'][$this_facility]['sign'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['sign'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['sign'][4] = $tmp_data; |
|
|
$data['sign'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['sign'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['sign'][3]) && $data['facility'][$this_facility]['sign'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['sign'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = $data['facility'][$this_facility]['sign'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['sign'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] =$data['facility'][$this_facility]['sign'][3] -$data['facility'][$this_facility]['sign'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] = $data['facility'][$this_facility]['sign'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['sign'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['sign'][5] = $data['sign'][3] - $data['sign'][4]; |
|
|
$data['sign'][5] = $data['sign'][3] - $data['sign'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['sign'][4] = 0; |
|
|
$data['sign'][4] = 0; |
|
|
$data['sign'][5] = $data['sign'][3]; |
|
|
$data['sign'][5] = $data['sign'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][5] = $data['facility'][$this_facility]['sign'][3]; |
|
|
|
|
|
if($data['facility'][$this_facility]['sign'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['sign'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['sign'][3]) >= 0) { |
|
@ -1022,19 +1098,81 @@ foreach ($arrayData as $key => &$data) { |
|
|
$data['sign'][6] = 0; |
|
|
$data['sign'][6] = 0; |
|
|
$data['sign'][7] = 0; |
|
|
$data['sign'][7] = 0; |
|
|
} |
|
|
} |
|
|
if ($data['second'][3] > 0) { |
|
|
if (isset($data['second'][3]) && $data['second'][3] > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['second'][3]) >= 0) { |
|
|
if (($tmp_data - $data['second'][3]) >= 0) { |
|
|
$data['second'][4] = $data['second'][3]; |
|
|
$data['second'][4] = $data['second'][3]; |
|
|
$tmp_data -= $data['second'][3]; |
|
|
$tmp_data -= $data['second'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['second'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['second'][3]) && $data['facility'][$this_facility]['second'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['second'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = $data['facility'][$this_facility]['second'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['second'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] =$data['facility'][$this_facility]['second'][3] -$data['facility'][$this_facility]['second'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] = $data['facility'][$this_facility]['second'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['second'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['second'][4] = $tmp_data; |
|
|
$data['second'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['second'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['second'][3]) && $data['facility'][$this_facility]['second'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['second'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = $data['facility'][$this_facility]['second'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['second'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] =$data['facility'][$this_facility]['second'][3] -$data['facility'][$this_facility]['second'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] = $data['facility'][$this_facility]['second'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['second'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['second'][5] = $data['second'][3] - $data['second'][4]; |
|
|
$data['second'][5] = $data['second'][3] - $data['second'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['second'][4] = 0; |
|
|
$data['second'][4] = 0; |
|
|
$data['second'][5] = $data['second'][3]; |
|
|
$data['second'][5] = $data['second'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['second'][5] = $data['facility'][$this_facility]['second'][3]; |
|
|
|
|
|
if($data['facility'][$this_facility]['second'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['second'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['second'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['second'][3]) >= 0) { |
|
@ -1056,20 +1194,81 @@ foreach ($arrayData as $key => &$data) { |
|
|
$data['second'][7] = 0; |
|
|
$data['second'][7] = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($data['arrive'][3] > 0) { |
|
|
if (isset($data['arrive'][3]) && $data['arrive'][3] > 0) { |
|
|
|
|
|
|
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['arrive'][1]) >= 0) { |
|
|
if (($tmp_data - $data['arrive'][1]) >= 0) { |
|
|
$data['arrive'][4] = $data['arrive'][3]; |
|
|
$data['arrive'][4] = $data['arrive'][3]; |
|
|
$tmp_data -= $data['arrive'][3]; |
|
|
$tmp_data -= $data['arrive'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['arrive'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['arrive'][3]) && $data['facility'][$this_facility]['arrive'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['arrive'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = $data['facility'][$this_facility]['arrive'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['arrive'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] =$data['facility'][$this_facility]['arrive'][3] -$data['facility'][$this_facility]['arrive'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] = $data['facility'][$this_facility]['arrive'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['arrive'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['arrive'][4] = $tmp_data; |
|
|
$data['arrive'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['arrive'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['arrive'][3]) && $data['facility'][$this_facility]['arrive'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['arrive'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = $data['facility'][$this_facility]['arrive'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['arrive'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] =$data['facility'][$this_facility]['arrive'][3] -$data['facility'][$this_facility]['arrive'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] = $data['facility'][$this_facility]['arrive'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['arrive'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['arrive'][5] = $data['arrive'][3] - $data['arrive'][4]; |
|
|
$data['arrive'][5] = $data['arrive'][3] - $data['arrive'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['arrive'][4] = 0; |
|
|
$data['arrive'][4] = 0; |
|
|
$data['arrive'][5] = $data['arrive'][3]; |
|
|
$data['arrive'][5] = $data['arrive'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][5] = $data['facility'][$this_facility]['arrive'][3]; |
|
|
|
|
|
if($data['facility'][$this_facility]['arrive'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['arrive'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['arrive'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['arrive'][3]) >= 0) { |
|
@ -1091,20 +1290,81 @@ foreach ($arrayData as $key => &$data) { |
|
|
$data['arrive'][7] = 0; |
|
|
$data['arrive'][7] = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($data['install'][3] > 0) { |
|
|
if (isset($data['install'][3]) && $data['install'][3] > 0) { |
|
|
|
|
|
|
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['install'][1]) >= 0) { |
|
|
if (($tmp_data - $data['install'][1]) >= 0) { |
|
|
$data['install'][4] = $data['install'][3]; |
|
|
$data['install'][4] = $data['install'][3]; |
|
|
$tmp_data -= $data['install'][3]; |
|
|
$tmp_data -= $data['install'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['install'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['install'][3]) && $data['facility'][$this_facility]['install'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['install'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = $data['facility'][$this_facility]['install'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['install'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] =$data['facility'][$this_facility]['install'][3] -$data['facility'][$this_facility]['install'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] = $data['facility'][$this_facility]['install'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['install'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['install'][4] = $tmp_data; |
|
|
$data['install'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['install'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['install'][3]) && $data['facility'][$this_facility]['install'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['install'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = $data['facility'][$this_facility]['install'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['install'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] =$data['facility'][$this_facility]['install'][3] -$data['facility'][$this_facility]['install'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] = $data['facility'][$this_facility]['install'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['install'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['install'][5] = $data['install'][3] - $data['install'][4]; |
|
|
$data['install'][5] = $data['install'][3] - $data['install'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['install'][4] = 0; |
|
|
$data['install'][4] = 0; |
|
|
$data['install'][5] = $data['install'][3]; |
|
|
$data['install'][5] = $data['install'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['install'][5] = $data['facility'][$this_facility]['install'][3]; |
|
|
|
|
|
if($data['facility'][$this_facility]['install'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['install'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['install'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['install'][3]) >= 0) { |
|
@ -1127,19 +1387,80 @@ foreach ($arrayData as $key => &$data) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($data['tryrun'][3] > 0) { |
|
|
if (isset($data['tryrun'][3]) && $data['tryrun'][3] > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['tryrun'][1]) >= 0) { |
|
|
if (($tmp_data - $data['tryrun'][1]) >= 0) { |
|
|
$data['tryrun'][4] = $data['tryrun'][3]; |
|
|
$data['tryrun'][4] = $data['tryrun'][3]; |
|
|
$tmp_data -= $data['tryrun'][3]; |
|
|
$tmp_data -= $data['tryrun'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['tryrun'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['tryrun'][3]) && $data['facility'][$this_facility]['tryrun'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['tryrun'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = $data['facility'][$this_facility]['tryrun'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['tryrun'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] =$data['facility'][$this_facility]['tryrun'][3] -$data['facility'][$this_facility]['tryrun'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] = $data['facility'][$this_facility]['tryrun'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['tryrun'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['tryrun'][4] = $tmp_data; |
|
|
$data['tryrun'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['tryrun'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['tryrun'][3]) && $data['facility'][$this_facility]['tryrun'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['tryrun'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = $data['facility'][$this_facility]['tryrun'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['tryrun'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] =$data['facility'][$this_facility]['tryrun'][3] -$data['facility'][$this_facility]['tryrun'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] = $data['facility'][$this_facility]['tryrun'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['tryrun'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['tryrun'][5] = $data['tryrun'][3] - $data['tryrun'][4]; |
|
|
$data['tryrun'][5] = $data['tryrun'][3] - $data['tryrun'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['tryrun'][4] = 0; |
|
|
$data['tryrun'][4] = 0; |
|
|
$data['tryrun'][5] = $data['tryrun'][3]; |
|
|
$data['tryrun'][5] = $data['tryrun'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][5] = $data['facility'][$this_facility]['tryrun'][3]; |
|
|
|
|
|
if($data['facility'][$this_facility]['tryrun'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['tryrun'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['tryrun'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['tryrun'][3]) >= 0) { |
|
@ -1161,19 +1482,80 @@ foreach ($arrayData as $key => &$data) { |
|
|
$data['tryrun'][7] = 0; |
|
|
$data['tryrun'][7] = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($data['check'][3] > 0) { |
|
|
if (isset($data['check'][3]) && $data['check'][3] > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['check'][1]) >= 0) { |
|
|
if (($tmp_data - $data['check'][1]) >= 0) { |
|
|
$data['check'][4] = $data['check'][3]; |
|
|
$data['check'][4] = $data['check'][3]; |
|
|
$tmp_data -= $data['check'][3]; |
|
|
$tmp_data -= $data['check'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['check'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['check'][3]) && $data['facility'][$this_facility]['check'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['check'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = $data['facility'][$this_facility]['check'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['check'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] =$data['facility'][$this_facility]['check'][3] -$data['facility'][$this_facility]['check'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] = $data['facility'][$this_facility]['check'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['check'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['check'][4] = $tmp_data; |
|
|
$data['check'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['check'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['check'][3]) && $data['facility'][$this_facility]['check'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['check'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = $data['facility'][$this_facility]['check'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['check'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] =$data['facility'][$this_facility]['check'][3] -$data['facility'][$this_facility]['check'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] = $data['facility'][$this_facility]['check'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['check'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['check'][5] = $data['check'][3] - $data['check'][4]; |
|
|
$data['check'][5] = $data['check'][3] - $data['check'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['check'][4] = 0; |
|
|
$data['check'][4] = 0; |
|
|
$data['check'][5] = $data['check'][3]; |
|
|
$data['check'][5] = $data['check'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['check'][5] = $data['facility'][$this_facility]['check'][3]; |
|
|
|
|
|
if($data['facility'][$this_facility]['check'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['check'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['check'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['check'][3]) >= 0) { |
|
@ -1194,19 +1576,80 @@ foreach ($arrayData as $key => &$data) { |
|
|
$data['check'][6] = 0; |
|
|
$data['check'][6] = 0; |
|
|
$data['check'][7] = 0; |
|
|
$data['check'][7] = 0; |
|
|
} |
|
|
} |
|
|
if ($data['delivery'][3] > 0) { |
|
|
if (isset($data['delivery'][3]) && $data['delivery'][3] > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['delivery'][1]) >= 0) { |
|
|
if (($tmp_data - $data['delivery'][1]) >= 0) { |
|
|
$data['delivery'][4] = $data['delivery'][3]; |
|
|
$data['delivery'][4] = $data['delivery'][3]; |
|
|
$tmp_data -= $data['delivery'][3]; |
|
|
$tmp_data -= $data['delivery'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['delivery'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['delivery'][3]) && $data['facility'][$this_facility]['delivery'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['delivery'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = $data['facility'][$this_facility]['delivery'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['delivery'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] =$data['facility'][$this_facility]['delivery'][3] -$data['facility'][$this_facility]['delivery'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] = $data['facility'][$this_facility]['delivery'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['delivery'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['delivery'][4] = $tmp_data; |
|
|
$data['delivery'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['delivery'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['delivery'][3]) && $data['facility'][$this_facility]['delivery'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['delivery'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = $data['facility'][$this_facility]['delivery'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['delivery'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] =$data['facility'][$this_facility]['delivery'][3] -$data['facility'][$this_facility]['delivery'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] = $data['facility'][$this_facility]['delivery'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['delivery'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['delivery'][5] = $data['delivery'][3] - $data['delivery'][4]; |
|
|
$data['delivery'][5] = $data['delivery'][3] - $data['delivery'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['delivery'][4] = 0; |
|
|
$data['delivery'][4] = 0; |
|
|
$data['delivery'][5] = $data['delivery'][3]; |
|
|
$data['delivery'][5] = $data['delivery'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['delivery'][5] = $data['facility'][$this_facility]['delivery'][3]; |
|
|
|
|
|
if($data['facility'][$this_facility]['sign'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['sign'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['delivery'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['delivery'][3]) >= 0) { |
|
@ -1228,19 +1671,80 @@ foreach ($arrayData as $key => &$data) { |
|
|
$data['delivery'][7] = 0; |
|
|
$data['delivery'][7] = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($data['final'][3] > 0) { |
|
|
if (isset($data['final'][3]) && $data['final'][3] > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if ($tmp_data > 0) { |
|
|
if (($tmp_data - $data['final'][1]) >= 0) { |
|
|
if (($tmp_data - $data['final'][1]) >= 0) { |
|
|
$data['final'][4] = $data['final'][3]; |
|
|
$data['final'][4] = $data['final'][3]; |
|
|
$tmp_data -= $data['final'][3]; |
|
|
$tmp_data -= $data['final'][3]; |
|
|
|
|
|
$tmp_facility_received = $data['final'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['final'][3]) && $data['facility'][$this_facility]['final'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['final'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = $data['facility'][$this_facility]['final'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['final'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] =$data['facility'][$this_facility]['final'][3] -$data['facility'][$this_facility]['final'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] = $data['facility'][$this_facility]['final'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['final'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$data['final'][4] = $tmp_data; |
|
|
$data['final'][4] = $tmp_data; |
|
|
$tmp_data = 0; |
|
|
$tmp_data = 0; |
|
|
|
|
|
$tmp_facility_received = $data['final'][4]; |
|
|
|
|
|
foreach ($facilities as $this_facility) { |
|
|
|
|
|
if (isset($data['facility'][$this_facility]['final'][3]) && $data['facility'][$this_facility]['final'][3] > 0) { |
|
|
|
|
|
if ($tmp_facility_received > 0) { |
|
|
|
|
|
if ($tmp_facility_received >= $data['facility'][$this_facility]['final'][3]) { |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = $data['facility'][$this_facility]['final'][3]; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] = 0; |
|
|
|
|
|
$tmp_facility_received -= $data['facility'][$this_facility]['final'][3]; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = $tmp_facility_received; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] =$data['facility'][$this_facility]['final'][3] -$data['facility'][$this_facility]['final'][4]; |
|
|
|
|
|
$tmp_facility_received = 0; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] = $data['facility'][$this_facility]['final'][3]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][6] = 0; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['final'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][6] =0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
$data['final'][5] = $data['final'][3] - $data['final'][4]; |
|
|
$data['final'][5] = $data['final'][3] - $data['final'][4]; |
|
|
} else { |
|
|
} else { |
|
|
$data['final'][4] = 0; |
|
|
$data['final'][4] = 0; |
|
|
$data['final'][5] = $data['final'][3]; |
|
|
$data['final'][5] = $data['final'][3]; |
|
|
|
|
|
foreach($facilities as $this_facility){ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][4] = 0; |
|
|
|
|
|
$data['facility'][$this_facility]['final'][5] = $data['facility'][$this_facility]['final'][3]; |
|
|
|
|
|
} |
|
|
|
|
|
if($data['facility'][$this_facility]['final'][5] == 0){ |
|
|
|
|
|
$data['facility'][$this_facility]['final'][6] =0; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if ($tmp_invoice > 0) { |
|
|
if ($tmp_invoice > 0) { |
|
|
if (($tmp_invoice - $data['final'][3]) >= 0) { |
|
|
if (($tmp_invoice - $data['final'][3]) >= 0) { |
|
@ -1263,6 +1767,7 @@ foreach ($arrayData as $key => &$data) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//產生excel的array |
|
|
//產生excel的array |
|
|
$excel_aray = array(); |
|
|
$excel_aray = array(); |
|
|
$boga_array = array(); |
|
|
$boga_array = array(); |
|
@ -1271,8 +1776,8 @@ $facility_array = array(); |
|
|
$facility_boga_array = array(); |
|
|
$facility_boga_array = array(); |
|
|
$facility_exclude_boga_array = array(); |
|
|
$facility_exclude_boga_array = array(); |
|
|
foreach ($arrayData as $key => $value) { |
|
|
foreach ($arrayData as $key => $value) { |
|
|
$sum_A40001 += $value['A40001']; |
|
|
$sum_A40001 += isset($value['A40001']) ? $value['A40001'] : 0; |
|
|
$sum_A40008 += $value['A40008']; |
|
|
$sum_A40008 += isset($value['A40008']) ? $value['A40008'] : 0; |
|
|
$sum_total_budget += $value['total_budget']; |
|
|
$sum_total_budget += $value['total_budget']; |
|
|
$sum_facility += $value['total_facility_num']; |
|
|
$sum_facility += $value['total_facility_num']; |
|
|
$value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0; |
|
|
$value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0; |
|
@ -1283,17 +1788,20 @@ foreach ($arrayData as $key => $value) { |
|
|
$value['check'][3] = (isset($value['check'][3])) ? $value['check'][3] : 0; |
|
|
$value['check'][3] = (isset($value['check'][3])) ? $value['check'][3] : 0; |
|
|
$value['delivery'][3] = (isset($value['delivery'][3])) ? $value['delivery'][3] : 0; |
|
|
$value['delivery'][3] = (isset($value['delivery'][3])) ? $value['delivery'][3] : 0; |
|
|
$value['final'][3] = (isset($value['final'][3])) ? $value['final'][3] : 0; |
|
|
$value['final'][3] = (isset($value['final'][3])) ? $value['final'][3] : 0; |
|
|
|
|
|
$value[9] = (isset($value[9])) ? Date('Ymd', strtotime($value[9])) : 0; |
|
|
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final'); |
|
|
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final'); |
|
|
foreach ($contractstage as $i) { |
|
|
foreach ($contractstage as $i) { |
|
|
$value[$i]['max'] = (empty($value[$i]['max']) || is_null($value[$i]['max'])) ? 0 : $value[$i]['max']; |
|
|
$value[$i]['max'] = (empty($value[$i]['max']) || is_null($value[$i]['max'])) ? 0 : $value[$i]['max']; |
|
|
$value[$i]['min'] = (empty($value[$i]['min']) || is_null($value[$i]['min'])) ? 0 : $value[$i]['min']; |
|
|
$value[$i]['min'] = (empty($value[$i]['min']) || is_null($value[$i]['min'])) ? 0 : $value[$i]['min']; |
|
|
$value[$i][4] = (isset($value[$i][4])) ? $value[$i][4] : 0; |
|
|
$value[$i][4] = (isset($value[$i][4])) ? $value[$i][4] : 0; |
|
|
$value[$i][5] = (isset($value[$i][5])) ? $value[$i][5] : 0; |
|
|
$value[$i][5] = (isset($value[$i][5])) ? $value[$i][5] : 0; |
|
|
|
|
|
$value['A40001'] = (isset($value['A40001'])) ? $value['A40001'] : 0; |
|
|
|
|
|
$value['A40008'] = (isset($value['A40008'])) ? $value['A40008'] : 0; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
if ($value['sign'][0] == "寶佳出貨前30天") { |
|
|
if (isset($value['sign'][0]) && $value['sign'][0] == "寶佳出貨前30天") { |
|
|
$boga_array[$key] = [ |
|
|
$boga_array[$key] = [ |
|
|
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
$value[9], $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'], |
|
|
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'], |
|
|
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'], |
|
|
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'], |
|
|
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'], |
|
|
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'], |
|
@ -1306,7 +1814,7 @@ foreach ($arrayData as $key => $value) { |
|
|
]; |
|
|
]; |
|
|
} else { |
|
|
} else { |
|
|
$exclude_boga_array[$key] = [ |
|
|
$exclude_boga_array[$key] = [ |
|
|
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
$value[9], $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'], |
|
|
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'], |
|
|
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'], |
|
|
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'], |
|
|
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'], |
|
|
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'], |
|
@ -1320,7 +1828,7 @@ foreach ($arrayData as $key => $value) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$excel_aray[$key] = [ |
|
|
$excel_aray[$key] = [ |
|
|
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
$value[9], $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'], |
|
|
number_format(round($value['sign'][1])), number_format(round($value['sign'][3])), number_format(round($value['sign'][6])), number_format(round($value['sign'][7])), number_format(round($value['sign'][4])), number_format(round($value['sign'][5])), $value['sign']['max'], $value['sign']['min'], |
|
|
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'], |
|
|
number_format(round($value['second'][1])), number_format(round($value['second'][3])), number_format(round($value['second'][6])), number_format(round($value['second'][7])), number_format(round($value['second'][4])), number_format(round($value['second'][5])), $value['second']['max'], $value['second']['min'], |
|
|
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'], |
|
|
number_format(round($value['arrive'][1])), number_format(round($value['arrive'][3])), number_format(round($value['arrive'][6])), number_format(round($value['arrive'][7])), number_format(round($value['arrive'][4])), number_format(round($value['arrive'][5])), $value['arrive']['max'], $value['arrive']['min'], |
|
@ -1334,54 +1842,56 @@ foreach ($arrayData as $key => $value) { |
|
|
|
|
|
|
|
|
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 min 最早應收月份 max 最晚應收月份 |
|
|
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 min 最早應收月份 max 最晚應收月份 |
|
|
//[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 |
|
|
//[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 |
|
|
foreach ($value['facility'] as $valkey => $val) { |
|
|
if (isset($value['facility'])) { |
|
|
foreach ($contractstage as $stage) { |
|
|
foreach ($value['facility'] as $valkey => $val) { |
|
|
$val[$stage][0] = (!(isset($val[$stage][0])) || is_null($val[$stage][0])) ? "-" : $val[$stage][0]; |
|
|
foreach ($contractstage as $stage) { |
|
|
$val[$stage][1] = (!(isset($val[$stage][1])) || is_null($val[$stage][1])) ? 0 : $val[$stage][1]; |
|
|
$val[$stage][0] = (!(isset($val[$stage][0])) || is_null($val[$stage][0])) ? "-" : $val[$stage][0]; |
|
|
$val[$stage][2] = (!(isset($val[$stage][2])) || is_null($val[$stage][2])) ? "-" : $val[$stage][2]; |
|
|
$val[$stage][1] = (!(isset($val[$stage][1])) || is_null($val[$stage][1])) ? 0 : $val[$stage][1]; |
|
|
$val[$stage][3] = (!(isset($val[$stage][3])) || is_null($val[$stage][3])) ? 0 : $val[$stage][3]; |
|
|
$val[$stage][2] = (!(isset($val[$stage][2])) || is_null($val[$stage][2])) ? "-" : $val[$stage][2]; |
|
|
$val[$stage][4] = (!(isset($val[$stage][4])) || is_null($val[$stage][4])) ? 0 : $val[$stage][4]; |
|
|
$val[$stage][3] = (!(isset($val[$stage][3])) || is_null($val[$stage][3])) ? 0 : $val[$stage][3]; |
|
|
$val[$stage][5] = (!(isset($val[$stage][5])) || is_null($val[$stage][5])) ? 0 : $val[$stage][5]; |
|
|
$val[$stage][4] = (!(isset($val[$stage][4])) || is_null($val[$stage][4])) ? 0 : $val[$stage][4]; |
|
|
$val[$stage][6] = (!(isset($val[$stage][6])) || is_null($val[$stage][6])) ? 0 : $val[$stage][6]; |
|
|
$val[$stage][5] = (!(isset($val[$stage][5])) || is_null($val[$stage][5])) ? 0 : $val[$stage][5]; |
|
|
} |
|
|
$val[$stage][6] = (!(isset($val[$stage][6])) || is_null($val[$stage][6])) ? 0 : $val[$stage][6]; |
|
|
$facility_array[$valkey] = [ |
|
|
} |
|
|
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
$facility_array[$valkey] = [ |
|
|
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), $val['sign'][6], |
|
|
$value[9], $valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), $val['second'][6], |
|
|
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), number_format(round($val['sign'][6])), |
|
|
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), $val['arrive'][6], |
|
|
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), number_format(round($val['second'][6])), |
|
|
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), $val['install'][6], |
|
|
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), number_format(round($val['arrive'][6])), |
|
|
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), $val['tryrun'][6], |
|
|
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), number_format(round($val['install'][6])), |
|
|
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), $val['check'][6], |
|
|
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), number_format(round($val['tryrun'][6])), |
|
|
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), $val['delivery'][6], |
|
|
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), number_format(round($val['check'][6])), |
|
|
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), $val['final'][6], |
|
|
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), number_format(round($val['delivery'][6])), |
|
|
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget'])) |
|
|
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), number_format(round($val['final'][6])), |
|
|
]; |
|
|
|
|
|
if ($value['sign'][0] == "寶佳出貨前30天") { |
|
|
|
|
|
$facility_boga_array[$valkey] = [ |
|
|
|
|
|
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
|
|
|
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), $val['sign'][6], |
|
|
|
|
|
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), $val['second'][6], |
|
|
|
|
|
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), $val['arrive'][6], |
|
|
|
|
|
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), $val['install'][6], |
|
|
|
|
|
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), $val['tryrun'][6], |
|
|
|
|
|
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), $val['check'][6], |
|
|
|
|
|
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), $val['delivery'][6], |
|
|
|
|
|
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), $val['final'][6], |
|
|
|
|
|
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget'])) |
|
|
|
|
|
]; |
|
|
|
|
|
} else { |
|
|
|
|
|
$facility_exclude_boga_array[$valkey] = [ |
|
|
|
|
|
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
|
|
|
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), $val['sign'][6], |
|
|
|
|
|
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), $val['second'][6], |
|
|
|
|
|
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), $val['arrive'][6], |
|
|
|
|
|
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), $val['install'][6], |
|
|
|
|
|
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), $val['tryrun'][6], |
|
|
|
|
|
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), $val['check'][6], |
|
|
|
|
|
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), $val['delivery'][6], |
|
|
|
|
|
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), $val['final'][6], |
|
|
|
|
|
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget'])) |
|
|
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget'])) |
|
|
]; |
|
|
]; |
|
|
|
|
|
if ($value['sign'][0] == "寶佳出貨前30天") { |
|
|
|
|
|
$facility_boga_array[$valkey] = [ |
|
|
|
|
|
$value[9], $valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
|
|
|
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), number_format(round($val['sign'][6])), |
|
|
|
|
|
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), number_format(round($val['second'][6])), |
|
|
|
|
|
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), number_format(round($val['arrive'][6])), |
|
|
|
|
|
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), number_format(round($val['install'][6])), |
|
|
|
|
|
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), number_format(round($val['tryrun'][6])), |
|
|
|
|
|
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), number_format(round($val['check'][6])), |
|
|
|
|
|
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), number_format(round($val['delivery'][6])), |
|
|
|
|
|
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), number_format(round($val['final'][6])), |
|
|
|
|
|
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget'])) |
|
|
|
|
|
]; |
|
|
|
|
|
} else { |
|
|
|
|
|
$facility_exclude_boga_array[$valkey] = [ |
|
|
|
|
|
$value[9], $valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], |
|
|
|
|
|
$val['sign'][0], number_format(round($val['sign'][1])), $val['sign'][2], number_format(round($val['sign'][3])), number_format(round($val['sign'][4])), number_format(round($val['sign'][5])), number_format(round($val['sign'][6])), |
|
|
|
|
|
$val['second'][0], number_format(round($val['second'][1])), $val['second'][2], number_format(round($val['second'][3])), number_format(round($val['second'][4])), number_format(round($val['second'][5])), number_format(round($val['second'][6])), |
|
|
|
|
|
$val['arrive'][0], number_format(round($val['arrive'][1])), $val['arrive'][2], number_format(round($val['arrive'][3])), number_format(round($val['arrive'][4])), number_format(round($val['arrive'][5])), number_format(round($val['arrive'][6])), |
|
|
|
|
|
$val['install'][0], number_format(round($val['install'][1])), $val['install'][2], number_format(round($val['install'][3])), number_format(round($val['install'][4])), number_format(round($val['install'][5])), number_format(round($val['install'][6])), |
|
|
|
|
|
$val['tryrun'][0], number_format(round($val['tryrun'][1])), $val['tryrun'][2], number_format(round($val['tryrun'][3])), number_format(round($val['tryrun'][4])), number_format(round($val['tryrun'][5])), number_format(round($val['tryrun'][6])), |
|
|
|
|
|
$val['check'][0], number_format(round($val['check'][1])), $val['check'][2], number_format(round($val['check'][3])), number_format(round($val['check'][4])), number_format(round($val['check'][5])), number_format(round($val['check'][6])), |
|
|
|
|
|
$val['delivery'][0], number_format(round($val['delivery'][1])), $val['delivery'][2], number_format(round($val['delivery'][3])), number_format(round($val['delivery'][4])), number_format(round($val['delivery'][5])), number_format(round($val['delivery'][6])), |
|
|
|
|
|
$val['final'][0], number_format(round($val['final'][1])), $val['final'][2], number_format(round($val['final'][3])), number_format(round($val['final'][4])), number_format(round($val['final'][5])), number_format(round($val['final'][6])), |
|
|
|
|
|
str_replace('<br>', '; ', $val['status']), number_format(round($val['A40001'])), number_format(round($val['A40008'])), number_format(round($val['total_budget'])), number_format(round($val['receivable_budget'])) |
|
|
|
|
|
]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -1727,23 +2237,6 @@ include "./footer.php"; |
|
|
})); |
|
|
})); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function sendData(BillNo) { |
|
|
|
|
|
var BillData = <?= $data ?>; |
|
|
|
|
|
var Bill = BillData[BillNo]; |
|
|
|
|
|
var form = document.createElement("form"); |
|
|
|
|
|
form.method = 'POST'; |
|
|
|
|
|
form.action = "account-receivable-check.php?<?= $token_link ?>"; |
|
|
|
|
|
var input = document.createElement("input"); |
|
|
|
|
|
input.type = "hidden"; |
|
|
|
|
|
input.name = "Bill"; |
|
|
|
|
|
input.value = JSON.stringify(Bill); |
|
|
|
|
|
form.appendChild(input); |
|
|
|
|
|
document.body.appendChild(form); |
|
|
|
|
|
form.submit(); |
|
|
|
|
|
} |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<?php |
|
|
<?php |
|
|