Browse Source

merge conflict

main
10994015 1 year ago
parent
commit
f02ec6134d
  1. 44
      mkt/pricereview-create.php
  2. 72804
      wms/account-receivable-bill.txt
  3. 72
      wms/account-receivable-excel.php
  4. BIN
      wms/account-receivable-facility.xlsx
  5. 125
      wms/account-receivable-index-ing.php
  6. 345
      wms/account-receivable-index.php
  7. BIN
      wms/account-receivable-test.xlsx
  8. 6
      wms/cont/sign_list.php
  9. 41
      wms/contract-repair/contract-download.php
  10. 33
      wms/contract-repair/js/alpine.js
  11. 195
      wms/contract/api/postContractData.php
  12. 38
      wms/contract/api/testT8API.php
  13. 3
      wms/contract/conn.php
  14. 15
      wms/contract/connt8.php
  15. BIN
      wms/facility-price.xlsx
  16. 2
      wms/header.php
  17. 365
      wms/mkt/price_normal-index.php
  18. 276
      wms/mkt/pricereview-create.php
  19. 294
      wms/mkt/pricereview_renovate-create.php
  20. 60
      wms/rib-invoice-check.php
  21. 20
      wms/rib02-create.php
  22. 19
      wms/rib02-edit.php
  23. 9
      wms/rib02-submit.php
  24. 8
      wms/sign/list.php

44
mkt/pricereview-create.php

