diff --git a/.gitignore b/.gitignore index a344fd2a..44e45c2f 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ wms/gary2.php wms/chinese.php phpinfo.php wms/account_receivable_sql_file.sql +wms/account_receivable_maintainance_sql.sql diff --git a/wms/T8_Authorization_from_bpm.php b/wms/T8_Authorization_from_bpm.php index 42c4f3bd..c3592c3d 100644 --- a/wms/T8_Authorization_from_bpm.php +++ b/wms/T8_Authorization_from_bpm.php @@ -1,6 +1,9 @@ 0) { + $column_str = "('$user_id'" . ",'"; + $column_str .= implode("','", $follower); + $column_str .= "')"; + $sql .= " OR siam.PersonId IN $column_str OR cd.LeaderId = '$user_id')"; + } else { + $sql .= " OR cd.LeaderId = '$user_id')"; + }; +} +if (!is_null($start_date)) { + $start_date = (int)date('Ymd', strtotime($start_date)); + $sql .= " AND siam.CU_ContractStart >= $start_date "; +} +if (!is_null($end_date)) { + $end_date = (int)date('Ymd', strtotime($end_date)); + $sql .= " AND siam.CU_ContractStart <= $end_date "; +} +if (!is_null($start_SignDate)) { + $start_SignDate = (int)date('Ymd', strtotime($start_SignDate)); + $sql .= " AND siam.BillDate >= $start_SignDate "; +} +if (!is_null($end_SignDate)) { + $end_SignDate = (int)date('Ymd', strtotime($end_SignDate)); + $sql .= " AND siam.BillDate <= $end_SignDate "; +} +$sql .= " GROUP BY +siam.PersonId, +cp.PersonName, +cd.DeptId, +cd.DeptName, +cd.LeaderId, +lcp.PersonName, +siam.BizPartnerId, +cbp.BizPartnerName, +siamd.RowCode, +siam.BillNo, +siamd.ProjectId, +siamd.CU_EstPayDate, +siamd.UnTransCheckBLAmtWTax, +siamd.HadTransCheckBLAmtWTax, +siamd.OAmountWithTax, +siamd.CU_MaterialId, +acb_tmp.BillNo2, +acb_tmp.RowCode2, +acb_tmp.checkOAmount, +asim.BillNo, +asim.InvoiceName, +asim.OAmountWithTax, +asi.InvoiceNo, +asi.InvoiceTime, +writeoff.BillDate +ORDER BY +siam.PersonId ASC, +siam.BillNo ASC, +siamd.RowCode ASC"; + +$query_T8 = $conn->query($sql); +$rows = $query_T8->fetchAll(PDO::FETCH_ASSOC); +$today = strtotime(date('Ymt')); +$table = ""; +for ($i = 0; $i < count($rows); $i++) { + $row = $rows[$i]; + $tmpname = $row['ProjectId'] . $row['RowCode']; + $data[$tmpname] = $row; + $data[$tmpname]['CU_EstPayDate'] = date('Y-m-d', strtotime($row['CU_EstPayDate'])); + $data[$tmpname]['havetopay'] = strtotime($row['CU_EstPayDate']) > $today ? '--' : 'V'; + $datahavetopay = $row['CU_EstPayDate'] > $today ? 0 : 1; + $data[$tmpname]['collecttime'] = collect_month(strtotime($row['CU_EstPayDate'])); + $invoicedate = is_null($row['InvoiceTime']) ? null : date('Y-m-d', strtotime($row['InvoiceTime'])); + $tableinvoice_state = is_null($invoicedate) ? 0 : 1; + $contract_no = $row['ProjectId']; + $facility_no = $row['CU_MaterialId']; + $RowCode = $row['RowCode']; + $BillNo = $row['BillNo']; + $receivable_date = date('Y-m-d', strtotime($row['CU_EstPayDate'])); + $budget = $row['OAmountWithTax']; + $invoiceNo = $row['InvoiceNo']; + $invoice_budget = is_null($row['InvoiceOAmount']) ? 0 : $row['InvoiceOAmount']; + $table_writeoff_date = is_null($row['WriteOffDate']) ? null : date('Y-m-d', strtotime($row['WriteOffDate'])); + $table_writeoff_amount = is_null($row['TotalCurrStandOffOAmount']) ? 0 : $row['TotalCurrStandOffOAmount']; + $table1 = "INSERT INTO account_receivable_maintainance( + `contract_no`, + `facility_no`, + `RowCode`, + `BillNo`, + `receivable_date`, + `budget`, + `receivable`, + `invoice_state`, + `invoice_budget`, + `received_budget` + "; + $table2 = ") VALUES( + '$contract_no', + '$facility_no', + '$RowCode', + '$BillNo', + '$receivable_date', + $budget, + $datahavetopay, + $tableinvoice_state, + $invoice_budget, + $table_writeoff_amount + "; + $table1 .= is_null($invoicedate) ? "" : ",`invoice_date`"; + $table2 .= is_null($invoicedate) ? "" : ",'$invoicedate'"; + $table1 .= is_null($table_writeoff_date) ? "" : ",`received_date`"; + $table2 .= is_null($table_writeoff_date) ? "" : ",'$table_writeoff_date'"; + $table1 .= is_null($invoiceNo) ? "" : ",`invoice_no`"; + $table2 .= is_null($invoiceNo) ? "" : ",'$invoiceNo'"; + $table .= $table1 . $table2 . "); \n"; +} +// $file_path = 'account_receivable_maintainance_sql.sql'; +// if (file_put_contents($file_path, $table) !== false) { +// echo "SQL文件已成功生成:{$file_path}"; +// } else { +// echo "生成SQL文件时出现错误。"; +// } + +// foreach ($data as $key => $row) { +// echo $key . "
"; +// print_r($row); +// echo "
------------
"; +// } +// exit(); +?> + + +
+
+ +
+
+
+
+

