|
@ -123,6 +123,7 @@ if ((in_array($user_id, array('M0060', 'M0175'))) || (in_array(accountidToDepart |
|
|
$sql_all_contract .= ")"; |
|
|
$sql_all_contract .= ")"; |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
$sql_all_contract .= " ORDER BY MainAll.PersonId ASC "; |
|
|
$str_numbers = ""; |
|
|
$str_numbers = ""; |
|
|
$query_all_contract = $conn->query($sql_all_contract); |
|
|
$query_all_contract = $conn->query($sql_all_contract); |
|
|
if (is_iterable($query_all_contract)) { |
|
|
if (is_iterable($query_all_contract)) { |
|
@ -326,11 +327,11 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case '寶佳出貨前30天': |
|
|
case '寶佳出貨前30天': |
|
|
$payvalue['stage'] = '訂金'; |
|
|
$payvalue['stage'] = '訂金'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_contract_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -340,7 +341,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case '寶佳出貨後10天': |
|
|
case '寶佳出貨後10天': |
|
|
$payvalue['stage'] = '二次款'; |
|
|
$payvalue['stage'] = '二次款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time + (10 * 86400); |
|
|
$signtime = $estimate_time + (10 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -350,7 +351,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case '貨抵工地後90天': |
|
|
case '貨抵工地後90天': |
|
|
$payvalue['stage'] = '貨抵工地款'; |
|
|
$payvalue['stage'] = '貨抵工地款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time + (90 * 86400); |
|
|
$signtime = $estimate_time + (90 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -360,7 +361,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case '安裝試車後90天': |
|
|
case '安裝試車後90天': |
|
|
$payvalue['stage'] = '試車款'; |
|
|
$payvalue['stage'] = '試車款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['tryrun_end_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['tryrun_end_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['tryrun_end_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['tryrun_end_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['tryrun_end_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['tryrun_end_date'])) { |
|
|
$estimate_time = strtotime($wip['tryrun_end_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['tryrun_end_date']); |
|
|
$signtime = $estimate_time + (90 * 86400); |
|
|
$signtime = $estimate_time + (90 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -370,30 +371,41 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case '交車後270天': |
|
|
case '交車後270天': |
|
|
$payvalue['stage'] = '尾款'; |
|
|
$payvalue['stage'] = '尾款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['delivery_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['delivery_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['delivery_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['delivery_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['delivery_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['delivery_date'])) { |
|
|
$estimate_time = strtotime($wip['delivery_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['delivery_date']); |
|
|
$signtime = $estimate_time + (270 * 86400); |
|
|
$signtime = $estimate_time + (270 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
case '交車後180天': |
|
|
|
|
|
$payvalue['stage'] = '尾款'; |
|
|
|
|
|
if ($wip_array[$payvalue['facilityno']]['delivery_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['delivery_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['delivery_date'])) { |
|
|
|
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['delivery_date']); |
|
|
|
|
|
$signtime = $estimate_time + (180 * 86400); |
|
|
|
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
|
|
|
} else { |
|
|
|
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
case (in_array($payvalue['PayStage'], $arrival)): |
|
|
case (in_array($payvalue['PayStage'], $arrival)): |
|
|
$payvalue['stage'] = '貨抵工地款'; |
|
|
$payvalue['stage'] = '貨抵工地款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time + (10 * 86400); |
|
|
$signtime = $estimate_time ; |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
$payvalue['PlanPayDate'] = 'NULL'; |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case '二次款': |
|
|
case '二次款': |
|
|
$payvalue['stage'] = '二次款'; |
|
|
$payvalue['stage'] = '二次款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_contract_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
} else { |
|
|
} else { |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
@ -402,11 +414,11 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '出貨前30') || stristr($payvalue['PayStage'], '簽約(出貨前30天)') || stristr($payvalue['PayStage'], '建照核發時')): |
|
|
case (stristr($payvalue['PayStage'], '出貨前30') || stristr($payvalue['PayStage'], '簽約(出貨前30天)') || stristr($payvalue['PayStage'], '建照核發時')): |
|
|
$payvalue['stage'] = '二次款'; |
|
|
$payvalue['stage'] = '二次款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_contract_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$signtime = $estimate_time - (30 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -416,11 +428,11 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '出貨前60')): |
|
|
case (stristr($payvalue['PayStage'], '出貨前60')): |
|
|
$payvalue['stage'] = '二次款'; |
|
|
$payvalue['stage'] = '二次款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time - (60 * 86400); |
|
|
$signtime = $estimate_time - (60 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_contract_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']); |
|
|
$signtime = $estimate_time - (60 * 86400); |
|
|
$signtime = $estimate_time - (60 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -430,11 +442,11 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '出貨前90')): |
|
|
case (stristr($payvalue['PayStage'], '出貨前90')): |
|
|
$payvalue['stage'] = '二次款'; |
|
|
$payvalue['stage'] = '二次款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time - (90 * 86400); |
|
|
$signtime = $estimate_time - (90 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_contract_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']); |
|
|
$signtime = $estimate_time - (90 * 86400); |
|
|
$signtime = $estimate_time - (90 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -444,11 +456,11 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '出貨前120')): |
|
|
case (stristr($payvalue['PayStage'], '出貨前120')): |
|
|
$payvalue['stage'] = '二次款'; |
|
|
$payvalue['stage'] = '二次款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['real_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_arrival_date']); |
|
|
$signtime = $estimate_time - (120 * 86400); |
|
|
$signtime = $estimate_time - (120 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
} elseif ($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['real_contract_arrival_date'])) { |
|
|
$estimate_time = strtotime($wip['real_contract_arrival_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['real_contract_arrival_date']); |
|
|
$signtime = $estimate_time - (120 * 86400); |
|
|
$signtime = $estimate_time - (120 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $signtime); |
|
|
} else { |
|
|
} else { |
|
@ -493,7 +505,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '試車')): |
|
|
case (stristr($payvalue['PayStage'], '試車')): |
|
|
$payvalue['stage'] = '試車款'; |
|
|
$payvalue['stage'] = '試車款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['tryrun_end_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['tryrun_end_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['tryrun_end_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['tryrun_end_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['tryrun_end_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['tryrun_end_date'])) { |
|
|
$estimate_time = strtotime($wip['tryrun_end_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['tryrun_end_date']); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
} else { |
|
|
} else { |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
@ -502,7 +514,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '安裝') || stristr($payvalue['PayStage'], '貨抵工地且完工')): |
|
|
case (stristr($payvalue['PayStage'], '安裝') || stristr($payvalue['PayStage'], '貨抵工地且完工')): |
|
|
$payvalue['stage'] = '安裝款'; |
|
|
$payvalue['stage'] = '安裝款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['install_end_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['install_end_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['install_end_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['install_end_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['install_end_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['install_end_date'])) { |
|
|
$estimate_time = strtotime($wip['install_end_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['install_end_date']); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
} else { |
|
|
} else { |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
@ -511,7 +523,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (in_array($payvalue['PayStage'], $final6)): |
|
|
case (in_array($payvalue['PayStage'], $final6)): |
|
|
$payvalue['stage'] = '尾款'; |
|
|
$payvalue['stage'] = '尾款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['delivery_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['delivery_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['delivery_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['delivery_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['delivery_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['delivery_date'])) { |
|
|
$estimate_time = strtotime($wip['delivery_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['delivery_date']); |
|
|
$estimate_time = $estimate_time + (180 * 86400); |
|
|
$estimate_time = $estimate_time + (180 * 86400); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
} else { |
|
|
} else { |
|
@ -521,7 +533,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '合格') || stristr($payvalue['PayStage'], '驗收') || stristr($payvalue['PayStage'], '驗收')): |
|
|
case (stristr($payvalue['PayStage'], '合格') || stristr($payvalue['PayStage'], '驗收') || stristr($payvalue['PayStage'], '驗收')): |
|
|
$payvalue['stage'] = '官檢驗收款'; |
|
|
$payvalue['stage'] = '官檢驗收款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['official_check_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['official_check_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['official_check_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['official_check_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['official_check_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['official_check_date'])) { |
|
|
$estimate_time = strtotime($wip['official_check_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['official_check_date']); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
} else { |
|
|
} else { |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
@ -530,7 +542,7 @@ foreach ($PayStage_array as $key => &$value) { |
|
|
case (stristr($payvalue['PayStage'], '交車') || stristr($payvalue['PayStage'], '移交') || stristr($payvalue['PayStage'], '完工') || stristr($payvalue['PayStage'], '許可') || stristr($payvalue['PayStage'], '核可')): |
|
|
case (stristr($payvalue['PayStage'], '交車') || stristr($payvalue['PayStage'], '移交') || stristr($payvalue['PayStage'], '完工') || stristr($payvalue['PayStage'], '許可') || stristr($payvalue['PayStage'], '核可')): |
|
|
$payvalue['stage'] = '交車款'; |
|
|
$payvalue['stage'] = '交車款'; |
|
|
if ($wip_array[$payvalue['facilityno']]['delivery_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['delivery_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['delivery_date'])) { |
|
|
if ($wip_array[$payvalue['facilityno']]['delivery_date'] !== null && strtotime($wip_array[$payvalue['facilityno']]['delivery_date']) > 975686400 && !empty($wip_array[$payvalue['facilityno']]['delivery_date'])) { |
|
|
$estimate_time = strtotime($wip['delivery_date']); |
|
|
$estimate_time = strtotime($wip_array[$payvalue['facilityno']]['delivery_date']); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
$payvalue['PlanPayDate'] = date('Y-m-d', $estimate_time); |
|
|
} else { |
|
|
} else { |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
|
$payvalue['PlanPayDate'] = NULL; |
|
@ -639,7 +651,6 @@ foreach ($final_paystage as $key => &$value) { |
|
|
$collect_month = collect_month(strtotime($value[$sequenceNumber]['PlanPayDate'])); |
|
|
$collect_month = collect_month(strtotime($value[$sequenceNumber]['PlanPayDate'])); |
|
|
if ($today > strtotime($value[$sequenceNumber]['PlanPayDate'])) { |
|
|
if ($today > strtotime($value[$sequenceNumber]['PlanPayDate'])) { |
|
|
$value[$sequenceNumber]['hadtopay'] = 'V'; |
|
|
$value[$sequenceNumber]['hadtopay'] = 'V'; |
|
|
$arrayData[$key]['receivable_budget'] += $value[$sequenceNumber]['PlanPayAmt']; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
$value[$sequenceNumber]['hadtopay'] = '--'; |
|
|
$value[$sequenceNumber]['hadtopay'] = '--'; |
|
|
} |
|
|
} |
|
@ -683,9 +694,14 @@ foreach ($final_paystage as $key => $value) { |
|
|
foreach ($arrayData[$key]['PayStage'] as $arkey => &$arvalue) { |
|
|
foreach ($arrayData[$key]['PayStage'] as $arkey => &$arvalue) { |
|
|
if ($arvalue['PayStage'] == $value[$sequence]['PayStage']) { |
|
|
if ($arvalue['PayStage'] == $value[$sequence]['PayStage']) { |
|
|
if (isset($arvalue['receivable_budget']) && isset($arvalue['received_budget']) && isset($arvalue['invoice_budget'])) { |
|
|
if (isset($arvalue['receivable_budget']) && isset($arvalue['received_budget']) && isset($arvalue['invoice_budget'])) { |
|
|
$arvalue['receivable_budget'] += $value[$sequence]['PlanPayAmt']; |
|
|
|
|
|
$arvalue['received_budget'] += $value[$sequence]['received_budget']; |
|
|
$arvalue['received_budget'] += $value[$sequence]['received_budget']; |
|
|
$arvalue['invoice_budget'] += $value[$sequence]['invoice_budget']; |
|
|
$arvalue['invoice_budget'] += $value[$sequence]['invoice_budget']; |
|
|
|
|
|
if ($value[$sequence]['hadtopay'] == 'V') { |
|
|
|
|
|
$arvalue['receivable_budget'] += $value[$sequence]['PlanPayAmt']; |
|
|
|
|
|
$arrayData[$key]['receivable_budget'] += $value[$sequence]['PlanPayAmt']; |
|
|
|
|
|
} else { |
|
|
|
|
|
$arvalue['receivable_budget'] = 0; |
|
|
|
|
|
} |
|
|
if ($arvalue['collect_month'] < $value[$sequence]['collect_month']) { |
|
|
if ($arvalue['collect_month'] < $value[$sequence]['collect_month']) { |
|
|
$arvalue['collect_month'] = $value[$sequence]['collect_month']; |
|
|
$arvalue['collect_month'] = $value[$sequence]['collect_month']; |
|
|
} |
|
|
} |
|
@ -694,7 +710,12 @@ foreach ($final_paystage as $key => $value) { |
|
|
$sum_invoice_budget += $value[$sequence]['invoice_budget']; |
|
|
$sum_invoice_budget += $value[$sequence]['invoice_budget']; |
|
|
} else { |
|
|
} else { |
|
|
$arvalue['stage'] = $value[$sequence]['stage']; |
|
|
$arvalue['stage'] = $value[$sequence]['stage']; |
|
|
|
|
|
if ($value[$sequence]['hadtopay'] == 'V') { |
|
|
$arvalue['receivable_budget'] = $value[$sequence]['PlanPayAmt']; |
|
|
$arvalue['receivable_budget'] = $value[$sequence]['PlanPayAmt']; |
|
|
|
|
|
$arrayData[$key]['receivable_budget'] += $value[$sequence]['PlanPayAmt']; |
|
|
|
|
|
} else { |
|
|
|
|
|
$arvalue['receivable_budget'] = 0; |
|
|
|
|
|
} |
|
|
$arvalue['received_budget'] = $value[$sequence]['received_budget']; |
|
|
$arvalue['received_budget'] = $value[$sequence]['received_budget']; |
|
|
$arvalue['invoice_budget'] = $value[$sequence]['invoice_budget']; |
|
|
$arvalue['invoice_budget'] = $value[$sequence]['invoice_budget']; |
|
|
$arvalue['collect_month'] = $value[$sequence]['collect_month']; |
|
|
$arvalue['collect_month'] = $value[$sequence]['collect_month']; |
|
@ -731,7 +752,7 @@ $excel_contract_noboga_array= array(); |
|
|
// 12 作番總金額; 13 A40001 金額; 14 A40008 金額; 15 目前應收金額; 16 已開發票金額; 17 已收金額; 18 催收金額; 19 催收次數; 20 作番狀態 |
|
|
// 12 作番總金額; 13 A40001 金額; 14 A40008 金額; 15 目前應收金額; 16 已開發票金額; 17 已收金額; 18 催收金額; 19 催收次數; 20 作番狀態 |
|
|
$excel_facility_array = array(); |
|
|
$excel_facility_array = array(); |
|
|
foreach ($arrayData as $key => $value) { |
|
|
foreach ($arrayData as $key => $value) { |
|
|
// echo $key . "<br>********************<br>"; |
|
|
|
|
|
$excel_contract_array[$key] = array_fill(0, 76, ''); |
|
|
$excel_contract_array[$key] = array_fill(0, 76, ''); |
|
|
$excel_contract_array[$key][0] = (isset($value['BillNo']) && !is_null($value['BillNo'])) ? $value['BillNo'] : ''; |
|
|
$excel_contract_array[$key][0] = (isset($value['BillNo']) && !is_null($value['BillNo'])) ? $value['BillNo'] : ''; |
|
|
$excel_contract_array[$key][1] = (isset($value['BillDate']) && !is_null($value['BillDate'])) ? $value['BillDate'] : ''; |
|
|
$excel_contract_array[$key][1] = (isset($value['BillDate']) && !is_null($value['BillDate'])) ? $value['BillDate'] : ''; |
|
@ -744,16 +765,18 @@ foreach ($arrayData as $key => $value) { |
|
|
$excel_contract_array[$key][8] = (isset($value['PersonName']) && !is_null($value['PersonName'])) ? $value['PersonName'] : ''; |
|
|
$excel_contract_array[$key][8] = (isset($value['PersonName']) && !is_null($value['PersonName'])) ? $value['PersonName'] : ''; |
|
|
$excel_contract_array[$key][9] = (isset($value['ManagerId']) && !is_null($value['ManagerId'])) ? $value['ManagerId'] : ''; |
|
|
$excel_contract_array[$key][9] = (isset($value['ManagerId']) && !is_null($value['ManagerId'])) ? $value['ManagerId'] : ''; |
|
|
$excel_contract_array[$key][10] = (isset($value['ManagerName']) && !is_null($value['ManagerName'])) ? $value['ManagerName'] : ''; |
|
|
$excel_contract_array[$key][10] = (isset($value['ManagerName']) && !is_null($value['ManagerName'])) ? $value['ManagerName'] : ''; |
|
|
$excel_contract_array[$key][11] = (isset($value['OAmountWithTax']) && !is_null($value['OAmountWithTax'])) ? $value['OAmountWithTax'] : 0; |
|
|
$excel_contract_array[$key][11] = (isset($value['OAmountWithTax']) && !is_null($value['OAmountWithTax'])) ? number_format(round($value['OAmountWithTax'])) : '0'; |
|
|
$excel_contract_array[$key][12] = (isset($value['A40001']) && !is_null($value['A40001'])) ? $value['A40001'] : 0; |
|
|
$excel_contract_array[$key][12] = (isset($value['A40001']) && !is_null($value['A40001'])) ? number_format(round($value['A40001'])) : '0'; |
|
|
$excel_contract_array[$key][13] = (isset($value['A40008']) && !is_null($value['A40008'])) ? $value['A40008'] : 0; |
|
|
$excel_contract_array[$key][13] = (isset($value['A40008']) && !is_null($value['A40008'])) ? number_format(round($value['A40008'])) : '0'; |
|
|
$excel_contract_array[$key][14] = (isset($value['receivable_budget']) && !is_null($value['receivable_budget'])) ? $value['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][14] = (isset($value['receivable_budget']) && !is_null($value['receivable_budget'])) ? $value['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][15] = (isset($value['invoice_budget']) && !is_null($value['invoice_budget'])) ? $value['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][15] = (isset($value['invoice_budget']) && !is_null($value['invoice_budget'])) ? number_format(round($value['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][16] = (isset($value['received_budget']) && !is_null($value['received_budget'])) ? $value['received_budget'] : 0; |
|
|
$excel_contract_array[$key][16] = (isset($value['received_budget']) && !is_null($value['received_budget'])) ? $value['received_budget'] : 0; |
|
|
$excel_contract_array[$key][17] = $excel_contract_array[$key][14] - $excel_contract_array[$key][16]; |
|
|
$excel_contract_array[$key][17] = number_format(round($excel_contract_array[$key][14] - $excel_contract_array[$key][16])); |
|
|
$excel_contract_array[$key][18] = (isset($value['collect_month']) && !is_null($value['collect_month'])) ? $value['collect_month'] : 0; |
|
|
$excel_contract_array[$key][18] = (isset($value['collect_month']) && !is_null($value['collect_month'])) ? number_format(round($value['collect_month'])) : '0'; |
|
|
$excel_contract_array[$key][19] = (isset($value['facility_num']) && !is_null($value['facility_num'])) ? $value['facility_num'] : 0; |
|
|
$excel_contract_array[$key][19] = (isset($value['facility_num']) && !is_null($value['facility_num'])) ? number_format(round($value['facility_num'])) : '0'; |
|
|
$excel_contract_array[$key][20] = (isset($value['facility_status']) && !is_null($value['facility_status'])) ? $value['facility_status'] : 0; |
|
|
$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 (isset($value['PayStage']) && is_iterable($value['PayStage'])) { |
|
|
$isBoga = 0; |
|
|
$isBoga = 0; |
|
|
if (stristr($value['PayStage'][1]['PayStage'], '寶佳')) { |
|
|
if (stristr($value['PayStage'][1]['PayStage'], '寶佳')) { |
|
@ -770,16 +793,18 @@ foreach ($arrayData as $key => $value) { |
|
|
$excel_contract_boga_array[$key][8] = (isset($value['PersonName']) && !is_null($value['PersonName'])) ? $value['PersonName'] : ''; |
|
|
$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][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][10] = (isset($value['ManagerName']) && !is_null($value['ManagerName'])) ? $value['ManagerName'] : ''; |
|
|
$excel_contract_boga_array[$key][11] = (isset($value['OAmountWithTax']) && !is_null($value['OAmountWithTax'])) ? $value['OAmountWithTax'] : 0; |
|
|
$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'])) ? $value['A40001'] : 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'])) ? $value['A40008'] : 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][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'])) ? $value['invoice_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][16] = (isset($value['received_budget']) && !is_null($value['received_budget'])) ? $value['received_budget'] : 0; |
|
|
$excel_contract_boga_array[$key][17] = $excel_contract_array[$key][14] - $excel_contract_array[$key][16]; |
|
|
$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'])) ? $value['collect_month'] : 0; |
|
|
$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'])) ? $value['facility_num'] : 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'] : 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])); |
|
|
} else { |
|
|
} else { |
|
|
$excel_contract_noboga_array[$key] = array_fill(0, 76, ''); |
|
|
$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][0] = (isset($value['BillNo']) && !is_null($value['BillNo'])) ? $value['BillNo'] : ''; |
|
@ -793,204 +818,258 @@ foreach ($arrayData as $key => $value) { |
|
|
$excel_contract_noboga_array[$key][8] = (isset($value['PersonName']) && !is_null($value['PersonName'])) ? $value['PersonName'] : ''; |
|
|
$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][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][10] = (isset($value['ManagerName']) && !is_null($value['ManagerName'])) ? $value['ManagerName'] : ''; |
|
|
$excel_contract_noboga_array[$key][11] = (isset($value['OAmountWithTax']) && !is_null($value['OAmountWithTax'])) ? $value['OAmountWithTax'] : 0; |
|
|
$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'])) ? $value['A40001'] : 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'])) ? $value['A40008'] : 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][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'])) ? $value['invoice_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][16] = (isset($value['received_budget']) && !is_null($value['received_budget'])) ? $value['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][17] = $excel_contract_array[$key][14] - $excel_contract_array[$key][16]; |
|
|
$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'])) ? $value['collect_month'] : 0; |
|
|
$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'])) ? $value['facility_num'] : 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'] : 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])); |
|
|
} |
|
|
} |
|
|
foreach ($value['PayStage'] as $paykey => $payvalue) { |
|
|
foreach ($value['PayStage'] as $paykey => $payvalue) { |
|
|
switch ($payvalue['stage']) { |
|
|
switch ($payvalue['stage']) { |
|
|
case "訂金": |
|
|
case "訂金": |
|
|
$excel_contract_array[$key][21] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][21] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][22] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][22] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][23] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][23] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][24] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][24] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][25] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][25] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][26] = $excel_contract_array[$key][23] - $excel_contract_array[$key][25]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][27] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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) { |
|
|
if ($isBoga == 1) { |
|
|
$excel_contract_boga_array[$key][21] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][25] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_boga_array[$key][26] = $excel_contract_array[$key][23] - $excel_contract_array[$key][25]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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 { |
|
|
} else { |
|
|
$excel_contract_noboga_array[$key][21] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][25] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][26] = $excel_contract_array[$key][23] - $excel_contract_array[$key][25]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
case "二次款": |
|
|
case "二次款": |
|
|
$excel_contract_array[$key][28] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][28] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][29] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][29] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][30] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][30] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][31] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][31] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][32] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][32] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][33] = $excel_contract_array[$key][30] - $excel_contract_array[$key][32]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][34] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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) { |
|
|
if ($isBoga == 1) { |
|
|
$excel_contract_boga_array[$key][28] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][32] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_boga_array[$key][33] = $excel_contract_array[$key][30] - $excel_contract_array[$key][32]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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 { |
|
|
} else { |
|
|
$excel_contract_noboga_array[$key][28] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][32] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][33] = $excel_contract_array[$key][30] - $excel_contract_array[$key][32]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
case "貨抵工地款": |
|
|
case "貨抵工地款": |
|
|
$excel_contract_array[$key][35] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][35] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][36] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][36] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][37] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][37] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][38] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][38] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][39] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][39] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][40] = $excel_contract_array[$key][37] - $excel_contract_array[$key][39]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][41] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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) { |
|
|
if ($isBoga == 1) { |
|
|
$excel_contract_boga_array[$key][35] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][39] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_boga_array[$key][40] = $excel_contract_array[$key][37] - $excel_contract_array[$key][39]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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 { |
|
|
} else { |
|
|
$excel_contract_noboga_array[$key][35] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][39] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][40] = $excel_contract_array[$key][37] - $excel_contract_array[$key][39]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
case "安裝款": |
|
|
case "安裝款": |
|
|
$excel_contract_array[$key][42] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][42] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][43] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][43] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][44] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][44] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][45] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][45] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][46] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][46] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][47] = $excel_contract_array[$key][44] - $excel_contract_array[$key][46]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][48] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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][42] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_noboga_array[$key][43] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][46] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][47] = $excel_contract_array[$key][44] - $excel_contract_array[$key][46]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
case "試車款": |
|
|
case "試車款": |
|
|
$excel_contract_array[$key][49] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][49] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][50] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][50] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][51] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][51] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][52] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][52] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][53] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][53] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][54] = $excel_contract_array[$key][51] - $excel_contract_array[$key][53]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][55] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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) { |
|
|
if ($isBoga == 1) { |
|
|
$excel_contract_boga_array[$key][49] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][53] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_boga_array[$key][54] = $excel_contract_array[$key][51] - $excel_contract_array[$key][53]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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 { |
|
|
} else { |
|
|
$excel_contract_noboga_array[$key][49] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][53] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][54] = $excel_contract_array[$key][51] - $excel_contract_array[$key][53]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
case "官檢驗收款": |
|
|
case "官檢驗收款": |
|
|
$excel_contract_array[$key][56] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][56] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][57] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][57] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][58] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][58] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][59] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][59] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][60] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][60] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][61] = $excel_contract_array[$key][58] - $excel_contract_array[$key][60]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][62] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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][56] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_noboga_array[$key][57] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][60] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][61] = $excel_contract_array[$key][58] - $excel_contract_array[$key][60]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
case "交車款": |
|
|
case "交車款": |
|
|
$excel_contract_array[$key][63] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][63] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][64] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][64] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][65] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][65] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][66] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][66] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][67] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][67] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][68] = $excel_contract_array[$key][65] - $excel_contract_array[$key][67]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][69] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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][63] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_noboga_array[$key][64] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][67] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][68] = $excel_contract_array[$key][65] - $excel_contract_array[$key][67]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
case "尾款": |
|
|
case "尾款": |
|
|
$excel_contract_array[$key][70] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][70] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$excel_contract_array[$key][71] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$excel_contract_array[$key][71] = (isset($payvalue['PlanPayAmt']) && !is_null($payvalue['PlanPayAmt'])) ? number_format(round($payvalue['PlanPayAmt'])) : '0'; |
|
|
$excel_contract_array[$key][72] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][72] = (isset($payvalue['receivable_budget']) && !is_null($payvalue['receivable_budget'])) ? $payvalue['receivable_budget'] : 0; |
|
|
$excel_contract_array[$key][73] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? $payvalue['invoice_budget'] : 0; |
|
|
$excel_contract_array[$key][73] = (isset($payvalue['invoice_budget']) && !is_null($payvalue['invoice_budget'])) ? number_format(round($payvalue['invoice_budget'])) : '0'; |
|
|
$excel_contract_array[$key][74] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][74] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_array[$key][75] = $excel_contract_array[$key][72] - $excel_contract_array[$key][74]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$excel_contract_array[$key][76] = (isset($payvalue['collect_month']) && !is_null($payvalue['collect_month'])) ? number_format(round($payvalue['collect_month'])) : '0'; |
|
|
|
|
|
$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) { |
|
|
if ($isBoga == 1) { |
|
|
$excel_contract_boga_array[$key][70] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][74] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_boga_array[$key][75] = $excel_contract_array[$key][72] - $excel_contract_array[$key][74]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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 { |
|
|
} else { |
|
|
$excel_contract_noboga_array[$key][70] = (isset($payvalue['PayStage']) && !is_null($payvalue['PayStage'])) ? $payvalue['PayStage'] : '--'; |
|
|
$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'])) ? $payvalue['PlanPayAmt'] : 0; |
|
|
$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][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'])) ? $payvalue['invoice_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][74] = (isset($payvalue['received_budget']) && !is_null($payvalue['received_budget'])) ? $payvalue['received_budget'] : 0; |
|
|
$excel_contract_noboga_array[$key][75] = $excel_contract_array[$key][72] - $excel_contract_array[$key][74]; |
|
|
$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'])) ? $payvalue['collect_month'] : 0; |
|
|
$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; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
foreach($arrayData as $key => $value){ |
|
|
|
|
|
echo $key."<br>"; |
|
|
|
|
|
foreach($value as $k => $v){ |
|
|
|
|
|
echo $k."<br>"; |
|
|
|
|
|
print_r($v); |
|
|
|
|
|
echo "<br><br>"; |
|
|
|
|
|
} |
|
|
|
|
|
exit(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$total_data = json_encode($excel_contract_array); |
|
|
$total_data = json_encode($excel_contract_array); |
|
|
$boga_data = json_encode($excel_contract_boga_array); |
|
|
$boga_data = json_encode($excel_contract_boga_array); |
|
@ -1006,6 +1085,7 @@ $noboga_data = json_encode($excel_contract_noboga_array); |
|
|
td { |
|
|
td { |
|
|
word-wrap: break-word; |
|
|
word-wrap: break-word; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
th { |
|
|
th { |
|
|
text-align: center; |
|
|
text-align: center; |
|
|
} |
|
|
} |
|
@ -1046,20 +1126,260 @@ $noboga_data = json_encode($excel_contract_noboga_array); |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="container"> |
|
|
|
|
|
<div class="text-center" style="margin-bottom: 20px;"> |
|
|
|
|
|
<h3><strong>合約 (新梯)統整資訊</strong></h3> |
|
|
|
|
|
</div> |
|
|
|
|
|
<form class="form-horizontal"> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="sum_total_budget">合約總金額</label> |
|
|
|
|
|
<input type="text" class="form-control" id="sum_total_budget" name="sum_total_budget" value="<?= number_format($sum_total_budget) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="sum_A40001">合約設備總金額</label> |
|
|
|
|
|
<input type="text" class="form-control" id="sum_A40001" name="sum_A40001" value="<?= number_format($sum_A40001) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="sum_A40008">合約安裝總金額</label> |
|
|
|
|
|
<input type="text" class="form-control" id="sum_A40008" name="sum_A40008" value="<?= number_format($sum_A40008) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="sum_facility">總台數</label> |
|
|
|
|
|
<input type="text" class="form-control" id="sum_facility" name="sum_facility" value="<?= number_format($sum_facility) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="form-group"> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="average_facility_budget">作番平均金額 (元/台)</label> |
|
|
|
|
|
<input type="text" class="form-control" id="average_facility_budget" name="average_facility_budget" value="<?= number_format($average_facility_budget) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="average_A40001">設備平均金額 (元/台)</label> |
|
|
|
|
|
<input type="text" class="form-control" id="average_A40001" name="average_A40001" value="<?= number_format($average_A40001) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="average_A40008">安裝平均金額 (元/台)</label> |
|
|
|
|
|
<input type="text" class="form-control" id="average_A40008" name="average_A40008" value="<?= number_format($average_A40008) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="col-md-3"> |
|
|
|
|
|
<label for="average_contract_facility">平均台數 (台/合約)</label> |
|
|
|
|
|
<input type="text" class="form-control" id="average_contract_facility" name="average_contract_facility" value="<?= number_format($average_contract_facility) ?>" disabled> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</form> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
include "./footer.php"; |
|
|
|
|
|
?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div style="width:98%;margin:1% ;overflow-x: auto;"> |
|
|
|
|
|
<table id="table_index" class="table table-striped table-bordered" style="width:100%;"> |
|
|
|
|
|
<thead> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
|
|
|
|
<th style="width: 300px;">作番狀態</th> |
|
|
|
|
|
<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: 150px;">已收金額金額</th> |
|
|
|
|
|
<th style="width: 150px;">催收金額金額</th> |
|
|
|
|
|
<th style="width: 150px;">催收次數</th> |
|
|
|
|
|
<th style="width: 150px;">作番數量</th> |
|
|
|
|
|
|
|
|
|
|
|
<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: 120px;">訂金<br>已收金額</th> |
|
|
|
|
|
<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: 120px;">二次款<br>應收金額</th> |
|
|
|
|
|
<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: 120px;">貨抵工地款 <br>名稱</th> |
|
|
|
|
|
<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: 120px;">貨抵工地款<br>催收金額</th> |
|
|
|
|
|
<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: 120px;">安裝款<br>已開金額</th> |
|
|
|
|
|
<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: 120px;">試車款<br>合約金額</th> |
|
|
|
|
|
<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: 120px;">試車款<br>催收次數</th> |
|
|
|
|
|
|
|
|
|
|
|
<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: 120px;">官檢驗收款<br>已收金額</th> |
|
|
|
|
|
<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: 120px;">交車款<br>應收金額</th> |
|
|
|
|
|
<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: 120px;">尾款 <br>名稱</th> |
|
|
|
|
|
<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: 120px;">尾款<br>催收金額</th> |
|
|
|
|
|
<th style="width: 120px;">尾款<br>催收次數</th> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
</thead> |
|
|
|
|
|
<tbody> |
|
|
|
|
|
<?php |
|
|
|
|
|
foreach ($excel_contract_array as $key => $value) { |
|
|
|
|
|
?> |
|
|
|
|
|
<tr> |
|
|
|
|
|
<th><?= $key ?></th> |
|
|
|
|
|
<td style="text-align: center;"><?= $value['Dept']."<br>".$value['DeptName'] ?></td> |
|
|
|
|
|
<td style="text-align: center;"><?= $value['ManagerId']."<br>".$value['ManagerName'] ?></td> |
|
|
|
|
|
<td style="text-align: center;"><?= $value['PersonId']."<br>".$value['PersonName'] ?></td> |
|
|
|
|
|
<td style="text-align: center;"><?= $value['CustomerId']."<br>".$value['CustomerName'] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value['facility_status'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['A40001'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['A40008'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['total_budget'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['receivable_budget'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['invoice_budget'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['received_budget'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['collect_budget'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['collect_month'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value['facility_num'] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value['PayStage'] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[20] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[21] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[22] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[23] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[24] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[25] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[26] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[27] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value[28] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[29] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[30] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[31] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[32] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[33] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[34] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[35] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[36] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value[37] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[38] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[39] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[40] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[41] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[42] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[43] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[44] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[45] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value[46] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[47] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[48] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[49] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[50] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[51] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[52] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[53] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[54] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value[55] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[56] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[57] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[58] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[59] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[60] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[61] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[62] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[63] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value[64] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[65] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[66] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[67] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[68] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[69] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[70] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[71] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[72] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<td style="text-align: end;"><?= $value[73] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[74] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[75] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[76] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[77] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[78] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[79] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[80] ?></td> |
|
|
|
|
|
<td style="text-align: end;"><?= $value[81] ?></td> |
|
|
|
|
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
<?php |
|
|
|
|
|
} |
|
|
|
|
|
?> |
|
|
|
|
|
</tbody> |
|
|
|
|
|
</table> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
function downloadData(content) { |
|
|
function downloadData(content) { |
|
|
console.log(content); |
|
|
|
|
|
if (content == 'all') { |
|
|
if (content == 'all') { |
|
|
var BillData = <?= $total_data ?>; |
|
|
var BillData = <?= $total_data ?>; |
|
|
var filename = "全部應收帳款" + "<?= date('Y/m/d-H:m') ?>" + ".xlsx"; |
|
|
var filename = "全部應收帳款" + "<?= date('Ymd-Hm') ?>" + ".xlsx"; |
|
|
} else if (content == 'noboga') { |
|
|
} else if (content == 'noboga') { |
|
|
var BillData = <?= $noboga_data ?>; |
|
|
var BillData = <?= $noboga_data ?>; |
|
|
var filename = "不含寶佳應收帳款" + "<?= date('Y/m/d-H:m') ?>" + ".xlsx"; |
|
|
var filename = "不含寶佳應收帳款" + "<?= date('Ymd-Hm') ?>" + ".xlsx"; |
|
|
} else if (content == 'boga') { |
|
|
} else if (content == 'boga') { |
|
|
var BillData = <?= $boga_data ?>; |
|
|
var BillData = <?= $boga_data ?>; |
|
|
var filename = "寶佳應收帳款" + "<?= date('Y/m/d-H:m') ?>" + ".xlsx"; |
|
|
var filename = "寶佳應收帳款" + "<?= date('Ymd-Hm') ?>" + ".xlsx"; |
|
|
} |
|
|
} |
|
|
var xhr = new XMLHttpRequest(); |
|
|
var xhr = new XMLHttpRequest(); |
|
|
var url = window.location.origin + "/wms/account-receivable-excel.php?type=newContract&<?= $token_link ?>"; |
|
|
var url = window.location.origin + "/wms/account-receivable-excel.php?type=newContract&<?= $token_link ?>"; |
|
@ -1068,7 +1388,7 @@ $noboga_data = json_encode($excel_contract_noboga_array); |
|
|
xhr.onreadystatechange = function() { |
|
|
xhr.onreadystatechange = function() { |
|
|
if (xhr.readyState === 4 && xhr.status === 200) { |
|
|
if (xhr.readyState === 4 && xhr.status === 200) { |
|
|
var link = document.createElement('a'); |
|
|
var link = document.createElement('a'); |
|
|
link.setAttribute('href', window.location.origin + "/wms/account-receivable-facility.xlsx"); |
|
|
link.setAttribute('href', window.location.origin + "/wms/account-receivable-contract.xlsx"); |
|
|
link.setAttribute('download', filename); |
|
|
link.setAttribute('download', filename); |
|
|
link.style.display = 'none'; |
|
|
link.style.display = 'none'; |
|
|
document.body.appendChild(link); |
|
|
document.body.appendChild(link); |
|
|