@ -167,9 +167,15 @@ $(function(){
}); });
}); });
$('#deposit_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); $('#deposit_rate').keyup(function() {
$('#keep_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
$('#warranty_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); });
$('#keep_rate').keyup(function() {
$(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
});
$('#warranty_rate').keyup(function() {
$(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
});
/* /*
// for 動態表格的作法:event delegation // for 動態表格的作法:event delegation
$('#tb1').on('click', $("input[name='item_qty']"), function(){ $('#tb1').on('click', $("input[name='item_qty']"), function(){
@ -257,28 +263,44 @@ $(function(){
}); });
$('#submit').click(function() { $('#submit').click(function() {
var itemFpidArr = []; var itemFpidArr = [];
$("input[name='fp_id']").each(function(){ itemFpidArr.push($(this).val()); }) $("input[name='fp_id']").each(function() {
itemFpidArr.push($(this).val());
})
$('#fp_id_all').val(itemFpidArr); $('#fp_id_all').val(itemFpidArr);
var itemSpecArr = []; var itemSpecArr = [];
$("input[name='item_spec']").each(function(){ itemSpecArr.push($(this).val()); }) $("input[name='item_spec']").each(function() {
itemSpecArr.push($(this).val());
})
$('#item_spec_all').val(itemSpecArr); $('#item_spec_all').val(itemSpecArr);
var itemGroupArr = []; var itemGroupArr = [];
$("input[name='item_group']").each(function(){ itemGroupArr.push($(this).val()); }) $("input[name='item_group']").each(function() {
itemGroupArr.push($(this).val());
})
$('#item_group_all').val(itemGroupArr); $('#item_group_all').val(itemGroupArr);
var itemQtyArr = []; var itemQtyArr = [];
$("input[name='item_qty']").each(function(){ itemQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_qty']").each(function() {
itemQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_qty_all').val(itemQtyArr); $('#item_qty_all').val(itemQtyArr);
var itemPriceBpArr = []; var itemPriceBpArr = [];
$("input[name='item_price_bp']").each(function(){ itemPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price_bp']").each(function() {
itemPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_bp_all').val(itemPriceBpArr); $('#item_price_bp_all').val(itemPriceBpArr);
var itemPriceArr = []; var itemPriceArr = [];
$("input[name='item_price']").each(function(){ itemPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price']").each(function() {
itemPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_all').val(itemPriceArr); $('#item_price_all').val(itemPriceArr);
var pvRateArr = []; var pvRateArr = [];
$("input[name='pv_rate']").each(function(){ pvRateArr.push($(this).val()); }) $("input[name='pv_rate']").each(function() {
pvRateArr.push($(this).val());
})
$('#pv_rate_all').val(pvRateArr); $('#pv_rate_all').val(pvRateArr);
var noteArr = []; var noteArr = [];
$("input[name='note']").each(function(){ noteArr.push($(this).val()); }) $("input[name='note']").each(function() {
noteArr.push($(this).val());
})
$('#note_all').val(noteArr); $('#note_all').val(noteArr);
//console.log(itemNameArr); //console.log(itemNameArr);
//return false; //return false;

72804
wms/account-receivable-bill.txt

File diff suppressed because it is too large

72
wms/account-receivable-excel.php

@ -5,35 +5,59 @@ require_once dirname(__DIR__) . '/common/composer/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
header('Content-Type: application/json'); header('Content-Type: application/json');
$type = $_GET['type'];
$array_data = array(); $array_data = array();
$Bill = json_decode(file_get_contents("php://input"), true); $Bill = json_decode(file_get_contents("php://input"), true);
$spreadsheet = new Spreadsheet(); $spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet(); $sheet = $spreadsheet->getActiveSheet();
if ($type == 'facility') {
$colomnHeader = [ $colomnHeader = [
'合約號','作番號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭', '作番號','合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金', '訂金目前應收', '訂金已收','訂金催收','訂金符合收款條件日期','訂金催收次數', '訂金名稱', '訂金合約金額', '訂金應收日期', '訂金目前應收金額', '訂金已收金額', '訂金催收金額', '訂金催收次數',
'二次款', '二次款目前應收', '二次款已收', '二次款催收','二次款符合收款條件日期','二次款催收次數', '二次款名稱', '二次款合約金額', '二次款應收日期', '二次款目前應收金額', '二次款已收金額', '二次款催收金額', '二次款催收次數',
'貨抵工地款', '貨抵工地款目前應收', '貨抵工地款已收', '貨抵工地款催收','貨抵工地款符合收款條件日期','貨抵工地款催收次數', '貨抵工地款名稱', '貨抵工地款合約金額', '貨抵工地款應收日期', '貨抵工地款目前應收金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款催收次數',
'安裝款', '安裝款目前應收', '安裝款已收', '安裝款催收','安裝款符合收款條件日期','安裝款催收次數', '安裝款名稱', '安裝款合約金額', '安裝款應收日期', '安裝款目前應收金額', '安裝款已收金額', '安裝款催收金額', '安裝款催收次數',
'試車款', '試車款目前應收', '試車款已收', '試車款催收','試車款符合收款條件日期','試車款催收次數', '試車款名稱', '試車款合約金額', '試車款應收日期', '試車款目前應收金額', '試車款已收金額', '試車款催收金額', '試車款催收次數',
'官檢款', '官檢款目前應收', '官檢款已收', '官檢款催收','官檢款符合收款條件日期','官檢款催收次數', '官檢款名稱', '官檢款合約金額', '官檢款應收日期', '官檢款目前應收金額', '官檢款已收金額', '官檢款催收金額', '官檢款催收次數',
'交車款', '交車款目前應收', '交車款已收', '交車款催收','交車款符合收款條件日期','交車款催收次數', '交車款名稱', '交車款合約金額', '交車款應收日期', '交車款目前應收金額', '交車款已收金額', '交車款催收金額', '交車款催收次數',
'尾款', '尾款目前應收', '尾款已收', '尾款催收','尾款符合收款條件日期','尾款催收次數', '尾款名稱', '尾款金額', '尾款應收日期', '尾款應收金額', '尾款已收金額', '尾款催收金額', '尾款催收次數',
'合約總金額', '目前應收', '已開發票金額', '已收金額' '作番狀態', '作番合約總金額', '作番總應收金額'
];
$sheet->fromArray($colomnHeader, NULL, 'A1');
$rowIndex = 2;
foreach ($Bill as $key => $value) {
$sheet->fromArray($value, NULL, 'A' . $rowIndex,true);
$column = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ',
'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO', 'BP'
];
foreach ($column as $col) {
$sheet->getColumnDimension($col)->setAutoSize(true);
}
$rowIndex++;
}
$writer = new Xlsx($spreadsheet);
$excelFileName = 'account-receivable-facility.xlsx';
$writer->save($excelFileName);
} else {
$colomnHeader = [
'合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金', '訂金目前應收', '訂金最大催收次數', '訂金最小催收次數',
'二次款', '二次款目前應收', '二次款最大催收次數', '二次款最小催收次數',
'貨抵工地款', '貨抵工地款目前應收', '貨抵工地款最小催收次數', '貨抵工地款最小催收次數',
'安裝款', '安裝款目前應收', '安裝款最大催收次數', '安裝款最小催收次數',
'試車款', '試車款目前應收', '試車款最大催收次數', '試車款最小催收次數',
'官檢款', '官檢款目前應收', '官檢款最大催收次數', '官檢款最小催收次數',
'交車款', '交車款目前應收', '交車款最大催收次數', '交車款最小催收次數',
'尾款', '尾款目前應收', '尾款最大催收次數', '尾款最小催收次數',
'合約總金額', '目前應收', '已開發票金額', '已收金額', '作番總數', '作番狀態'
]; ];
// $colomnHeader = [
// '合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
// '訂金', '訂金目前應收', '簽約最大催收次數', '簽約最小應收次數',
// '二次款', '二次款目前應收', '二次款最大催收次數', '二次款最小催收次數',
// '貨抵工地款', '貨抵工地款目前應收', '貨抵工地最小催收次數', '貨抵工地最小催收次數',
// '安裝款', '安裝款目前應收', '安裝最大催收次數', '安裝最小催收次數',
// '試車款', '試車款目前應收', '試車最大催收次數', '試車最小催收次數',
// '官檢款', '官檢款目前應收', '官檢最大催收次數', '官檢最小催收次數',
// '交車款', '交車款目前應收', '交車最大催收次數', '交車最小催收次數',
// '尾款', '尾款目前應收', '尾款最大催收次數', '尾款最小催收次數',
// '合約總金額', '目前應收', '已開發票金額', '已收金額','作番總數', '作番狀態'
// ];
$sheet->fromArray($colomnHeader, NULL, 'A1'); $sheet->fromArray($colomnHeader, NULL, 'A1');
$rowIndex = 2; $rowIndex = 2;
@ -56,5 +80,9 @@ foreach ($Bill as $key => $value) {
$writer = new Xlsx($spreadsheet); $writer = new Xlsx($spreadsheet);
$excelFileName = 'account-receivable-test.xlsx'; $excelFileName = 'account-receivable-test.xlsx';
$writer->save($excelFileName); $writer->save($excelFileName);
}
echo $excelFileName; echo $excelFileName;
?> ?>
<!-- <script>
window.location.href = "account-receivable-index.php?<?= $token_link ?>";
</script> -->

BIN
wms/account-receivable-facility.xlsx

Binary file not shown.

125
wms/account-receivable-index-ing.php

@ -233,6 +233,10 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']]['total_facility_num'] += 1; $arrayData[$wip['contractno']]['total_facility_num'] += 1;
// [合約號]['facility'][作番號]['no'] // [合約號]['facility'][作番號]['no']
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['no'] = $wip['facilityno']; $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['no'] = $wip['facilityno'];
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = "";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['total_budget'] = 0;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['receivable_budget'] = 0;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['collect_budget'] = 0;
// [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期] // [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期]
// [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期] // [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期]
@ -320,7 +324,7 @@ foreach ($wipwhole_array as $wip) {
// real_contract_arrival_date 預計出貨日=預計到貨日=預計貨抵工地 // real_contract_arrival_date 預計出貨日=預計到貨日=預計貨抵工地
// real_arrival_date 實際出貨日=實際到貨日=實際貨抵工地 // real_arrival_date 實際出貨日=實際到貨日=實際貨抵工地
//----------------------------------------寶佳的另外處理--------------------------------------------------- //----------------------------------------寶佳的另外處理---------------------------------------------------
//[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
if ($arrayData[$wip['contractno']]['sign'][0] == "寶佳出貨前30天") { if ($arrayData[$wip['contractno']]['sign'][0] == "寶佳出貨前30天") {
$facility_status = ""; $facility_status = "";
// if ($arrayData[$wip['contractno']]['sign'][2]) // if ($arrayData[$wip['contractno']]['sign'][2])
@ -332,6 +336,7 @@ foreach ($wipwhole_array as $wip) {
if ($today > $contractday) { if ($today > $contractday) {
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
$facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//二次款 //二次款
$contractday = strtotime($arrayData[$wip['contractno']]['second'][2]); $contractday = strtotime($arrayData[$wip['contractno']]['second'][2]);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][2] = $arrayData[$wip['contractno']]['second'][2]; $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][2] = $arrayData[$wip['contractno']]['second'][2];
@ -340,6 +345,7 @@ foreach ($wipwhole_array as $wip) {
if ($today > $contractday) { if ($today > $contractday) {
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
$facility_status = $wip['facilityno'] . " (出貨後10天" . $arrayData[$wip['contractno']]['second'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (出貨後10天" . $arrayData[$wip['contractno']]['second'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//貨抵工地款 //貨抵工地款
if ($wip['real_arrival_date'] != NULL) { if ($wip['real_arrival_date'] != NULL) {
$estimate_time = strtotime($wip['real_arrival_date']); $estimate_time = strtotime($wip['real_arrival_date']);
@ -351,6 +357,7 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['arrive'][2] = strval(date('Y-m-d', $contractday)); $arrayData[$wip['contractno']]['arrive'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (貨抵工地後90天" . $arrayData[$wip['contractno']]['arrive'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (貨抵工地後90天" . $arrayData[$wip['contractno']]['arrive'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//試車款 //試車款
if ($wip['tryrun_end_date'] != NULL) { if ($wip['tryrun_end_date'] != NULL) {
$estimate_time = strtotime($wip['tryrun_end_date']); $estimate_time = strtotime($wip['tryrun_end_date']);
@ -362,6 +369,7 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['tryrun'][2] = strval(date('Y-m-d', $contractday)); $arrayData[$wip['contractno']]['tryrun'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (試車後90天" . $arrayData[$wip['contractno']]['tryrun'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (試車後90天" . $arrayData[$wip['contractno']]['tryrun'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//交車款 //交車款
if ($wip['delivery_date'] != NULL) { if ($wip['delivery_date'] != NULL) {
$estimate_time = strtotime($wip['delivery_date']); $estimate_time = strtotime($wip['delivery_date']);
@ -373,6 +381,7 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']]['delivery_num'] += 1; $arrayData[$wip['contractno']]['delivery_num'] += 1;
$arrayData[$wip['contractno']]['delivery'][2] = strval(date('Y-m-d', $contractday)); $arrayData[$wip['contractno']]['delivery'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (交車後270天" . $arrayData[$wip['contractno']]['delivery'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (交車後270天" . $arrayData[$wip['contractno']]['delivery'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
} }
} }
} }
@ -382,6 +391,7 @@ foreach ($wipwhole_array as $wip) {
} }
} else { } else {
$facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "未到) <br>"; $facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "未到) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
} }
$arrayData[$wip['contractno']]['facilities'] .= $facility_status; $arrayData[$wip['contractno']]['facilities'] .= $facility_status;
} else { } else {
@ -397,6 +407,7 @@ foreach ($wipwhole_array as $wip) {
} }
if ($wip['delivery_date'] != NULL) { if ($wip['delivery_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>";
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
@ -487,6 +498,7 @@ foreach ($wipwhole_array as $wip) {
} }
} elseif ($wip['official_check_date'] != NULL) { } elseif ($wip['official_check_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>";
$arrayData[$wip['contractno']]['check_num'] += 1; $arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
@ -503,7 +515,7 @@ foreach ($wipwhole_array as $wip) {
} }
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) { if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") { if ( isset($arrayData[$wip['contractno']]['tryrun'][0]) && $arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") {
$estimate_delivery_time = strtotime($wip['tryrun_end_date']); $estimate_delivery_time = strtotime($wip['tryrun_end_date']);
$tryruntime = $estimate_delivery_time + (90 * 86400); $tryruntime = $estimate_delivery_time + (90 * 86400);
$month = collect_month($tryruntime); $month = collect_month($tryruntime);
@ -532,7 +544,7 @@ foreach ($wipwhole_array as $wip) {
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
} }
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) { if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if (isset($arrayData[$wip['contractno']]['arrive'][0]) && $arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']); $estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$month = collect_month($arrivetime); $month = collect_month($arrivetime);
@ -567,6 +579,7 @@ foreach ($wipwhole_array as $wip) {
} }
} elseif ($wip['tryrun_end_date'] != NULL) { } elseif ($wip['tryrun_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>";
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
@ -624,6 +637,7 @@ foreach ($wipwhole_array as $wip) {
} }
} elseif ($wip['install_end_date'] != NULL) { } elseif ($wip['install_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>";
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
@ -672,6 +686,7 @@ foreach ($wipwhole_array as $wip) {
} }
} elseif ($wip['real_arrival_date'] != NULL) { } elseif ($wip['real_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>";
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
@ -701,16 +716,20 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][6] = $month; $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][2] = strval(date('Ymd', $secondtime)); $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][2] = strval(date('Ymd', $secondtime));
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (已達二次款收款條件) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (已達二次款收款條件) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (已達二次款收款條件) <br>";
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
} else { } else {
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
if ($wip['real_contract_arrival_date'] != NULL) { if ($wip['real_contract_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>";
} elseif ($wip['estimated_shipping_date'] != NULL) { } elseif ($wip['estimated_shipping_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>";
} else { } else {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (預計出港日待確認) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (預計出港日待確認) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (預計出港日待確認) <br>";
} }
} }
} }
@ -719,6 +738,7 @@ foreach ($wipwhole_array as $wip) {
// 計算每個合約的應收款、作番總數 // 計算每個合約的應收款、作番總數
$today_date = new DateTime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d'))))); $today_date = new DateTime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d')))));
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($arrayData as &$value) { foreach ($arrayData as &$value) {
if ($value['total_facility_num'] > 0) { if ($value['total_facility_num'] > 0) {
$value['receivable_budget'] = $value['sign'][1] * ($value['sign_num'] / $value['total_facility_num']) + ($value['second'][1] * ($value['second_num'] / $value['total_facility_num'])) + $value['receivable_budget'] = $value['sign'][1] * ($value['sign_num'] / $value['total_facility_num']) + ($value['second'][1] * ($value['second_num'] / $value['total_facility_num'])) +
@ -734,9 +754,24 @@ foreach ($arrayData as &$value) {
$value['delivery'][3] = $value['delivery'][1] * ($value['delivery_num'] / $value['total_facility_num']); $value['delivery'][3] = $value['delivery'][1] * ($value['delivery_num'] / $value['total_facility_num']);
$value['final'][3] = $value['final'][1] * ($value['delivery_num'] / $value['total_facility_num']); $value['final'][3] = $value['final'][1] * ($value['delivery_num'] / $value['total_facility_num']);
} }
// 計算最大催收次數與最小催收次數
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
// 計算每台作番金額與各階段應收金額
foreach ($value['facility'] as &$val) {
foreach ($contractstage as $stage) {
if (isset($value[$stage][0]) && !empty($value[$stage][0])) {
$val[$stage][0] = $value[$stage][0];
$val[$stage][1] = $value[$stage][1] / $value['total_facility_num'];
$val[$stage][3] = (!(isset($val[$stage][6])) || $val[$stage][6] == 0) ? 0 : $val[$stage][1];
$val['total_budget'] += $val[$stage][1];
$val['receivable_budget'] += $val[$stage][3];
}
}
}
// 計算最大催收次數與最小催收次數
foreach ($contractstage as $i) { foreach ($contractstage as $i) {
if (!empty($value[$i]['min']) && count($value[$i]['min']) > 0) { if (!empty($value[$i]['min']) && count($value[$i]['min']) > 0) {
$latest_timestamp = max($value[$i]['min']); $latest_timestamp = max($value[$i]['min']);
@ -810,6 +845,7 @@ foreach ($received_array as $received) {
$excel_aray = array(); $excel_aray = array();
$boga_array = array(); $boga_array = array();
$exclude_boga_array = array(); $exclude_boga_array = array();
$facility_array = array();
foreach ($arrayData as $key => $value) { foreach ($arrayData as $key => $value) {
$value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0; $value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0;
$value['second'][3] = (isset($value['second'][3])) ? $value['second'][3] : 0; $value['second'][3] = (isset($value['second'][3])) ? $value['second'][3] : 0;
@ -867,11 +903,43 @@ foreach ($arrayData as $key => $value) {
$value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'], $value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'],
$value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], $value['total_facility_num'], str_replace('<br>', '; ', $value['facilities']) $value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], $value['total_facility_num'], str_replace('<br>', '; ', $value['facilities'])
]; ];
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 min 最早應收月份 max 最晚應收月份
//[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
foreach ($value['facility'] as $valkey => $val) {
foreach ($contractstage as $stage) {
$val[$stage][0] = (!(isset($val[$stage][0])) || is_null($val[$stage][0])) ? "-" : $val[$stage][0];
$val[$stage][1] = (!(isset($val[$stage][1])) || is_null($val[$stage][1])) ? 0 : $val[$stage][1];
$val[$stage][2] = (!(isset($val[$stage][2])) || is_null($val[$stage][2])) ? "-" : $val[$stage][2];
$val[$stage][3] = (!(isset($val[$stage][3])) || is_null($val[$stage][3])) ? 0 : $val[$stage][3];
$val[$stage][4] = (!(isset($val[$stage][4])) || is_null($val[$stage][4])) ? 0 : $val[$stage][4];
$val[$stage][5] = (!(isset($val[$stage][5])) || is_null($val[$stage][5])) ? 0 : $val[$stage][5];
$val[$stage][6] = (!(isset($val[$stage][6])) || is_null($val[$stage][6])) ? 0 : $val[$stage][6];
}
$facility_array[$valkey] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6], $valkey,
$val['sign'][0], $val['sign'][1], $val['sign'][2], $val['sign'][3], $val['sign'][4], $val['sign'][5], $val['sign'][6],
$val['second'][0], $val['second'][1], $val['second'][2], $val['second'][3], $val['second'][4], $val['second'][5], $val['second'][6],
$val['arrive'][0], $val['arrive'][1], $val['arrive'][2], $val['arrive'][3], $val['arrive'][4], $val['arrive'][5], $val['arrive'][6],
$val['install'][0], $val['install'][1], $val['install'][2], $val['install'][3], $val['install'][4], $val['install'][5], $val['install'][6],
$val['tryrun'][0], $val['tryrun'][1], $val['tryrun'][2], $val['tryrun'][3], $val['tryrun'][4], $val['tryrun'][5], $val['tryrun'][6],
$val['check'][0], $val['check'][1], $val['check'][2], $val['check'][3], $val['check'][4], $val['check'][5], $val['check'][6],
$val['delivery'][0], $val['delivery'][1], $val['delivery'][2], $val['delivery'][3], $val['delivery'][4], $val['delivery'][5], $val['delivery'][6],
$val['final'][0], $val['final'][1], $val['final'][2], $val['final'][3], $val['final'][4], $val['final'][5], $val['final'][6],
str_replace('<br>', '; ', $val['status']), $val['total_budget'], $val['receivable_budget']
];
}
} }
// foreach($facility_array as $key=>$value){
// echo $key;
// echo '<br>';
// print_r($value);
// echo '<br><br>';
// }
$data = json_encode($excel_aray); $data = json_encode($excel_aray);
$boga_data = json_encode($boga_array); $boga_data = json_encode($boga_array);
$exclude_boga_data = json_encode($exclude_boga_array); $exclude_boga_data = json_encode($exclude_boga_array);
$facility_data = json_encode($facility_array);
?> ?>
<style> <style>
@ -911,16 +979,23 @@ $exclude_boga_data = json_encode($exclude_boga_array);
} }
</style> </style>
<button type="button" onclick="downloadData()" class="btn btn-success btn-lg pull-right">全部<span class="glyphicon glyphicon-download-alt"></span></button> <div class="btn-group btn-group-lg" style="padding:10 px;">
<button type="button" onclick="exclude_bogaData()" class="btn btn-info btn-lg pull-right">不含寶佳<span class="glyphicon glyphicon-download-alt"></span></button> <button type="button" onclick="downloadData()" class="btn btn-success">全部<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="bogaData()" class="btn btn-warning btn-lg pull-right">寶佳<span class="glyphicon glyphicon-download-alt"></span></button> <button type="button" onclick="exclude_bogaData()" class="btn btn-info">不含寶佳<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="bogaData()" class="btn btn-warning">寶佳<span class="glyphicon glyphicon-download-alt"></span></button>
</div>
<div style="padding: 10px;">
<button type="button" onclick="downloadFacilityData()" class="btn btn-primary btn-lg">合約作番明細<span class="glyphicon glyphicon-download-alt"></span></button>
</div>
<div>
<?php <?php
if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id == 'M0060') { if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id == 'M0060') {
?> ?>
<a href="facility-price.php?<?= $token_link ?>" class="btn btn-primary btn-lg pull-right">合約作番明細</span></a> <!-- <a href="facility-price.php?<?= $token_link ?>" class="btn btn-primary btn-lg pull-right">合約作番明細</span></a> -->
<?php <?php
} }
?> ?>
</div>
<div style="width:98%;margin:1% ;overflow-x: auto;"> <div style="width:98%;margin:1% ;overflow-x: auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%;"> <table id="table_index" class="table table-striped table-bordered" style="width:100%;">
<thead> <thead>
@ -1034,10 +1109,10 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
} }
function test() { function test() {
var BillData = <?= $data ?>; var BillData = <?= $boga_data ?>;
var form = document.createElement("form"); var form = document.createElement("form");
form.method = 'POST'; form.method = 'POST';
form.action = "account-receivable-excel.php?<?= $token_link ?>"; form.action = "account-receivable-excel.php?type=facility&<?= $token_link ?>";
var input = document.createElement("input"); var input = document.createElement("input");
input.type = "hidden"; input.type = "hidden";
input.name = "Bill"; input.name = "Bill";
@ -1050,7 +1125,7 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
function downloadData() { function downloadData() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>"; var url = window.location.origin + "/wms/account-receivable-excel.php?type=all&<?= $token_link ?>";
xhr.open('POST', url, true); xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
@ -1079,7 +1154,7 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
function bogaData() { function bogaData() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>"; var url = window.location.origin + "/wms/account-receivable-excel.php?type=boga&<?= $token_link ?>";
xhr.open('POST', url, true); xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
@ -1100,11 +1175,33 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
})); }));
} }
function downloadFacilityData() {
var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?type=facility&<?= $token_link ?>";
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var file_path = xhr.responseText;
var link = document.createElement('a');
var name = "作番應收帳款" + "<?= date('Y-m-d-Hm') ?>" + ".xlsx";
link.setAttribute('href', window.location.origin + "/wms/account-receivable-facility.xlsx");
link.setAttribute('download', name);
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
xhr.send(JSON.stringify({
Bill: <?= $facility_data ?>
}));
}
function exclude_bogaData() { function exclude_bogaData() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>"; var url = window.location.origin + "/wms/account-receivable-excel.php?type=exclude_boga&<?= $token_link ?>";
xhr.open('POST', url, true); xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {

345
wms/account-receivable-index.php

@ -220,6 +220,8 @@ FROM department
ON d.department_id = tmp2.department_id ORDER BY contractno"; ON d.department_id = tmp2.department_id ORDER BY contractno";
$wipwhole_array = mysqli_query($link, $sql); $wipwhole_array = mysqli_query($link, $sql);
foreach ($wipwhole_array as $wip) { foreach ($wipwhole_array as $wip) {
$today = strtotime(date('Ymd'));
//[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
if (isset($arrayData[$wip['contractno']])) { if (isset($arrayData[$wip['contractno']])) {
// 整理合約資料 // 整理合約資料
$arrayData[$wip['contractno']][0] = $wip['department_id'];; $arrayData[$wip['contractno']][0] = $wip['department_id'];;
@ -229,14 +231,19 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']][4] = $wip['name']; $arrayData[$wip['contractno']][4] = $wip['name'];
$arrayData[$wip['contractno']][10] = $wip['contractno']; $arrayData[$wip['contractno']][10] = $wip['contractno'];
$arrayData[$wip['contractno']]['total_facility_num'] += 1; $arrayData[$wip['contractno']]['total_facility_num'] += 1;
// [合約號][作番號]['no'] // [合約號]['facility'][作番號]['no']
$arrayData[$wip['contractno']][$wip['facilityno']]['no'] = $wip['facilityno']; $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['no'] = $wip['facilityno'];
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = "";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['total_budget'] = 0;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['receivable_budget'] = 0;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['collect_budget'] = 0;
// [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期] // [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期]
// [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期] // [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期]
// [合約號][作番號][款別] ['rec'] [金額]/[實際收款日期] // [合約號][作番號][款別] ['rec'] [金額]/[實際收款日期]
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final'); $contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($contractstage as $i) { foreach ($contractstage as $i) {
$arrayData[$wip['contractno']][$wip['facilityno']][$i] = ['', 0, '', 0, 0, 0, 0];
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['date'] = ""; $arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['date'] = "";
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['budget'] = 0; $arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['budget'] = 0;
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['rec']['date'] = ""; $arrayData[$wip['contractno']][$wip['facilityno']][$i]['rec']['date'] = "";
@ -317,40 +324,64 @@ foreach ($wipwhole_array as $wip) {
// real_contract_arrival_date 預計出貨日=預計到貨日=預計貨抵工地 // real_contract_arrival_date 預計出貨日=預計到貨日=預計貨抵工地
// real_arrival_date 實際出貨日=實際到貨日=實際貨抵工地 // real_arrival_date 實際出貨日=實際到貨日=實際貨抵工地
//----------------------------------------寶佳的另外處理--------------------------------------------------- //----------------------------------------寶佳的另外處理---------------------------------------------------
if ($arrayData[$wip['contractno']]['sign'][0] == "寶佳出貨前30天") { if ($arrayData[$wip['contractno']]['sign'][0] == "寶佳出貨前30天") {
$facility_status = ""; $facility_status = "";
// if ($arrayData[$wip['contractno']]['sign'][2]) // if ($arrayData[$wip['contractno']]['sign'][2])
$today = strtotime(date('Ymd')); $today = strtotime(date('Ymd'));
$contractday = strtotime($arrayData[$wip['contractno']]['sign'][2]); $contractday = strtotime($arrayData[$wip['contractno']]['sign'][2]);
$month = collect_month($contractday); $month = collect_month($contractday);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['sign'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['sign'][2] = $arrayData[$wip['contractno']]['sign'][2];
if ($today > $contractday) { if ($today > $contractday) {
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
$facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//二次款
$contractday = strtotime($arrayData[$wip['contractno']]['second'][2]); $contractday = strtotime($arrayData[$wip['contractno']]['second'][2]);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][2] = $arrayData[$wip['contractno']]['second'][2];
$month = collect_month($contractday);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][6] = $month;
if ($today > $contractday) { if ($today > $contractday) {
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
$facility_status = $wip['facilityno'] . " (出貨後10天" . $arrayData[$wip['contractno']]['second'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (出貨後10天" . $arrayData[$wip['contractno']]['second'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//貨抵工地款
if ($wip['real_arrival_date'] != NULL) { if ($wip['real_arrival_date'] != NULL) {
$estimate_time = strtotime($wip['real_arrival_date']); $estimate_time = strtotime($wip['real_arrival_date']);
$contractday = $estimate_time + (90 * 86400); $contractday = $estimate_time + (90 * 86400);
$month = collect_month($contractday);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $contractday));
if ($today > $contractday) { if ($today > $contractday) {
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['arrive'][2] = strval(date('Y-m-d', $contractday)); $arrayData[$wip['contractno']]['arrive'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (貨抵工地後90天" . $arrayData[$wip['contractno']]['arrive'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (貨抵工地後90天" . $arrayData[$wip['contractno']]['arrive'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//試車款
if ($wip['tryrun_end_date'] != NULL) { if ($wip['tryrun_end_date'] != NULL) {
$estimate_time = strtotime($wip['tryrun_end_date']); $estimate_time = strtotime($wip['tryrun_end_date']);
$contractday = $estimate_time + (90 * 86400); $contractday = $estimate_time + (90 * 86400);
$month = collect_month($contractday);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][2] = strval(date('Ymd', $contractday));
if ($today > $contractday) { if ($today > $contractday) {
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['tryrun'][2] = strval(date('Y-m-d', $contractday)); $arrayData[$wip['contractno']]['tryrun'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (試車後90天" . $arrayData[$wip['contractno']]['tryrun'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (試車後90天" . $arrayData[$wip['contractno']]['tryrun'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
//交車款
if ($wip['delivery_date'] != NULL) { if ($wip['delivery_date'] != NULL) {
$estimate_time = strtotime($wip['delivery_date']); $estimate_time = strtotime($wip['delivery_date']);
$contractday = $estimate_time + (270 * 86400); $contractday = $estimate_time + (270 * 86400);
$month = collect_month($contractday);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['delivery'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['delivery'][2] = strval(date('Ymd', $contractday));
if ($today > $contractday) { if ($today > $contractday) {
$arrayData[$wip['contractno']]['delivery_num'] += 1; $arrayData[$wip['contractno']]['delivery_num'] += 1;
$arrayData[$wip['contractno']]['delivery'][2] = strval(date('Y-m-d', $contractday)); $arrayData[$wip['contractno']]['delivery'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (交車後270天" . $arrayData[$wip['contractno']]['delivery'][2] . "已過) <br>"; $facility_status = $wip['facilityno'] . " (交車後270天" . $arrayData[$wip['contractno']]['delivery'][2] . "已過) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
} }
} }
} }
@ -360,11 +391,23 @@ foreach ($wipwhole_array as $wip) {
} }
} else { } else {
$facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "未到) <br>"; $facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "未到) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $facility_status;
} }
$arrayData[$wip['contractno']]['facilities'] .= $facility_status; $arrayData[$wip['contractno']]['facilities'] .= $facility_status;
} else { } else {
$signtime = strtotime($arrayData[$wip['contractno']]['sign'][2]);
$month = collect_month($signtime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['sign'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['sign'][2] = strval(date('Ymd', $signtime));
if (isset($arrayData[$wip['contractno']]['second'][2]) && ($arrayData[$wip['contractno']]['second'][2] !== NULL)) {
$secondtime = strtotime($arrayData[$wip['contractno']]['second'][2]);
$month = collect_month($secondtime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][2] = strval(date('Ymd', $secondtime));
}
if ($wip['delivery_date'] != NULL) { if ($wip['delivery_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>";
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
@ -374,7 +417,13 @@ foreach ($wipwhole_array as $wip) {
if ($arrayData[$wip['contractno']]['delivery'][0] == "交車後270天") { if ($arrayData[$wip['contractno']]['delivery'][0] == "交車後270天") {
$estimate_delivery_time = strtotime($wip['delivery_date']); $estimate_delivery_time = strtotime($wip['delivery_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime); $month = collect_month($arrivetime);
if ($today > $arrivetime) {
$arrayData[$wip['contractno']]['delivery_num'] += 1;
}
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['delivery'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['delivery'][2] = strval(date('Ymd', $arrivetime));
$arrivetime = date('Ymd', $arrivetime);
$arrayData[$wip['contractno']]['delivery'][2] = strval($secondtime); $arrayData[$wip['contractno']]['delivery'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($arrivetime)));
@ -382,60 +431,74 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']]['delivery_num'] += 1; $arrayData[$wip['contractno']]['delivery_num'] += 1;
$arrayData[$wip['contractno']]['check_num'] += 1; $arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['delivery'][2] = strval($wip['delivery_date']); $arrayData[$wip['contractno']]['delivery'][2] = strval($wip['delivery_date']);
$deliverytime = strtotime($wip['delivery_date']);
$month = collect_month($deliverytime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['delivery'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['delivery'][2] = strval(date('Ymd', $deliverytime));
array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($wip['delivery_date']))); array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($wip['delivery_date'])));
array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($wip['delivery_date']))); array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($wip['delivery_date'])));
} }
if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) { if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['check']['min'], strtotime(strval($wip['official_check_date']))); array_push($arrayData[$wip['contractno']]['check']['min'], strtotime(strval($wip['official_check_date'])));
array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date']))); array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date'])));
$checktime = strtotime($wip['official_check_date']);
$month = collect_month($checktime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['check'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['check'][2] = strval(date('Ymd', $checktime));
} }
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) { if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") { if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") {
$estimate_delivery_time = strtotime($wip['tryrun_end_date']); $estimate_delivery_time = strtotime($wip['tryrun_end_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $tryruntime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime); $tryruntime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime); $arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($tryruntime)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($tryruntime)));
$month = collect_month($tryruntime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][2] = strval(date('Ymd', $tryruntime));
} else { } else {
$arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']); $arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date']))); array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date']))); array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
$tryruntime = strtotime($wip['tryrun_end_date']);
$month = collect_month($tryruntime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][2] = strval(date('Ymd', $tryruntime));
} }
} }
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) { if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
$installtime = strtotime($wip['install_end_date']);
$month = collect_month($installtime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][2] = strval(date('Ymd', $installtime));
} }
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) { if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']); $estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrivetime = date('Ymd', $secondtime); $arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime); $arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else { } else {
$arrivetime = strtotime($wip['real_arrival_date']);
$month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']); $arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
} }
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
} }
} elseif ($wip['official_check_date'] != NULL) { } elseif ($wip['official_check_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>";
$arrayData[$wip['contractno']]['check_num'] += 1; $arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
@ -445,30 +508,48 @@ foreach ($wipwhole_array as $wip) {
if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) { if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['check']['min'], strtotime(strval($wip['official_check_date']))); array_push($arrayData[$wip['contractno']]['check']['min'], strtotime(strval($wip['official_check_date'])));
array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date']))); array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date'])));
$checktime = strtotime($wip['official_check_date']);
$month = collect_month($checktime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['check'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['check'][2] = strval(date('Ymd', $checktime));
} }
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) { if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") { if (isset($arrayData[$wip['contractno']]['tryrun'][0]) && $arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") {
$estimate_delivery_time = strtotime($wip['tryrun_end_date']); $estimate_delivery_time = strtotime($wip['tryrun_end_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $tryruntime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime); $month = collect_month($tryruntime);
$tryruntime = date('Ymd', $tryruntime);
$arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime); $arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($tryruntime)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($tryruntime)));
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][2] = strval($tryruntime);
} else { } else {
$tryruntime = strtotime($wip['tryrun_end_date']);
$month = collect_month($tryruntime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][2] = strval(date('Ymd', $tryruntime));
$arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']); $arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date']))); array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date']))); array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
} }
} }
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) { if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
$installtime = strtotime($wip['install_end_date']);
$month = collect_month($installtime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][2] = strval(date('Ymd', $installtime));
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
} }
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) { if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if (isset($arrayData[$wip['contractno']]['arrive'][0]) && $arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']); $estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrivetime = date('Ymd', $secondtime); $arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime); $arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
@ -477,6 +558,10 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']); $arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
$arrivetime = strtotime($wip['real_arrival_date']);
$month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
} }
} else { } else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
@ -494,6 +579,7 @@ foreach ($wipwhole_array as $wip) {
} }
} elseif ($wip['tryrun_end_date'] != NULL) { } elseif ($wip['tryrun_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>";
$arrayData[$wip['contractno']]['tryrun_num'] += 1; $arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
@ -502,20 +588,35 @@ foreach ($wipwhole_array as $wip) {
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) { if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date']))); array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date']))); array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
$tryruntime = strtotime($wip['tryrun_end_date']);
$month = collect_month($tryruntime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['tryrun'][2] = strval(date('Ymd', $tryruntime));
} }
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) { if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
$installtime = strtotime($wip['install_end_date']);
$month = collect_month($installtime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][2] = strval(date('Ymd', $installtime));
} }
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) { if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']); $estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime); $month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime); $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrivetime = date('Ymd', $arrivetime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($arrivetime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else { } else {
$arrivetime = strtotime($wip['real_arrival_date']);
$month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']); $arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
@ -524,8 +625,8 @@ foreach ($wipwhole_array as $wip) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']); $estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime); $arrivetime = date('Ymd', $arrivetime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime); $arrayData[$wip['contractno']]['arrive'][2] = strval($arrivetime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else { } else {
@ -536,11 +637,16 @@ foreach ($wipwhole_array as $wip) {
} }
} elseif ($wip['install_end_date'] != NULL) { } elseif ($wip['install_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>";
$arrayData[$wip['contractno']]['install_num'] += 1; $arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) { if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
$installtime = strtotime($wip['install_end_date']);
$month = collect_month($installtime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['install'][2] = strval(date('Ymd', $installtime));
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date']))); array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strtotime(strval($wip['install_end_date'])))); array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strtotime(strval($wip['install_end_date']))));
} }
@ -548,11 +654,18 @@ foreach ($wipwhole_array as $wip) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']); $estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime); $month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime); $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrivetime = date('Ymd', $arrivetime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($arrivetime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else { } else {
$arrivetime = strtotime($wip['real_arrival_date']);
$month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']); $arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
@ -573,6 +686,7 @@ foreach ($wipwhole_array as $wip) {
} }
} elseif ($wip['real_arrival_date'] != NULL) { } elseif ($wip['real_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>";
$arrayData[$wip['contractno']]['arrive_num'] += 1; $arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
@ -580,28 +694,42 @@ foreach ($wipwhole_array as $wip) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") { if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']); $estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400); $arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime); $month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime); $arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrivetime = date('Ymd', $arrivetime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($arrivetime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else { } else {
$arrivetime = strtotime($wip['real_arrival_date']);
$month = collect_month($arrivetime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['arrive'][2] = strval(date('Ymd', $arrivetime));
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']); $arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date']))); array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
} }
} elseif (($arrayData[$wip['contractno']]['second'] != NULL) && (isset($arrayData[$wip['contractno']]['second'][2])) && ($arrayData[$wip['contractno']]['second'][2] <= date('Ymd'))) { } elseif (($arrayData[$wip['contractno']]['second'] != NULL) && (isset($arrayData[$wip['contractno']]['second'][2])) && ($arrayData[$wip['contractno']]['second'][2] <= date('Ymd'))) {
$secondtime = strtotime($arrayData[$wip['contractno']]['second'][2]);
$month = collect_month($secondtime);
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][6] = $month;
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['second'][2] = strval(date('Ymd', $secondtime));
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (已達二次款收款條件) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (已達二次款收款條件) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (已達二次款收款條件) <br>";
$arrayData[$wip['contractno']]['second_num'] += 1; $arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
} else { } else {
$arrayData[$wip['contractno']]['sign_num'] += 1; $arrayData[$wip['contractno']]['sign_num'] += 1;
if ($wip['real_contract_arrival_date'] != NULL) { if ($wip['real_contract_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>";
} elseif ($wip['estimated_shipping_date'] != NULL) { } elseif ($wip['estimated_shipping_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>";
} else { } else {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (預計出港日待確認) <br>"; $arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (預計出港日待確認) <br>";
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['facilityno'] . " (預計出港日待確認) <br>";
} }
} }
} }
@ -610,6 +738,7 @@ foreach ($wipwhole_array as $wip) {
// 計算每個合約的應收款、作番總數 // 計算每個合約的應收款、作番總數
$today_date = new DateTime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d'))))); $today_date = new DateTime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d')))));
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($arrayData as &$value) { foreach ($arrayData as &$value) {
if ($value['total_facility_num'] > 0) { if ($value['total_facility_num'] > 0) {
$value['receivable_budget'] = $value['sign'][1] * ($value['sign_num'] / $value['total_facility_num']) + ($value['second'][1] * ($value['second_num'] / $value['total_facility_num'])) + $value['receivable_budget'] = $value['sign'][1] * ($value['sign_num'] / $value['total_facility_num']) + ($value['second'][1] * ($value['second_num'] / $value['total_facility_num'])) +
@ -625,9 +754,24 @@ foreach ($arrayData as &$value) {
$value['delivery'][3] = $value['delivery'][1] * ($value['delivery_num'] / $value['total_facility_num']); $value['delivery'][3] = $value['delivery'][1] * ($value['delivery_num'] / $value['total_facility_num']);
$value['final'][3] = $value['final'][1] * ($value['delivery_num'] / $value['total_facility_num']); $value['final'][3] = $value['final'][1] * ($value['delivery_num'] / $value['total_facility_num']);
} }
// 計算最大催收次數與最小催收次數
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
// 計算每台作番金額與各階段應收金額
foreach ($value['facility'] as &$val) {
foreach ($contractstage as $stage) {
if (isset($value[$stage][0]) && !empty($value[$stage][0])) {
$val[$stage][0] = $value[$stage][0];
$val[$stage][1] = $value[$stage][1] / $value['total_facility_num'];
$val[$stage][3] = (!(isset($val[$stage][6])) || $val[$stage][6] == 0) ? 0 : $val[$stage][1];
$val['total_budget'] += $val[$stage][1];
$val['receivable_budget'] += $val[$stage][3];
}
}
}
// 計算最大催收次數與最小催收次數
foreach ($contractstage as $i) { foreach ($contractstage as $i) {
if (!empty($value[$i]['min']) && count($value[$i]['min']) > 0) { if (!empty($value[$i]['min']) && count($value[$i]['min']) > 0) {
$latest_timestamp = max($value[$i]['min']); $latest_timestamp = max($value[$i]['min']);
@ -701,6 +845,9 @@ foreach ($received_array as $received) {
$excel_aray = array(); $excel_aray = array();
$boga_array = array(); $boga_array = array();
$exclude_boga_array = array(); $exclude_boga_array = array();
$facility_array = array();
$facility_boga_array = array();
$facility_exclude_boga_array = array();
foreach ($arrayData as $key => $value) { foreach ($arrayData as $key => $value) {
$value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0; $value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0;
$value['second'][3] = (isset($value['second'][3])) ? $value['second'][3] : 0; $value['second'][3] = (isset($value['second'][3])) ? $value['second'][3] : 0;
@ -758,11 +905,67 @@ foreach ($arrayData as $key => $value) {
$value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'], $value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'],
$value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], $value['total_facility_num'], str_replace('<br>', '; ', $value['facilities']) $value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], $value['total_facility_num'], str_replace('<br>', '; ', $value['facilities'])
]; ];
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 min 最早應收月份 max 最晚應收月份
//[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數
foreach ($value['facility'] as $valkey => $val) {
foreach ($contractstage as $stage) {
$val[$stage][0] = (!(isset($val[$stage][0])) || is_null($val[$stage][0])) ? "-" : $val[$stage][0];
$val[$stage][1] = (!(isset($val[$stage][1])) || is_null($val[$stage][1])) ? 0 : $val[$stage][1];
$val[$stage][2] = (!(isset($val[$stage][2])) || is_null($val[$stage][2])) ? "-" : $val[$stage][2];
$val[$stage][3] = (!(isset($val[$stage][3])) || is_null($val[$stage][3])) ? 0 : $val[$stage][3];
$val[$stage][4] = (!(isset($val[$stage][4])) || is_null($val[$stage][4])) ? 0 : $val[$stage][4];
$val[$stage][5] = (!(isset($val[$stage][5])) || is_null($val[$stage][5])) ? 0 : $val[$stage][5];
$val[$stage][6] = (!(isset($val[$stage][6])) || is_null($val[$stage][6])) ? 0 : $val[$stage][6];
}
$facility_array[$valkey] = [
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], $val['sign'][1], $val['sign'][2], $val['sign'][3], $val['sign'][4], $val['sign'][5], $val['sign'][6],
$val['second'][0], $val['second'][1], $val['second'][2], $val['second'][3], $val['second'][4], $val['second'][5], $val['second'][6],
$val['arrive'][0], $val['arrive'][1], $val['arrive'][2], $val['arrive'][3], $val['arrive'][4], $val['arrive'][5], $val['arrive'][6],
$val['install'][0], $val['install'][1], $val['install'][2], $val['install'][3], $val['install'][4], $val['install'][5], $val['install'][6],
$val['tryrun'][0], $val['tryrun'][1], $val['tryrun'][2], $val['tryrun'][3], $val['tryrun'][4], $val['tryrun'][5], $val['tryrun'][6],
$val['check'][0], $val['check'][1], $val['check'][2], $val['check'][3], $val['check'][4], $val['check'][5], $val['check'][6],
$val['delivery'][0], $val['delivery'][1], $val['delivery'][2], $val['delivery'][3], $val['delivery'][4], $val['delivery'][5], $val['delivery'][6],
$val['final'][0], $val['final'][1], $val['final'][2], $val['final'][3], $val['final'][4], $val['final'][5], $val['final'][6],
str_replace('<br>', '; ', $val['status']), $val['total_budget'], $val['receivable_budget']
];
if ($value['sign'][0] == "寶佳出貨前30天") {
$facility_boga_array[$valkey] = [
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], $val['sign'][1], $val['sign'][2], $val['sign'][3], $val['sign'][4], $val['sign'][5], $val['sign'][6],
$val['second'][0], $val['second'][1], $val['second'][2], $val['second'][3], $val['second'][4], $val['second'][5], $val['second'][6],
$val['arrive'][0], $val['arrive'][1], $val['arrive'][2], $val['arrive'][3], $val['arrive'][4], $val['arrive'][5], $val['arrive'][6],
$val['install'][0], $val['install'][1], $val['install'][2], $val['install'][3], $val['install'][4], $val['install'][5], $val['install'][6],
$val['tryrun'][0], $val['tryrun'][1], $val['tryrun'][2], $val['tryrun'][3], $val['tryrun'][4], $val['tryrun'][5], $val['tryrun'][6],
$val['check'][0], $val['check'][1], $val['check'][2], $val['check'][3], $val['check'][4], $val['check'][5], $val['check'][6],
$val['delivery'][0], $val['delivery'][1], $val['delivery'][2], $val['delivery'][3], $val['delivery'][4], $val['delivery'][5], $val['delivery'][6],
$val['final'][0], $val['final'][1], $val['final'][2], $val['final'][3], $val['final'][4], $val['final'][5], $val['final'][6],
str_replace('<br>', '; ', $val['status']), $val['total_budget'], $val['receivable_budget']
];
} else {
$facility_exclude_boga_array[$valkey] = [
$valkey, $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$val['sign'][0], $val['sign'][1], $val['sign'][2], $val['sign'][3], $val['sign'][4], $val['sign'][5], $val['sign'][6],
$val['second'][0], $val['second'][1], $val['second'][2], $val['second'][3], $val['second'][4], $val['second'][5], $val['second'][6],
$val['arrive'][0], $val['arrive'][1], $val['arrive'][2], $val['arrive'][3], $val['arrive'][4], $val['arrive'][5], $val['arrive'][6],
$val['install'][0], $val['install'][1], $val['install'][2], $val['install'][3], $val['install'][4], $val['install'][5], $val['install'][6],
$val['tryrun'][0], $val['tryrun'][1], $val['tryrun'][2], $val['tryrun'][3], $val['tryrun'][4], $val['tryrun'][5], $val['tryrun'][6],
$val['check'][0], $val['check'][1], $val['check'][2], $val['check'][3], $val['check'][4], $val['check'][5], $val['check'][6],
$val['delivery'][0], $val['delivery'][1], $val['delivery'][2], $val['delivery'][3], $val['delivery'][4], $val['delivery'][5], $val['delivery'][6],
$val['final'][0], $val['final'][1], $val['final'][2], $val['final'][3], $val['final'][4], $val['final'][5], $val['final'][6],
str_replace('<br>', '; ', $val['status']), $val['total_budget'], $val['receivable_budget']
];
}
}
} }
$data = json_encode($excel_aray); $data = json_encode($excel_aray);
$boga_data = json_encode($boga_array); $boga_data = json_encode($boga_array);
$exclude_boga_data = json_encode($exclude_boga_array); $exclude_boga_data = json_encode($exclude_boga_array);
$facility_data = json_encode($facility_array);
$facility_boga_data = json_encode($facility_boga_array);
$facility_exclude_boga_data = json_encode($facility_exclude_boga_array);
?> ?>
<style> <style>
@ -802,16 +1005,43 @@ $exclude_boga_data = json_encode($exclude_boga_array);
} }
</style> </style>
<button type="button" onclick="downloadData()" class="btn btn-success btn-lg pull-right">全部<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="exclude_bogaData()" class="btn btn-info btn-lg pull-right">不含寶佳<span class="glyphicon glyphicon-download-alt"></span></button> <!-- <div style="width: 98%;margin: 1%;">
<button type="button" onclick="bogaData()" class="btn btn-warning btn-lg pull-right">寶佳<span class="glyphicon glyphicon-download-alt"></span></button> <div class="btn-group btn-group-lg " style="padding:10 px;">
<button type="button" onclick="downloadData()" class="btn btn-success">全部<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="exclude_bogaData()" class="btn btn-info">不含寶佳<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="bogaData()" class="btn btn-warning">寶佳<span class="glyphicon glyphicon-download-alt"></span></button>
</div>
</div>
<div style="width: 98%;margin: 1%;">
<div class="btn-group btn-group-lg">
<button type="button" onclick="downloadFacilityData()" class="btn btn-success btn-lg">合約作番明細<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="downloadFacilityBogaData()" class="btn btn-info btn-lg">寶佳合約作番明細<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="downloadFacilityExcludeBogaData()" class="btn btn-warning btn-lg">不含寶佳合約作番明細<span class="glyphicon glyphicon-download-alt"></span></button>
</div>
</div> -->
<div class="btn-group" role="group">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
合約
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><button type="button" onclick="downloadData()" class="btn btn-success">全部<span class="glyphicon glyphicon-download-alt"></span></button></li>
<li><button type="button" onclick="exclude_bogaData()" class="btn btn-info">不含寶佳<span class="glyphicon glyphicon-download-alt"></span></button></li>
<li><button type="button" onclick="bogaData()" class="btn btn-warning">寶佳<span class="glyphicon glyphicon-download-alt"></span></button></li>
</ul>
</div>
</div>
<div>
<?php <?php
if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id == 'M0060') { if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id == 'M0060') {
?> ?>
<a href="facility-price.php?<?= $token_link ?>" class="btn btn-primary btn-lg pull-right">合約作番明細</span></a> <!-- <a href="facility-price.php?<?= $token_link ?>" class="btn btn-primary btn-lg pull-right">合約作番明細</span></a> -->
<?php <?php
} }
?> ?>
</div>
<div style="width:98%;margin:1% ;overflow-x: auto;"> <div style="width:98%;margin:1% ;overflow-x: auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%;"> <table id="table_index" class="table table-striped table-bordered" style="width:100%;">
<thead> <thead>
@ -925,10 +1155,10 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
} }
function test() { function test() {
var BillData = <?= $data ?>; var BillData = <?= $boga_data ?>;
var form = document.createElement("form"); var form = document.createElement("form");
form.method = 'POST'; form.method = 'POST';
form.action = "account-receivable-excel.php?<?= $token_link ?>"; form.action = "account-receivable-excel.php?type=facility&<?= $token_link ?>";
var input = document.createElement("input"); var input = document.createElement("input");
input.type = "hidden"; input.type = "hidden";
input.name = "Bill"; input.name = "Bill";
@ -941,7 +1171,7 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
function downloadData() { function downloadData() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>"; var url = window.location.origin + "/wms/account-receivable-excel.php?type=all&<?= $token_link ?>";
xhr.open('POST', url, true); xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
@ -970,7 +1200,7 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
function bogaData() { function bogaData() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>"; var url = window.location.origin + "/wms/account-receivable-excel.php?type=boga&<?= $token_link ?>";
xhr.open('POST', url, true); xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {
@ -992,10 +1222,33 @@ if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id ==
} }
function downloadFacilityData() {
var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?type=facility&<?= $token_link ?>";
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var file_path = xhr.responseText;
var link = document.createElement('a');
var name = "作番應收帳款" + "<?= date('Y-m-d-Hm') ?>" + ".xlsx";
link.setAttribute('href', window.location.origin + "/wms/account-receivable-facility.xlsx");
link.setAttribute('download', name);
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
xhr.send(JSON.stringify({
Bill: <?= $facility_data ?>
}));
}
function exclude_bogaData() { function exclude_bogaData() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>"; var url = window.location.origin + "/wms/account-receivable-excel.php?type=exclude_boga&<?= $token_link ?>";
xhr.open('POST', url, true); xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() { xhr.onreadystatechange = function() {

BIN
wms/account-receivable-test.xlsx

Binary file not shown.

6
wms/cont/sign_list.php

@ -75,8 +75,10 @@ form_key,
status, status,
f_return_content('payment_kind',payment_kind ) payment_kind FROM $table f_return_content('payment_kind',payment_kind ) payment_kind FROM $table
where 1=1 $where ORDER BY vol_no"; where 1=1 $where ORDER BY vol_no";
// echo $sql;
$data = mysqli_query($link, $sql); $data = mysqli_query($link, $sql);
// echo '<pre>';
// print_r($sql);
// echo '</pre>';
?> ?>
@ -225,7 +227,7 @@ if ($data) :
$oneself = ($row['salesman'] == $user_id) ? 1 : 0; $oneself = ($row['salesman'] == $user_id) ? 1 : 0;
?> ?>
<tr> <tr>
<td><?php echo $row['apply_key'] ?></td> <td><a href="query_form.php?apply_key=<?= $row['apply_key'] ?>&token=<?= $_GET['token'] ?>"><?= $row['apply_key'] ?></a></td>
<td><?php echo $row['vol_no'] ?></td> <td><?php echo $row['vol_no'] ?></td>
<td><?php echo $row['address'] ?></td> <td><?php echo $row['address'] ?></td>
<td><?php echo $row['case_name'] ?></td> <td><?php echo $row['case_name'] ?></td>

41
wms/contract-repair/contract-download.php

@ -70,22 +70,17 @@ if (!empty($_GET['apply_key'])) {
$noteArr = array(1, 1, 1, 1, 1); $noteArr = array(1, 1, 1, 1, 1);
$qty = $contract_maintance[0]['num']; $qty = $contract_maintance[0]['num'];
// echo $qty; // echo $qty;
// foreach ($contract_maintance as $idx => $amount) { foreach ($contract_maintance as $idx => $amount) {
// $isset = false; $isset = false;
// if ($amount['payment_kind'] == 5 || $amount['payment_kind'] == 6) {
// if ($amount['pay_scale'] >= 0) { if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) {
// $install_total_price = $install_total_price + $amount['pay_amount']; if ($amount['pay_scale'] > 0) {
// $installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; $buy_total_price = $buy_total_price + $amount['pay_amount'];
// } foreach ($buyArr as $buy) {
// } if ($buy['installment'] == $amount['pay_kind']) {
// if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) { $isset = true;
// if ($amount['pay_scale'] > 0) { }
// $buy_total_price = $buy_total_price + $amount['pay_amount']; }
// foreach ($buyArr as $buy) {
// if ($buy['installment'] == $amount['pay_kind']) {
// $isset = true;
// }
// }
// if (!$isset) { { // if (!$isset) { {
// $buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']]; // $buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
// } // }
@ -93,9 +88,9 @@ if (!empty($_GET['apply_key'])) {
// $buyNo2Pay = true; // $buyNo2Pay = true;
// } // }
// } // }
// } }
// } }
// } }
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL"; $sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$sql_str = "SELECT contract_apply_files.*, contract_new_apply.id as apply_id FROM contract_apply_files LEFT JOIN contract_new_apply ON contract_apply_files.contract_id = contract_new_apply.id WHERE contract_new_apply.mid = :mid AND contract_apply_files.deleted_at IS NULL"; $sql_str = "SELECT contract_apply_files.*, contract_new_apply.id as apply_id FROM contract_apply_files LEFT JOIN contract_new_apply ON contract_apply_files.contract_id = contract_new_apply.id WHERE contract_new_apply.mid = :mid AND contract_apply_files.deleted_at IS NULL";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
@ -119,7 +114,7 @@ if (!empty($_GET['apply_key'])) {
<ul> <ul>
<button :class="isbuyShow ? 'active' : ''" @click="isbuyShow = true">電梯買賣合約書</button> <button :class="isbuyShow ? 'active' : ''" @click="isbuyShow = true">電梯買賣合約書</button>
<button :class="!isbuyShow ?'active' : ''" @click="isbuyShow = false">電梯安裝合約書</button> <button :class="!isbuyShow ?'active' : ''" @click="isbuyShow = false">電梯安裝合約書</button>
<a href="..wms/cont/sign_list.php?function_name=pricereview&<?php echo $token_link; ?>">回列表</a> <a href="../cont/sign_list.php?function_name=sign_list&<?php echo $token_link; ?>">回列表</a>
</ul> </ul>
</div> </div>
<div class="inputDiv" x-show="isbuyShow && isBuyInputIng"> <div class="inputDiv" x-show="isbuyShow && isBuyInputIng">
@ -453,11 +448,11 @@ if (!empty($_GET['apply_key'])) {
const totalInstallPrice = <?php echo $install_total_price; ?>; const totalInstallPrice = <?php echo $install_total_price; ?>;
const totalBuyPrice = <?php echo $buy_total_price; ?>; const totalBuyPrice = <?php echo $buy_total_price; ?>;
// const secondPayDeadline = <?php echo $contract['secondPayDeadline']; ?>; // const secondPayDeadline = <?php echo $contract['secondPayDeadline']; ?>;
// const buyfill1 = <?php echo $contract['tradedeadline']; ?>; const buyfill1 = <?php echo $contract['pre_oreder_date']; ?>;
// const installfill1 = "<?php echo $contract_maintance['test_time']; ?>"; // const installfill1 = "<?php echo $contract_maintance['test_time']; ?>";
// const installfill2 = "<?php echo $contract_maintance['freedeadline']; ?>"; // const installfill2 = "<?php echo $contract_maintance['freedeadline']; ?>";
// const buyArr = [...<?php echo json_encode($buyArr); ?>]; const buyArr = [...<?php echo json_encode($buyArr); ?>];
// const installArr = [...<?php echo json_encode($installArr); ?>]; const installArr = [...<?php echo json_encode($installArr); ?>];
let install_pay_text = '付款方式:<br> '; let install_pay_text = '付款方式:<br> ';
let buy_pay_text = '' let buy_pay_text = ''
const chineseArr = ['零', '一', '二', '三', '四', '五', '六', '七'] const chineseArr = ['零', '一', '二', '三', '四', '五', '六', '七']

33
wms/contract-repair/js/alpine.js

@ -6,6 +6,8 @@ const contractDownload = () => {
this.buystandarData = this.deepClone(this.buydata); this.buystandarData = this.deepClone(this.buydata);
this.buyonstandardViewData = this.deepClone(this.buydata); this.buyonstandardViewData = this.deepClone(this.buydata);
}, },
buyfill1: buyfill1,
css: `table { background - color: #fff; border: none; margin - top: 30px; font - family: '標楷體'; width: 600px; } table tr: nth - child(even), table tr: nth - child(odd) { background - color: #fff; } table tr { font - size: 12pt; width: 100 %; } table tr h2 { font - size: 18pt; } table tr td { width: 100 %; height: 100 %; line - height: 2; display: flex; } table tr td.center { display: flex; justify - content: center; align - items: center; } table tr td.list { width: 100 %; height: 100 %; white - space: nowrap; display: flex; } table tr td.list span { width: 60px; min - height: 100 %; display: block; } table tr td.list > p { display: block; text - align: justify; } table tr td.list div { max - width: calc(100 % - 60px); white - space: normal; } table tr td.list div.text - justify { display: flex; width: 100 %; justify - content: space - between; } table tr.date td > div { width: 100 %; text - align: right; } table tr.date td > div.text - justify { display: flex; justify - content: space - between; } table td, table th { padding: 8px; }`, css: `table { background - color: #fff; border: none; margin - top: 30px; font - family: '標楷體'; width: 600px; } table tr: nth - child(even), table tr: nth - child(odd) { background - color: #fff; } table tr { font - size: 12pt; width: 100 %; } table tr h2 { font - size: 18pt; } table tr td { width: 100 %; height: 100 %; line - height: 2; display: flex; } table tr td.center { display: flex; justify - content: center; align - items: center; } table tr td.list { width: 100 %; height: 100 %; white - space: nowrap; display: flex; } table tr td.list span { width: 60px; min - height: 100 %; display: block; } table tr td.list > p { display: block; text - align: justify; } table tr td.list div { max - width: calc(100 % - 60px); white - space: normal; } table tr td.list div.text - justify { display: flex; width: 100 %; justify - content: space - between; } table tr.date td > div { width: 100 %; text - align: right; } table tr.date td > div.text - justify { display: flex; justify - content: space - between; } table td, table th { padding: 8px; }`,
data: { data: {
illustrate: { illustrate: {
@ -45,6 +47,22 @@ const contractDownload = () => {
] ]
} }
}, },
deepClone: function (obj) {
let clone = Array.isArray(obj) ? [] : {};
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object' && obj[key] !== null) {
clone[key] = this.deepClone(obj[key]);
if (clone[key].text != undefined) {
} else {
clone[key] = obj[key];
}
}
}
}
return clone;
},
buydata: { buydata: {
}, },
@ -129,7 +147,22 @@ const contractDownload = () => {
return; return;
} }
},
isBuyShow: true,
sendBuyInputFn() {
if (this.buyfilt1 == '') {
alert('請輸入交貨期限');
return;
}
if (this.buyfilt1 < 1) {
alert('交貨日期不得低於1日');
return;
} }
if (buyArr[1].installment == 2) {
}
},
isBuyInputIng: true,
} }
}; };

195
wms/contract/api/postContractData.php

@ -1,8 +1,10 @@
<?php <?php
require_once("../conn.php"); require_once("../conn.php");
// require_once("../connt8.php");
include_once("./getFacilityNo.php"); include_once("./getFacilityNo.php");
include_once("./getComboNo.php"); include_once("./getComboNo.php");
include_once("./upload_chk.php"); include_once("./upload_chk.php");
ini_set('date.timezone', 'Asia/Taipei'); ini_set('date.timezone', 'Asia/Taipei');
//保養簽回 //保養簽回
if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'b') { if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'b') {
@ -137,7 +139,14 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$facility_arr[] = $dailyNecessities[$elevator['spec']]; $facility_arr[] = $dailyNecessities[$elevator['spec']];
} }
echo json_encode($facility_arr); echo json_encode($facility_arr);
// 電梯做番號
$facilityno = $createFacilityNo->makeBFacilityNo("T", $facility_arr, (int)$num); $facilityno = $createFacilityNo->makeBFacilityNo("T", $facility_arr, (int)$num);
// if ($user_id == 'M0225') {
// echo '<pre>';
// print_r($facilityno);
// echo '</pre>';
// exit();
// }
echo json_encode($facilityno); echo json_encode($facilityno);
echo '-------'; echo '-------';
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid"; $sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid";
@ -304,6 +313,19 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$stmt->execute(); $stmt->execute();
// $date = date('Y-m-sH-s-i');
// $createTime = str_replace("-", '', $date);
// $sql = "INSERT INTO comCustomer(BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime)VALUES(:BizPartnerId,:PersonId,:CreatorId,1,:InvoiceAddress,:CreateTime)";
// $stmt = $connT8->prepare($sql);
// $stmt->bindParam(':BizPartnerId', $contractno);
// $stmt->bindParam(':PersonId', $salesman);
// $stmt->bindParam(':CreatorId', $user_id);
// $stmt->bindParam(':InvoiceAddress', $address);
// $stmt->bindParam(':CreateTime', $createTime);
// $stmt->execute();
T8insert($_POST, $facilityno);
header('Content-Type: application/json'); header('Content-Type: application/json');
$jsonData = json_encode($files); $jsonData = json_encode($files);
@ -314,4 +336,177 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
echo $e->getMessage(); echo $e->getMessage();
die('Error!:' . $e->getMessage()); die('Error!:' . $e->getMessage());
} }
};
function T8insert($data, $facilityno)
{
require_once("../connt8.php");
$contractno = !empty($data['contractno']) ? $data['contractno'] : null; // 合約號
$address = !empty($data['address']) ? $data['address'] : null; // 客戶地址
$customer = !empty($data['customer']) ? $data['customer'] : null; //企業名稱
$phone = !empty($data['phone']) ? $data['phone'] : null; //客戶電話
$vat = !empty($data['vat']) ? $data['vat'] : null; //統編
$email = !empty($data['email']) ? $data['email'] : null;
$salesman = !empty($data['salesman']) ? $data['salesman'] : null; // 銷售人員
$partyA = !empty($data['partyA']) ? $data['partyA'] : null; //客戶名稱 / 業務聯絡人
$partyAaddress = !empty($data['partyAaddress']) ? $data['partyAaddress'] : null; // 業務聯絡人地址
$contract_begin_date = !empty($data['contract_begin_date']) ? $data['contract_begin_date'] : null;
$contract_end_date = !empty($data['contract_end_date']) ? $data['contract_end_date'] : null;
$num = !empty($data['num']) ? $data['num'] : null; // 電梯數量
$elevators = !empty($data['elevators']) ? json_decode($data['elevators'], true) : []; //電梯
$area = !empty($_POST['area']) ? $_POST['area'] : null; //縣市 Ex. A->台北 , B-> ..。
$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
$connT8->beginTransaction();
$sql = "SELECT * FROM comCustomer WHERE BizPartnerId = :BizPartnerId";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':BizPartnerId', $contractno);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$date = date('Y-m-sH-s-i');
$createTime = str_replace("-", '', $date);
$beginDate = str_replace("-", '', $contract_begin_date);
$endDate = str_replace("-", '', $contract_end_date);
if (empty($result)) {
// 若 客戶資料為空,新增一筆到 comCustomer
// 新增客戶資料
$sql = "INSERT INTO comBusinessPartner
(BizPartnerId,BizPartnerName,BusinessAttr,CountryId,WorkTelNo,BizToDate,TaxNo,EnterpriseName,ContactAddress,EMail,CreatorId,CreateTime,BizPartnerTypeId)
VALUES(:BizPartnerId,:BizPartnerName,1,'TW',:WorkTelNo,99999999,:TaxNo,:EnterpriseName,:ContactAddress,:EMail,:CreatorId,:CreateTime,'10')";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':BizPartnerId', $contractno);
$stmt->bindParam(':BizPartnerName', $partyA);
$stmt->bindParam(':WorkTelNo', $phone);
$stmt->bindParam(':TaxNo', $vat);
$stmt->bindParam(':EnterpriseName', $customer); //企業名稱
$stmt->bindParam(':ContactAddress', $partyAaddress);
$stmt->bindParam(':EMail', $email);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->execute();
$sql = "INSERT INTO comCustomer(OrgId,BizPartnerTypeId,CurrId,BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime)
VALUES('1000','10','TWD',:BizPartnerId,:PersonId,:CreatorId,1,:InvoiceAddress,:CreateTime)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':BizPartnerId', $contractno);
$stmt->bindParam(':PersonId', $salesman);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':InvoiceAddress', $address);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->execute();
} else {
// // 若客戶資料不為空,更新該客戶資訊。
$sql = "UPDATE comCustomer SET
PersonId=:PersonId,
InvoiceAddress=:InvoiceAddress,
LastOperatorId=:LastOperatorId,
LastOperateTime=:LastOperateTime
WHERE BizPartnerId=:BizPartnerId
";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':PersonId', $salesman);
$stmt->bindParam(':InvoiceAddress', $address);
$stmt->bindParam(':LastOperatorId', $user_id);
$stmt->bindParam(':LastOperateTime', $createTime);
$stmt->bindParam(':BizPartnerId', $contractno);
$stmt->execute();
$sql = "UPDATE comBusinessPartner SET
BizPartnerName=:BizPartnerName,
WorkTelNo=:WorkTelNo,
TaxNo=:TaxNo,
EnterpriseName=:EnterpriseName,
ContactAddress=:ContactAddress,
EMail=:EMail,
LastOperatorId=:LastOperatorId,
LastOperateTime=:LastOperateTime
WHERE BizPartnerId = :BizPartnerId
";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':BizPartnerName', $partyA);
$stmt->bindParam(':WorkTelNo', $phone);
$stmt->bindParam(':TaxNo', $vat);
$stmt->bindParam(':EnterpriseName', $customer);
$stmt->bindParam(':ContactAddress', $partyAaddress);
$stmt->bindParam(':EMail', $email);
$stmt->bindParam(':LastOperatorId', $user_id);
$stmt->bindParam(':LastOperateTime', $createTime);
$stmt->bindParam(':BizPartnerId', $contractno);
$stmt->execute();
}
// echo '<pre>';
// print_r($elevators['maintainance']);
// echo '</pre>';
foreach ($elevators as $index => $elevator) {
$type[] = $elevator['maintainance'];
if ($type[$index] == 'A') {
$type = 'C3';
} else if ($type[$index] == 'B') {
$type = 'C4';
} else if ($type[$index] == 'C') {
$type = 'C5';
}
}
// echo '<pre>';
// print_r($type);
// echo '</pre>';
// //新增於 comProject。合約 table
$sql = "INSERT INTO comProject(ProjectId,ProjectName,TypeId,ValidityFromDate,ValidityToDate,CreateTime,CreatorId,IsInUsed)
VALUES(:ProjectId,:ProjectName,:TypeId,:ValidityFromDate,:ValidityToDate,:CreateTime,:CreatorId,1)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':ProjectId', $contractno);
$stmt->bindParam(':ProjectName', $customer);
$stmt->bindParam(':TypeId', $type);
$stmt->bindParam(':ValidityFromDate', $beginDate);
$stmt->bindParam(':ValidityToDate', $endDate);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->execute();
// // 新增電梯數
foreach ($elevators as $index => $elevator) {
echo '<pre>';
print_r($elevator);
echo '</pre>';
$sql = "INSERT INTO comMaterial
(MaterialId,MaterialCategoryId,CreatorId,CreateTime)
VALUES (:MaterialId,'E',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facilityno[$index]);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->execute();
/// 還沒修完
$sql = "INSERT INTO comMaterialGroup
(MaterialTypeId,MaterialId,MaterialName,MaterialCategoryId,UnitId,CreatorId,CreateTime)
VALUES ('10',:MaterialId,:MaterialName,'E','SET',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facilityno[$index]);
$stmt->bindParam(':MaterialName', $customer);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->execute();
/// 還沒修完
$sql = "INSERT INTO comMaterialPurchases
(MaterialId,CurrId,SUnitId,TaxId,CreatorId,CreateTime)
VALUES (:MaterialId,'TWD','SET','ST005',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facilityno[$index]);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->execute();
}
$connT8->commit();
} }

38
wms/contract/api/testT8API.php

@ -0,0 +1,38 @@
<?php
require_once("../connt8.php");
try {
$contractno = 'M0225202300';
$user_id = 'M0225';
// $sql = "INSERT INTO comBusinessPartner (BizPartnerId,TaxNo,CreatorId) VALUES('M0225202301','0923373895','$userid')";
// $stmt = $connT8->prepare($sql);
// $stmt->execute();
$sql = "UPDATE comBusinessPartner SET WorkTelNo = '' WHERE BizPartnerId= 'M0225202301'";
$stmt = $connT8->prepare($sql);
$stmt->execute();
echo 'Success';
} catch (PDOException $e) {
echo '<script>alert("更新失敗")</script>';
}
// $sql = "SELECT * FROM comCustomer WHERE BizPartnerId = :BizPartnerId";
// $stmt = $conn->prepare($sql);
// $stmt->bindParam(':BizPartnerId', $contractno);
// $stmt->execute();
// $result = $stmt->fetch(PDO::FETCH_NUM);
// $arr = array();
// if (!empty($result)) {
// foreach ($result as $key => $value) {
// $arr[$key] = $value;
// }
// }
// $count = empty($result) == '' ? 0 : COUNT($result);
// echo '<pre>';
// print_r($result);
// echo '</pre>';
// echo '<br/>';
// $createTime = Date('Y-m-sH-i-s');
// echo str_replace('-', '', $createTime);

3
wms/contract/conn.php

@ -34,8 +34,7 @@ try{
//設定主動以警告的形式報錯 //設定主動以警告的形式報錯
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//如果連接錯誤,將抛出一個PDOException異常對象 //如果連接錯誤,將抛出一個PDOException異常對象
} } catch (PDOException $e) {
catch ( PDOException $e ){
//如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作 //如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作
die("ERROR!!!: " . $e->getMessage()); die("ERROR!!!: " . $e->getMessage());
} }

15
wms/contract/connt8.php

@ -0,0 +1,15 @@
<?php
require_once dirname(__FILE__) . "/../../mkt/database.php";
include "/Users/LO_2342/Desktop/httpdocs/wms/fun_global.php";
// phpinfo();
// exit();
try {
$connT8 = new PDO("sqlsrv:Server=220.130.203.251;Database=T8TEST", "M0225", "IFFBU1E=");
if ($connT8) {
$connT8->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
} catch (PDOException $e) {
// echo "fail";
// echo $e->getMessage();
die("ERROR!!!: " . $e->getMessage());
}

BIN
wms/facility-price.xlsx

Binary file not shown.

2
wms/header.php

@ -34,7 +34,7 @@ if (isset($_REQUEST["function_name"])) {
* 連線T8 MSSQL * 連線T8 MSSQL
*/ */
try { try {
$conn = new PDO("sqlsrv:Server=220.130.203.251;Database=T8MASADA", "masada", "ztPmPP!HRoV6SL3E"); $conn = new PDO("sqlsrv:Server=220.130.203.251;Database=T8MASADA", "M0225", "IFFBU1E=");
if ($conn) { if ($conn) {
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} }

365
wms/mkt/price_normal-index.php

@ -7,22 +7,27 @@ include "../header.php";
.container { .container {
padding-top: 10px !important; padding-top: 10px !important;
} }
#exTab1 .tab-content { #exTab1 .tab-content {
color: white; color: white;
padding: 5px 15px; padding: 5px 15px;
} }
/* remove border radius for the tab */ /* remove border radius for the tab */
#exTab1 .nav-pills>li>a { #exTab1 .nav-pills>li>a {
border-radius: 10%; border-radius: 10%;
font-size: 16px; font-size: 16px;
} }
#exTab1 .tab-content table { #exTab1 .tab-content table {
border: 1px solid #000; border: 1px solid #000;
} }
</style> </style>
<div style="overflow-x:auto;"> <div style="overflow-x:auto;">
<div class="container"><h2>電梯標準價查詢</h2></div> <div class="container">
<h2>電梯標準價查詢</h2>
</div>
<div id="exTab1" class="container"> <div id="exTab1" class="container">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li class="active"><a href="#1a" data-toggle="tab">小機房</a></li> <li class="active"><a href="#1a" data-toggle="tab">小機房</a></li>
@ -51,36 +56,34 @@ include "../header.php";
<td class=xl123 width=213 style='width:160pt'>單位:萬元</td> <td class=xl123 width=213 style='width:160pt'>單位:萬元</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt'><span <td height=51 class=xl89 style='height:38.0pt'><span style='mso-spacerun:yes'> </span>
style='mso-spacerun:yes'> </span><font class="font21"><span <font class="font21"><span style='mso-spacerun:yes'>                </span></font>
style='mso-spacerun:yes'>                </span></font></td> </td>
<td class=xl89 style='border-top:none;border-left:none'>標準價</td> <td class=xl89 style='border-top:none;border-left:none'>標準價</td>
<td class=xl89 style='border-top:none;border-left:none'>(±1S)<span <td class=xl89 style='border-top:none;border-left:none'>(±1S)<span style='mso-spacerun:yes'> </span></td>
style='mso-spacerun:yes'> </span></td>
<td colspan=2 rowspan=12 class=xl124 width=461 style='border-right:1.0pt solid black; <td colspan=2 rowspan=12 class=xl124 width=461 style='border-right:1.0pt solid black;
border-bottom:1.0pt solid black;width:346pt;vertical-align:middle;text-align:left;font-size:16px;'>1、1.0最低到5停;5停以下以5停計。<br> border-bottom:1.0pt solid black;width:346pt;vertical-align:middle;text-align:left;font-size:16px;'>1、1.5及1.75最低到5停,5停以下以5停計。<br>
2、1.5及1.75最低到8停;8停以下以8停計。<br> 2、處長權限為發佈價之80%。<br>
3、1.5變為1.75---》+5.4萬/台;加減1停同1.5。<br> </td>
4、經理權限為發佈價之80%、業務部協理權限為75%。</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-6*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-6*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>89.0</td> <td class=xl81 style='border-top:none;border-left:none'>90.1</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-8*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-8*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>89.1</td> <td class=xl81 style='border-top:none;border-left:none'>90.1</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-9*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-9*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>89.7</td> <td class=xl81 style='border-top:none;border-left:none'>90.4</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-10*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-10*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>90.4</td> <td class=xl81 style='border-top:none;border-left:none'>91.9</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
@ -90,64 +93,63 @@ include "../header.php";
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-12*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-12*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>95.6</td> <td class=xl81 style='border-top:none;border-left:none'>95.2</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>98.0</td> <td class=xl81 style='border-top:none;border-left:none'>97.8</td>
<td class=xl81 style='border-top:none;border-left:none'>4.1</td> <td class=xl81 style='border-top:none;border-left:none'>4.1</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>98.5</td> <td class=xl81 style='border-top:none;border-left:none'>98.3</td>
<td class=xl81 style='border-top:none;border-left:none'>4.1</td> <td class=xl81 style='border-top:none;border-left:none'>4.1</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>133.6</td> <td class=xl81 style='border-top:none;border-left:none'>130.6</td>
<td class=xl81 style='border-top:none;border-left:none'>5.1</td> <td class=xl81 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>153.2</td> <td class=xl81 style='border-top:none;border-left:none'>150.2</td>
<td class=xl81 style='border-top:none;border-left:none'>5.4</td> <td class=xl81 style='border-top:none;border-left:none'>4.9</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAE100-24*7-CO60</td> <td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAE100-24*7-CO60</td>
<td class=xl81 style='border-top:none;border-left:none'>158.4</td> <td class=xl81 style='border-top:none;border-left:none'>155.4</td>
<td class=xl81 style='border-top:none;border-left:none'>5.4</td> <td class=xl81 style='border-top:none;border-left:none'>4.9</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td colspan=5 height=51 class=xl123 style='height:38.0pt'> </td> <td colspan=5 height=51 class=xl123 style='height:38.0pt'> </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt'><span <td height=51 class=xl89 style='height:38.0pt'><span style='mso-spacerun:yes'> </span>
style='mso-spacerun:yes'> </span><font class="font21"><span <font class="font21"><span style='mso-spacerun:yes'>                </span></font>
style='mso-spacerun:yes'>                </span></font></td> </td>
<td class=xl89 style='border-left:none'>標準價</td> <td class=xl89 style='border-left:none'>標準價</td>
<td class=xl89 style='border-left:none'>(±1S)<span <td class=xl89 style='border-left:none'>(±1S)<span style='mso-spacerun:yes'> </span></td>
style='mso-spacerun:yes'> </span></td>
<td class=xl91 style='border-left:none'>規格</td> <td class=xl91 style='border-left:none'>規格</td>
<td class=xl92 style='border-left:none'>標準價</td> <td class=xl92 style='border-left:none'>標準價</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-8*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-8*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>101.5</td> <td class=xl81 style='border-top:none;border-left:none'>102.1</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
<td class=xl114 style='border-top:none'>MAE100-8*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-8*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>106.3</td> <td class=xl81 style='border-top:none;border-left:none'>106.3</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-9*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-9*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>102.1</td> <td class=xl81 style='border-top:none;border-left:none'>102.6</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
<td class=xl114 style='border-top:none'>MAE100-9*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-9*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>107.4</td> <td class=xl81 style='border-top:none;border-left:none'>107.4</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-10*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-10*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>103.0</td> <td class=xl81 style='border-top:none;border-left:none'>108.0</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
<td class=xl114 style='border-top:none'>MAE100-10*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-10*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>108.6</td> <td class=xl81 style='border-top:none;border-left:none'>108.6</td>
@ -164,42 +166,42 @@ include "../header.php";
<td class=xl81 style='border-top:none;border-left:none'>110.0</td> <td class=xl81 style='border-top:none;border-left:none'>110.0</td>
<td class=xl81 style='border-top:none;border-left:none'>4.0</td> <td class=xl81 style='border-top:none;border-left:none'>4.0</td>
<td class=xl114 style='border-top:none'>MAE100-12*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-12*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>115.5</td> <td class=xl81 style='border-top:none;border-left:none'>115.3</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>112.2</td> <td class=xl81 style='border-top:none;border-left:none'>112.2</td>
<td class=xl81 style='border-top:none;border-left:none'>4.1</td> <td class=xl81 style='border-top:none;border-left:none'>4.1</td>
<td class=xl114 style='border-top:none'>MAE100-13*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-13*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>117.8</td> <td class=xl81 style='border-top:none;border-left:none'>117.5</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>113.4</td> <td class=xl81 style='border-top:none;border-left:none'>113.4</td>
<td class=xl81 style='border-top:none;border-left:none'>4.1</td> <td class=xl81 style='border-top:none;border-left:none'>4.1</td>
<td class=xl114 style='border-top:none'>MAE100-15*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-15*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>119.0</td> <td class=xl81 style='border-top:none;border-left:none'>118.8</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>151.1</td> <td class=xl81 style='border-top:none;border-left:none'>148.1</td>
<td class=xl81 style='border-top:none;border-left:none'>5.1</td> <td class=xl81 style='border-top:none;border-left:none'>4.5</td>
<td class=xl114 style='border-top:none'>MAE100-17*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-17*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>156.7</td> <td class=xl81 style='border-top:none;border-left:none'>152.7</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>173.0</td> <td class=xl81 style='border-top:none;border-left:none'>170.0</td>
<td class=xl81 style='border-top:none;border-left:none'>5.4</td> <td class=xl81 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAE100-20*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-20*10-CO105</td>
<td class=xl81 style='border-top:none;border-left:none'>178.6</td> <td class=xl81 style='border-top:none;border-left:none'>173.6</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAE100-24*10-CO90</td> <td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAE100-24*10-CO90</td>
<td class=xl81 style='border-top:none;border-left:none'>192.0</td> <td class=xl81 style='border-top:none;border-left:none'>188.0</td>
<td class=xl81 style='border-top:none;border-left:none'>5.4</td> <td class=xl81 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAE100-24*10-CO105</td> <td class=xl114 style='border-top:none'>MAE100-24*10-CO105</td>
<td class=xl82 style='border-top:none;border-left:none'>198.0</td> <td class=xl82 style='border-top:none;border-left:none'>193.0</td>
</tr> </tr>
<![if supportMisalignedColumns]> <![if supportMisalignedColumns]>
<tr height=0 style='display:none'> <tr height=0 style='display:none'>
@ -227,137 +229,133 @@ include "../header.php";
<td class=xl123 width=213 style='width:160pt'>單位:萬元</td> <td class=xl123 width=213 style='width:160pt'>單位:萬元</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl93 style='height:38.0pt'><span <td height=51 class=xl93 style='height:38.0pt'><span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'>                </span></td>
style='mso-spacerun:yes'> </span><span
style='mso-spacerun:yes'>                </span></td>
<td class=xl93 style='border-top:none;border-left:none'>標準價</td> <td class=xl93 style='border-top:none;border-left:none'>標準價</td>
<td class=xl93 style='border-top:none;border-left:none'>(±1S)<span <td class=xl93 style='border-top:none;border-left:none'>(±1S)<span style='mso-spacerun:yes'> </span></td>
style='mso-spacerun:yes'> </span></td>
<td colspan=2 rowspan=11 class=xl124 width=470 style='border-right:1.0pt solid black; <td colspan=2 rowspan=11 class=xl124 width=470 style='border-right:1.0pt solid black;
width:353pt;vertical-align:middle;text-align:left;font-size:16px;'>1、1.0最低到5停;5停以下以5停計。<br> width:353pt;vertical-align:middle;text-align:left;font-size:16px;'>1、1.5及1.75停最低到5停;5停以下以5停計。<br>
2、1.5及1.75最低到8停;8停以下以8停計。<br> 2、處長權限為發布價之80%。<br>
3、1.5變為1.75---》+5.4萬/台;加減1停同1.5。<br> </td>
4、營業員權限為發佈價之73%</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-8*7-CO60</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-8*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>117.5</td> <td class=xl83 style='border-top:none;border-left:none'>111.9</td>
<td class=xl83 style='border-top:none;border-left:none'>4.5</td> <td class=xl83 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-9*7-CO60</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-9*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>118.7</td> <td class=xl83 style='border-top:none;border-left:none'>112.7</td>
<td class=xl83 style='border-top:none;border-left:none'>4.5</td> <td class=xl83 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-10*7-CO60</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-10*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>120.1</td> <td class=xl83 style='border-top:none;border-left:none'>114.3</td>
<td class=xl83 style='border-top:none;border-left:none'>4.5</td> <td class=xl83 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-11*7-CO60</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-11*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>121.2</td> <td class=xl83 style='border-top:none;border-left:none'>115.4</td>
<td class=xl83 style='border-top:none;border-left:none'>4.5</td> <td class=xl83 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-12*7-CO60</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-12*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>122.5</td> <td class=xl83 style='border-top:none;border-left:none'>116.6</td>
<td class=xl83 style='border-top:none;border-left:none'>4.5</td> <td class=xl83 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-13*7-CO60</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-13*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>123.8</td> <td class=xl83 style='border-top:none;border-left:none'>117.8</td>
<td class=xl83 style='border-top:none;border-left:none'>4.5</td> <td class=xl83 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-15*7-CO60</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAM200-15*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>124.9</td> <td class=xl83 style='border-top:none;border-left:none'>118.9</td>
<td class=xl83 style='border-top:none;border-left:none'>4.5</td> <td class=xl83 style='border-top:none;border-left:none'>4.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-17*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-17*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>187.4</td> <td class=xl83 style='border-top:none;border-left:none'>178.3</td>
<td class=xl83 style='border-top:none;border-left:none'>6.4</td> <td class=xl83 style='border-top:none;border-left:none'>5.7</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-20*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-20*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>204.8</td> <td class=xl83 style='border-top:none;border-left:none'>194.8</td>
<td class=xl83 style='border-top:none;border-left:none'>6.4</td> <td class=xl83 style='border-top:none;border-left:none'>5.7</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-24*7-CO60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-24*7-CO60</td>
<td class=xl83 style='border-top:none;border-left:none'>208.5</td> <td class=xl83 style='border-top:none;border-left:none'>198.3</td>
<td class=xl83 style='border-top:none;border-left:none'>6.4</td> <td class=xl83 style='border-top:none;border-left:none'>5.7</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-8*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-8*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>133.4</td> <td class=xl83 style='border-top:none;border-left:none'>127.7</td>
<td class=xl83 style='border-top:none;border-left:none'>4.9</td> <td class=xl83 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAM200-8*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-8*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>139.1</td> <td class=xl84 style='border-top:none;border-left:none'>131.6</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-9*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-9*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>134.5</td> <td class=xl83 style='border-top:none;border-left:none'>128.7</td>
<td class=xl83 style='border-top:none;border-left:none'>4.9</td> <td class=xl83 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAM200-9*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-9*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>140.2</td> <td class=xl84 style='border-top:none;border-left:none'>132.7</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-10*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-10*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>135.8</td> <td class=xl83 style='border-top:none;border-left:none'>130.0</td>
<td class=xl83 style='border-top:none;border-left:none'>4.9</td> <td class=xl83 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAM200-10*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-10*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>141.5</td> <td class=xl84 style='border-top:none;border-left:none'>133.9</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-11*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-11*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>137.1</td> <td class=xl83 style='border-top:none;border-left:none'>131.2</td>
<td class=xl83 style='border-top:none;border-left:none'>4.9</td> <td class=xl83 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAM200-11*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-11*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>142.8</td> <td class=xl84 style='border-top:none;border-left:none'>135.1</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-12*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-12*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>138.2</td> <td class=xl83 style='border-top:none;border-left:none'>132.3</td>
<td class=xl83 style='border-top:none;border-left:none'>4.9</td> <td class=xl83 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAM200-12*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-12*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>143.9</td> <td class=xl84 style='border-top:none;border-left:none'>136.2</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-13*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-13*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>140.0</td> <td class=xl83 style='border-top:none;border-left:none'>134.0</td>
<td class=xl83 style='border-top:none;border-left:none'>4.9</td> <td class=xl83 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAM200-13*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-13*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>145.7</td> <td class=xl84 style='border-top:none;border-left:none'>137.9</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-15*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-15*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>141.2</td> <td class=xl83 style='border-top:none;border-left:none'>135.1</td>
<td class=xl83 style='border-top:none;border-left:none'>4.9</td> <td class=xl83 style='border-top:none;border-left:none'>4.9</td>
<td class=xl114 style='border-top:none'>MAM200-15*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-15*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>146.9</td> <td class=xl84 style='border-top:none;border-left:none'>139.0</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-17*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-17*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>202.8</td> <td class=xl83 style='border-top:none;border-left:none'>196.6</td>
<td class=xl83 style='border-top:none;border-left:none'>6.5</td> <td class=xl83 style='border-top:none;border-left:none'>5.9</td>
<td class=xl114 style='border-top:none'>MAM200-17*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-17*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>208.5</td> <td class=xl84 style='border-top:none;border-left:none'>199.5</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-20*10-CO90</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAM200-20*10-CO90</td>
<td class=xl83 style='border-top:none;border-left:none'>220.2</td> <td class=xl83 style='border-top:none;border-left:none'>213.2</td>
<td class=xl83 style='border-top:none;border-left:none'>6.5</td> <td class=xl83 style='border-top:none;border-left:none'>5.9</td>
<td class=xl114 style='border-top:none'>MAM200-20*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-20*10-CO105</td>
<td class=xl84 style='border-top:none;border-left:none'>225.9</td> <td class=xl84 style='border-top:none;border-left:none'>223.9</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAM200-24*10-CO90</td> <td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAM200-24*10-CO90</td>
<td class=xl85 style='border-top:none;border-left:none'>223.9</td> <td class=xl85 style='border-top:none;border-left:none'>216.7</td>
<td class=xl85 style='border-top:none;border-left:none'>6.5</td> <td class=xl85 style='border-top:none;border-left:none'>5.9</td>
<td class=xl114 style='border-top:none'>MAM200-24*10-CO105</td> <td class=xl114 style='border-top:none'>MAM200-24*10-CO105</td>
<td class=xl86 style='border-top:none;border-left:none'>229.6</td> <td class=xl86 style='border-top:none;border-left:none'>227.6</td>
</tr> </tr>
<![if supportMisalignedColumns]> <![if supportMisalignedColumns]>
<tr height=0 style='display:none'> <tr height=0 style='display:none'>
@ -378,17 +376,16 @@ include "../header.php";
<col width=261 span=2 style='mso-width-source:userset;mso-width-alt:8362; <col width=261 span=2 style='mso-width-source:userset;mso-width-alt:8362;
width:196pt'> width:196pt'>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl123 width=261 style='height:38.0pt;width:196pt'><font class="font20">小電梯</font></td> <td height=51 class=xl123 width=261 style='height:38.0pt;width:196pt'>
<font class="font20">小電梯</font>
</td>
<td class=xl123 width=261 style='width:196pt'>MAH100</td> <td class=xl123 width=261 style='width:196pt'>MAH100</td>
<td class=xl123 width=261 style='width:196pt'>單位:萬元</td> <td class=xl123 width=261 style='width:196pt'>單位:萬元</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl95 style='height:38.0pt'><span <td height=51 class=xl95 style='height:38.0pt'><span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'>                </span></td>
style='mso-spacerun:yes'> </span><span
style='mso-spacerun:yes'>                </span></td>
<td class=xl95 style='border-left:none'>標準價</td> <td class=xl95 style='border-left:none'>標準價</td>
<td class=xl95 style='border-left:none'>(±1S)<span <td class=xl95 style='border-left:none'>(±1S)<span style='mso-spacerun:yes'> </span></td>
style='mso-spacerun:yes'> </span></td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAH100-6*5-2S45</td> <td height=51 class=xl94 style='height:38.0pt;border-top:none'>MAH100-6*5-2S45</td>
@ -422,8 +419,8 @@ include "../header.php";
</tr> </tr>
<tr class=xl67 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl67 height=51 style='mso-height-source:userset;height:38.0pt'>
<td colspan=2 rowspan=4 height=150 class=xl129 width=522 style='height:113.75pt;width:392pt'>註:<br> <td colspan=2 rowspan=4 height=150 class=xl129 width=522 style='height:113.75pt;width:392pt'>註:<br>
1、最低到3停;2停以3停計。<br>
2、經理權限為發佈價之80%、業務部協理權限為75%。</td> 1、處長權限為發布價之80%。</td>
<td class="xl67"></td> <td class="xl67"></td>
</tr> </tr>
<![if supportMisalignedColumns]> <![if supportMisalignedColumns]>
@ -444,85 +441,82 @@ include "../header.php";
<td class=xl123 width=261 style='width:196pt'>單位:萬元</td> <td class=xl123 width=261 style='width:196pt'>單位:萬元</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl95 style='height:38.0pt'><span <td height=51 class=xl95 style='height:38.0pt'><span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'>                </span></td>
style='mso-spacerun:yes'> </span><span
style='mso-spacerun:yes'>                </span></td>
<td class=xl88 style='border-left:none'>標準價</td> <td class=xl88 style='border-left:none'>標準價</td>
<td class=xl92 style='border-left:none'>(±1S)<span <td class=xl92 style='border-left:none'>(±1S)<span style='mso-spacerun:yes'> </span></td>
style='mso-spacerun:yes'> </span></td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-12*20-CO120</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-12*20-CO120</td>
<td class=xl109 style='border-top:none;border-left:none'>180.0 </td> <td class=xl109 style='border-top:none;border-left:none'>190.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>5.0 </td> <td class=xl110 style='border-top:none;border-left:none'>4.8 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*20-CO120</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*20-CO120</td>
<td class=xl109 style='border-top:none;border-left:none'>181.3 </td> <td class=xl109 style='border-top:none;border-left:none'>191.3 </td>
<td class=xl110 style='border-top:none;border-left:none'>5.0 </td> <td class=xl110 style='border-top:none;border-left:none'>4.8 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*20-CO120</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*20-CO120</td>
<td class=xl109 style='border-top:none;border-left:none'>182.7 </td> <td class=xl109 style='border-top:none;border-left:none'>192.7 </td>
<td class=xl110 style='border-top:none;border-left:none'>5.0 </td> <td class=xl110 style='border-top:none;border-left:none'>4.8 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*20-CO120</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*20-CO120</td>
<td class=xl109 style='border-top:none;border-left:none'>217.1 </td> <td class=xl109 style='border-top:none;border-left:none'>215.1 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.3 </td> <td class=xl110 style='border-top:none;border-left:none'>5.8 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*20-CO120</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*20-CO120</td>
<td class=xl109 style='border-top:none;border-left:none'>225.6 </td> <td class=xl109 style='border-top:none;border-left:none'>223.6 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.4 </td> <td class=xl110 style='border-top:none;border-left:none'>5.9 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-24*20-CO120</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-24*20-CO120</td>
<td class=xl109 style='border-top:none;border-left:none'>240.2 </td> <td class=xl109 style='border-top:none;border-left:none'>238.2 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.5 </td> <td class=xl110 style='border-top:none;border-left:none'>6.0 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-12*20-CO150</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-12*20-CO150</td>
<td class=xl109 style='border-top:none;border-left:none'>223.0 </td> <td class=xl109 style='border-top:none;border-left:none'>216.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.1 </td> <td class=xl110 style='border-top:none;border-left:none'>5.7 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*20-CO150</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-13*20-CO150</td>
<td class=xl109 style='border-top:none;border-left:none'>224.1 </td> <td class=xl109 style='border-top:none;border-left:none'>224.1 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.1 </td> <td class=xl110 style='border-top:none;border-left:none'>5.7 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*20-CO150</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-15*20-CO150</td>
<td class=xl109 style='border-top:none;border-left:none'>225.4 </td> <td class=xl109 style='border-top:none;border-left:none'>225.4 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.1 </td> <td class=xl110 style='border-top:none;border-left:none'>5.7 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*20-CO150</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-17*20-CO150</td>
<td class=xl109 style='border-top:none;border-left:none'>239.9 </td> <td class=xl109 style='border-top:none;border-left:none'>236.9 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.5 </td> <td class=xl110 style='border-top:none;border-left:none'>6.0 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*20-CO150</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAE100-20*20-CO150</td>
<td class=xl109 style='border-top:none;border-left:none'>244.3 </td> <td class=xl109 style='border-top:none;border-left:none'>241.3 </td>
<td class=xl110 style='border-top:none;border-left:none'>6.5 </td> <td class=xl110 style='border-top:none;border-left:none'>6.0 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAE100-24*20-CO150</td> <td height=51 class=xl90 style='height:38.0pt;border-top:none'>MAE100-24*20-CO150</td>
<td class=xl111 style='border-top:none;border-left:none'>253.3 </td> <td class=xl111 style='border-top:none;border-left:none'>250.3 </td>
<td class=xl112 style='border-top:none;border-left:none'>6.5 </td> <td class=xl112 style='border-top:none;border-left:none'>6.0 </td>
</tr> </tr>
<tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'> <tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'>
<td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>註:<br>1、2.0及2.5最低到15停;15停以下以15停計</td> <td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>註:<br>1、2.0及2.5最低到15停;15停以下以15停計</td>
<td class=xl99></td> <td class=xl99></td>
</tr> </tr>
<tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'> <tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'>
<td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>2、P-12(含)以下以P-13計</td> <td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>2、處長權限為發布價之80%</td>
<td class=xl99></td> <td class=xl99></td>
</tr> </tr>
<tr class=xl69 height=33 style='mso-height-source:userset;height:25.25pt'> <!-- <tr class=xl69 height=33 style='mso-height-source:userset;height:25.25pt'>
<td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>3、經理權限為發佈價之80%、業務部協理權限為75%。</td> <td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>3、經理權限為發佈價之80%、業務部協理權限為75%。</td>
<td class=xl113></td> <td class=xl113></td>
</tr> </tr> -->
<tr class=xl69 height=33 style='mso-height-source:userset;height:25.25pt'> <tr class=xl69 height=33 style='mso-height-source:userset;height:25.25pt'>
<td height=33 class=xl69 style='height:25.25pt'></td> <td height=33 class=xl69 style='height:25.25pt'></td>
<td class=xl69></td> <td class=xl69></td>
@ -546,94 +540,91 @@ include "../header.php";
<td class=xl123 width=261 style='width:196pt'>單位:萬元</td> <td class=xl123 width=261 style='width:196pt'>單位:萬元</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl95 style='height:38.0pt'><span <td height=51 class=xl95 style='height:38.0pt'><span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'>                </span></td>
style='mso-spacerun:yes'> </span><span
style='mso-spacerun:yes'>                </span></td>
<td class=xl88 style='border-left:none'>標準價</td> <td class=xl88 style='border-left:none'>標準價</td>
<td class=xl92 style='border-left:none'>(±1S)<span <td class=xl92 style='border-left:none'>(±1S)<span style='mso-spacerun:yes'> </span></td>
style='mso-spacerun:yes'> </span></td>
</tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-750*3-2S45</td>
<td class=xl109 style='border-top:none;border-left:none'>114.3 </td>
<td class=xl110 style='border-top:none;border-left:none'>5.8 </td>
</tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-750*3-2S60</td>
<td class=xl109 style='border-top:none;border-left:none'>115.5 </td>
<td class=xl110 style='border-top:none;border-left:none'>5.8 </td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1000*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1000*3-2S45</td>
<td class=xl109 style='border-top:none;border-left:none'>136.4 </td> <td class=xl109 style='border-top:none;border-left:none'>116.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>8.7 </td> <td class=xl110 style='border-top:none;border-left:none'>5.3 </td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1000*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1000*3-2S60</td>
<td class=xl109 style='border-top:none;border-left:none'>138.5 </td> <td class=xl109 style='border-top:none;border-left:none'>117.8 </td>
<td class=xl110 style='border-top:none;border-left:none'>8.7 </td> <td class=xl110 style='border-top:none;border-left:none'>5.3 </td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1500*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1500*3-2S45</td>
<td class=xl109 style='border-top:none;border-left:none'>171.4 </td> <td class=xl109 style='border-top:none;border-left:none'>145.7 </td>
<td class=xl110 style='border-top:none;border-left:none'>9.7 </td> <td class=xl110 style='border-top:none;border-left:none'>9.8 </td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1500*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-1500*3-2S60</td>
<td class=xl109 style='border-top:none;border-left:none'>175.5 </td> <td class=xl109 style='border-top:none;border-left:none'>149.2 </td>
<td class=xl110 style='border-top:none;border-left:none'>9.7 </td> <td class=xl110 style='border-top:none;border-left:none'>9.8 </td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2000*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2000*3-2S45</td>
<td class=xl109 style='border-top:none;border-left:none'>195.3 </td> <td class=xl109 style='border-top:none;border-left:none'>166.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>10.0 </td> <td class=xl110 style='border-top:none;border-left:none'>10.0 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2000*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2000*3-2S60</td>
<td class=xl109 style='border-top:none;border-left:none'>198.5 </td> <td class=xl109 style='border-top:none;border-left:none'>168.7 </td>
<td class=xl110 style='border-top:none;border-left:none'>10.0 </td> <td class=xl110 style='border-top:none;border-left:none'>10.0 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2500*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2500*3-4PCO45</td>
<td class=xl109 style='border-top:none;border-left:none'>286.3 </td> <td class=xl109 style='border-top:none;border-left:none'>243.3 </td>
<td class=xl110 style='border-top:none;border-left:none'>15.1 </td> <td class=xl110 style='border-top:none;border-left:none'>14.2 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2500*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-2500*3-4PCO60</td>
<td class=xl109 style='border-top:none;border-left:none'>288.3 </td> <td class=xl109 style='border-top:none;border-left:none'>245.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>15.1 </td> <td class=xl110 style='border-top:none;border-left:none'>14.2 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3000*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3000*3-4PCO45</td>
<td class=xl109 style='border-top:none;border-left:none'>307.7 </td> <td class=xl109 style='border-top:none;border-left:none'>261.5 </td>
<td class=xl110 style='border-top:none;border-left:none'>16.3 </td> <td class=xl110 style='border-top:none;border-left:none'>15.2 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3000*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3000*3-4PCO60</td>
<td class=xl109 style='border-top:none;border-left:none'>309.5 </td> <td class=xl109 style='border-top:none;border-left:none'>263.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>16.3 </td> <td class=xl110 style='border-top:none;border-left:none'>15.2 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3500*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3500*3-4PCO45</td>
<td class=xl109 style='border-top:none;border-left:none'>365.5 </td> <td class=xl109 style='border-top:none;border-left:none'>310.6 </td>
<td class=xl110 style='border-top:none;border-left:none'>18.2 </td> <td class=xl110 style='border-top:none;border-left:none'>18.2 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3500*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-3500*3-4PCO60</td>
<td class=xl109 style='border-top:none;border-left:none'>368.5 </td> <td class=xl109 style='border-top:none;border-left:none'>313.2 </td>
<td class=xl110 style='border-top:none;border-left:none'>18.2 </td> <td class=xl110 style='border-top:none;border-left:none'>18.2 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-4000*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-4000*3-6PCO45</td>
<td class=xl109 style='border-top:none;border-left:none'>407.5 </td> <td class=xl109 style='border-top:none;border-left:none'>346.4 </td>
<td class=xl110 style='border-top:none;border-left:none'>20.5 </td> <td class=xl110 style='border-top:none;border-left:none'>20.5 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-4000*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-4000*3-6PCO60</td>
<td class=xl109 style='border-top:none;border-left:none'>409.5 </td> <td class=xl109 style='border-top:none;border-left:none'>348.1 </td>
<td class=xl110 style='border-top:none;border-left:none'>20.5 </td> <td class=xl110 style='border-top:none;border-left:none'>20.5 </td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-5000*3-6PCO45</td>
<td class=xl109 style='border-top:none;border-left:none'>442.5 </td>
<td class=xl110 style='border-top:none;border-left:none'>24.0 </td>
</tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-5000*3-6PCO60</td>
<td class=xl109 style='border-top:none;border-left:none'>447.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>24.0 </td>
</tr>
<!-- <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-5000*3-2S45</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-5000*3-2S45</td>
<td class=xl109 style='border-top:none;border-left:none'>520.5 </td> <td class=xl109 style='border-top:none;border-left:none'>520.5 </td>
<td class=xl110 style='border-top:none;border-left:none'>25.5 </td> <td class=xl110 style='border-top:none;border-left:none'>25.5 </td>
@ -642,14 +633,14 @@ include "../header.php";
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-5000*3-2S60</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAF100-5000*3-2S60</td>
<td class=xl111 style='border-top:none;border-left:none'>525.8 </td> <td class=xl111 style='border-top:none;border-left:none'>525.8 </td>
<td class=xl112 style='border-top:none;border-left:none'>25.5 </td> <td class=xl112 style='border-top:none;border-left:none'>25.5 </td>
</tr> </tr> -->
<tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'> <tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'>
<td height=33 class=xl99 style='height:25.25pt'>註:<br>1、最低為2停</td> <td height=33 class=xl99 style='height:25.25pt'>註:<br>1、最低為2停</td>
<td class=xl99></td> <td class=xl99></td>
<td class=xl99></td> <td class=xl99></td>
</tr> </tr>
<tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'> <tr class=xl67 height=33 style='mso-height-source:userset;height:25.25pt'>
<td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>2、經理權限為發佈價之80%、業務部協理權限為75%。</td> <td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>2、處長權限為發佈價之80%。</td>
<td class=xl99></td> <td class=xl99></td>
</tr> </tr>
<![if supportMisalignedColumns]> <![if supportMisalignedColumns]>
@ -670,16 +661,14 @@ include "../header.php";
<td class=xl123 width=323 style='width:242pt'>單位:萬元</td> <td class=xl123 width=323 style='width:242pt'>單位:萬元</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl95 style='height:38.0pt'><span <td height=51 class=xl95 style='height:38.0pt'><span style='mso-spacerun:yes'> </span><span style='mso-spacerun:yes'>                </span></td>
style='mso-spacerun:yes'> </span><span
style='mso-spacerun:yes'>                </span></td>
<td class=xl88 style='border-left:none'>標準價</td> <td class=xl88 style='border-left:none'>標準價</td>
<td class=xl88 style='border-left:none'>提升高度標準</td> <td class=xl88 style='border-left:none'>提升高度標準</td>
<td class=xl92 style='border-left:none'>備註</td> <td class=xl92 style='border-left:none'>備註</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*2-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*2-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>78.5 </td> <td class=xl109 style='border-top:none;border-left:none'>75.0 </td>
<td class=xl109 style='border-top:none;border-left:none'>3.0 </td> <td class=xl109 style='border-top:none;border-left:none'>3.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td>
</tr> </tr>
@ -703,43 +692,43 @@ include "../header.php";
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*2-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*2-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>80.2 </td> <td class=xl109 style='border-top:none;border-left:none'>82.0 </td>
<td class=xl109 style='border-top:none;border-left:none'>3.0 </td> <td class=xl109 style='border-top:none;border-left:none'>3.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*3-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*3-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>88.5 </td> <td class=xl109 style='border-top:none;border-left:none'>90.0 </td>
<td class=xl109 style='border-top:none;border-left:none'>6.0 </td> <td class=xl109 style='border-top:none;border-left:none'>6.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td>
</tr> </tr>
<tr height=51 style='mso-height-source:userset;height:38.0pt'> <tr height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*4-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*4-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>96.5 </td> <td class=xl109 style='border-top:none;border-left:none'>98.0 </td>
<td class=xl109 style='border-top:none;border-left:none'>9.0 </td> <td class=xl109 style='border-top:none;border-left:none'>9.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*5-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-280*5-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>104.5 </td> <td class=xl109 style='border-top:none;border-left:none'>107.0 </td>
<td class=xl109 style='border-top:none;border-left:none'>12.0 </td> <td class=xl109 style='border-top:none;border-left:none'>12.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>人造皮革;L型開門另加3萬元/台</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-320*2-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-320*2-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>82.0 </td> <td class=xl109 style='border-top:none;border-left:none'>77.5 </td>
<td class=xl109 style='border-top:none;border-left:none'>3.0 </td> <td class=xl109 style='border-top:none;border-left:none'>3.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-320*3-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-320*3-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>90.0 </td> <td class=xl109 style='border-top:none;border-left:none'>88.5 </td>
<td class=xl109 style='border-top:none;border-left:none'>6.0 </td> <td class=xl109 style='border-top:none;border-left:none'>6.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td>
</tr> </tr>
<tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'> <tr class=xl66 height=51 style='mso-height-source:userset;height:38.0pt'>
<td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-320*4-CO09</td> <td height=51 class=xl89 style='height:38.0pt;border-top:none'>MAP100-320*4-CO09</td>
<td class=xl109 style='border-top:none;border-left:none'>98.0 </td> <td class=xl109 style='border-top:none;border-left:none'>96.5 </td>
<td class=xl109 style='border-top:none;border-left:none'>9.0 </td> <td class=xl109 style='border-top:none;border-left:none'>9.0 </td>
<td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td> <td class=xl110 style='border-top:none;border-left:none'>岩板;L型開門另加3萬元/台</td>
</tr> </tr>
@ -798,7 +787,7 @@ include "../header.php";
<td class=xl99></td> <td class=xl99></td>
</tr> </tr>
<tr class=xl69 height=33 style='mso-height-source:userset;height:25.25pt'> <tr class=xl69 height=33 style='mso-height-source:userset;height:25.25pt'>
<td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>3、經理權限為發佈價之80%、業務部協理權限為75%。</td> <td height=33 class=xl99 colspan=2 style='height:25.25pt;mso-ignore:colspan'>3、處長權限為發佈價之80%。</td>
<td class=xl69></td> <td class=xl69></td>
<td class=xl113></td> <td class=xl113></td>
</tr> </tr>

276
wms/mkt/pricereview-create.php

@ -47,6 +47,7 @@ if (count($last_pr_arr) > 0) {
$last_pr_arr["qty_total"] += $last_pritem_arr["A"][$row["item_no"]]["item_qty"]; $last_pr_arr["qty_total"] += $last_pritem_arr["A"][$row["item_no"]]["item_qty"];
} }
} }
mysqli_free_result($res); mysqli_free_result($res);
$sql = "select * from pricereview_pay where mid = '" . $last_pr_arr["id"] . "' order by pay_kind"; $sql = "select * from pricereview_pay where mid = '" . $last_pr_arr["id"] . "' order by pay_kind";
@ -200,89 +201,121 @@ $option_str .= "</tbody></table>";
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.c_iframe { .c_iframe {
width: 1350px; width: 1350px;
height: 500px; height: 500px;
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
} }
.container { .container {
width: 1350px; width: 1350px;
} }
.nextline { .nextline {
width: 100%; width: 100%;
height: 0; height: 0;
} }
#btnadd, #btnadd2, #btnadd3, #btnadd4, a[name=btndel], a[name=btndel2], a[name=btndel3], a[name=btndel4] {
#btnadd,
#btnadd2,
#btnadd3,
#btnadd4,
a[name=btndel],
a[name=btndel2],
a[name=btndel3],
a[name=btndel4] {
margin-left: 4px; margin-left: 4px;
} }
tr th svg { tr th svg {
vertical-align: text-top; vertical-align: text-top;
} }
tr select { tr select {
margin: 8px; margin: 8px;
} }
.modal-dialog { .modal-dialog {
width: 1200px; width: 1200px;
} }
.modal-content { .modal-content {
height: 660px; height: 660px;
} }
#optionModal .modal-body { #optionModal .modal-body {
height: 540px; height: 540px;
overflow-y: auto; overflow-y: auto;
} }
#optionFaciModal .modal-body { #optionFaciModal .modal-body {
font-size: 16px; font-size: 16px;
} }
#optionFaciModal .modal-dialog { #optionFaciModal .modal-dialog {
margin-top: 200px; margin-top: 200px;
width: 400px; width: 400px;
} }
#optionFaciModal .modal-content { #optionFaciModal .modal-content {
height: auto; height: auto;
} }
ol li { ol li {
margin-left: -20px; margin-left: -20px;
line-height: 160%; line-height: 160%;
} }
a[name=optdel] { a[name=optdel] {
font-size: 13px; font-size: 13px;
text-decoration: none; text-decoration: none;
} }
.dollar-right { .dollar-right {
text-align: right; text-align: right;
} }
.kind-title { .kind-title {
background-color: black; background-color: black;
color: white; color: white;
font-size: 18px; font-size: 18px;
} }
.kind-col { .kind-col {
color: brown; color: brown;
} }
.col-md-6 { .col-md-6 {
width: 100%; width: 100%;
} }
#table_index2_filter label { #table_index2_filter label {
width: 30%; width: 30%;
} }
#table_index2 { #table_index2 {
cursor: pointer; cursor: pointer;
} }
.notice { .notice {
margin: 0 0 -2px 10px; margin: 0 0 -2px 10px;
color: red; color: red;
} }
.btn2:hover { .btn2:hover {
color: #fff; color: #fff;
} }
button[name=btnpost] { button[name=btnpost] {
margin-top: 12px; margin-top: 12px;
} }
input[type=checkbox] { input[type=checkbox] {
margin: 8px; margin: 8px;
} }
.star { .star {
color: red; color: red;
font-weight: bold; font-weight: bold;
@ -472,7 +505,25 @@ function selEX(o) {
$(function() { $(function() {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$(document).ready(function() {
$('input[name=pay_scale]').each(function() {
if ($(this).val() != '') {
// console.log($(this).val());
$(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0)));
var payAllScale = 0;
var payAllAmt = 0;
$("input[name=pay_scale]").each(function() {
payAllScale += Number($(this).val().replace(/[,]+/g, ""))
});
$("input[name=pay_amount]").each(function() {
payAllAmt += Number($(this).val().replace(/[,]+/g, ""))
});
$("input[name=pay_all_scale]").val(commafy(payAllScale));
$("input[name=pay_all_amount]").val(commafy(payAllAmt));
}
})
})
$('#table_index2').DataTable({ $('#table_index2').DataTable({
"language": { "language": {
"zeroRecords": "沒有符合的結果", "zeroRecords": "沒有符合的結果",
@ -530,10 +581,18 @@ $(function(){
}); });
}); });
$('#deposit_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); $('#deposit_rate').keyup(function() {
$('#keep_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
$('#warranty_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); });
$('#special_fee').keyup(function(){ $(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",")); }); $('#keep_rate').keyup(function() {
$(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
});
$('#warranty_rate').keyup(function() {
$(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
});
$('#special_fee').keyup(function() {
$(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ","));
});
/* /*
// for 動態表格的作法:event delegation // for 動態表格的作法:event delegation
$('#tb1').on('click', $("input[name='item_qty']"), function(){ $('#tb1').on('click', $("input[name='item_qty']"), function(){
@ -680,11 +739,13 @@ $(function(){
var jobj = $(this); // 父視窗 var jobj = $(this); // 父視窗
$("#optionModal .modal-body td").unbind().click(function() { $("#optionModal .modal-body td").unbind().click(function() {
var pobj = $(this).closest('td').parent(); var pobj = $(this).closest('td').parent();
console.log(jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html()));
jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html()); jobj.html(pobj.find('td').eq(0).html() + ' ' + pobj.find('td').eq(1).html());
jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(5).html()); jobj.closest('td').parent().find('input[name=option_unit_price]').val(pobj.find('td').eq(5).html());
jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(5).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, ""))); jobj.closest('td').parent().find('input[name=option_price_bp]').val(commafy(pobj.find('td').eq(5).html().replace(/[,]+/g, "") * jobj.closest('td').parent().find('input[name=option_qty]').val().replace(/[,]+/g, "")));
jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('input[name=option_id]').val()); jobj.closest('td').parent().find('input[name=op_id]').val(pobj.find('input[name=option_id]').val());
$("#optionModal").modal('hide'); $("#optionModal").modal('hide');
}); });
}); });
$("#optionFaciModal").on("hidden.bs.modal", function() { $("#optionFaciModal").on("hidden.bs.modal", function() {
@ -764,6 +825,7 @@ $(function(){
return false; return false;
} }
}); });
$("input[name=pay_scale]").keyup(function() { $("input[name=pay_scale]").keyup(function() {
$(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0))); $(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0)));
var payAllScale = 0; var payAllScale = 0;
@ -823,49 +885,79 @@ $(function(){
$('button[name=submit],button[name=save').click(function() { $('button[name=submit],button[name=save').click(function() {
var itemFpidArr = []; var itemFpidArr = [];
$("input[name='fp_id']").each(function(){ if ($(this).val() != '') itemFpidArr.push($(this).val()); }) $("input[name='fp_id']").each(function() {
if ($(this).val() != '') itemFpidArr.push($(this).val());
})
$('#fp_id_all').val(itemFpidArr); $('#fp_id_all').val(itemFpidArr);
var fpKindArr = []; var fpKindArr = [];
$("select[name='fp_kind']").each(function(){ if ($(this).val() != '') fpKindArr.push($(this).val()); }) $("select[name='fp_kind']").each(function() {
if ($(this).val() != '') fpKindArr.push($(this).val());
})
$('#fp_kind_all').val(fpKindArr); $('#fp_kind_all').val(fpKindArr);
var fpSeatArr = []; var fpSeatArr = [];
$("select[name='fp_seat']").each(function(){ if ($(this).val() != '') fpSeatArr.push($(this).val()); }) $("select[name='fp_seat']").each(function() {
if ($(this).val() != '') fpSeatArr.push($(this).val());
})
$('#fp_seat_all').val(fpSeatArr); $('#fp_seat_all').val(fpSeatArr);
var fpNumberofstopArr = []; var fpNumberofstopArr = [];
$("input[name='fp_numberofstop']").each(function(){ if ($(this).val() != '') fpNumberofstopArr.push($(this).val()); }) $("input[name='fp_numberofstop']").each(function() {
if ($(this).val() != '') fpNumberofstopArr.push($(this).val());
})
$('#fp_numberofstop_all').val(fpNumberofstopArr); $('#fp_numberofstop_all').val(fpNumberofstopArr);
var fpSpeedArr = []; var fpSpeedArr = [];
$("select[name='fp_speed']").each(function(){ if ($(this).val() != '') fpSpeedArr.push($(this).val()); }) $("select[name='fp_speed']").each(function() {
if ($(this).val() != '') fpSpeedArr.push($(this).val());
})
$('#fp_speed_all').val(fpSpeedArr); $('#fp_speed_all').val(fpSpeedArr);
var itemOpArr = []; var itemOpArr = [];
$("select[name='item_op']").each(function(){ if ($(this).val() != '') itemOpArr.push($(this).val()); }) $("select[name='item_op']").each(function() {
if ($(this).val() != '') itemOpArr.push($(this).val());
})
$('#item_op_all').val(itemOpArr); $('#item_op_all').val(itemOpArr);
var itemWeightArr = []; var itemWeightArr = [];
$("input[name='item_weight']").each(function(){ if ($(this).val() != '') itemWeightArr.push($(this).val()); }) $("input[name='item_weight']").each(function() {
if ($(this).val() != '') itemWeightArr.push($(this).val());
})
$('#item_weight_all').val(itemWeightArr); $('#item_weight_all').val(itemWeightArr);
var itemSpecArr = []; var itemSpecArr = [];
$("input[name='item_spec']").each(function(){ itemSpecArr.push($(this).val()); }) $("input[name='item_spec']").each(function() {
itemSpecArr.push($(this).val());
})
$('#item_spec_all').val(itemSpecArr); $('#item_spec_all').val(itemSpecArr);
var itemGroupArr = []; var itemGroupArr = [];
$("input[name='item_group']").each(function(){ itemGroupArr.push($(this).val()); }) $("input[name='item_group']").each(function() {
itemGroupArr.push($(this).val());
})
$('#item_group_all').val(itemGroupArr); $('#item_group_all').val(itemGroupArr);
var itemUnitPriceArr = []; var itemUnitPriceArr = [];
$("input[name='item_unit_price']").each(function(){ itemUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_unit_price']").each(function() {
itemUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_unit_price_all').val(itemUnitPriceArr); $('#item_unit_price_all').val(itemUnitPriceArr);
var itemQtyArr = []; var itemQtyArr = [];
$("input[name='item_qty']").each(function(){ itemQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_qty']").each(function() {
itemQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_qty_all').val(itemQtyArr); $('#item_qty_all').val(itemQtyArr);
var itemQtyOriArr = []; var itemQtyOriArr = [];
$("input[name='item_qty_ori']").each(function(){ itemQtyOriArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_qty_ori']").each(function() {
itemQtyOriArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_qty_ori_all').val(itemQtyOriArr); $('#item_qty_ori_all').val(itemQtyOriArr);
var itemPriceBpArr = []; var itemPriceBpArr = [];
$("input[name='item_price_bp']").each(function(){ itemPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price_bp']").each(function() {
itemPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_bp_all').val(itemPriceBpArr); $('#item_price_bp_all').val(itemPriceBpArr);
var itemPriceCtArr = []; var itemPriceCtArr = [];
$("input[name='item_price_ct']").each(function(){ itemPriceCtArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price_ct']").each(function() {
itemPriceCtArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_ct_all').val(itemPriceCtArr); $('#item_price_ct_all').val(itemPriceCtArr);
var itemPriceArr = []; var itemPriceArr = [];
$("input[name='item_price']").each(function(){ itemPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price']").each(function() {
itemPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_all').val(itemPriceArr); $('#item_price_all').val(itemPriceArr);
var grossProfitArr = []; var grossProfitArr = [];
$("input[name='gross_profit']").each(function() { $("input[name='gross_profit']").each(function() {
@ -873,88 +965,144 @@ $(function(){
}) })
$('#gross_profit_all').val(grossProfitArr); $('#gross_profit_all').val(grossProfitArr);
var pvRateArr = []; var pvRateArr = [];
$("input[name='pv_rate']").each(function(){ pvRateArr.push($(this).val()); }) $("input[name='pv_rate']").each(function() {
pvRateArr.push($(this).val());
})
$('#pv_rate_all').val(pvRateArr); $('#pv_rate_all').val(pvRateArr);
var noteArr = []; var noteArr = [];
$("input[name='note']").each(function(){ noteArr.push($(this).val()); }) $("input[name='note']").each(function() {
noteArr.push($(this).val());
})
$('#note_all').val(noteArr); $('#note_all').val(noteArr);
var payKindArr = []; var payKindArr = [];
$("input[name='pay_kind']").each(function(){ payKindArr.push($(this).val()); }) $("input[name='pay_kind']").each(function() {
payKindArr.push($(this).val());
})
$('#pay_kind_all').val(payKindArr); $('#pay_kind_all').val(payKindArr);
var payScaleArr = []; var payScaleArr = [];
$("input[name='pay_scale']").each(function(){ payScaleArr.push($(this).val()); }) $("input[name='pay_scale']").each(function() {
payScaleArr.push($(this).val());
})
$('#pay_scale_all').val(payScaleArr); $('#pay_scale_all').val(payScaleArr);
var payAmountArr = []; var payAmountArr = [];
$("input[name='pay_amount']").each(function(){ payAmountArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='pay_amount']").each(function() {
payAmountArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#pay_amount_all').val(payAmountArr); $('#pay_amount_all').val(payAmountArr);
var payPeriodArr = []; var payPeriodArr = [];
$("select[name='pay_period']").each(function(){ payPeriodArr.push($(this).val()); }) $("select[name='pay_period']").each(function() {
payPeriodArr.push($(this).val());
})
$('#pay_period_all').val(payPeriodArr); $('#pay_period_all').val(payPeriodArr);
var itemOpidArr = []; var itemOpidArr = [];
$("input[name='op_id']").each(function(){ itemOpidArr.push($(this).val()); }) $("input[name='op_id']").each(function() {
itemOpidArr.push($(this).val());
})
$('#op_id_all').val(itemOpidArr); $('#op_id_all').val(itemOpidArr);
var optionSeatArr = []; var optionSeatArr = [];
$("td[name='option_seat'] a").each(function(){ optionSeatArr.push($(this).html()+"@@"); }) $("td[name='option_seat'] a").each(function() {
optionSeatArr.push($(this).html() + "@@");
})
$('#option_seat_all').val(optionSeatArr); $('#option_seat_all').val(optionSeatArr);
var optionUnitPriceArr = []; var optionUnitPriceArr = [];
$("input[name='option_unit_price']").each(function(){ optionUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='option_unit_price']").each(function() {
optionUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#option_unit_price_all').val(optionUnitPriceArr); $('#option_unit_price_all').val(optionUnitPriceArr);
var optionQtyArr = []; var optionQtyArr = [];
$("input[name='option_qty']").each(function(){ optionQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='option_qty']").each(function() {
optionQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#option_qty_all').val(optionQtyArr); $('#option_qty_all').val(optionQtyArr);
var optionPriceBpArr = []; var optionPriceBpArr = [];
$("input[name='option_price_bp']").each(function(){ optionPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='option_price_bp']").each(function() {
optionPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#option_price_bp_all').val(optionPriceBpArr); $('#option_price_bp_all').val(optionPriceBpArr);
var optionMemoArr = []; var optionMemoArr = [];
$("input[name='option_memo']").each(function(){ optionMemoArr.push($(this).val()+"@@"); }) $("input[name='option_memo']").each(function() {
optionMemoArr.push($(this).val() + "@@");
})
$('#option_memo_all').val(optionMemoArr); $('#option_memo_all').val(optionMemoArr);
var optionRelateFacilArr = []; var optionRelateFacilArr = [];
$("td[name='option_relate_facil']").each(function(){ optionRelateFacilArr.push($(this).html()); }) $("td[name='option_relate_facil']").each(function() {
optionRelateFacilArr.push($(this).html());
})
$('#option_relate_facil_all').val(optionRelateFacilArr); $('#option_relate_facil_all').val(optionRelateFacilArr);
var mnIdArr = []; var mnIdArr = [];
$("input[name='mn_id']").each(function(){ mnIdArr.push($(this).val()); }) $("input[name='mn_id']").each(function() {
mnIdArr.push($(this).val());
})
$('#mn_id_all').val(mnIdArr); $('#mn_id_all').val(mnIdArr);
var mnKindArr = []; var mnKindArr = [];
$("select[name='mn_kind']").each(function(){ mnKindArr.push($(this).val()); }) $("select[name='mn_kind']").each(function() {
mnKindArr.push($(this).val());
})
$('#mn_kind_all').val(mnKindArr); $('#mn_kind_all').val(mnKindArr);
var mnSeatArr = []; var mnSeatArr = [];
$("select[name='mn_seat']").each(function(){ mnSeatArr.push($(this).val()); }) $("select[name='mn_seat']").each(function() {
mnSeatArr.push($(this).val());
})
$('#mn_seat_all').val(mnSeatArr); $('#mn_seat_all').val(mnSeatArr);
var mnNumberofstopArr = []; var mnNumberofstopArr = [];
$("input[name='mn_numberofstop']").each(function(){ mnNumberofstopArr.push($(this).val()); }) $("input[name='mn_numberofstop']").each(function() {
mnNumberofstopArr.push($(this).val());
})
$('#mn_numberofstop_all').val(mnNumberofstopArr); $('#mn_numberofstop_all').val(mnNumberofstopArr);
var mnSpeedArr = []; var mnSpeedArr = [];
$("select[name='mn_speed']").each(function(){ mnSpeedArr.push($(this).val()); }) $("select[name='mn_speed']").each(function() {
mnSpeedArr.push($(this).val());
})
$('#mn_speed_all').val(mnSpeedArr); $('#mn_speed_all').val(mnSpeedArr);
var mnUnitPriceArr = []; var mnUnitPriceArr = [];
$("input[name='mn_unit_price']").each(function(){ mnUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='mn_unit_price']").each(function() {
mnUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#mn_unit_price_all').val(mnUnitPriceArr); $('#mn_unit_price_all').val(mnUnitPriceArr);
var mnQtyArr = []; var mnQtyArr = [];
$("input[name='mn_qty']").each(function(){ mnQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='mn_qty']").each(function() {
mnQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#mn_qty_all').val(mnQtyArr); $('#mn_qty_all').val(mnQtyArr);
var mnPriceBpArr = []; var mnPriceBpArr = [];
$("input[name='mn_price_bp']").each(function(){ mnPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='mn_price_bp']").each(function() {
mnPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#mn_price_bp_all').val(mnPriceBpArr); $('#mn_price_bp_all').val(mnPriceBpArr);
var mnMemoArr = []; var mnMemoArr = [];
$("input[name='mn_memo']").each(function(){ mnMemoArr.push($(this).val()+"@@"); }) $("input[name='mn_memo']").each(function() {
mnMemoArr.push($(this).val() + "@@");
})
$('#mn_memo_all').val(mnMemoArr); $('#mn_memo_all').val(mnMemoArr);
var mnRelateFacilArr = []; var mnRelateFacilArr = [];
$("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html()); }) $("td[name='mn_relate_facil']").each(function() {
mnRelateFacilArr.push($(this).html());
})
$('#mn_relate_facil_all').val(mnRelateFacilArr); $('#mn_relate_facil_all').val(mnRelateFacilArr);
var exNoteArr = []; var exNoteArr = [];
$("input[name='except_note']").each(function(){ exNoteArr.push($(this).val()); }) $("input[name='except_note']").each(function() {
exNoteArr.push($(this).val());
})
$('#except_note_all').val(exNoteArr); $('#except_note_all').val(exNoteArr);
var exSpecArr = []; var exSpecArr = [];
$("input[name='except_spec']").each(function(){ exSpecArr.push($(this).val()); }) $("input[name='except_spec']").each(function() {
exSpecArr.push($(this).val());
})
$('#except_spec_all').val(exSpecArr); $('#except_spec_all').val(exSpecArr);
var exUnitPriceArr = []; var exUnitPriceArr = [];
$("input[name='except_unit_price']").each(function(){ exUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='except_unit_price']").each(function() {
exUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#except_unit_price_all').val(exUnitPriceArr); $('#except_unit_price_all').val(exUnitPriceArr);
var exQtyArr = []; var exQtyArr = [];
$("input[name='except_qty']").each(function(){ exQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='except_qty']").each(function() {
exQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#except_qty_all').val(exQtyArr); $('#except_qty_all').val(exQtyArr);
var exPriceBpArr = []; var exPriceBpArr = [];
$("input[name='except_price_bp']").each(function(){ exPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='except_price_bp']").each(function() {
exPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#except_price_bp_all').val(exPriceBpArr); $('#except_price_bp_all').val(exPriceBpArr);
$("input[name='pmstatus']").val($(this).val()); $("input[name='pmstatus']").val($(this).val());
@ -1684,12 +1832,14 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<th>數量</th> <th>數量</th>
<th>複價</th> <th>複價</th>
<th>備註</th> <th>備註</th>
<th class="star"><div data-toggle="tooltip" data-placement="auto" title="每次選完OPTION後,請點選右方紅色按鈕「電梯」來勾選電梯項次">所屬電梯 <th class="star">
<div data-toggle="tooltip" data-placement="auto" title="每次選完OPTION後,請點選右方紅色按鈕「電梯」來勾選電梯項次">所屬電梯
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" /> <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" /> <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
</svg> </svg>
</div></th> </div>
</th>
<th>功能</th> <th>功能</th>
</tr> </tr>
</thead> </thead>
@ -1700,7 +1850,7 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
?> ?>
<tr name="option_templ"> <tr name="option_templ">
<td name="option_seat"> <td name="option_seat">
<a href="" name="option_href" data-toggle="modal"><?php echo $v["item_spec"]; ?></a> <a href="" name="option_href" data-toggle="modal"><?php echo $v["item_spec"] . '-(' . $v['item-memo'] . ')'; ?></a>
</td> </td>
<td><input type="text" name="option_unit_price" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_unit_price"]); ?>" readonly></td> <td><input type="text" name="option_unit_price" class="form-control dollar-right" size="8" value="<?php echo number_format($v["item_unit_price"]); ?>" readonly></td>
<td><input type="text" name="option_qty" class="form-control" size="2" maxlength="2" value="<?php echo $v["item_qty"]; ?>"></td> <td><input type="text" name="option_qty" class="form-control" size="2" maxlength="2" value="<?php echo $v["item_qty"]; ?>"></td>
@ -1830,7 +1980,9 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
<th>數量(月)</th> <th>數量(月)</th>
<th>複價</th> <th>複價</th>
<th>備註</th> <th>備註</th>
<th class="star">所屬電梯</div></th> <th class="star">所屬電梯
</div>
</th>
<th>功能</th> <th>功能</th>
</tr> </tr>
</thead> </thead>
@ -1985,13 +2137,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
<tr> <tr>
<td rowspan="4">材料</td> <td rowspan="4">材料</td>
<td>1、訂金<input type="hidden" name="pay_kind" value="1"></td> <td>1、訂金<input type="hidden" name="pay_kind" value="1"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[1]["pay_scale"]; ?>"></td> <td><input type="text" id="pay_scale1" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[1]["pay_scale"]) ? 20 : @$last_prpay_arr[1]["pay_scale"]; ?>"></td>
<td id="pay1"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[1]["pay_amount"]); ?>" readonly></td> <td id="pay1"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[1]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[1]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[1]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[1]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[1]["pay_period"] == "30" || @$last_prpay_arr[1]["pay_period"] == "") echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[1]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[1]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[1]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[1]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[1]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[1]["pay_period"] == "120") echo " selected"; ?>>120天</option>
@ -2002,7 +2154,7 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
</tr> </tr>
<tr> <tr>
<td>2、二次款<input type="hidden" name="pay_kind" value="2"></td> <td>2、二次款<input type="hidden" name="pay_kind" value="2"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[2]["pay_scale"]; ?>"></td> <td><input type="text" id="pay_scale2" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[2]["pay_scale"]; ?>"></td>
<td id="pay2"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[2]["pay_amount"]); ?>" readonly></td> <td id="pay2"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[2]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
@ -2019,13 +2171,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
</tr> </tr>
<tr> <tr>
<td>3、貨到工地款<input type="hidden" name="pay_kind" value="3"></td> <td>3、貨到工地款<input type="hidden" name="pay_kind" value="3"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[3]["pay_scale"]; ?>"></td> <td><input type="text" id="pay_scale3" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[3]["pay_scale"]) ? 50 : @$last_prpay_arr[3]["pay_scale"]; ?>"></td>
<td id="pay3"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[3]["pay_amount"]); ?>" readonly></td> <td id="pay3"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[3]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[3]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[3]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[3]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[3]["pay_period"] == "30" || @$last_prpay_arr[3]["pay_period"] == "") echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[3]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[3]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[3]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[3]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[3]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[3]["pay_period"] == "120") echo " selected"; ?>>120天</option>
@ -2036,7 +2188,7 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
</tr> </tr>
<tr> <tr>
<td>4、其它<input type="hidden" name="pay_kind" value="4"></td> <td>4、其它<input type="hidden" name="pay_kind" value="4"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[4]["pay_scale"]; ?>"></td> <td><input type="text" id="pay_scale4" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[4]["pay_scale"]; ?>"></td>
<td id="pay4"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[4]["pay_amount"]); ?>" readonly></td> <td id="pay4"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[4]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
@ -2054,13 +2206,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
<tr> <tr>
<td rowspan="3">安裝</td> <td rowspan="3">安裝</td>
<td>5、安裝完畢款<input type="hidden" name="pay_kind" value="5"></td> <td>5、安裝完畢款<input type="hidden" name="pay_kind" value="5"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[5]["pay_scale"]; ?>"></td> <td><input type="text" id="pay_scale5" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[5]["pay_scale"]) ? 20 : @$last_prpay_arr[5]["pay_scale"]; ?>"></td>
<td id="pay5"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[5]["pay_amount"]); ?>" readonly></td> <td id="pay5"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[5]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[5]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[5]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[5]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[5]["pay_period"] == "30" || @$last_prpay_arr[5]["pay_period"] == "") echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[5]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[5]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[5]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[5]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[5]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[5]["pay_period"] == "120") echo " selected"; ?>>120天</option>
@ -2071,13 +2223,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
</tr> </tr>
<tr> <tr>
<td>6、驗收款<input type="hidden" name="pay_kind" value="6"></td> <td>6、驗收款<input type="hidden" name="pay_kind" value="6"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[6]["pay_scale"]; ?>"></td> <td><input type="text" id="pay_scale6" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[6]["pay_scale"]) ? 10 : @$last_prpay_arr[6]["pay_scale"]; ?>"></td>
<td id="pay6"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[6]["pay_amount"]); ?>" readonly></td> <td id="pay6"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[6]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[6]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[6]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[6]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[6]["pay_period"] == "30" || @$last_prpay_arr[6]["pay_period"] == "") echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[6]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[6]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[6]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[6]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[6]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[6]["pay_period"] == "120") echo " selected"; ?>>120天</option>

294
wms/mkt/pricereview_renovate-create.php

@ -201,89 +201,123 @@ $option_str .= "</tbody></table>";
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.c_iframe { .c_iframe {
width: 1350px; width: 1350px;
height: 500px; height: 500px;
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
} }
.container { .container {
width: 1350px; width: 1350px;
} }
.nextline { .nextline {
width: 100%; width: 100%;
height: 0; height: 0;
} }
#btnadd, #btnadd2, #btnadd3, #btnadd4, #btnadd5, a[name=btndel], a[name=btndel2], a[name=btndel3], a[name=btndel4], a[name=btndel5] {
#btnadd,
#btnadd2,
#btnadd3,
#btnadd4,
#btnadd5,
a[name=btndel],
a[name=btndel2],
a[name=btndel3],
a[name=btndel4],
a[name=btndel5] {
margin-left: 4px; margin-left: 4px;
} }
tr th svg { tr th svg {
vertical-align: text-top; vertical-align: text-top;
} }
tr select { tr select {
margin: 8px; margin: 8px;
} }
.modal-dialog { .modal-dialog {
width: 1200px; width: 1200px;
} }
.modal-content { .modal-content {
height: 660px; height: 660px;
} }
#optionModal .modal-body { #optionModal .modal-body {
height: 540px; height: 540px;
overflow-y: auto; overflow-y: auto;
} }
#optionFaciModal .modal-body { #optionFaciModal .modal-body {
font-size: 16px; font-size: 16px;
} }
#optionFaciModal .modal-dialog { #optionFaciModal .modal-dialog {
margin-top: 200px; margin-top: 200px;
width: 400px; width: 400px;
} }
#optionFaciModal .modal-content { #optionFaciModal .modal-content {
height: auto; height: auto;
} }
ol li { ol li {
margin-left: -20px; margin-left: -20px;
line-height: 160%; line-height: 160%;
} }
a[name=optdel] { a[name=optdel] {
font-size: 13px; font-size: 13px;
text-decoration: none; text-decoration: none;
} }
.dollar-right { .dollar-right {
text-align: right; text-align: right;
} }
.kind-title { .kind-title {
background-color: black; background-color: black;
color: white; color: white;
font-size: 18px; font-size: 18px;
} }
.kind-col { .kind-col {
color: brown; color: brown;
} }
.col-md-6 { .col-md-6 {
width: 100%; width: 100%;
} }
#table_index2_filter label { #table_index2_filter label {
width: 30%; width: 30%;
} }
#table_index2 { #table_index2 {
cursor: pointer; cursor: pointer;
} }
.notice { .notice {
margin: 0 0 -2px 10px; margin: 0 0 -2px 10px;
color: red; color: red;
} }
.btn2:hover { .btn2:hover {
color: #fff; color: #fff;
} }
button[name=btnpost] { button[name=btnpost] {
margin-top: 12px; margin-top: 12px;
} }
input[type=checkbox] { input[type=checkbox] {
margin: 8px; margin: 8px;
} }
.star { .star {
color: red; color: red;
font-weight: bold; font-weight: bold;
@ -509,6 +543,26 @@ function selDemolition(o) {
$(function() { $(function() {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$(document).ready(function() {
$('input[name=pay_scale]').each(function() {
if ($(this).val() != '') {
// console.log($(this).val());
$(this).closest('td').next('td').find('input[name=pay_amount]').val(commafy(($("#price_total").val().replace(/[,]+/g, "") / 100 * $(this).val()).toFixed(0)));
var payAllScale = 0;
var payAllAmt = 0;
$("input[name=pay_scale]").each(function() {
payAllScale += Number($(this).val().replace(/[,]+/g, ""))
});
$("input[name=pay_amount]").each(function() {
payAllAmt += Number($(this).val().replace(/[,]+/g, ""))
});
$("input[name=pay_all_scale]").val(commafy(payAllScale));
$("input[name=pay_all_amount]").val(commafy(payAllAmt));
}
})
})
$('#table_index2').DataTable({ $('#table_index2').DataTable({
"language": { "language": {
"zeroRecords": "沒有符合的結果", "zeroRecords": "沒有符合的結果",
@ -566,10 +620,18 @@ $(function(){
}); });
}); });
$('#deposit_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); $('#deposit_rate').keyup(function() {
$('#keep_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
$('#warranty_rate').keyup(function(){ $(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')); }); });
$('#special_fee').keyup(function(){ $(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",")); }); $('#keep_rate').keyup(function() {
$(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
});
$('#warranty_rate').keyup(function() {
$(this).val($(this).val().replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1'));
});
$('#special_fee').keyup(function() {
$(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ","));
});
/* /*
// for 動態表格的作法:event delegation // for 動態表格的作法:event delegation
$('#tb1').on('click', $("input[name='item_qty']"), function(){ $('#tb1').on('click', $("input[name='item_qty']"), function(){
@ -893,49 +955,79 @@ $(function(){
$('button[name=submit],button[name=save').click(function() { $('button[name=submit],button[name=save').click(function() {
var itemFpidArr = []; var itemFpidArr = [];
$("input[name='fp_id']").each(function(){ if ($(this).val() != '') itemFpidArr.push($(this).val()); }) $("input[name='fp_id']").each(function() {
if ($(this).val() != '') itemFpidArr.push($(this).val());
})
$('#fp_id_all').val(itemFpidArr); $('#fp_id_all').val(itemFpidArr);
var fpKindArr = []; var fpKindArr = [];
$("select[name='fp_kind']").each(function(){ if ($(this).val() != '') fpKindArr.push($(this).val()); }) $("select[name='fp_kind']").each(function() {
if ($(this).val() != '') fpKindArr.push($(this).val());
})
$('#fp_kind_all').val(fpKindArr); $('#fp_kind_all').val(fpKindArr);
var fpSeatArr = []; var fpSeatArr = [];
$("select[name='fp_seat']").each(function(){ if ($(this).val() != '') fpSeatArr.push($(this).val()); }) $("select[name='fp_seat']").each(function() {
if ($(this).val() != '') fpSeatArr.push($(this).val());
})
$('#fp_seat_all').val(fpSeatArr); $('#fp_seat_all').val(fpSeatArr);
var fpNumberofstopArr = []; var fpNumberofstopArr = [];
$("input[name='fp_numberofstop']").each(function(){ if ($(this).val() != '') fpNumberofstopArr.push($(this).val()); }) $("input[name='fp_numberofstop']").each(function() {
if ($(this).val() != '') fpNumberofstopArr.push($(this).val());
})
$('#fp_numberofstop_all').val(fpNumberofstopArr); $('#fp_numberofstop_all').val(fpNumberofstopArr);
var fpSpeedArr = []; var fpSpeedArr = [];
$("select[name='fp_speed']").each(function(){ if ($(this).val() != '') fpSpeedArr.push($(this).val()); }) $("select[name='fp_speed']").each(function() {
if ($(this).val() != '') fpSpeedArr.push($(this).val());
})
$('#fp_speed_all').val(fpSpeedArr); $('#fp_speed_all').val(fpSpeedArr);
var itemOpArr = []; var itemOpArr = [];
$("select[name='item_op']").each(function(){ if ($(this).val() != '') itemOpArr.push($(this).val()); }) $("select[name='item_op']").each(function() {
if ($(this).val() != '') itemOpArr.push($(this).val());
})
$('#item_op_all').val(itemOpArr); $('#item_op_all').val(itemOpArr);
var itemWeightArr = []; var itemWeightArr = [];
$("input[name='item_weight']").each(function(){ if ($(this).val() != '') itemWeightArr.push($(this).val()); }) $("input[name='item_weight']").each(function() {
if ($(this).val() != '') itemWeightArr.push($(this).val());
})
$('#item_weight_all').val(itemWeightArr); $('#item_weight_all').val(itemWeightArr);
var itemSpecArr = []; var itemSpecArr = [];
$("input[name='item_spec']").each(function(){ itemSpecArr.push($(this).val()); }) $("input[name='item_spec']").each(function() {
itemSpecArr.push($(this).val());
})
$('#item_spec_all').val(itemSpecArr); $('#item_spec_all').val(itemSpecArr);
var itemGroupArr = []; var itemGroupArr = [];
$("input[name='item_group']").each(function(){ itemGroupArr.push($(this).val()); }) $("input[name='item_group']").each(function() {
itemGroupArr.push($(this).val());
})
$('#item_group_all').val(itemGroupArr); $('#item_group_all').val(itemGroupArr);
var itemUnitPriceArr = []; var itemUnitPriceArr = [];
$("input[name='item_unit_price']").each(function(){ itemUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_unit_price']").each(function() {
itemUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_unit_price_all').val(itemUnitPriceArr); $('#item_unit_price_all').val(itemUnitPriceArr);
var itemQtyArr = []; var itemQtyArr = [];
$("input[name='item_qty']").each(function(){ itemQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_qty']").each(function() {
itemQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_qty_all').val(itemQtyArr); $('#item_qty_all').val(itemQtyArr);
var itemQtyOriArr = []; var itemQtyOriArr = [];
$("input[name='item_qty_ori']").each(function(){ itemQtyOriArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_qty_ori']").each(function() {
itemQtyOriArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_qty_ori_all').val(itemQtyOriArr); $('#item_qty_ori_all').val(itemQtyOriArr);
var itemPriceBpArr = []; var itemPriceBpArr = [];
$("input[name='item_price_bp']").each(function(){ itemPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price_bp']").each(function() {
itemPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_bp_all').val(itemPriceBpArr); $('#item_price_bp_all').val(itemPriceBpArr);
var itemPriceCtArr = []; var itemPriceCtArr = [];
$("input[name='item_price_ct']").each(function(){ itemPriceCtArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price_ct']").each(function() {
itemPriceCtArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_ct_all').val(itemPriceCtArr); $('#item_price_ct_all').val(itemPriceCtArr);
var itemPriceArr = []; var itemPriceArr = [];
$("input[name='item_price']").each(function(){ itemPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='item_price']").each(function() {
itemPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#item_price_all').val(itemPriceArr); $('#item_price_all').val(itemPriceArr);
var grossProfitArr = []; var grossProfitArr = [];
$("input[name='gross_profit']").each(function() { $("input[name='gross_profit']").each(function() {
@ -943,106 +1035,174 @@ $(function(){
}) })
$('#gross_profit_all').val(grossProfitArr); $('#gross_profit_all').val(grossProfitArr);
var pvRateArr = []; var pvRateArr = [];
$("input[name='pv_rate']").each(function(){ pvRateArr.push($(this).val()); }) $("input[name='pv_rate']").each(function() {
pvRateArr.push($(this).val());
})
$('#pv_rate_all').val(pvRateArr); $('#pv_rate_all').val(pvRateArr);
var noteArr = []; var noteArr = [];
$("input[name='note']").each(function(){ noteArr.push($(this).val()); }) $("input[name='note']").each(function() {
noteArr.push($(this).val());
})
$('#note_all').val(noteArr); $('#note_all').val(noteArr);
var payKindArr = []; var payKindArr = [];
$("input[name='pay_kind']").each(function(){ payKindArr.push($(this).val()); }) $("input[name='pay_kind']").each(function() {
payKindArr.push($(this).val());
})
$('#pay_kind_all').val(payKindArr); $('#pay_kind_all').val(payKindArr);
var payScaleArr = []; var payScaleArr = [];
$("input[name='pay_scale']").each(function(){ payScaleArr.push($(this).val()); }) $("input[name='pay_scale']").each(function() {
payScaleArr.push($(this).val());
})
$('#pay_scale_all').val(payScaleArr); $('#pay_scale_all').val(payScaleArr);
var payAmountArr = []; var payAmountArr = [];
$("input[name='pay_amount']").each(function(){ payAmountArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='pay_amount']").each(function() {
payAmountArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#pay_amount_all').val(payAmountArr); $('#pay_amount_all').val(payAmountArr);
var payPeriodArr = []; var payPeriodArr = [];
$("select[name='pay_period']").each(function(){ payPeriodArr.push($(this).val()); }) $("select[name='pay_period']").each(function() {
payPeriodArr.push($(this).val());
})
$('#pay_period_all').val(payPeriodArr); $('#pay_period_all').val(payPeriodArr);
var itemOpidArr = []; var itemOpidArr = [];
$("input[name='op_id']").each(function(){ itemOpidArr.push($(this).val()); }) $("input[name='op_id']").each(function() {
itemOpidArr.push($(this).val());
})
$('#op_id_all').val(itemOpidArr); $('#op_id_all').val(itemOpidArr);
var optionSeatArr = []; var optionSeatArr = [];
$("td[name='option_seat'] a").each(function(){ optionSeatArr.push($(this).html()+"@@"); }) $("td[name='option_seat'] a").each(function() {
optionSeatArr.push($(this).html() + "@@");
})
$('#option_seat_all').val(optionSeatArr); $('#option_seat_all').val(optionSeatArr);
var optionUnitPriceArr = []; var optionUnitPriceArr = [];
$("input[name='option_unit_price']").each(function(){ optionUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='option_unit_price']").each(function() {
optionUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#option_unit_price_all').val(optionUnitPriceArr); $('#option_unit_price_all').val(optionUnitPriceArr);
var optionQtyArr = []; var optionQtyArr = [];
$("input[name='option_qty']").each(function(){ optionQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='option_qty']").each(function() {
optionQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#option_qty_all').val(optionQtyArr); $('#option_qty_all').val(optionQtyArr);
var optionPriceBpArr = []; var optionPriceBpArr = [];
$("input[name='option_price_bp']").each(function(){ optionPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='option_price_bp']").each(function() {
optionPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#option_price_bp_all').val(optionPriceBpArr); $('#option_price_bp_all').val(optionPriceBpArr);
var optionMemoArr = []; var optionMemoArr = [];
$("input[name='option_memo']").each(function(){ optionMemoArr.push($(this).val()+"@@"); }) $("input[name='option_memo']").each(function() {
optionMemoArr.push($(this).val() + "@@");
})
$('#option_memo_all').val(optionMemoArr); $('#option_memo_all').val(optionMemoArr);
var optionRelateFacilArr = []; var optionRelateFacilArr = [];
$("td[name='option_relate_facil']").each(function(){ optionRelateFacilArr.push($(this).html()); }) $("td[name='option_relate_facil']").each(function() {
optionRelateFacilArr.push($(this).html());
})
$('#option_relate_facil_all').val(optionRelateFacilArr); $('#option_relate_facil_all').val(optionRelateFacilArr);
var mnIdArr = []; var mnIdArr = [];
$("input[name='mn_id']").each(function(){ mnIdArr.push($(this).val()); }) $("input[name='mn_id']").each(function() {
mnIdArr.push($(this).val());
})
$('#mn_id_all').val(mnIdArr); $('#mn_id_all').val(mnIdArr);
var mnKindArr = []; var mnKindArr = [];
$("select[name='mn_kind']").each(function(){ mnKindArr.push($(this).val()); }) $("select[name='mn_kind']").each(function() {
mnKindArr.push($(this).val());
})
$('#mn_kind_all').val(mnKindArr); $('#mn_kind_all').val(mnKindArr);
var mnSeatArr = []; var mnSeatArr = [];
$("select[name='mn_seat']").each(function(){ mnSeatArr.push($(this).val()); }) $("select[name='mn_seat']").each(function() {
mnSeatArr.push($(this).val());
})
$('#mn_seat_all').val(mnSeatArr); $('#mn_seat_all').val(mnSeatArr);
var mnNumberofstopArr = []; var mnNumberofstopArr = [];
$("input[name='mn_numberofstop']").each(function(){ mnNumberofstopArr.push($(this).val()); }) $("input[name='mn_numberofstop']").each(function() {
mnNumberofstopArr.push($(this).val());
})
$('#mn_numberofstop_all').val(mnNumberofstopArr); $('#mn_numberofstop_all').val(mnNumberofstopArr);
var mnSpeedArr = []; var mnSpeedArr = [];
$("select[name='mn_speed']").each(function(){ mnSpeedArr.push($(this).val()); }) $("select[name='mn_speed']").each(function() {
mnSpeedArr.push($(this).val());
})
$('#mn_speed_all').val(mnSpeedArr); $('#mn_speed_all').val(mnSpeedArr);
var mnUnitPriceArr = []; var mnUnitPriceArr = [];
$("input[name='mn_unit_price']").each(function(){ mnUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='mn_unit_price']").each(function() {
mnUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#mn_unit_price_all').val(mnUnitPriceArr); $('#mn_unit_price_all').val(mnUnitPriceArr);
var mnQtyArr = []; var mnQtyArr = [];
$("input[name='mn_qty']").each(function(){ mnQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='mn_qty']").each(function() {
mnQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#mn_qty_all').val(mnQtyArr); $('#mn_qty_all').val(mnQtyArr);
var mnPriceBpArr = []; var mnPriceBpArr = [];
$("input[name='mn_price_bp']").each(function(){ mnPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='mn_price_bp']").each(function() {
mnPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#mn_price_bp_all').val(mnPriceBpArr); $('#mn_price_bp_all').val(mnPriceBpArr);
var mnMemoArr = []; var mnMemoArr = [];
$("input[name='mn_memo']").each(function(){ mnMemoArr.push($(this).val()+"@@"); }) $("input[name='mn_memo']").each(function() {
mnMemoArr.push($(this).val() + "@@");
})
$('#mn_memo_all').val(mnMemoArr); $('#mn_memo_all').val(mnMemoArr);
var mnRelateFacilArr = []; var mnRelateFacilArr = [];
$("td[name='mn_relate_facil']").each(function(){ mnRelateFacilArr.push($(this).html()); }) $("td[name='mn_relate_facil']").each(function() {
mnRelateFacilArr.push($(this).html());
})
$('#mn_relate_facil_all').val(mnRelateFacilArr); $('#mn_relate_facil_all').val(mnRelateFacilArr);
var exNoteArr = []; var exNoteArr = [];
$("input[name='except_note']").each(function(){ exNoteArr.push($(this).val()); }) $("input[name='except_note']").each(function() {
exNoteArr.push($(this).val());
})
$('#except_note_all').val(exNoteArr); $('#except_note_all').val(exNoteArr);
var exSpecArr = []; var exSpecArr = [];
$("input[name='except_spec']").each(function(){ exSpecArr.push($(this).val()); }) $("input[name='except_spec']").each(function() {
exSpecArr.push($(this).val());
})
$('#except_spec_all').val(exSpecArr); $('#except_spec_all').val(exSpecArr);
var exUnitPriceArr = []; var exUnitPriceArr = [];
$("input[name='except_unit_price']").each(function(){ exUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='except_unit_price']").each(function() {
exUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#except_unit_price_all').val(exUnitPriceArr); $('#except_unit_price_all').val(exUnitPriceArr);
var exQtyArr = []; var exQtyArr = [];
$("input[name='except_qty']").each(function(){ exQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='except_qty']").each(function() {
exQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#except_qty_all').val(exQtyArr); $('#except_qty_all').val(exQtyArr);
var exPriceBpArr = []; var exPriceBpArr = [];
$("input[name='except_price_bp']").each(function(){ exPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='except_price_bp']").each(function() {
exPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#except_price_bp_all').val(exPriceBpArr); $('#except_price_bp_all').val(exPriceBpArr);
var demIdArr = []; var demIdArr = [];
$("input[name='dem_id']").each(function(){ demIdArr.push($(this).val()); }) $("input[name='dem_id']").each(function() {
demIdArr.push($(this).val());
})
$('#dem_id_all').val(demIdArr); $('#dem_id_all').val(demIdArr);
var demSeatArr = []; var demSeatArr = [];
$("select[name='seat']").each(function(){ demSeatArr.push($(this).val()); }) $("select[name='seat']").each(function() {
demSeatArr.push($(this).val());
})
$('#seat_all').val(demSeatArr); $('#seat_all').val(demSeatArr);
var demFloorArr = []; var demFloorArr = [];
$("select[name='floor']").each(function(){ demFloorArr.push($(this).val()); }) $("select[name='floor']").each(function() {
demFloorArr.push($(this).val());
})
$('#floor_all').val(demFloorArr); $('#floor_all').val(demFloorArr);
var demUnitPriceArr = []; var demUnitPriceArr = [];
$("input[name='demolition_unit_price']").each(function(){ demUnitPriceArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='demolition_unit_price']").each(function() {
demUnitPriceArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#demolition_unit_price_all').val(demUnitPriceArr); $('#demolition_unit_price_all').val(demUnitPriceArr);
var demQtyArr = []; var demQtyArr = [];
$("input[name='demolition_qty']").each(function(){ demQtyArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='demolition_qty']").each(function() {
demQtyArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#demolition_qty_all').val(demQtyArr); $('#demolition_qty_all').val(demQtyArr);
var demPriceBpArr = []; var demPriceBpArr = [];
$("input[name='demolition_price_bp']").each(function(){ demPriceBpArr.push($(this).val().replace(/[,]+/g,"")); }) $("input[name='demolition_price_bp']").each(function() {
demPriceBpArr.push($(this).val().replace(/[,]+/g, ""));
})
$('#demolition_price_bp_all').val(demPriceBpArr); $('#demolition_price_bp_all').val(demPriceBpArr);
$("input[name='pmstatus']").val($(this).val()); $("input[name='pmstatus']").val($(this).val());
@ -1760,12 +1920,14 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
<th>數量</th> <th>數量</th>
<th>複價</th> <th>複價</th>
<th>備註</th> <th>備註</th>
<th class="star"><div data-toggle="tooltip" data-placement="auto" title="每次選完OPTION後,請點選右方紅色按鈕「電梯」來勾選電梯項次">所屬電梯 <th class="star">
<div data-toggle="tooltip" data-placement="auto" title="每次選完OPTION後,請點選右方紅色按鈕「電梯」來勾選電梯項次">所屬電梯
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" /> <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" /> <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
</svg> </svg>
</div></th> </div>
</th>
<th>功能</th> <th>功能</th>
</tr> </tr>
</thead> </thead>
@ -1906,7 +2068,9 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
<th>數量(月)</th> <th>數量(月)</th>
<th>複價</th> <th>複價</th>
<th>備註</th> <th>備註</th>
<th class="star">所屬電梯</div></th> <th class="star">所屬電梯
</div>
</th>
<th>功能</th> <th>功能</th>
</tr> </tr>
</thead> </thead>
@ -2157,13 +2321,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
<tr> <tr>
<td rowspan="4">材料</td> <td rowspan="4">材料</td>
<td>1、訂金<input type="hidden" name="pay_kind" value="1"></td> <td>1、訂金<input type="hidden" name="pay_kind" value="1"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[1]["pay_scale"]; ?>"></td> <td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[1]["pay_scale"]) ? 20 : @$last_prpay_arr[1]["pay_scale"]; ?>"></td>
<td id="pay1"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[1]["pay_amount"]); ?>" readonly></td> <td id="pay1"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[1]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[1]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[1]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[1]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[1]["pay_period"] == "30" || @$last_prpay_arr[1]["pay_period"] == "") echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[1]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[1]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[1]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[1]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[1]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[1]["pay_period"] == "120") echo " selected"; ?>>120天</option>
@ -2191,13 +2355,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
</tr> </tr>
<tr> <tr>
<td>3、貨到工地款<input type="hidden" name="pay_kind" value="3"></td> <td>3、貨到工地款<input type="hidden" name="pay_kind" value="3"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[3]["pay_scale"]; ?>"></td> <td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[3]["pay_scale"]) ? 50 : @$last_prpay_arr[3]["pay_scale"]; ?>"></td>
<td id="pay3"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[3]["pay_amount"]); ?>" readonly></td> <td id="pay3"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[3]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[3]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[3]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[3]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[3]["pay_period"] == "30" || @$last_prpay_arr[3]["pay_period"] == "") echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[3]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[3]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[3]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[3]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[3]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[3]["pay_period"] == "120") echo " selected"; ?>>120天</option>
@ -2226,13 +2390,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
<tr> <tr>
<td rowspan="3">安裝</td> <td rowspan="3">安裝</td>
<td>5、安裝完畢款<input type="hidden" name="pay_kind" value="5"></td> <td>5、安裝完畢款<input type="hidden" name="pay_kind" value="5"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[5]["pay_scale"]; ?>"></td> <td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[5]["pay_scale"]) ? 20 : @$last_prpay_arr[5]["pay_scale"];; ?>"></td>
<td id="pay5"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[5]["pay_amount"]); ?>" readonly></td> <td id="pay5"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[5]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[5]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[5]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[5]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[5]["pay_period"] == "30" || @$last_prpay_arr[5]["pay_period"] == "") echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[5]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[5]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[5]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[5]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[5]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[5]["pay_period"] == "120") echo " selected"; ?>>120天</option>
@ -2243,13 +2407,13 @@ if (count($last_pritem_arr) > 0 && isset($last_pritem_arr["B"])) {
</tr> </tr>
<tr> <tr>
<td>6、驗收款<input type="hidden" name="pay_kind" value="6"></td> <td>6、驗收款<input type="hidden" name="pay_kind" value="6"></td>
<td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo @$last_prpay_arr[6]["pay_scale"]; ?>"></td> <td><input type="text" name="pay_scale" class="form-control" size="3" value="<?php echo empty(@$last_prpay_arr[6]["pay_scale"]) ? 10 : @$last_prpay_arr[6]["pay_scale"]; ?>"></td>
<td id="pay6"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[6]["pay_amount"]); ?>" readonly></td> <td id="pay6"><input type="text" name="pay_amount" class="form-control dollar-right" size="8" value="<?php echo number_format(@$last_prpay_arr[6]["pay_amount"]); ?>" readonly></td>
<td> <td>
<select name="pay_period" class="form-control"> <select name="pay_period" class="form-control">
<option value=""></option> <option value=""></option>
<option value="7" <?php if (@$last_prpay_arr[6]["pay_period"] == "7") echo " selected"; ?>>7天</option> <option value="7" <?php if (@$last_prpay_arr[6]["pay_period"] == "7") echo " selected"; ?>>7天</option>
<option value="30"<?php if (@$last_prpay_arr[6]["pay_period"]=="30") echo " selected"; ?>>30天</option> <option value="30" <?php if (@$last_prpay_arr[6]["pay_period"] == "30" || @$last_prpay_arr[6]["pay_period"] == '') echo " selected"; ?>>30天</option>
<option value="60" <?php if (@$last_prpay_arr[6]["pay_period"] == "60") echo " selected"; ?>>60天</option> <option value="60" <?php if (@$last_prpay_arr[6]["pay_period"] == "60") echo " selected"; ?>>60天</option>
<option value="90" <?php if (@$last_prpay_arr[6]["pay_period"] == "90") echo " selected"; ?>>90天</option> <option value="90" <?php if (@$last_prpay_arr[6]["pay_period"] == "90") echo " selected"; ?>>90天</option>
<option value="120" <?php if (@$last_prpay_arr[6]["pay_period"] == "120") echo " selected"; ?>>120天</option> <option value="120" <?php if (@$last_prpay_arr[6]["pay_period"] == "120") echo " selected"; ?>>120天</option>

60
wms/rib-invoice-check.php

@ -0,0 +1,60 @@
<?php
include "header.php";
$sql = "SELECT
B.rib_id,B.BillNo,B.DeptId, B.CreatorId, C.name, A.InvoiceNo,B.CurrentState
FROM `rib_sub` AS A
LEFT JOIN `rib` AS B
ON A.rib_id=B.rib_id
LEFT JOIN `account` AS C ON A.CreatorId=C.accountid
WHERE B.CurrentState
IN (1,2,4) AND A.InvoiceNo IS NOT NULL AND trim(A.InvoiceNo)!='' AND B.BillNo NOT IN ('M0056231003','M0056231002')
ORDER BY A.InvoiceNo";
$query = mysqli_query($link, $sql);
$array = array();
$repeat_array = array();
foreach ($query as $value) {
$InvoiceNo = preg_replace('/\s(?=)/', '', $value['InvoiceNo']);
$InvoiceNo = str_replace('-', '', $InvoiceNo);
// echo $InvoiceNo." //".$value['BillNo'];
// echo "<br>";
if (isset($array[$InvoiceNo])) {
if (in_array($value['BillNo'], $array[$InvoiceNo]['BillNo'])) {
} else {
array_push($array[$InvoiceNo]['BillNo'], $value['BillNo']);
array_push($array[$InvoiceNo]['InvoiceNo'], $value['InvoiceNo']);
$repeat_array[$InvoiceNo]['BillNo']= $array[$InvoiceNo]['BillNo'];
$repeat_array[$InvoiceNo]['InvoiceNo']= $array[$InvoiceNo]['InvoiceNo'];
}
} else {
// $array[$InvoiceNo] = array($value['BillNo']);
$array[$InvoiceNo]['BillNo']= array($value['BillNo']);
$array[$InvoiceNo]['InvoiceNo']=array($value['InvoiceNo']);
}
}
$duplicate = "(";
foreach($repeat_array as $repeat){
$tmp = "'";
$tmp .= implode("','",$repeat['InvoiceNo']);
$tmp .="'";
$duplicate .= $tmp.",";
}
$duplicate = substr($duplicate,0,-1);
$duplicate.=")";
// // echo $repeat."<br>";
$sql_repeat = "SELECT
A.rib_id,A.BillNo, A.CurrentState, A.CreatorId,C.name,B.InvoiceNo, A.GatheringPersonId,A.WriteOffAmount,A.CreateTime
FROM `rib_sub` AS B
LEFT JOIN `rib` AS A ON A.rib_id=B.rib_id
LEFT JOIN `account` AS C ON A.CreatorId=C.accountid
WHERE A.CurrentState IN (1,2,4)
AND B.InvoiceNo IN $duplicate ORDER BY B.InvoiceNo";
$repeat_query = mysqli_query($link, $sql_repeat);
foreach($repeat_query as $value){
echo $value['rib_id'].";".$value['BillNo'].";".$value['CurrentState'].";".$value['CreatorId'].";".$value['name'].";".$value['InvoiceNo'].";".$value['GatheringPersonId'].";".$value['WriteOffAmount'].";".$value['CreateTime'];
echo "<br>";
}
?>

20
wms/rib02-create.php

@ -7,8 +7,10 @@ $CurrId = isset($_GET['CurrId']) ? $_GET['CurrId'] : null;
$sql_rib = ""; $sql_rib = "";
if (empty($rib_id)) { if (empty($rib_id)) {
$sql_rib = "SELECT * FROM rib WHERE BillNo = '$BillNo' && CurrentState=0"; $sql_rib = "SELECT * FROM rib WHERE BillNo = '$BillNo' && CurrentState=0";
$sql_invoiceNo = "SELECT DISTINCT InvoiceNo FROM rib_sub WHERE BillNo!==$BillNo";
} else { } else {
$sql_rib = "SELECT * FROM rib WHERE rib_id = $rib_id"; $sql_rib = "SELECT * FROM rib WHERE rib_id = $rib_id";
$sql_invoiceNo = "SELECT DISTINCT InvoiceNo FROM rib_sub WHERE rib_id!==$rib_id";
} }
$rib_query = mysqli_query($link, $sql_rib); $rib_query = mysqli_query($link, $sql_rib);
if (mysqli_num_rows($rib_query) > 0) { if (mysqli_num_rows($rib_query) > 0) {
@ -114,7 +116,17 @@ foreach ($BizPartner as $biz) {
array_push($BusinessPartner, $bizKey); array_push($BusinessPartner, $bizKey);
$bizcount += 1; $bizcount += 1;
} }
// 取得所有報銷過的發票號碼
$invoiceNo = mysqli_query($link, $sql_invoiceNo);
$invoiceNo_array = array();
foreach ($invoiceNo as $invoice) {
array_push($invoiceNo_array, $invoice['InvoiceNo']);
}
$BizJSON = json_encode($BusinessPartner); $BizJSON = json_encode($BusinessPartner);
$InvoiceJSON = json_encode($invoiceNo_array);
$sql_Project = "SELECT * FROM comProject"; $sql_Project = "SELECT * FROM comProject";
$projects = $conn->query($sql_Project); $projects = $conn->query($sql_Project);
$sql_Material = "SELECT * FROM comMaterialGroup"; $sql_Material = "SELECT * FROM comMaterialGroup";
@ -389,7 +401,7 @@ $materials = $conn->query($sql_Material);
</div> </div>
<div class="col-md-3" id="NotInvoice2"> <div class="col-md-3" id="NotInvoice2">
<label for="InvoiceNo">發票號碼</label> <label for="InvoiceNo">發票號碼</label>
<input class="form-control" type="text" name="InvoiceNo" id="InvoiceNo"> <input class="form-control" type="text" name="InvoiceNo" id="InvoiceNo" onblur="checkInvoice()">
</div> </div>
</div> </div>
@ -665,6 +677,12 @@ $materials = $conn->query($sql_Material);
window.open('rib02-invoice.php', '發票範例', config = 'height=600, width=600'); window.open('rib02-invoice.php', '發票範例', config = 'height=600, width=600');
} }
function checkInvoice(){
var invoiceArray = <?= $InvoiceJSON ?>;
if($.inArray($("#InvoiceNo").val(),invoiceArray) !== -1) {
alert("此發票已報銷過");
$("#InvoiceNo").val('');}
}
function changeWriteOffId(SelectedDept) { function changeWriteOffId(SelectedDept) {
var SelectDeptId = 'WriteOff' + SelectedDept + '-'; var SelectDeptId = 'WriteOff' + SelectedDept + '-';

19
wms/rib02-edit.php

@ -55,7 +55,18 @@ foreach ($BizPartner as $biz) {
array_push($BusinessPartner, $bizKey); array_push($BusinessPartner, $bizKey);
$bizcount += 1; $bizcount += 1;
} }
// 取得所有報銷過的發票號碼
$rib_id = $ribsub['rib_id'];
$sql_invoiceNo = "SELECT DISTINCT InvoiceNo FROM rib_sub WHERE rib_id !== $rib_id";
$invoiceNo = mysqli_query($link, $sql_invoiceNo);
$invoiceNo_array = array();
foreach ($invoiceNo as $invoice) {
array_push($invoiceNo_array, $invoice['InvoiceNo']);
}
$BizJSON = json_encode($BusinessPartner); $BizJSON = json_encode($BusinessPartner);
$InvoiceJSON = json_encode($invoiceNo_array);
$sql_Project = "SELECT * FROM comProject"; $sql_Project = "SELECT * FROM comProject";
$projects = $conn->query($sql_Project); $projects = $conn->query($sql_Project);
$sql_Material = "SELECT * FROM comMaterialGroup"; $sql_Material = "SELECT * FROM comMaterialGroup";
@ -410,7 +421,7 @@ $materials = $conn->query($sql_Material);
</div> </div>
<div class="col-md-3" id="NotInvoice2"> <div class="col-md-3" id="NotInvoice2">
<label for="InvoiceNo">發票號碼</label> <label for="InvoiceNo">發票號碼</label>
<input class="form-control" type="text" name="InvoiceNo" id="InvoiceNo" value="<?= $ribsub['InvoiceNo'] ?>"> <input class="form-control" type="text" name="InvoiceNo" id="InvoiceNo" value="<?= $ribsub['InvoiceNo'] ?>" onblur="checkInvoice()">
</div> </div>
</div> </div>
<div> <div>
@ -683,6 +694,12 @@ $materials = $conn->query($sql_Material);
window.open('rib02-invoice.php', '新視窗的名稱', config = 'height=600, width=600'); window.open('rib02-invoice.php', '新視窗的名稱', config = 'height=600, width=600');
} }
function checkInvoice(){
var invoiceArray = <?= $InvoiceJSON ?>;
if($.inArray($("#InvoiceNo").val().replace("-", ""),invoiceArray) !== -1) {
alert("此發票已報銷過");
$("#InvoiceNo").val('');}
}
function changeWriteOffId(SelectedDept) { function changeWriteOffId(SelectedDept) {
var SelectDeptId = 'WriteOff' + SelectedDept + '-'; var SelectDeptId = 'WriteOff' + SelectedDept + '-';

9
wms/rib02-submit.php

@ -15,6 +15,13 @@ foreach ($BizPartner as $biz) {
$bizValue = $biz['BizPartnerName']; $bizValue = $biz['BizPartnerName'];
$BusinessPartner[$bizKey] = $bizValue; $BusinessPartner[$bizKey] = $bizValue;
} }
// 取得所有報銷過的發票號碼
$sql_invoiceNo = "SELECT DISTINCT InvoiceNo FROM rib_sub WHERE rib_id !== $rib_id";
$invoiceNo = mysqli_query($link, $sql_invoiceNo);
$invoiceNo_array = array();
foreach ($invoiceNo as $invoice) {
array_push($invoiceNo_array, $invoice['InvoiceNo']);
}
$RowCode = $_POST['RowCode']; $RowCode = $_POST['RowCode'];
$FeeDate = $_POST['FeeDate']; $FeeDate = $_POST['FeeDate'];
@ -35,7 +42,7 @@ $IsCounteract = $_POST['IsCounteract'];
$InvoiceId = $_POST['InvoiceId']; $InvoiceId = $_POST['InvoiceId'];
$VoucherCount = empty($_POST['VoucherCount']) ? 1 : $_POST['VoucherCount']; $VoucherCount = empty($_POST['VoucherCount']) ? 1 : $_POST['VoucherCount'];
$VoucherType = isset($_POST['VoucherType']) ? $_POST['VoucherType'] : 0; $VoucherType = isset($_POST['VoucherType']) ? $_POST['VoucherType'] : 0;
$InvoiceNo = empty($_POST['InvoiceNo']) ? NULL : $_POST['InvoiceNo']; $InvoiceNo = empty($_POST['InvoiceNo']) ? " ": (in_array(str_replace("-", "",$_POST['InvoiceNo']), $invoiceNo_array) ? " ": str_replace("-", "",$_POST['InvoiceNo']));
$CurrLAmount = empty($_POST['CurrLAmount']) ? null : $_POST['CurrLAmount']; $CurrLAmount = empty($_POST['CurrLAmount']) ? null : $_POST['CurrLAmount'];
// $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName']; // $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName'];

8
wms/sign/list.php

@ -38,10 +38,10 @@ if ($result == false) {
die(mysqli_error($link)); die(mysqli_error($link));
} }
$res_get = mysqli_fetch_all(mysqli_query($link, $sql_get), MYSQLI_ASSOC); $res_get = mysqli_fetch_all(mysqli_query($link, $sql_get), MYSQLI_ASSOC);
echo '<pre>'; // echo '<pre>';
print_r($sql_get); // print_r($sql_get);
echo '</pre>'; // echo '</pre>';
exit; // exit;
$system_name_opt = array_map(function ($item) { $system_name_opt = array_map(function ($item) {
return array('system_id' => $item['system_id'], 'system_name' => $item['system_name']); return array('system_id' => $item['system_id'], 'system_name' => $item['system_name']);

Loading…
Cancel
Save