應收帳款(保養)

+
+
+
+ + + + + + + + + + + + + + + + + + + + +
簽約日期 + + ~ + + + + +
合約日期 + + ~ + + +
催收次數 + + ≤ 催收次數 ≤ + + +
催收金額 + + ≤ 催收金額 ≤ + + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ +
+ + +
+
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + $row) { ?> + + + + + + + + + + + + + + + + + + + +
合約號序號作番號部門主管契約員客戶名稱應收日期是否應收應收金額已收金額催收金額催收次數
" . $row['DeptName']; ?>" . $row['LeaderName']; ?>" . $row['PersonName']; ?>" . $row['BizPartnerName']; ?>1))? $row['collecttime']:0; ?>
+
+ + \ No newline at end of file diff --git a/wms/cont/css/pricereview.css b/wms/cont/css/pricereview.css new file mode 100644 index 00000000..3cd7f902 --- /dev/null +++ b/wms/cont/css/pricereview.css @@ -0,0 +1,329 @@ +@charset "UTF-8"; +#pricereviewCreate input[type=text], #pricereviewCreate input[type=number], #pricereviewCreate select { + margin: 1px; +} +#pricereviewCreate textarea { + resize: vertical; +} +#pricereviewCreate select { + -webkit-appearance: none; /* 針對 Chrome, Safari, Opera */ + -moz-appearance: none; /* 針對 Firefox */ + appearance: none; /* 標準語法 */ +} +#pricereviewCreate > .modal { + padding: 20px; +} +#pricereviewCreate > .modal table, #pricereviewCreate > .modal th, #pricereviewCreate > .modal td { + border: 1px #ccc solid; +} +#pricereviewCreate > .modal table > thead tr th { + color: #A52A2A; +} +#pricereviewCreate > .modal table > tbody .selected { + background-color: #E7FEFB; +} +#pricereviewCreate .container table, #pricereviewCreate .container th, #pricereviewCreate .container td { + border: 1px #ccc solid; + padding: 9px; +} +#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; + padding: 15px 2px; + 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; + height: 30px; + padding: 0; + margin-left: 6px; + 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 { + border: 1px #ccc solid; + padding: 10px; + border-radius: 4px; +} +#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 { + font-weight: 600; +} +#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 th input, #pricereviewCreate .container .pricreviewmain > .divitem th select, #pricereviewCreate .container .pricreviewmain > .divitem td input, #pricereviewCreate .container .pricreviewmain > .divitem td select { + font-size: 13px; + padding: 0 13px; +} +#pricereviewCreate .container .pricreviewmain > .divitem table textarea, #pricereviewCreate .container .pricreviewmain > .divitem th textarea, #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 { + -webkit-appearance: none; + margin: 0; +} +#pricereviewCreate .container .pricreviewmain > .divitem table tr:hover .deleteBtn, #pricereviewCreate .container .pricreviewmain > .divitem table tr:hover .copyBtn { + opacity: 1; +} +#pricereviewCreate .container .pricreviewmain > .divitem table .copyBtn { + width: 30px; + height: 30px; +} +#pricereviewCreate .container .pricreviewmain > .divitem table .saletd { + position: relative; +} +#pricereviewCreate .container .pricreviewmain > .divitem table .saletd > .deleteBtn { + position: absolute; + top: 50%; + transform: translateY(-50%); + right: 2px; + opacity: 0; + transition: 0.3s; +} +#pricereviewCreate .container .pricreviewmain > .divitem table .saletd > .copyBtn { + position: absolute; + top: 50%; + transform: translateY(-50%); + right: 38px; + opacity: 0; + transition: 0.3s; + width: 30px; + height: 30px; +} +#pricereviewCreate .container .pricreviewmain > .divitem table textarea { + height: auto; + min-height: 50px; +} +#pricereviewCreate .container .pricreviewmain > .filediv { + display: flex; + flex-direction: column; + margin-top: 20px; +} +#pricereviewCreate .container .pricreviewmain > .filediv label { + display: flex; + align-items: center; + margin: 10px 0; +} +#pricereviewCreate .container .pricreviewmain > .filediv label p { + width: 100px; + font-size: 15px; + font-weight: 600; +} +#pricereviewCreate .container .pricreviewmain > .filediv label input[type=file] { + width: 400px; +} +#pricereviewCreate .container .pricreviewmain > .filediv label a, #pricereviewCreate .container .pricreviewmain > .filediv label button { + width: 100px; + height: 35px; + margin: 0; + margin-right: 15px; + margin-top: 20px; +} +#pricereviewCreate .dark { + background-color: rgb(225, 225, 225) !important; + font-weight: 600; +} + +.container-fluid, .container { + max-width: 1400px !important; + width: 100%; +} +.container-fluid h4, .container h4 { + font-weight: 600; +} +.container-fluid .btn-secondary, .container .btn-secondary { + background-color: #6C757D; +} + +[x-cloak][data-type=window-modal], +[x-cloak][data-type=errortext] { + display: none !important; +} + +.errortext { + font-size: 12px !important; + color: red !important; + font-weight: 600 !important; +} + +.window-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100vh; + background-color: rgba(0, 0, 0, 0.5); + z-index: 9; + padding: 20px; +} +@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 { + border: 1px #ccc solid; +} +.window-modal table > thead tr th { + color: #A52A2A; +} +.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; + border-radius: 10px; + position: absolute; + width: 90%; + padding: 30px; + top: 50%; + left: 50%; + transform: translate(-50%, -55%); + 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; + right: 10px; + background-color: transparent; + border: none; + outline: none; + border-radius: 50%; +} +.window-modal .window-modal-content .window-modal-header > div > input { + width: 250px; +} +.window-modal .window-back { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: transparent; +} + +#pricereviewCheck > .container { + background-color: #F2F2F2; + border-radius: 15px; + padding: 20px; +} +#pricereviewCheck > .container .historytable { + max-height: 0; + overflow: hidden; +} +#pricereviewCheck > .container textarea { + resize: vertical; +} +#pricereviewCheck > .container table, #pricereviewCheck > .container th, #pricereviewCheck > .container td { + border: 1px #ccc solid; +} +#pricereviewCheck > .container table.noborder { + border: none !important; +} +#pricereviewCheck > .container table.noborder th, #pricereviewCheck > .container table.noborder td { + border: none !important; +} +#pricereviewCheck > .container .customerinfo-table input { + background-color: #EEE5E5; +} +#pricereviewCheck > .container .mi-table th { + font-weight: 600; +} +#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 { + font-size: 14px; +} +#pricereviewCheck > .container .mi-table .mi-info span { + font-size: 15px; + font-weight: 600; +} +#pricereviewCheck > .container .mi-table .mi-info .line { + width: 100%; + height: 0.5px; + margin: 30px 0; + background-color: #ccc; +}/*# sourceMappingURL=pricereview.css.map */ \ No newline at end of file diff --git a/wms/cont/css/pricereview.css.map b/wms/cont/css/pricereview.css.map new file mode 100644 index 00000000..a5d7bedf --- /dev/null +++ b/wms/cont/css/pricereview.css.map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BAAA;ADTZ;ACUY;EACI,kBAAA;EACA,SAAA;EACA,WAAA;EACA,6BAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;ADRhB;ACUY;EACI,YAAA;ADRhB;ACYI;EACI,kBAAA;EACA,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,6BAAA;ADVR;;ACeI;EACI,yBAAA;EACA,mBAAA;EACA,aAAA;ADZR;ACaQ;EACI,aAAA;EACA,gBAAA;ADXZ;ACaQ;EACI,gBAAA;ADXZ;ACaQ;EACI,sBAAA;ADXZ;ACaQ;EACI,uBAAA;ADXZ;ACYY;EACI,uBAAA;ADVhB;ACcY;EACI,yBAAA;ADZhB;ACgBY;EACI,gBAAA;ADdhB;ACgBY;EACI,yBAAA;EACA,mBAAA;EACA,iBAAA;EACA,eAAA;ADdhB;ACgBY;EACI,eAAA;ADdhB;ACegB;EACI,eAAA;EACA,gBAAA;ADbpB;ACegB;EACI,WAAA;EACA,aAAA;EACA,cAAA;EACA,sBAAA;ADbpB","file":"pricereview.css"} \ No newline at end of file diff --git a/wms/cont/css/pricereview.scss b/wms/cont/css/pricereview.scss new file mode 100644 index 00000000..7812e8e5 --- /dev/null +++ b/wms/cont/css/pricereview.scss @@ -0,0 +1,348 @@ +#pricereviewCreate{ + + input[type='text'], input[type='number'], select{ + margin: 1px; + } + textarea{ + resize: vertical; + } + select{ + -webkit-appearance: none; /* 針對 Chrome, Safari, Opera */ + -moz-appearance: none; /* 針對 Firefox */ + appearance: none; /* 標準語法 */ + } + >.modal{ + padding: 20px; + table, th, td{ + border:1px #ccc solid; + } + table > thead tr th{ + color:#A52A2A; + } + table > tbody .selected{ + background-color: #E7FEFB; + } + table > tbody .selected td{ + } + } + .container{ + table, th, td{ + border:1px #ccc solid; + padding: 9px; + &.noborder, .noborder th, .noborder td{ + border:none; + } + } + table{ + + thead th{ + background-color: #6D9EEB; + } + tbody { + td input{ + font-size: 14px; + } + th{ + background-color: #CCE4F8; + font-size: 14px; + padding: 15px 2px; + min-width: 100px; + text-align: center; + } + } + input{ + font-size: 13px; + } + } + .pricreviewmain{ + background-color: #F2F2F2; + padding: 20px; + 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{ + background-color: #337AB7; + width: 30px; + } + &.deleteBtn{ + background-color: #D9534F; + color:#fff; + font-size: 12px; + width: 30px; + } + &.selectElevator{ + background-color: #D9534F; + color:#fff; + } + } + + >.divitem{ + border:1px #ccc solid; + padding: 10px; + border-radius: 4px ; + .title{ + display: flex; + align-items: center; + border-bottom: 1px #ccc solid; + padding: 10px 0; + margin-bottom: 10px; + h6{ + font-weight: 600; + } + + } + table, th, td{ + font-size: 14px; + background-color: transparent; + input, select{ + font-size: 13px; + padding: 0 13px; + } + textarea{ + font-size: 13px; + } + input[type=number]::-webkit-outer-spin-button, + input[type=number]::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + } + table { + tr:hover .deleteBtn ,tr:hover .copyBtn{ + opacity: 1; + } + .copyBtn{ + width: 30px; + height: 30px; + } + .saletd{ + position: relative; + >.deleteBtn{ + position: absolute; + top: 50%; + transform: translateY(-50%); + right:2px; + opacity: 0; + transition: .3s; + } + >.copyBtn{ + position: absolute; + top: 50%; + transform: translateY(-50%); + right:38px; + opacity: 0; + transition: .3s; + width: 30px; + height: 30px; + } + } + textarea{ + height: auto; + min-height: 50px; + } + } + } + >.filediv{ + display: flex; + flex-direction: column; + margin-top: 20px; + label{ + display: flex; + align-items: center; + margin:10px 0; + p{ + width:100px; + font-size: 15px; + font-weight: 600; + } + input[type="file"]{ + width:400px + } + a, button{ + width:100px; + height: 35px; + margin:0; + margin-right: 15px; + margin-top: 20px; + } + } + } + } + } + .dark{ + background-color: rgba(225,225,225,1) !important; + font-weight: 600; + } +} + +.container-fluid, .container{ + max-width:1400px !important; + width: 100%; + h4{ + font-weight: 600; + } + .btn-secondary{ + background-color: #6C757D; + } +} +[x-cloak][data-type="window-modal"], +[x-cloak][data-type="errortext"] +{ + display: none !important; +} +.errortext{ + font-size:12px !important; + color:red !important; + font-weight:600 !important; +} +.window-modal{ + position: fixed; + top: 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%); + opacity: 0; + } + 100%{ + transform: translate(-50%, -55%); + opacity: 1; + } + } + table, th, td{ + border:1px #ccc solid; + } + table > thead tr th{ + color:#A52A2A; + } + 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; + background-color: #fff; + border-radius: 10px; + position: absolute; + width:90%; + padding: 30px; + top: 50%; + left:50%; + transform: translate(-50%, -55%); + box-shadow: 0 5px 5px #222; + animation: fade-in .2s linear; + &.modal-xl{ + max-width:1200px; + } + &.modal-lg{ + max-width:800px; + } + &.modal-m{ + max-width:450px; + } + .window-modal-header{ + display: flex; + flex-direction: column; + button.btn-close{ + position: absolute; + top: 10px; + right:10px; + background-color: transparent; + border:none; + outline: none; + border-radius: 50%; + } + >div > input{ + width: 250px; + } + } + } + .window-back{ + position: absolute; + top: 0; + left:0; + width: 100%; + height: 100%; + background-color: transparent; + } +} + +#pricereviewCheck{ + >.container{ + background-color: #F2F2F2; + border-radius: 15px; + padding: 20px; + .historytable{ + max-height: 0; + overflow: hidden; + } + textarea{ + resize: vertical; + } + table, th, td{ + border:1px #ccc solid; + } + table.noborder{ + border:none !important; + th ,td{ + border:none !important; + } + } + .customerinfo-table{ + input{ + background-color: #EEE5E5; + } + } + .mi-table{ + th{ + font-weight: 600; + } + input[type=text]{ + background-color: #EEEEEE; + cursor: not-allowed; + padding: 6px 12px; + font-size: 14px; + } + .mi-info{ + font-size: 14px; + span{ + font-size: 15px; + font-weight: 600; + } + .line{ + width: 100%; + height: .5px; + margin:30px 0; + background-color: #ccc; + } + } + } + } + +} \ No newline at end of file diff --git a/wms/cont/js/alpinejs/cdn.min.js b/wms/cont/js/alpinejs/cdn.min.js new file mode 100644 index 00000000..922cc02e --- /dev/null +++ b/wms/cont/js/alpinejs/cdn.min.js @@ -0,0 +1,5 @@ +(()=>{var Ze=!1,Qe=!1,H=[],et=-1;function zt(e){En(e)}function En(e){H.includes(e)||H.push(e),vn()}function we(e){let t=H.indexOf(e);t!==-1&&t>et&&H.splice(t,1)}function vn(){!Qe&&!Ze&&(Ze=!0,queueMicrotask(Sn))}function Sn(){Ze=!1,Qe=!0;for(let e=0;ee.effect(t,{scheduler:r=>{tt?zt(r):r()}}),rt=e.raw}function nt(e){I=e}function qt(e){let t=()=>{};return[n=>{let i=I(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),L(i))},i},()=>{t()}]}function q(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function O(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>O(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)O(n,t,!1),n=n.nextElementSibling}function v(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Ut=!1;function Wt(){Ut&&v("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Ut=!0,document.body||v("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` + + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
有望客戶(契約)基本資料
評審單號卷號現場地址現場名稱
電梯品牌數量營業員保養方式 + +
契約期限開始契約期限結束契約性質 + + 介紹人
付款方式 + +
+ + + + + + + + + + + +
洽商進度
+ +
+ + + + + + + + + + + +
電梯詳細資料
+ +
+
+
+
+

