Browse Source

新梯/汰改價審更新 0226 ,差上傳報價單

main
10994015 1 year ago
parent
commit
6617999f75
  1. 12
      wms/T8_Authorization_from_bpm.php
  2. BIN
      wms/account-receivable-contract.xlsx
  3. 92
      wms/account-receivable-excel.php
  4. BIN
      wms/account-receivable-facility.xlsx
  5. 991
      wms/account-receivable-new-index.php
  6. 9
      wms/account-receivable-renovate-index.php
  7. 2
      wms/account-receivable.txt
  8. 111
      wms/bonus/api/postStatus.php
  9. 496
      wms/bonus/bonus.php
  10. 199
      wms/bonus/bonus_check.php
  11. 34
      wms/bonus/bonus_detail.php
  12. 218
      wms/bonus/elevator_new/elevator_new_deal_bonus.php
  13. 48
      wms/bonus/other/maintenance_contract_bonus_v2_1.php
  14. 469
      wms/bonus/other/maintenance_contract_bonus_v2_1_examination.php
  15. 190
      wms/contract-repair/contract-renovate-input.php
  16. 51
      wms/contract-repair/js/alpine.js
  17. 2
      wms/contract-repair/styles/style.css
  18. 2
      wms/contract-repair/styles/style.scss
  19. 11
      wms/contract/api/T8salIncomeApply.php
  20. 121
      wms/contract/api/getComboNo.php
  21. 95
      wms/contract/api/getContractData.php
  22. 276
      wms/contract/api/postContractData.php
  23. 464
      wms/contract/api/postNewContractData.php
  24. 55
      wms/contract/api/testT8API.php
  25. 2
      wms/contract/conn.php
  26. 106
      wms/contract/contract-input.php
  27. 10
      wms/contract/contract-new-apply.php
  28. 337
      wms/contract/contract-newelevator-input.php
  29. 101
      wms/contract/js/alpine.js
  30. 309
      wms/contract_b-index.php
  31. 2
      wms/crm/crmm02-index.php
  32. 8
      wms/crm/crmm03-edit.php
  33. 28
      wms/crm/crmm04-edit.php
  34. 2
      wms/fun_global.php
  35. 292
      wms/mkt/assets/js/pricereviewAlpine.js
  36. 190
      wms/mkt/css/pricereview.css
  37. 15
      wms/mkt/css/pricereview.css.map
  38. 324
      wms/mkt/css/pricereview.scss
  39. 195
      wms/mkt/pricereviewMaintainCreate.php

12
wms/T8_Authorization_from_bpm.php

@ -3,10 +3,7 @@
// $user_id = "M0000";
// $user_password = "M012290493119";
$user_id = "M0117";
$user_password = "90493119";
echo $validation = get_Auth($user_id, $user_password);
// echo $validation = get_Auth($user_id, $user_password);
function get_Auth($user_id = "M0000", $user_password = "M012290493119")
{
@ -16,8 +13,9 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
// $now = gmdate("YmdHis");
$now = gmdate("YmdHis", strtotime("-2 minutes"));
$data = "$user_id." . $now;
$sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false);
$sign = hash_hmac('SHA256', $data, 'A21181F1EE4966D3', false);
// echo $sign;
// $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth';
$apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth';
@ -30,7 +28,7 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
"Pwd: $user_password",
"TimestampUTC: $now",
"Sign: $sign",
"GroupId: TEST"
"GroupId:TEST"
];
$ch = curl_init();
@ -53,4 +51,4 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119")
curl_close($ch);
}
// $data = [];
get_Auth();
// get_Auth();

BIN
wms/account-receivable-contract.xlsx

Binary file not shown.

92
wms/account-receivable-excel.php

@ -12,19 +12,63 @@ $array_data = array();
$Bill = json_decode(file_get_contents("php://input"), true);
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
// file_put_contents('account-receivable.txt', json_encode($Bill));
if ($type == 'facility') {
if ($type == 'newContract') {
$excel_array = array();
$colomnHeader = [
'合約號', '客戶名稱', '營業員', '合約金額', '台數', '作番狀態', '催收金額', '催收次數', '訂金催收金額', '訂金催收次數', '二次款催收金額', '二次款催收次數',
'貨抵工地款催收金額', '貨抵工地款催收次數',
'安裝款催收金額', '安裝款催收次數',
'試車款催收金額', '試車款催收次數',
'官檢驗收催收金額', '官檢驗收催收次數',
'交車款催收金額', '交車款催收次數',
'尾款催收金額', '尾款催收次數'
];
foreach ($Bill as $key => $value) {
$excel_array[$key] = [
$value[0], $value[3], $value[8], $value[11], $value[19], $value[20], $value[17], $value[18], $value[26], $value[27], $value[33], $value[34],
$value[40], $value[41],
$value[47], $value[48],
$value[54], $value[55],
$value[61], $value[62],
$value[68], $value[69],
$value[75], $value[76]
];
}
file_put_contents('account-receivable.txt', json_encode($excel_array, JSON_UNESCAPED_UNICODE));
$sheet->fromArray($colomnHeader, NULL, 'A1');
$rowIndex = 2;
foreach ($excel_array as $item) {
$sheet->fromArray($item, NULL, 'A' . $rowIndex);
$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'
];
foreach ($column as $col) {
if ($col == 'F') {
$sheet->getColumnDimension('F')->setWidth(35);
$sheet->getStyle('F')->getAlignment()->setWrapText(true);
} else {
$sheet->getColumnDimension($col)->setAutoSize(true);
}
}
$rowIndex++;
}
$writer = new Xlsx($spreadsheet);
$excelFileName = 'account-receivable-contract.xlsx';
$writer->save($excelFileName);
} elseif ($type == 'facility') {
$colomnHeader = [
'T8單據日期','作番號', '合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金名稱', '訂金合約金額', '訂金應收日期', '訂金目前應收金額','訂金已開金額','訂金未開金額', '訂金已收金額', '訂金催收金額', '訂金催收次數',
'二次款名稱', '二次款合約金額', '二次款應收日期', '二次款目前應收金額','二次款已開金額','二次款未開金額', '二次款已收金額', '二次款催收金額', '二次款催收次數',
'貨抵工地款名稱', '貨抵工地款合約金額', '貨抵工地款應收日期', '貨抵工地款目前應收金額','貨抵工地款已開金額','貨抵工地款未開金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款催收次數',
'安裝款名稱', '安裝款合約金額', '安裝款應收日期', '安裝款目前應收金額','安裝款已開金額','安裝款未開金額', '安裝款已收金額', '安裝款催收金額', '安裝款催收次數',
'試車款名稱', '試車款合約金額', '試車款應收日期', '試車款目前應收金額','試車款已開金額','試車款未開金額', '試車款已收金額', '試車款催收金額', '試車款催收次數',
'官檢款名稱', '官檢款合約金額', '官檢款應收日期', '官檢款目前應收金額','官檢款已開金額','官檢款未開金額', '官檢款已收金額', '官檢款催收金額', '官檢款催收次數',
'交車款名稱', '交車款合約金額', '交車款應收日期', '交車款目前應收金額','交車款已開金額','交車款未開金額', '交車款已收金額', '交車款催收金額', '交車款催收次數',
'尾款名稱', '尾款金額', '尾款應收日期', '尾款應收金額','尾款已開金額','尾款未開金額', '尾款已收金額', '尾款催收金額', '尾款催收次數',
'作番狀態', '合約-設備金額','合約-安裝金額','作番合約總金額', '作番總應收金額'
'T8單據日期', '作番號', '合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金名稱', '訂金合約金額', '訂金應收日期', '訂金目前應收金額', '訂金已開金額', '訂金未開金額', '訂金已收金額', '訂金催收金額', '訂金催收次數',
'二次款名稱', '二次款合約金額', '二次款應收日期', '二次款目前應收金額', '二次款已開金額', '二次款未開金額', '二次款已收金額', '二次款催收金額', '二次款催收次數',
'貨抵工地款名稱', '貨抵工地款合約金額', '貨抵工地款應收日期', '貨抵工地款目前應收金額', '貨抵工地款已開金額', '貨抵工地款未開金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款催收次數',
'安裝款名稱', '安裝款合約金額', '安裝款應收日期', '安裝款目前應收金額', '安裝款已開金額', '安裝款未開金額', '安裝款已收金額', '安裝款催收金額', '安裝款催收次數',
'試車款名稱', '試車款合約金額', '試車款應收日期', '試車款目前應收金額', '試車款已開金額', '試車款未開金額', '試車款已收金額', '試車款催收金額', '試車款催收次數',
'官檢款名稱', '官檢款合約金額', '官檢款應收日期', '官檢款目前應收金額', '官檢款已開金額', '官檢款未開金額', '官檢款已收金額', '官檢款催收金額', '官檢款催收次數',
'交車款名稱', '交車款合約金額', '交車款應收日期', '交車款目前應收金額', '交車款已開金額', '交車款未開金額', '交車款已收金額', '交車款催收金額', '交車款催收次數',
'尾款名稱', '尾款金額', '尾款應收日期', '尾款應收金額', '尾款已開金額', '尾款未開金額', '尾款已收金額', '尾款催收金額', '尾款催收次數',
'作番狀態', '合約-設備金額', '合約-安裝金額', '作番合約總金額', '作番總應收金額'
];
$sheet->fromArray($colomnHeader, NULL, 'A1');
$rowIndex = 2;
@ -34,7 +78,7 @@ if ($type == 'facility') {
$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','BQ','BR','BK'
'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO', 'BP', 'BQ', 'BR', 'BK'
];
foreach ($column as $col) {
$sheet->getColumnDimension($col)->setAutoSize(true);
@ -47,16 +91,16 @@ if ($type == 'facility') {
$writer->save($excelFileName);
} else {
$colomnHeader = [
'T8單據日期','合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金', '訂金目前應收', '訂金已開票金額','訂金未開票金額', '訂金已收金額', '訂金催收金額', '訂金最大催收次數', '訂金最小催收次數',
'二次款', '二次款目前應收', '二次款已開票金額','二次款未開票金額', '二次款已收金額', '二次款催收金額', '二次款最大催收次數', '二次款最小催收次數',
'貨抵工地款', '貨抵工地款目前應收', '貨抵工地款已開票金額','貨抵工地款未開票金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款最大催收次數', '貨抵工地款最小催收次數',
'安裝款', '安裝款目前應收', '安裝款已開票金額','安裝款未開票金額', '安裝款已收金額', '安裝款催收金額', '安裝款最大催收次數', '安裝款最小催收次數',
'試車款', '試車款目前應收', '試車款已開票金額','試車款未開票金額', '試車款已收金額', '試車款催收金額', '試車款最大催收次數', '試車款最小催收次數',
'官檢款', '官檢款目前應收', '官檢款已開票金額','官檢款未開票金額', '官檢款已收金額', '官檢款催收金額', '官檢款最大催收次數', '官檢款最小催收次數',
'交車款', '交車款目前應收', '交車款已開票金額','交車款未開票金額', '交車款已收金額', '交車款催收金額', '交車款最大催收次數', '交車款最小催收次數',
'尾款', '尾款目前應收', '尾款已開票金額','尾款未開票金額', '尾款已收金額', '尾款催收金額', '尾款最大催收次數', '尾款最小催收次數',
'合約設備金額','合約安裝金額','合約總金額', '目前應收', '已開發票金額', '已收金額', '作番總數', '作番狀態'
'T8單據日期', '合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'訂金', '訂金目前應收', '訂金已開票金額', '訂金未開票金額', '訂金已收金額', '訂金催收金額', '訂金最大催收次數', '訂金最小催收次數',
'二次款', '二次款目前應收', '二次款已開票金額', '二次款未開票金額', '二次款已收金額', '二次款催收金額', '二次款最大催收次數', '二次款最小催收次數',
'貨抵工地款', '貨抵工地款目前應收', '貨抵工地款已開票金額', '貨抵工地款未開票金額', '貨抵工地款已收金額', '貨抵工地款催收金額', '貨抵工地款最大催收次數', '貨抵工地款最小催收次數',
'安裝款', '安裝款目前應收', '安裝款已開票金額', '安裝款未開票金額', '安裝款已收金額', '安裝款催收金額', '安裝款最大催收次數', '安裝款最小催收次數',
'試車款', '試車款目前應收', '試車款已開票金額', '試車款未開票金額', '試車款已收金額', '試車款催收金額', '試車款最大催收次數', '試車款最小催收次數',
'官檢款', '官檢款目前應收', '官檢款已開票金額', '官檢款未開票金額', '官檢款已收金額', '官檢款催收金額', '官檢款最大催收次數', '官檢款最小催收次數',
'交車款', '交車款目前應收', '交車款已開票金額', '交車款未開票金額', '交車款已收金額', '交車款催收金額', '交車款最大催收次數', '交車款最小催收次數',
'尾款', '尾款目前應收', '尾款已開票金額', '尾款未開票金額', '尾款已收金額', '尾款催收金額', '尾款最大催收次數', '尾款最小催收次數',
'合約設備金額', '合約安裝金額', '合約總金額', '目前應收', '已開發票金額', '已收金額', '作番總數', '作番狀態'
];
$sheet->fromArray($colomnHeader, NULL, 'A1');
@ -67,7 +111,7 @@ if ($type == 'facility') {
'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', 'BQ', 'BR', 'BS', 'BT', 'BU', 'BV', 'BW', 'BX', 'BY', 'BZ',
'CA','CB','CC','CD'
'CA', 'CB', 'CC', 'CD'
];
foreach ($column as $col) {
if ($col == 'CC') {

BIN
wms/account-receivable-facility.xlsx

Binary file not shown.

991
wms/account-receivable-new-index.php

File diff suppressed because it is too large

9
wms/account-receivable-renovate-index.php

@ -9,11 +9,14 @@ $sum_A40002 = 0;
$sum_A40009 = 0;
// 安裝
$sum_A40010 = 0;
// M4
$sum_A40019 = 0;
$sum_total_budget = 0;
$average_budget = 0;
$average_A40002 = 0;
$average_A40009 = 0;
$average_A40010 = 0;
$average_A40019 = 0;
$start_date = empty($_POST['date_start']) ? null : $_POST['date_start'];
$end_date = empty($_POST['date_end']) ? null : $_POST['date_end'];
@ -258,7 +261,7 @@ foreach ($contract as $cont) {
$arrayData[$BillNo]['invoice'] = array();
$arrayData[$BillNo]['received_budget'] = 0;
$arrayData[$BillNo]['invoice_budget'] = 0;
$arrayData[$BillNo]['A40002'] = $arrayData[$BillNo]['A40009'] = $arrayData[$BillNo]['A40010'] = 0;
$arrayData[$BillNo]['A40002'] = $arrayData[$BillNo]['A40009'] = $arrayData[$BillNo]['A40010'] =$arrayData[$BillNo]['A40019'] = 0;
$arrayData[$BillNo]['total_facility_num'] = 0;
}
$arrayData[$BillNo]['PayStage'][$RowNo]['type'] = 0;
@ -312,7 +315,7 @@ foreach ($contract_budget_data as $cont) {
} else {
$arrayData[$BillNo]['total_facility_num'] += 1;
$arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['total_budget'] = $cont['OAmountWithTax'];
$arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['A40002'] = $arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['A40009'] = $arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['A40010'] = 0;
$arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['A40002'] = $arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['A40009'] = $arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['A40010'] = $arrayData[$BillNo]['facility'][$cont['CU_MaterialId']]['A40019'] = 0;
$arrayData[$BillNo]['facility'][$cont['CU_MaterialId']][$cont['MaterialId']] = $cont['OAmountWithTax'];
}
}
@ -335,6 +338,7 @@ foreach ($contract_budget_data as $cont) {
$contract_budget[$cont['BillNo']]['facility'][$cont['CU_MaterialId']]['A40002'] = 0;
$contract_budget[$cont['BillNo']]['facility'][$cont['CU_MaterialId']]['A40009'] = 0;
$contract_budget[$cont['BillNo']]['facility'][$cont['CU_MaterialId']]['A40010'] = 0;
$contract_budget[$cont['BillNo']]['facility'][$cont['CU_MaterialId']]['A40019'] = 0;
$contract_budget[$cont['BillNo']]['facility'][$cont['CU_MaterialId']][$cont['MaterialId']] = $cont['OAmountWithTax'];
};
}
@ -428,6 +432,7 @@ foreach ($wipwhole_array as $wip) {
$arrayData[$billno]['facility'][$wip['facilityno']]['A40002'] = (isset($contract_budget[$billno][$wip['facilityno']]['A40002']) && !is_null($contract_budget[$billno][$wip['facilityno']]['A40002'])) ? $contract_budget[$billno][$wip['facilityno']]['A40002'] : 0;
$arrayData[$billno]['facility'][$wip['facilityno']]['A40008'] = (isset($contract_budget[$billno][$wip['facilityno']]['A40008']) && !is_null($contract_budget[$billno][$wip['facilityno']]['A40008'])) ? $contract_budget[$billno][$wip['facilityno']]['A40008'] : 0;
$arrayData[$billno]['facility'][$wip['facilityno']]['A40010'] = (isset($contract_budget[$billno][$wip['facilityno']]['A40010']) && !is_null($contract_budget[$billno][$wip['facilityno']]['A40010'])) ? $contract_budget[$billno][$wip['facilityno']]['A40010'] : 0;
$arrayData[$billno]['facility'][$wip['facilityno']]['A40019'] = (isset($contract_budget[$billno][$wip['facilityno']]['A40019']) && !is_null($contract_budget[$billno][$wip['facilityno']]['A40019'])) ? $contract_budget[$billno][$wip['facilityno']]['A40019'] : 0;
}
$wipwhole_status[$wip['facilityno']] = $wip;
}

2
wms/account-receivable.txt

File diff suppressed because one or more lines are too long

111
wms/bonus/api/postStatus.php

@ -0,0 +1,111 @@
<?php
require_once("../../contract/conn.php");
if (!empty($_POST['id']) && !empty($_POST['postType']) && $_POST['postType'] == 'a') {
try {
$id = empty($_POST['id']) ? '' : $_POST['id'];
$user_id = empty($_POST['user_id']) ? '' : $_POST['user_id'];
$amount = empty($_POST['amount']) ? '' : $_POST['amount'];
$pay_day = empty($_POST['pay_day']) ? '' : $_POST['pay_day'];
$review_at = date("Y-m-d H:i:s");
$sql = "UPDATE bonus SET status = 2 ,bonus_actual='$amount',review_hr = '$user_id' ,review_at = '$review_at',pay_day ='$pay_day',update_id='$user_id',update_at='$review_at' WHERE id = $id";
$stmt = $conn->prepare($sql);
$stmt->execute();
header("HTTP/1.1 200 success!");
echo 'Success';
} catch (PDOException $e) {
header("HTTP/1.1 404 failed!");
echo $e->getMessage();
die('Error!:' . $e->getMessage());
}
}
// 獎金確認發放,並更新獎金 OR 實際發放時間
if (!empty($_POST['postType']) && $_POST['postType'] == 'b') {
try {
$id = empty($_POST['id']) ? '' : $_POST['id'];
$pay_day = empty($_POST['pay_day']) ? '' : $_POST['pay_day'];
$bonus_actual = empty($_POST['bonus_actual']) ? '' : $_POST['bonus_actual'];
$note = empty($_POST['note']) ? '' : $_POST['note'];
$user_id = empty($_POST['user_id']) ? '' : $_POST['user_id'];
$review_at = date("Y-m-d H:i:s");
if ($pay_day != '' && $bonus_actual != '') {
$sql = "UPDATE bonus SET status = 2,review_hr='$user_id',review_at='$review_at',bonus_actual='$bonus_actual',pay_day='$pay_day',note='$note' WHERE id = $id";
$stmt = $conn->prepare($sql);
$stmt->execute();
header("HTTP/1.1 200 success!");
} else {
header("HTTP/1.1 400");
echo '請填寫發放時間和實發獎金';
}
} catch (PDOException $e) {
header("HTTP/1.1 404 failed!");
echo $e->getMessage();
die('Error!:' . $e->getMessage());
}
}
// 獎金暫不發放
if (!empty($_POST['postType']) && $_POST['postType'] == 'c') {
// echo 'cccccc';
try {
$id = empty($_POST['id']) ? '' : $_POST['id'];
$pay_day = empty($_POST['pay_day']) ? '' : $_POST['pay_day'];
$bonus_actual = empty($_POST['bonus_issue']) ? '' : $_POST['bonus_issue'];
$user_id = empty($_POST['user_id']) ? '' : $_POST['user_id'];
$note = empty($_POST['note']) ? '' : $_POST['note'];
$review_at = date("Y-m-d H:i:s");
if ($note != '') {
$sql = "UPDATE bonus SET status = 4,review_hr='$user_id',review_at='$review_at',pay_day='$pay_day',note='$note' WHERE id = $id";
echo $sql;
$stmt = $conn->prepare($sql);
$stmt->execute();
header("HTTP/1.1 200 success!");
} else {
echo '請填寫備註!!';
header("HTTP/1.1 400!");
}
} catch (PDOException $e) {
header("HTTP/1.1 404 failed!");
echo $e->getMessage();
die('Error!:' . $e->getMessage());
}
}
if (!empty($_POST['postType']) && $_POST['postType'] == 'd') {
try {
$id = empty($_POST['id']) ? '' : $_POST['id'];
$review_at = date("Y-m-d H:i:s");
$user_id = empty($_POST['user_id']) ? '' : $_POST['user_id'];
$sql = "SELECT * FROM bonus WHERE id IN ($id)";
$stmt = $conn->prepare($sql);
$stmt->execute();
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
$conn->beginTransaction();
foreach ($results as $result) {
// echo '<pre>';
// print_r($result);
// echo '</pre>';
// exit();
$amount = $result['amount'];
$id = $result['id'];
$pay_day = $result['pay_day_due'];
$sql = "UPDATE bonus SET status = 5 ,bonus_actual='$amount',review_hr = '$user_id' ,review_at = '$review_at',pay_day ='$pay_day' WHERE id = $id";
$stmt = $conn->prepare($sql);
$stmt->execute();
}
$conn->commit();
header("HTTP/1.1 200 success!");
} catch (PDOException $e) {
$conn->rollBack();
header("HTTP/1.1 404 failed!");
echo $e->getMessage();
die('Error!:' . $e->getMessage());
}
// echo 'ddddd';
}

496
wms/bonus/bonus.php

@ -2,7 +2,7 @@
include_once("../header.php");
// require_once('./connT8.php');
require("../contract/conn.php");
$now = date("Y-m-d");
$contract_type = [
'1' => '新梯',
@ -15,18 +15,32 @@ $bonus_type = [
'2' => '區經理獎金',
'3' => '專任契約經理獎金'
];
$bonus_status = [
'1' => '未確認',
'2' => '應發已確認',
'3' => '應發未確認',
'4' => '暫不發放',
'5' => '人事審核確認'
];
$clause = '';
if ($user_id != 'M0225') {
$clause .= "AND receiver == '$user_id'";
}
if (!empty($_GET['check'])) {
if ($_GET['check'] == 1) {
$clause .= "AND pay_day > DATE_SUB(NOW(), INTERVAL 1 MONTH)";
// 人事發放作業,應為一個月內
if ($_GET['check'] == 4) {
$oneMonthAgo = date("Y-m-d", strtotime("$now +1 months"));
// $clause .= "AND pay_day_due >= '$now' AND pay_day_due <= '$oneMonthAgo' AND status IN (1,2,5)";
$clause .= "AND status IN (1,2,5)";
} else if ($_GET['check'] == 2) {
$clause .= "AND status = 1";
} else if ($_GET['check'] == 3) {
$clause .= "AND status = 2";
$clause .= "AND status IN (2,5)";
}
}
$sql = "SELECT * FROM bonus WHERE 1=1 $clause LIMIT 50";
$sql = "SELECT * FROM bonus WHERE 1=1 $clause";
$stmt = $conn->prepare($sql);
$stmt->execute();
$datas = $stmt->fetchAll(PDO::FETCH_ASSOC);
@ -35,6 +49,13 @@ $datas = $stmt->fetchAll(PDO::FETCH_ASSOC);
$now = new DateTime();
$oneMonthAgo = $now->modify('+1 month');
$id = [];
foreach ($datas as $data) {
$id[] = $data['id'];
}
$id_str = implode(',', $id);
// 查看 T8 是否有收款明細
// require("./api/get.php");
function isPay($contract_no, $connT8)
@ -98,204 +119,269 @@ function isPay($contract_no, $connT8)
<script src="../contract-repair/js/axios/axios.min.js"></script>
<!-- <script src="../contract-repair/js/jquery/jquery-3.1.1.min.js"></script> -->
<script src="../contract-repair/semantic/dist/semantic.min.js"></script>
<div class="bonus_index">
<!-- <input type="button" hidden x-ref="initbtn" @click="isPay()" /> -->
<div style="overflow-x:auto;margin-top:12px">
<a href="bonus_index1.php?function_name=bonus&token=<?php echo $token; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
<a href="/wms/bonus/bonus.php?function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (!isset($_GET['check'])) ? "btn btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 所有獎金</a>
<a href="/wms/bonus/bonus.php?check=1&function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 1) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 應發獎金</a>
<a href="/wms/bonus/bonus.php?check=2&function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 2) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 未發獎金</a>
<a href="/wms/bonus/bonus.php?check=3&function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 3) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 已發獎金</a>
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>項次</th>
<th>合約類別</th>
<th>合約號</th>
<th>作番號</th>
<th>獎金類別</th>
<th>獎金版本</th>
<th>作番總價</th>
<th>牌價</th>
<th>服務費</th>
<th>應發人員</th>
<th>預計發放時間</th>
<th>獎金水庫</th>
<!-- <th>是否發放</th> -->
<th>狀態</th>
<th>檢視/發放</th>
</tr>
</thead>
<tbody>
<?php if (!empty($datas)) {
foreach ($datas as $key => $data) :
$contract_no = $data['contract_no'];
$json = json_decode($data['bonus_json']);
$total = empty($json->total) ? 0 : $json->total;
$fee_per_st = empty($json->fee_per_st) ? 0 : $json->fee_per_st;
$commission_fee = empty($json->commission_fee) ? 0 : $json->commission_fee;
$isPay = isPay($data['contract_no'], $connT8);
?>
<tr>
<td><?= $data['id'] ?></td>
<td><?= $contract_type[$data['contract_type']] ?></td>
<td><?= $data['contract_no'] ?></td>
<td><?= $data['facility_no'] ?></td>
<td><?= $bonus_type[$data['bonus_type']] ?></td>
<td><?= $data['bonus_verson'] ?></td>
<td><?= $total ?></td>
<td><?= $fee_per_st ?></td>
<td><?= $commission_fee ?></td>
<td><?= $data['receiver'] ?></td>
<td><?= $data['pay_day'] ?></td>
<td><?= $data['amount'] ?></td>
<!-- <td><?= ($data['status'] == 1) ? '未發放' : '已發放' ?></td> -->
<td>
<!-- <input type="text" x-model="isPays[<?php echo $key; ?>]" /> -->
<span><?= ($isPay == 1) ? '已收款' : '未收款' ?></span>
</td>
<td>
<?php
// 判斷時間是否為一個月內
$payday = new DateTime($data['pay_day']);
if ($isPay == 1) {
?>
<a href="bonus_detail.php?id=<?= $data['id'] ?>&token=<?php echo $token; ?>" class="applybtn" style="">發放獎金</a>
<?php
} else if ($payday < $oneMonthAgo) {
?>
<a href="bonus_detail.php?id=<?= $data['id'] ?>&token=<?php echo $token; ?>" class="applybtncheck">查看詳情</a>
<?php
}
?>
</td>
</tr>
<?php
endforeach;
} ?>
</tbody>
</table>
<div class="bonus_index" x-data="bonusIndexTest">
<div class="form" method="post" id="form" enctype="multipart/form-data">
<div style="overflow-x:auto;margin-top:12px">
<!-- <a href="bonus_index1.php?function_name=bonus&token=<?php echo $token; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a> -->
<a href="/wms/bonus/bonus.php?function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (!isset($_GET['check'])) ? "btn btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 所有獎金</a>
<!-- <a href="/wms/bonus/bonus.php?check=1&function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 1) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 應發獎金</a> -->
<a href="/wms/bonus/bonus.php?check=2&function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 2) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 未發獎金</a>
<a href="/wms/bonus/bonus.php?check=3&function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 3) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 已發獎金</a>
<a href="/wms/bonus/bonus.php?check=4&function_name=bonus&token=<?php echo $token; ?>" class=" btn <?php echo (isset($_GET['check']) && $_GET['check'] == 4) ? "btn-primary" : "btn-secondary"; ?> btn-sm categoryBtn"> 人事發放作業</a>
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<?php if (!empty($_GET['check']) && $_GET['check'] == '4') { ?>
<button class="btn btn-primary float-end" style="float: right;" onclick="All('<?= $id_str ?>')">鎖定並發放</button>
<?php } ?>
<thead>
<tr>
<th>項次</th>
<th>合約類別</th>
<th>合約號</th>
<th>作番號</th>
<th>獎金類別</th>
<th>獎金版本</th>
<th>作番金額(月)</th>
<th>牌價</th>
<th>服務費</th>
<th>應發人員</th>
<th>預計發放時間</th>
<th>應發獎金水庫</th>
<th>實發金額</th>
<th>狀態</th>
<?php
if (!empty($_GET['check']) && $_GET['check'] == '4') {
?>
<th>實際發放時間</th>
<th>發放 / 詳情</th>
<?php } else { ?>
<th>詳情</th>
<?php
} ?>
</tr>
</thead>
<tbody>
<?php if (!empty($datas)) {
foreach ($datas as $key => $data) :
$contract_no = $data['contract_no'];
$json = json_decode($data['bonus_json']);
$total = empty($json->total) ? 0 : $json->total;
$fee_per_st = empty($json->fee_per_st) ? 0 : $json->fee_per_st;
$commission_fee = empty($json->commission_fee) ? 0 : $json->commission_fee;
// $isPay = isPay($data['contract_no'], $connT8);
?>
<tr>
<td><?= $data['id'] ?></td>
<td><?= $contract_type[$data['contract_type']] ?></td>
<td><?= $data['contract_no'] ?></td>
<td><?= $data['facility_no'] ?></td>
<td><?= $bonus_type[$data['bonus_type']] ?></td>
<td><?= $data['bonus_verson'] ?></td>
<td><?= $fee_per_st ?></td>
<td><?= $total ?></td>
<td><?= $commission_fee ?></td>
<td><?= $data['receiver'] ?></td>
<td><?= $data['pay_day_due'] ?></td>
<td><?= $data['amount'] ?></td>
<td><?= $data['bonus_actual'] ?></td>
<td>
<?= $bonus_status[$data['status']] ?>
<!-- <span><?= ($isPay == 1) ? '已收款' : '未收款' ?></span> -->
</td>
<?php if (!empty($_GET['check']) && $_GET['check'] == '4') {
if ($data['status'] == '3' || $data['status'] == '1') { ?>
<td> -- </td>
<td>
<?php
// if ($isPay == 1) {
?>
<button onclick="issue(<?= $data['id'] ?>,'<?= $user_id ?>','<?= $data['pay_day_due'] ?>','<?= $data['amount'] ?>')" type="button" class="btn applybtn" name='issuePay'>發放獎金</button>
<?php
// } else if ($payday < $oneMonthAgo) {
?>
<a href="bonus_detail.php?id=<?= $data['id'] ?>&token=<?php echo $token; ?>" class="applybtncheck">查看詳情</a>
<?php
// }
?>
</td>
<!-- <td><input type="date" value="<?= $data['pay_day'] ?>"></td> -->
<?php } else { ?>
<td><?= $data['pay_day'] ?></td>
<td><a href="bonus_check.php?id=<?= $data['id'] ?>&token=<?php echo $token; ?>" class="applybtncheck">查看詳情</a></td>
<?php }
} else { ?>
<td><a href="bonus_check.php?id=<?= $data['id'] ?>&token=<?php echo $token; ?>" class="applybtncheck">查看詳情</a></td>
<?php } ?>
</tr>
<?php
endforeach;
} ?>
</tbody>
</table>
</div>
</div>
</div>
<style>
table {
table-layout: fixed;
width: 100%;
}
td {
word-wrap: break-word;
}
.width_style_1 {
width: 125px;
}
table {
width: 100%;
}
#table_index_filter {
float: right;
}
#table_index_paginate {
table-layout: fixed;
width: 100%;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
.btn-secondary {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
.btn-secondary:hover {
color: #fff;
background-color: #5a6268;
border-color: #545b62;
}
.applybtn {
color: #fff;
background-color: #1484c4;
/* display: block; */
border-radius: 5px;
padding: 5px 2px;
font-size: 13px;
line-height: 1;
display: grid;
place-items: center;
/* 水平和垂直居中 */
height: 2%vh;
/* 100%视窗高度,可根据需要调整 */
}
.applybtncheck {
color: #fff;
background-color: #eea236;
/* display: block; */
border-radius: 4px;
padding: 4px 2px;
font-size: 13px;
line-height: 1;
display: grid;
place-items: center;
/* 水平和垂直居中 */
height: 2%vh;
/* 100%视窗高度,可根据需要调整 */
}
.applybtncheck:hover {
background-color: #f0ad4e;
color: #fff;
}
.applybtn:hover {
background-color: #1494f9;
color: #fff;
}
</style>
<script>
const datas = <?php echo json_encode($datas); ?>;
// function init() {
// this.isPay();
// }
// const bonusIndex = () => {
// return {
// async isPay() {
// // console.log(123)
// for (let i = 0; i < datas.length; i++) {
// await axios.get('./api/get.php?contract_no=' + datas[i].contract_no).then(res => {
// let isPay = res.data;
// // this.data.isPay.push(isPay); // 更新 x-data 中的数据
// this.isPays.push(isPay);
// }).catch(err => {
// })
// }
// console.log(this.isPays);
// }
// }
// }
</script>
<!-- </div> -->
<style>
table {
table-layout: fixed;
width: 100%;
}
td {
word-wrap: break-word;
}
.width_st yle_1 {
width: 125px;
}
table {
width: 100%;
}
#table_index_filter {
float: right;
}
#table_index_paginate {
table-layout: fixed;
width: 100%;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
.btn-secondary {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
.btn-secondary:hover {
color: #fff;
background-color: #5a6268;
border-color: #545b62;
}
.applybtn {
color: #fff;
background-color: #1484c4;
/* display: block; */
border-radius: 5px;
/* padding: 5px 2px; */
font-size: 13px;
line-height: 1;
display: grid;
place-items: center;
/* 水平和垂直居中 */
/* height: 2%vh; */
/* 100%视窗高度,可根据需要调整 */
}
.applybtncheck {
color: #fff;
background-color: #eea236;
/* display: block; */
border-radius: 4px;
padding: 4px 2px;
font-size: 13px;
line-height: 1;
display: grid;
place-items: center;
/* 水平和垂直居中 */
height: 2%vh;
/* 100%视窗高度,可根据需要调整 */
}
.applybtncheck:hover {
background-color: #f0ad4e;
color: #fff;
}
.applybtn:hover {
background-color: #1494f9;
color: #fff;
}
</style>
<script>
const datas = <?php echo json_encode($datas); ?>;
function issue(id, user_id, pay_day, amount) {
// console.log(id);
const form = new FormData();
form.append('id', id)
form.append('user_id', user_id);
form.append('pay_day', pay_day)
form.append('amount', amount);
form.append('postType', 'a');
axios.post('./api/postStatus.php', form).then((res) => {
if (res.data == 'Success') {
alert('更新成功');
location.reload();
}
}).catch((err) => {
})
}
function All(data) {
let arr = data.split(",");
const form = new FormData();
form.append('id', arr);
form.append('user_id', '<?= $user_id ?>')
form.append('postType', 'd');
if (confirm('是否發放全部獎金')) {
axios.post('./api/postStatus.php', form).then((res) => {
if (res.status == 200) {
alert('更新成功');
location.reload();
}
}).catch((err) => {
});
}
}
// $(function() {
// $("button[name=issuePay]").click(function() {
// console.log(123);
// })
// })
// function init() {
// this.isPay();
// }
// const bonusIndex = () => {
// return {
// async isPay() {
// // console.log(123)
// for (let i = 0; i < datas.length; i++) {
// await axios.get('./api/get.php?contract_no=' + datas[i].contract_no).then(res => {
// let isPay = res.data;
// // this.data.isPay.push(isPay); // 更新 x-data 中的数据
// this.isPays.push(isPay);
// }).catch(err => {
// })
// }
// console.log(this.isPays);
// }
// }
// }
</script>

199
wms/bonus/bonus_check.php

@ -0,0 +1,199 @@
<?php
include('../header.php');
require_once('../contract-repair/conn.php');
$sql = "SELECT * FROM bonus WHERE id = :id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':id', $_GET['id']);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r($result['bonus_json']);
// echo '</pre>';
$bonus_json = json_decode($result['bonus_json']);
$paykind = [
'monthly' => '月繳',
'bimonthly' => '雙月繳',
'quarterly' => '季繳',
'semiannually' => '半年繳',
'annually' => '年繳'
];
$maintain_type = [
'new' => '新簽約',
'free_to_charge' => '免保轉有費',
'renew_priceissue' => '續簽約'
];
?>
<link rel="stylesheet" href="../contract-repair/styles/style.css">
<link rel="stylesheet" href="../contract-repair/semantic/dist/semantic.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="../contract-repair/js/alpine.js"></script>
<script defer src="../contract-repair/js/alpinejs/cdn.min.js"></script>
<script src="../contract-repair/js/axios/axios.min.js"></script>
<script src="../contract-repair/js/jquery/jquery-3.1.1.min.js"></script>
<script src="../contract-repair/semantic/dist/semantic.min.js"></script>
<div class="bonuns_index" x-data="bonunsIndex">
<div class="form" method="post" id="form" enctype="multipart/form-data">
<input type="hidden" name="form_name" value="main_form">
<div>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead>
<tr>
<td colspan="8">
<h3 style='text-align:center'>獎金計算</h3>
</td>
</tr>
</thead>
<template x-if="step==1">
<tbody style="font-weight: bolder;margin-bottom:20px">
<tr>
<td colspan="7" style="vertical-align:middle;border-right:0px">
<h4>獎金確認項</h4>
</td>
<td class="text-right" style="border: left 0px;">
<button type="button" id="btn_back" class="btn btn-default" onclick="window.history.back();">返回</button>
<button type="button" id="btn_close" class="btn btn-default" onclick="window.close()">關閉</button>
</td>
</tr>
<tr>
<td style="vertical-align:middle">合約號</td>
<td>
<input type="text" x-model="data.contract_no" disabled="disabled">
</td>
<td style="vertical-align:middle">合約類別</td>
<td>
<select id="contract_type" x-model="data.contract_type" disabled="disabled">
<option value="">--請選擇--</option>
<option value="1">新梯</option>
<option value="2">汰改</option>
<option value="3">保養</option>
</select>
<p class="alerttext" x-show="data.contract_type==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align:middle">作番號</td>
<td>
<input type="text" x-model="data.facility_no" disabled="disabled">
</td>
<td style="vertical-align:middle">獎金適用版本</td>
<td>
<input type="text" x-model="data.bonus_verson" disabled="disabled">
</td>
</tr>
<tr>
<td style="vertical-align:middle">保養類別</td>
<td>
<input type="text" x-model="data.maintain_type" disabled>
</td>
<td style="vertical-align:middle">付款方式</td>
<td>
<input type="text" x-model="data.pay_kind" disabled>
</td>
<td style="vertical-align:middle">合約付款日</td>
<td>
<input type="text" x-model="data.receivable_date_due" disabled>
</td>
<td style="vertical-align:middle">應發獎金</td>
<td>
<input type="text" x-model="data.maintain_price_total" disabled>
</td>
</tr>
<tr>
<td style="vertical-align:middle">作番總價</td>
<td>
<input type="text" x-model="data.total" disabled>
</td>
<td style="vertical-align:middle">牌價</td>
<td>
<input type="text" x-model="data.fee_per_st" disabled>
</td>
<td style="vertical-align:middle">服務費</td>
<td>
<input type="text" x-model="data.commission_fee" disabled>
</td>
<td style="vertical-align:middle">價率</td>
<td>
<input type="text" x-model="data.discount" disabled>
</td>
</tr>
<tr>
<td style="vertical-align:middle">實發獎金</td>
<td>
<input type="text" x-model="data.bonus_actual" disabled>
</td>
<td style="vertical-align:middle">實發時間</td>
<td> <input class="form-control disabled_select" type="date" x-model="data.payDay" disabled>
</td>
<td style="vertical-align:middle">備註</td>
<td><input type="text" x-model='data.note' disabled></td>
<td></td>
<td></td>
</tr>
</tbody>
</template>
</table>
<!-- <button x-show=" step==1" @click="save()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>確認</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button>
<button x-show=" step==1" @click="stop()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>暫不發放</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button> -->
<!-- <button x-show="step<=2" @click="nextStepFn()" type="button" class="btn btn-primary btn-lg pull-right savebtn" :disabled="isLoading">
<template x-if="!isLoading">
<span>下一步</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button>
<button x-show="step>1" @click="preStepFn()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>上一步</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button> -->
</div>
</div>
</div>
<script>
const user_id = '<?= $user_id ?>';
const id = '<?= $_GET['id'] ?>';
const contract_no = '<?= $result['contract_no'] ?>';
const facility_no = '<?= $result['facility_no'] ?>';
const bonus_verson = '<?= $result['bonus_verson'] ?>';
const receiver = '<?= $result['receiver'] ?>';
const payDaydue = '<?= $result['pay_day'] ?>';
const maintain_price_total = '<?= $result['amount'] ?>';
const contract_type = '<?= $result['contract_type'] ?>';
// const bonus_verson = '<?= $result['bonus_verson'] ?>';
const maintain_type = '<?= $maintain_type[$bonus_json->contract_type] ?>';
const pay_kind = '<?= $paykind[$bonus_json->paykind] ?>';
const receivable_date_due = '<?= $bonus_json->receivable_date_due ?>';
const total = '<?= $bonus_json->total ?>';
const fee_per_st = '<?= $bonus_json->fee_per_st ?>';
const commission_fee = '<?= $bonus_json->commission_fee ?>';
const discount = '<?= $bonus_json->discount ?>'
const bonus_actual = '<?= $result['bonus_actual'] ?>';
const payDay = '<?= $result['pay_day'] ?>';
const note = '<?= $result['note'] ?>'
</script>

34
wms/bonus/bonus_detail.php

@ -48,17 +48,6 @@ $maintain_type = [
</td>
</tr>
</thead>
<!-- <template x-if="step==1">
<tbody style="font-weight: bolder;margin: botton 20px;">
<tr>
<td style="vertical-align: middle;">合約號</td>
<td colspan="5">
<input class="form-control" @keyup="nextStepKeyupFn($event)" type="text" name="contract_no" x-model="data.contract_no">
</td>
<td colspan="2" style="vertical-align:middle"></td>
</tr>
</tbody>
</template> -->
<template x-if="step==1">
<tbody style="font-weight: bolder;margin-bottom:20px">
@ -111,7 +100,7 @@ $maintain_type = [
</td>
<td style="vertical-align:middle">應發獎金</td>
<td>
<input type="text" x-model="data.maintain_price_total" disabled>
<input type="text" x-model="data.maintain_price_total">
</td>
</tr>
<tr>
@ -133,6 +122,17 @@ $maintain_type = [
</td>
</tr>
<tr>
<td style="vertical-align:middle">實發獎金</td>
<td>
<input type="text" x-model="data.bonus_actual">
</td>
<td style="vertical-align:middle">實發時間</td>
<td> <input class="form-control disabled_select" type="date" x-model="data.payDay">
</td>
<td style="vertical-align:middle">備註</td>
<td><input type="text" x-model='data.note'></td>
</tr>
</tbody>
</template>
</table>
@ -145,6 +145,14 @@ $maintain_type = [
<div class="loader"></div>
</template>
</button>
<button x-show=" step==1" @click="stop()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>暫不發放</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button>
<!-- <button x-show="step<=2" @click="nextStepFn()" type="button" class="btn btn-primary btn-lg pull-right savebtn" :disabled="isLoading">
<template x-if="!isLoading">
<span>下一步</span>
@ -176,7 +184,7 @@ $maintain_type = [
const maintain_price_total = '<?= $result['amount'] ?>';
const contract_type = '<?= $result['contract_type'] ?>';
// const bonus_verson = '<?= $result['bonus_verson'] ?>';
const maintain_type = '<?= $maintain_type[$bonus_json->maintain_type] ?>';
const maintain_type = '<?= $maintain_type[$bonus_json->contract_type] ?>';
const pay_kind = '<?= $paykind[$bonus_json->paykind] ?>';
const receivable_date_due = '<?= $bonus_json->receivable_date_due ?>';
const total = '<?= $bonus_json->total ?>';

218
wms/bonus/elevator_new/elevator_new_deal_bonus.php

@ -0,0 +1,218 @@
<?php
function elevator_new_deal_bonus_v2_0($ver, $contract_type, $elevator_type, $elevator_list_price, $elevator_knockdown_price, $sales_id, $region_manger_id)
{
$bonus_array = [];
if ($ver == "2.0") {
$discount = round($elevator_knockdown_price / $elevator_list_price, 3); #銷售點數,取到小數點第三位。
#合約總類($contract_type):戰略客戶(strategy_customer)、一般客戶(general_customer)
switch ($contract_type) {
case "strategy_customer":
#契約員獎金($sales_bonus)
$sales_bonus = $elevator_knockdown_price * 0.007;
#地區經理提成獎金($region_manager_bonus)
$region_manager_bonus = 400;
break;
case "general_customer":
switch ($elevator_type) {
#客梯(passenger)、貨梯(cargo)
case ($elevator_type == "passenger" or $elevator_type == "cargo"):
switch ($discount) {
case ($discount >= 1.0):
$sales_bonus = $elevator_knockdown_price * 0.02;
break;
case ($discount >= 0.9 and $discount < 1.0):
$sales_bonus = $elevator_knockdown_price * 0.018;
break;
case ($discount >= 0.75 and $discount < 0.9):
$sales_bonus = $elevator_knockdown_price * 0.015;
break;
case ($discount < 0.75):
$sales_bonus = $elevator_knockdown_price * 0.008;
break;
};
break;
#小電梯(dumbwaiter)、平台梯(flatbase)、強驅(positive_drive)
case ($elevator_type == "dumbwaiter" or $elevator_type == "flatbase" or $elevator_type == "positive_drive"):
switch ($discount) {
case ($discount >= 1.0):
$sales_bonus = $elevator_knockdown_price * 0.02;
break;
case ($discount >= 0.9 and $discount < 1.0):
$sales_bonus = $elevator_knockdown_price * 0.018;
break;
case ($discount >= 0.72 and $discount < 0.9):
$sales_bonus = $elevator_knockdown_price * 0.015;
break;
case ($discount < 0.72):
$sales_bonus = $elevator_knockdown_price * 0.008;
break;
};
break;
};
#區域經理提成獎金($region_manager_bonus)
$region_manager_bonus = 600;
break;
};
#營銷人員銷售獎金水庫-----訂金已收款20%,發放總獎金20%
array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-訂金段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.2), #金額
"payment_schedul_due" => "deposit", #訂金已收款20%
"payment_schedul_regulation" => "訂金已收款20%,發放總獎金20%" #發放規定
]);
#營銷人員銷售獎金水庫-----出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%
array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-出貨款段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.5), #金額
"payment_schedul_due" => "shipping", #訂金已收款20%
"payment_schedul_regulation" => "出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%" #發放規定
]);
#營銷人員銷售獎金水庫-----驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%
array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-驗收款段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.3), #金額
"payment_schedul_due" => "acceptance", #訂金已收款20%
"payment_schedul_regulation" => "驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%" #發放規定
]);
#區域經理提成獎金水庫-----訂金已收款100%,發放總獎金50%
array_push($bonus_array, [
"bonus_type" => "區域經理提成獎金-訂金段", #獎金名稱
"bonus_receiver" => $region_manger_id, #發放人員
"bonus_amount" => round($region_manager_bonus * 0.5), #金額
"payment_schedul_due" => "deposit", #訂金已收款100%
"payment_schedul_regulation" => "訂金已收款100%,發放總獎金50%" #發放規定
]);
#區域經理獎金水庫-----貨到工地款(含)之前所有款項已收款100%,發放總獎金50%
array_push($bonus_array, [
"bonus_type" => "區域經理提成獎金-貨到工地款段", #獎金名稱
"bonus_receiver" => $region_manger_id, #發放人員
"bonus_amount" => round($region_manager_bonus * 0.5), #金額
"payment_schedul_due" => "deliveried", #貨到工地款(含)之前所有款項已收款100%
"payment_schedul_regulation" => "貨到工地款(含)之前所有款項已收款100%,發放總獎金50%" #發放規定
]);
$result_array = [
"ver" => $ver, #獎金版本
"result_status" => "success", #計算結果
"bonus_array" => $bonus_array #獎金水庫
];
} else {
array_push($bonus_array, [
"bonus_type" => "error", #獎金名稱
"bonus_receiver" => "error", #發放人員
"bonus_amount" => 0, #金額
"payment_schedul_due" => "9999-1-1", #預計發放時間
"payment_schedul_regulation" => "error" #發放規定
]);
$result_array = [
"ver" => $ver, #獎金版本
"result_status" => "error", #計算結果
"bonus_array" => $bonus_array #獎金水庫
];
};
return $result_array;
};
function elevator_new_deal_bonus_v1_0($ver, $contract_type, $elevator_knockdown_price, $sales_id, $region_manger_id)
{
$bonus_array = [];
if ($ver == "1.0") {
#合約總類($contract_type):戰略客戶(strategy_customer)、一般客戶(general_customer)
switch ($contract_type) {
case "strategy_customer":
#契約員獎金($sales_bonus)
$sales_bonus = $elevator_knockdown_price * 0.007;
#地區經理經理獎金($region_manager_bonus)
$region_manager_bonus = 400;
break;
case "general_customer":
#契約員獎金($sales_bonus)
$sales_bonus = $elevator_knockdown_price * 0.015;
#區域經理獎金($region_manager_bonus)
$region_manager_bonus = 600;
break;
};
#營銷人員銷售獎金水庫-----訂金已收款20%,發放總獎金20%
array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-訂金段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.2), #金額
"payment_schedul_due" => "deposit", #訂金已收款20%
"payment_schedul_regulation" => "訂金已收款20%,發放總獎金20%" #發放規定
]);
#營銷人員銷售獎金水庫-----出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%
array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-出貨款段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.5), #金額
"payment_schedul_due" => "shipping", #訂金已收款20%
"payment_schedul_regulation" => "出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%" #發放規定
]);
#營銷人員銷售獎金水庫-----驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%
array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-驗收款段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.3), #金額
"payment_schedul_due" => "acceptance", #訂金已收款20%
"payment_schedul_regulation" => "驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%" #發放規定
]);
#區域經理獎金水庫-----訂金已收款100%,發放總獎金50%
array_push($bonus_array, [
"bonus_type" => "區域經理提成獎金-訂金段", #獎金名稱
"bonus_receiver" => $region_manger_id, #發放人員
"bonus_amount" => round($region_manager_bonus * 0.5), #金額
"payment_schedul_due" => "deposit", #訂金已收款100%
"payment_schedul_regulation" => "訂金已收款100%,發放總獎金50%" #發放規定
]);
#區域經理獎金水庫-----貨到工地款(含)之前所有款項已收款100%,發放總獎金50%
array_push($bonus_array, [
"bonus_type" => "區域經理提成獎金-貨到工地款段", #獎金名稱
"bonus_receiver" => $region_manger_id, #發放人員
"bonus_amount" => round($region_manager_bonus * 0.5), #金額
"payment_schedul_due" => "deliveried", #貨到工地款(含)之前所有款項已收款100%
"payment_schedul_regulation" => "貨到工地款(含)之前所有款項已收款100%,發放總獎金50%" #發放規定
]);
$result_array = [
"ver" => $ver, #獎金版本
"result_status" => "success", #計算結果
"bonus_array" => $bonus_array #獎金水庫
];
} else {
array_push($bonus_array, [
"bonus_type" => "error", #獎金名稱
"bonus_receiver" => "error", #發放人員
"bonus_amount" => 0, #金額
"payment_schedul_due" => "9999-1-1", #預計發放時間
"payment_schedul_regulation" => "error" #發放規定
]);
$result_array = [
"ver" => $ver, #獎金版本
"result_status" => "error", #計算結果
"bonus_array" => $bonus_array #獎金水庫
];
};
return $result_array;
};

