diff --git a/wms/rib02-purReceive-submit.php b/wms/T8-purReceive-submit.php similarity index 96% rename from wms/rib02-purReceive-submit.php rename to wms/T8-purReceive-submit.php index ba87bc27..aa917201 100644 --- a/wms/rib02-purReceive-submit.php +++ b/wms/T8-purReceive-submit.php @@ -1,89 +1,89 @@ - - \ No newline at end of file diff --git a/wms/rib02-purchase-submit.php b/wms/T8-purchase-submit.php similarity index 97% rename from wms/rib02-purchase-submit.php rename to wms/T8-purchase-submit.php index 13f042fa..216b4906 100644 --- a/wms/rib02-purchase-submit.php +++ b/wms/T8-purchase-submit.php @@ -1,89 +1,89 @@ - - \ No newline at end of file diff --git a/wms/T8_Authorization.php b/wms/T8_Authorization.php index a1a756ce..dce65c91 100644 --- a/wms/T8_Authorization.php +++ b/wms/T8_Authorization.php @@ -14,12 +14,13 @@ $sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false); var validation = ""; // var corsurl = 'http://cors-anywhere.herokuapp.com/'; // var apiurl = 'http://60.244.87.101:880//twWebAPI/GetAuth'; - var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth' + // var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth' headerParam = { UserId: 'M0000', Pwd: 'M012290493119', TimestampUTC: = $now ?>, - Sign: '= $sign ?>' + Sign: '= $sign ?>', + GroupId: 'TEST', }; obj = { type: 'get', @@ -30,7 +31,7 @@ $sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false); success: function(res) { validation = res.Data['CHI_Authorization']; console.log(validation); - // console.log(res); + console.log(res); // console.log() // window.parent.postMessage(validation,'http://localhost:3000'); // window.parent.postMessage(validation,'https://masada.com.tw'); @@ -40,4 +41,5 @@ $sign = hash_hmac('SHA256', $data, 'B2D6395D2883E26C', false); jQuery.ajax(obj); // return jQuery.ajax(obj); } + get_Auth(); \ No newline at end of file diff --git a/wms/T8_Authorization_from_bpm.php b/wms/T8_Authorization_from_bpm.php index 3e8708b2..7c206023 100644 --- a/wms/T8_Authorization_from_bpm.php +++ b/wms/T8_Authorization_from_bpm.php @@ -24,11 +24,13 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119") // $apiurl = 'http://10.10.145.2:880//twWebAPI/GetAuth'; // $apiurl = 'https://erp.masada.com.tw:780/twWebAPI/GetAuth'; + //GroupId : TEST測試區 ; MASADA正式區 $headerParam = [ "UserId: $user_id", "Pwd: $user_password", "TimestampUTC: $now", - "Sign: $sign" + "Sign: $sign", + "GroupId: TEST" ]; $ch = curl_init(); @@ -51,4 +53,4 @@ function get_Auth($user_id = "M0000", $user_password = "M012290493119") curl_close($ch); } // $data = []; -// get_Auth(); +get_Auth(); diff --git a/wms/WriteOff.xlsx b/wms/WriteOff.xlsx index 61407291..6bb1cd82 100644 Binary files a/wms/WriteOff.xlsx and b/wms/WriteOff.xlsx differ diff --git a/wms/account-receivable-index-ing.php b/wms/account-receivable-index-ing.php index ced50411..722cc971 100644 --- a/wms/account-receivable-index-ing.php +++ b/wms/account-receivable-index-ing.php @@ -2158,9 +2158,14 @@ include "./footer.php"; //[合約號]['facility'] [作番號][款別]0 款項名稱 1 合約金額 2 應收日期 3 應收金額 4 已收金額 5 催收金額 6 催收次數 ?> - +
合約號 | @@ -2180,7 +2185,7 @@ include "./footer.php"; $value) { ?> -||
---|---|---|
= $key ?> | = $value[1] ?> | = $value[4] ?> | @@ -2246,6 +2251,21 @@ include "./footer.php";
合約號 | +作番號 | +部門 | +主管 | +契約員 | +客戶名稱 | +收款階段 | +應收日期 | +是否應收 | +應收金額 | +已開金額 | +未開金額 | +已收金額 | +催收金額 | +催收次數 | +
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
= $row[0]; ?> | += $row[1]; ?> | += $row[2] . " " . $row[3]; ?> |
+ = $row[4] . " " . $row[5]; ?> |
+ = $row[6] . " " . $row[7]; ?> |
+ = $row[8]; ?> | += $row[12]; ?> | += $row[13]; ?> | += $row[14]; ?> | += $row[15]; ?> | += $row[16]; ?> | += $row[17]; ?> | += $row[18]; ?> | += $row[19]; ?> | += $row[20]; ?> | +
合約號 | -部門 | -經理 | -營業員 | -客戶名稱 | -簽約款 | -應收簽約金額 | -簽約最小催收次數 | -簽約最大催收次數 | -二次款 | -應收二次金額 | -二次最小催收次數 | -二次最大催收次數 | -貨抵工地款 | -應收貨抵工地金額 | -貨抵工地最小催收次數 | -貨抵工地最大催收次數 | -安裝款 | -應收安裝金額 | -安裝最小催收次數 | -安裝最大催收次數 | -試車款 | -應收試車金額 | -試車最小催收次數 | -試車最大催收次數 | -官檢款 | -應收官檢金額 | -官檢最小催收次數 | -官檢最大催收次數 | -移交款 | -應收移交金額 | -移交最小催收次數 | -移交最大催收次數 | -尾款 | -應收尾款金額 | -尾款最小催收次數 | -尾款最大催收次數 | -合約總金額 | -目前應收 | -已開發票金額 | -已收金額 | - -收款狀態 | - +合約號 | +作番號 | +部門 | +主管 | +契約員 | +客戶名稱 | +收款階段 | +應收日期 | +是否應收 | +應收金額 | +已開金額 | +未開金額 | +已收金額 | +催收金額 | +催收次數 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
= $key ?> | -= $value[1] ?> | -= $value[2] ?> | -= $value[4] ?> | -= $value[5] ?> | -= number_format(round($value['sign'][1])) ?> | -= isset($value['sign'][3]) ? number_format(round($value['sign'][3])) : '--' ?> | -= isset($value['sign']['min']) ? $value['sign']['min'] : '--' ?> | -= isset($value['sign']['max']) ? $value['sign']['max'] : '--' ?> | -= isset($value['second'][1]) ? number_format(round($value['second'][1])) : '--' ?> | -= isset($value['second'][3]) ? number_format(round($value['second'][3])) : '--' ?> | -= isset($value['second']['min']) ? $value['second']['min'] : '--' ?> | -= isset($value['second']['max']) ? $value['second']['max'] : '--' ?> | -= isset($value['arrive'][1]) ? number_format(round($value['arrive'][1])) : '--' ?> | -= isset($value['arrive'][3]) ? number_format(round($value['arrive'][3])) : '--' ?> | -= isset($value['arrive']['min']) ? $value['arrive']['min'] : '--' ?> | -= isset($value['arrive']['max']) ? $value['arrive']['max'] : '--' ?> | -= isset($value['install'][1]) ? number_format(round($value['install'][1])) : '--' ?> | -= isset($value['install'][3]) ? number_format(round($value['install'][3])) : '--' ?> | -= isset($value['install']['min']) ? $value['install']['min'] : '--' ?> | -= isset($value['install']['max']) ? $value['install']['max'] : '--' ?> | -= isset($value['tryrun'][1]) ? number_format(round($value['tryrun'][1])) : '--' ?> | -= isset($value['tryrun'][3]) ? number_format(round($value['tryrun'][3])) : '--' ?> | -= isset($value['tryrun']['min']) ? $value['tryrun']['min'] : '--' ?> | -= isset($value['tryrun']['max']) ? $value['tryrun']['max'] : '--' ?> | -= isset($value['check'][1]) ? number_format(round($value['check'][1])) : '--' ?> | -= isset($value['check'][3]) ? number_format(round($value['check'][3])) : '--' ?> | -= isset($value['check']['min']) ? $value['check']['min'] : '--' ?> | -= isset($value['check']['max']) ? $value['check']['max'] : '--' ?> | -= isset($value['delivery'][1]) ? number_format(round($value['delivery'][1])) : '--' ?> | -= isset($value['delivery'][3]) ? number_format(round($value['delivery'][3])) : '--' ?> | -= isset($value['delivery']['min']) ? $value['delivery']['min'] : '--' ?> | -= isset($value['delivery']['max']) ? $value['delivery']['max'] : '--' ?> | -= isset($value['final'][1]) ? number_format(round($value['final'][1])) : '--' ?> | -= isset($value['final'][3]) ? number_format(round($value['final'][3])) : '--' ?> | -= isset($value['final']['min']) ? $value['final']['min'] : '--' ?> | -= isset($value['final']['max']) ? $value['final']['max'] : '--' ?> | -= isset($value['total_budget']) ? number_format(round($value['total_budget'])) : '--' ?> | -= isset($value['receivable_budget']) ? number_format(round($value['receivable_budget'])) : '--' ?> | -= isset($value['invoice_budget']) ? number_format(round($value['invoice_budget'])) : '--' ?> | -= isset($value['received_budget']) ? number_format(round($value['received_budget'])) : '--' ?> | -= $value['facilities'] ?> | - + $row) { ?> +|||||||||||||||
= $row[0]; ?> | += $row[1]; ?> | += $row[2] . " " . $row[3]; ?> |
+ = $row[4] . " " . $row[5]; ?> |
+ = $row[6] . " " . $row[7]; ?> |
+ = $row[8]; ?> | += $row[12]; ?> | += $row[13]; ?> | += $row[14]; ?> | += $row[15]; ?> | += $row[16]; ?> | += $row[17]; ?> | += $row[18]; ?> | += $row[19]; ?> | += $row[20]; ?> |
+ 獎金計算+ |
+ |||||||
合約號 | ++ + | ++ | |||||
+ 獎金確認項+ |
+ + + + | +||||||
合約號 | ++ + | +合約類別 | ++ + | +作番號 | ++ + | + +獎金適用版本 | ++ + | +
獎金發放人員 | ++ + | +保養月份 | ++ + | +保養總額 | ++ + | +||
+ 獎金確認項+ |
+ + + + | +||||||
+ |
營業人員/契約人員 | +合約號 | +標示號 | +電梯編號 | +預計請款日 | +催收次數 | +應收申請單狀態 | +請款金額(未轉應收) | +請款金額(已轉應收) | +應收申請單號 | +發票狀態 | +發票單標示號 | +發票單號 | +發票明細 | +發票金額 | +發票號碼 | +核銷 | + +
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ "; + echo getSalesmanName($link, $row['BillNo']); + ?> + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | ++ + | +
diff --git a/wms/contract/api/T8salIncomeApply.php b/wms/contract/api/T8salIncomeApply.php index 96246a7c..0a3d7698 100644 --- a/wms/contract/api/T8salIncomeApply.php +++ b/wms/contract/api/T8salIncomeApply.php @@ -29,9 +29,7 @@ function T8API($data) echo 'API傳入失敗,' . $result['ErrorMsg']; return $result; } else { - // echo '
'; // print_r($result); - // echo ''; return $result; } } diff --git a/wms/contract/api/postContractData.php b/wms/contract/api/postContractData.php index d9b9f8b8..2a9e082c 100644 --- a/wms/contract/api/postContractData.php +++ b/wms/contract/api/postContractData.php @@ -459,12 +459,12 @@ function T8insert($data, $facilityno) // print_r($elevators['maintainance']); // echo ''; foreach ($elevators as $index => $elevator) { - $type[] = $elevator['maintainance']; - if ($type[$index] == 'A') { + $maintainance_type = $elevator['maintainance']; + if ($maintainance_type == 'A') { $type = 'C3'; - } else if ($type[$index] == 'B') { + } else if ($maintainance_type == 'B') { $type = 'C4'; - } else if ($type[$index] == 'C') { + } else if ($maintainance_type == 'C') { $type = 'C5'; } } @@ -487,7 +487,7 @@ function T8insert($data, $facilityno) $stmt->bindParam(':CreatorId', $user_id); $stmt->execute(); } - + $row = 0; // // 新增電梯數 foreach ($elevators as $index => $elevator) { // echo '
'; @@ -535,23 +535,24 @@ function T8insert($data, $facilityno) // 依每台電梯去加入各個的付款項 for ($i = 0; $i < $IncomeId[$payType]; $i++) { + $row++; // 計算分期款的收款月份 $paymonth = $i * $SQuantity; - $payday = date('Y-m-d', strtotime("$date_1 + $paymonth months")); - + $countDay = date('Y-m-d', strtotime("$date_1 + $paymonth months")); + $payDay = str_replace('-', '', $countDay); $rows_data = [ "BillNo" => "$contractno", "IncomeId" => "$payType", "TaxId" => "ST005", - "RowCode" => $i + 1, - "RowNo" => $i + 1, + "RowCode" => $row, + "RowNo" => $row, "ItemType" => 1, "SPrice" => $elevator['sold_price'], "SQuantity" => $SQuantity, "ProjectId" => "$contractno", "FromSourceTag" => 0, "CU_MaterialId" => "$facilityno[$index]", - "CU_EstPayDate" => "$payday" + "CU_EstPayDate" => "$payDay" ]; $salIncomeApplyDetail_rows[] = $rows_data; } @@ -594,7 +595,8 @@ function T8insert($data, $facilityno) // 呼叫 API $result = T8API($API_body); - if ($result['Status'] == 'Error') { + if ($result['Status'] == 'Error' || $result['Status'] == 'Fails') { + http_response_code(404); die('Error!:' . $result['ErrorMsg']); } diff --git a/wms/contract/api/testT8API.php b/wms/contract/api/testT8API.php index 3718df5d..e7a85071 100644 --- a/wms/contract/api/testT8API.php +++ b/wms/contract/api/testT8API.php @@ -2,13 +2,18 @@ $date = Date('Y-m-d'); $date1 = Date('Y-m-d', strtotime("$date +1 months")); - -$a = 1; -$b = 12 / $a; -for ($i = 0; $i < $b; $i++) { - $c = $i * $a; - $date1 = Date('Y-m-d', strtotime("$date + $c months")); - echo ''; - print_r($date1); - echo ''; +// $countDay = date('Ymd', strtotime("$date1 + 1 months")); +// echo ''; +// print_r($countDay); +// echo ''; +// exit(); +$a = 0; +// $b = 24 / $a; +for ($i = 0; $i < 2; $i++) { + for ($j = 0; $j < 12; $j++) { + $a++; + echo ''; + print_r($a); + echo ''; + } } diff --git a/wms/contract/connt8.php b/wms/contract/connt8.php index 59f2b247..2a40e459 100644 --- a/wms/contract/connt8.php +++ b/wms/contract/connt8.php @@ -4,7 +4,7 @@ include "/Users/LO_2342/Desktop/httpdocs/wms/fun_global.php"; // phpinfo(); // exit(); try { - $connT8 = new PDO("sqlsrv:Server=220.130.203.251;Database=T8TEST", "M0225", "IFFBU1E="); + $connT8 = new PDO("sqlsrv:Server=220.130.203.251;Database=T8masada", "M0225", "IFFBU1E="); if ($connT8) { $connT8->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } diff --git a/wms/contract/connt8_test.php b/wms/contract/connt8_test.php new file mode 100644 index 00000000..a13f85d2 --- /dev/null +++ b/wms/contract/connt8_test.php @@ -0,0 +1,15 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } +} catch (PDOException $e) { + // echo "fail"; + // echo $e->getMessage(); + die("ERROR!!!: " . $e->getMessage()); +} diff --git a/wms/contract/contract-download.php b/wms/contract/contract-download.php index 3693ab7d..3ae40fa2 100644 --- a/wms/contract/contract-download.php +++ b/wms/contract/contract-download.php @@ -24,6 +24,7 @@ if (isset($_GET['id']) && $_GET['id'] != "") { $stmt->bindParam(':id', $id); $stmt->execute(); $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC); + $contract = $contracts[0]; $contract_apply_id = $contract['id']; if (($contract['status'] !== "YY" && $user_id != 'M0107' && $user_id != "TEST02" && $user_id == "TEST01") && $user_id != 'M0174' && $user_id != 'M0225') { @@ -52,7 +53,8 @@ if (isset($_GET['id']) && $_GET['id'] != "") { $install_total_price = 0; // $noteArr = explode(",", $contracts[0]['note']); $noteArr = array(1, 1, 1, 1, 1); - $qty = $contracts[0]['total_items']; + // $qty = $contracts[0]['total_items']; + $qty = 1; foreach ($contracts as $idx => $amount) { $isset = false; if ($amount['pay_kind'] == 5 || $amount['pay_kind'] == 6) { @@ -413,8 +415,8 @@ if (isset($_GET['id']) && $_GET['id'] != "") { - - + + diff --git a/wms/contract/contract-maintainance-management.php b/wms/contract/contract-maintainance-management.php new file mode 100644 index 00000000..c0f94479 --- /dev/null +++ b/wms/contract/contract-maintainance-management.php @@ -0,0 +1,114 @@ +prepare($sql_str); +$stmt->execute(); +$contracts= $stmt->fetchAll(PDO::FETCH_ASSOC); + +?> + + + + + + + + + +