|
@ -459,12 +459,12 @@ function T8insert($data, $facilityno) |
|
|
// print_r($elevators['maintainance']); |
|
|
// print_r($elevators['maintainance']); |
|
|
// echo '</pre>'; |
|
|
// echo '</pre>'; |
|
|
foreach ($elevators as $index => $elevator) { |
|
|
foreach ($elevators as $index => $elevator) { |
|
|
$type = $elevator['maintainance']; |
|
|
$maintainance_type = $elevator['maintainance']; |
|
|
if ($type == 'A') { |
|
|
if ($maintainance_type == 'A') { |
|
|
$type = 'C3'; |
|
|
$type = 'C3'; |
|
|
} else if ($type == 'B') { |
|
|
} else if ($maintainance_type == 'B') { |
|
|
$type = 'C4'; |
|
|
$type = 'C4'; |
|
|
} else if ($type == 'C') { |
|
|
} else if ($maintainance_type == 'C') { |
|
|
$type = 'C5'; |
|
|
$type = 'C5'; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -487,7 +487,7 @@ function T8insert($data, $facilityno) |
|
|
$stmt->bindParam(':CreatorId', $user_id); |
|
|
$stmt->bindParam(':CreatorId', $user_id); |
|
|
$stmt->execute(); |
|
|
$stmt->execute(); |
|
|
} |
|
|
} |
|
|
|
|
|
$row = 0; |
|
|
// // 新增電梯數 |
|
|
// // 新增電梯數 |
|
|
foreach ($elevators as $index => $elevator) { |
|
|
foreach ($elevators as $index => $elevator) { |
|
|
// echo '<pre>'; |
|
|
// echo '<pre>'; |
|
@ -535,6 +535,7 @@ function T8insert($data, $facilityno) |
|
|
|
|
|
|
|
|
// 依每台電梯去加入各個的付款項 |
|
|
// 依每台電梯去加入各個的付款項 |
|
|
for ($i = 0; $i < $IncomeId[$payType]; $i++) { |
|
|
for ($i = 0; $i < $IncomeId[$payType]; $i++) { |
|
|
|
|
|
$row++; |
|
|
// 計算分期款的收款月份 |
|
|
// 計算分期款的收款月份 |
|
|
$paymonth = $i * $SQuantity; |
|
|
$paymonth = $i * $SQuantity; |
|
|
$countDay = date('Y-m-d', strtotime("$date_1 + $paymonth months")); |
|
|
$countDay = date('Y-m-d', strtotime("$date_1 + $paymonth months")); |
|
@ -543,8 +544,8 @@ function T8insert($data, $facilityno) |
|
|
"BillNo" => "$contractno", |
|
|
"BillNo" => "$contractno", |
|
|
"IncomeId" => "$payType", |
|
|
"IncomeId" => "$payType", |
|
|
"TaxId" => "ST005", |
|
|
"TaxId" => "ST005", |
|
|
"RowCode" => $i + 1, |
|
|
"RowCode" => $row, |
|
|
"RowNo" => $i + 1, |
|
|
"RowNo" => $row, |
|
|
"ItemType" => 1, |
|
|
"ItemType" => 1, |
|
|
"SPrice" => $elevator['sold_price'], |
|
|
"SPrice" => $elevator['sold_price'], |
|
|
"SQuantity" => $SQuantity, |
|
|
"SQuantity" => $SQuantity, |
|
|