48
wms/bonus/other/maintenance_contract_bonus_v2_1.php

@ -41,7 +41,7 @@ result_array[
function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period, $elevator_list_price, $fee_per_st, $commission_fee, $receivable_date_due, $sales_id, $region_director_id, $regular_contract_manger_id)
function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period, $elevator_list_price, $fee_per_st, $commission_fee, $receivable_date_due, $sales_id, $region_director_id, $regular_contract_manger_id = '')
{
$bonus_array = [];
if ($ver == "2.1") {
@ -54,13 +54,13 @@ function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period,
switch ($discount) {
case ($discount >= 0.8):
switch ($fee_per_st) {
case ($fee_per_st < 3000):
case ($fee_per_st <= 3000):
$sales_bonus = ($fee_per_st - $commission_fee) * 0.6;
break;
case ($fee_per_st >= 3000 and $fee_per_st < 3500):
case ($fee_per_st >= 3001 and $fee_per_st <= 3499):
$sales_bonus = ($fee_per_st - $commission_fee) * 0.7;
break;
case ($fee_per_st >= 3500 and $fee_per_st < 4000):
case ($fee_per_st >= 3500 and $fee_per_st <= 3999):
$sales_bonus = ($fee_per_st - $commission_fee) * 0.8;
break;
case ($fee_per_st >= 4000):
@ -157,19 +157,19 @@ function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period,
"bonus_receiver" => $region_director_id, #發放人員
"bonus_amount" => round($region_director_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +1 months")), #預計發放時間
"bonus_regulation" => "第1次款項收回後,次月發放", #發放規定
'discount' => $discount //折扣率
"bonus_regulation" => "第1次款項收回後,次月發放" #發放規定
]);
#專任契約經理獎金
array_push($bonus_array, [
"bonus_type" => "3", #獎金名稱
"bonus_receiver" => $regular_contract_manger_id, #發放人員
"bonus_amount" => round($regular_contract_manger_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +1 months")), #預計發放時間
"bonus_regulation" => "第1次款項收回後,次月發放", #發放規定
'discount' => $discount //折扣率
]);
if ($regular_contract_manger_id != '') {
array_push($bonus_array, [
"bonus_type" => "3", #獎金名稱
"bonus_receiver" => $regular_contract_manger_id, #發放人員
"bonus_amount" => round($regular_contract_manger_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +1 months")), #預計發放時間
"bonus_regulation" => "第1次款項收回後,次月發放" #發放規定
]);
}
#契約員獎金
switch ($payment_period) {
@ -180,9 +180,7 @@ function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period,
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +1 months")), #預計發放時間
"bonus_regulation" => "每月收款後,按收款比率次月發放", #發放規定
'discount' => $discount //折扣率
"bonus_regulation" => "每月收款後,按收款比率次月發放" #發放規定
]);
break;
@ -201,9 +199,7 @@ function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period,
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($current_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +$payday_due_array[$i] months")), #預計發放時間
"bonus_regulation" => "每月收款後,按收款比率次月發放", #發放規定
'discount' => $discount //折扣率
"bonus_regulation" => "每月收款後,按收款比率次月發放" #發放規定
]);
}
break;
@ -223,9 +219,7 @@ function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period,
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($current_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +$payday_due_array[$i] months")), #預計發放時間
"bonus_regulation" => "每月收款後,按收款比率次月發放", #發放規定
'discount' => $discount //折扣率
"bonus_regulation" => "每月收款後,按收款比率次月發放" #發放規定
]);
}
break;
@ -245,9 +239,7 @@ function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period,
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($current_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +$payday_due_array[$i] months")), #預計發放時間
"bonus_regulation" => "每月收款後,按收款比率次月發放", #發放規定
'discount' => $discount //折扣率
"bonus_regulation" => "每月收款後,按收款比率次月發放" #發放規定
]);
}
break;
@ -267,9 +259,7 @@ function maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period,
"bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($current_bonus), #金額
"pay_day_due" => date("Y-m-d", strtotime("$receivable_date_due +$payday_due_array[$i] months")), #預計發放時間
"bonus_regulation" => "每月收款後,按收款比率次月發放", #發放規定
'discount' => $discount //折扣率
"bonus_regulation" => "每月收款後,按收款比率次月發放" #發放規定
]);
}
break;

