Cheng 1 year ago
parent
commit
805865a89a
  1. 15
      wms/contract/api/postContractData.php
  2. 18
      wms/contract/api/testT8API.php

15
wms/contract/api/postContractData.php

@ -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,

18
wms/contract/api/testT8API.php

@ -7,13 +7,13 @@ $date1 = Date('Y-m-d', strtotime("$date +1 months"));
// print_r($countDay); // print_r($countDay);
// echo '</pre>'; // echo '</pre>';
// exit(); // exit();
$a = 1; $a = 0;
$b = 24 / $a; // $b = 24 / $a;
for ($i = 0; $i < $b; $i++) { for ($i = 0; $i < 2; $i++) {
$c = $i * $a; for ($j = 0; $j < 12; $j++) {
$date1 = Date('Y-m-d', strtotime("$date + $c months")); $a++;
$date2 = str_replace('-', '', $date1); echo '<pre>';
echo '<pre>'; print_r($a);
print_r($date2); echo '</pre>';
echo '</pre>'; }
} }

Loading…
Cancel
Save