整機單價

+ +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
標準價總額(A)報價總額(B)破價總額(B-A)價率%(B/A)總台數服務費(介紹費)
+ + +
罰則訂金保證金(函)%履約保證金(函)%保固保證金(函)%
特記事項
+ +
+ +
+
+ + + + +
+
+
+
+ + \ No newline at end of file diff --git a/wms/contract/api/postContractData.php b/wms/contract/api/postContractData.php index 26b97cb7..9522defe 100644 --- a/wms/contract/api/postContractData.php +++ b/wms/contract/api/postContractData.php @@ -220,7 +220,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c $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)"; + 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); $stmt->bindParam(':contractno', $contractno); $stmt->bindParam(':define', $define); diff --git a/wms/contract/api/postContractNewApplyData.php b/wms/contract/api/postContractNewApplyData.php index e3ec18e5..7f2e2525 100644 --- a/wms/contract/api/postContractNewApplyData.php +++ b/wms/contract/api/postContractNewApplyData.php @@ -4,6 +4,7 @@ use function Symfony\Component\String\s; require_once("../conn.php"); include_once("./upload_chk.php"); +include_once "./postFlow.php"; ini_set('date.timezone', 'Asia/Taipei'); if ($_SERVER['REQUEST_METHOD'] != 'POST') { exit(); @@ -42,6 +43,8 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $status = $_POST['status']; // 0:暫存 1:送審 2:退回 3:完成 $pays = json_decode($pays, true); + $form_key = $_POST['form_key']; + $files = !empty($_FILES['files']) ? $_FILES['files'] : null; @@ -160,6 +163,14 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == } } // -----處理檔案上傳 END----- + + if($status == 1){ + $current_assigner = "M0175"; + $flow_code = "A"; + $ekind = "新梯"; + createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key); + } + header("HTTP/1.1 201 success!"); $conn->commit(); } else { @@ -211,7 +222,6 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == } $deleted_at = date("Y-m-d H:i:s"); $removefiles = isset($_POST['removefiles']) ? json_decode($_POST['removefiles'], true) : []; - print_r($removefiles); if(count($removefiles) > 0){ foreach($removefiles as $file){ $sql_str = "UPDATE contract_apply_files SET deleted_at = :deleted_at WHERE id = :fileid"; @@ -221,9 +231,18 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $stmt ->execute(); } } + + if($status == 1){ + $current_assigner = "M0175"; + $flow_code = "A"; + $ekind = "新梯"; + createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key); + } + header("HTTP/1.1 201 success!"); $conn->commit(); } + } catch (PDOException $e) { $conn->rollback(); header("HTTP/1.1 500 failed!"); @@ -268,6 +287,8 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $progress = $_POST['progress']; $review_comment = $_POST['review_comment']; $user_id = $_POST['review_person_id']; + $form_key = $_POST['form_key']; + $mid = $contract_new_apply_id; $review_date = date('Y-m-d H:i:s'); $conn->beginTransaction(); try { @@ -280,6 +301,13 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $stmt->bindParam(':review_person_id', $user_id); $stmt->bindParam(':review_date', $review_date); $stmt->execute(); + + + //發送待簽通知 + $current_assigner = "00000"; + $flow_code = "Z"; + $ekind = "新梯"; + createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key); header("HTTP/1.1 200 success!"); $conn->commit(); } catch (PDOException $e) { @@ -297,6 +325,8 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $progress = $_POST['progress']; $review_comment = $_POST['review_comment']; $user_id = $_POST['review_person_id']; + $form_key = $_POST['form_key']; + $mid = $contract_new_apply_id; echo $user_id; $review_date = date('Y-m-d H:i:s'); $conn->beginTransaction(); @@ -310,6 +340,13 @@ if (isset($_POST['vol_no']) && !empty($_POST['vol_no']) && ($_POST['status'] == $stmt->bindParam(':review_person_id', $user_id); $stmt->bindParam(':review_date', $review_date); $stmt->execute(); + + + //發送待簽通知 + $current_assigner = "00000"; + $flow_code = "A"; + $ekind = "新梯"; + createFlow($mid, $current_assigner, $flow_code, $ekind, $form_key); header("HTTP/1.1 200 success!"); $conn->commit(); } catch (PDOException $e) { diff --git a/wms/contract/api/postFlow.php b/wms/contract/api/postFlow.php new file mode 100644 index 00000000..90368b1c --- /dev/null +++ b/wms/contract/api/postFlow.php @@ -0,0 +1,58 @@ +prepare($sql_str); + $stmt->execute(); + $result = $stmt->fetch(PDO::FETCH_ASSOC); + $form_key = $result['form_key']; + $seq = 0; + + $sql_str = "INSERT INTO flow (system_id, flow_id, form_id, form_key, flow_code) + VALUES (:system_id, :flow_id, :form_id, :form_key, :flow_code)"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':system_id', $system_id); + $stmt->bindParam(':flow_id', $flow_id); + $stmt->bindParam(':form_id', $form_id); + $stmt->bindParam(':form_key', $form_key); + $stmt->bindParam(':flow_code', $flow_code); + $stmt->execute(); + }else{ + $sql_str = "UPDATE flow SET flow_code = :flow_code WHERE form_key = :form_key"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':form_key', $form_key); + $stmt->bindParam(':flow_code', $flow_code); + $stmt->execute(); + + $sql_str = "SELECT MAX(seq) AS max_seq FROM subflow WHERE form_key = :form_key"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':form_key', $form_key); + $stmt->execute(); + $result = $stmt->fetch(PDO::FETCH_ASSOC); + $seq = $result['max_seq']; + $seq ++; + } + + $created_at = date("Y-m-d H:i:s"); + $sql_str = "INSERT INTO subflow (form_key, seq, current_assigner, update_date,create_date) + VALUES (:form_key, :seq, :current_assigner, :update_date,:create_date)"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':form_key', $form_key); + $stmt->bindParam(':seq', $seq); + $stmt->bindParam(':current_assigner', $current_assigner); + $stmt->bindParam(':update_date', $created_at); + $stmt->bindParam(':create_date', $created_at); + $stmt->execute(); + + + return $form_key; +} \ No newline at end of file diff --git a/wms/contract/contract-new-apply.php b/wms/contract/contract-new-apply.php index 74153c28..e315c28c 100644 --- a/wms/contract/contract-new-apply.php +++ b/wms/contract/contract-new-apply.php @@ -1,13 +1,45 @@ alert('非法訪問!!!');"; echo ""; exit; } -$id = $_GET["id"]; +$id = null; +if(isset($_GET['id'])){ + $id = $_GET["id"]; +} +$form_key = null; +if(isset($_GET['form_key'])){ + $form_key = $_GET['form_key']; +} + +if($form_key != null){ + $sql_str = "SELECT form_id FROM flow WHERE system_id = 'cta' AND flow_id = 'cta01' AND form_key = :form_key"; + $stmt = $conn->prepare($sql_str); + $stmt->bindParam(':form_key', $form_key); + $stmt->execute(); + $result = $stmt->fetch(PDO::FETCH_ASSOC); + $id = $result['form_id']; +} + +if(!$id){ + $para = "function_name=pricereview&" . $token_link; + echo ""; + echo ""; + exit; +} + +$sql_str = "SELECT form_key FROM flow WHERE system_id = 'cta' AND flow_id = 'cta01' AND form_id = :id"; +$stmt = $conn->prepare($sql_str); +$stmt->bindParam(':id', $id); +$stmt->execute(); +$result = $stmt->fetch(PDO::FETCH_ASSOC); +if($result){ + $form_key = $result['form_key']; +} $sql_str = "SELECT contract_new_apply.*, person_account.name AS review_person_name, person_final_account.name AS review_final_person_name FROM contract_new_apply @@ -439,7 +471,13 @@ $para = "function_name=pricereview&" . $token_link; 第二期款交貨期限(日) - +