469
wms/bonus/other/maintenance_contract_bonus_v2_1_examination.php

@ -48,244 +48,281 @@ require_once("maintenance_contract_bonus_v2_1.php");
#獎金測試
$examination_array = [
#錯誤版本
["1.0","new","one",0.8,4000,333, "2014-07-01", "M0001", "M0002", "M0003"],
// ["1.0", "new", "one", 0.8, 4000, 333, "2014-07-01", "M0001", "M0002", "M0003"],
#新簽約
#月繳(monthly)
["2.1","new","monthly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","new","monthly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","new","monthly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","new","monthly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","new","monthly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","new","monthly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","new","monthly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","new","monthly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","new","monthly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","new","monthly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","new","monthly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","new","monthly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1","new","bimonthly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","new","bimonthly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","new","bimonthly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","new","bimonthly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","new","bimonthly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","new","bimonthly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","new","bimonthly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","new","bimonthly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","new","bimonthly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","new","bimonthly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","new","bimonthly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","new","bimonthly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1","new","quarterly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","new","quarterly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","new","quarterly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","new","quarterly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","new","quarterly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","new","quarterly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","new","quarterly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","new","quarterly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","new","quarterly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","new","quarterly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","new","quarterly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","new","quarterly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#月繳(monthly)
["2.1", "new", "monthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", ''], #新簽約、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "monthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "monthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "monthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "monthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "monthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "monthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "monthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "monthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "monthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "monthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "monthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1", "new", "bimonthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "bimonthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "bimonthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "bimonthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "bimonthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "bimonthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1", "new", "quarterly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "quarterly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "quarterly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "quarterly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "quarterly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "quarterly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1","new","semiannually",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","new","semiannually",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","new","semiannually",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","new","semiannually",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","new","semiannually",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","new","semiannually",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","new","semiannually",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","new","semiannually",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","new","semiannually",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","new","semiannually",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","new","semiannually",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","new","semiannually",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1", "new", "semiannually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "semiannually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "semiannually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "semiannually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "semiannually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "semiannually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1","new","annually",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","new","annually",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","new","annually",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","new","annually",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","new","annually",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","new","annually",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","new","annually",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","new","annually",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","new","annually",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","new","annually",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","new","annually",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","new","annually",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1", "new", "annually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "new", "annually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "new", "annually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "new", "annually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "new", "annually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "new", "annually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "new", "annually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "new", "annually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "new", "annually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "new", "annually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "new", "annually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "new", "annually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #新簽約、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#免保轉有費(free_to_charge)
#月繳(monthly)
["2.1","free_to_charge","monthly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","free_to_charge","monthly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","free_to_charge","monthly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","free_to_charge","monthly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","free_to_charge","monthly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","free_to_charge","monthly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","free_to_charge","monthly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","free_to_charge","monthly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","free_to_charge","monthly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","free_to_charge","monthly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","free_to_charge","monthly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","free_to_charge","monthly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1","free_to_charge","bimonthly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","free_to_charge","bimonthly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","free_to_charge","bimonthly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","free_to_charge","bimonthly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","free_to_charge","bimonthly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","free_to_charge","bimonthly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","free_to_charge","bimonthly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","free_to_charge","bimonthly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","free_to_charge","bimonthly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","free_to_charge","bimonthly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","free_to_charge","bimonthly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","free_to_charge","bimonthly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1","free_to_charge","quarterly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","free_to_charge","quarterly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","free_to_charge","quarterly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","free_to_charge","quarterly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","free_to_charge","quarterly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","free_to_charge","quarterly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","free_to_charge","quarterly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","free_to_charge","quarterly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","free_to_charge","quarterly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","free_to_charge","quarterly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","free_to_charge","quarterly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","free_to_charge","quarterly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#月繳(monthly)
["2.1", "free_to_charge", "monthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "monthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "monthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "monthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "monthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "monthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1", "free_to_charge", "bimonthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "bimonthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "bimonthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "bimonthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "bimonthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "bimonthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1", "free_to_charge", "quarterly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "quarterly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "quarterly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "quarterly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "quarterly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "quarterly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1","free_to_charge","semiannually",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","free_to_charge","semiannually",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","free_to_charge","semiannually",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","free_to_charge","semiannually",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","free_to_charge","semiannually",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","free_to_charge","semiannually",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","free_to_charge","semiannually",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","free_to_charge","semiannually",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","free_to_charge","semiannually",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","free_to_charge","semiannually",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","free_to_charge","semiannually",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","free_to_charge","semiannually",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1", "free_to_charge", "semiannually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "semiannually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "semiannually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "semiannually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "semiannually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "semiannually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1","free_to_charge","annually",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","free_to_charge","annually",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","free_to_charge","annually",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","free_to_charge","annually",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","free_to_charge","annually",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","free_to_charge","annually",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","free_to_charge","annually",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","free_to_charge","annually",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","free_to_charge","annually",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","free_to_charge","annually",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","free_to_charge","annually",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","free_to_charge","annually",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1", "free_to_charge", "annually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "free_to_charge", "annually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "free_to_charge", "annually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "free_to_charge", "annually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "free_to_charge", "annually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "free_to_charge", "annually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #免保轉有費、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#續簽約(原價或僅契約金額異動)(renew_priceissue)
#月繳(monthly)
["2.1","renew_priceissue","monthly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","renew_priceissue","monthly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","renew_priceissue","monthly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","renew_priceissue","monthly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","renew_priceissue","monthly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","renew_priceissue","monthly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","renew_priceissue","monthly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","renew_priceissue","monthly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","renew_priceissue","monthly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","renew_priceissue","monthly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","renew_priceissue","monthly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","renew_priceissue","monthly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1","renew_priceissue","bimonthly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","renew_priceissue","bimonthly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","renew_priceissue","bimonthly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","renew_priceissue","bimonthly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","renew_priceissue","bimonthly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","renew_priceissue","bimonthly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","renew_priceissue","bimonthly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","renew_priceissue","bimonthly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","renew_priceissue","bimonthly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","renew_priceissue","bimonthly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","renew_priceissue","bimonthly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","renew_priceissue","bimonthly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1","renew_priceissue","quarterly",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","renew_priceissue","quarterly",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","renew_priceissue","quarterly",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","renew_priceissue","quarterly",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","renew_priceissue","quarterly",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","renew_priceissue","quarterly",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","renew_priceissue","quarterly",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","renew_priceissue","quarterly",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","renew_priceissue","quarterly",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","renew_priceissue","quarterly",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","renew_priceissue","quarterly",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","renew_priceissue","quarterly",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#月繳(monthly)
["2.1", "renew_priceissue", "monthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "monthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "monthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "monthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "monthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "monthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、月繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#2月1次繳(bimonthly)
["2.1", "renew_priceissue", "bimonthly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "bimonthly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "bimonthly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "bimonthly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "bimonthly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "bimonthly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、2月1次繳、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#季付(quarterly)
["2.1", "renew_priceissue", "quarterly", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "quarterly", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "quarterly", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "quarterly", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "quarterly", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "quarterly", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、季付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1","renew_priceissue","semiannually",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","renew_priceissue","semiannually",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","renew_priceissue","semiannually",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","renew_priceissue","semiannually",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","renew_priceissue","semiannually",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","renew_priceissue","semiannually",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","renew_priceissue","semiannually",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","renew_priceissue","semiannually",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","renew_priceissue","semiannually",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","renew_priceissue","semiannually",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","renew_priceissue","semiannually",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","renew_priceissue","semiannually",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#半年付(semiannually)
["2.1", "renew_priceissue", "semiannually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "semiannually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "semiannually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "semiannually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "semiannually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "semiannually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、半年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1","renew_priceissue","annually",3000,3000,600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1","renew_priceissue","annually",3000,3001,601,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1","renew_priceissue","annually",3000,3500,1100,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1","renew_priceissue","annually",3000,4000,1600,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1","renew_priceissue","annually",3000,3000,1200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1","renew_priceissue","annually",3000,3001,1201,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1","renew_priceissue","annually",3000,3500,1700,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1","renew_priceissue","annually",3000,4000,2200,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1","renew_priceissue","annually",3000,3000,1230,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1","renew_priceissue","annually",3000,3001,1231,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1","renew_priceissue","annually",3000,3500,1730,"2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1","renew_priceissue","annually",3000,4000,2230,"2014-07-01", "M0001", "M0002", "M0003"] #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
#年付(annually)
["2.1", "renew_priceissue", "annually", 3000, 3000, 600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 3001, 601, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費601元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 3500, 1100, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1100元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 4000, 1600, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費1600元(折扣率0.8)
["2.1", "renew_priceissue", "annually", 3000, 3000, 1200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費1200元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 3001, 1201, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費1201元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 3500, 1700, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1700元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 4000, 2200, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費2200元(折扣率0.6)
["2.1", "renew_priceissue", "annually", 3000, 3000, 1230, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3000元、服務費1230元(折扣率0.59)
["2.1", "renew_priceissue", "annually", 3000, 3001, 1231, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3001元、服務費1231元(折扣率0.59)
["2.1", "renew_priceissue", "annually", 3000, 3500, 1730, "2014-07-01", "M0001", "M0002", "M0003"], #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價3500元、服務費1730元(折扣率0.59)
["2.1", "renew_priceissue", "annually", 3000, 4000, 2230, "2014-07-01", "M0001", "M0002", "M0003"] #續簽約(原價或僅契約金額異動)、年付、牌價3000、簽約價4000元、服務費2230元(折扣率0.59)
];
// echo '1、契約總類($contract_type):新簽約(new)、免保轉有費(free_to_charge)、續簽約(原價或僅契約金額異動)(renew_priceissue)</br>';
// echo '6、付款方式$payment_period: 每月支付(monthly), 2月1次(bimonthly), 季付(quarterly), 半年付(semiannually), 年付(annually)</br>';
// echo '2、作番契約金額($fee_per_st):3000元/月以下、3001-3499元/月、3500-3999元/月、4000元/月以上</br>';
// echo '3、牌價($elevator_list_price):該電梯的合約發佈(標準)價+Option價格+與其他電梯共同分擔的費用貨價格</br>';
// echo '4、該作番所佔的服務費金額($commission_fee)</br>';
// echo '5、合約折扣率($discount):大於80%以上(含)(above_80)、60-79%(含)以上(60_to_79)、折扣率59% (含)以下(below_59) ; 契約折扣率=(簽約價格-服務費)/牌價</br>';
// echo '7、第一筆保養款項應收回日($receivable_date_due, array)</br>';
// echo '8、契約員員工號($sales_id)</br>';
// echo '9、地區處長員工號($region_director_id)</br>';
// echo '10、專任契約經理員工號($regular_contract_manger_id)</br>';
for ($i = 0; $i < count($examination_array); $i++) {
$fee_per_st = $examination_array[$i][3];
$commission_fee = $examination_array[$i][5];
$elevator_list_price = $examination_array[$i][4];
$discount = round(($fee_per_st - $commission_fee) / $elevator_list_price, 2);
for($i = 0; $i<count($examination_array); $i++){
// echo "$fee_per_st - $commission_fee / $elevator_list_price ";
// $discount = round(($examination_array[$i][4] - $examination_array[$i][6]) / $examination_array[$i][5], 2);
$examination_array[$i][9] = $examination_array[$i][9] == '' ? '' : $examination_array[$i][9];
$result = maintenance_contract_bonus_v2_1(
$examination_array[$i][0],
$examination_array[$i][1],
$examination_array[$i][2],
$examination_array[$i][3],
$examination_array[$i][4],
$examination_array[$i][5],
$examination_array[$i][6],
$examination_array[$i][7],
$examination_array[$i][8],
$examination_array[$i][9]
$examination_array[$i][1],
$examination_array[$i][2],
$examination_array[$i][3],
$examination_array[$i][4],
$examination_array[$i][5],
$examination_array[$i][6],
$examination_array[$i][7],
$examination_array[$i][8],
$examination_array[$i][9]
);
#新簽約、月繳、牌價3000、簽約價3000元、服務費600元(折扣率0.8)
$contract_type = [
'new' => '新簽約',
'free_to_charge' => '免保轉有費',
'renew_priceissue' => '續簽約(原價或僅契約金額異動)'
];
// 付款方式$payment_period: 每月支付(monthly), 2月1次(bimonthly), 季付(quarterly), 半年付(semiannually), 年付(annually)
$pay_kind = [
'monthly' => '月繳',
'bimonthly' => '雙月繳',
'quarterly' => '季繳',
'semiannually' => '半年繳',
'annually' => '年繳'
];
//
$bonus_type = [
'1' => '契約員獎金',
'2' => '區經理獎金',
'3' => '契約經理獎金'
];
echo "獎金版本:" . $result["ver"] . "<br>";
echo "計算結果:" . $result["result_status"] . "<br>";
echo "傳入參數說明:" . $contract_type[$examination_array[$i][1]] . "、" . $pay_kind[$examination_array[$i][2]] . "、牌價" . $examination_array[$i][3] . "元、簽約價" . $examination_array[$i][4] . "元、服務費600元(折扣率" . $discount . ")、契約人員 : " . $examination_array[$i][7] . "、區經理 : " . $examination_array[$i][8] . " 、契約經理 : " . $examination_array[$i][9] . "<br>";
echo "輸入參數:" . $examination_array[$i][1] . " " . $examination_array[$i][2] . " " . $examination_array[$i][3] . " " . $examination_array[$i][4] . " "
. $examination_array[$i][5] . " " . $examination_array[$i][6] . " " . $examination_array[$i][7]. " " . $examination_array[$i][8] . " "
. $examination_array[$i][9] . "<br>";
for($j = 0; $j<count($result["bonus_array"]); $j++){
echo "輸出結果:" . $result["bonus_array"][$j]["bonus_type"] . " " . $result["bonus_array"][$j]["bonus_receiver"] . " "
. $result["bonus_array"][$j]["bonus_amount"] . " " . $result["bonus_array"][$j]["pay_day_due"] . " "
. $result["bonus_array"][$j]["bonus_regulation"] . "<br>";
. $examination_array[$i][5] . " " . $examination_array[$i][6] . " " . $examination_array[$i][7] . " " . $examination_array[$i][8] . " "
. $examination_array[$i][9] . "<br>";
for ($j = 0; $j < count($result["bonus_array"]); $j++) {
echo "輸出結果:" . $bonus_type[$result["bonus_array"][$j]["bonus_type"]] . " ,發放人員 : " . $result["bonus_array"][$j]["bonus_receiver"] . " ,發放金額 : "
. $result["bonus_array"][$j]["bonus_amount"] . " ,預計發放時間 : " . $result["bonus_array"][$j]["pay_day_due"] . " ,說明 : "
. $result["bonus_array"][$j]["bonus_regulation"] . "<br>";
};
echo "-------------------------" . "<br>";
};
?>

190
wms/contract-repair/contract-renovate-input.php

@ -92,7 +92,7 @@ $contractSalesman = $stmt->fetchAll(PDO::FETCH_ASSOC);
<tr>
<td rowspan="4">材料</td>
<td rowspan="3">材料</td>
<td>1、訂金</td>
<td>
<input type="text">
@ -143,8 +143,11 @@ $contractSalesman = $stmt->fetchAll(PDO::FETCH_ASSOC);
</select>
</td>
</tr>
<!-- <tr>
<td>4、其他</td>
<tr>
<td rowspan="3">安裝</td>
<td>5、安裝完畢款</td>
<td>
<input type="text">
</td>
@ -152,112 +155,93 @@ $contractSalesman = $stmt->fetchAll(PDO::FETCH_ASSOC);
<input type="text">
</td>
<td>
<select x-model=data.paykind[3] @change="totalFn()">
<select x-model=data.paykind[4] @change="totalFn()">
<template x-for="pay in data.payarr" :key="pay">
<!-- <option value=""></option> -->
<option x-text="pay"></option>
</template>
</select>
</td>
</tr> -->
<tr>
<td rowspan="3">安裝</td>
<td>5、安裝完畢款</td>
<td>
<input type="text">
</td>
<td colspan="2">
<input type="text">
</td>
<td>
<select x-model=data.paykind[4] @change="totalFn()">
<template x-for="pay in data.payarr" :key="pay">
<!-- <option value=""></option> -->
<option x-text="pay"></option>
</template>
</select>
</td>
</tr>
<tr>
<td>6、驗收款</td>
<td>
<input type="text">
</td>
<td colspan="2">
<input type="text">
</td>
<td>
<select x-model=data.paykind[5] @change="totalFn()">
<template x-for="pay in data.payarr" :key="pay">
<!-- <option value=""></option> -->
<option x-text="pay"></option>
</template>
</select>
</td>
</tr>
<tr>
<td>7、其他</td>
<td>
<input type="text">
</td>
<td colspan="2">
<input type="text">
</td>
<td>
<select x-model=data.paykind[6] @change="totalFn()">
<template x-for="pay in data.payarr" :key="pay">
<!-- <option value=""></option> -->
<option :value="pay" x-text="pay"></option>
</template>
</select>
</td>
</tr>
<option x-text="pay"></option>
</template>
</select>
</td>
</tr>
<tr>
<td>6、驗收款</td>
<td>
<input type="text">
</td>
<td colspan="2">
<input type="text">
</td>
<td>
<select x-model=data.paykind[5] @change="totalFn()">
<template x-for="pay in data.payarr" :key="pay">
<!-- <option value=""></option> -->
<option x-text="pay"></option>
</template>
</select>
</td>
</tr>
<tr>
<td>7、其他</td>
<td>
<input type="text">
</td>
<td colspan="2">
<input type="text">
</td>
<td>
<select x-model=data.paykind[6] @change="totalFn()">
<template x-for="pay in data.payarr" :key="pay">
<!-- <option value=""></option> -->
<option :value="pay" x-text="pay"></option>
</template>
</select>
</td>
</tr>
<tr>
<td colspan="2">合計</td>
<td>
<input type="text" disabled>
</td>
<td colspan="2">
<input type="text" disabled>
</td>
<td>
<input type="text" x-model="data.total" disabled>
</td>
</tr>
</div>
</tbody>
<tr>
<td colspan="2">合計</td>
<td>
<input type="text" disabled>
</td>
<td colspan="2">
<input type="text" disabled>
</td>
<td>
<input type="text" x-model="data.total" disabled>
</td>
</tr>
</div>
</tbody>
</template>
</table>
</template>
</table>
<button x-show="step==3" @click="save()" type="button" class="btn btn-primary btn-lg pull-right savebutton" :disabled="isLoading">
<template x-if="!isLoading">
<span>存檔</span>
</template>
<template x-if="isLoading">
<span class="loader"></span>
</template>
</button>
<button x-show="step==3" @click="save()" type="button" class="btn btn-primary btn-lg pull-right savebutton" :disabled="isLoading">
<template x-if="!isLoading">
<span>存檔</span>
</template>
<template x-if="isLoading">
<span class="loader"></span>
</template>
</button>
<button x-show="step<2" @click="nextStepFn()" class="btn btn-primary btn-lg pull-right savebutton" :disabled="isLoading">
<template x-if="!isLoading">
<span>下一步</span>
</template>
<template x-if="isLoading">
<span class="loader"></span>
</template>
</button>
<button x-show="step<2" @click="nextStepFn()" class="btn btn-primary btn-lg pull-right savebutton" :disabled="isLoading">
<template x-if="!isLoading">
<span>下一步</span>
</template>
<template x-if="isLoading">
<span class="loader"></span>
</template>
</button>
<button x-show="step>1" @click="preStepFn()" class="btn btn-primary btn-lg pull-right savebutton" :disabled="isLoading">
<template x-if="!isLoading">
<span>上一步</span>
</template>
<template x-if="isLoading">
<span class="loaders"></span>
</template>
</button>
<button x-show="step>1" @click="preStepFn()" class="btn btn-primary btn-lg pull-right savebutton" :disabled="isLoading">
<template x-if="!isLoading">
<span>上一步</span>
</template>
<template x-if="isLoading">
<span class="loaders"></span>
</template>
</button>
</div>
</div>
</div>
</div>

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

@ -900,7 +900,13 @@ const bonunsIndex = () => {
total: total,
fee_per_st: fee_per_st,
commission_fee: commission_fee,
discount: discount
discount: discount,
bonus_actual: '',
note: '',
id: id,
// bonus_actual: bonus_actual,
// payDay: payDay,
// note: note
},
step: 1,
@ -929,6 +935,9 @@ const bonunsIndex = () => {
this.step = 3; s
}
},
issue() {
console.log(1233);
},
getContractData() {
axios.get('./api/get.php?contract_no=' + this.data.contract_no).then(res => {
if (!res.data) {
@ -965,7 +974,39 @@ const bonunsIndex = () => {
},
save() {
if (this.step == 1) {
window.history.back();
// window.history.back();
const form = new FormData();
form.append('id', this.data.id);
form.append('bonus_actual', this.data.bonus_actual);
form.append('pay_day', this.data.payDay);
form.append('note', this.data.note);
form.append('user_id', this.data.user_id);
form.append('postType', 'b');
axios.post('./api/postStatus.php', form).then((res) => {
alert('更新成功');
window.history.go(-1);
}).catch((err) => {
// alert('更新失敗');
alert('更新失敗' + err.response.data);
})
}
},
stop() {
if (this.step == 1) {
const form = new FormData();
form.append('id', this.data.id);
form.append('bonus_actual', this.data.bonus_actual);
form.append('pay_day', this.data.payDay);
form.append('note', this.data.note);
form.append('postType', 'c');
axios.post('./api/postStatus.php', form).then((res) => {
console.log(res);
alert('更新成功');
window.history.go(-1);
}).catch((err) => {
alert(err.response.data);
})
}
},
calBons() {
@ -1001,7 +1042,7 @@ const bonunsIndex = () => {
}
}
const bonunsIndexTest = () => {
const bonusIndexTest = () => {
return {
data: {
bonus_verson: '2.1',
@ -1028,8 +1069,8 @@ const bonunsIndexTest = () => {
step: 1,
isLoading: false,
fail_arr: [],
test() {
console.log(this.data.paykind);
issue() {
console.log('123');
},
nextStepFn() {
if (this.step == 1) {

2
wms/contract-repair/styles/style.css

@ -654,7 +654,7 @@ main table th {
align-items: center;
width: 70px;
height: 45px;
font-size: 15px;
font-size: 10px;
}
.contract-input-component .form table .fixed,
.contract-management .form table .fixed,

2
wms/contract-repair/styles/style.scss

@ -707,7 +707,7 @@ main {
align-items: center;
width: 70px;
height: 45px;
font-size: 15px;
font-size: 10px;
}
table {

11
wms/contract/api/T8salIncomeApply.php

@ -3,14 +3,15 @@ require_once("../../T8_Authorization_from_bpm.php");
function T8API($data)
{
// echo '<pre>';
// print_r(json_encode($data));
// echo '</pre>';
$api_url = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData';
$validation = get_Auth();
echo '<pre>';
print_r(json_encode($data));
echo '</pre>';
$header = [
"CHI_Authorization :" . $validation
"CHI_Authorization :" . $validation,
"GroupId:TEST"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url); // 设置请求的URL
@ -20,6 +21,7 @@ function T8API($data)
curl_setopt($ch, CURLOPT_POST, 1); // 使用 POST
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if ($response === false) {
echo 'Curl error: ' . curl_error($ch);
} else {
@ -32,6 +34,7 @@ function T8API($data)
// print_r($result);
return $result;
}
return $result;
}
curl_close($ch);

121
wms/contract/api/getComboNo.php

@ -1,59 +1,62 @@
<?php
class CreateComboNo{
private $comboarr = [
'week'=>'BW002',
'month'=>'EM002',
'quarter'=>'EQ002',
'half'=>'HY002',
'year'=>'EY002'
];
private $bwarr = [
'week','month','week','month','week','quarter',
'week','month','week','month','week','half',
'week','month','week','month','week','quarter',
'week','month','week','month','week','year'
];
private $emarr = [
'month','month','quarter','month','month','half',
'month','month','quarter','month','month','year'
];
private $combo;
private $startdate;
private $enddate;
public function __construct($combo, $startdate, $enddate){
$this->combo = $combo;
$this->startdate = $startdate;
$this->enddate = $enddate;
}
public function getComboNo(){
$comboarr = (array) $this->combo === 'bw' ? $this->bwarr : $this->emarr;
$startdate = new DateTime($this->startdate);
$enddate = new DateTime($this->enddate);
$interval = date_diff($startdate, $enddate);
$months = $interval->y * 12 + $interval->m;
$months = $this->combo === 'bw' ? $months*2 : $months;
$newarr = [];
$idx = 0;
$ori_first_month = date('m', strtotime($this->startdate));
$first_day = date('Y-m-d', strtotime($this->startdate. ' + 3 days'));
$new_first_month = date('m', strtotime($first_day));
if($ori_first_month != $new_first_month){
$first_day = date('Y-m-t', strtotime($this->startdate));
}
$scheduleDate = new DateTime($first_day);
for ($i = 0; $i < $months; $i++){
$newarr[] = [$this->comboarr[$comboarr[$idx]], $scheduleDate->format("Y-m-d")];
$idx ++;
$scheduleDate = $startdate->modify("+1 month");
if($idx >= count($comboarr)){
$idx = 0;
}
}
return json_encode($newarr);
}
}
<?php
class CreateComboNo
{
private $comboarr = [
'week' => 'BW002',
'month' => 'EM002',
'quarter' => 'EQ002',
'half' => 'HY002',
'year' => 'EY002'
];
private $bwarr = [
'week', 'month', 'week', 'month', 'week', 'quarter',
'week', 'month', 'week', 'month', 'week', 'half',
'week', 'month', 'week', 'month', 'week', 'quarter',
'week', 'month', 'week', 'month', 'week', 'year'
];
private $emarr = [
'month', 'month', 'quarter', 'month', 'month', 'half',
'month', 'month', 'quarter', 'month', 'month', 'year'
];
private $combo;
private $startdate;
private $enddate;
public function __construct($combo, $startdate, $enddate)
{
$this->combo = $combo;
$this->startdate = $startdate;
$this->enddate = $enddate;
}
public function getComboNo()
{
$comboarr = (array) $this->combo === 'bw' ? $this->bwarr : $this->emarr;
$startdate = new DateTime($this->startdate);
$enddate = new DateTime($this->enddate);
$interval = date_diff($startdate, $enddate);
$months = $interval->y * 12 + $interval->m;
$months = $this->combo === 'bw' ? $months * 2 : $months;
$newarr = [];
$idx = 0;
$ori_first_month = date('m', strtotime($this->startdate));
$first_day = date('Y-m-d', strtotime($this->startdate . ' + 3 days'));
$new_first_month = date('m', strtotime($first_day));
if ($ori_first_month != $new_first_month) {
$first_day = date('Y-m-d', strtotime($this->startdate));
}
$scheduleDate = new DateTime($first_day);
for ($i = 0; $i <= $months; $i++) {
$newarr[] = [$this->comboarr[$comboarr[$idx]], $scheduleDate->format("Y-m-d")];
$idx++;
$scheduleDate = $scheduleDate->modify("+1 month");
if ($idx >= count($comboarr)) {
$idx = 0;
}
}
return json_encode($newarr);
}
}

95
wms/contract/api/getContractData.php

@ -1,7 +1,7 @@
<?php
<?php
require_once('../conn.php');
if(isset($_GET['contractno']) && $_GET['contractno']!='' && isset($_GET['contracttype']) && $_GET['contracttype']=='b'){
try{
if (isset($_GET['contractno']) && $_GET['contractno'] != '' && isset($_GET['contracttype']) && $_GET['contracttype'] == 'b') {
try {
$contractno = $_GET['contractno'];
$sql_str = "SELECT con_maintance_examine_apply.*, con_maintance_examine_clear.* FROM con_maintance_examine_apply
JOIN con_maintance_examine_clear on con_maintance_examine_apply.apply_key=con_maintance_examine_clear.apply_key
@ -10,9 +10,9 @@ if(isset($_GET['contractno']) && $_GET['contractno']!='' && isset($_GET['contrac
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contractno);
$stmt->execute();
$contract= $stmt->fetch(PDO::FETCH_ASSOC);
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
if(empty($contract)){
if (empty($contract)) {
echo false;
exit;
}
@ -21,42 +21,99 @@ if(isset($_GET['contractno']) && $_GET['contractno']!='' && isset($_GET['contrac
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':apply_key', $apply_key);
$stmt->execute();
$elevators= $stmt->fetchAll(PDO::FETCH_ASSOC);
$elevators = $stmt->fetchAll(PDO::FETCH_ASSOC);
$count = COUNT($elevators);
// foreach ($elevators as $key => $elevator) {
// $elevator['discount'] = ($elevator['sold_price'] / $elevator['stand_price']) * 100;
// }
$contract['elevators'] = $elevators;
$contract['num'] = $count;
$contractResponse = json_encode($contract);
// 設定回應標頭為 JSON
header('Content-Type: application/json');
// 將 JSON 回應返回給客戶端
echo $contractResponse;
// echo json_encode($contractResponse);
}catch (PDOException $e ){
die("ERROR!!!: ". $e->getMessage());
} catch (PDOException $e) {
die("ERROR!!!: " . $e->getMessage());
}
}
if(isset($_GET['contractno']) && $_GET['contractno']!='' && isset($_GET['contracttype']) && $_GET['contracttype']=='m'){
try{
if (isset($_GET['contractno']) && $_GET['contractno'] != '' && isset($_GET['contracttype']) && $_GET['contracttype'] == 'm') {
try {
$contractno = $_GET['contractno'];
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no ORDER BY created_at DESC";
$sql_str = "SELECT a.*,b.lm_tel,b.uscc,b.manager,b.linkman FROM pricereview_main AS a
LEFT JOIN hope_elevator_customer AS b ON a.contractno = b.vol_no
WHERE a.contractno = :contractno AND a.status != 'YN' ";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contractno);
$stmt->bindParam(':contractno', $contractno);
$stmt->execute();
$contract= $stmt->fetch(PDO::FETCH_ASSOC);
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
$salesman = $contract['person'];
$sql = "SELECT * FROM account WHERE accountid = :accountid ";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':accountid', $salesman);
$stmt->execute();
$account_detail = $stmt->fetch(PDO::FETCH_ASSOC);
$contract['manager'] = $account_detail['manager'];
$contract['salesman_departno'] = $account_detail['department_id'];
$mid = $contract['id'];
$sql = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A' ";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
$elevators_detail_arr = [];
foreach ($results as $keys => $result) {
$note = explode(',', $result['note']);
$result['spec'] = $note[0]; //型號
$result['person'] = $note[1]; // 人承
$result['floor'] = $note[2]; // 樓層
$result['speed'] = $note[3]; // 速度
for ($i = 0; $i < $result['item_qty']; $i++) {
$result['item_no'] = $i + 1;
array_push($elevators_detail_arr, $result);
}
}
$count = COUNT($elevators_detail_arr);
$contract['elevators'] = $results;
$contract['elevators_detail_arr'] = $elevators_detail_arr;
$contract['nums'] = $count;
// echo '<pre>';
// print_r($contract);
// echo '</pre>';
// exit;
$contractResponse = json_encode($contract);
// 設定回應標頭為 JSON
header('Content-Type: application/json');
// 將 JSON 回應返回給客戶端
echo $contractResponse;
}catch (PDOException $e ){
die("ERROR!!!: ". $e->getMessage());
} catch (PDOException $e) {
die("ERROR!!!: " . $e->getMessage());
}
}
if (!empty($_GET['contracttype']) && $_GET['contracttype'] == 'accountManger' && !empty($_GET['salesman'])) {
try {
$salesman = $_GET['salesman'];
$sql = "SELECT manager FROM account WHERE accountid = :accountid";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':accountid', $salesman);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
header('Content-Type:application/json');
echo json_encode($result);
} catch (PDOException $e) {
die("ERROR!!!:" . $e->getMessage());
}
}

276
wms/contract/api/postContractData.php

@ -18,7 +18,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$phone = !empty($_POST['phone']) ? $_POST['phone'] : null;
$email = !empty($_POST['email']) ? $_POST['email'] : null;
$mworker = !empty($_POST['mworker']) ? $_POST['mworker'] : null;
$mcycle = !empty($_POST['mcycle']) ? $_POST['mcycle'] : null;
// $mcycle = !empty($_POST['mcycle']) ? $_POST['mcycle'] : null;
$salesman = !empty($_POST['salesman']) ? $_POST['salesman'] : null;
$contract_begin_date = !empty($_POST['contract_begin_date']) ? $_POST['contract_begin_date'] : null;
$contract_end_date = !empty($_POST['contract_end_date']) ? $_POST['contract_end_date'] : null;
@ -35,17 +35,53 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$files = !empty($_FILES['files']) ? $_FILES['files'] : null;
$elevators = !empty($_POST['elevators']) ? json_decode($_POST['elevators'], true) : [];
$payType = !empty($_POST['payType']) ? $_POST['payType'] : null;
$sql = "SELECT * FROM account WHERE accountid = '$salesman'";
$stmt = $conn->prepare($sql);
$stmt->execute();
$accountData = $stmt->fetch(PDO::FETCH_ASSOC);
$depId = $accountData['department_id'];
// validate
//create facility table
$createFacilityNo = new CreateFacilityNo();
$dailyNecessities = [
'MAE100' => 'X',
'MAM200' => 'W',
'MAH100' => 'H',
'MAQ100' => 'Z',
'MAF100' => 'F',
'MAZ100' => 'B',
];
$maintain_times = [
'1' => 'em', //月保
'2' => 'bw' // 雙周保
];
$facility_arr = [];
foreach ($elevators as $elevator) {
$facility_arr[] = $dailyNecessities[$elevator['spec']];
}
echo json_encode($facility_arr);
// 電梯做番號
$facilityno = $createFacilityNo->makeBFacilityNo("T", $facility_arr, (int)$num);
// if ($user_id == 'M0225') {
// echo '<pre>';
// print_r($facilityno);
// echo '</pre>';
// exit();
// }
echo json_encode($facilityno);
/// 獎金計算
$fail_arr = [];
if ($contractno === '') return $fail_arr[] = '合約號為必填';
if ($total_price == '') $fail_arr[] = '合約總價為必填';
if ($vat == '') $fail_arr[] = '統一編號為必填';
if ($mtype == '') $fail_arr[] = '維修型態為必填';
if ($phone == '') $fail_arr[] = '客戶電話為必填';
if ($email == '') $fail_arr[] = 'Email為必填';
// if ($email == '') $fail_arr[] = 'Email為必填';
if ($mworker == '') $fail_arr[] = '保養員為必填';
if ($mcycle == '') $fail_arr[] = '保養頻率為必填';
// if ($mcycle == '') $fail_arr[] = '保養頻率為必填';
if ($salesman == '') $fail_arr[] = '營業員為必填';
if ($contract_begin_date == '') $fail_arr[] = '合約開始時間為必填';
if ($contract_end_date == '') $fail_arr[] = '合約結束時間為必填';
@ -63,7 +99,8 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
echo json_encode($fail_arr);
exit();
}
T8insert($_POST, $facilityno, $depId);
bonusCreate($_POST, $facilityno, $conn);
//create account table
$accounttype = "A";
$accountid = $vat;
@ -75,6 +112,8 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$create_at = date('Y-m-d H:i:s');
$conn->beginTransaction();
// bonusCreate($_POST, $facilityno, $conn);
// exit();
$sql_str = "INSERT INTO account (accounttype, accountid, pwd, name, tel, address, email, repairerid, creater, create_at) VALUES (:accounttype, :accountid, :pwd, :name, :tel, :address, :email, :repairerid, :creater, :create_at)";
$stmt = $conn->prepare($sql_str);
@ -127,30 +166,35 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$stmt->execute();
//create facility table
$createFacilityNo = new CreateFacilityNo();
$dailyNecessities = [
'MAE100' => 'X',
'MAM200' => 'W',
'MAH100' => 'H',
'MAQ100' => 'Z',
'MAF100' => 'F',
'MAZ100' => 'B',
];
$facility_arr = [];
foreach ($elevators as $elevator) {
$facility_arr[] = $dailyNecessities[$elevator['spec']];
}
echo json_encode($facility_arr);
// 電梯做番號
$facilityno = $createFacilityNo->makeBFacilityNo("T", $facility_arr, (int)$num);
// if ($user_id == 'M0225') {
// echo '<pre>';
// print_r($facilityno);
// echo '</pre>';
// exit();
// $createFacilityNo = new CreateFacilityNo();
// $dailyNecessities = [
// 'MAE100' => 'X',
// 'MAM200' => 'W',
// 'MAH100' => 'H',
// 'MAQ100' => 'Z',
// 'MAF100' => 'F',
// 'MAZ100' => 'B',
// ];
// $maintain_times = [
// '1' => 'em', //月保
// '2' => 'bw' // 雙周保
// ];
// $facility_arr = [];
// foreach ($elevators as $elevator) {
// $facility_arr[] = $dailyNecessities[$elevator['spec']];
// }
echo json_encode($facilityno);
echo '-------';
// echo json_encode($facility_arr);
// // 電梯做番號
// $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 '-------';
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accountid', $mworker);
@ -162,6 +206,12 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$repairerid = $mworker;
$repairername = $worker['name'];
foreach ($elevators as $idx => $elevator) {
// 民國年轉換西元年
$ROCuseful_date = $elevator['useful_date'];
$click = explode("-", $ROCuseful_date);
$click[0] = intval($click[0]) + 1911;
$ADuseful_date = implode("-", $click);
$sql_str = "INSERT INTO facility (contractno, define, facilityno, latitude, longitude, customerid, weight, numberofpassenger, numberofstop, numberoffloor, opentype, speed, repairtype, maintainance, facility_kind, address, repairerid, repairername, creater, create_at, area, takecertificatedate, licensedate)
VALUES (:contractno, :define, :facilityno, :latitude, :longitude, :customerid, :weight, :numberofpassenger, :numberofstop, :numberoffloor, :opentype, :speed, :repairtype, :maintainance, :facility_kind, :address, :repairerid, :repairername, :creater, :create_at, :area, :takecertificatedate, :licensedate)";
$stmt = $conn->prepare($sql_str);
@ -187,15 +237,17 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$stmt->bindParam(':create_at', $create_at);
$stmt->bindParam(':area', $area);
$stmt->bindParam(':takecertificatedate', $elevator['takecertificatedate']);
$stmt->bindParam(':licensedate', $elevator['useful_date']);
$stmt->bindParam(':licensedate', $ADuseful_date);
$result = $stmt->execute();
}
//create schedule table
$comboNo = new CreateComboNo($mcycle, $contract_begin_date, $contract_end_date);
$comboArr = json_decode($comboNo->getComboNo(), true);
// $comboNo = new CreateComboNo($mcycle, $contract_begin_date, $contract_end_date);
// $comboArr = json_decode($comboNo->getComboNo(), true);
foreach ($facilityno as $no) {
$comboNo = new CreateComboNo($maintain_times[$elevator['maintain_times']], $contract_begin_date, $contract_end_date);
$comboArr = json_decode($comboNo->getComboNo(), true);
foreach ($comboArr as $combo) {
$sql_str = 'INSERT INTO schedule (contractno, facilityno, combono, repairerid, repairername, duedate, creater, create_at) VALUES (:contractno, :facilityno, :combono, :repairerid, :repairername, :duedate, :creater, :create_at)';
$stmt = $conn->prepare($sql_str);
@ -218,7 +270,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$customer_phone = $phone;
$customer_email = $email;
$repairman = $mworker;
$cycle = $mcycle;
// $cycle = $mcycle;
$contact_person = $partyA;
$contact_address = $partyAaddress;
$contact_phone = $partyAphone;
@ -285,8 +337,8 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
} else {
$files = null;
}
$sql_str = "INSERT INTO contract_b_signed_back (contract_no, contract_type, company, customer_no, salesperson, contract_start_date, contract_end_date, total_price,payType, customer_phone, customer_email, repairman, cycle, contact_person, contact_address, contact_phone, contact_email, elevators_number, area, address, files_id, bonus, max_bonus, created_at, created_by)
VALUES (:contract_no, :contract_type, :company, :customer_no, :salesperson, :contract_start_date, :contract_end_date, :total_price, :payType ,:customer_phone, :customer_email, :repairman, :cycle, :contact_person, :contact_address, :contact_phone, :contact_email, :elevators_number, :area, :address, :files_id, :bonus, :max_bonus, :created_at, :created_by)";
$sql_str = "INSERT INTO contract_b_signed_back (contract_no, contract_type, company, customer_no, salesperson, contract_start_date, contract_end_date, total_price,payType, customer_phone, customer_email, repairman, contact_person, contact_address, contact_phone, contact_email, elevators_number, area, address, files_id, bonus, max_bonus, created_at, created_by)
VALUES (:contract_no, :contract_type, :company, :customer_no, :salesperson, :contract_start_date, :contract_end_date, :total_price, :payType ,:customer_phone, :customer_email, :repairman, :contact_person, :contact_address, :contact_phone, :contact_email, :elevators_number, :area, :address, :files_id, :bonus, :max_bonus, :created_at, :created_by)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(":contract_no", $contractno);
$stmt->bindParam(":contract_type", $contract_type);
@ -299,7 +351,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$stmt->bindParam(":customer_phone", $customer_phone);
$stmt->bindParam(":customer_email", $customer_email);
$stmt->bindParam(":repairman", $repairman);
$stmt->bindParam(":cycle", $cycle);
// $stmt->bindParam(":cycle", $cycle); // 保養頻率在做番上,這邊不 insert。
$stmt->bindParam(":contact_person", $contact_person);
$stmt->bindParam(":contact_address", $contact_address);
$stmt->bindParam(":contact_phone", $contact_phone);
@ -316,20 +368,9 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$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);
// T8insert($_POST, $facilityno);
header('Content-Type: application/json');
// header('Content-Type: application/json');
$jsonData = json_encode($files);
$conn->commit();
@ -341,7 +382,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
}
};
function T8insert($data, $facilityno)
function T8insert($data, $facilityno, $depId)
{
require_once("../connt8.php");
// 引入 T8 API 連線
@ -362,7 +403,6 @@ function T8insert($data, $facilityno)
$elevators = !empty($data['elevators']) ? json_decode($data['elevators'], true) : []; //電梯
$area = !empty($data['area']) ? $data['area'] : null; //縣市 Ex. A->台北 , B-> ..。
$payType = !empty($data['payType']) ? $data['payType'] : null;
$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
@ -372,9 +412,9 @@ function T8insert($data, $facilityno)
$stmt = $conn->prepare($sql);
$stmt->bindParam(':BizPartnerId', $contractno);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$date = date('Y-m-sH-s-i');
$date_1 = date('Y-m-s');
$result = $stmt->fetch(PDO::FETCH_ASSOC);
$date = date('Y-m-dH-s-i');
$date_1 = date('Y-m-d');
$createTime = str_replace("-", '', $date);
$insertTime = str_replace('-', '', $date_1);
$beginDate = str_replace("-", '', $contract_begin_date);
@ -493,12 +533,12 @@ function T8insert($data, $facilityno)
// echo '<pre>';
// print_r($elevator);
// echo '</pre>';
$facility_no = $facilityno[$index];
$sql = "INSERT INTO comMaterial
(FOrgid,MaterialId,MaterialTypeId,MaterialCategoryId,CreatorId,CreateTime)
VALUES ('1000',:MaterialId,'10','E',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facilityno[$index]);
$stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->execute();
@ -507,7 +547,7 @@ function T8insert($data, $facilityno)
(MaterialTypeId,MaterialId,MaterialName,MaterialCategoryId,IsInUsed,UnitId,CreatorId,CreateTime)
VALUES ('10',:MaterialId,:MaterialName,'E',1,'SET',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facilityno[$index]);
$stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':MaterialName', $customer);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime);
@ -517,7 +557,7 @@ function T8insert($data, $facilityno)
(Orgid,MaterialTypeId,MaterialId,CurrId,SUnitId,TaxId,CreatorId,CreateTime)
VALUES ('1000','10',:MaterialId,'TWD','SET','ST005',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facilityno[$index]);
$stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->execute();
@ -533,6 +573,9 @@ function T8insert($data, $facilityno)
//分幾期 => 總共保養月 / 分期月
$SQuantity = $elevator['maintain_months'] / $IncomeId[$payType];
$date_1 = getNext25thDate($contract_begin_date);
// 依每台電梯去加入各個的付款項
for ($i = 0; $i < $IncomeId[$payType]; $i++) {
$row++;
@ -547,14 +590,16 @@ function T8insert($data, $facilityno)
"RowCode" => $row,
"RowNo" => $row,
"ItemType" => 1,
"SPrice" => $elevator['sold_price'],
"SPrice" => intval($elevator['sold_price']),
"SQuantity" => $SQuantity,
"ProjectId" => "$contractno",
"FromSourceTag" => 0,
"CU_MaterialId" => "$facilityno[$index]",
"CU_EstPayDate" => "$payDay"
"CU_MaterialId" => "$facility_no",
"CU_EstPayDate" => intval($payDay)
];
$salIncomeApplyDetail_rows[] = $rows_data;
// echo '<pre>';
// print_r($salIncomeApplyDetail_rows);
// echo '</pre>';
}
}
@ -564,7 +609,7 @@ function T8insert($data, $facilityno)
// $insertime = settype($insertTime, 'integer');
$salIncomeApplyMaster_rows = [
"BillNo" => "$contractno",
"BillDate" => $insertTime,
"BillDate" => intval($insertTime),
"OrgId" => "1000",
"FOrgId" => "1000",
"TypeId" => "RAS",
@ -578,7 +623,10 @@ function T8insert($data, $facilityno)
"DueToId" => "$contractno",
"TaxId" => "ST005",
"CompId" => "1001",
"CreatorId" => "$user_id"
"CreatorId" => "$user_id",
"CreateTime" => intval($insertTime),
"DeptId" => "$depId",
"IsPriceWithTax" => 1
];
$salIncomeApplyMaster = [
@ -593,6 +641,9 @@ function T8insert($data, $facilityno)
$API_body[] = $salIncomeApplyMaster;
$API_body[] = $salIncomeApplyDetail;
// 呼叫 API
// echo '<pre>';
// print_r($API_body);
// echo '</pre>';
$result = T8API($API_body);
if ($result['Status'] == 'Error' || $result['Status'] == 'Fails') {
@ -601,3 +652,102 @@ function T8insert($data, $facilityno)
die('Error!:' . $result['ErrorMsg']);
}
}
function bonusCreate($data, $facilityno, $conn)
{
try {
require_once("../../bonus/other/maintenance_contract_bonus_v2_1.php");
$elevators = !empty($_POST['elevators']) ? json_decode($_POST['elevators'], true) : [];
$contract_begin_date = !empty($data['contract_begin_date']) ? $data['contract_begin_date'] : '';
$salesman = !empty($data['salesman']) ? $data['salesman'] : '';
$payType = !empty($data['payType']) ? $data['payType'] : '';
$status = 1;
$bonus_json = [];
$create_id = $data['user_id'];
$create_at = date('Y-m-d');
$contract_no = !empty($data['contractno']) ? $data['contractno'] : '';
$contract_kind = 3;
$payment = [
'A40006' => 'annually', //年繳
'A40007' => 'quarterly', //季繳
'A40004' => 'bimonthly', // 雙月繳
'A40005' => 'semiannually', // 半年繳
'A40003' => 'monthly' //月繳
];
$payDay = getNext25thDate($contract_begin_date);
foreach ($elevators as $key => $elevator) {
// print_r($payDay);
// echo '<pre>';
// print_r($elevator);
// echo '</pre>';
// exit;
$facility_no = $facilityno[$key];
$ver = $elevator['bonus_verson']; //獎金版本
$contract_type = $elevator['contract_type']; //合約類別
$payment_period = $payment[$payType]; //付款方式
$elevator_list_price = intval($elevator['stand_price']); //牌價
$fee_per_st = $elevator['contract_price']; //作翻契約金額
$commission_fee = $elevator['service_expense']; //服務費(月)
$receivable_date_due = $payDay; //第一筆保養款項收回日
$sales_id = $salesman; //營業人員
$discount = $elevator['discount'];
$region_director_id = $elevator['manager'];
$regular_contract_manger_id = !empty($elevator['regular_contract_manger_id']) ? $elevator['regular_contract_manger_id'] : '';
$results = maintenance_contract_bonus_v2_1($ver, $contract_type, $payment_period, $elevator_list_price, $fee_per_st, $commission_fee, $receivable_date_due, $sales_id, $region_director_id, $regular_contract_manger_id);
$bonus_json = [
'contract_type' => $contract_type,
'total' => $elevator_list_price,
'fee_per_st' => $fee_per_st,
'commission_fee' => $commission_fee,
'paykind' => $payment_period,
'receivable_date_due' => $receivable_date_due,
'discount' => $discount
];
if ($results['result_status'] != 'error') {
foreach ($results['bonus_array'] as $i => $result) {
$bonus_type = $result['bonus_type'];
$pay_day = $result['pay_day_due'];
$amount = $result['bonus_amount'];
$receiver = $result['bonus_receiver'];
$a = json_encode($bonus_json);
$sql = "INSERT INTO bonus
(bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,pay_day_due,status,bonus_json,create_id,create_at) VALUES
($bonus_type,'$ver','$contract_no',$contract_kind,'$facility_no',$amount,'$receiver','$pay_day',$status,'$a','$create_id','$create_at')";
$stmt = $conn->prepare($sql);
$stmt->execute();
}
}
}
// exit();
} catch (PDOException $e) {
http_response_code(404);
echo $e->getMessage();
die('Error!:' . $e->getMessage());
}
}
// 計算保養開始日期的當月25號
function getNext25thDate($dateString)
{
// 將傳入的日期字串轉換成 Unix 時間戳記
$timestamp = strtotime($dateString);
// 取得該日期的日期
$day = date('d', $timestamp);
// 如果日期大於 25,則回傳下個月的 25 號日期
if ($day > 25) {
// 增加一個月
$timestamp = strtotime('+1 month', $timestamp);
}
// 設定日期為 25 號
$targetDate = date('Y-m-25', $timestamp);
return $targetDate;
}

464
wms/contract/api/postNewContractData.php

@ -1,139 +1,325 @@
<?php
require_once("../conn.php");
include_once("./getFacilityNo.php");
include_once("./getComboNo.php");
include_once("./upload_chk.php");
ini_set ( 'date.timezone' , 'Asia/Taipei' );
if($_SERVER['REQUEST_METHOD'] != 'POST'){
exit();
}
//新梯簽回
if(isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'm') {
try{
$created_at = date('Y-m-d H:i:s');
$created_by = $_POST["user_id"];
$contractno = $_POST["contractno"];
$customer = $_POST["customer"];
$manager = $_POST["manager"];
$vat = $_POST["vat"];
$case_name = $_POST["case_name"];
$linkman = $_POST["linkman"];
$lm_tel = $_POST["lm_tel"];
$address = $_POST["address"];
$salesman = $_POST["salesman"];
$qc = $_POST["qc"];
$contracttype = $_POST["contracttype"];
$files = !empty($_FILES['files']) ? $_FILES['files'] : null;
$files_id = null;
$fail_arr = [];
if(empty($contractno)) $fail_arr[] = '合約號為必填';
if(empty($customer)) $fail_arr[] = '客戶名稱為必填';
if(empty($manager)) $fail_arr[] = '負責人為必填';
if(empty($vat)) $fail_arr[] = '統編/身分證為必填';
if(empty($case_name)) $fail_arr[] = '案名為必填';
if(empty($linkman)) $fail_arr[] = '聯絡人為必填';
if(empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填';
if(empty($address)) $fail_arr[] = '地址為必填';
if(empty($salesman)) $fail_arr[] = '營業員為必填';
if(empty($qc)) $fail_arr[] = '請選擇QC或官檢';
if(count($fail_arr) > 0) {
header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr);
exit();
}
$conn->beginTransaction();
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid ORDER BY create_at DESC";
$stmt = $conn -> prepare($sql_str);
$stmt -> bindParam(":accountid",$salesman);
$stmt -> execute();
$saleman = $stmt->fetch(PDO::FETCH_ASSOC);
$salesman_name = $saleman['name'];
if(!empty($files)){
$englisharr = range('a', 'z');
$files = $_FILES['files'];
$newfiles = [];
foreach( $files as $file ){
$i = 0; //新陣列的索引編號
foreach( $file as $key => $val ){
$newfiles[$i]['name'] = $files['name'][$key];
$newfiles[$i]['type'] = $files['type'][$key];
$newfiles[$i]['tmp_name'] = $files['tmp_name'][$key];
$newfiles[$i]['error'] = $files['error'][$key];
$newfiles[$i]['size'] = $files['size'][$key];
$i++;
} //foreach 第2層 end
}
$max_size = 4096*4096; //設定允許上傳檔案容量的最大值(1M)
$allow_ext = array('jpeg', 'jpg', 'png','JPG','JPEG','PNG','GIF'); //設定允許上傳檔案的類型
$path = '../images/contracts/';
if (!file_exists($path)) { mkdir($path); }
$msg_result = ''; //負責接收所有檔案檢測後的回傳訊息
$datetime = (string)date('YmdHis');
$files_id = 'm' . $datetime; // 保養=>b + 日期時間
foreach( $newfiles as $key => $file ){
$randNum = rand(1000,9999);
$randEnglish = $englisharr[rand(0,25)];
$file_name = 'm' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum.$file['name'];
$msg = upload_chk( $file,$path, $max_size, $allow_ext, $file_name );
if($msg==1){
$msg = '檔案傳送成功!';
$sql_str = "INSERT INTO contract_back_files (files_id, file_name, file_mime, file_size, created_at, created_by) VALUES (:files_id, :file_name, :file_mime, :file_size, :created_at, :created_by)";
$stmt = $conn -> prepare($sql_str);
$stmt -> bindParam(':files_id' ,$files_id);
$stmt -> bindParam(':file_name' ,$file_name);
$stmt -> bindParam(':file_mime' ,$file['type']);
$stmt -> bindParam(':file_size' ,$file['size']);
$stmt -> bindParam(':created_at' ,$created_at);
$stmt -> bindParam(':created_by' ,$created_by);
$stmt ->execute();
}else{
throw new PDOException('檔案上傳失敗:' . $msg);
}
$msg_result .= '第' . ($key+1) . '個上傳檔案的結果:' . $msg . '<br/>';
$src_name = $path.$file['name'];
if( file_exists($src_name) ){
//副檔名
$extname = pathinfo($src_name, PATHINFO_EXTENSION);
//主檔名
$basename = basename($src_name, '.'.$extname);
}
}
}else{
$files = null;
}
$sql_str = "INSERT INTO contract_m_signed_back (contract_no, customer, manager, vat, case_name, linkman, lm_tel, address, salesman, salesman_name, files_id, created_at, created_by, qc_official_type) VALUES (:contract_no, :customer, :manager, :vat, :case_name, :linkman, :lm_tel, :address, :salesman, :salesman_name, :files_id, :created_at, :created_by, :qc)";
$stmt = $conn -> prepare($sql_str);
$stmt -> bindParam(":contract_no",$contractno);
$stmt -> bindParam(":customer",$customer);
$stmt -> bindParam(":manager",$manager);
$stmt -> bindParam(":vat",$vat);
$stmt -> bindParam(":case_name",$case_name);
$stmt -> bindParam(":linkman",$linkman);
$stmt -> bindParam(":lm_tel",$lm_tel);
$stmt -> bindParam(":address",$address);
$stmt -> bindParam(":salesman",$salesman);
$stmt -> bindParam(":salesman_name",$salesman_name);
$stmt -> bindParam(":files_id",$files_id);
$stmt -> bindParam(":created_at",$created_at);
$stmt -> bindParam(":created_by",$created_by);
$stmt -> bindParam(":qc",$qc);
$stmt -> execute();
$result = $conn->commit();
if($result){
header("HTTP/1.1 201 Created");
}
}catch(PDOException $e){
$conn->rollback();
header("HTTP/1.1 500 Internal Server Error");
die('Error!:'.$e->getMessage());
}
}
<?php
require_once("../conn.php");
include_once("./getFacilityNo.php");
include_once("./getComboNo.php");
include_once("./upload_chk.php");
ini_set('date.timezone', 'Asia/Taipei');
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
exit();
}
//新梯簽回
if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'm') {
try {
$created_at = date('Y-m-d H:i:s');
$created_by = $_POST["user_id"];
$contractno = $_POST["contractno"];
$customer = $_POST["customer"];
$manager = $_POST["manager"];
$vat = $_POST["vat"];
$case_name = $_POST["case_name"];
$linkman = $_POST["linkman"];
$lm_tel = $_POST["lm_tel"];
$address = $_POST["address"];
$salesman = $_POST["salesman"];
$qc = $_POST["qc"];
$contracttype = $_POST["contracttype"];
$elevators_nums = $_POST['nums'];
$elevators = json_decode($_POST['elevators'], true);
$elevators_detail_arr = json_decode($_POST['elevators_detail_arr'], true);
BounsCount($_POST, $conn);
// echo '<pre>';
// print_r($elevators);
// echo '</pre>';
// exit;
$files = !empty($_FILES['files']) ? $_FILES['files'] : null;
$files_id = null;
$fail_arr = [];
if (empty($contractno)) $fail_arr[] = '合約號為必填';
if (empty($customer)) $fail_arr[] = '客戶名稱為必填';
if (empty($manager)) $fail_arr[] = '負責人為必填';
if (empty($vat)) $fail_arr[] = '統編/身分證為必填';
if (empty($case_name)) $fail_arr[] = '案名為必填';
if (empty($linkman)) $fail_arr[] = '聯絡人為必填';
if (empty($lm_tel)) $fail_arr[] = '聯絡人電話為必填';
if (empty($address)) $fail_arr[] = '地址為必填';
if (empty($salesman)) $fail_arr[] = '營業員為必填';
if (empty($qc)) $fail_arr[] = '請選擇QC或官檢';
if (count($fail_arr) > 0) {
header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr);
exit();
}
//create facility table
$createFacilityNo = new CreateFacilityNo();
$dailyNecessities = [
'MAE100' => 'X',
'MAM200' => 'W',
'MAH100' => 'H',
'MAQ100' => 'Z',
'MAF100' => 'F',
'MAZ100' => 'B',
];
$arr = [];
// 建立作番號
foreach ($elevators_detail_arr as $elevator) {
// $spec = explode('-', $elevator['item_spec']);
$arr[] = $dailyNecessities[$elevator['spec']];
}
$facilityno = $createFacilityNo->makeMFacilityNo('M', $arr, intval($elevators_nums));
echo '<pre>';
print_r($facilityno);
echo '</pre>';
exit();
$conn->beginTransaction();
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid ORDER BY create_at DESC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(":accountid", $salesman);
$stmt->execute();
$saleman = $stmt->fetch(PDO::FETCH_ASSOC);
$salesman_name = $saleman['name'];
if (!empty($files)) {
$englisharr = range('a', 'z');
$files = $_FILES['files'];
$newfiles = [];
foreach ($files as $file) {
$i = 0; //新陣列的索引編號
foreach ($file as $key => $val) {
$newfiles[$i]['name'] = $files['name'][$key];
$newfiles[$i]['type'] = $files['type'][$key];
$newfiles[$i]['tmp_name'] = $files['tmp_name'][$key];
$newfiles[$i]['error'] = $files['error'][$key];
$newfiles[$i]['size'] = $files['size'][$key];
$i++;
} //foreach 第2層 end
}
$max_size = 4096 * 4096; //設定允許上傳檔案容量的最大值(1M)
$allow_ext = array('jpeg', 'jpg', 'png', 'JPG', 'JPEG', 'PNG', 'GIF'); //設定允許上傳檔案的類型
$path = '../images/contracts/';
if (!file_exists($path)) {
mkdir($path);
}
$msg_result = ''; //負責接收所有檔案檢測後的回傳訊息
$datetime = (string)date('YmdHis');
$files_id = 'm' . $datetime; // 保養=>b + 日期時間
foreach ($newfiles as $key => $file) {
$randNum = rand(1000, 9999);
$randEnglish = $englisharr[rand(0, 25)];
$file_name = 'm' . (string)date('YmdHis') . $randNum . $randEnglish . $randNum . $file['name'];
$msg = upload_chk($file, $path, $max_size, $allow_ext, $file_name);
if ($msg == 1) {
$msg = '檔案傳送成功!';
$sql_str = "INSERT INTO contract_back_files (files_id, file_name, file_mime, file_size, created_at, created_by) VALUES (:files_id, :file_name, :file_mime, :file_size, :created_at, :created_by)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':files_id', $files_id);
$stmt->bindParam(':file_name', $file_name);
$stmt->bindParam(':file_mime', $file['type']);
$stmt->bindParam(':file_size', $file['size']);
$stmt->bindParam(':created_at', $created_at);
$stmt->bindParam(':created_by', $created_by);
$stmt->execute();
} else {
throw new PDOException('檔案上傳失敗:' . $msg);
}
$msg_result .= '第' . ($key + 1) . '個上傳檔案的結果:' . $msg . '<br/>';
$src_name = $path . $file['name'];
if (file_exists($src_name)) {
//副檔名
$extname = pathinfo($src_name, PATHINFO_EXTENSION);
//主檔名
$basename = basename($src_name, '.' . $extname);
}
}
} else {
$files = null;
}
$sql_str = "INSERT INTO contract_m_signed_back (contract_no, customer, manager, vat, case_name, linkman, lm_tel, address, salesman, salesman_name, files_id, created_at, created_by, qc_official_type) VALUES (:contract_no, :customer, :manager, :vat, :case_name, :linkman, :lm_tel, :address, :salesman, :salesman_name, :files_id, :created_at, :created_by, :qc)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(":contract_no", $contractno);
$stmt->bindParam(":customer", $customer);
$stmt->bindParam(":manager", $manager);
$stmt->bindParam(":vat", $vat);
$stmt->bindParam(":case_name", $case_name);
$stmt->bindParam(":linkman", $linkman);
$stmt->bindParam(":lm_tel", $lm_tel);
$stmt->bindParam(":address", $address);
$stmt->bindParam(":salesman", $salesman);
$stmt->bindParam(":salesman_name", $salesman_name);
$stmt->bindParam(":files_id", $files_id);
$stmt->bindParam(":created_at", $created_at);
$stmt->bindParam(":created_by", $created_by);
$stmt->bindParam(":qc", $qc);
$stmt->execute();
$result = $conn->commit();
if ($result) {
header("HTTP/1.1 201 Created");
}
} catch (PDOException $e) {
$conn->rollback();
header("HTTP/1.1 500 Internal Server Error");
die('Error!:' . $e->getMessage());
}
}
function T8Insert($data)
{
require_once("../connt8.php");
$contractno = $data['contractno'];
$partyA = $data['customer'];
$phone = $data['lm_tel'];
$vat = $data['vat'];
$partyAaddress = $data['address'];
$user_id = $data['user_id'];
$salesman = $data['salesman'];
$createAt = date("Y-m-dH-i-s");
$elevators[] = $data['elevators'];
$createTime = str_replace('-', '', $createAt);
$connT8->beginTransaction();
$sql = "SELECT * FROM comCustomer WHERE BizPartnerId = :BizPartnerId";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':BizPartnerId', $contractno);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
// 新增客戶 table
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,InvoiceId)
VALUES('1000','10','TWD',:BizPartnerId,:PersonId,:CreatorId,1,:InvoiceAddress,:CreateTime,'35')";
$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();
}
$sql = "SELECT * FROM comProject WHERE ProjectId = :ProjectId";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':ProjectId', $contractno);
$stmt->execute();
$resultProject = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (empty($resultProject)) {
//新增於 comProject。合約 table
$sql = "INSERT INTO comProject(ProjectId,ProjectName,TypeId,CreateTime,CreatorId,IsInUsed)
VALUES(:ProjectId,:ProjectName,'C0',:CreateTime,:CreatorId,1)";
$stmt = $connT8->prepare($sql);
$stmt->bindParam(':ProjectId', $contractno);
$stmt->bindParam(':ProjectName', $customer);
$stmt->bindParam(':CreateTime', $createTime);
$stmt->bindParam(':CreatorId', $user_id);
$stmt->execute();
}
}
function BounsCount($data, $conn)
{
// echo '<pre>';
// print_r($data);
// echo '</pre>';
// exit;
require_once("../../bonus/elevator_new/elevator_new_deal_bonus.php");
$signing_date = $data['signing_date'];
$bonus_v1_0_date = '2024-01-02';
$bonus_v2_0_date = '2024-01-03';
$contractType = [
'1' => 'strategy_customer',
'2' => 'general_customer'
];
$contract_type = $data['contract_type'];
$type = $contractType[$contract_type]; //戰略客戶 or 一般客戶
$elevator_knockdown_price = $data['price_total']; //受價總額
$salesman = $data['salesman'];
$manager = $data['manager'];
$result_bonus = [];
if ($signing_date <= $bonus_v1_0_date) {
$ver = '1.0';
$result_bonus = elevator_new_deal_bonus_v1_0($ver, $type, $elevator_knockdown_price, $salesman, $manager);
} else if ($signing_date >= $bonus_v2_0_date) {
$ver = '2.0';
// $result_bonus = elevator_new_deal_bonus_v2_0($ver,$contract_type,);
}
echo '<pre>';
print_r($result_bonus);
echo '</pre>';
exit();
try {
} catch (PDOException $e) {
header("HTTP/1.1 500 Internal Server Error");
die('Error!:' . $e->getMessage());
}
}

55
wms/contract/api/testT8API.php

@ -1,21 +1,36 @@
<?php
$date = Date('Y-m-d');
$date1 = Date('Y-m-d', strtotime("$date +1 months"));
// $paymonth = $i * $SQuantity;
// $countDay = date('Y-m-d', strtotime("$date + $paymonth months"));
// $payDay = str_replace('-', '', $countDay);
// $countDay = date('Ymd', strtotime("$date1 + 1 months"));
// echo '<pre>';
// print_r($countDay);
// echo '</pre>';
// exit();
$SQuantity = 2;
// $b = 24 / $a;
for ($i = 0; $i < 12; $i++) {
$paymonth = $i * $SQuantity;
$countDay = date('Y-m-d', strtotime("$date + $paymonth months"));
$payDay = str_replace('-', '', $countDay);
echo '<pre>';
print_r($payDay);
echo '</pre>';
}
?>
<head>
<title>地址轉經緯度</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<h1>輸入地址以獲取經緯度</h1>
<form id="addressForm" method="post">
<input type="text" id="addressInput" name="address" placeholder="輸入地址">
<button type="submit">查詢</button>
</form>
<div id="map"></div>
<script>
// 使用AJAX提交表單
$(document).ready(function() {
$("#addressForm").submit(function(event) {
event.preventDefault();
var address = $("#addressInput").val();
$.ajax({
url: "get_lat_lng.php",
type: "POST",
data: {
address: address
},
success: function(data) {
$("#map").html(data);
}
});
});
});
</script>
</body>

2
wms/contract/conn.php

@ -34,7 +34,7 @@ try {
//設定主動以警告的形式報錯
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$connT8 = new PDO("sqlsrv:Server=220.130.203.251;Database=T8masada", "M0225", "IFFBU1E=");
$connT8 = new PDO("sqlsrv:Server=220.130.203.251;Database=T8TEST", "M0225", "IFFBU1E=");
if ($connT8) {
$connT8->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}

106
wms/contract/contract-input.php

@ -136,7 +136,7 @@ $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
</select>
<p class="alerttext" x-show="data.mworker==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">保養頻率</td>
<!-- <td style="vertical-align: middle">保養頻率</td>
<td>
<select class="ui search dropdown" name="repairer_name" x-model="data.mcycle">
<option value="">選擇保養頻率</option>
@ -144,6 +144,18 @@ $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
<option value="em">月保</option>
</select>
<p class="alerttext" x-show="data.mcycle==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td> -->
<td style="vertical-align: middle">分期方式</td>
<td>
<select class="ui search dropdown" x-model="data.payType">
<option value="">選擇付款方式</option>
<option value="A40006">年繳</option>
<option value="A40007">季繳</option>
<option value="A40003">月繳</option>
<option value="A40004">雙月繳</option>
<option value="A40005">半年繳</option>
</select>
<p class="alerttext" x-show="data.payType==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
@ -184,21 +196,13 @@ $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
<input type="text" x-model="data.address" />
<p class="alerttext" x-show="data.address==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">分期方式</td>
<td style="vertical-align: middle">附件</td>
<td colspan="2">
<select class="ui search dropdown" x-model="data.payType">
<option value="">選擇付款方式</option>
<option value="A40006">年繳</option>
<option value="A40007">季繳</option>
<option value="A40003">月繳</option>
<option value="A40004">雙月繳</option>
<option value="A40005">半年繳</option>
</select>
<p class="alerttext" x-show="data.payType==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
</td>
</tr>
<tr>
<!-- <tr>
<td></td>
<td></td>
<td></td>
@ -208,7 +212,7 @@ $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
<td colspan="2">
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
</td>
</tr>
</tr> -->
</tbody>
</template>
<template x-if="step==3">
@ -307,19 +311,28 @@ $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
</select>
<p class="alerttext" x-show="data.elevators[idx].maintainance=='' || !data.elevators[idx].maintainance"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">竣檢日</td>
<td style="vertical-align: middle">竣檢日(民國年分)</td>
<td>
<input class="form-control disabled_select" type="date" x-model="data.elevators[idx].takecertificatedate">
<input class="form-control disabled_select" type="text" x-model="data.elevators[idx].takecertificatedate">
<p class="alerttext" x-show="data.elevators[idx].takecertificatedate=='' || !data.elevators[idx].takecertificatedate"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">許可證有效時間</td>
<td style="vertical-align: middle">許可證有效日期<br>(民國年-月-日。Ex.113-01-01)</td>
<td>
<input class="form-control disabled_select" type="date" x-model="data.elevators[idx].useful_date">
<input class="form-control disabled_select" type="text" x-model="data.elevators[idx].useful_date">
<p class="alerttext" x-show="data.elevators[idx].useful_date=='' || !data.elevators[idx].useful_date"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">保養頻率</td>
<td>
<select class="ui search dropdown" name="repairer_name" x-model="data.elevators[idx].maintain_times">
<option value="">選擇保養頻率</option>
<option value="2">雙週保</option>
<option value="1">月保</option>
</select>
<p class="alerttext" x-show="data.maintain_times==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td></td>
@ -334,10 +347,65 @@ $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
</tbody>
</template>
</template>
<template x-if="step==4">
<template x-for="(elevator, idx) in data.elevators" :key="elevator.apply_key + elevator.register_code">
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==4">
<tr>
<td colspan=8>
<p x-text="'獎金計算 : 電梯' + Number(idx+1)"></p>
</td>
</tr>
<tr>
<td style="vertical-align:middle">契約人員</td>
<td><input type="text" x-model="data.salesman"></td>
<td style="vertical-align:middle">保養月份</td>
<td>
<input type="text" x-model="elevator.maintain_months">
</td>
<td style="vertical-align:middle">合約類別</td>
<td>
<select name="" id="" x-model="elevator.contract_type">
<option value="">請選擇</option>
<option value="new">新簽約</option>
<option value="free_to_charge">免保轉有費</option>
<option value="renew_priceissue">續簽約</option>
</select>
</td>
<td style="vertical-align:middle">獎金適用版本</td>
<td>
<input type="text" x-model="elevator.bonus_verson" disabled="disabled">
</td>
</tr>
<tr>
<td style="vertical-align:middle">作番契約金額(月)</td>
<td><input type="text" x-model="elevator.sold_price" disabled></td>
<td style="vertical-align:middle">牌價(標準價)</td>
<td>
<input type="text" x-model="elevator.stand_price" disabled>
<p>標準價+Option價格+與其他電梯共同分擔的費用貨價格</p>
</td>
<td style="vertical-align:middle">服務費</td>
<td>
<input type="text" x-model="elevator.service_expense" disabled>
</td>
<td style="vertical-align:middle">折扣率(%)</td>
<td><input type="text" x-model='elevator.discount' disabled></td>
</tr>
<tr>
<td style="vertical-align:middle">地區處長員工號</td>
<td><input type="text" x-model="elevator.manager" disabled></td>
<td style="vertical-align:middle">專任契約經理員工號</td>
<td><input type="text" x-model="elevator.regular_contract_manger_id"></td>
</tr>
</tbody>
</template>
</template>
</table>
<button x-show="step==3" @click="save()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<button x-show=" step==4" @click="save()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>存檔</span>
</template>
@ -345,7 +413,7 @@ $contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
<div class="loader"></div>
</template>
</button>
<button x-show="step<=2" @click="nextStepFn()" type="button" class="btn btn-primary btn-lg pull-right savebtn" :disabled="isLoading">
<button x-show="step<=3" @click="nextStepFn()" type="button" class="btn btn-primary btn-lg pull-right savebtn" :disabled="isLoading">
<template x-if="!isLoading">
<span>下一步</span>
</template>

10
wms/contract/contract-new-apply.php

@ -495,7 +495,7 @@ $para = "function_name=pricereview&" . $token_link;
<td>結果</td>
<td colspan=2>意見</td>
<td>時間</td>
<td colspan=2><?php if (($user_id === "M0174" || $user_id === "M0107" || $user_id === "M0060" || $user_id == "TEST02" || $user_id == "TEST03") && $status == 1) : ?>審核意見<?php endif; ?></td>
<td colspan=2><?php if (($user_id === "M0174" || $user_id === "M0175" || $user_id === "M0060" || $user_id == "TEST02" || $user_id == "TEST03") && $status == 1) : ?>審核意見<?php endif; ?></td>
</tr>
<tr>
<td>營業員</td>
@ -508,7 +508,7 @@ $para = "function_name=pricereview&" . $token_link;
<td colspan=2>---</td>
<td><?php echo ($contract['submit_date']) ?? "---"; ?> </td>
<td colspan=2 rowspan="3">
<?php if (($user_id === "M0174" || $user_id === "M0107" || $user_id === "M0060" || $user_id == "TEST02" || $user_id == "TEST03") && $status == 1) : ?>
<?php if (($user_id === "M0174" || $user_id === "M0175" || $user_id === "M0060" || $user_id == "TEST02" || $user_id == "TEST03") && $status == 1) : ?>
<textarea class="form-control opinion" x-model="data.review_comment"></textarea>
<?php endif; ?>
</td>
@ -572,14 +572,14 @@ $para = "function_name=pricereview&" . $token_link;
</template>
</button>
<?php endif; ?>
<?php if ($status == 1 && ((($user_id == "M0107" || $user_id == "TEST02") && $contract['progress'] <= 1) || (($user_id == "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) || $user_id == "M0174")) : ?>
<?php if ($status == 1 && ((($user_id == "M0175" || $user_id == "TEST02") && $contract['progress'] <= 1) || (($user_id == "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) || $user_id == "M0174")) : ?>
<button x-show="true" x-on:click="agree()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>
<?php
if (($user_id === "M0107" || $user_id == "TEST02") && $contract['progress'] <= 1) {
if (($user_id === "M0175" || $user_id == "TEST02") && $contract['progress'] <= 1) {
echo "同意(上呈)";
// } elseif (($user_id === "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) {
} elseif (($user_id === "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) {
echo "同意(結案)";
}
?>

337
wms/contract/contract-newelevator-input.php

@ -1,17 +1,17 @@
<?php
<?php
include_once("../header.php");
require_once("./conn.php");
$accounttype = "M";
$sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype";
$sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype ORDER BY accountid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(":accounttype", $accounttype);
$stmt -> execute();
$stmt->execute();
$persons = $stmt->fetchAll(PDO::FETCH_ASSOC);
$persons = array_map(function($person){
$persons = array_map(function ($person) {
return [
'view'=>$person['accountid'] .'-'. $person['name'],
'value'=>$person['accountid'],
'name'=>$person['name']
'view' => $person['name'] . '-' . $person['accountid'],
'value' => $person['accountid'],
'name' => $person['name']
];
}, $persons);
?>
@ -21,7 +21,7 @@ $persons = array_map(function($person){
<script src="./js/axios/axios.min.js"></script>
<div class="contract-input-component" x-data="contractNewInput">
<div class="form" method="post" id="form" enctype="multipart/form-data" >
<div class="form" method="post" id="form" enctype="multipart/form-data">
<input type="hidden" name='form_name' value="main_form" />
<div>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
@ -31,106 +31,233 @@ $persons = array_map(function($person){
<h3 style='text-align:center'>合約入力(新梯)</h3>
</td>
</tr>
</thead>
</thead>
<template x-if="step==1">
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==1">
<tr>
<td style="vertical-align: middle">合約號</td>
<td colspan=5>
<input class="form-control" @keyup="nextStepKeyupFn($event)" type="text" name="contractno" x-model="data.contractno" >
</td>
<td colspan="2" style="vertical-align: middle">
<label for="customize">
<input type="checkbox" x-model="customize" id="customize" />自定義欄位
</label>
</td>
</tr>
</tbody>
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==1">
<tr>
<td style="vertical-align: middle">合約號</td>
<td colspan=5>
<input class="form-control" @keyup="nextStepKeyupFn($event)" type="text" name="contractno" x-model="data.contractno">
</td>
<td colspan="2" style="vertical-align: middle">
<label for="customize">
<input type="checkbox" x-model="customize" id="customize" />自定義欄位
</label>
</td>
</tr>
</tbody>
</template>
<template x-if="step==2">
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==2">
<tr>
<td colspan="7" style='vertical-align: middle;border-right:0px;'>
<h4>業務確認項</h4>
</td>
<td class="text-right" style='border-left:0px;'>
<button type="button" id="btn_close" class="btn btn-default" onclick="window.history.back();">返回</button>
<button type="button" id="btn_close" class="btn btn-default" onclick="window.close();">關閉分頁</button>
</td>
</tr>
<tr>
<td style="vertical-align: middle">客戶名稱</td>
<td>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.customer" >
<p class="alerttext" x-show="data.customer==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">負責人</td>
<td>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.manager" >
<p class="alerttext" x-show="data.manager==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">統一編號/身分證</td>
<td>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.vat" >
<p class="alerttext" x-show="data.vat==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">營業員</td>
<td style="vertical-align: middle">
<div class="ui form">
<select class="salesman" id="salesman" x-model="data.salesman">
<option value="">請選擇營業員</option>
<?php foreach($persons as $person): ?>
<option value="<?php echo $person['value']; ?>"><?php echo $person['view']; ?></option>
<?php endforeach ?>
</select>
</div>
<p class="alerttext" x-show="data.salesman==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">聯繫人</td>
<td>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.linkman" >
<p class="alerttext" x-show="data.linkman==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">聯繫人電話</td>
<td>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.lm_tel" >
<p class="alerttext" x-show="data.lm_tel==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">QC和官檢</td>
<td>
<select class="" id="qc" x-model="data.qc">
<option value="">請選擇QC或官檢</option>
<option value="Q">只需QC</option>
<option value="O">只需官檢</option>
<option value="QO">QC和官檢</option>
</select>
<p class="alerttext" x-show="data.qc==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">案件名稱</td>
<td >
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.case_name" >
<p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">地址</td>
<td colspan=3>
<input class="form-control disabled_select" type="text" name="uscc" x-model="data.address" >
<p class="alerttext" x-show="data.address==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">附件上傳</td>
<td colspan="3">
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
</td>
</tr>
</tbody>
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==2">
<tr>
<td colspan="7" style='vertical-align: middle;border-right:0px;'>
<h4>業務確認項</h4>
</td>
<td class="text-right" style='border-left:0px;'>
<button type="button" id="btn_close" class="btn btn-default" onclick="window.history.back();">返回</button>
<button type="button" id="btn_close" class="btn btn-default" onclick="window.close();">關閉分頁</button>
</td>
</tr>
<tr>
<td style="vertical-align: middle">客戶名稱</td>
<td>
<input class="form-control disabled_select" type="text" name="" x-model="data.customer">
<p class="alerttext" x-show="data.customer==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">負責人</td>
<td>
<select class="manager" id="manager" x-model="data.manager">
<option value="">請選擇營業員</option>
<?php foreach ($persons as $person) : ?>
<option value="<?php echo $person['value']; ?>"><?php echo $person['view']; ?></option>
<?php endforeach ?>
</select>
<p class="alerttext" x-show="data.manager==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">統一編號/身分證</td>
<td>
<input class="form-control disabled_select" type="text" name="" x-model="data.vat">
<p class="alerttext" x-show="data.vat==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">營業員</td>
<td style="vertical-align: middle">
<div class="ui form">
<select class="salesman" id="salesman" x-model="data.salesman">
<option value="">請選擇營業員</option>
<?php foreach ($persons as $person) : ?>
<option value="<?php echo $person['value']; ?>"><?php echo $person['view']; ?></option>
<?php endforeach ?>
</select>
</div>
<p class="alerttext" x-show="data.salesman==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>\
<td style="vertical-align:middle">電梯數量</td>
<td>
<input type="text" class="form-control disabled_select" name="num" x-model="data.nums" disabled>
</td>
<td style="vertical-align: middle">聯繫人</td>
<td>
<input class="form-control disabled_select" type="text" name="" x-model="data.linkman">
<p class="alerttext" x-show="data.linkman==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">聯繫人電話</td>
<td>
<input class="form-control disabled_select" type="text" name="" x-model="data.lm_tel">
<p class="alerttext" x-show="data.lm_tel==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">案件名稱</td>
<td>
<input class="form-control disabled_select" type="text" name="" x-model="data.case_name">
<p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">合約簽訂日期</td>
<td>
<input class="form-control disabled_select" type="date" name="" x-model="data.signing_date">
<p class="alerttext" x-show="data.signing_date==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">客戶類型</td>
<td>
<select name="contract_type" id="contract_type" x-model="data.contract_type">
<option value="">請選擇</option>
<option value="1">戰略客戶</option>
<option value="2">一般客戶</option>
</select>
</td>
<td style="vertical-align: middle">附件上傳</td>
<td colspan="3">
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
</td>
</tr>
<tr>
</tr>
</tbody>
</template>
<template x-if="step == 3">
<template x-for="(elevator, idx) in data.elevators_detail_arr" :key="idx">
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==3">
<tr>
<td colspan=8>
<p x-text="'電梯' + Number(idx+1)"></p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">電梯型號</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.spec" disabled>
</td>
<td style="vertical-align: middle">開門方式</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.item_op" disabled>
</td>
<td style="vertical-align: middle">電梯載重</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.item_weight" disabled>
</td>
<td style="vertical-align: middle">電梯人乘</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.person" disabled>
</td>
</tr>
<tr>
<td style="vertical-align: middle">電梯速度</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.person" disabled>
</td>
<td style="vertical-align: middle">電梯樓停</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.floor" disabled>
</td>
<td style="vertical-align: middle">電梯樓層</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.floor">
</td>
<td style="vertical-align: middle">合約交期(到工地)</td>
<td>
<input class="form-control disabled_select" type="date" x-model="elevator.contract_arrival_date">
</td>
</tr>
<tr>
<td style="vertical-align: middle">QC和官檢</td>
<td>
<select class="" id="qc" x-model="data.qc">
<option value="">請選擇QC或官檢</option>
<option value="Q">只需QC</option>
<option value="O">只需官檢</option>
<option value="QO">QC和官檢</option>
</select>
<p class="alerttext" x-show="data.qc==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">工地負責人</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.manage">
</td>
<td style="vertical-align: middle">工務部門負責人</td>
<td style="vertical-align: middle">
<select class="form-control " id="warehouseid" name="warehouseid" x-model="elevator.warehouseid">
<option value="">未選擇</option>
<optgroup label="北區">
<option value="M0041">張潘榮(桃竹以北)</option>
<option value="M0150">羅盛騰(桃竹)</option>
<option value="M0040">吳宗紘</option>
</optgroup>
<optgroup label="中區">
<option value="M0198">廖堉勝</option>
<option value="M0158">劉子睿(新梯)</option>
<option value="M0161">鄭永典(汰改)</option>
<option value="M0159">孫仲凱</option>
<option value="M0202">徐錦潤</option>
<option value="M0113">林瑋隆</option>
</optgroup>
<optgroup label="南區">
<option value="M0078">許益連</option>
<option value="M0102">鄭存邑(高屏、台東)</option>
<option value="M0187">田祖豪(台南、嘉義)</option>
<option value="M0077">鍾玉龍</option>
</optgroup>
<optgroup label="宜蘭">
<option value="M0087">高培軒</option>
</optgroup>
</select>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td style="vertical-align: middle">現場地址</td>
<td colspan="3">
<input class="form-control disabled_select" type="text" x-model="data.address">
</td>
<td style="vertical-align: middle">經度</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.latitude">
</td>
<td style="vertical-align: middle">緯度</td>
<td>
<input class="form-control disabled_select" type="text" x-model="elevator.longitude">
</td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</template>
</template>
<template x-if="step == 4">
<template>
</template>
</template>
</table>
<button x-show="step==2" x-on:click="save()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<button x-show="step==3" x-on:click="save()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>存檔</span>
</template>
@ -138,7 +265,7 @@ $persons = array_map(function($person){
<div class="loader"></div>
</template>
</button>
<button x-show="step<=1" x-on:click="nextStepFn()" type="button" class="btn btn-primary btn-lg pull-right savebtn" :disabled="isLoading">
<button x-show="step<=3" x-on:click="nextStepFn()" type="button" class="btn btn-primary btn-lg pull-right savebtn" :disabled="isLoading">
<template x-if="!isLoading">
<span>下一步</span>
</template>
@ -162,4 +289,4 @@ $persons = array_map(function($person){
<script>
const user_id = '<?php echo $user_id; ?>';
const user_name = '<?php echo $user_name; ?>';
</script>
</script>

101
wms/contract/js/alpine.js

@ -810,7 +810,7 @@ const contractNewInput = () => {
return {
init() { },
data: {
contractno: '',
contractno: 'M23110004',
customer: '',
manager: '',
vat: '',
@ -821,7 +821,13 @@ const contractNewInput = () => {
salesman: '',
qc: '',
qc: '',
price_total: '', //合約總價
files: [],
contract_type: '1',
signing_date: '', //合約簽訂日期
elevators: [], // 電梯種類 Array
elevators_detail_arr: [], // 電梯台數 Array
nums: '', //電梯數量
},
step: 1,
isLoading: false,
@ -831,6 +837,10 @@ const contractNewInput = () => {
this.isLoading = true
if (this.step == 1) {
this.getContractDate();
} else if (this.step == 2) {
this.getElevatorsData();
} else if (this.step == 3) {
this.getElevatorsData();
}
},
nextStepKeyupFn(e) {
@ -843,10 +853,34 @@ const contractNewInput = () => {
preStepFn() {
if (this.step == 2) {
this.step = 1
} else if (this.step == 3) {
this.step = 2
}
},
getElevatorsData() {
if (this.step == 2) {
for (let i = 0; i < this.data.nums; i++) {
// console.log(this.data.elevators_detail_arr[i]);
this.data.elevators_detail_arr[i].warehouseid = ''; // 公務部門負責人
this.data.elevators_detail_arr[i].latitude = ''; // 經度
this.data.elevators_detail_arr[i].longitude = ''; // 緯度
this.data.elevators_detail_arr[i].manage = ''; // 工地負責人
this.data.elevators_detail_arr[i].qc = ''; // QC和官檢
this.data.elevators_detail_arr[i].contract_arrival_date = ''; //合約交期(到工地)
}
this.step = 3;
this.isLoading = false;
} else if (this.step == 3) {
console.log(this.data.elevators_detail_arr);
this.step = 4;
this.isLoading = false;
}
},
getContractDate() {
axios.get('./api/getContractData.php?contracttype=m&contractno=' + this.data.contractno).then(res => {
console.log(res);
if (!res.data) {
this.step = 2
this.isLoading = false
@ -854,15 +888,19 @@ const contractNewInput = () => {
}
if (!this.customize) {
console.log(res.data);
this.data.customer = res.data.customer
this.data.customer = res.data.company
this.data.manager = res.data.manager
this.data.vat = res.data.uscc
this.data.case_name = res.data.case_name
this.data.linkman = res.data.linkman
this.data.lm_tel = res.data.lm_tel
this.data.address = res.data.address
this.data.salesman = res.data.salesman
this.data.qc = res.data.qc
this.data.salesman = res.data.person
this.data.qc = res.data.qc;
this.data.price_total = res.data.price_total;
this.data.elevators = res.data.elevators;
this.data.elevators_detail_arr = res.data.elevators_detail_arr;
this.data.nums = res.data.nums;
}
this.step = 2
this.isLoading = false
@ -884,6 +922,12 @@ const contractNewInput = () => {
form.append('address', this.data.address);
form.append('salesman', this.data.salesman);
form.append('qc', this.data.qc);
form.append('signing_date', this.data.signing_date);
form.append('nums', this.data.nums);
form.append('price_total', this.data.price_total);
form.append('contract_type', this.data.contract_type);
form.append('elevators_detail_arr', JSON.stringify(this.data.elevators_detail_arr));
form.append('elevators', JSON.stringify(this.data.elevators));
form.append('contracttype', 'm');
form.append('user_id', user_id);
for (var i = 0; i < this.data.files.length; i++) {
@ -971,7 +1015,11 @@ const contractInput = () => {
num: '', //電梯數量
disabled: false, //資料庫是否有電梯數量資料
elevators: [], //機種、載重、人乘、樓停、樓層、速度、緯度、經度、開門方式、保養別、廠牌、竣檢日、許可證日期
payType: '' //付款方式
payType: '', //付款方式
// bonus_verson: 2.1,
// manager: '',
// regular_contract_manger_id: '',
// bonus: [],
},
customize: false,
step: 1,
@ -988,6 +1036,26 @@ const contractInput = () => {
this.createElevator();
}
this.step = 3
} else if (this.step == 3) {
this.getManager();
this.step = 4;
// console.log(this.step);
}
},
getBonusVerson(data) {
// 目前獎金版本為 2.1,若之後要依辦法建立時間來判斷在這邊修改
data.bonus_verson = 2.1;
},
getManager() {
for (let i = 0; i < this.data.elevators.length; i++) {
this.getBonusVerson(this.data.elevators[i]);
axios.get('./api/getContractData.php?contracttype=accountManger&salesman=' + this.data.salesman).then(res => {
this.data.elevators[i].manager = res.data.manager;
console.log(this.data.elevators[i]);
}).catch(err => {
})
}
},
nextStepKeyupFn(e) {
@ -1017,6 +1085,12 @@ const contractInput = () => {
maintainance: '', //保養別
takecertificatedate: '', //竣檢日
useful_date: '', //許可證有效日期
maintain_times: '', //保養頻率
discount: '', //折價率
contract_type: '',
manager: '',
regular_contract_manger_id: '',
bonus_verson: ''
})
}
},
@ -1028,9 +1102,15 @@ const contractInput = () => {
return
}
if (!this.customize) {
this.data.elevators = res.data.elevators;
for (let i = 0; i < res.data.elevators.length; i++) {
// 合約總價格。
this.data.total_price = Number(res.data.elevators[i].sold_price) + Number(this.data.total_price);
console.log(this.data.total_price);
// 服務費 (以單筆合約記,但計算獎金須傳入單月服務費)
this.data.elevators[i].service_expense = Math.round(this.data.elevators[i].service_expense / 12);
// 折扣率
this.data.elevators[i].discount = Math.round(((res.data.elevators[i].sold_price / res.data.elevators[i].stand_price) + this.data.elevators[i].service_expense) * 100);
}
this.data.total_price = Number(res.data.elevators[0].maintain_months) * this.data.total_price;
this.data.salesman = res.data.salesman
@ -1040,9 +1120,10 @@ const contractInput = () => {
this.data.customer = res.data.customer
this.data.partyA = res.data.customer
this.data.partyAaddress = res.data.address
this.data.num = res.data.num
this.data.num = res.data.num;
this.data.payType = res.data.payment_kind
this.data.disabled = (res.data.num > 0) ? true : false;
this.data.elevators = res.data.elevators
let cityIndex = this.data.address.indexOf('市');
// console.log(cityIndex);
if (cityIndex == -1) {
@ -1094,6 +1175,8 @@ const contractInput = () => {
}
} else if (this.step == 3) {
this.step = 2
} else if (this.step == 4) {
this.step = 3
}
},
save() {
@ -1106,7 +1189,7 @@ const contractInput = () => {
form.append('phone', this.data.phone);
form.append('email', this.data.email);
form.append('mworker', this.data.mworker);
form.append('mcycle', this.data.mcycle);
// form.append('mcycle', this.data.mcycle);
form.append('salesman', this.data.salesman);
form.append('contract_begin_date', this.data.contract_begin_date);
form.append('contract_end_date', this.data.contract_end_date);

309
wms/contract_b-index.php

@ -0,0 +1,309 @@
<?php
include "header.php";
include "css/view/wipwhole-index.php";
// 設置一個空陣列來放資料
$data = array();
$contractno = empty($_POST['contractno']) ? null : $_POST['contractno'];
$department_id = accountidToDepartId($user_id);
if (in_array(accountidToDepartId($user_id), ['220'])) {
$sql_cmd = " WHERE 1=1 ";
} else {
$sql_cmd = sql_myself($user_id, "cgp.PersonId");
}
// 合約主檔
$sql = "
SELECT
siam.BillNo, -- 單據號
siad_tmp.ProjectId,-- 合約號
siam.BillDate, -- 合約日期
BizPartnerName, -- 客戶名稱
cp.PersonId, -- 業務人員
cgp.PersonName, -- 業務人員名稱
cd.DeptName, -- 業務人員部門
siam.UnTransAmount, -- 合約金額
siad_tmp2.Max_CU_EstPayDate -- 最後收款日期
FROM salIncomeApplyMaster AS siam
LEFT JOIN (
SELECT
cc.BizPartnerId,
cbp.BizPartnerName
FROM comCustomer AS cc
LEFT JOIN comBusinessPartner AS cbp
ON cc.BizPartnerId = cbp.BizPartnerId
)cb_tmp
ON cb_tmp.BizPartnerId = siam.BizPartnerId
LEFT JOIN comPerson AS cp -- 員工主檔
ON siam.PersonId = cp.PersonId
LEFT JOIN comGroupPerson AS cgp -- 員工明細檔
ON cp.PersonId = cgp.PersonId
LEFT JOIN comDepartment AS cd -- 部門主檔
ON cp.DeptId = cd.DeptId
LEFT JOIN
(
SELECT DISTINCT
siad.BillNo,
siad.ProjectId
FROM salIncomeApplyDetail AS siad
WHERE siad.ProjectId != ''
AND siad.ProjectId IS NOT NULL
)AS siad_tmp -- 合約明細
ON siam.BillNo = siad_tmp.BillNo
LEFT JOIN
(
SELECT
siad.BillNo,
MAX(siad.CU_EstPayDate) as Max_CU_EstPayDate
FROM salIncomeApplyDetail AS siad
GROUP BY siad.BillNo
)AS siad_tmp2 -- 合約明細2
ON siam.BillNo = siad_tmp2.BillNo
$sql_cmd
AND siam.CurrentState = '2'
";
if (!empty($contractno)) {
$sql .= " AND siad_tmp.ProjectId = '$contractno' ";
}
// echo "<pre>";
// echo $sql;
// echo "</pre>";
// exit;
$data = $conn->query($sql);
if ($data) :
?>
<style>
table {
table-layout: fixed;
width: 100%;
}
td {
word-wrap: break-word;
}
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
table {
width: 100%;
}
#table_index_filter {
float: right;
}
#table_index_paginate {
float: right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
</style>
<div id="myModal" class="modal">
<div class="back"></div>
<div class="modal-content">
<button type="button" class="close" id="myCloseBtn">X</button>
<div class='col-12' style='text-align:center'>
<div class='row'>
<div class='col-12'>
<table id="table_detail" class="table table-bordered" style="width:100%; margin:0 auto;">
<thead>
<tr>
<th>收入代碼</th>
<th>收入名稱</th>
<th>數量</th>
<th>單價</th>
<th>金額(未稅)</th>
<th>稅金</th>
<th>含稅金額</th>
<th>專案代碼</th>
<th>作番號</th>
<th>預計請款日</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div style="overflow-x:auto;">
<form id='myForm' method='post' action='contract_b-index.php?<?= $token_link ?>'>
<table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'>
<thead>
<tr>
<td colspan="5">
<h3 style='text-align:center'>保養合約管理</h3>
</td>
</tr>
</thead>
<tbody>
<tr>
<th style='text-align:center;vertical-align: middle;'>合約號</th>
<td style='text-align:center;vertical-align: middle;'>
<input type="text" class='form-control' id='contractno' name='contractno' value="">
</td>
<td style='text-align:left;vertical-align: middle;'>
<button type="submit" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm">查詢</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div style="overflow-x:auto;">
<a href="contract/contract-input.php?function_name=contract-input&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th style='text-align:center;vertical-align: middle;width:120px;'>營業人員/契約人員</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>部門</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>合約號</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>單據號</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>客戶名稱</th>
<th style='text-align:center;vertical-align: middle;width:80px;'>單據日期</th>
<th style='text-align:center;vertical-align: middle;width:80px;'>最後收款日</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>追蹤狀態</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>金額</th>
<th style='text-align:center;vertical-align: middle;width:60px;'>明細</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $row) { ?>
<tr>
<td>
<?php
echo $row['PersonId'];
echo "<br/>";
echo $row['PersonName'];
?>
</td>
<td>
<?php echo $row['DeptName']; ?>
</td>
<td>
<?php echo $row['ProjectId']; ?>
</td>
<td>
<?php echo $row['BillNo']; ?>
</td>
<td>
<?php echo $row['BizPartnerName']; ?>
</td>
<td>
<?php echo date('Y/m/d', strtotime($row['BillDate'])); ?>
</td>
<td>
<?php echo empty($row['Max_CU_EstPayDate']) ? '' : date('Y/m/d', strtotime($row['Max_CU_EstPayDate'])); ?>
</td>
<td>
<?php
$date1 = new DateTime(date('Y-m-d', strtotime($row['Max_CU_EstPayDate'])));
$date2 = new DateTime(date('Y-m-d'));
$interval = $date1->diff($date2);
$months = $interval->m;
$months += $interval->y * 12;
if ($date1 <= $date2) {
echo "<span class=''>合約已過期</span>";
} else if ($months <= 2) {
echo "<span class='text-danger'>合約快到期</span>";
} else {
echo "<span class='text-success'>合約未到期</span>";
}
?>
</td>
<td>
<?php echo number_format(intval($row['UnTransAmount']), 0, '', ','); ?>
</td>
<td>
<button class="btn btn-primary myBtn" type="button" onclick="showDetail('<?php echo $row['BillNo']; ?>')">明細</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<script>
var modal = document.getElementById("myModal");
$(".myBtn").click(function() {
$("#myModal").show();
});
$("#myCloseBtn").click(function(e) {
$("#myModal").hide();
});
$(".back").click(function(e) {
$("#myModal").hide();
});
function showDetail(billno) {
$.ajax({
type: "POST",
dataType: "json",
url: "contract_b-index-model.php",
data: {
form_name: 'showDetail',
billno: billno
},
complete: function(data) {
var data = data.responseJSON
var str = "";
for (var i = 0; i < data.length; i++) {
str += "<tr>";
str += "<td>" + data[i]['IncomeId'] + "</td>";
str += "<td>" + data[i]['FeeTypeName'] + "</td>";
str += "<td>" + data[i]['SQuantity'] + "</td>";
str += "<td>" + data[i]['SPrice'] + "</td>";
str += "<td>" + data[i]['OAmount'] + "</td>";
str += "<td>" + data[i]['OTax'] + "</td>";
str += "<td>" + data[i]['OAmountWithTax'] + "</td>";
str += "<td>" + data[i]['ProjectId'] + "</td>";
str += "<td>" + data[i]['CU_MaterialId'] + "</td>";
str += "<td>" + data[i]['CU_EstPayDate'] + "</td>";
str += "</tr>";
}
if ($('#table_detail').hasClass('dataTable')) {
dttable = $('#table_detail').dataTable();
dttable.fnClearTable();
dttable.fnDestroy();
}
$("#table_detail").find("tbody").html(str);
$('#table_detail').dataTable();
}
})
}
</script>
<?php
else :
echo "<h2>There is no record!</h2>";
endif;
#代表結束連線
mysqli_close($link);
include "footer.php";
?>

2
wms/crm/crmm02-index.php

@ -170,7 +170,7 @@ if ($data) :
<span class="glyphicon glyphicon-pencil"></span>
</a>
<?php if ($user_name === $row['salesman'] || $user_id = 'M0225') : ?>
<a href="https://bpm.masada.com.tw/km/review/km_review_main/kmReviewMain.do?method=add&fdTemplateId=18cf68c8bc2a8ec3c80950e4e2389f0a&s_css=default&vol_no=<?= $row['vol_no'] ?>" class="btn btn-info btn-sm">
<a href="../mkt/pricereviewMaintainCreate.php?function_name=customer&token=<?= $token_link ?>&vol_no=<?= $row['vol_no'] ?>" class="btn btn-info btn-sm">
轉價審
</a>
<?php endif ?>

8
wms/crm/crmm03-edit.php

@ -348,7 +348,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
<textarea class='form-control textarea' id="progress_status" name="progress_status" value='' rows='6'></textarea>
</div>
</div>
<div id="elevator_list_area" class="row ">
<!-- <div id="elevator_list_area" class="row ">
<div class="col-12 form_row_header ">
<b>電梯規格信息</b>
</div>
@ -398,8 +398,8 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
</tbody>
</table>
</div>
<div id="option_list_area" class="row ">
</div> -->
<!-- <div id="option_list_area" class="row ">
<div class="col-12 form_row_header ">
<b>Option報價</b>
</div>
@ -452,7 +452,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
</tbody>
</table>
</div>
</div> -->
<button style='margin:20px auto;width:50px' type="submit" class="btn btn-primary btn-sm">保存</button>
</div>

28
wms/crm/crmm04-edit.php

@ -98,7 +98,7 @@ $hope_project_elevator_spec_columm = [
//'weight' => ['label' => "載重(KG)", "tag" => 'number', 'attr' => ['name' => 'weight[]', 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']],
'stop' => ['label' => "停數", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'min=0', 'class' => 'form-control form-control-sm']],
'open' => ['label' => "開門方式", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'open[]', 'class' => 'form-control form-control-sm'], 'options' => $open_kind_opt],
'speed' => ['label' => "速度(m/min)", "tag" => 'select', 'attr' => ['name' => 'speed[]', 'class' => 'form-control form-control-sm'],'options' => $speed_opt],
'speed' => ['label' => "速度(m/min)", "tag" => 'select', 'attr' => ['name' => 'speed[]', 'class' => 'form-control form-control-sm'], 'options' => $speed_opt],
'spec_num' => ['label' => "數量", "tag" => 'digits', 'attr' => ['name' => 'spec_num[]', 'min=0', 'class' => 'form-control form-control-sm']],
'spec_price' => ['label' => "單價", "tag" => 'number', 'attr' => ['name' => 'spec_price[]', 'min=0', 'class' => 'form-control form-control-sm']],
@ -204,14 +204,14 @@ function base_url($url)
"indent | alignleft center alignright justify | undo redo | "
});
$('#cmecTbody').on('click', 'input[name^=spec_num]', function(){
$(this).unbind().keyup(function(){
$('#cmecTbody').on('click', 'input[name^=spec_num]', function() {
$(this).unbind().keyup(function() {
$(this).val($(this).val().replace(/\D/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ","));
sumNum();
});
});
$('#is_renovation').change(function(){
$('#is_renovation').change(function() {
console.log($(this).val());
});
@ -220,8 +220,8 @@ function base_url($url)
});
sumNum = function() {
var numAll = 0;
$("input[name^=spec_num]").each(function(){
numAll += Number($(this).val().replace(/[,]+/g,""));
$("input[name^=spec_num]").each(function() {
numAll += Number($(this).val().replace(/[,]+/g, ""));
});
$('#num').val(numAll);
}
@ -295,7 +295,7 @@ function base_url($url)
}
selectHpeoRow = function(obj) {
var id = $(obj).parent().parent().find('td:nth-child(1)>div').text();
var id = $(obj).parent().parent().find('td:nth-child(1)>div').text();
var spec = $(obj).parent().parent().find('td:nth-child(2)>div').text();
var memo = $(obj).parent().parent().find('td:nth-child(3)>div').text();
var optional = $(obj).parent().parent().find('td:nth-child(4)>div').text();
@ -307,13 +307,13 @@ function base_url($url)
//').last()
var tr = $('#hpeoTbody tr').last();
$(tr).children('td').each(function(i) {
$(this).find("input[name^='id']").val(id.trim());
$(this).find("input[name^='id']").val(id.trim());
$(this).find("input[name^='spec']").val(spec.trim());
$(this).find("input[name^='memo']").val(memo.trim());
$(this).find("input[name^='optional']").val(optional.trim());
$(this).find("input[name^='unit']").val(unit.trim());
$(this).find("input[name^='price']").val(price.trim());
});
}
</script>
@ -333,7 +333,7 @@ function base_url($url)
<div class=" form container-fluid pt-5">
<div class="row form_head ">
<div class=" col-12 form_head_title ">
<h4> 有望客戶(<?php echo ($hope_elevator_customer[0]["is_renovation"]=="Y")?"汰改":"新梯"; ?>)訂正</h4>
<h4> 有望客戶(<?php echo ($hope_elevator_customer[0]["is_renovation"] == "Y") ? "汰改" : "新梯"; ?>)訂正</h4>
</div>
</div>
@ -381,7 +381,7 @@ function base_url($url)
</div>
</div>
<div id="elevator_list_area" class="row ">
<!-- <div id="elevator_list_area" class="row ">
<div class="col-12 form_row_header ">
<b>電梯規格信息</b>
</div>
@ -431,8 +431,8 @@ function base_url($url)
</tbody>
</table>
</div>
<div id="option_list_area" class="row ">
</div> -->
<!-- <div id="option_list_area" class="row ">
<div class="col-12 form_row_header ">
<b>Option報價</b>
</div>
@ -486,7 +486,7 @@ function base_url($url)
</tbody>
</table>
</div>
</div> -->
<button style='margin:20px auto;width:50px' type="submit" class="btn btn-primary btn-sm">保存</button>
</div>

2
wms/fun_global.php

@ -14,7 +14,7 @@ function sql_myself($user_id, $column = "creater")
global $link;
$follower_arr = []; // 下屬列表
if($user_id == 'M0105'){
if ($user_id == 'M0105') {
$user_id = "M0137";
}
$sql_cmd = "where ($column = '$user_id'";

292
wms/mkt/assets/js/pricereviewAlpine.js

@ -1,6 +1,6 @@
const pricereviewCreate = ()=>{
const pricereviewCreate = () => {
return {
init(){
init() {
this.elevators = elevators;
this.is_renovation = is_renovation
this.selectedOptions = selectedOptions;
@ -15,9 +15,9 @@ const pricereviewCreate = ()=>{
9:"CO"
},
optionalArr: {
1:'標配',
2:'選配',
3:'選配',
1: '標配',
2: '選配',
3: '選配',
},
total_spec: total_spec,
options: options,
@ -27,9 +27,9 @@ const pricereviewCreate = ()=>{
subkind: 1,
buttons: [],
modalSelectedOptions: {},
selectedOptions:[],
selectedOptions: [],
elevators: [],
toElevators:[],
toElevators: [],
toElevatorNo: '',
currentOptionKey: '',
currentOtherOptionKey: '',
@ -46,23 +46,23 @@ const pricereviewCreate = ()=>{
speed:'',
open:'CO',
num: 1,
price:'',
sale_price:'',
price: '',
sale_price: '',
facility_id: '',
model:'',
},
otherOptions: [],
modalOtherOptionInfo:{
pr_no:"",
name:"",
modalOtherOptionInfo: {
pr_no: "",
name: "",
price: 0,
num:"",
num: "",
},
maintainOptions:[],
modalMaintainInfo:{
price:0,
num:"",
memo:"",
maintainOptions: [],
modalMaintainInfo: {
price: 0,
num: "",
memo: "",
},
demolishOptions: demolishOptions,
modalDemolishOptionsInfo:{
@ -122,15 +122,14 @@ const pricereviewCreate = ()=>{
try{
const res = await axios.get("./api/getElevatorPrice.php", {params: {model: model, kind: spec}})
console.log(res.data);
if(res.data.id == null || res.data.id == ""){
if (res.data == null || res.data == "") {
console.log("公司並無提供此規格!!");
}
this.elevators[idx].price = res.data.price
this.elevators[idx].facility_id = res.data.id
}catch (error) {
this.elevators[idx].price = res.data
} catch (error) {
console.error("Error fetching elevator price:", error);
}
},
async getModalElevatorPrice(){
let model = "";
@ -145,12 +144,11 @@ const pricereviewCreate = ()=>{
try{
const res = await axios.get("./api/getElevatorPrice.php", {params: {model: model, kind:kind}})
console.log(res.data);
if(res.data.id == null || res.data.id == ""){
if (res.data == null || res.data == "") {
console.log("公司並無提供此規格!!");
}
this.modalElevatorInfo.price = res.data.price
this.modalElevatorInfo.facility_id = res.data.id
}catch (error) {
this.modalElevatorInfo.price = res.data
} catch (error) {
console.error("Error fetching elevator price:", error);
}
},
@ -228,65 +226,65 @@ const pricereviewCreate = ()=>{
}
},
optionSubCategory: 1,
initOptinos(){
this.options.forEach(option=>{
initOptinos() {
this.options.forEach(option => {
option.isShow = 1;
})
},
searchOptions(kind=this.kind, subkind=this.subkind){
if(kind!=null) this.kind = kind;
if(subkind!=null) this.subkind = subkind;
searchOptions(kind = this.kind, subkind = this.subkind) {
if (kind != null) this.kind = kind;
if (subkind != null) this.subkind = subkind;
this.initOptinos();
this.initButtons(kind);
this.options.forEach(option=>{
if(option.kind != this.kind && this.kind != 1){
this.options.forEach(option => {
if (option.kind != this.kind && this.kind != 1) {
option.isShow = 0;
}else{
if(option.subkind != this.subkind && this.subkind != 1){
} else {
if (option.subkind != this.subkind && this.subkind != 1) {
option.isShow = 0;
}
}
if(option.isShow == 1){
if(option.group_name == null) option.group_name = ''
if(option.spec == null) option.spec = ''
if(option.memo == null) option.memo = ''
if(option.price == null) option.price = 0
if(option.unit == null) option.unit = ''
if(String(option.id).includes(this.searchtext) || option.group_name.includes(this.searchtext) || option.memo.toLowerCase().includes(this.searchtext) || option.spec.toLowerCase().includes(this.searchtext) || option.unit.includes(this.searchtext) || String(option.price).includes(this.searchtext)){
if (option.isShow == 1) {
if (option.group_name == null) option.group_name = ''
if (option.spec == null) option.spec = ''
if (option.memo == null) option.memo = ''
if (option.price == null) option.price = 0
if (option.unit == null) option.unit = ''
if (String(option.id).includes(this.searchtext) || option.group_name.includes(this.searchtext) || option.memo.toLowerCase().includes(this.searchtext) || option.spec.toLowerCase().includes(this.searchtext) || option.unit.includes(this.searchtext) || String(option.price).includes(this.searchtext)) {
option.isShow = 1
}else{
} else {
option.isShow = 0
}
}
})
},
selectOption(idx, id, name, price, memo){
this.options[idx].selected = this.options[idx].selected==1 ? 0 : 1;
if(this.modalSelectedOptions.hasOwnProperty(idx)){
selectOption(idx, id, name, price, memo) {
this.options[idx].selected = this.options[idx].selected == 1 ? 0 : 1;
if (this.modalSelectedOptions.hasOwnProperty(idx)) {
delete this.modalSelectedOptions[idx];
}else{
} else {
//this.optionKey => 已選option 流水號, idx:option表內的流水號, id:option 資料庫的ID
this.modalSelectedOptions[idx] = {key:this.optionKey, 'idx':idx, 'id': id, 'name': name, 'price': price, qty:1, 'memo': memo, 'toElevator':[] }
this.modalSelectedOptions[idx] = { key: this.optionKey, 'idx': idx, 'id': id, 'name': name, 'price': price, qty: 1, 'memo': memo, 'toElevator': [] }
}
this.optionKey ++;
this.optionKey++;
},
initModalSelectedOptions(){
initModalSelectedOptions() {
this.modalSelectedOptions = {}
this.options.forEach(option=>{
this.options.forEach(option => {
option.selected = 0
})
this.$refs.optionsModal.style.display = "block"
body.style.overflow = 'hidden'
},
chkOptions(){
Object.keys(this.modalSelectedOptions).forEach(option=>{
chkOptions() {
Object.keys(this.modalSelectedOptions).forEach(option => {
this.selectedOptions.push(this.modalSelectedOptions[option])
})
console.log(this.selectedOptions);
this.hideOptionsModal();
},
hideOptionsModal(){
hideOptionsModal() {
this.$refs.optionsModal.style.display = 'none';
body.style.overflow = 'auto'
},
@ -354,33 +352,33 @@ const pricereviewCreate = ()=>{
return total + (elevator.spec_num * elevator.price);
}, 0);
},
totalElevatorsNum(){
totalElevatorsNum() {
return this.elevators.reduce((total, elevator) => {
return total + Number(elevator.spec_num);
}, 0)
},
totalElevatorsSalePrice(){
totalElevatorsSalePrice() {
return this.elevators.reduce((total, elevator) => {
return total + (elevator.spec_num * elevator.spec_price);
}, 0);
},
totalOptionsPrice(){
totalOptionsPrice() {
return this.selectedOptions.reduce((total, option) => {
return total + (option.qty * option.price);
}, 0);
},
openAddElevatorFn(){
openAddElevatorFn() {
},
createElevatorFn(){
if(this.modalElevatorInfo.spec == '') return alert("請選擇電梯規格");
if(this.modalElevatorInfo.stop == '') return alert("請填入停數");
if(this.modalElevatorInfo.speed == '') return alert("請選擇速度");
if(this.modalElevatorInfo.open == '') return alert("請選擇開梯方式");
if(this.modalElevatorInfo.person == '') return alert("請填入人乘/載重");
if(this.modalElevatorInfo.num == '') return alert("請填入數量");
if(this.modalElevatorInfo.sale_price == '') return alert("請填入售價");
this.total_spec ++;
createElevatorFn() {
if (this.modalElevatorInfo.spec == '') return alert("請選擇電梯規格");
if (this.modalElevatorInfo.stop == '') return alert("請填入停數");
if (this.modalElevatorInfo.speed == '') return alert("請選擇速度");
if (this.modalElevatorInfo.open == '') return alert("請選擇開梯方式");
if (this.modalElevatorInfo.person == '') return alert("請填入人乘/載重");
if (this.modalElevatorInfo.num == '') return alert("請填入數量");
if (this.modalElevatorInfo.sale_price == '') return alert("請填入售價");
this.total_spec++;
this.elevators.push({
id: this.total_spec,
specifications: this.modalElevatorInfo.spec,
@ -390,7 +388,7 @@ const pricereviewCreate = ()=>{
open_converted: this.modalElevatorInfo.open,
spec_price: this.modalElevatorInfo.sale_price,
price: this.modalElevatorInfo.price,
open:'',
open: '',
spec_num: this.modalElevatorInfo.num,
facility_id: this.modalElevatorInfo.facility_id,
model: this.modalElevatorInfo.model,
@ -398,7 +396,7 @@ const pricereviewCreate = ()=>{
console.log(this.elevators);
this.hideCreateElevatorModal();
},
copyElevator(idx){
copyElevator(idx) {
const spec = this.elevators[idx].specifications
const person = this.elevators[idx].person
const stop = this.elevators[idx].stop
@ -411,7 +409,7 @@ const pricereviewCreate = ()=>{
const facility_id = this.elevators[idx].facility_id
const model = this.elevators[idx].model
this.total_spec ++;
this.total_spec++;
this.elevators.push({
id: this.total_spec,
specifications: spec,
@ -484,11 +482,11 @@ const pricereviewCreate = ()=>{
this.$refs.toElevatorModal.style.display = 'block';
body.style.overflow = 'hidden'
},
addOtherOptionToElevator(id){
addOtherOptionToElevator(id) {
this.currentOtherOptionKey = id;
this.toElevators = [];
this.toElevatorNo = "";
const matchElevators = this.otherOptions.filter(option=> option.id == id)[0].toElevator.map(elevator=> elevator.id)
const matchElevators = this.otherOptions.filter(option => option.id == id)[0].toElevator.map(elevator => elevator.id)
this.toElevatorNo = matchElevators[0]
this.elevators.forEach(elevator=>{
if(elevator.price > 0){
@ -510,7 +508,7 @@ const pricereviewCreate = ()=>{
this.$refs.toOtherOptionElevatorModal.style.display = 'block';
body.style.overflow = 'hidden'
},
chkOptionToElevators(){
chkOptionToElevators() {
const checkedOptions = [];
const matchElevators = this.elevators.filter(elevator=> elevator.id == this.toElevatorNo)[0]
@ -518,8 +516,8 @@ const pricereviewCreate = ()=>{
id: this.toElevatorNo,
model: matchElevators['model'] ,
})
this.selectedOptions.forEach(option=>{
if(option.key == this.currentOptionKey){
this.selectedOptions.forEach(option => {
if (option.key == this.currentOptionKey) {
option.toElevator = [];
option.toElevator.push(...checkedOptions)
}
@ -527,7 +525,7 @@ const pricereviewCreate = ()=>{
this.currentOptionKey = ''
this.hideToElevatorModal();
},
chkOtherOptionToElevators(){
chkOtherOptionToElevators() {
const checkedOptions = [];
const matchElevators = this.elevators.filter(elevator=> elevator.id == this.toElevatorNo)[0]
@ -535,8 +533,8 @@ const pricereviewCreate = ()=>{
id: this.toElevatorNo,
model: matchElevators['model'],
})
this.otherOptions.forEach(option=>{
if(option.id == this.currentOtherOptionKey){
this.otherOptions.forEach(option => {
if (option.id == this.currentOtherOptionKey) {
option.toElevator = [];
option.toElevator.push(...checkedOptions)
}
@ -546,36 +544,36 @@ const pricereviewCreate = ()=>{
this.hideToOtherOptionElevatorModal();
},
removeElevator(id){
if(!confirm("確定刪除嗎?")) return;
this.elevators = this.elevators.filter(elevator=> elevator.id != id)
removeElevator(id) {
if (!confirm("確定刪除嗎?")) return;
this.elevators = this.elevators.filter(elevator => elevator.id != id)
const issetElevators = [];
this.elevators.forEach(elevator=>{
this.elevators.forEach(elevator => {
issetElevators.push(elevator.id);
})
this.selectedOptions.forEach(option=>{
option.toElevator = option.toElevator.filter(el=>{
this.selectedOptions.forEach(option => {
option.toElevator = option.toElevator.filter(el => {
return issetElevators.includes(el.id)
})
})
console.log(this.selectedOptions);
},
removeOption(key){
removeOption(key) {
console.log(this.selectedOptions);
this.selectedOptions = this.selectedOptions.filter(option=> option.key != key)
this.selectedOptions = this.selectedOptions.filter(option => option.key != key)
},
removeOtherOption(id){
this.otherOptions = this.otherOptions.filter(option=> option.id != id)
removeOtherOption(id) {
this.otherOptions = this.otherOptions.filter(option => option.id != id)
},
createOtherOptionFn(){
createOtherOptionFn() {
this.otherOptions.push({
id: this.otherOptionKey,
pr_no: this.modalOtherOptionInfo.pr_no,
name: this.modalOtherOptionInfo.name,
price: this.modalOtherOptionInfo.price,
num: this.modalOtherOptionInfo.num,
toElevator:[],
toElevator: [],
})
this.modalOtherOptionInfo = {
pr_no: '',
@ -583,34 +581,35 @@ const pricereviewCreate = ()=>{
price: 0,
num: '',
}
this.otherOptionKey ++;
this.hideCreateOtherOptionModal();
this.otherOptionKey++;
console.log(this.otherOptions);
this.$refs.closeCreateOtherOptionModalBtn.click();
},
totalOtherOptionsPrice(){
totalOtherOptionsPrice() {
return this.otherOptions.reduce((total, option) => {
return total + (Number(option.num) * Number(option.price));
}, 0);
},
totalOtherOptionsNum(){
totalOtherOptionsNum() {
return this.otherOptions.reduce((total, option) => {
return total + Number(option.num);
}, 0);
},
createMaintainOptionFn(){
createMaintainOptionFn() {
this.maintainOptions.push({
id: this.maintainOptionKey,
price: this.modalMaintainInfo.price,
num: this.modalMaintainInfo.num,
memo: this.modalMaintainInfo.memo,
toElevator:[],
toElevator: [],
})
this.modalMaintainInfo = {
price:0,
num:"",
memo:"",
price: 0,
num: "",
memo: "",
}
this.maintainOptionKey ++;
this.hideCreateMaintainModal();
this.maintainOptionKey++;
this.$refs.closeCreateMaintainOptionModalBtn.click();
},
createDemolishOptionFn(){
this.demolishOptions.push({
@ -636,7 +635,7 @@ const pricereviewCreate = ()=>{
return total + (Number(option.num) * Number(option.price));
}, 0);
},
totalMaintainOptionsNum(){
totalMaintainOptionsNum() {
return this.maintainOptions.reduce((total, option) => {
return total + Number(option.num);
}, 0);
@ -659,8 +658,8 @@ const pricereviewCreate = ()=>{
id: this.toElevatorNo,
model: matchElevators['model'],
})
this.maintainOptions.forEach(option=>{
if(option.id == this.currentMaintainOptionKey){
this.maintainOptions.forEach(option => {
if (option.id == this.currentMaintainOptionKey) {
option.toElevator = [];
option.toElevator.push(...checkedOptions)
}
@ -688,7 +687,7 @@ const pricereviewCreate = ()=>{
this.currentMaintainOptionKey = id;
this.toElevators = [];
this.toElevatorNo = "";
const matchElevators = this.maintainOptions.filter(option=> option.id == id)[0].toElevator.map(elevator=> elevator.id)
const matchElevators = this.maintainOptions.filter(option => option.id == id)[0].toElevator.map(elevator => elevator.id)
this.toElevatorNo = matchElevators[0]
this.elevators.forEach(elevator=>{
if(elevator.price > 0){
@ -745,19 +744,19 @@ const pricereviewCreate = ()=>{
totalPrice(){
return this.totalElevatorsPrice() + this.totalOptionsPrice() + this.totalOtherOptionsPrice() + this.totalMaintainOptionsPrice();
},
totalSalePrice(){
totalSalePrice() {
return this.elevators.reduce((total, elevator) => {
return total + (elevator.spec_num * elevator.spec_price);
}, 0);
},
scalePrice(scale){
if(scale === '') return 0;
scalePrice(scale) {
if (scale === '') return 0;
return this.totalSalePrice() * scale / 100;
},
totalScale(){
totalScale() {
let total = 0;
Object.keys(this.paymentRatio).forEach(pay=>{
if(this.paymentRatio[pay].scale != '' && this.paymentRatio[pay].scale > 0){
Object.keys(this.paymentRatio).forEach(pay => {
if (this.paymentRatio[pay].scale != '' && this.paymentRatio[pay].scale > 0) {
total += Number(this.paymentRatio[pay].scale)
}
})
@ -815,7 +814,7 @@ const pricereviewCreate = ()=>{
form.append('address', this.customerInfo.address);
form.append('price_lowest', this.totalPrice());
form.append('price_total', this.totalSalePrice());
form.append('price_rate', Math.round(this.totalSalePrice() / this.totalPrice() * 100 *10) / 10);
form.append('price_rate', Math.round(this.totalSalePrice() / this.totalPrice() * 100 * 10) / 10);
form.append('special_fee', this.serviceFee);
form.append('predeal_date', this.transactionDate);
form.append('facilitok_date', this.shippingDate);
@ -837,14 +836,14 @@ const pricereviewCreate = ()=>{
form.append('demolishOptions', JSON.stringify(this.demolishOptions));
form.append('paymentRatio', JSON.stringify(this.paymentRatio));
axios.post('./api/postNewElevatorPricereview.php', form).then(res=>{
axios.post('./api/postNewElevatorPricereview.php', form).then(res => {
console.log(res.data);
if(res.data == "success"){
if (res.data == "success") {
alert("送審成功!");
window.location.href = './pricereview-index.php?' + token_link;
}
}).catch(err=>{
}).catch(err => {
console.error(err);
})
},
@ -894,9 +893,7 @@ const pricereviewCreate = ()=>{
},
}
}
const pricereviewCheck = ()=>{
const pricereviewCheck = () => {
return {
init(){
this.elevators = elevators
@ -920,8 +917,8 @@ const pricereviewCheck = ()=>{
if(option.option_relate_spec == elevator.item_no){
elevator.optionsTotalPrice += option.option_mi * option.item_qty
this.elevators[idx].options.push({
'id': option.id, //&amp;lt;br&amp;gt;()
'item_spec': option.item_spec.trim().replaceAll('&amp;', '').replaceAll('lt;', '').replaceAll('br', '').replaceAll('gt;', '').replaceAll('()', ''),
'id': option.id,
'item_spec': option.item_spec.trim(),
'item_unit_price': option.item_unit_price,
'item_qty': option.item_qty,
'mi': Math.round(option.option_mi),
@ -930,11 +927,11 @@ const pricereviewCheck = ()=>{
}
})
this.otherOptions.forEach(option=>{
if(option.option_relate_spec == elevator.item_no){
this.otherOptions.forEach(option => {
if (option.option_relate_spec == elevator.item_no) {
elevator.otherOptionsTotalPrice += option.item_unit_price * option.item_qty
this.elevators[idx].otherOptions.push({
'id': option.id,
'id': option.id,
'item_spec': option.item_spec.trim(),
'item_unit_price': option.item_unit_price,
'item_qty': option.item_qty,
@ -943,8 +940,8 @@ const pricereviewCheck = ()=>{
}
})
this.maintainOptions.forEach(option=>{
if(option.option_relate_spec == elevator.item_no){
this.maintainOptions.forEach(option => {
if (option.option_relate_spec == elevator.item_no) {
elevator.maintainOptionsTotalPrice += option.item_unit_price * option.item_qty
this.elevators[idx].maintainOptions.push({
'id': option.id,
@ -976,14 +973,14 @@ const pricereviewCheck = ()=>{
let stop = model.split('-')[1].split('*')[1].split('-')[0];
let open = model.split('-')[2];
let speed = '';
for(let i=0;i<this.openFn.length;i++){
if(open.includes(this.openFn[i])){
for (let i = 0; i < this.openFn.length; i++) {
if (open.includes(this.openFn[i])) {
speed = open.replace(this.openFn[i], '')
open = this.openFn[i];
break;
}
}
this.getElevatorMi(idx, spec, person, stop, open, speed, elevator.item_weight)
});
@ -1022,22 +1019,22 @@ const pricereviewCheck = ()=>{
'add_price':0,
}
}
console.log(this.elevators[idx]);
}catch (error) {
} catch (error) {
console.error("Error fetching elevator price:", error);
}
},
isNotfoundMi:false,
openFn:[
isNotfoundMi: false,
openFn: [
'CO', '2S', '2U', '4PCO', '6PCO'
],
sign1:'',
sign2:'',
sign3:'',
sign4:'',
sign1: '',
sign2: '',
sign3: '',
sign4: '',
is_renovate: false,
elevators_total_price: 0,
contractno: contractno,
@ -1057,25 +1054,24 @@ const pricereviewCheck = ()=>{
memo: memo,
qty: 0,
pays: pays,
elevators:[],
elevators: [],
options: [],
otherOptions: [],
maintainOptions: [],
demolishOptions:[],
mid: mid,
user_id: user_id,
reviewcomment:'',
optionsTotalPrice(){
optionsTotalPrice() {
return this.options.reduce((total, option) => {
return total + (option.item_qty * option.item_unit_price);
}, 0);
},
otherOptionsTotalPrice(){
otherOptionsTotalPrice() {
return this.otherOptions.reduce((total, option) => {
return total + (option.item_qty * option.item_unit_price);
}, 0);
},
maintainOptionsTotalPrice(){
maintainOptionsTotalPrice() {
return this.maintainOptions.reduce((total, option) => {
return total + (option.item_qty * option.item_unit_price);
}, 0);
@ -1087,7 +1083,7 @@ const pricereviewCheck = ()=>{
},
totalScale(){
return this.pays.reduce((total, option) => {
return total + Number(option.pay_scale );
return total + Number(option.pay_scale);
}, 0);
},
totalElevatorsPrice(){
@ -1105,10 +1101,9 @@ const pricereviewCheck = ()=>{
form.append('mid', this.mid);
form.append('result', status);
form.append('user_id', this.user_id);
form.append('reviewcomment', this.reviewcomment);
axios.post('./api/postPricereviewSign.php', form).then(res=>{
axios.post('./api/postPricereviewSign.php', form).then(res => {
console.log(res.data);
if(res.data == 1){
if (res.data == 1) {
alert("簽核成功!");
window.location.reload()
}
@ -1120,5 +1115,6 @@ const pricereviewCheck = ()=>{
const res = await axios.get('./api/getUsername.php', {params: {user_id: user_id}})
return res.data ;
},
}
}

190
wms/mkt/css/pricereview.css

@ -1,34 +1,58 @@
#pricereviewCreate input[type=text], #pricereviewCreate input[type=number], #pricereviewCreate select {
#pricereviewCreate input[type=text],
#pricereviewCreate input[type=number],
#pricereviewCreate select {
margin: 1px;
}
#pricereviewCreate textarea {
resize: vertical;
}
#pricereviewCreate > .modal {
#pricereviewCreate>.modal {
padding: 20px;
}
#pricereviewCreate > .modal table, #pricereviewCreate > .modal th, #pricereviewCreate > .modal td {
#pricereviewCreate>.modal table,
#pricereviewCreate>.modal th,
#pricereviewCreate>.modal td {
border: 1px #ccc solid;
}
#pricereviewCreate > .modal table > thead tr th {
#pricereviewCreate>.modal table>thead tr th {
color: #A52A2A;
}
#pricereviewCreate > .modal table > tbody .selected {
#pricereviewCreate>.modal table>tbody .selected {
background-color: #E7FEFB;
}
#pricereviewCreate .container table, #pricereviewCreate .container th, #pricereviewCreate .container td {
#pricereviewCreate .container table,
#pricereviewCreate .container th,
#pricereviewCreate .container td {
border: 1px #ccc solid;
padding: 15px;
}
#pricereviewCreate .container table.noborder, #pricereviewCreate .container table .noborder th, #pricereviewCreate .container table .noborder td, #pricereviewCreate .container th.noborder, #pricereviewCreate .container th .noborder th, #pricereviewCreate .container th .noborder td, #pricereviewCreate .container td.noborder, #pricereviewCreate .container td .noborder th, #pricereviewCreate .container td .noborder td {
#pricereviewCreate .container table.noborder,
#pricereviewCreate .container table .noborder th,
#pricereviewCreate .container table .noborder td,
#pricereviewCreate .container th.noborder,
#pricereviewCreate .container th .noborder th,
#pricereviewCreate .container th .noborder td,
#pricereviewCreate .container td.noborder,
#pricereviewCreate .container td .noborder th,
#pricereviewCreate .container td .noborder td {
border: none;
}
#pricereviewCreate .container table thead th {
background-color: #6D9EEB;
}
#pricereviewCreate .container table tbody td input {
font-size: 14px;
}
#pricereviewCreate .container table tbody th {
background-color: #CCE4F8;
font-size: 14px;
@ -36,15 +60,18 @@
min-width: 100px;
text-align: center;
}
#pricereviewCreate .container table input {
font-size: 13px;
}
#pricereviewCreate .container .pricreviewmain {
background-color: #F2F2F2;
padding: 20px;
border-radius: 6px;
margin: 30px 0;
}
#pricereviewCreate .container .pricreviewmain button {
color: #fff;
width: 55px;
@ -54,60 +81,89 @@
margin-bottom: 2px;
font-size: 13px;
}
#pricereviewCreate .container .pricreviewmain button.addbtn {
background-color: #337AB7;
width: 30px;
}
#pricereviewCreate .container .pricreviewmain button.deleteBtn {
background-color: #D9534F;
color: #fff;
font-size: 12px;
width: 30px;
}
#pricereviewCreate .container .pricreviewmain button.selectElevator {
background-color: #D9534F;
color: #fff;
}
#pricereviewCreate .container .pricreviewmain > .divitem {
#pricereviewCreate .container .pricreviewmain>.divitem {
border: 1px #ccc solid;
padding: 10px;
border-radius: 4px;
}
#pricereviewCreate .container .pricreviewmain > .divitem .title {
#pricereviewCreate .container .pricreviewmain>.divitem .title {
display: flex;
align-items: center;
border-bottom: 1px #ccc solid;
padding: 10px 0;
margin-bottom: 10px;
}
#pricereviewCreate .container .pricreviewmain > .divitem .title h6 {
#pricereviewCreate .container .pricreviewmain>.divitem .title h6 {
font-weight: 600;
}
#pricereviewCreate .container .pricreviewmain > .divitem table, #pricereviewCreate .container .pricreviewmain > .divitem th, #pricereviewCreate .container .pricreviewmain > .divitem td {
#pricereviewCreate .container .pricreviewmain>.divitem table,
#pricereviewCreate .container .pricreviewmain>.divitem th,
#pricereviewCreate .container .pricreviewmain>.divitem td {
font-size: 14px;
background-color: transparent;
}
#pricereviewCreate .container .pricreviewmain > .divitem table input, #pricereviewCreate .container .pricreviewmain > .divitem table select, #pricereviewCreate .container .pricreviewmain > .divitem table textarea, #pricereviewCreate .container .pricreviewmain > .divitem th input, #pricereviewCreate .container .pricreviewmain > .divitem th select, #pricereviewCreate .container .pricreviewmain > .divitem th textarea, #pricereviewCreate .container .pricreviewmain > .divitem td input, #pricereviewCreate .container .pricreviewmain > .divitem td select, #pricereviewCreate .container .pricreviewmain > .divitem td textarea {
#pricereviewCreate .container .pricreviewmain>.divitem table input,
#pricereviewCreate .container .pricreviewmain>.divitem table select,
#pricereviewCreate .container .pricreviewmain>.divitem table textarea,
#pricereviewCreate .container .pricreviewmain>.divitem th input,
#pricereviewCreate .container .pricreviewmain>.divitem th select,
#pricereviewCreate .container .pricreviewmain>.divitem th textarea,
#pricereviewCreate .container .pricreviewmain>.divitem td input,
#pricereviewCreate .container .pricreviewmain>.divitem td select,
#pricereviewCreate .container .pricreviewmain>.divitem td textarea {
font-size: 13px;
}
#pricereviewCreate .container .pricreviewmain > .divitem table input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain > .divitem table input[type=number]::-webkit-inner-spin-button, #pricereviewCreate .container .pricreviewmain > .divitem th input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain > .divitem th input[type=number]::-webkit-inner-spin-button, #pricereviewCreate .container .pricreviewmain > .divitem td input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain > .divitem td input[type=number]::-webkit-inner-spin-button {
#pricereviewCreate .container .pricreviewmain>.divitem table input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain>.divitem table input[type=number]::-webkit-inner-spin-button,
#pricereviewCreate .container .pricreviewmain>.divitem th input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain>.divitem th input[type=number]::-webkit-inner-spin-button,
#pricereviewCreate .container .pricreviewmain>.divitem td input[type=number]::-webkit-outer-spin-button,
#pricereviewCreate .container .pricreviewmain>.divitem td input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
#pricereviewCreate .container .pricreviewmain > .divitem table tr:hover .deleteBtn, #pricereviewCreate .container .pricreviewmain > .divitem table tr:hover .copyBtn {
#pricereviewCreate .container .pricreviewmain>.divitem table tr:hover .deleteBtn,
#pricereviewCreate .container .pricreviewmain>.divitem table tr:hover .copyBtn {
opacity: 1;
}
<<<<<<< HEAD
#pricereviewCreate .container .pricreviewmain > .divitem table .copyBtn {
width: 30px;
height: 30px;
}
#pricereviewCreate .container .pricreviewmain > .divitem table .saletd {
=======
#pricereviewCreate .container .pricreviewmain>.divitem table .saletd {
>>>>>>> 3ca7276d197f3d77f11e3719294215e04a32dc62
position: relative;
}
#pricereviewCreate .container .pricreviewmain > .divitem table .saletd > .deleteBtn {
#pricereviewCreate .container .pricreviewmain>.divitem table .saletd>.deleteBtn {
position: absolute;
top: 50%;
transform: translateY(-50%);
@ -115,7 +171,8 @@
opacity: 0;
transition: 0.3s;
}
#pricereviewCreate .container .pricreviewmain > .divitem table .saletd > .copyBtn {
#pricereviewCreate .container .pricreviewmain>.divitem table .saletd>.copyBtn {
position: absolute;
top: 50%;
transform: translateY(-50%);
@ -125,29 +182,35 @@
width: 30px;
height: 30px;
}
#pricereviewCreate .container .pricreviewmain > .divitem table textarea {
#pricereviewCreate .container .pricreviewmain>.divitem table textarea {
height: auto;
min-height: 50px;
}
#pricereviewCreate .container .pricreviewmain > .filediv {
#pricereviewCreate .container .pricreviewmain>.filediv {
display: flex;
flex-direction: column;
margin-top: 20px;
}
#pricereviewCreate .container .pricreviewmain > .filediv label {
#pricereviewCreate .container .pricreviewmain>.filediv label {
display: flex;
align-items: center;
margin: 10px 0;
}
#pricereviewCreate .container .pricreviewmain > .filediv label p {
#pricereviewCreate .container .pricreviewmain>.filediv label p {
width: 100px;
font-size: 15px;
font-weight: 600;
}
#pricereviewCreate .container .pricreviewmain > .filediv label input[type=file] {
#pricereviewCreate .container .pricreviewmain>.filediv label input[type=file] {
width: 400px;
}
#pricereviewCreate .container .pricreviewmain > .filediv label button {
#pricereviewCreate .container .pricreviewmain>.filediv label button {
width: 90px;
height: 35px;
margin: 0;
@ -155,14 +218,19 @@
margin-top: 20px;
}
.container-fluid, .container {
.container-fluid,
.container {
max-width: 1400px !important;
width: 100%;
}
.container-fluid h4, .container h4 {
.container-fluid h4,
.container h4 {
font-weight: 600;
}
.container-fluid .btn-secondary, .container .btn-secondary {
.container-fluid .btn-secondary,
.container .btn-secondary {
background-color: #6C757D;
}
@ -177,39 +245,51 @@
padding: 20px;
display: none;
}
@keyframes fade-in {
0% {
transform: translate(-50%, -60%);
opacity: 0;
}
100% {
transform: translate(-50%, -55%);
opacity: 1;
}
}
.window-modal table, .window-modal th, .window-modal td {
.window-modal table,
.window-modal th,
.window-modal td {
border: 1px #ccc solid;
}
.window-modal table > thead tr th {
.window-modal table>thead tr th {
color: #A52A2A;
}
.window-modal table > tbody .selected {
.window-modal table>tbody .selected {
background-color: #E7FEFB;
}
.window-modal#optionModal .window-modal-content {
max-height: 80vh;
}
.window-modal#optionModal .window-modal-content .window-modal-body {
height: 400px;
overflow-y: scroll;
}
.window-modal#toElevatorModal .window-modal-content {
min-height: 270px;
height: auto;
}
.window-modal#toElevatorModal .window-modal-content .window-modal-body {
height: auto;
}
.window-modal .window-modal-content {
z-index: 9;
background-color: #fff;
@ -223,19 +303,24 @@
box-shadow: 0 5px 5px #222;
animation: fade-in 0.2s linear;
}
.window-modal .window-modal-content.modal-xl {
max-width: 1200px;
}
.window-modal .window-modal-content.modal-lg {
max-width: 800px;
}
.window-modal .window-modal-content.modal-m {
max-width: 450px;
}
.window-modal .window-modal-content .window-modal-header {
display: flex;
flex-direction: column;
}
.window-modal .window-modal-content .window-modal-header button.btn-close {
position: absolute;
top: 10px;
@ -245,9 +330,11 @@
outline: none;
border-radius: 50%;
}
.window-modal .window-modal-content .window-modal-header > div > input {
.window-modal .window-modal-content .window-modal-header>div>input {
width: 250px;
}
.window-modal .window-back {
position: absolute;
top: 0;
@ -257,45 +344,60 @@
background-color: transparent;
}
#pricereviewCheck > .container {
#pricereviewCheck>.container {
background-color: #F2F2F2;
border-radius: 15px;
padding: 20px;
}
#pricereviewCheck > .container textarea {
#pricereviewCheck>.container textarea {
resize: vertical;
}
#pricereviewCheck > .container table, #pricereviewCheck > .container th, #pricereviewCheck > .container td {
#pricereviewCheck>.container table,
#pricereviewCheck>.container th,
#pricereviewCheck>.container td {
border: 1px #ccc solid;
}
#pricereviewCheck > .container table.noborder {
#pricereviewCheck>.container table.noborder {
border: none !important;
}
#pricereviewCheck > .container table.noborder th, #pricereviewCheck > .container table.noborder td {
#pricereviewCheck>.container table.noborder th,
#pricereviewCheck>.container table.noborder td {
border: none !important;
}
#pricereviewCheck > .container .customerinfo-table input {
#pricereviewCheck>.container .customerinfo-table input {
background-color: #EEE5E5;
}
#pricereviewCheck > .container .mi-table th {
#pricereviewCheck>.container .mi-table th {
font-weight: 600;
}
#pricereviewCheck > .container .mi-table input[type=text] {
#pricereviewCheck>.container .mi-table input[type=text] {
background-color: #EEEEEE;
cursor: not-allowed;
padding: 6px 12px;
font-size: 14px;
}
#pricereviewCheck > .container .mi-table .mi-info {
#pricereviewCheck>.container .mi-table .mi-info {
font-size: 14px;
}
#pricereviewCheck > .container .mi-table .mi-info span {
#pricereviewCheck>.container .mi-table .mi-info span {
font-size: 15px;
font-weight: 600;
}
#pricereviewCheck > .container .mi-table .mi-info .line {
#pricereviewCheck>.container .mi-table .mi-info .line {
width: 100%;
height: 0.5px;
margin: 30px 0;
background-color: #ccc;
}/*# sourceMappingURL=pricereview.css.map */
}
/*# sourceMappingURL=pricereview.css.map */

15
wms/mkt/css/pricereview.css.map

@ -1 +1,14 @@
{"version":3,"sources":["pricereview.scss","pricereview.css"],"names":[],"mappings":"AACI;EACI,WAAA;ACAR;ADEI;EACI,gBAAA;ACAR;ADEI;EACI,aAAA;ACAR;ADCQ;EACI,sBAAA;ACCZ;ADCQ;EACI,cAAA;ACCZ;ADCQ;EACI,yBAAA;ACCZ;ADKQ;EACI,sBAAA;EACA,aAAA;ACHZ;ADIY;EACI,YAAA;ACFhB;ADMY;EACI,yBAAA;ACJhB;ADOgB;EACI,eAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,kBAAA;ACLpB;ADQY;EACI,eAAA;ACNhB;ADSQ;EACI,yBAAA;EACA,aAAA;EACA,kBAAA;EACA,cAAA;ACPZ;ADQY;EACI,WAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;ACNhB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;EACA,eAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADSY;EACI,sBAAA;EACA,aAAA;EACA,kBAAA;ACPhB;ADQgB;EACI,aAAA;EACA,mBAAA;EACA,6BAAA;EACA,eAAA;EACA,mBAAA;ACNpB;ADOoB;EACI,gBAAA;ACLxB;ADSgB;EACI,eAAA;EACA,6BAAA;ACPpB;ADQoB;EACI,eAAA;ACNxB;ADQoB;;;;EAEA,wBAAA;EACA,SAAA;ACJpB;ADQoB;EACI,UAAA;ACNxB;ADQoB;EACI,WAAA;EACA,YAAA;ACNxB;ADQoB;EACI,kBAAA;ACNxB;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,UAAA;EACA,UAAA;EACA,gBAAA;ACL5B;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,WAAA;EACA,UAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;ACL5B;ADQoB;EACI,YAAA;EACA,gBAAA;ACNxB;ADUY;EACI,aAAA;EACA,sBAAA;EACA,gBAAA;ACRhB;ADSgB;EACI,aAAA;EACA,mBAAA;EACA,cAAA;ACPpB;ADQoB;EACI,YAAA;EACA,eAAA;EACA,gBAAA;ACNxB;ADQoB;EACI,YAAA;ACNxB;ADQoB;EACI,WAAA;EACA,YAAA;EACA,SAAA;EACA,kBAAA;EACA,gBAAA;ACNxB;;ADcA;EACI,4BAAA;EACA,WAAA;ACXJ;ADYI;EACI,gBAAA;ACVR;ADYI;EACI,yBAAA;ACVR;;ADcA;EACI,eAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,oCAAA;EACA,UAAA;EACA,aAAA;EACA,aAAA;ACXJ;ADYI;EACI;IACI,gCAAA;IACA,UAAA;ECVV;EDYM;IACI,gCAAA;IACA,UAAA;ECVV;AACF;ADYI;EACI,sBAAA;ACVR;ADYI;EACI,cAAA;ACVR;ADYI;EACI,yBAAA;ACVR;ADYI;EACI,gBAAA;ACVR;ADWQ;EACI,aAAA;EACA,kBAAA;ACTZ;ADYI;EACI,iBAAA;EACA,YAAA;ACVR;ADWQ;EACI,YAAA;ACTZ;ADYI;EACI,UAAA;EACA,sBAAA;EACA,mBAAA;EACA,kBAAA;EACA,UAAA;EACA,aAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,0BAAA;EACA,8BAAA;ACVR;ADWQ;EACI,iBAAA;ACTZ;ADWQ;EACI,gBAAA;ACTZ;ADWQ;EACI,gBAAA;ACTZ;ADWQ;EACI,aAAA;EACA,sBAAA;ACTZ;ADUY;EACI,kBAAA;EACA,SAAA;EACA,WAAA;EACA,6BAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;ACRhB;ADUY;EACI,YAAA;ACRhB;ADYI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;ACVR;;ADeI;EACI,yBAAA;EACA,mBAAA;EACA,aAAA;ACZR;ADaQ;EACI,gBAAA;ACXZ;ADaQ;EACI,sBAAA;ACXZ;ADaQ;EACI,uBAAA;ACXZ;ADYY;EACI,uBAAA;ACVhB;ADcY;EACI,yBAAA;ACZhB;ADgBY;EACI,gBAAA;ACdhB;ADgBY;EACI,yBAAA;EACA,mBAAA;EACA,iBAAA;EACA,eAAA;ACdhB;ADgBY;EACI,eAAA;ACdhB;ADegB;EACI,eAAA;EACA,gBAAA;ACbpB;ADegB;EACI,WAAA;EACA,aAAA;EACA,cAAA;EACA,sBAAA;ACbpB","file":"pricereview.css"}
<<<<<<< HEAD
{"version":3,"sources":["pricereview.scss","pricereview.css"],"names":[],"mappings":"AACI;EACI,WAAA;ACAR;ADEI;EACI,gBAAA;ACAR;ADEI;EACI,aAAA;ACAR;ADCQ;EACI,sBAAA;ACCZ;ADCQ;EACI,cAAA;ACCZ;ADCQ;EACI,yBAAA;ACCZ;ADKQ;EACI,sBAAA;EACA,aAAA;ACHZ;ADIY;EACI,YAAA;ACFhB;ADMY;EACI,yBAAA;ACJhB;ADOgB;EACI,eAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,kBAAA;ACLpB;ADQY;EACI,eAAA;ACNhB;ADSQ;EACI,yBAAA;EACA,aAAA;EACA,kBAAA;EACA,cAAA;ACPZ;ADQY;EACI,WAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;ACNhB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;EACA,eAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADSY;EACI,sBAAA;EACA,aAAA;EACA,kBAAA;ACPhB;ADQgB;EACI,aAAA;EACA,mBAAA;EACA,6BAAA;EACA,eAAA;EACA,mBAAA;ACNpB;ADOoB;EACI,gBAAA;ACLxB;ADSgB;EACI,eAAA;EACA,6BAAA;ACPpB;ADQoB;EACI,eAAA;ACNxB;ADQoB;;;;EAEA,wBAAA;EACA,SAAA;ACJpB;ADQoB;EACI,UAAA;ACNxB;ADQoB;EACI,WAAA;EACA,YAAA;ACNxB;ADQoB;EACI,kBAAA;ACNxB;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,UAAA;EACA,UAAA;EACA,gBAAA;ACL5B;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,WAAA;EACA,UAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;ACL5B;ADQoB;EACI,YAAA;EACA,gBAAA;ACNxB;ADUY;EACI,aAAA;EACA,sBAAA;EACA,gBAAA;ACRhB;ADSgB;EACI,aAAA;EACA,mBAAA;EACA,cAAA;ACPpB;ADQoB;EACI,YAAA;EACA,eAAA;EACA,gBAAA;ACNxB;ADQoB;EACI,YAAA;ACNxB;ADQoB;EACI,WAAA;EACA,YAAA;EACA,SAAA;EACA,kBAAA;EACA,gBAAA;ACNxB;;ADcA;EACI,4BAAA;EACA,WAAA;ACXJ;ADYI;EACI,gBAAA;ACVR;ADYI;EACI,yBAAA;ACVR;;ADcA;EACI,eAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,oCAAA;EACA,UAAA;EACA,aAAA;EACA,aAAA;ACXJ;ADYI;EACI;IACI,gCAAA;IACA,UAAA;ECVV;EDYM;IACI,gCAAA;IACA,UAAA;ECVV;AACF;ADYI;EACI,sBAAA;ACVR;ADYI;EACI,cAAA;ACVR;ADYI;EACI,yBAAA;ACVR;ADYI;EACI,gBAAA;ACVR;ADWQ;EACI,aAAA;EACA,kBAAA;ACTZ;ADYI;EACI,iBAAA;EACA,YAAA;ACVR;ADWQ;EACI,YAAA;ACTZ;ADYI;EACI,UAAA;EACA,sBAAA;EACA,mBAAA;EACA,kBAAA;EACA,UAAA;EACA,aAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,0BAAA;EACA,8BAAA;ACVR;ADWQ;EACI,iBAAA;ACTZ;ADWQ;EACI,gBAAA;ACTZ;ADWQ;EACI,gBAAA;ACTZ;ADWQ;EACI,aAAA;EACA,sBAAA;ACTZ;ADUY;EACI,kBAAA;EACA,SAAA;EACA,WAAA;EACA,6BAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;ACRhB;ADUY;EACI,YAAA;ACRhB;ADYI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;ACVR;;ADeI;EACI,yBAAA;EACA,mBAAA;EACA,aAAA;ACZR;ADaQ;EACI,gBAAA;ACXZ;ADaQ;EACI,sBAAA;ACXZ;ADaQ;EACI,uBAAA;ACXZ;ADYY;EACI,uBAAA;ACVhB;ADcY;EACI,yBAAA;ACZhB;ADgBY;EACI,gBAAA;ACdhB;ADgBY;EACI,yBAAA;EACA,mBAAA;EACA,iBAAA;EACA,eAAA;ACdhB;ADgBY;EACI,eAAA;ACdhB;ADegB;EACI,eAAA;EACA,gBAAA;ACbpB;ADegB;EACI,WAAA;EACA,aAAA;EACA,cAAA;EACA,sBAAA;ACbpB","file":"pricereview.css"}
=======
{
"version": 3,
"sources": [
"pricereview.scss",
"pricereview.css"
],
"names": [],
"mappings": "AACI;EACI,WAAA;ACAR;ADEI;EACI,gBAAA;ACAR;ADEI;EACI,aAAA;ACAR;ADCQ;EACI,sBAAA;ACCZ;ADCQ;EACI,cAAA;ACCZ;ADCQ;EACI,yBAAA;ACCZ;ADKQ;EACI,sBAAA;EACA,aAAA;ACHZ;ADIY;EACI,YAAA;ACFhB;ADMY;EACI,yBAAA;ACJhB;ADOgB;EACI,eAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,kBAAA;ACLpB;ADQY;EACI,eAAA;ACNhB;ADSQ;EACI,yBAAA;EACA,aAAA;EACA,kBAAA;EACA,cAAA;ACPZ;ADQY;EACI,WAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,iBAAA;EACA,eAAA;ACNhB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;EACA,eAAA;EACA,WAAA;ACLpB;ADOgB;EACI,yBAAA;EACA,WAAA;ACLpB;ADSY;EACI,sBAAA;EACA,aAAA;EACA,kBAAA;ACPhB;ADQgB;EACI,aAAA;EACA,mBAAA;EACA,6BAAA;EACA,eAAA;EACA,mBAAA;ACNpB;ADOoB;EACI,gBAAA;ACLxB;ADSgB;EACI,eAAA;EACA,6BAAA;ACPpB;ADQoB;EACI,eAAA;ACNxB;ADQoB;;;;EAEA,wBAAA;EACA,SAAA;ACJpB;ADQoB;EACI,UAAA;ACNxB;ADQoB;EACI,kBAAA;ACNxB;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,UAAA;EACA,UAAA;EACA,gBAAA;ACL5B;ADOwB;EACI,kBAAA;EACA,QAAA;EACA,2BAAA;EACA,WAAA;EACA,UAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;ACL5B;ADQoB;EACI,YAAA;EACA,gBAAA;ACNxB;ADUY;EACI,aAAA;EACA,sBAAA;EACA,gBAAA;ACRhB;ADSgB;EACI,aAAA;EACA,mBAAA;EACA,cAAA;ACPpB;ADQoB;EACI,YAAA;EACA,eAAA;EACA,gBAAA;ACNxB;ADQoB;EACI,YAAA;ACNxB;ADQoB;EACI,WAAA;EACA,YAAA;EACA,SAAA;EACA,kBAAA;EACA,gBAAA;ACNxB;;ADcA;EACI,4BAAA;EACA,WAAA;ACXJ;ADYI;EACI,gBAAA;ACVR;ADYI;EACI,yBAAA;ACVR;;ADcA;EACI,eAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,aAAA;EACA,oCAAA;EACA,UAAA;EACA,aAAA;EACA,aAAA;ACXJ;ADYI;EACI;IACI,gCAAA;IACA,UAAA;ECVV;EDYM;IACI,gCAAA;IACA,UAAA;ECVV;AACF;ADYI;EACI,sBAAA;ACVR;ADYI;EACI,cAAA;ACVR;ADYI;EACI,yBAAA;ACVR;ADYI;EACI,gBAAA;ACVR;ADWQ;EACI,aAAA;EACA,kBAAA;ACTZ;ADYI;EACI,iBAAA;EACA,YAAA;ACVR;ADWQ;EACI,YAAA;ACTZ;ADYI;EACI,UAAA;EACA,sBAAA;EACA,mBAAA;EACA,kBAAA;EACA,aAAA;EACA,aAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,0BAAA;EACA,8BAAA;ACVR;ADWQ;EACI,aAAA;ACTZ;ADWQ;EACI,YAAA;ACTZ;ADWQ;EACI,YAAA;ACTZ;ADWQ;EACI,aAAA;EACA,sBAAA;ACTZ;ADUY;EACI,kBAAA;EACA,SAAA;EACA,WAAA;EACA,6BAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;ACRhB;ADUY;EACI,YAAA;ACRhB;ADYI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;ACVR;;ADeI;EACI,yBAAA;EACA,mBAAA;EACA,aAAA;ACZR;ADaQ;EACI,gBAAA;ACXZ;ADaQ;EACI,sBAAA;ACXZ;ADaQ;EACI,uBAAA;ACXZ;ADYY;EACI,uBAAA;ACVhB;ADcY;EACI,yBAAA;ACZhB;ADgBY;EACI,gBAAA;ACdhB;ADgBY;EACI,yBAAA;EACA,mBAAA;EACA,iBAAA;EACA,eAAA;ACdhB;ADgBY;EACI,eAAA;ACdhB;ADegB;EACI,eAAA;EACA,gBAAA;ACbpB;ADegB;EACI,WAAA;EACA,aAAA;EACA,cAAA;EACA,sBAAA;ACbpB",
"file": "pricereview.css"
}
>>>>>>> 3ca7276d197f3d77f11e3719294215e04a32dc62

324
wms/mkt/css/pricereview.scss

@ -1,41 +1,61 @@
#pricereviewCreate{
input[type='text'], input[type='number'], select{
#pricereviewCreate {
input[type='text'],
input[type='number'],
select {
margin: 1px;
}
textarea{
textarea {
resize: vertical;
}
>.modal{
>.modal {
padding: 20px;
table, th, td{
border:1px #ccc solid;
table,
th,
td {
border: 1px #ccc solid;
}
table > thead tr th{
color:#A52A2A;
table>thead tr th {
color: #A52A2A;
}
table > tbody .selected{
table>tbody .selected {
background-color: #E7FEFB;
}
table > tbody .selected td{
}
table>tbody .selected td {}
}
.container{
table, th, td{
border:1px #ccc solid;
.container {
table,
th,
td {
border: 1px #ccc solid;
padding: 15px;
&.noborder, .noborder th, .noborder td{
border:none;
&.noborder,
.noborder th,
.noborder td {
border: none;
}
}
table{
thead th{
table {
thead th {
background-color: #6D9EEB;
}
tbody {
td input{
td input {
font-size: 14px;
}
th{
th {
background-color: #CCE4F8;
font-size: 14px;
padding: 15px 2px;
@ -43,121 +63,152 @@
text-align: center;
}
}
input{
input {
font-size: 13px;
}
}
.pricreviewmain{
.pricreviewmain {
background-color: #F2F2F2;
padding: 20px;
border-radius: 6px ;
margin:30px 0;
button{
color:#fff;
border-radius: 6px;
margin: 30px 0;
button {
color: #fff;
width: 55px;
height: 30px;
padding: 0;
margin-left: 6px;
margin-bottom: 2px;
font-size: 13px;
&.addbtn{
&.addbtn {
background-color: #337AB7;
width: 30px;
}
&.deleteBtn{
&.deleteBtn {
background-color: #D9534F;
color:#fff;
color: #fff;
font-size: 12px;
width: 30px;
}
&.selectElevator{
&.selectElevator {
background-color: #D9534F;
color:#fff;
color: #fff;
}
}
>.divitem{
border:1px #ccc solid;
>.divitem {
border: 1px #ccc solid;
padding: 10px;
border-radius: 4px ;
.title{
border-radius: 4px;
.title {
display: flex;
align-items: center;
border-bottom: 1px #ccc solid;
padding: 10px 0;
margin-bottom: 10px;
h6{
h6 {
font-weight: 600;
}
}
table, th, td{
table,
th,
td {
font-size: 14px;
background-color: transparent;
input, select, textarea{
input,
select,
textarea {
font-size: 13px;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
-webkit-appearance: none;
margin: 0;
}
}
table {
tr:hover .deleteBtn ,tr:hover .copyBtn{
tr:hover .deleteBtn,
tr:hover .copyBtn {
opacity: 1;
}
<<<<<<< HEAD
.copyBtn{
width: 30px;
height: 30px;
}
.saletd{
=======
.saletd {
>>>>>>> 3ca7276d197f3d77f11e3719294215e04a32dc62
position: relative;
>.deleteBtn{
>.deleteBtn {
position: absolute;
top: 50%;
transform: translateY(-50%);
right:2px;
right: 2px;
opacity: 0;
transition: .3s;
}
>.copyBtn{
>.copyBtn {
position: absolute;
top: 50%;
transform: translateY(-50%);
right:38px;
right: 38px;
opacity: 0;
transition: .3s;
width: 30px;
height: 30px;
}
}
textarea{
textarea {
height: auto;
min-height: 50px;
}
}
}
>.filediv{
>.filediv {
display: flex;
flex-direction: column;
margin-top: 20px;
label{
label {
display: flex;
align-items: center;
margin:10px 0;
p{
width:100px;
margin: 10px 0;
p {
width: 100px;
font-size: 15px;
font-weight: 600;
}
input[type="file"]{
width:400px
input[type="file"] {
width: 400px
}
button{
width:90px;
button {
width: 90px;
height: 35px;
margin:0;
margin: 0;
margin-right: 15px;
margin-top: 20px;
}
@ -167,72 +218,73 @@
}
}
.container-fluid, .container{
max-width:1400px !important;
.container-fluid,
.container {
max-width: 1400px !important;
width: 100%;
h4{
h4 {
font-weight: 600;
}
.btn-secondary{
.btn-secondary {
background-color: #6C757D;
}
}
.window-modal{
.window-modal {
position: fixed;
top: 0;
left:0;
left: 0;
width: 100%;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
z-index: 9;
padding: 20px;
display: none;
@keyframes fade-in {
0%{
transform: translate(-50%, -60%);
0% {
transform: translate(-50%, -55%);
opacity: 0;
}
100%{
transform: translate(-50%, -55%);
100% {
transform: translate(-50%, -50%);
opacity: 1;
}
}
table, th, td{
border:1px #ccc solid;
table,
th,
td {
border: 1px #ccc solid;
}
table > thead tr th{
color:#A52A2A;
table>thead tr th {
color: #A52A2A;
}
table > tbody .selected{
table>tbody .selected {
background-color: #E7FEFB;
}
&#optionModal .window-modal-content{
max-height: 80vh;
.window-modal-body{
height: 400px;
overflow-y: scroll;
}
}
&#toElevatorModal .window-modal-content{
min-height: 270px;
height: auto;
.window-modal-body{
height: auto;
}
}
.window-modal-content{
z-index: 9;
.window-modal-content {
background-color: #fff;
border-radius: 10px;
position: absolute;
<<<<<<< HEAD
width:90%;
=======
width: 1200px;
>>>>>>> 3ca7276d197f3d77f11e3719294215e04a32dc62
padding: 30px;
top: 50%;
left:50%;
transform: translate(-50%, -55%);
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 5px 5px #222;
animation: fade-in .2s linear;
<<<<<<< HEAD
&.modal-xl{
max-width:1200px;
}
@ -241,80 +293,106 @@
}
&.modal-m{
max-width:450px;
=======
&.modal-xl {
width: 1200px;
}
.window-modal-header{
&.modal-lg {
width: 800px;
}
&.modal-m {
width: 400px;
>>>>>>> 3ca7276d197f3d77f11e3719294215e04a32dc62
}
.window-modal-header {
display: flex;
flex-direction: column;
button.btn-close{
button.btn-close {
position: absolute;
top: 10px;
right:10px;
right: 10px;
background-color: transparent;
border:none;
border: none;
outline: none;
border-radius: 50%;
}
>div > input{
>div>input {
width: 250px;
}
}
}
.window-back{
position: absolute;
top: 0;
left:0;
width: 100%;
height: 100%;
background-color: transparent;
.window-modal-body {
overflow-y: scroll;
height: 400px;
}
}
}
#pricereviewCheck{
>.container{
#pricereviewCheck {
>.container {
background-color: #F2F2F2;
border-radius: 15px;
padding: 20px;
textarea{
textarea {
resize: vertical;
}
table, th, td{
border:1px #ccc solid;
table,
th,
td {
border: 1px #ccc solid;
}
table.noborder{
border:none !important;
th ,td{
border:none !important;
table.noborder {
border: none !important;
th,
td {
border: none !important;
}
}
.customerinfo-table{
input{
.customerinfo-table {
input {
background-color: #EEE5E5;
}
}
.mi-table{
th{
.mi-table {
th {
font-weight: 600;
}
input[type=text]{
input[type=text] {
background-color: #EEEEEE;
cursor: not-allowed;
padding: 6px 12px;
font-size: 14px;
}
.mi-info{
.mi-info {
font-size: 14px;
span{
span {
font-size: 15px;
font-weight: 600;
}
.line{
.line {
width: 100%;
height: .5px;
margin:30px 0;
margin: 30px 0;
background-color: #ccc;
}
}
}
}
}

195
wms/mkt/pricereviewMaintainCreate.php

@ -0,0 +1,195 @@
<?php
include_once('../header.php');
require_once('./conn.php');
$vol_no = empty($_GET['vol_no']) ? '' : $_GET['vol_no'];
// 有望客戶
$sql = "SELECT a.*,b.content FROM hope_contract_customer AS a
LEFT JOIN code AS b ON a.source = b.code_name
WHERE a.vol_no = '$vol_no' AND b.field_name = 'customer_source'
";
$stmt = $conn->prepare($sql);
// $stmt->bindParam(':vol_no', $vol_no);
$stmt->execute();
$hope_contract = $stmt->fetch(PDO::FETCH_ASSOC);
$hope_customer_status = [
'A' => '有望簽約(已報價)',
'B' => '觀望考慮(等待時機報價)',
'C' => '在途合約',
'D' => '已簽約',
'N' => '無望簽約',
];
$salename = $hope_contract['salesman'];
$sql = "SELECT * FROM account WHERE accountid = :salename";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':salename', $salename);
$stmt->execute();
$salename = $stmt->fetch(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r($hope_customer_status);
// echo '</pre>';
?>
<link rel="stylesheet" href="./css/pricereview.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.5.0/axios.min.js" integrity="sha512-aoTNnqZcT8B4AmeCFmiSnDlc4Nj/KPaZyB5G7JnOnUEkdNpCZs1LCankiYi01sLTyWy+m2P+W4XM+BuQ3Q4/Dg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script defer src="./assets/js/alpinejs/cdn.min.js"></script>
<script src="./assets/js/pricereviewAlpine.js"></script>
<div id="pricereviewMaintainCreate" x-data=pricereviewMaintainCreate()>
<div class="container">
<table class="table" border="1">
<thead>
<tr class=""></tr>
<th scope="col" class="text-center" colspan=8>有望客戶基本資料</th>
</thead>
<tbody>
<tr>
<th>卷號</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['vol_no'] ?>"></td>
<th>客戶名稱</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['customer'] ?>"></td>
<th>負責人</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['manager'] ?>"></td>
<th>客戶來源</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['content'] ?>"></td>
</tr>
<tr>
<th>地址</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['address'] ?>"></td>
<th>案件名稱</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['customer'] ?>"></td>
<th>市話 / 手機</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['tel'] ?>"></td>
<th>業主方聯繫人</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['linkman'] ?>"></td>
</tr>
<tr>
<th>營業員</th>
<td><input type="text" class="form-control" disabled value="<?= $salename['name'] ?>"></td>
<th>台數</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['num'] ?>"></td>
<th>預定成交日</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_contract['pre_order_date'] ?>"></td>
<th>有望客戶狀態</th>
<td><input type="text" class="form-control" disabled value="<?= $hope_customer_status[$hope_contract['status']] ?>"></td>
</tr>
<tr>
<th>有望客戶狀態</th>
<td><input type="text" class="form-control" disabled value=""></td>
</tr>
</tbody>
</table>
<table class="table" border="1">
<thead>
<tr class=""></tr>
<th scope="col" class="text-center" colspan="8">洽商進度</th>
</thead>
<tbody>
<td colspan=8>
<textarea name="progress" class="form-control" id="progress" cols="20" rows="5" disabled><?= $hope_contract['progress_status'] ?></textarea>
</td>
</tbody>
</table>
<div class="pricreviewmain container">
<div class="divitem">
<div class="title">
<h4>整機單價</h4>
<button class="addbtn btn" x-ref="addElevatorBtn" data-bs-toggle="modal" data-bs-target="#createElevatorModal">+</button>
</div>
<table class="table" border=1>
<thead>
<tr>
<td>項次</td>
<td>電梯</td>
<td>人乘/<br>載重</td>
<td>停數</td>
<td>速度(m/min)</td>
<td>保養月數</td>
<td>保養次數(月)</td>
<td>保養方式</td>
<td>公司發布價(月)</td>
<td>數量</td>
<td>公司發布價(總價)</td>
<td>售價(月)</td>
<td>售價(總價)</td>
</tr>
</thead>
<tbody>
<template x-for="(elevator, idx) in elevator" :key="elevator.id">
<tr>
<td x-text="elevator.id"></td>
<td>
<select name="" id="" class="form-control" x-model="elevator.specifications" @change="getElevatorPrice(idx)">
<option value="">請選擇</option>
<option value="MAE100">MAE100有機房</option>
<option value="MAM200">MAM200無機房</option>
<option value="MAH100">MAH100小電梯</option>
<option value="MAF100">MAE100貨梯(有機房)</option>
<option value="MAQ100">MAQ100強趨梯</option>
<option value="MAP100">MAP100平台梯</option>
</select>
</td>
<td>
<select name="" id="" class="form-control" x-model=elevator.person" @change="getElevatorPrice(idx)">
<option value="">請選擇</option>
<option value="6">6</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="15">15</option>
<option value="17">17</option>
<option value="20">20</option>
<option value="24">24</option>
</select>
</td>
<td>
<input type="number" class="form-control" style="width: 83px;" x-model="elevator.stop" @keyup="getElevatorPrice(idx)" ">
</td>
<td>
<select name="" id="" class=" form-control" x-model="elevator.speed" @change="getElevatorPrice(idx)"></select>
<option value="">請選擇</option>
<option value="9">9</option>
<option value="24">24</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="90">90</option>
<option value="105">105</option>
<option value="120">120</option>
<option value="150">150</option>
</td>
<td>
<input type="number" class="form-control" style="width: 63px;" x-model="maintain_month" @keyup="getElevatorPrice(idx)">
</td>
<td>
<input type="number" class="form-control" style="width: 63px;" x-model="maintain_times" @keyup="getElevatorPrice(idx)">
</td>
<td>
<select name="" id="" class="form-control" style="width: 63px" x-model="maintain_kind" @change="getElevatorPrice(idx)">
<option value="">請選擇</option>
<option value="2">半包</option>
<option value="3">全包</option>
<option value="4">清包</option>
</select>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
const body = document.querySelector('body');
// const elevator = [...<?= json_encode($hope_elevator) ?>];
</script>
Loading…
Cancel
Save