|
|
@ -613,7 +613,7 @@ foreach ($query_invoice as $invoice) { |
|
|
|
//未在T8的收款資料 |
|
|
|
$sql_wms = "SELECT * FROM account_received WHERE type='M' AND BillNo IN $str_numbers"; |
|
|
|
$query_wms = mysqli_query($link, $sql_wms); |
|
|
|
foreach($query_wms as $wms){ |
|
|
|
foreach ($query_wms as $wms) { |
|
|
|
if (isset($arrayData[$wms['BillNo']]) && isset($arrayData[$wms['BillNo']]['invoice_budget'])) { |
|
|
|
$arrayData[$wms['BillNo']]['invoice_budget'] += $wms['invoice_budget']; |
|
|
|
} |
|
|
@ -756,6 +756,7 @@ $average_contract_facility = $sum_facility / $sum_contract; |
|
|
|
// 21 訂金名稱; 22 訂金金額; 23 應收金額; 24 已開發票金額; 25 已收金額; 26 催收金額; 27 催收次數; |
|
|
|
// 28 二次款名稱; 29 二次款金額; 30 應收金額; 31 已開發票金額; 32 已收金額; 33 催收金額; 34 催收次數; |
|
|
|
$excel_contract_array = array(); |
|
|
|
$excel_contract_all_array = array(); |
|
|
|
$excel_contract_boga_array = array(); |
|
|
|
$excel_contract_noboga_array = array(); |
|
|
|
|
|
|
@ -786,59 +787,38 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][20] = (isset($value['facility_status']) && !is_null($value['facility_status'])) ? $value['facility_status'] : '--'; |
|
|
|
$excel_contract_array[$key][14] = number_format(round($excel_contract_array[$key][14])); |
|
|
|
$excel_contract_array[$key][16] = number_format(round($excel_contract_array[$key][16])); |
|
|
|
if (isset($value['PayStage']) && is_iterable($value['PayStage'])) { |
|
|
|
if ($excel_contract_array[$key][17] > 1 && isset($value['PayStage']) && is_iterable($value['PayStage'])) { |
|
|
|
$excel_contract_all_array[$key] = array_fill(0, 24, 0); |
|
|
|
$excel_contract_all_array[$key][0] = $excel_contract_array[$key][0]; |
|
|
|
$excel_contract_all_array[$key][1] = $excel_contract_array[$key][3]; |
|
|
|
$excel_contract_all_array[$key][2] = $excel_contract_array[$key][8]; |
|
|
|
$excel_contract_all_array[$key][3] = $excel_contract_array[$key][11]; |
|
|
|
$excel_contract_all_array[$key][4] = $excel_contract_array[$key][19]; |
|
|
|
$excel_contract_all_array[$key][5] = $excel_contract_array[$key][20]; |
|
|
|
$excel_contract_all_array[$key][6] = $excel_contract_array[$key][17]; |
|
|
|
$excel_contract_all_array[$key][7] = $excel_contract_array[$key][18]; |
|
|
|
$isBoga = 0; |
|
|
|
if (stristr($value['PayStage'][1]['PayStage'], '寶佳')) { |
|
|
|
$isBoga = 1; |
|
|
|
$excel_contract_boga_array[$key] = array_fill(0, 76, ''); |
|
|
|
$excel_contract_boga_array[$key][0] = (isset($value['BillNo']) && !is_null($value['BillNo'])) ? $value['BillNo'] : ''; |
|
|
|
$excel_contract_boga_array[$key][1] = (isset($value['BillDate']) && !is_null($value['BillDate'])) ? $value['BillDate'] : ''; |
|
|
|
$excel_contract_boga_array[$key][2] = (isset($value['CustomerId']) && !is_null($value['CustomerId'])) ? $value['CustomerId'] : ''; |
|
|
|
$excel_contract_boga_array[$key][3] = (isset($value['CustomerName']) && !is_null($value['CustomerName'])) ? $value['CustomerName'] : ''; |
|
|
|
$excel_contract_boga_array[$key][4] = (isset($value['CustomerAddress']) && !is_null($value['CustomerAddress'])) ? $value['CustomerAddress'] : ''; |
|
|
|
$excel_contract_boga_array[$key][5] = (isset($value['DeptId']) && !is_null($value['DeptId'])) ? $value['DeptId'] : ''; |
|
|
|
$excel_contract_boga_array[$key][6] = (isset($value['DeptName']) && !is_null($value['DeptName'])) ? $value['DeptName'] : ''; |
|
|
|
$excel_contract_boga_array[$key][7] = (isset($value['PersonId']) && !is_null($value['PersonId'])) ? $value['PersonId'] : ''; |
|
|
|
$excel_contract_boga_array[$key][8] = (isset($value['PersonName']) && !is_null($value['PersonName'])) ? $value['PersonName'] : ''; |
|
|
|
$excel_contract_boga_array[$key][9] = (isset($value['ManagerId']) && !is_null($value['ManagerId'])) ? $value['ManagerId'] : ''; |
|
|
|
$excel_contract_boga_array[$key][10] = (isset($value['ManagerName']) && !is_null($value['ManagerName'])) ? $value['ManagerName'] : ''; |
|
|
|
$excel_contract_boga_array[$key][11] = (isset($value['OAmountWithTax']) && !is_null($value['OAmountWithTax'])) ? number_format(round($value['OAmountWithTax'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][12] = (isset($value['A40001']) && !is_null($value['A40001'])) ? number_format(round($value['A40001'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][13] = (isset($value['A40008']) && !is_null($value['A40008'])) ? number_format(round($value['A40008'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][14] = (isset($value['receivable_budget']) && !is_null($value['receivable_budget'])) ? $value['receivable_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][15] = (isset($value['invoice_budget']) && !is_null($value['invoice_budget'])) ? number_format(round($value['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][16] = (isset($value['received_budget']) && !is_null($value['received_budget'])) ? $value['received_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][17] = number_format(round($excel_contract_boga_array[$key][14] - $excel_contract_boga_array[$key][16])); |
|
|
|
$excel_contract_boga_array[$key][18] = (isset($value['collect_month']) && !is_null($value['collect_month'])) ? number_format(round($value['collect_month'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][19] = (isset($value['facility_num']) && !is_null($value['facility_num'])) ? number_format(round($value['facility_num'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][20] = (isset($value['facility_status']) && !is_null($value['facility_status'])) ? $value['facility_status'] : '--'; |
|
|
|
$excel_contract_boga_array[$key][14] = number_format(round($excel_contract_boga_array[$key][14])); |
|
|
|
$excel_contract_boga_array[$key][16] = number_format(round($excel_contract_boga_array[$key][16])); |
|
|
|
$excel_contract_boga_array[$key] = array_fill(0, 24, ''); |
|
|
|
$excel_contract_boga_array[$key][0] = $excel_contract_array[$key][0]; |
|
|
|
$excel_contract_boga_array[$key][1] = $excel_contract_array[$key][3]; |
|
|
|
$excel_contract_boga_array[$key][2] = $excel_contract_array[$key][8]; |
|
|
|
$excel_contract_boga_array[$key][3] = $excel_contract_array[$key][11]; |
|
|
|
$excel_contract_boga_array[$key][4] = $excel_contract_array[$key][19]; |
|
|
|
$excel_contract_boga_array[$key][5] = $excel_contract_array[$key][20]; |
|
|
|
$excel_contract_boga_array[$key][6] = $excel_contract_array[$key][17]; |
|
|
|
$excel_contract_boga_array[$key][7] = $excel_contract_array[$key][18]; |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key] = array_fill(0, 76, ''); |
|
|
|
$excel_contract_noboga_array[$key][0] = (isset($value['BillNo']) && !is_null($value['BillNo'])) ? $value['BillNo'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][1] = (isset($value['BillDate']) && !is_null($value['BillDate'])) ? $value['BillDate'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][2] = (isset($value['CustomerId']) && !is_null($value['CustomerId'])) ? $value['CustomerId'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][3] = (isset($value['CustomerName']) && !is_null($value['CustomerName'])) ? $value['CustomerName'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][4] = (isset($value['CustomerAddress']) && !is_null($value['CustomerAddress'])) ? $value['CustomerAddress'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][5] = (isset($value['DeptId']) && !is_null($value['DeptId'])) ? $value['DeptId'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][6] = (isset($value['DeptName']) && !is_null($value['DeptName'])) ? $value['DeptName'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][7] = (isset($value['PersonId']) && !is_null($value['PersonId'])) ? $value['PersonId'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][8] = (isset($value['PersonName']) && !is_null($value['PersonName'])) ? $value['PersonName'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][9] = (isset($value['ManagerId']) && !is_null($value['ManagerId'])) ? $value['ManagerId'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][10] = (isset($value['ManagerName']) && !is_null($value['ManagerName'])) ? $value['ManagerName'] : ''; |
|
|
|
$excel_contract_noboga_array[$key][11] = (isset($value['OAmountWithTax']) && !is_null($value['OAmountWithTax'])) ? number_format(round($value['OAmountWithTax'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][12] = (isset($value['A40001']) && !is_null($value['A40001'])) ? number_format(round($value['A40001'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][13] = (isset($value['A40008']) && !is_null($value['A40008'])) ? number_format(round($value['A40008'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][14] = (isset($value['receivable_budget']) && !is_null($value['receivable_budget'])) ? $value['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][15] = (isset($value['invoice_budget']) && !is_null($value['invoice_budget'])) ? number_format(round($value['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][16] = (isset($value['received_budget']) && !is_null($value['received_budget'])) ? $value['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][17] = number_format(round($excel_contract_noboga_array[$key][14] - $excel_contract_noboga_array[$key][16])); |
|
|
|
$excel_contract_noboga_array[$key][18] = (isset($value['collect_month']) && !is_null($value['collect_month'])) ? number_format(round($value['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][19] = (isset($value['facility_num']) && !is_null($value['facility_num'])) ? number_format(round($value['facility_num'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][20] = (isset($value['facility_status']) && !is_null($value['facility_status'])) ? $value['facility_status'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][14] = number_format(round($excel_contract_noboga_array[$key][14])); |
|
|
|
$excel_contract_noboga_array[$key][16] = number_format(round($excel_contract_noboga_array[$key][16])); |
|
|
|
$excel_contract_noboga_array[$key] = array_fill(0, 24, ''); |
|
|
|
$excel_contract_noboga_array[$key][0] = $excel_contract_array[$key][0]; |
|
|
|
$excel_contract_noboga_array[$key][1] = $excel_contract_array[$key][3]; |
|
|
|
$excel_contract_noboga_array[$key][2] = $excel_contract_array[$key][8]; |
|
|
|
$excel_contract_noboga_array[$key][3] = $excel_contract_array[$key][11]; |
|
|
|
$excel_contract_noboga_array[$key][4] = $excel_contract_array[$key][19]; |
|
|
|
$excel_contract_noboga_array[$key][5] = $excel_contract_array[$key][20]; |
|
|
|
$excel_contract_noboga_array[$key][6] = $excel_contract_array[$key][17]; |
|
|
|
$excel_contract_noboga_array[$key][7] = $excel_contract_array[$key][18]; |
|
|
|
} |
|
|
|
foreach ($value['PayStage'] as $paykey => $payvalue) { |
|
|
|
switch ($payvalue['stage']) { |
|
|
@ -850,29 +830,21 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][25] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][26] = number_format(round($excel_contract_array[$key][23] - $excel_contract_array[$key][25])); |
|
|
|
$excel_contract_array[$key][27] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][8] = number_format(round($excel_contract_array[$key][23] - $excel_contract_array[$key][25])); |
|
|
|
$excel_contract_all_array[$key][9] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][8] = $excel_contract_all_array[$key][8]; |
|
|
|
$excel_contract_boga_array[$key][9] = $excel_contract_all_array[$key][9]; |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][8] = $excel_contract_all_array[$key][8]; |
|
|
|
$excel_contract_noboga_array[$key][9] = $excel_contract_all_array[$key][9]; |
|
|
|
} |
|
|
|
} |
|
|
|
$excel_contract_array[$key][23] = number_format(round($excel_contract_array[$key][23])); |
|
|
|
$excel_contract_array[$key][25] = number_format(round($excel_contract_array[$key][25])); |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][21] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_boga_array[$key][22] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][23] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][24] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][25] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][26] = number_format(round($excel_contract_boga_array[$key][23] - $excel_contract_boga_array[$key][25])); |
|
|
|
$excel_contract_boga_array[$key][27] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][23] = number_format(round($excel_contract_boga_array[$key][23])); |
|
|
|
$excel_contract_boga_array[$key][25] = number_format(round($excel_contract_boga_array[$key][25])); |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][21] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][22] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][23] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][24] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][25] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][26] = number_format(round($excel_contract_noboga_array[$key][23] - $excel_contract_noboga_array[$key][25])); |
|
|
|
$excel_contract_noboga_array[$key][27] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][23] = number_format(round($excel_contract_noboga_array[$key][23])); |
|
|
|
$excel_contract_noboga_array[$key][25] = number_format(round($excel_contract_noboga_array[$key][25])); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
case "二次款": |
|
|
|
$excel_contract_array[$key][28] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
@ -882,30 +854,22 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][32] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][33] = number_format(round($excel_contract_array[$key][30] - $excel_contract_array[$key][32])); |
|
|
|
$excel_contract_array[$key][34] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][10] = number_format(round($excel_contract_array[$key][30] - $excel_contract_array[$key][32])); |
|
|
|
$excel_contract_all_array[$key][11] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][10] = $excel_contract_all_array[$key][10]; |
|
|
|
$excel_contract_boga_array[$key][11] = $excel_contract_all_array[$key][11]; |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][10] = $excel_contract_all_array[$key][10]; |
|
|
|
$excel_contract_noboga_array[$key][11] = $excel_contract_all_array[$key][11]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$excel_contract_array[$key][30] = number_format(round($excel_contract_array[$key][30])); |
|
|
|
$excel_contract_array[$key][32] = number_format(round($excel_contract_array[$key][32])); |
|
|
|
|
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][28] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_boga_array[$key][29] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][30] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][31] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][32] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][33] = number_format(round($excel_contract_boga_array[$key][30] - $excel_contract_boga_array[$key][32])); |
|
|
|
$excel_contract_boga_array[$key][34] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][30] = number_format(round($excel_contract_boga_array[$key][30])); |
|
|
|
$excel_contract_boga_array[$key][32] = number_format(round($excel_contract_boga_array[$key][32])); |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][28] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][29] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][30] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][31] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][32] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][33] = number_format(round($excel_contract_noboga_array[$key][30] - $excel_contract_noboga_array[$key][32])); |
|
|
|
$excel_contract_noboga_array[$key][34] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][30] = number_format(round($excel_contract_noboga_array[$key][30])); |
|
|
|
$excel_contract_noboga_array[$key][32] = number_format(round($excel_contract_noboga_array[$key][32])); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
case "貨抵工地款": |
|
|
|
$excel_contract_array[$key][35] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
@ -915,29 +879,20 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][39] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][40] = number_format(round($excel_contract_array[$key][37] - $excel_contract_array[$key][39])); |
|
|
|
$excel_contract_array[$key][41] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][12] = number_format(round($excel_contract_array[$key][37] - $excel_contract_array[$key][39])); |
|
|
|
$excel_contract_all_array[$key][13] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][12] = $excel_contract_all_array[$key][12]; |
|
|
|
$excel_contract_boga_array[$key][13] = $excel_contract_all_array[$key][13]; |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][12] = $excel_contract_all_array[$key][12]; |
|
|
|
$excel_contract_noboga_array[$key][13] = $excel_contract_all_array[$key][13]; |
|
|
|
} |
|
|
|
} |
|
|
|
$excel_contract_array[$key][37] = number_format(round($excel_contract_array[$key][37])); |
|
|
|
$excel_contract_array[$key][39] = number_format(round($excel_contract_array[$key][39])); |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][35] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_boga_array[$key][36] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][37] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][38] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][39] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][40] = number_format(round($excel_contract_boga_array[$key][37] - $excel_contract_boga_array[$key][39])); |
|
|
|
$excel_contract_boga_array[$key][41] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][37] = number_format(round($excel_contract_boga_array[$key][37])); |
|
|
|
$excel_contract_boga_array[$key][39] = number_format(round($excel_contract_boga_array[$key][39])); |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][35] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][36] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][37] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][38] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][39] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][40] = number_format(round($excel_contract_noboga_array[$key][37] - $excel_contract_noboga_array[$key][39])); |
|
|
|
$excel_contract_noboga_array[$key][41] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][37] = number_format(round($excel_contract_noboga_array[$key][37])); |
|
|
|
$excel_contract_noboga_array[$key][39] = number_format(round($excel_contract_noboga_array[$key][39])); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
case "安裝款": |
|
|
|
$excel_contract_array[$key][42] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
@ -947,18 +902,14 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][46] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][47] = number_format(round($excel_contract_array[$key][44] - $excel_contract_array[$key][46])); |
|
|
|
$excel_contract_array[$key][48] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][14] = number_format(round($excel_contract_array[$key][44] - $excel_contract_array[$key][46])); |
|
|
|
$excel_contract_all_array[$key][15] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][14] = $excel_contract_all_array[$key][14]; |
|
|
|
$excel_contract_noboga_array[$key][15] = $excel_contract_all_array[$key][15]; |
|
|
|
} |
|
|
|
$excel_contract_array[$key][44] = number_format(round($excel_contract_array[$key][44])); |
|
|
|
$excel_contract_array[$key][46] = number_format(round($excel_contract_array[$key][46])); |
|
|
|
|
|
|
|
$excel_contract_noboga_array[$key][42] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][43] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][44] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][45] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][46] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][47] = number_format(round($excel_contract_noboga_array[$key][44] - $excel_contract_noboga_array[$key][46])); |
|
|
|
$excel_contract_noboga_array[$key][48] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][44] = number_format(round($excel_contract_noboga_array[$key][44])); |
|
|
|
$excel_contract_noboga_array[$key][46] = number_format(round($excel_contract_noboga_array[$key][46])); |
|
|
|
break; |
|
|
|
case "試車款": |
|
|
|
$excel_contract_array[$key][49] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
@ -968,29 +919,20 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][53] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][54] = number_format(round($excel_contract_array[$key][51] - $excel_contract_array[$key][53])); |
|
|
|
$excel_contract_array[$key][55] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][16] = number_format(round($excel_contract_array[$key][51] - $excel_contract_array[$key][53])); |
|
|
|
$excel_contract_all_array[$key][17] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][16] = $excel_contract_all_array[$key][16]; |
|
|
|
$excel_contract_boga_array[$key][17] = $excel_contract_all_array[$key][17]; |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][16] = $excel_contract_all_array[$key][16]; |
|
|
|
$excel_contract_noboga_array[$key][17] = $excel_contract_all_array[$key][17]; |
|
|
|
} |
|
|
|
} |
|
|
|
$excel_contract_array[$key][51] = number_format(round($excel_contract_array[$key][51])); |
|
|
|
$excel_contract_array[$key][53] = number_format(round($excel_contract_array[$key][53])); |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][49] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_boga_array[$key][50] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][51] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][52] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][53] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][54] = number_format(round($excel_contract_boga_array[$key][51] - $excel_contract_boga_array[$key][53])); |
|
|
|
$excel_contract_boga_array[$key][55] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][51] = number_format(round($excel_contract_boga_array[$key][51])); |
|
|
|
$excel_contract_boga_array[$key][53] = number_format(round($excel_contract_boga_array[$key][53])); |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][49] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][50] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][51] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][52] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][53] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][54] = number_format(round($excel_contract_noboga_array[$key][51] - $excel_contract_noboga_array[$key][53])); |
|
|
|
$excel_contract_noboga_array[$key][55] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][51] = number_format(round($excel_contract_noboga_array[$key][51])); |
|
|
|
$excel_contract_noboga_array[$key][53] = number_format(round($excel_contract_noboga_array[$key][53])); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
case "官檢驗收款": |
|
|
|
$excel_contract_array[$key][56] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
@ -1000,18 +942,16 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][60] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][61] = number_format(round($excel_contract_array[$key][58] - $excel_contract_array[$key][60])); |
|
|
|
$excel_contract_array[$key][62] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][18] = number_format(round($excel_contract_array[$key][58] - $excel_contract_array[$key][60])); |
|
|
|
$excel_contract_all_array[$key][19] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
|
|
$excel_contract_noboga_array[$key][18] = $excel_contract_all_array[$key][18]; |
|
|
|
$excel_contract_noboga_array[$key][19] = $excel_contract_all_array[$key][19]; |
|
|
|
} |
|
|
|
$excel_contract_array[$key][58] = number_format(round($excel_contract_array[$key][58])); |
|
|
|
$excel_contract_array[$key][60] = number_format(round($excel_contract_array[$key][60])); |
|
|
|
|
|
|
|
$excel_contract_noboga_array[$key][56] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][57] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][58] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][59] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][60] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][61] = number_format(round($excel_contract_noboga_array[$key][58] - $excel_contract_noboga_array[$key][60])); |
|
|
|
$excel_contract_noboga_array[$key][62] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][58] = number_format(round($excel_contract_noboga_array[$key][58])); |
|
|
|
$excel_contract_noboga_array[$key][60] = number_format(round($excel_contract_noboga_array[$key][60])); |
|
|
|
break; |
|
|
|
case "交車款": |
|
|
|
$excel_contract_array[$key][63] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
@ -1021,18 +961,15 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][67] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][68] = number_format(round($excel_contract_array[$key][65] - $excel_contract_array[$key][67])); |
|
|
|
$excel_contract_array[$key][69] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][20] = number_format(round($excel_contract_array[$key][65] - $excel_contract_array[$key][67])); |
|
|
|
$excel_contract_all_array[$key][21] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][20] = $excel_contract_all_array[$key][20]; |
|
|
|
$excel_contract_noboga_array[$key][21] = $excel_contract_all_array[$key][21]; |
|
|
|
} |
|
|
|
$excel_contract_array[$key][65] = number_format(round($excel_contract_array[$key][65])); |
|
|
|
$excel_contract_array[$key][67] = number_format(round($excel_contract_array[$key][67])); |
|
|
|
|
|
|
|
$excel_contract_noboga_array[$key][63] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][64] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][65] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][66] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][67] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][68] = number_format(round($excel_contract_noboga_array[$key][65] - $excel_contract_noboga_array[$key][67])); |
|
|
|
$excel_contract_noboga_array[$key][69] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][65] = number_format(round($excel_contract_noboga_array[$key][65])); |
|
|
|
$excel_contract_noboga_array[$key][67] = number_format(round($excel_contract_noboga_array[$key][67])); |
|
|
|
break; |
|
|
|
case "尾款": |
|
|
|
$excel_contract_array[$key][70] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
@ -1042,29 +979,20 @@ foreach ($arrayData as $key => $value) { |
|
|
|
$excel_contract_array[$key][74] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_array[$key][75] = number_format(round($excel_contract_array[$key][72] - $excel_contract_array[$key][74])); |
|
|
|
$excel_contract_array[$key][76] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if (isset($excel_contract_all_array[$key])) { |
|
|
|
$excel_contract_all_array[$key][22] = number_format(round($excel_contract_array[$key][72] - $excel_contract_array[$key][74])); |
|
|
|
$excel_contract_all_array[$key][23] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][22] = $excel_contract_all_array[$key][22]; |
|
|
|
$excel_contract_boga_array[$key][23] = $excel_contract_all_array[$key][23]; |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][22] = $excel_contract_all_array[$key][22]; |
|
|
|
$excel_contract_noboga_array[$key][23] = $excel_contract_all_array[$key][23]; |
|
|
|
} |
|
|
|
} |
|
|
|
$excel_contract_array[$key][72] = number_format(round($excel_contract_array[$key][72])); |
|
|
|
$excel_contract_array[$key][74] = number_format(round($excel_contract_array[$key][74])); |
|
|
|
if ($isBoga == 1) { |
|
|
|
$excel_contract_boga_array[$key][70] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_boga_array[$key][71] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][72] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][73] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][74] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_boga_array[$key][75] = number_format(round($excel_contract_boga_array[$key][72] - $excel_contract_boga_array[$key][74])); |
|
|
|
$excel_contract_boga_array[$key][76] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_boga_array[$key][72] = number_format(round($excel_contract_boga_array[$key][72])); |
|
|
|
$excel_contract_boga_array[$key][74] = number_format(round($excel_contract_boga_array[$key][74])); |
|
|
|
} else { |
|
|
|
$excel_contract_noboga_array[$key][70] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
|
$excel_contract_noboga_array[$key][71] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][72] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][73] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][74] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
|
$excel_contract_noboga_array[$key][75] = number_format(round($excel_contract_noboga_array[$key][72] - $excel_contract_noboga_array[$key][74])); |
|
|
|
$excel_contract_noboga_array[$key][76] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
$excel_contract_noboga_array[$key][72] = number_format(round($excel_contract_noboga_array[$key][72])); |
|
|
|
$excel_contract_noboga_array[$key][74] = number_format(round($excel_contract_noboga_array[$key][74])); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -1085,36 +1013,8 @@ foreach ($arrayData as $key => $value) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// $excel_contract_noboga_array[$key] = array_fill(0, 76, ''); |
|
|
|
// $excel_contract_noboga_array[$key][0] = (isset($value['BillNo']) && !is_null($value['BillNo'])) ? $value['BillNo'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][1] = (isset($value['BillDate']) && !is_null($value['BillDate'])) ? $value['BillDate'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][2] = (isset($value['CustomerId']) && !is_null($value['CustomerId'])) ? $value['CustomerId'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][3] = (isset($value['CustomerName']) && !is_null($value['CustomerName'])) ? $value['CustomerName'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][4] = (isset($value['CustomerAddress']) && !is_null($value['CustomerAddress'])) ? $value['CustomerAddress'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][5] = (isset($value['DeptId']) && !is_null($value['DeptId'])) ? $value['DeptId'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][6] = (isset($value['DeptName']) && !is_null($value['DeptName'])) ? $value['DeptName'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][7] = (isset($value['PersonId']) && !is_null($value['PersonId'])) ? $value['PersonId'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][8] = (isset($value['PersonName']) && !is_null($value['PersonName'])) ? $value['PersonName'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][9] = (isset($value['ManagerId']) && !is_null($value['ManagerId'])) ? $value['ManagerId'] : ''; |
|
|
|
// $excel_contract_noboga_array[$key][10] = (isset($value['ManagerName']) && !is |
|
|
|
// foreach ($arrayData as $key => $value) { |
|
|
|
// echo $key . "<br>"; |
|
|
|
// foreach ($value as $k => $v) { |
|
|
|
// if ($k == 'facility') { |
|
|
|
// foreach ($v as $fkey => $fvalue) { |
|
|
|
// echo $fkey . "<br>"; |
|
|
|
// print_r($fvalue); |
|
|
|
// echo "<br><br>"; |
|
|
|
// } |
|
|
|
// } |
|
|
|
// // echo $k . "<br>"; |
|
|
|
// // print_r($v); |
|
|
|
// // echo "<br><br>"; |
|
|
|
// } |
|
|
|
// exit(); |
|
|
|
// } |
|
|
|
|
|
|
|
$total_data = json_encode($excel_contract_array); |
|
|
|
$total_data = json_encode($excel_contract_all_array); |
|
|
|
$boga_data = json_encode($excel_contract_boga_array); |
|
|
|
$noboga_data = json_encode($excel_contract_noboga_array); |
|
|
|
?> |
|
|
@ -1210,6 +1110,31 @@ $noboga_data = json_encode($excel_contract_noboga_array); |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
<form class="form-horizontal" id='myForm' method='post' action='account-receivable-new-index.php?<?= $token_link ?>'> |
|
|
|
<table class="table table-striped table-bordered" style='width:98%;text-align:center;margin:0 auto'> |
|
|
|
<tbody> |
|
|
|
<tr> |
|
|
|
<th class="text-center" style="vertical-align: middle;">合約日期</th> |
|
|
|
<td colspan="2"> |
|
|
|
<input type="date" class='form-control' id='date_start' name='date_start' style='width:40%;display:inline;'> |
|
|
|
~ |
|
|
|
<input type="date" class='form-control' id='date_end' name='date_end' style='width:40%;display:inline;'> |
|
|
|
<button type="submit" class="btn btn-primary btn-sm">搜尋</button> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<th class="text-center" style="vertical-align: middle;">合約催收次數</th> |
|
|
|
<td colspan="2"> |
|
|
|
<input type="text" class='form-control' id='collect_time_start' name='collect_time_start' style='width:10%;display:inline;' oninput="searchFront('collect_time_start')"> |
|
|
|
≤ 催收次數 ≤ |
|
|
|
<input type="text" class='form-control' id='collect_time_end' name='collect_time_end' style='width:10%;display:inline;'> |
|
|
|
<!-- <button type="submit" class="btn btn-primary btn-sm">搜尋</button> --> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
|
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
|
|
|
|
<?php |
|
|
@ -1223,7 +1148,7 @@ include "./footer.php"; |
|
|
|
<tr> |
|
|
|
<th style="width: 120px;">合約號</th> |
|
|
|
<th style="width: 120px;">部門</th> |
|
|
|
<th style="width: 120px;">經理</th> |
|
|
|
<th style="width: 120px;">主管</th> |
|
|
|
<th style="width: 120px;">營業員</th> |
|
|
|
<th style="width: 180px;">客戶</th> |
|
|
|
|
|
|
@ -1235,8 +1160,8 @@ include "./footer.php"; |
|
|
|
<th style="width: 150px;">已開發票金額</th> |
|
|
|
<th style="width: 150px;">已收金額金額</th> |
|
|
|
<th style="width: 150px;">催收金額金額</th> |
|
|
|
<th style="width: 150px;">催收次數</th> |
|
|
|
<th style="width: 150px;">作番數量</th> |
|
|
|
<th style="width: 100px;">催收次數</th> |
|
|
|
<th style="width: 100px;">作番數量</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">訂金 <br>名稱</th> |
|
|
|
<th style="width: 120px;">訂金<br>合約金額</th> |
|
|
@ -1244,7 +1169,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">訂金<br>已開金額</th> |
|
|
|
<th style="width: 120px;">訂金<br>已收金額</th> |
|
|
|
<th style="width: 120px;">訂金<br>催收金額</th> |
|
|
|
<th style="width: 120px;">訂金<br>催收次數</th> |
|
|
|
<th style="width: 100px;">訂金<br>催收次數</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">二次款 <br>名稱</th> |
|
|
|
<th style="width: 120px;">二次款<br>合約金額</th> |
|
|
@ -1252,7 +1177,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">二次款<br>已開金額</th> |
|
|
|
<th style="width: 120px;">二次款<br>已收金額</th> |
|
|
|
<th style="width: 120px;">二次款<br>催收金額</th> |
|
|
|
<th style="width: 120px;">二次款<br>催收次數</th> |
|
|
|
<th style="width: 100px;">二次款<br>催收次數</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">貨抵工地款 <br>名稱</th> |
|
|
|
<th style="width: 120px;">貨抵工地款<br>合約金額</th> |
|
|
@ -1260,7 +1185,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">貨抵工地款<br>已開金額</th> |
|
|
|
<th style="width: 120px;">貨抵工地款<br>已收金額</th> |
|
|
|
<th style="width: 120px;">貨抵工地款<br>催收金額</th> |
|
|
|
<th style="width: 120px;">貨抵工地款<br>催收次數</th> |
|
|
|
<th style="width: 100px;">貨抵工地款<br>催收次數</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">安裝款 <br>名稱</th> |
|
|
|
<th style="width: 120px;">安裝款<br>合約金額</th> |
|
|
@ -1268,7 +1193,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">安裝款<br>已開金額</th> |
|
|
|
<th style="width: 120px;">安裝款<br>已收金額</th> |
|
|
|
<th style="width: 120px;">安裝款<br>催收金額</th> |
|
|
|
<th style="width: 120px;">安裝款<br>催收次數</th> |
|
|
|
<th style="width: 100px;">安裝款<br>催收次數</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">試車款 <br>名稱</th> |
|
|
|
<th style="width: 120px;">試車款<br>合約金額</th> |
|
|
@ -1276,7 +1201,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">試車款<br>已開金額</th> |
|
|
|
<th style="width: 120px;">試車款<br>已收金額</th> |
|
|
|
<th style="width: 120px;">試車款<br>催收金額</th> |
|
|
|
<th style="width: 120px;">試車款<br>催收次數</th> |
|
|
|
<th style="width: 100px;">試車款<br>催收次數</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">官檢驗收款 <br>名稱</th> |
|
|
|
<th style="width: 120px;">官檢驗收款<br>合約金額</th> |
|
|
@ -1284,7 +1209,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">官檢驗收款<br>已開金額</th> |
|
|
|
<th style="width: 120px;">官檢驗收款<br>已收金額</th> |
|
|
|
<th style="width: 120px;">官檢驗收款<br>催收金額</th> |
|
|
|
<th style="width: 120px;">官檢驗收款<br>催收次數</th> |
|
|
|
<th style="width: 100px;">官檢驗收款<br>催收次數</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">交車款 <br>名稱</th> |
|
|
|
<th style="width: 120px;">交車款<br>合約金額</th> |
|
|
@ -1292,7 +1217,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">交車款<br>已開金額</th> |
|
|
|
<th style="width: 120px;">交車款<br>已收金額</th> |
|
|
|
<th style="width: 120px;">交車款<br>催收金額</th> |
|
|
|
<th style="width: 120px;">交車款<br>催收次數</th> |
|
|
|
<th style="width: 100px;">交車款<br>催收次數</th> |
|
|
|
|
|
|
|
<th style="width: 120px;">尾款 <br>名稱</th> |
|
|
|
<th style="width: 120px;">尾款<br>合約金額</th> |
|
|
@ -1300,7 +1225,7 @@ include "./footer.php"; |
|
|
|
<th style="width: 120px;">尾款<br>已開金額</th> |
|
|
|
<th style="width: 120px;">尾款<br>已收金額</th> |
|
|
|
<th style="width: 120px;">尾款<br>催收金額</th> |
|
|
|
<th style="width: 120px;">尾款<br>催收次數</th> |
|
|
|
<th style="width: 100px;">尾款<br>催收次數</th> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|