未填寫

@@ -513,8 +551,8 @@ $para = "function_name=pricereview&" . $token_link; - - 業務承辦人 + + 業務部審核 = 2) : ?>已同意 @@ -525,15 +563,15 @@ $para = "function_name=pricereview&" . $token_link; - 業務部協理 + 業務部審核 結案同意 結案不同意 --- - - + + ">下載 + + + + + diff --git a/wms/mkt/pricereviewCreate.php b/wms/mkt/pricereviewCreate.php index 921de714..f9c6ba6f 100644 --- a/wms/mkt/pricereviewCreate.php +++ b/wms/mkt/pricereviewCreate.php @@ -49,12 +49,11 @@ $hope_status = [ $sql_str = "SELECT hope_elevator_customer.*, code.content AS source_content, account.name AS salesman_name FROM hope_elevator_customer LEFT JOIN code ON code.code_name = hope_elevator_customer.source LEFT JOIN account ON account.accountid = hope_elevator_customer.salesman - WHERE hope_elevator_customer.vol_no = :vol_no AND code.field_name = 'customer_source'"; + WHERE hope_elevator_customer.vol_no = :vol_no "; $stmt = $conn->prepare($sql_str); $stmt->bindParam(':vol_no', $vol_no); $stmt->execute(); $hope_customer = $stmt->fetch(PDO::FETCH_ASSOC); - if($user_id !== $hope_customer['salesman'] && $user_id !== "M0174"){ echo ""; exit;