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

18
wms/contract/api/testT8API.php

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

Loading…
Cancel
Save