Browse Source

Merge branch 'main' into gary

# Conflicts:
#	wms/estimated_shipping_date_report.php
#	wms/wipwhole-change-contractdate-submit.php
#	wms/wipwhole-index-function.php
#	wms/wipwhole-rec-invoice.php
#	wms/wipwhole-renovate-rec-invoice-edit-submit.php
#	wms/wipwhole-renovate-rec-invoice-edit.php
#	wms/wipwhole-renovate-rec-invoice.php
#	wms/wipwholeinstall-index-function.php
#	wms/wipwholeinstall-renovate-index-function.php
gary
gary_chen\gary_chen 1 year ago
parent
commit
ed20a74e46
  1. 45
      mkt/IncludeCommon.php
  2. 217
      mkt/contractapply-index.php
  3. 4
      mkt/database.php
  4. 3
      wms/Bill.txt
  5. 198
      wms/account-receivable-check.php
  6. 256
      wms/account-receivable-contract.php
  7. 115
      wms/account-receivable-excel.php
  8. 855
      wms/account-receivable-index-ing.php
  9. 739
      wms/account-receivable-index.php
  10. 12
      wms/account-receivable-received-create.php
  11. 14
      wms/account-receivable-received-edit.php
  12. 33
      wms/account-receivable-test.php
  13. BIN
      wms/account-receivable-test.xlsx
  14. BIN
      wms/account-receivable.xlsx
  15. BIN
      wms/assets/img/icon/(Ñ╝¿╧Ñ╬)icon-star-active.png
  16. BIN
      wms/assets/img/icon/(Ñ╝¿╧Ñ╬)icon-star-default.png
  17. 16
      wms/board-record-submit.php
  18. 17
      wms/class/Cmail.php
  19. 2
      wms/cont/MICalculator.php
  20. 428
      wms/cont/apply_form.php
  21. 912
      wms/cont/apply_form1.php
  22. 42
      wms/cont/conn.php
  23. 11
      wms/cont/query_form.php
  24. 11
      wms/cont/sign_form.php
  25. 272
      wms/cont/sign_list.php
  26. 21
      wms/cont/submit.php
  27. 16
      wms/cont/t.php
  28. 34
      wms/contract-repair/api/deleteNewContractData.php
  29. 59
      wms/contract-repair/api/getComboNo.php
  30. 122
      wms/contract-repair/api/getContractData.php
  31. 518
      wms/contract-repair/api/getFacilityNo.php
  32. 16
      wms/contract-repair/api/getPriceview.php
  33. 423
      wms/contract-repair/api/postContractData.php
  34. 68
      wms/contract-repair/api/postContractNewApplyData.php
  35. 139
      wms/contract-repair/api/postNewContractData.php
  36. 190
      wms/contract-repair/api/putContractData.php
  37. 0
      wms/contract-repair/api/store_contract.php
  38. 61
      wms/contract-repair/api/upload_chk.php
  39. 43
      wms/contract-repair/conn.php
  40. 567
      wms/contract-repair/contract-download.php
  41. 214
      wms/contract-repair/contract-repair-edit.php
  42. 185
      wms/contract-repair/contract-repair-input.php
  43. 131
      wms/contract-repair/contract-repair-management.php
  44. 662
      wms/contract-repair/contract_maintance.php
  45. 842
      wms/contract-repair/js/alpine.js
  46. 5
      wms/contract-repair/js/alpinejs/cdn.min.js
  47. 25
      wms/contract-repair/js/axios.js
  48. 2
      wms/contract-repair/js/axios/axios.min.js
  49. 48
      wms/contract-repair/js/el.js
  50. 4
      wms/contract-repair/js/jquery/jquery-3.1.1.min.js
  51. 649
      wms/contract-repair/prviewPdf.php
  52. 5
      wms/contract-repair/semantic/.browserlistrc
  53. 322
      wms/contract-repair/semantic/.csscomb.json
  54. 18
      wms/contract-repair/semantic/.csslintrc
  55. 24
      wms/contract-repair/semantic/.github/ISSUE_TEMPLATE.md
  56. 28
      wms/contract-repair/semantic/.github/PULL_REQUEST_TEMPLATE.md
  57. 33
      wms/contract-repair/semantic/.github/stale.yml
  58. 38
      wms/contract-repair/semantic/.gitignore
  59. 38
      wms/contract-repair/semantic/.jshintrc
  60. 58
      wms/contract-repair/semantic/CONTRIBUTING.md
  61. 7
      wms/contract-repair/semantic/LICENSE.md
  62. 112
      wms/contract-repair/semantic/README.md
  63. 2959
      wms/contract-repair/semantic/RELEASE-NOTES.md
  64. 5
      wms/contract-repair/semantic/Semantic-UI-master/.browserlistrc
  65. 322
      wms/contract-repair/semantic/Semantic-UI-master/.csscomb.json
  66. 18
      wms/contract-repair/semantic/Semantic-UI-master/.csslintrc
  67. 24
      wms/contract-repair/semantic/Semantic-UI-master/.github/ISSUE_TEMPLATE.md
  68. 28
      wms/contract-repair/semantic/Semantic-UI-master/.github/PULL_REQUEST_TEMPLATE.md
  69. 33
      wms/contract-repair/semantic/Semantic-UI-master/.github/stale.yml
  70. 38
      wms/contract-repair/semantic/Semantic-UI-master/.gitignore
  71. 38
      wms/contract-repair/semantic/Semantic-UI-master/.jshintrc
  72. 58
      wms/contract-repair/semantic/Semantic-UI-master/CONTRIBUTING.md
  73. 7
      wms/contract-repair/semantic/Semantic-UI-master/LICENSE.md
  74. 112
      wms/contract-repair/semantic/Semantic-UI-master/README.md
  75. 2959
      wms/contract-repair/semantic/Semantic-UI-master/RELEASE-NOTES.md
  76. 27
      wms/contract-repair/semantic/Semantic-UI-master/bower.json
  77. 24
      wms/contract-repair/semantic/Semantic-UI-master/composer.json
  78. 244
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.css
  79. 613
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.js
  80. 9
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.min.css
  81. 1
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.min.js
  82. 274
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/ad.css
  83. 10
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/ad.min.css
  84. 1167
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/api.js
  85. 1
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/api.min.js
  86. 124
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/breadcrumb.css
  87. 9
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/breadcrumb.min.css
  88. 3561
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/button.css
  89. 9
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/button.min.css
  90. 937
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/card.css
  91. 9
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/card.min.css
  92. 608
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.css
  93. 831
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.js
  94. 9
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.min.css
  95. 1
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.min.js
  96. 268
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/comment.css
  97. 9
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/comment.min.css
  98. 147
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/container.css
  99. 9
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/container.min.css
  100. 235
      wms/contract-repair/semantic/Semantic-UI-master/dist/components/dimmer.css

45
mkt/IncludeCommon.php

@ -1,14 +1,17 @@
<?php
// phpinfo();
// exit;
class IncludeCommon
{
function CheckToken($token) {
function CheckToken($token)
{
date_default_timezone_set("Asia/Taipei");
$encryption_code = "MASADA!^***";
$time = date("Y-m-d H:i:s");
if (!isset($token) || empty($token)) {
$data['code'] = '400';
$data['message'] = '非法求';
$data['message'] = '非法求';
return $data;
}
//对比token
@ -20,7 +23,7 @@ class IncludeCommon
$data['user_id'] = '';
$data['user_name'] = '';
$data['code'] = '401';
$data['message'] = 'Token已过期,请重新登录';
$data['message'] = 'Token已過期,請重新登入';
return $data;
}
if ($true_signature == $explode[4]) {
@ -44,22 +47,23 @@ class IncludeCommon
return $data;
}
}
//生成登录记录
function save_log_response($source_flag='web', $account, $response_result){
//生成登录记录
function save_log_response($source_flag = 'web', $account, $response_result)
{
# 储存纪录并输出
#echo date("Y-m-d");
$file_path = "account_log/" . $account . "-" . date("Y-m-d") . ".ini";
$data = serialize($response_result). date("H:i:s") . "\n";
$fp = fopen($file_path,"a"); # 如果档案不存在择尝试建立再写入
$data = serialize($response_result) . date("H:i:s") . "\n";
$fp = fopen($file_path, "a"); # 如果档案不存在择尝试建立再写入
fwrite($fp, $data);
fclose($fp);
if ($source_flag == "web"){
// header("Location: custom-create.php?function_list=" . serialize($response_result) .
// "&token=" . $response_result["token"]); #请输入使用者名称密码
// exit();
if ($source_flag == "web") {
// header("Location: custom-create.php?function_list=" . serialize($response_result) .
// "&token=" . $response_result["token"]); #请输入使用者名称密码
// exit();
return true;
}else{
// echo json_encode($response_result, JSON_UNESCAPED_UNICODE);
} else {
// echo json_encode($response_result, JSON_UNESCAPED_UNICODE);
return false;
}
@ -74,11 +78,12 @@ class IncludeCommon
*/
}
//生成token
function CreateToken($user_id, $user_name) {
//生成token
function CreateToken($user_id, $user_name)
{
date_default_timezone_set("Asia/Taipei");
$start_time = date("Y-m-d H:i:s");
$end_time = date('Y-m-d H:i:s',strtotime('+24 hour')); #设定24小时
$end_time = date('Y-m-d H:i:s', strtotime('+24 hour')); #设定24小时
$info = $user_id . '.' . $start_time . '.' . $end_time . '.' . $user_name; //设置token过期时间为一天
$encryption_code = "MASADA!^***";
//根据以上信息信息生成签名(密钥为 SIGNATURE 自定义全局常量)
@ -86,9 +91,10 @@ class IncludeCommon
//最后将这两部分拼接起来,得到最终的Token字符串
return $token = $info . '.' . $signature;
}
//生成菜单
//生成菜单
function menu ($from='tw',$type){
function menu($from = 'tw', $type)
{
$function_type = array(
"tw" => array(
# F角色菜单
@ -104,7 +110,6 @@ class IncludeCommon
)
);
return $function_type[$from][$type];
return $function_type[$from][$type];
}
}

217
mkt/contractapply-index.php

@ -7,129 +7,132 @@ require_once "database.php";
$data = array();
// sql語法存在變數中
$sql = "select * from contractapply_main order by id";
$data = mysqli_query($link,$sql);
$data = mysqli_query($link, $sql);
$apply_type_arr = ["A" => "制式新合約", "B" => "非制式新合約"];
$status_arr = ["I" => "申請中", "P" => "在途中", "Y" => "已完成", "X" => "作廢"];
?>
<p>
<a href="contractapply-create.php" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
<a href="contractapply-create.php" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
</p>
<?php
if($data):
if ($data) :
?>
<style>
table {
table-layout:fixed;
width: 100%;
}
<style>
table {
table-layout: fixed;
width: 100%;
}
td {
word-wrap:break-word;
}
td {
word-wrap: break-word;
}
img {
width:125px;
}
img {
width: 125px;
}
.width_style_1 {
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;
table {
width: 100%;
}
}
</style>
<div style="overflow-x:auto;">
<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>
<!--<th>交貨期限</th>
#table_index_filter {
float: right;
}
#table_index_paginate {
float: right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
</style>
<div style="overflow-x:auto;">
<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>
<!--<th>交貨期限</th>
<th>完工期限</th>-->
<th>建檔人</th>
<th>建檔時間</th>
</tr>
</thead>
<tbody>
<?php foreach($data as $data) :
switch ($data["status"]) {
case "I":
$status_dt = $data["status_1_dt"];
break;
case "P":
$status_dt = $data["status_2_dt"];
break;
case "Y":
$status_dt = $data["status_3_dt"];
break;
case "X":
$status_dt = $data["status_4_dt"];
break;
}
?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php echo $data['apply_no1'].$data['apply_no2']; ?></td>
<td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['person']; ?></td>
<td><?php echo $data['apply_number']; ?></td>
<td><?php echo $data['apply_date']; ?></td>
<td><?php echo $data['promiser']; ?></td>
<td><?php echo $apply_type_arr[$data['apply_type']]; ?></td>
<td>
<?php echo $status_arr[$data['status']]; ?>
<p>
<a href="contractapply-edit.php?id=<?php echo $data['id']; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td><?php echo $status_dt; ?></td>
<td><?php echo $data['case_name']; ?></td>
<td><?php echo number_format($data['pay']); ?></td>
<td><?php echo number_format($data['pay_install']); ?></td>
<td><?php echo number_format($data['pay_total']); ?></td>
<td><?php echo $data['pay_second']; ?></td>
<!--<td><?php echo $data['delivery_date']; ?></td>
<th>建檔人</th>
<th>建檔時間</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $data) :
switch ($data["status"]) {
case "I":
$status_dt = $data["status_1_dt"];
break;
case "P":
$status_dt = $data["status_2_dt"];
break;
case "Y":
$status_dt = $data["status_3_dt"];
break;
case "X":
$status_dt = $data["status_4_dt"];
break;
}
?>
<tr>
<td><?php echo $data['id']; ?></td>
<td><?php echo $data['apply_no1'] . $data['apply_no2']; ?></td>
<td><?php echo $data['contractno']; ?></td>
<td><?php echo $data['person']; ?></td>
<td><?php echo $data['apply_number']; ?></td>
<td><?php echo $data['apply_date']; ?></td>
<td><?php echo $data['promiser']; ?></td>
<td><?php echo $apply_type_arr[$data['apply_type']]; ?></td>
<td>
<?php echo $status_arr[$data['status']]; ?>
<p>
<a href="contractapply-edit.php?id=<?php echo $data['id']; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</p>
</td>
<td><?php echo $status_dt; ?></td>
<td><?php echo $data['case_name']; ?></td>
<td><?php echo number_format($data['pay']); ?></td>
<td><?php echo number_format($data['pay_install']); ?></td>
<td><?php echo number_format($data['pay_total']); ?></td>
<td><?php echo $data['pay_second']; ?></td>
<!--<td><?php echo $data['delivery_date']; ?></td>
<td><?php echo $data['completion_date']; ?></td>-->
<td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_dt']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<td><?php echo $data['creater']; ?></td>
<td><?php echo $data['create_dt']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php
else:
else :
echo "<h2>There is no record!</h2>";
endif;

4
mkt/database.php

@ -31,8 +31,8 @@ try {
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
} catch (PDOException $e) {
echo "fail";
echo $e->getMessage();
// echo "fail";
// echo $e->getMessage();
}
//print_r($link);exit;
if($link){

3
wms/Bill.txt

@ -0,0 +1,3 @@
Array
Array
Array

198
wms/account-receivable-check.php

@ -1,9 +1,20 @@
<?php
include "./header.php";
$Bill = $_POST['Bill'];
$Bill = json_decode($Bill, true);
$data = json_encode($Bill);
$BillNo = $_GET['BillNo'];
echo $BillNo;
//企業名稱 統一編號 聯絡地址
// $Bill = $_POST['Bill'];
// $Bill = json_decode($Bill, true);
// $sql_received = "SELECT * from account_received where BillNo = '$Bill[0]' ORDER BY `pay_id` ASC";
// $pay_received = mysqli_query($link, $sql_received);
// $had_received = 0;
// if (mysqli_num_rows($pay_received) == 0) {
// foreach ($pay_received as $received) {
// $had_received += $received['received_amount'];
// }
// }
// $unreceived = $Bill[12] - $had_received;
// $data = json_encode($Bill);
?>
<style>
th {
@ -25,13 +36,13 @@ $data = json_encode($Bill);
</div>
<div class="container">
<div class="text-center" style="margin-bottom: 20px;">
<h3><strong><?= $Bill[5] ?></strong></h3>
<h3><strong><?= $Bill[4] ?></strong></h3>
</div>
<form class="form-horizontal">
<div class="form-group">
<div class="col-md-3">
<label for="BillNo">合約號</label>
<input type="text" class="form-control" id="BillNo" name="BillNo" value="<?= $Bill[10] ?>" disabled>
<input type="text" class="form-control" id="BillNo" name="BillNo" value="<?= $Bill[0] ?>" disabled>
</div>
<div class="col-md-3">
<label for="DeptId">部門</label>
@ -43,34 +54,59 @@ $data = json_encode($Bill);
</div>
<div class="col-md-3">
<label for="PersonName">營業員</label>
<input type="text" class="form-control" id="PersonName" name="PersonName" value="<?= $Bill[4] ?>" disabled>
<input type="text" class="form-control" id="PersonName" name="PersonName" value="<?= $Bill[3] ?>" disabled>
</div>
</div>
<div class="form-group">
<div class="col-md-3">
<label for="EnterpriseName">抬頭</label>
<input type="text" class="form-control" id="EnterpriseName" name="EnterpriseName" value="<?= $Bill[6] ?>" disabled>
<input type="text" class="form-control" id="EnterpriseName" name="EnterpriseName" value="<?= $Bill[14] ?>" disabled>
</div>
<div class="col-md-3">
<label for="TaxNo">統一編號</label>
<input type="text" class="form-control" id="TaxNo" name="TaxNo" value="<?= $Bill[7] ?>" disabled>
<input type="text" class="form-control" id="TaxNo" name="TaxNo" value="<?= $Bill[15] ?>" disabled>
</div>
<div class="col-md-6">
<label for="ContactAddress">聯絡地址</label>
<input type="text" class="form-control" id="ContactAddress" name="ContactAddress" value="<?= $Bill[8] ?>" disabled>
<input type="text" class="form-control" id="ContactAddress" name="ContactAddress" value="<?= $Bill[16] ?>" disabled>
</div>
</div>
<div>
<label for="detail">狀態</label>
<textarea class="form-control" style="height: 150px; width: 50%;" name="detail" id="detail" disabled><?= str_replace("<br>", "\n", $Bill['facilities']) ?></textarea>
<textarea class="form-control" style="height: 150px; width: 50%;" name="detail" id="detail" disabled><?= str_replace("<br>", "\n", $Bill[13]) ?></textarea>
</div>
</form>
<div style="width: auto; margin-top: 30px;">
<table class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th></th>
<th>目前應收</th>
<th>已開發票金額</th>
<th>未開發票金額</th>
<th>已收金額</th>
<th>未收金額</th>
</tr>
</thead>
<tbody>
<tr>
<td><?= number_format(round($Bill[12])) ?></td>
<td><?= number_format(round($Bill[19])) ?></td>
<td><?= number_format(round($Bill[21])) ?></td>
<td><?= number_format(round($Bill[20])) ?></td>
<td><?= number_format(round($Bill[22])) ?></td>
</tr>
</tbody>
</table>
</div>
<div style="width: auto; margin-top: 30px;">
<table class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th>簽約款</th>
<th>二次款</th>
<th>貨抵工地款</th>
@ -78,62 +114,22 @@ $data = json_encode($Bill);
<th>試車款</th>
<th>官檢款</th>
<th>交車款</th>
<th>尾款</th>
</tr>
</thead>
<tbody>
<tr>
<td>合約金額</td>
<td><?= number_format(round($Bill['sign'][1])) ?></td>
<td><?= number_format(round($Bill['second'][1])) ?></td>
<td><?= number_format(round($Bill['arrive'][1])) ?></td>
<td><?= number_format(round($Bill['install'][1])) ?></td>
<td><?= number_format(round($Bill['tryrun'][1])) ?></td>
<td><?= number_format(round($Bill['check'][1])) ?></td>
<td><?= number_format(round($Bill['delivery'][1])) ?></td>
<td><?= number_format(round($Bill['final'][1])) ?></td>
</tr>
<tr>
<td>目前應收</td>
<td><?= number_format(round($Bill['sign'][3])) ?></td>
<td><?= number_format(round($Bill['second'][3])) ?></td>
<td><?= number_format(round($Bill['arrive'][3])) ?></td>
<td><?= number_format(round($Bill['install'][3])) ?></td>
<td><?= number_format(round($Bill['tryrun'][3])) ?></td>
<td><?= number_format(round($Bill['check'][3])) ?></td>
<td><?= number_format(round($Bill['delivery'][3])) ?></td>
<td><?= number_format(round($Bill['final'][3])) ?></td>
<td><?= number_format(round($Bill[5])) ?></td>
<td><?= number_format(round($Bill[6])) ?></td>
<td><?= number_format(round($Bill[7])) ?></td>
<td><?= number_format(round($Bill[8])) ?></td>
<td><?= number_format(round($Bill[9])) ?></td>
<td><?= number_format(round($Bill[10])) ?></td>
<td><?= number_format(round($Bill[11])) ?></td>
</tr>
</tbody>
</table>
<div style="width: auto; margin-top: 30px;">
<table class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th>目前應收</th>
<th>已開發票金額</th>
<th>未開發票金額</th>
<th>已收金額</th>
<th>未收金額</th>
</tr>
</thead>
<tbody>
<tr>
<td><?= number_format(round($Bill['receivable_budget'])) ?></td>
<td><?= number_format(round($Bill['invoice_budget'])) ?></td>
<td><?= number_format(round($Bill['receivable_budget'] - $Bill['invoice_budget'])) ?></td>
<td><?= number_format(round($Bill['received_budget'])) ?></td>
<td><?= number_format(round($Bill['invoice_budget'] - $Bill['received_budget'])) ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php
@ -141,10 +137,10 @@ include "./footer.php";
?>
<?php
if ((accountidToDepartId($user_id) == '220') || ($user_id == "M0209")) {
if ($user_id == "M0122") {
?>
<!-- <button type="button" onclick="create('create',0)" class="btn btn-primary btn-sm pull-right" style="margin-right: 10%;margin-bottom: 10px;">
新增收款紀錄<span class=" glyphicon glyphicon-plus"></span></button> -->
<button type="button" onclick="create('create',0)" class="btn btn-primary btn-sm pull-right" style="margin-right: 10%;margin-bottom: 10px;">
新增收款紀錄<span class=" glyphicon glyphicon-plus"></span></button>
<?php
}
?>
@ -152,74 +148,34 @@ if ((accountidToDepartId($user_id) == '220') || ($user_id == "M0209")) {
<table 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 style="width: 10%;">功能</th>
</tr>
</thead>
<tbody>
<?php if ($Bill['invoice'] != Null) {
foreach ($Bill['invoice'] as $key => $invoice) { ?>
<?php if ($pay_received) {
foreach ($pay_received as $received) { ?>
<tr>
<td><?= $key ?></td>
<td><?= $invoice[0] ?></td>
<td><?php switch ($invoice[2]) {
case 0:
echo "藍字";
break;
case 1:
echo "紅字";
break;
case 2:
echo "作廢";
break;
} ?></td>
<td><?= isset($invoice[1])? number_format($invoice[1]):0 ?></td>
<td><?= isset($invoice[3])? $invoice[3]:' ' ?></td>
<td><?= isset($invoice[4])? number_format($invoice[4]):0 ?></td>
<td><?= isset($invoice[5])? number_format($invoice[5]):0 ?></td>
<!-- <td><?= $received['remark'] ?></td>
<td style="text-align: center;">
<?php
switch ($received['status']) {
case 0:
echo "<span style='color:blue;'>進行中</span>";
break;
case 1:
echo "<span style='color:brown;'>催收</span>";
break;
case 2:
echo "<span style='color:red;'>法務件 (發函)</span>";
break;
case 3:
echo "<span style='color:red;'>法務件 (訴訟)</span>";
break;
case 4:
echo "折讓";
break;
case 5:
echo "壞帳";
break;
case 99:
echo "完成";
break;
}
?></td> -->
<td><?= $received['invoice_date'] ?></td>
<td><?= number_format($received['invoice_amount']) ?></td>
<td><?= $received['received_date'] ?></td>
<td><?= number_format($received['received_amount']) ?></td>
<td><?= $received['remark'] ?></td>
<td><?php if (in_array(accountidToDepartId($user_id), array('220', '210'))) { ?>
<button type="button" onclick="create('edit',<?= $received['pay_id'] ?>)" class="btn btn-warning btn-sm pull-right" style="margin-right: 10%;margin-bottom: 10px;">
<span class="glyphicon glyphicon-pencil"></span></button>
<a href="account-receivable-received-delete.php?id=<?php echo $received['pay_id'] ?>&<?= $token_link ?>" class="btn btn-danger btn-sm">
<span class=" glyphicon glyphicon-trash"></span>
</a>
<?php } ?>
</td>
</tr>
<?php }
}
?>
} ?>
</tbody>
</table>
</div>

256
wms/account-receivable-contract.php

@ -1,39 +1,245 @@
<?php
include "header.php";
$BillNo = $_GET['BillNo'];
if ($cont['BillNo'] == 'M231067') {
$BillNo = 'SO20230801002';
}
// 合約收款款別名稱
$arrayData = [];
echo "合約號;客戶名稱;1款;金額;2款;金額;3款;金額;4款;金額;5款;金額;6款;金額;7款;金額;8款;金額;9款;金額;10款;金額;11款;金額;12款</br>";
// echo "合約號;客戶名稱;1款;金額;2款;金額;3款;金額;4款;金額;5款;金額;6款;金額;7款;金額;8款;金額;9款;金額;10款;金額;11款;金額;12款</br>";
$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt,s.BizPartnerId,c.BizPartnerName
FROM salOrderStagePay AS a
LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo
LEFT JOIN comBusinessPartner as c ON s.BizPartnerId=c.BizPartnerId
WHERE s.ModeId = 'M' AND (s.CurrentState=2 OR s.CurrentState=4)";
WHERE s.BillNo = '$BillNo'";
// T8發票
//M220478
$sql_invoice = "SELECT DISTINCT
a.InvoiceNo, a.InvoiceTime,a.OAmountWithTax,a.InvoiceState,
b.ProjectId
FROM arSellInvoice as a
LEFT JOIN arSellInvoiceMaterial as b
ON a.BillNo=b.BillNo
WHERE b.ProjectId='$BillNo'";
$contract = $conn->query($sql_contract);
foreach ($contract as $cont) {
if ($cont['BillNo'] == 'SO20230801002') {
$BillNo = 'M231067';
}else{
$BillNo = $cont['BillNo'];
};
$PayStage = $cont['PayStage'];
$PayAmount = $cont['PlanPayAmt'];
$partnerName = $cont['BizPartnerName'];
if(isset($arrayData[$BillNo])){
array_push($arrayData[$BillNo], $PayStage);
array_push($arrayData[$BillNo], $PayAmount);
}else{
$arrayData[$BillNo][0] = $BillNo;
$arrayData[$BillNo][1] = $partnerName;
array_push($arrayData[$BillNo], $PayStage);
array_push($arrayData[$BillNo], $PayAmount);
$invoices = $conn->query($sql_invoice);
// foreach($contract as $con){
// print_r($con);
// echo "<br>";
// }
// foreach ($contract as $cont) {
// if ($cont['BillNo'] == 'SO20230801002') {
// $BillNo = 'M231067';
// }else{
// $BillNo = $cont['BillNo'];
// };
// $PayStage = $cont['PayStage'];
// $PayAmount = $cont['PlanPayAmt'];
// $partnerName = $cont['BizPartnerName'];
// if(isset($arrayData[$BillNo])){
// array_push($arrayData[$BillNo], $PayStage);
// array_push($arrayData[$BillNo], $PayAmount);
// }else{
// $arrayData[$BillNo][0] = $BillNo;
// $arrayData[$BillNo][1] = $partnerName;
// array_push($arrayData[$BillNo], $PayStage);
// array_push($arrayData[$BillNo], $PayAmount);
// }
// };
// foreach($arrayData as $data){
// foreach($data as $value){
// echo $value.";";
// }
// echo "</br>";
// }
?>
<style>
th {
text-align: center;
}
};
foreach($arrayData as $data){
foreach($data as $value){
echo $value.";";
td {
text-align: right;
}
echo "</br>";
</style>
<div class="container">
<div class="text-center" style="margin-bottom: 20px;">
<h3><strong><?= $Bill[4] ?></strong></h3>
</div>
<form class="form-horizontal">
<div class="form-group">
<div class="col-md-3">
<label for="BillNo">合約號</label>
<input type="text" class="form-control" id="BillNo" name="BillNo" value="<?= $Bill[0] ?>" disabled>
</div>
<div class="col-md-3">
<label for="DeptId">部門</label>
<input type="text" class="form-control" id="DeptId" name="DeptId" value="<?= $Bill[1] ?>" disabled>
</div>
<div class="col-md-3">
<label for="Manager">經理</label>
<input type="text" class="form-control" id="Manager" name="Manager" value="<?= $Bill[2] ?>" disabled>
</div>
<div class="col-md-3">
<label for="PersonName">營業員</label>
<input type="text" class="form-control" id="PersonName" name="PersonName" value="<?= $Bill[3] ?>" disabled>
</div>
</div>
<div class="form-group">
<div class="col-md-3">
<label for="EnterpriseName">抬頭</label>
<input type="text" class="form-control" id="EnterpriseName" name="EnterpriseName" value="<?= $Bill[14] ?>" disabled>
</div>
<div class="col-md-3">
<label for="TaxNo">統一編號</label>
<input type="text" class="form-control" id="TaxNo" name="TaxNo" value="<?= $Bill[15] ?>" disabled>
</div>
<div class="col-md-6">
<label for="ContactAddress">聯絡地址</label>
<input type="text" class="form-control" id="ContactAddress" name="ContactAddress" value="<?= $Bill[16] ?>" disabled>
</div>
</div>
<div>
<label for="detail">狀態</label>
<textarea class="form-control" style="height: 150px; width: 50%;" name="detail" id="detail" disabled><?= str_replace("<br>", "\n", $Bill[13]) ?></textarea>
</div>
</form>
<div style="width: auto; margin-top: 30px;">
<table class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th>目前應收</th>
<th>已開發票金額</th>
<th>未開發票金額</th>
<th>已收金額</th>
<th>未收金額</th>
</tr>
</thead>
<tbody>
<tr>
<td><?= number_format(round($Bill[12])) ?></td>
<td><?= number_format(round($Bill[19])) ?></td>
<td><?= number_format(round($Bill[21])) ?></td>
<td><?= number_format(round($Bill[20])) ?></td>
<td><?= number_format(round($Bill[22])) ?></td>
</tr>
</tbody>
</table>
</div>
<div style="width: auto; margin-top: 30px;">
<table 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>
</tr>
</thead>
<tbody>
<tr>
<td><?= number_format(round($Bill[5])) ?></td>
<td><?= number_format(round($Bill[6])) ?></td>
<td><?= number_format(round($Bill[7])) ?></td>
<td><?= number_format(round($Bill[8])) ?></td>
<td><?= number_format(round($Bill[9])) ?></td>
<td><?= number_format(round($Bill[10])) ?></td>
<td><?= number_format(round($Bill[11])) ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php
include "./footer.php";
?>
<?php
if ($user_id == "M0122") {
?>
<button type="button" onclick="create('create',0)" class="btn btn-primary btn-sm pull-right" style="margin-right: 10%;margin-bottom: 10px;">
新增收款紀錄<span class=" glyphicon glyphicon-plus"></span></button>
<?php
}
?>
<div style="margin-right: 10%;margin-left: 10%; justify-content: center;">
<table class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th>發票號碼</th>
<th>發票日期</th>
<th>發票金額</th>
<th>收款日期</th>
<th>收款金額</th>
<th>說明</th>
<th style="width: 10%;">功能</th>
</tr>
</thead>
<tbody>
<?php if (!empty($invoices)) {
foreach ($invoices as $invoice) { ?>
<tr>
<td><?= $invoice['InvoiceNo'] ?></td>
<td><?= date('Y-m-d', strtotime(strval($invoice['InvoiceTime']))) ?></td>
<td><?= number_format($invoice['OAmountWithTax']) ?></td>
<td><?= number_format($received['received_amount']) ?></td>
<td><?= $received['remark'] ?></td>
<td><?php if (in_array(accountidToDepartId($user_id), array('220', '210'))) { ?>
<button type="button" onclick="create('edit',<?= $received['pay_id'] ?>)" class="btn btn-warning btn-sm pull-right" style="margin-right: 10%;margin-bottom: 10px;">
<span class="glyphicon glyphicon-pencil"></span></button>
<a href="account-receivable-received-delete.php?id=<?php echo $received['pay_id'] ?>&<?= $token_link ?>" class="btn btn-danger btn-sm">
<span class=" glyphicon glyphicon-trash"></span>
</a>
<?php } ?>
</td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
<script>
function create(type, pay_id) {
var BillData = <?= $data ?>;
var form = document.createElement("form");
form.method = 'POST';
if (type === 'create') {
form.action = "account-receivable-received-create.php?<?= $token_link ?>";
} else {
form.action = "account-receivable-received-edit.php?pay_id=" + pay_id + "&<?= $token_link ?>";
}
var input = document.createElement("input");
input.type = "hidden";
input.name = "Bill";
input.value = JSON.stringify(BillData);
form.appendChild(input);
document.body.appendChild(form);
form.submit();
}
</script>

115
wms/account-receivable-excel.php

@ -1,51 +1,102 @@
<?php
include "./header.php";
require_once dirname(__DIR__) . '/common/composer/vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$Bill = $_POST['Bill'];
header('Content-Type: application/json');
// $Bill = file_get_contents('php://input');
// $Bill = $_POST['Bill'];
$array_data = array();
$Bill = json_decode($Bill, true);
$Bill = json_decode(file_get_contents("php://input"), true);
// $Bill = json_decode($Bill, true);
foreach ($Bill as $key => $value) {
// for ($i = 0; $i < 17; $i++) {
// $value[$i] = (isset($value[$i])) ? $value[$i] : 0;
// }
$value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0;
$value['second'][3] = (isset($value['second'][3])) ? $value['second'][3] : 0;
$value['arrive'][3] = (isset($value['arrive'][3])) ? $value['arrive'][3] : 0;
$value['install'][3] = (isset($value['install'][3])) ? $value['install'][3] : 0;
$value['tryrun'][3] = (isset($value['tryrun'][3])) ? $value['tryrun'][3] : 0;
$value['check'][3] = (isset($value['check'][3])) ? $value['check'][3] : 0;
$value['delivery'][3] = (isset($value['delivery'][3])) ? $value['delivery'][3] : 0;
$value['final'][3] = (isset($value['final'][3])) ? $value['final'][3] : 0;
$array_data[$key] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$value['sign'][1], $value['second'][1], $value['arrive'][1], $value['install'][1], $value['tryrun'][1], $value['check'][1], $value['delivery'][1], $value['final'][1],
$value['sign'][3], $value['second'][3], $value['arrive'][3], $value['install'][3], $value['tryrun'][3], $value['check'][3], $value['delivery'][3], $value['final'][3],
$value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], str_replace('<br>', '; ', $value['facilities'])
];
}
// 檢查是否有 POST 資料
// if ($_SERVER["REQUEST_METHOD"] == "POST") {
// // 獲取 POST 資料
// // $postData = $_POST['Bill'];
// // 指定儲存資料的檔案路徑
// $filePath = 'Bill.txt';
// // 寫入檔案
// // 使用 FILE_APPEND 選項,以便將資料附加到檔案的末尾而不是覆寫檔案
// file_put_contents($filePath, $Bill . PHP_EOL, FILE_APPEND);
// echo '資料已成功寫入檔案。';
// } else {
// echo '請透過正確的方式訪問此頁面。';
// }
// exit();
// print_r($Bill);
// foreach ($Bill as $key => $value) {
// $value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0;
// $value['second'][3] = (isset($value['second'][3])) ? $value['second'][3] : 0;
// $value['arrive'][3] = (isset($value['arrive'][3])) ? $value['arrive'][3] : 0;
// $value['install'][3] = (isset($value['install'][3])) ? $value['install'][3] : 0;
// $value['tryrun'][3] = (isset($value['tryrun'][3])) ? $value['tryrun'][3] : 0;
// $value['check'][3] = (isset($value['check'][3])) ? $value['check'][3] : 0;
// $value['delivery'][3] = (isset($value['delivery'][3])) ? $value['delivery'][3] : 0;
// $value['final'][3] = (isset($value['final'][3])) ? $value['final'][3] : 0;
// $array_data[$key] = [
// $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
// $value['sign'][1], $value['sign'][3], $value['sign']['max'], $value['sign']['min'],
// $value['second'][1], $value['second'][3], $value['second']['max'], $value['second']['min'],
// $value['arrive'][1], $value['arrive'][3], $value['arrive']['max'], $value['arrive']['min'],
// $value['install'][1], $value['install'][3], $value['install']['max'], $value['install']['min'],
// $value['tryrun'][1], $value['tryrun'][3], $value['tryrun']['max'], $value['tryrun']['min'],
// $value['check'][1], $value['check'][3], $value['check']['max'], $value['check']['min'],
// $value['delivery'][1], $value['delivery'][3], $value['delivery']['max'], $value['delivery']['min'],
// $value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'],
// $value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], str_replace('<br>', '; ', $value['facilities'])
// ];
// $array_data[$key] = [
// $key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
// $value['sign'][1], $value['second'][1], $value['arrive'][1], $value['install'][1], $value['tryrun'][1], $value['check'][1], $value['delivery'][1], $value['final'][1],
// $value['sign'][3], $value['second'][3], $value['arrive'][3], $value['install'][3], $value['tryrun'][3], $value['check'][3], $value['delivery'][3], $value['final'][3],
// $value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], str_replace('<br>', '; ', $value['facilities'])
// ];
// }
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$colomnHeader = [
'合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
'簽約款', '二次款', '貨抵工地款', '安裝款', '試車款', '官檢款', '交車款', '尾款',
'目前應收簽約款', '目前應收二次款', '目前應收貨抵工地款', '目前應收安裝款', '目前應收試車款', '目前應收官檢款', '目前應收交車款', '目前應收尾款',
'目前應收', '已開發票金額', '已收金額', '作番狀態'
'簽約款', '簽約款目前應收', '簽約最大催收次數', '簽約最小應收次數',
'二次款', '二次款目前應收', '二次最大催收次數', '二次最小應收次數',
'貨抵工地款', '貨抵工地款目前應收', '貨抵工地最小催收次數', '貨抵工地最小應收次數',
'安裝款', '安裝款目前應收', '安裝最大催收次數', '安裝最小應收次數',
'試車款', '試車款目前應收', '試車最大催收次數', '試車最小應收次數',
'官檢款', '官檢款目前應收', '官檢最大催收次數', '官檢最小應收次數',
'交車款', '交車款目前應收', '交車最大催收次數', '交車最小應收次數',
'尾款', '尾款目前應收', '尾款最大催收次數', '尾款最小應收次數',
'合約總金額', '目前應收', '已開發票金額', '已收金額', '作番狀態'
];
// $colomnHeader = [
// '合約號', '部門', '經理', '營業員', '客戶名稱', '統一編號', '聯絡地址', '抬頭',
// '簽約款', '二次款', '貨抵工地款', '安裝款', '試車款', '官檢款', '交車款', '尾款',
// '目前應收簽約款', '目前應收二次款', '目前應收貨抵工地款', '目前應收安裝款', '目前應收試車款', '目前應收官檢款', '目前應收交車款', '目前應收尾款',
// '合約總金額', '目前應收', '已開發票金額', '已收金額', '作番狀態'
// ];
$sheet->fromArray($colomnHeader, NULL, 'A1');
$rowIndex = 2;
foreach ($array_data as $key => $value) {
$sheet->fromArray([$value], NULL, 'A' . $rowIndex);
$sheet->getStyle('AB' . $rowIndex)->getAlignment()->setWrapText(true);
$column = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','AA'];
foreach($column as $col) {
$sheet->getColumnDimension($col)->setAutoSize(true);
foreach ($Bill as $key => $value) {
$sheet->fromArray($value, 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', 'Y', 'Z',
'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS'
];
foreach ($column as $col) {
if ($col == 'AS') {
$sheet->getStyle('AS' . $rowIndex)->getAlignment()->setWrapText(true);
} else {
$sheet->getColumnDimension($col)->setAutoSize(true);
}
}
$rowIndex++;
}
$writer = new Xlsx($spreadsheet);

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

@ -0,0 +1,855 @@
<?php
include "header.php";
$follower = find_follow($user_id);
$arrayData = [];
$receivable_array = [];
// T8發票 (有專案的發票)
$sql_invoice = "SELECT DISTINCT
a.InvoiceNo, a.InvoiceTime,a.OAmountWithTax,a.InvoiceState,
b.ProjectId
FROM arSellInvoice as a
LEFT JOIN arSellInvoiceMaterial as b
ON a.BillNo=b.BillNo
WHERE DATALENGTH(b.ProjectId)>0";
// T8核銷
$sql_received = "SELECT
a.BillNo, a.WriteOffBizPartnerId,a.PayWriteOffOAmount,
b.FromBillDate AS ReceivedDate,b.CurrWOFeeOAmt AS Fee,
c.OrderBillNo, c.checkBillNo, c.InvoiceNo, c.BillDate AS CheckBillDate
FROM arWriteOffBill AS a
LEFT JOIN arWriteOffBillRec AS b ON a.BillNo=b.BillNo
LEFT JOIN
(SELECT temp1.*,arWriteOffBillDetail.* FROM arWriteOffBillDetail
LEFT JOIN
(SELECT
arCheckBill.BillNo AS checkBillNo, arCheckBill.BillDate,arCheckBillInvInfo.InvoiceNo
FROM arCheckBill
LEFT JOIN arCheckBillInvInfo
ON arCheckBill.InvoiceBillNo=arCheckBillInvInfo.InvoiceBillNo) AS temp1
ON temp1.checkBillNo = arWriteOffBillDetail.FromBillNo) AS c
ON a.BillNo=c.BillNo
WHERE DATALENGTH(c.OrderBillNo) >0";
//T8 銷售訂單 階段收款計畫
$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt, a.PlanPayDate,s.BizPartnerId,c.BizPartnerName, s.PersonId,
c.EnterpriseName, c.TaxNo, c.ContactAddress FROM salOrderStagePay AS a
LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo
LEFT JOIN comBusinessPartner AS c ON s.BizPartnerId=c.BizPartnerId
WHERE s.ModeId = 'M' AND (s.CurrentState=2 OR s.CurrentState=4) ";
// 期初收款資訊
$sql_opening = "
SELECT * FROM account_received ";
// 設定權限:看到自己的/下屬的,資訊處跟財會處可以看全部的
if (!(in_array(accountidToDepartId($user_id), array('220', '210')))) {
$sql_contract .= "AND (s.PersonId = '$user_id'";
$sql_received .= " AND (PersonId = '$user_id'";
$sql_opening .= " OR person_id = '$user_id'";
if (count($follower) > 0) {
$column_str = "('$user_id'" . ",'";
$column_str .= implode("','", $follower);
$column_str .= "')";
$sql_contract .= " OR s.PersonId IN $column_str)";
$sql_received .= " OR PersonId IN $column_str)";
$sql_opening .= " OR person_id IN $column_str)";
} else {
$sql_contract .= ")";
$sql_received .= ")";
$sql_opening .= ")";
};
}
$contract = $conn->query($sql_contract);
$received_array = $conn->query($sql_received);
$opening_data = mysqli_query($link, $sql_opening);
$invoice_data = $conn->query($sql_invoice);
// 合約收款階段內容分類
$sign60 = array('簽訂後60天', '簽約60日', '簽約後60天', '簽訂後60日內', '訂金支付後60天');
$sign90 = array('簽約後90天', '簽約後90日', '簽訂後90天');
$sign120 = array('簽約後120天', '簽約後120日', '簽訂後120天');
// 將T8合約收款階段資料依據款別分類放進arraData裡
foreach ($contract as $cont) {
if ($cont['BillNo'] == 'SO20230801001') {
$BillNo = 'M230947';
} elseif ($cont['BillNo'] == 'SO20230801002') {
$BillNo = 'M231067';
} else {
$BillNo = $cont['BillNo'];
};
$PayStage = $cont['PayStage'];
$PlanPayDate = $cont['PlanPayDate'];
$PayAmount = $cont['PlanPayAmt'];
$partnerName = $cont['BizPartnerName'];
$EnterpriseName = $cont['EnterpriseName'];
$TaxNo = $cont['TaxNo'];
$ContactAddress = $cont['ContactAddress'];
//['sign'] 0 款項名稱 1 簽約金額 2 簽約日期 3 應收金額 min 最早應收月份 max 最晚應收月份 ['second'] 0 二次款名 1 二次款金額 2 收款日期 ['arrive'] 0 貨抵工地款名稱 1 貨抵工地款金額 2 貨抵工地收款日期 ['install'] 0 安裝款名 1 安裝金額 2 安裝收款日期
//['tryrun'] 0 試車款名 1試車金額 2 試車收款日期 ['check'] 0 官檢款名 1 官檢金額 2 官檢收款日期 ['delivery'] 0 交車款名 1 交車金額 2 交車收款日期 ['final'] 0 尾款名 1 尾款金額 2 尾款收款日期
if (!(isset($arrayData[$BillNo]))) {
// 0 部門id 1 部門名稱 2 經理名稱 3 營業員id 4 營業員名稱 5 客戶名稱 6 抬頭 7 統編 8 通訊地址
$arrayData[$BillNo] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
$arrayData[$BillNo][5] = $partnerName;
$arrayData[$BillNo][6] = $EnterpriseName;
$arrayData[$BillNo][7] = $TaxNo;
$arrayData[$BillNo][8] = $ContactAddress;
$arrayData[$BillNo]['total_budget'] = 0;
$arrayData[$BillNo]['invoice'] = array();
$arrayData[$BillNo]['received_budget'] = 0;
$arrayData[$BillNo]['invoice_budget'] = 0;
$arrayData[$BillNo]['sign'][1] = $arrayData[$BillNo]['second'][1] = $arrayData[$BillNo]['arrive'][1] = $arrayData[$BillNo]['install'][1] = $arrayData[$BillNo]['tryrun'][1] = $arrayData[$BillNo]['check'][1] = $arrayData[$BillNo]['delivery'][1] = $arrayData[$BillNo]['final'][1] = 0;
$arrayData[$BillNo]['sign']['min'] = $arrayData[$BillNo]['second']['min'] = $arrayData[$BillNo]['arrive']['min'] = $arrayData[$BillNo]['install']['min'] = $arrayData[$BillNo]['tryrun']['min'] = $arrayData[$BillNo]['check']['min'] = $arrayData[$BillNo]['delivery']['min'] = $arrayData[$BillNo]['final']['min'] = array();
$arrayData[$BillNo]['sign']['max'] = $arrayData[$BillNo]['second']['max'] = $arrayData[$BillNo]['arrive']['max'] = $arrayData[$BillNo]['install']['max'] = $arrayData[$BillNo]['tryrun']['max'] = $arrayData[$BillNo]['check']['max'] = $arrayData[$BillNo]['delivery']['max'] = $arrayData[$BillNo]['final']['max'] = array();
$arrayData[$BillNo]['facilities'] = "";
$arrayData[$BillNo]['total_facility_num'] = $arrayData[$BillNo]['delivery_num'] = $arrayData[$BillNo]['check_num'] = $arrayData[$BillNo]['tryrun_num'] = $arrayData[$BillNo]['install_num'] = $arrayData[$BillNo]['arrive_num'] = $arrayData[$BillNo]['second_num'] = $arrayData[$BillNo]['receivable_budget'] = 0;
}
if (stristr($PayStage, '二次款') || stristr($PayStage, '出貨前') || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60') || stristr($PayStage, '寶佳出貨後10天')) {
$arrayData[$BillNo]['second'][0] = $PayStage;
$arrayData[$BillNo]['second'][1] = $PayAmount;
$arrayData[$BillNo]['second'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
if (isset($arrayData[$BillNo]['sign'][2]) && !is_null($arrayData[$BillNo]['sign'][2])) {
$signtime = strtotime(strval($arrayData[$BillNo]['sign'][2]));
if (in_array($PayStage, $sign60)) {
$secondtime = $signtime + (60 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
} elseif (in_array($PayStage, $sign90)) {
$secondtime = $signtime + (90 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
} elseif (in_array($PayStage, $sign120)) {
$secondtime = $signtime + (120 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
} elseif (stristr($PayStage, '簽訂後30天')) {
$secondtime = $signtime + (30 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
}
}
} elseif ($PayStage == '簽約' || stristr($PayStage, '簽定') || stristr($PayStage, '簽訂') || stristr($PayStage, '訂金') || stristr($PayStage, '工地動工') || stristr($PayStage, '寶佳出貨前30天')) {
$arrayData[$BillNo]['sign'][0] = $PayStage;
$arrayData[$BillNo]['sign'][1] = $PayAmount;
$arrayData[$BillNo]['sign'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
$arrayData[$BillNo]['receivable_budget'] += $PayAmount;
if (isset($PlanPayDate) && !empty($PlanPayDate)) {
array_push($arrayData[$BillNo]['sign']['min'], strval($PlanPayDate));
array_push($arrayData[$BillNo]['sign']['max'], strtotime(strval($PlanPayDate)));
}
} elseif (stristr($PayStage, '試車')) {
$arrayData[$BillNo]['tryrun'][0] = $PayStage;
$arrayData[$BillNo]['tryrun'][1] = $PayAmount;
$arrayData[$BillNo]['tryrun'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
} elseif (stristr($PayStage, '安裝') || stristr($PayStage, '貨抵工地且完工')) {
$arrayData[$BillNo]['install'][0] = $PayStage;
$arrayData[$BillNo]['install'][1] = $PayAmount;
$arrayData[$BillNo]['install'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
} elseif (stristr($PayStage, '貨抵工地') || stristr($PayStage, '貨底工地')) {
$arrayData[$BillNo]['arrive'][0] = $PayStage;
$arrayData[$BillNo]['arrive'][1] = $PayAmount;
$arrayData[$BillNo]['arrive'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
} elseif (stristr($PayStage, '得合格函後6個月') || stristr($PayStage, '核可函取得後6個月') || stristr($PayStage, '交車')) {
$arrayData[$BillNo]['delivery'][0] = $PayStage;
$arrayData[$BillNo]['delivery'][1] = $PayAmount;
$arrayData[$BillNo]['delivery'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
} elseif (stristr($PayStage, '合格') || stristr($PayStage, '驗收') || stristr($PayStage, '許可') || stristr($PayStage, '核可')) {
$arrayData[$BillNo]['check'][0] = $PayStage;
$arrayData[$BillNo]['check'][1] = $PayAmount;
$arrayData[$BillNo]['check'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
} elseif (stristr($PayStage, '驗收完成')) {
$arrayData[$BillNo]['final'][0] = $PayStage;
$arrayData[$BillNo]['final'][1] = $PayAmount;
$arrayData[$BillNo]['final'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
} else {
$arrayData[$BillNo]['other'][1] = $PayAmount;
$arrayData[$BillNo]['other'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
}
}
//取作番大日程作番與時程
// real_contract_arrival_date 預計出貨日
// real_arrival_date 實際出貨日
$sql = "SELECT
tmp2.*,
d.name AS depart_name
FROM(
SELECT
a.manager,
a2.name as manager_name,
a.name,
a.department_id,
w.salesid,
w.contractno,
w.facilityno,
w.estimated_shipping_date,
w.real_contract_arrival_date,
w.actual_tofactory_date,
w.real_contract_arrival_date,
w.real_arrival_date,
w.install_end_date,
w.tryrun_end_date,
w.official_check_date,
w.delivery_date
from wipwholestatus AS w
left join account AS a
ON w.salesid = a.accountid
left join account AS a2
ON a2.accountid = a.manager
where w.status = '1' AND w.contract_type='A'
)AS tmp2
left join (
SELECT DISTINCT
department_id,
name
FROM department
) AS d
ON d.department_id = tmp2.department_id ORDER BY contractno";
$wipwhole_array = mysqli_query($link, $sql);
foreach ($wipwhole_array as $wip) {
if (isset($arrayData[$wip['contractno']])) {
// 整理合約資料
$arrayData[$wip['contractno']][0] = $wip['department_id'];;
$arrayData[$wip['contractno']][1] = $wip['depart_name'];
$arrayData[$wip['contractno']][2] = $wip['manager_name'];
$arrayData[$wip['contractno']][3] = $wip['salesid'];
$arrayData[$wip['contractno']][4] = $wip['name'];
$arrayData[$wip['contractno']][10] = $wip['contractno'];
// [合約號][作番號]['no']
$arrayData[$wip['contractno']][$wip['facilityno']]['no'] = $wip['facilityno'];
// [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期]
// [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期]
// [合約號][作番號][款別] ['rec'] [金額]/[實際收款日期]
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($contractstage as $i) {
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['date'] = "";
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['budget'] = 0;
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['rec']['date'] = "";
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['rec']['budget'] = 0;
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['con']['date'] = (isset($arrayData[$wip['contractno']][$i][2])) ? $arrayData[$wip['contractno']][$i][2] : "";
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['con']['budget'] = 0;
}
// 補上寶佳 (出貨前) 收款時間
if (isset($arrayData[$wip['contractno']]['sign'][0]) && $arrayData[$wip['contractno']]['sign'][0] == '寶佳出貨前30天') {
if ($wip['real_arrival_date'] != NULL) {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$signtime = $estimate_delivery_time - (30 * 86400);
$signtime = date('Ymd', $signtime);
$arrayData[$wip['contractno']]['sign'][2] = strval($signtime);
array_push($arrayData[$wip['contractno']]['sign']['max'], strtotime(strval($signtime)));
array_push($arrayData[$wip['contractno']]['sign']['min'], strtotime(strval($signtime)));
} elseif ($wip['real_contract_arrival_date'] != NULL) {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$signtime = $estimate_delivery_time - (30 * 86400);
$signtime = date('Ymd', $signtime);
$arrayData[$wip['contractno']]['sign'][2] = strval($signtime);
array_push($arrayData[$wip['contractno']]['sign']['max'], strtotime(strval($signtime)));
array_push($arrayData[$wip['contractno']]['sign']['min'], strtotime(strval($signtime)));
}
}
// 補上二次款 (出貨前) 收款時間,條件不是"出貨前"就pass
if (isset($arrayData[$wip['contractno']]['second'][0]) && stristr($arrayData[$wip['contractno']]['second'][0], '出貨前30天')) {
if (empty($wip['real_contract_arrival_date'])) {
} else {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$secondtime = $estimate_delivery_time - (30 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime(strval($secondtime)));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
}
} elseif (isset($arrayData[$wip['contractno']]['second'][0]) && stristr($arrayData[$wip['contractno']]['second'][0], '出貨前90天')) {
if (empty($wip['real_contract_arrival_date'])) {
} else {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$secondtime = $estimate_delivery_time - (90 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime(strval($secondtime)));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
}
} elseif (isset($arrayData[$wip['contractno']]['second'][0]) && $arrayData[$wip['contractno']]['second'][0] == '寶佳出貨後10天') {
if ($wip['real_arrival_date'] != NULL) {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$secondtime = $estimate_delivery_time + (10 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime(strval($secondtime)));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
} else {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$secondtime = $estimate_delivery_time + (10 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime($secondtime));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
}
}
//根據作番狀態填入facilities,計算各階段數量、一個合約有幾個作番,增加作番資料
// real_contract_arrival_date 預計出貨日=預計到貨日=預計貨抵工地
// real_arrival_date 實際出貨日=實際到貨日=實際貨抵工地
if ($wip['delivery_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['delivery_num'] += 1;
$arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if ($arrayData[$wip['contractno']]['delivery'][0] == "交車後270天") {
$estimate_delivery_time = strtotime($wip['delivery_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['delivery'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['delivery'][2] = strval($wip['delivery_date']);
array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($wip['delivery_date'])));
array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($wip['delivery_date'])));
}
if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['check']['min'], strtotime(strval($wip['official_check_date'])));
array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date'])));
}
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") {
$estimate_delivery_time = strtotime($wip['tryrun_end_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
}
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['official_check_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['check']['min'], strval($wip['official_check_date']));
array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date'])));
}
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") {
$estimate_delivery_time = strtotime($wip['tryrun_end_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
}
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strval($wip['install_end_date']));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['tryrun_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strval($wip['tryrun_end_date']));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strval($wip['install_end_date']));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['install_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strval($wip['install_end_date']));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strtotime(strval($wip['install_end_date']))));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['real_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} elseif (($arrayData[$wip['contractno']]['second'] != NULL) && (isset($arrayData[$wip['contractno']]['second'][2])) && ($arrayData[$wip['contractno']]['second'][2] <= date('Ymd'))) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (已達二次款收款條件) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
} else {
if ($wip['real_contract_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
} elseif ($wip['estimated_shipping_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
} else {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (預計出港日待確認) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
}
}
}
}
// 計算每個合約的應收款、作番總數
foreach ($arrayData as &$value) {
if ($value['total_facility_num'] > 0) {
$value['receivable_budget'] += ($value['second'][1] * ($value['second_num'] / $value['total_facility_num'])) +
($value['arrive'][1] * ($value['arrive_num'] / $value['total_facility_num'])) + ($value['install'][1] * ($value['install_num'] / $value['total_facility_num'])) +
($value['tryrun'][1] * ($value['tryrun_num'] / $value['total_facility_num'])) + ($value['check'][1] * ($value['check_num'] / $value['total_facility_num'])) +
(($value['delivery'][1] + $value['final'][1]) * ($value['delivery_num'] / $value['total_facility_num']));
$value['sign'][3] = $value['sign'][1];
$value['second'][3] = $value['second'][1] * ($value['second_num'] / $value['total_facility_num']);
$value['arrive'][3] = $value['arrive'][1] * ($value['arrive_num'] / $value['total_facility_num']);
$value['install'][3] = $value['install'][1] * ($value['install_num'] / $value['total_facility_num']);
$value['tryrun'][3] = $value['tryrun'][1] * ($value['tryrun_num'] / $value['total_facility_num']);
$value['check'][3] = $value['check'][1] * ($value['check_num'] / $value['total_facility_num']);
$value['delivery'][3] = $value['delivery'][1] * ($value['delivery_num'] / $value['total_facility_num']);
$value['final'][3] = $value['final'][1] * ($value['delivery_num'] / $value['total_facility_num']);
}
$stagearray = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
$today = date('Ym01', strtotime('-1 month', strtotime(date('Ym01'))));
// $today = strtotime($today,);
// echo "today: " . $today . "<br>";
// exit();
// foreach ($stagearray as $stage) {
// // 計算月份差距
// if (empty($value[$stage]['min'])==0) {
// print_r($value[$stage]['min']);
// echo "<br>";
// // $maxtime = array_map('strtotime', $value[$stage]['min']);
// $earliestDate = min($value[$stage]['min']);
// $earliestMonth = date('Ym01', $earliestDate);
// echo "earliestDate: " . $earliestDate . "<br>";
// // $earliestMonth = date('n', strtotime($earliestDate));
// // 計算月份差距
// $maxDifference = $today -$earliestMonth;
// echo "difference = ".$maxDifference."<br>";
// $value[$stage]['max'] = $maxDifference;
// } else {
// $value[$stage]['max'] = 0;
// }
// echo $value[$stage]['max'];
// echo "<br>--------------------<br>";
// exit();
// if(!empty($value[$stage]['max']) && $value[$stage]['max'] !==10 && $value[$stage]['max'] !==1){
// echo "max: " . $value[$stage]['max'] . "<br>";
// if (!empty($value[$stage]['max'])) {
// $mintime = array_map('strtotime', $value[$stage]['max']);
// $latestDate = max($mintime);
// $latestMonth = date('n', strtotime($latestDate));
// $minDifference = abs($latestMonth - $today);
// $value[$stage]['min'] = $minDifference;
// } else {
// $value[$stage]['min'] = 0;
// }
// }else{
// $value[$stage]['min'] = 0;
// }
// }
}
// [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期]
// [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期]
// [合約號][作番號][款別] ['rec'] [金額]/[實際收款日期]
foreach ($wipwhole_array as $wip) {
if (isset($arrayData[$wip['contractno']]) && isset($arrayData[$wip['contractno']][$wip['facilityno']]) && !empty($arrayData[$wip['contractno']]['total_facility_num'])) {
$stagearray = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($stagearray as $stage) {
$arrayData[$wip['contractno']][$wip['facilityno']][$stage]['con'] = $arrayData[$wip['contractno']][$stage][1] / $arrayData[$wip['contractno']]['total_facility_num'];
}
}
}
// [invoice][發票號碼][0 發票日期, 1 發票金額, 2 發票狀態, 3 收款日期, 4 收款金額, 5 手續費, 6 核銷單號]
foreach ($invoice_data as $invoice) {
if (isset($arrayData[$invoice['ProjectId']])) {
$arrayData[$invoice['ProjectId']]['invoice_budget'] += intval($invoice['OAmountWithTax']);
$arrayData[$invoice['ProjectId']]['invoice'][$invoice['InvoiceNo']] = [date("Ymd", strtotime($invoice['InvoiceTime'])), $invoice['OAmountWithTax'], $invoice['InvoiceState']];
}
}
// 把核銷單的內容補到發票資料中
foreach ($received_array as $received) {
if ($received['OrderBillNo'] == 'SO20230801001') {
$BillNo = 'M230947';
} elseif ($received['OrderBillNo'] == 'SO20230801002') {
$BillNo = 'M231067';
} else {
$BillNo = $received['OrderBillNo'];
};
if (isset($arrayData[$BillNo])) {
if (isset($arrayData[$BillNo]['invoice'][$received['InvoiceNo']])) {
$arrayData[$BillNo]['received_budget'] += $received['PayWriteOffOAmount'];
array_push($arrayData[$BillNo]['invoice'][$received['InvoiceNo']], date($received['ReceivedDate']), $received['PayWriteOffOAmount'], $received['Fee'], $received['BillNo']);
}
}
}
foreach ($arrayData as $key => $value) {
print_r($value);
echo "<br>";
}
$data = json_encode($arrayData);
?>
<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>
<button type="button" onclick="downloadData()" class="btn btn-warning btn-lg pull-right"><span class="glyphicon glyphicon-download-alt"></span></button>
<div style="width:98%;margin:1% ;overflow-x: auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th style="width: 120px;">合約號</th>
<th style="width: 120px;">部門</th>
<th style="width: 120px;">經理</th>
<th style="width: 120px;">營業員</th>
<th style="width: 180px;">客戶名稱</th>
<th style="width: 150px;">簽約款</th>
<th style="width: 150px;">應收簽約金額</th>
<th style="width: 150px;">簽約最大催收次數</th>
<th style="width: 150px;">簽約最小催收次數</th>
<th style="width: 150px;">二次款</th>
<th style="width: 150px;">應收二次金額</th>
<th style="width: 150px;">二次最大催收次數</th>
<th style="width: 150px;">二次最小催收次數</th>
<th style="width: 150px;">貨抵工地款</th>
<th style="width: 150px;">應收貨抵工地金額</th>
<th style="width: 150px;">貨抵工地最大催收次數</th>
<th style="width: 150px;">貨抵工地最小催收次數</th>
<th style="width: 150px;">安裝款</th>
<th style="width: 150px;">應收安裝金額</th>
<th style="width: 150px;">安裝最大催收次數</th>
<th style="width: 150px;">安裝最小催收次數</th>
<th style="width: 150px;">試車款</th>
<th style="width: 150px;">應收試車金額</th>
<th style="width: 150px;">試車最大催收次數</th>
<th style="width: 150px;">試車最小催收次數</th>
<th style="width: 150px;">官檢款</th>
<th style="width: 150px;">應收官檢金額</th>
<th style="width: 150px;">官檢最大催收次數</th>
<th style="width: 150px;">官檢最小催收次數</th>
<th style="width: 150px;">移交款</th>
<th style="width: 150px;">應收移交金額</th>
<th style="width: 150px;">移交最大催收次數</th>
<th style="width: 150px;">移交最小催收次數</th>
<th style="width: 150px;">尾款</th>
<th style="width: 150px;">應收尾款金額</th>
<th style="width: 150px;">尾款最大催收次數</th>
<th style="width: 150px;">尾款最小催收次數</th>
<th style="width: 150px;">合約總金額</th>
<th style="width: 150px;" style="width: 120px;">目前應收</th>
<th style="width: 150px;" style="width: 120px;">已開發票金額</th>
<th style="width: 150px;">已收金額</th>
<!-- <th>作番狀態</th> -->
<!-- <th style="width: 100px;">收款狀態</th> -->
</tr>
</thead>
<tbody>
<?php
foreach ($arrayData as $key => $value) {
?>
<tr>
<th><?= $key ?></th>
<td><?= $value[1] ?></td>
<td><?= $value[2] ?></td>
<td><?= $value[4] ?></td>
<td><?= $value[5] ?></td>
<td><?= number_format(round($value['sign'][1])) ?></td>
<td style="text-align: end;"><?= isset($value['sign'][3]) ? number_format(round($value['sign'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['sign']['min']) ? $value['sign']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['sign']['max']) ? $value['sign']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['second'][1]) ? number_format(round($value['second'][1])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['second'][3]) ? number_format(round($value['second'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['second']['min']) ? $value['second']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['second']['max']) ? $value['second']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['arrive'][1]) ? number_format(round($value['arrive'][1])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['arrive'][3]) ? number_format(round($value['arrive'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['arrive']['min']) ? $value['arrive']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['arrive']['max']) ? $value['arrive']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['install'][1]) ? number_format(round($value['install'][1])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['install'][3]) ? number_format(round($value['install'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['install']['min']) ? $value['install']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['install']['max']) ? $value['install']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['tryrun'][1]) ? number_format(round($value['tryrun'][1])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['tryrun'][3]) ? number_format(round($value['tryrun'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['tryrun']['min']) ? $value['tryrun']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['tryrun']['max']) ? $value['tryrun']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['check'][1]) ? number_format(round($value['check'][1])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['check'][3]) ? number_format(round($value['check'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['check']['min']) ? $value['check']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['check']['max']) ? $value['check']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['delivery'][1]) ? number_format(round($value['delivery'][1])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['delivery'][3]) ? number_format(round($value['delivery'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['delivery']['min']) ? $value['delivery']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['delivery']['max']) ? $value['delivery']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['final'][1]) ? number_format(round($value['final'][1])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['final'][3]) ? number_format(round($value['final'][3])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['final']['min']) ? $value['final']['min'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['final']['max']) ? $value['final']['max'] : '--' ?></td>
<td style="text-align: end;"><?= isset($value['total_budget']) ? number_format(round($value['total_budget'])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['receivable_budget']) ? number_format(round($value['receivable_budget'])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['invoice_budget']) ? number_format(round($value['invoice_budget'])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['received_budget']) ? number_format(round($value['received_budget'])) : '--' ?></td>
<!-- <td style="text-align: start;"><?= $value['facilities'] ?></td>
<td><button type="button" onclick="sendData('<?= $key ?>')" class="btn btn-primary btn-sm"><span class=" glyphicon glyphicon-search"></span></button>
</td> -->
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<script>
function test() {
var BillData = <?= $data ?>;
var form = document.createElement("form");
form.method = 'POST';
form.action = "account-receivable-excel.php?<?= $token_link ?>";
var input = document.createElement("input");
input.type = "hidden";
input.name = "Bill";
input.value = JSON.stringify(BillData);
form.appendChild(input);
document.body.appendChild(form);
form.submit();
}
function downloadData() {
var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>";
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var file_path = xhr.responseText;
var link = document.createElement('a');
var name = "應收帳款" + "<?= date('Y-m-d-Hm') ?>" + ".xlsx";
link.setAttribute('href', window.location.origin + "/wms/account-receivable.xlsx");
link.setAttribute('download', name);
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
xhr.send(JSON.stringify({
Bill: <?= $data ?>
}));
}
function sendData(BillNo) {
var BillData = <?= $data ?>;
var Bill = BillData[BillNo];
var form = document.createElement("form");
form.method = 'POST';
form.action = "account-receivable-check.php?<?= $token_link ?>";
var input = document.createElement("input");
input.type = "hidden";
input.name = "Bill";
input.value = JSON.stringify(Bill);
form.appendChild(input);
document.body.appendChild(form);
form.submit();
}
</script>

739
wms/account-receivable-index.php

@ -32,6 +32,7 @@ LEFT JOIN
ON a.BillNo=c.BillNo
WHERE DATALENGTH(c.OrderBillNo) >0";
//T8 銷售訂單 階段收款計畫
$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt, a.PlanPayDate,s.BizPartnerId,c.BizPartnerName, s.PersonId,
c.EnterpriseName, c.TaxNo, c.ContactAddress FROM salOrderStagePay AS a
LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo
@ -105,9 +106,9 @@ foreach ($contract as $cont) {
$arrayData[$BillNo]['sign']['min'] = $arrayData[$BillNo]['second']['min'] = $arrayData[$BillNo]['arrive']['min'] = $arrayData[$BillNo]['install']['min'] = $arrayData[$BillNo]['tryrun']['min'] = $arrayData[$BillNo]['check']['min'] = $arrayData[$BillNo]['delivery']['min'] = $arrayData[$BillNo]['final']['min'] = array();
$arrayData[$BillNo]['sign']['max'] = $arrayData[$BillNo]['second']['max'] = $arrayData[$BillNo]['arrive']['max'] = $arrayData[$BillNo]['install']['max'] = $arrayData[$BillNo]['tryrun']['max'] = $arrayData[$BillNo]['check']['max'] = $arrayData[$BillNo]['delivery']['max'] = $arrayData[$BillNo]['final']['max'] = array();
$arrayData[$BillNo]['facilities'] = "";
$arrayData[$BillNo]['total_facility_num'] = $arrayData[$BillNo]['delivery_num'] = $arrayData[$BillNo]['check_num'] = $arrayData[$BillNo]['tryrun_num'] = $arrayData[$BillNo]['install_num'] = $arrayData[$BillNo]['arrive_num'] = $arrayData[$BillNo]['second_num'] = $arrayData[$BillNo]['receivable_budget'] = 0;
$arrayData[$BillNo]['total_facility_num'] = $arrayData[$BillNo]['delivery_num'] = $arrayData[$BillNo]['check_num'] = $arrayData[$BillNo]['tryrun_num'] = $arrayData[$BillNo]['install_num'] = $arrayData[$BillNo]['arrive_num'] = $arrayData[$BillNo]['second_num'] = $arrayData[$BillNo]['sign_num'] = $arrayData[$BillNo]['receivable_budget'] = 0;
}
if (stristr($PayStage, '二次款') || stristr($PayStage, '出貨前') || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60')) {
if (stristr($PayStage, '二次款') || (stristr($PayStage, '出貨前') && $PayStage != "寶佳出貨前30天") || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60') || stristr($PayStage, '寶佳出貨後10天')) {
$arrayData[$BillNo]['second'][0] = $PayStage;
$arrayData[$BillNo]['second'][1] = $PayAmount;
$arrayData[$BillNo]['second'][2] = $PlanPayDate;
@ -117,28 +118,31 @@ foreach ($contract as $cont) {
if (in_array($PayStage, $sign60)) {
$secondtime = $signtime + (60 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = intval($secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
} elseif (in_array($PayStage, $sign90)) {
$secondtime = $signtime + (90 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = intval($secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
} elseif (in_array($PayStage, $sign120)) {
$secondtime = $signtime + (120 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = intval($secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
} elseif (stristr($PayStage, '簽訂後30天')) {
$secondtime = $signtime + (30 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$BillNo]['second'][2] = intval($secondtime);
$arrayData[$BillNo]['second'][2] = strval($secondtime);
}
}
} elseif ($PayStage == '簽約' || stristr($PayStage, '簽定') || stristr($PayStage, '簽訂') || stristr($PayStage, '訂金') || stristr($PayStage, '工地動工')) {
} elseif ($PayStage == '簽約' || stristr($PayStage, '簽定') || stristr($PayStage, '簽訂') || stristr($PayStage, '訂金') || stristr($PayStage, '工地動工') || $PayStage == '寶佳出貨前30天') {
$arrayData[$BillNo]['sign'][0] = $PayStage;
$arrayData[$BillNo]['sign'][1] = $PayAmount;
$arrayData[$BillNo]['sign'][2] = $PlanPayDate;
$arrayData[$BillNo]['total_budget'] += $PayAmount;
array_push($arrayData[$BillNo]['sign']['min'], intval(substr($PlanPayDate, 4, 2)));
array_push($arrayData[$BillNo]['sign']['max'], intval(substr($PlanPayDate, 4, 2)));
$arrayData[$BillNo]['receivable_budget'] += $PayAmount;
if (isset($PlanPayDate) && !empty($PlanPayDate) && $PayStage != "寶佳出貨前30天") {
array_push($arrayData[$BillNo]['sign']['min'], strtotime(strval($PlanPayDate)));
array_push($arrayData[$BillNo]['sign']['max'], strtotime(strval($PlanPayDate)));
}
} elseif (stristr($PayStage, '試車')) {
$arrayData[$BillNo]['tryrun'][0] = $PayStage;
$arrayData[$BillNo]['tryrun'][1] = $PayAmount;
@ -175,6 +179,9 @@ foreach ($contract as $cont) {
$arrayData[$BillNo]['total_budget'] += $PayAmount;
}
}
//取作番大日程作番與時程
// real_contract_arrival_date 預計出貨日
// real_arrival_date 實際出貨日
$sql = "SELECT
tmp2.*,
d.name AS depart_name
@ -188,6 +195,7 @@ SELECT
w.contractno,
w.facilityno,
w.estimated_shipping_date,
w.real_contract_arrival_date,
w.actual_tofactory_date,
w.real_arrival_date,
w.install_end_date,
@ -208,163 +216,395 @@ SELECT DISTINCT
FROM department
) AS d
ON d.department_id = tmp2.department_id";
ON d.department_id = tmp2.department_id ORDER BY contractno";
$wipwhole_array = mysqli_query($link, $sql);
foreach ($wipwhole_array as $wip) {
if (isset($arrayData[$wip['contractno']])) {
// 整理合約資料
$arrayData[$wip['contractno']][0] = $wip['department_id'];;
$arrayData[$wip['contractno']][1] = $wip['depart_name'];
$arrayData[$wip['contractno']][2] = $wip['manager_name'];
$arrayData[$wip['contractno']][3] = $wip['salesid'];
$arrayData[$wip['contractno']][4] = $wip['name'];
$arrayData[$wip['contractno']][10] = $wip['contractno'];
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
// [合約號][作番號]['no']
$arrayData[$wip['contractno']][$wip['facilityno']]['no'] = $wip['facilityno'];
// [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期]
// [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期]
// [合約號][作番號][款別] ['rec'] [金額]/[實際收款日期]
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($contractstage as $i) {
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['date'] = "";
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['inv']['budget'] = 0;
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['rec']['date'] = "";
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['rec']['budget'] = 0;
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['con']['date'] = (isset($arrayData[$wip['contractno']][$i][2])) ? $arrayData[$wip['contractno']][$i][2] : "";
$arrayData[$wip['contractno']][$wip['facilityno']][$i]['con']['budget'] = 0;
}
// 補上寶佳 (出貨前) 收款時間
if (isset($arrayData[$wip['contractno']]['sign'][0]) && $arrayData[$wip['contractno']]['sign'][0] == '寶佳出貨前30天') {
if ($wip['real_arrival_date'] != NULL) {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$signtime = $estimate_delivery_time - (30 * 86400);
$signtime = date('Ymd', $signtime);
$arrayData[$wip['contractno']]['sign'][2] = strval($signtime);
array_push($arrayData[$wip['contractno']]['sign']['max'], strtotime(strval($signtime)));
array_push($arrayData[$wip['contractno']]['sign']['min'], strtotime(strval($signtime)));
} elseif ($wip['real_contract_arrival_date'] != NULL) {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$signtime = $estimate_delivery_time - (30 * 86400);
$signtime = date('Ymd', $signtime);
$arrayData[$wip['contractno']]['sign'][2] = strval($signtime);
array_push($arrayData[$wip['contractno']]['sign']['max'], strtotime(strval($signtime)));
array_push($arrayData[$wip['contractno']]['sign']['min'], strtotime(strval($signtime)));
}
}
// 補上二次款 (出貨前) 收款時間,條件不是"出貨前"就pass
if (isset($arrayData[$wip['contractno']]['second'][0]) && stristr($arrayData[$wip['contractno']]['second'][0], '出貨前30天')) {
$estimate_delivery_time = strtotime($wip['estimated_shipping_date']);
$secondtime = $estimate_delivery_time - (30 * 86400);
$secondtime = date('Ymd', $secondtime);
if (empty($wip['estimated_shipping_date'])) {
$arrayData[$wip['contractno']]['second']['min'] = 0;
if (empty($wip['real_contract_arrival_date'])) {
} else {
array_push($arrayData[$wip['contractno']]['second']['max'], intval(substr($wip['estimated_shipping_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['second']['min'], intval(substr($wip['estimated_shipping_date'], 5, 2)));
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$secondtime = $estimate_delivery_time - (30 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime(strval($secondtime)));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
}
$arrayData[$wip['contractno']]['second'][2] = intval($secondtime);
} elseif (isset($arrayData[$wip['contractno']]['second'][0]) && stristr($arrayData[$wip['contractno']]['second'][0], '出貨前90天')) {
$estimate_delivery_time = strtotime($wip['estimated_shipping_date']);
$secondtime = $estimate_delivery_time - (90 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = intval($secondtime);
if (empty($wip['estimated_shipping_date'])) {
$arrayData[$wip['contractno']]['second']['min'] = 0;
if (empty($wip['real_contract_arrival_date'])) {
} else {
array_push($arrayData[$wip['contractno']]['second']['max'], intval(substr($wip['estimated_shipping_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['second']['min'], intval(substr($wip['estimated_shipping_date'], 5, 2)));
}
}
if ($wip['delivery_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['delivery_num'] += 1;
$arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
array_push($arrayData[$wip['contractno']]['delivery']['min'], intval(substr($wip['delivery_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['delivery']['max'], intval(substr($wip['delivery_date'], 5, 2)));
if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['check']['min'], intval(substr($wip['official_check_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['check']['max'], intval(substr($wip['official_check_date'], 5, 2)));
}
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['tryrun']['min'], intval(substr($wip['tryrun_end_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], intval(substr($wip['tryrun_end_date'], 5, 2)));
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], intval(substr($wip['install_end_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['install']['max'], intval(substr($wip['install_end_date'], 5, 2)));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['arrive']['min'], intval(substr($wip['real_arrival_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], intval(substr($wip['real_arrival_date'], 5, 2)));
}
} elseif ($wip['official_check_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
array_push($arrayData[$wip['contractno']]['check']['min'], intval(substr($wip['official_check_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['check']['max'], intval(substr($wip['official_check_date'], 5, 2)));
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['tryrun']['min'], intval(substr($wip['tryrun_end_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], intval(substr($wip['tryrun_end_date'], 5, 2)));
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], intval(substr($wip['install_end_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['install']['max'], intval(substr($wip['install_end_date'], 5, 2)));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['arrive']['min'], intval(substr($wip['real_arrival_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], intval(substr($wip['real_arrival_date'], 5, 2)));
}
} elseif ($wip['tryrun_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['tryrun']['min'], intval(substr($wip['tryrun_end_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], intval(substr($wip['tryrun_end_date'], 5, 2)));
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], intval(substr($wip['install_end_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['install']['max'], intval(substr($wip['install_end_date'], 5, 2)));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['arrive']['min'], intval(substr($wip['real_arrival_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], intval(substr($wip['real_arrival_date'], 5, 2)));
}
} elseif ($wip['install_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], intval(substr($wip['install_end_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['install']['max'], intval(substr($wip['install_end_date'], 5, 2)));
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$secondtime = $estimate_delivery_time - (90 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime(strval($secondtime)));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['arrive']['min'], intval(substr($wip['real_arrival_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], intval(substr($wip['real_arrival_date'], 5, 2)));
} elseif (isset($arrayData[$wip['contractno']]['second'][0]) && $arrayData[$wip['contractno']]['second'][0] == '寶佳出貨後10天') {
if ($wip['real_arrival_date'] != NULL) {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$secondtime = $estimate_delivery_time + (10 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime(strval($secondtime)));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
} else {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$secondtime = $estimate_delivery_time + (10 * 86400);
$secondtime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['second'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['second']['max'], strtotime($secondtime));
array_push($arrayData[$wip['contractno']]['second']['min'], strtotime(strval($secondtime)));
}
} elseif ($wip['real_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['arrive']['min'], intval(substr($wip['real_arrival_date'], 5, 2)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], intval(substr($wip['real_arrival_date'], 5, 2)));
}
//根據作番狀態填入facilities,計算各階段數量、一個合約有幾個作番,增加作番資料
// real_contract_arrival_date 預計出貨日=預計到貨日=預計貨抵工地
// real_arrival_date 實際出貨日=實際到貨日=實際貨抵工地
//----------------------------------------寶佳的另外處理---------------------------------------------------
if ($arrayData[$wip['contractno']]['sign'][0] == "寶佳出貨前30天") {
$facility_status = "";
// if ($arrayData[$wip['contractno']]['sign'][2])
$today = strtotime(date('Ymd'));
$contractday = strtotime($arrayData[$wip['contractno']]['sign'][2]);
if ($today > $contractday) {
$arrayData[$wip['contractno']]['sign_num'] += 1;
$facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "已過) <br>";
$contractday = strtotime($arrayData[$wip['contractno']]['second'][2]);
if ($today > $contractday) {
$arrayData[$wip['contractno']]['second_num'] += 1;
$facility_status = $wip['facilityno'] . " (出貨後10天" . $arrayData[$wip['contractno']]['second'][2] . "已過) <br>";
if ($wip['real_arrival_date'] != NULL) {
$estimate_time = strtotime($wip['real_arrival_date']);
$contractday = $estimate_time + (90 * 86400);
if ($today > $contractday) {
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['arrive'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (貨抵工地後90天" . $arrayData[$wip['contractno']]['arrive'][2] . "已過) <br>";
if ($wip['tryrun_end_date'] != NULL) {
$estimate_time = strtotime($wip['tryrun_end_date']);
$contractday = $estimate_time + (90 * 86400);
if ($today > $contractday) {
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['tryrun'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (試車後90天" . $arrayData[$wip['contractno']]['tryrun'][2] . "已過) <br>";
if ($wip['delivery_date'] != NULL) {
$estimate_time = strtotime($wip['delivery_date']);
$contractday = $estimate_time + (270 * 86400);
if ($today > $contractday) {
$arrayData[$wip['contractno']]['delivery_num'] += 1;
$arrayData[$wip['contractno']]['delivery'][2] = strval(date('Y-m-d', $contractday));
$facility_status = $wip['facilityno'] . " (交車後270天" . $arrayData[$wip['contractno']]['delivery'][2] . "已過) <br>";
}
}
}
}
}
}
}
} else {
$facility_status = $wip['facilityno'] . " (出貨前30天" . $arrayData[$wip['contractno']]['sign'][2] . "未到) <br>";
}
} elseif (($arrayData[$wip['contractno']]['second'] != NULL) && (isset($arrayData[$wip['contractno']]['second'][2])) && ($arrayData[$wip['contractno']]['second'][2] <= date('Ymd'))) {
if ($wip['estimated_shipping_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出貨日) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['facilities'] .= $facility_status;
} else {
if ($wip['delivery_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) <br>";
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1;
if ($arrayData[$wip['contractno']]['delivery'][0] == "交車後270天") {
$estimate_delivery_time = strtotime($wip['delivery_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['delivery'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['delivery_num'] += 1;
$arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['delivery'][2] = strval($wip['delivery_date']);
array_push($arrayData[$wip['contractno']]['delivery']['min'], strtotime(strval($wip['delivery_date'])));
array_push($arrayData[$wip['contractno']]['delivery']['max'], strtotime(strval($wip['delivery_date'])));
}
if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['check']['min'], strtotime(strval($wip['official_check_date'])));
array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date'])));
}
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") {
$estimate_delivery_time = strtotime($wip['tryrun_end_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
}
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['official_check_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) <br>";
$arrayData[$wip['contractno']]['check_num'] += 1;
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1;
if (!empty($wip['official_check_date']) && $wip['official_check_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['check']['min'], strtotime(strval($wip['official_check_date'])));
array_push($arrayData[$wip['contractno']]['check']['max'], strtotime(strval($wip['official_check_date'])));
}
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
if ($arrayData[$wip['contractno']]['tryrun'][0] == "安裝試車後90天") {
$estimate_delivery_time = strtotime($wip['tryrun_end_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['tryrun'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['tryrun'][2] = strval($wip['tryrun_end_date']);
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
}
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['tryrun_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) <br>";
$arrayData[$wip['contractno']]['tryrun_num'] += 1;
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
} elseif ($wip['actual_tofactory_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['actual_tofactory_date'] . "實際到觀音日) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1;
if (!empty($wip['tryrun_end_date']) && $wip['tryrun_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['tryrun']['min'], strtotime(strval($wip['tryrun_end_date'])));
array_push($arrayData[$wip['contractno']]['tryrun']['max'], strtotime(strval($wip['tryrun_end_date'])));
}
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strval($wip['install_end_date'])));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['install_end_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) <br>";
$arrayData[$wip['contractno']]['install_num'] += 1;
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
} else {
$arrayData[$wip['contractno']]['sign_num'] += 1;
if (!empty($wip['install_end_date']) && $wip['install_end_date'] != NULL) {
array_push($arrayData[$wip['contractno']]['install']['min'], strtotime(strval($wip['install_end_date'])));
array_push($arrayData[$wip['contractno']]['install']['max'], strtotime(strtotime(strval($wip['install_end_date']))));
}
if (!empty($wip['real_arrival_date']) && $wip['real_arrival_date'] != NULL) {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} else {
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_contract_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_contract_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_contract_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_contract_arrival_date'])));
}
}
} elseif ($wip['real_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) <br>";
$arrayData[$wip['contractno']]['arrive_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1;
if ($arrayData[$wip['contractno']]['arrive'][0] == "貨抵工地後90天") {
$estimate_delivery_time = strtotime($wip['real_arrival_date']);
$arrivetime = $estimate_delivery_time + (90 * 86400);
$arrivetime = date('Ymd', $secondtime);
$arrayData[$wip['contractno']]['arrive'][2] = strval($secondtime);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($arrivetime)));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($arrivetime)));
} else {
$arrayData[$wip['contractno']]['arrive'][2] = strval($wip['real_arrival_date']);
array_push($arrayData[$wip['contractno']]['arrive']['min'], strtotime(strval($wip['real_arrival_date'])));
array_push($arrayData[$wip['contractno']]['arrive']['max'], strtotime(strval($wip['real_arrival_date'])));
}
} elseif (($arrayData[$wip['contractno']]['second'] != NULL) && (isset($arrayData[$wip['contractno']]['second'][2])) && ($arrayData[$wip['contractno']]['second'][2] <= date('Ymd'))) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (已達二次款收款條件) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
$arrayData[$wip['contractno']]['second_num'] += 1;
$arrayData[$wip['contractno']]['sign_num'] += 1;
} else {
$arrayData[$wip['contractno']]['sign_num'] += 1;
if ($wip['real_contract_arrival_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨日) <br>";
} elseif ($wip['estimated_shipping_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港日) <br>";
} else {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (預計出港日待確認) <br>";
}
}
} elseif ($wip['estimated_shipping_date'] != NULL) {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計到港) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
} else {
$arrayData[$wip['contractno']]['facilities'] .= $wip['facilityno'] . " (預計到港日待確認) <br>";
$arrayData[$wip['contractno']]['total_facility_num'] += 1;
}
}
}
// 計算每個合約的應收款、作番總數
$today_date = new DateTime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d')))));
foreach ($arrayData as &$value) {
if ($value['total_facility_num'] > 0) {
$month = 11;
$value['receivable_budget'] = $value['sign'][1] + ($value['second'][1] * ($value['second_num'] / $value['total_facility_num'])) +
$value['receivable_budget'] = $value['sign'][1] * ($value['sign_num'] / $value['total_facility_num']) + ($value['second'][1] * ($value['second_num'] / $value['total_facility_num'])) +
($value['arrive'][1] * ($value['arrive_num'] / $value['total_facility_num'])) + ($value['install'][1] * ($value['install_num'] / $value['total_facility_num'])) +
($value['tryrun'][1] * ($value['tryrun_num'] / $value['total_facility_num'])) + ($value['check'][1] * ($value['check_num'] / $value['total_facility_num'])) +
(($value['delivery'][1] + $value['final'][1]) * ($value['delivery_num'] / $value['total_facility_num']));
$value['sign'][3] = $value['sign'][1];
$value['sign'][3] = $value['sign'][1] * ($value['sign_num'] / $value['total_facility_num']);
$value['second'][3] = $value['second'][1] * ($value['second_num'] / $value['total_facility_num']);
$value['arrive'][3] = $value['arrive'][1] * ($value['arrive_num'] / $value['total_facility_num']);
$value['install'][3] = $value['install'][1] * ($value['install_num'] / $value['total_facility_num']);
@ -373,22 +613,51 @@ foreach ($arrayData as &$value) {
$value['delivery'][3] = $value['delivery'][1] * ($value['delivery_num'] / $value['total_facility_num']);
$value['final'][3] = $value['final'][1] * ($value['delivery_num'] / $value['total_facility_num']);
}
$value['sign']['max'] = empty($value['sign']['max']) ? 0 : (($month - max($value['sign']['max'])) < 0 ? 0 : ($month - max($value['sign']['max'])));
$value['sign']['min'] = empty($value['sign']['min']) ? 0 : (($month - min($value['sign']['min'])) < 0 ? 0 : ($month - min($value['sign']['min'])));
$value['second']['max'] = empty($value['second']['max']) ? 0 : (($month - max($value['second']['max'])) < 0 ? 0 : ($month - max($value['second']['max'])));
$value['second']['min'] = empty($value['second']['min']) ? 0 : (($month - min($value['second']['min'])) < 0 ? 0 : ($month - min($value['second']['min'])));
$value['arrive']['max'] = empty($value['arrive']['max']) ? 0 : (($month - max($value['arrive']['max'])) < 0 ? 0 : ($month - max($value['arrive']['max'])));
$value['arrive']['min'] = empty($value['arrive']['min']) ? 0 : (($month - min($value['arrive']['min'])) < 0 ? 0 : ($month - min($value['arrive']['min'])));
$value['install']['max'] = empty($value['install']['max']) ? 0 : (($month - max($value['install']['max'])) < 0 ? 0 : ($month - max($value['install']['max'])));
$value['install']['min'] = empty($value['install']['min']) ? 0 : (($month - min($value['install']['min'])) < 0 ? 0 : ($month - min($value['install']['min'])));
$value['tryrun']['max'] = empty($value['tryrun']['max']) ? 0 : (($month - max($value['tryrun']['max'])) < 0 ? 0 : ($month - max($value['tryrun']['max'])));
$value['tryrun']['min'] = empty($value['tryrun']['min']) ? 0 : (($month - min($value['tryrun']['min'])) < 0 ? 0 : ($month - min($value['tryrun']['min'])));
$value['check']['max'] = empty($value['check']['max']) ? 0 : (($month - max($value['check']['max'])) < 0 ? 0 : ($month - max($value['check']['max'])));
$value['check']['min'] = empty($value['check']['min']) ? 0 : (($month - min($value['check']['min'])) < 0 ? 0 : ($month - min($value['check']['min'])));
$value['delivery']['max'] = empty($value['delivery']['max']) ? 0 : (($month - max($value['delivery']['max'])) < 0 ? 0 : ($month - max($value['delivery']['max'])));
$value['delivery']['min'] = empty($value['delivery']['min']) ? 0 : (($month - min($value['delivery']['min'])) < 0 ? 0 : ($month - min($value['delivery']['min'])));
$value['final']['max'] = empty($value['final']['max']) ? 0 : (($month - max($value['final']['max'])) < 0 ? 0 : ($month - max($value['final']['max'])));
$value['final']['min'] = empty($value['final']['min']) ? 0 : (($month - min($value['final']['min'])) < 0 ? 0 : ($month - min($value['final']['min'])));
// 計算最大催收次數與最小催收次數
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($contractstage as $i) {
if (!empty($value[$i]['min']) && count($value[$i]['min']) > 0) {
$latest_timestamp = max($value[$i]['min']);
$latest_date = new DateTime();
$latest_date->setTimestamp($latest_timestamp);
if ($latest_date < $today_date) {
$interval = $latest_date->diff($today_date);
$month = $interval->format('%m');
$value[$i]['min'] = $month;
} else {
$value[$i]['min'] = 0;
}
} else {
$value[$i]['min'] = 0;
};
if (!empty($value[$i]['max']) && count($value[$i]['max']) > 0) {
$latest_timestamp = min($value[$i]['max']);
$latest_date = new DateTime();
$latest_date->setTimestamp($latest_timestamp);
if ($latest_date < $today_date) {
$interval = $latest_date->diff($today_date);
$month = $interval->format('%m');
$value[$i]['max'] = $month;
} else {
$value[$i]['max'] = 0;
}
} else {
$value[$i]['max'] = 0;
};
}
}
// [合約號][作番號][款別] ['con'] [金額]/[合約預計收款日期]
// [合約號][作番號][款別] ['inv'] [金額]/[發票開立日期]
// [合約號][作番號][款別] ['rec'] [金額]/[實際收款日期]
foreach ($wipwhole_array as $wip) {
if (isset($arrayData[$wip['contractno']]) && isset($arrayData[$wip['contractno']][$wip['facilityno']]) && !empty($arrayData[$wip['contractno']]['total_facility_num'])) {
$stagearray = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($stagearray as $stage) {
$arrayData[$wip['contractno']][$wip['facilityno']][$stage]['con'] = $arrayData[$wip['contractno']][$stage][1] / $arrayData[$wip['contractno']]['total_facility_num'];
}
}
}
// [invoice][發票號碼][0 發票日期, 1 發票金額, 2 發票狀態, 3 收款日期, 4 收款金額, 5 手續費, 6 核銷單號]
foreach ($invoice_data as $invoice) {
@ -415,7 +684,74 @@ foreach ($received_array as $received) {
}
}
$data = json_encode($arrayData);
//產生excel的array
$excel_aray = array();
$boga_array = array();
$exclude_boga_array = array();
foreach ($arrayData as $key => $value) {
$value['sign'][3] = (isset($value['sign'][3])) ? $value['sign'][3] : 0;
$value['second'][3] = (isset($value['second'][3])) ? $value['second'][3] : 0;
$value['arrive'][3] = (isset($value['arrive'][3])) ? $value['arrive'][3] : 0;
$value['install'][3] = (isset($value['install'][3])) ? $value['install'][3] : 0;
$value['tryrun'][3] = (isset($value['tryrun'][3])) ? $value['tryrun'][3] : 0;
$value['check'][3] = (isset($value['check'][3])) ? $value['check'][3] : 0;
$value['delivery'][3] = (isset($value['delivery'][3])) ? $value['delivery'][3] : 0;
$value['final'][3] = (isset($value['final'][3])) ? $value['final'][3] : 0;
$contractstage = array('sign', 'second', 'arrive', 'install', 'tryrun', 'check', 'delivery', 'final');
foreach ($contractstage as $i) {
$value[$i]['max'] = (empty($value[$i]['max']) || !isset($value[$i]['max'])) ? 0 : $value[$i]['max'];
$value[$i]['min'] = (empty($value[$i]['min']) || !isset($value[$i]['min'])) ? 0 : $value[$i]['min'];
};
if ($value['sign'][0] == "寶佳出貨前30天") {
$boga_array[$key] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$value['sign'][1], $value['sign'][3], $value['sign']['max'], $value['sign']['min'],
$value['second'][1], $value['second'][3], $value['second']['max'], $value['second']['min'],
$value['arrive'][1], $value['arrive'][3], $value['arrive']['max'], $value['arrive']['min'],
$value['install'][1], $value['install'][3], $value['install']['max'], $value['install']['min'],
$value['tryrun'][1], $value['tryrun'][3], $value['tryrun']['max'], $value['tryrun']['min'],
$value['check'][1], $value['check'][3], $value['check']['max'], $value['check']['min'],
$value['delivery'][1], $value['delivery'][3], $value['delivery']['max'], $value['delivery']['min'],
$value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'],
$value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], str_replace('<br>', '; ', $value['facilities'])
];
}else{
$exclude_boga_array[$key] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$value['sign'][1], $value['sign'][3], $value['sign']['max'], $value['sign']['min'],
$value['second'][1], $value['second'][3], $value['second']['max'], $value['second']['min'],
$value['arrive'][1], $value['arrive'][3], $value['arrive']['max'], $value['arrive']['min'],
$value['install'][1], $value['install'][3], $value['install']['max'], $value['install']['min'],
$value['tryrun'][1], $value['tryrun'][3], $value['tryrun']['max'], $value['tryrun']['min'],
$value['check'][1], $value['check'][3], $value['check']['max'], $value['check']['min'],
$value['delivery'][1], $value['delivery'][3], $value['delivery']['max'], $value['delivery']['min'],
$value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'],
$value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], str_replace('<br>', '; ', $value['facilities'])
];
}
$excel_aray[$key] = [
$key, $value[1], $value[2], $value[4], $value[5], $value[7], $value[8], $value[6],
$value['sign'][1], $value['sign'][3], $value['sign']['max'], $value['sign']['min'],
$value['second'][1], $value['second'][3], $value['second']['max'], $value['second']['min'],
$value['arrive'][1], $value['arrive'][3], $value['arrive']['max'], $value['arrive']['min'],
$value['install'][1], $value['install'][3], $value['install']['max'], $value['install']['min'],
$value['tryrun'][1], $value['tryrun'][3], $value['tryrun']['max'], $value['tryrun']['min'],
$value['check'][1], $value['check'][3], $value['check']['max'], $value['check']['min'],
$value['delivery'][1], $value['delivery'][3], $value['delivery']['max'], $value['delivery']['min'],
$value['final'][1], $value['final'][3], $value['final']['max'], $value['final']['min'],
$value['total_budget'], $value['receivable_budget'], $value['invoice_budget'], $value['received_budget'], str_replace('<br>', '; ', $value['facilities'])
];
}
$data = json_encode($excel_aray);
$boga_data = json_encode($boga_array);
$exclude_boga_data = json_encode($exclude_boga_array);
?>
<style>
@ -455,7 +791,16 @@ $data = json_encode($arrayData);
}
</style>
<button type="button" onclick="downloadData()" class="btn btn-warning btn-lg pull-right"><span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="downloadData()" class="btn btn-success btn-lg pull-right">全部<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="exclude_bogaData()" class="btn btn-info btn-lg pull-right">不含寶佳<span class="glyphicon glyphicon-download-alt"></span></button>
<button type="button" onclick="bogaData()" class="btn btn-warning btn-lg pull-right">寶佳<span class="glyphicon glyphicon-download-alt"></span></button>
<?php
if (in_array(accountidToDepartId($user_id), array('220', '210')) || $user_id == 'M0060') {
?>
<a href="facility-price.php?<?= $token_link ?>" class="btn btn-primary btn-lg pull-right">合約作番明細</span></a>
<?php
}
?>
<div style="width:98%;margin:1% ;overflow-x: auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%;">
<thead>
@ -467,42 +812,42 @@ $data = json_encode($arrayData);
<th style="width: 120px;">客戶名稱</th>
<th style="width: 120px;">簽約款</th>
<th style="width: 120px;">應收簽約金額</th>
<th style="width: 120px;">簽約最大催收次數</th>
<th style="width: 120px;">簽約最小催收次數</th>
<th style="width: 120px;">簽約最大催收次數</th>
<th style="width: 120px;">二次款</th>
<th style="width: 120px;">應收二次金額</th>
<th style="width: 120px;">二次最大催收次數</th>
<th style="width: 120px;">二次最小催收次數</th>
<th style="width: 120px;">二次最大催收次數</th>
<th style="width: 120px;">貨抵工地款</th>
<th style="width: 120px;">應收貨抵工地金額</th>
<th style="width: 120px;">貨抵工地最大催收次數</th>
<th style="width: 120px;">貨抵工地最小催收次數</th>
<th style="width: 120px;">貨抵工地最大催收次數</th>
<th style="width: 120px;">安裝款</th>
<th style="width: 120px;">應收安裝金額</th>
<th style="width: 120px;">安裝最大催收次數</th>
<th style="width: 120px;">安裝最小催收次數</th>
<th style="width: 120px;">安裝最大催收次數</th>
<th style="width: 120px;">試車款</th>
<th style="width: 120px;">應收試車金額</th>
<th style="width: 120px;">試車最大催收次數</th>
<th style="width: 120px;">試車最小催收次數</th>
<th style="width: 120px;">試車最大催收次數</th>
<th style="width: 120px;">官檢款</th>
<th style="width: 120px;">應收官檢金額</th>
<th style="width: 120px;">官檢最大催收次數</th>
<th style="width: 120px;">官檢最小催收次數</th>
<th style="width: 120px;">官檢最大催收次數</th>
<th style="width: 120px;">移交款</th>
<th style="width: 120px;">應收移交金額</th>
<th style="width: 120px;">移交最大催收次數</th>
<th style="width: 120px;">移交最小催收次數</th>
<th style="width: 120px;">移交最大催收次數</th>
<th style="width: 120px;">尾款</th>
<th style="width: 120px;">應收尾款金額</th>
<th style="width: 120px;">尾款最大催收次數</th>
<th style="width: 120px;">尾款最小催收次數</th>
<th style="width: 120px;">尾款最大催收次數</th>
<th style="width: 120px;">合約總金額</th>
<th style="width: 120px;" style="width: 120px;">目前應收</th>
<th style="width: 120px;" style="width: 120px;">已開發票金額</th>
<th style="width: 120px;">已收金額</th>
<!-- <th>作番狀態</th> -->
<!-- <th style="width: 100px;">收款狀態</th> -->
<th style="width: 350px;">收款狀態</th>
</tr>
</thead>
@ -511,7 +856,7 @@ $data = json_encode($arrayData);
foreach ($arrayData as $key => $value) {
?>
<tr>
<th><?= $key ?></th>
<th><a onclick="showContract('<?= $key ?>')"><?= $key ?> </a></th>
<td><?= $value[1] ?></td>
<td><?= $value[2] ?></td>
<td><?= $value[4] ?></td>
@ -552,8 +897,8 @@ $data = json_encode($arrayData);
<td style="text-align: end;"><?= isset($value['receivable_budget']) ? number_format(round($value['receivable_budget'])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['invoice_budget']) ? number_format(round($value['invoice_budget'])) : '--' ?></td>
<td style="text-align: end;"><?= isset($value['received_budget']) ? number_format(round($value['received_budget'])) : '--' ?></td>
<!-- <td style="text-align: start;"><?= $value['facilities'] ?></td>
<td><button type="button" onclick="sendData('<?= $key ?>')" class="btn btn-primary btn-sm"><span class=" glyphicon glyphicon-search"></span></button>
<td style="text-align: start;"><?= $value['facilities'] ?></td>
<!-- <td><button type="button" onclick="sendData('<?= $key ?>')" class="btn btn-primary btn-sm"><span class=" glyphicon glyphicon-search"></span></button>
</td> -->
</tr>
<?php
@ -563,6 +908,11 @@ $data = json_encode($arrayData);
</table>
</div>
<script>
function showContract(BillNo) {
window.open('account-receivable-contract.php?BillNo=' + BillNo+'&<?= $token_link ?>', '發票範例', config = 'height=600, width=1200');
console.log(BillNo);
}
function test() {
var BillData = <?= $data ?>;
var form = document.createElement("form");
@ -588,7 +938,7 @@ $data = json_encode($arrayData);
var file_path = xhr.responseText;
var link = document.createElement('a');
var name = "應收帳款" + "<?= date('Y-m-d-Hm') ?>" + ".xlsx";
link.setAttribute('href', window.location.origin + "/wms/account-receivable.xlsx");
link.setAttribute('href', window.location.origin + "/wms/account-receivable-test.xlsx");
link.setAttribute('download', name);
link.style.display = 'none';
document.body.appendChild(link);
@ -596,11 +946,68 @@ $data = json_encode($arrayData);
document.body.removeChild(link);
}
}
// xhr.send(JSON.stringify({
// Bill: <?= $data ?>
// })
// );
xhr.send(JSON.stringify({
Bill: <?= $data ?>
}));
}
function bogaData() {
var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>";
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var file_path = xhr.responseText;
var link = document.createElement('a');
var name = "應收帳款" + "<?= date('Y-m-d-Hm') ?>" + ".xlsx";
link.setAttribute('href', window.location.origin + "/wms/account-receivable-test.xlsx");
link.setAttribute('download', name);
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
xhr.send(JSON.stringify({
Bill: <?= $boga_data ?>
}));
}
function exclude_bogaData() {
var xhr = new XMLHttpRequest();
var url = window.location.origin + "/wms/account-receivable-excel.php?<?= $token_link ?>";
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var file_path = xhr.responseText;
var link = document.createElement('a');
var name = "應收帳款" + "<?= date('Y-m-d-Hm') ?>" + ".xlsx";
link.setAttribute('href', window.location.origin + "/wms/account-receivable-test.xlsx");
link.setAttribute('download', name);
link.style.display = 'none';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
}
xhr.send(JSON.stringify({
Bill: <?= $exclude_boga_data ?>
}));
}
function sendData(BillNo) {
var BillData = <?= $data ?>;
var Bill = BillData[BillNo];

12
wms/account-receivable-received-create.php

@ -51,29 +51,29 @@ $BillData = json_decode($Bill, true);
<div class="form-group">
<div class="col-md-3">
<label for="InvoiceDate">發票開立日期</label>
<input type="date" class="form-control" id="InvoiceDate" name="InvoiceDate" >
<input type="date" class="form-control" id="InvoiceDate" name="InvoiceDate">
</div>
<div class="col-md-3">
<label for="InvoiceAmount">發票金額</label>
<input type="number" class="form-control" id="InvoiceAmount" name="InvoiceAmount" >
<input type="number" class="form-control" id="InvoiceAmount" name="InvoiceAmount">
</div>
<div class="col-md-3">
<label for="InvoiceNo">發票號碼</label>
<input type="text" class="form-control" id="InvoiceNo" name="InvoiceNo" >
<input type="text" class="form-control" id="InvoiceNo" name="InvoiceNo">
</div>
</div>
<div class="form-group">
<div class="col-md-3">
<label for="ReceivedDate">收款日期</label>
<input type="date" class="form-control" id="ReceivedDate" name="ReceivedDate" >
<input type="date" class="form-control" id="ReceivedDate" name="ReceivedDate">
</div>
<div class="col-md-3">
<label for="ReceivedAmount">收款金額</label>
<input type="number" class="form-control" id="ReceivedAmount" name="ReceivedAmount" >
<input type="number" class="form-control" id="ReceivedAmount" name="ReceivedAmount">
</div>
<div class="col-md-3">
<label for="remark">備註</label>
<input type="text" class="form-control" id="remark" name="remark" >
<input type="text" class="form-control" id="remark" name="remark">
</div>
</div>

14
wms/account-receivable-received-edit.php

@ -89,13 +89,13 @@ $pay = mysqli_fetch_assoc($pay);
<div class="col-md-3">
<label for="status" style="color: red;">狀態</label>
<select id="status" name="status">
<option value=0 <?php if($pay['status'] == 0) echo "selected" ?>>進行中</option>
<option value=1 <?php if($pay['status'] == 1) echo "selected" ?>>催收</option>
<option value=2 <?php if($pay['status'] == 2) echo "selected" ?>>法務件 (發函)</option>
<option value=3 <?php if($pay['status'] == 3) echo "selected" ?>>法務件 (訴訟)</option>
<option value=4 <?php if($pay['status'] == 4) echo "selected" ?>>折讓</option>
<option value=5 <?php if($pay['status'] == 5) echo "selected" ?>>壞帳</option>
<option value=99 <?php if($pay['status'] == 99) echo "selected" ?>>完成</option>
<option value=0 <?php if ($pay['status'] == 0) echo "selected" ?>>進行中</option>
<option value=1 <?php if ($pay['status'] == 1) echo "selected" ?>>催收</option>
<option value=2 <?php if ($pay['status'] == 2) echo "selected" ?>>法務件 (發函)</option>
<option value=3 <?php if ($pay['status'] == 3) echo "selected" ?>>法務件 (訴訟)</option>
<option value=4 <?php if ($pay['status'] == 4) echo "selected" ?>>折讓</option>
<option value=5 <?php if ($pay['status'] == 5) echo "selected" ?>>壞帳</option>
<option value=99 <?php if ($pay['status'] == 99) echo "selected" ?>>完成</option>
</select>
</div>
</div>

33
wms/account-receivable-test.php

@ -1,3 +1,32 @@
<?php
$test = [8,9,3,4];
echo min($test);
// $today = date('Ym01', strtotime('-1 month',strtotime(date('Ym01'))));
// $yesterday = date("Ym01", strtotime('-1 month',strtotime(date('2023-11-17'))));
// echo "today: " . $today . "<br>";
// echo "yesterday: " . $yesterday . "<br>";
// echo $today-$yesterday;
// echo "<br>";
// $test = date('Ymd', $today-$yesterday);
// echo $test;
include './header.php';
$sql = "SELECT
salOrderStagePay.BillNo,
salOrderStagePay.PayStage
FROM salOrderStagePay
LEFT JOIN salSalesOrder
ON salSalesOrder.BillNo = salOrderStagePay.BillNo WHERE salSalesOrder.ModeId = 'M' AND (salSalesOrder.CurrentState=2 OR salSalesOrder.CurrentState=4) ";
$query = $conn->query($sql);
$contracts = array();
foreach ($query as $row) {
if (!array_key_exists($row['BillNo'], $contracts)) {
$contracts[$row['BillNo']] = [$row['BillNo'], $row['PayStage']];
}else{
array_push($contracts[$row['BillNo']], $row['PayStage']);
}
}
foreach($contracts as $contract){
foreach($contract as $con){
echo $con.";";
}
echo "<br>";
}

BIN
wms/account-receivable-test.xlsx

Binary file not shown.

BIN
wms/account-receivable.xlsx

Binary file not shown.

BIN
wms/assets/img/icon/(Ñ╝¿╧Ñ╬)icon-star-active.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
wms/assets/img/icon/(Ñ╝¿╧Ñ╬)icon-star-default.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

16
wms/board-record-submit.php

@ -7,7 +7,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$$k = trim($v);
}
function get_basename($filename) {
function get_basename($filename)
{
return preg_replace('/^.+[\\\\\\/]/', '', $filename);
}
@ -16,7 +17,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$temp_file_name = $_FILES["attatch1"]["tmp_name"];
$file_size = $_FILES["attatch1"]["size"];
$target_dir = "board-attach/";
$target_file1 = strtolower($target_dir.get_basename($file_name));
$target_file1 = strtolower($target_dir . get_basename($file_name));
$img_file_type = pathinfo($file_name, PATHINFO_EXTENSION);
$upload_ok = 1;
if (file_exists($target_file1)) unlink($target_file1);
@ -27,22 +28,22 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($target_file1 && !$upload_res_1) {
echo "<script type ='text/JavaScript'>";
echo "alert('檔案上傳失敗,資料請重建。');";
echo "location.href='board-index.php?function_name=board&token=".$token."';";
echo "location.href='board-index.php?function_name=board&token=" . $token . "';";
echo "</script>";
}
$db_query = "insert into board (title, content, attach, pin, creater, create_at) values (";
$db_query .= "'$title', '$content', '$target_file1', '1', '".$user_id."', NOW())";
$db_query .= "'$title', '$content', '$target_file1', '1', '" . $user_id . "', NOW())";
$result = mysqli_query($link, $db_query);
if (mysqli_affected_rows($link) > 0) {
echo "<script type ='text/JavaScript'>";
echo "alert('新增成功');";
echo "location.href='board-index.php?function_name=board&token=".$token."';";
echo "location.href='board-index.php?function_name=board&token=" . $token . "';";
echo "</script>";
} elseif (mysqli_affected_rows($link)==0) {
} elseif (mysqli_affected_rows($link) == 0) {
echo "<script type ='text/JavaScript'>";
echo "alert('無新增資料');";
echo "location.href='board-index.php?function_name=board&token=".$token."';";
echo "location.href='board-index.php?function_name=board&token=" . $token . "';";
echo "</script>";
} else {
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
@ -50,4 +51,3 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
mysqli_close($link);
}
?>

17
wms/class/Cmail.php

@ -1,5 +1,4 @@
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
@ -12,11 +11,11 @@ class Cmail
public $smtp_user = "";
public $smtp_pwd = "";
function __construct($charset = '', $fromemail = '')
function __construct($charset='', $fromemail='')
{
include dirname(__DIR__) . "/PHPMailer/Exception.php";
include dirname(__DIR__) . "/PHPMailer/PHPMailer.php";
include dirname(__DIR__) . "/PHPMailer/SMTP.php";
include dirname(__DIR__)."/PHPMailer/Exception.php";
include dirname(__DIR__)."/PHPMailer/PHPMailer.php";
include dirname(__DIR__)."/PHPMailer/SMTP.php";
$this->charset = "UTF-8";
$this->host = "mail.masada.com.tw";
@ -25,7 +24,7 @@ class Cmail
$this->smtp_pwd = "90493119"; // 這裡填寫SMTP登入密碼
}
function sendx($subject = "", $em_body = "", $sendlist = array(), $from = "永佳捷科技", $bcc = "", $files = array())
function sendx($subject="", $em_body="", $sendlist=array(), $from="永佳捷科技", $bcc="", $files=array())
{
if (!$sendlist) return;
$em_body = nl2br($em_body);
@ -53,12 +52,8 @@ class Cmail
//$mail->addCC("personC@gmail.com", "person C");
//$mail->addBCC("personD@gmail.com", "person D");
//$mail->addAttachment("image1.jpg", "picture.jpg"); //設定附件, 對方會看到附件名稱為 picture.jpg
foreach ($files as $v) {
list($file, $file_name) = $v;
$mail->addAttachment($file, $file_name);
}
//print_r($mail);exit;
if (!$mail->Send()) {
if (!$mail->Send()){
// echo "Mailer error: " . $mail->ErrorInfo;
} else {
//echo "Email sent";

2
wms/cont/MICalculator.php

@ -284,6 +284,8 @@ class MICalculator
and maintain_kind='" . $item['maintain_kind'] . "'
and is_m1_bundle='" . $item['is_m1_bundle'] . "'
";
// echo $sql_get_price;
list($row) = DB::result($sql_get_price);
if (empty($row)) return self::error();
#1基礎價格

428
wms/cont/apply_form.php

@ -2,6 +2,8 @@
require_once '../header_nomenu.php';
require_once './FormHelper.php';
require_once './wf_common.php';
// require_once('./conn.php');
$vol_no = empty($_GET['vol_no']) ? "" : $_GET['vol_no'];
@ -25,26 +27,34 @@ $flow_id = 'con01';
$form_id = "";
#價審單狀態
$apply_st = "";
list($apply_key, $form_key)=DB::fields("select apply_key, form_key from con_maintance_examine_apply where vol_no='$vol_no' order by apply_key desc limit 0, 1");
list($apply_key, $form_key, $salesman) = DB::fields("SELECT apply_key, form_key,salesman FROM con_maintance_examine_apply WHERE vol_no='$vol_no' ORDER BY apply_key desc limit 0, 1");
// echo '<pre>';
// print_r($apply_key);
// echo '</pre>';
// exit;
// if ($salesman != $user_id) {
// echo '<script>alert("您並不是該單營業員,無法訪問。");history.go(-1);</script>';
// exit;
// }
if (empty($apply_key)) $apply_st = 1; // 準備新增
else {
//list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'");
list($current_assigner)=DB::fields("select current_assigner from subflow where form_key = '$form_key' order by seq desc limit 0, 1");
if ($current_assigner == $user_id) $apply_st = 2; // 修改中,還未提交
else $apply_st = 9; // 已到下一關,無法䖺改
//list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'");
list($current_assigner) = DB::fields("SELECT current_assigner FROM subflow WHERE form_key = '$form_key' ORDER BY seq desc limit 0, 1");
if ($current_assigner == $user_id) $apply_st = 2; // 修改中,還未提交
else $apply_st = 9; // 已到下一關,無法䖺改
}
if ($apply_st > 2) {
echo"<script>alert('卷號".$vol_no."已生成價審單,請勿重複生成!');history.go(-1);</script>";
exit;
}
// if ($apply_st > 2) {
// echo "<script>alert('卷號" . $vol_no . "已生成價審單,請勿重複生成!');history.go(-1);</script>";
// exit;
// }
if ($apply_st==1) {
$wf = new WorkFlow($system_id, $flow_id, $form_id);
$wf->initWorkFlow($user_id);
$form_key = $wf->flowContext->getFormKey();
if ($apply_st == 1) {
$wf = new WorkFlow($system_id, $flow_id, $form_id);
$wf->initWorkFlow($user_id);
$form_key = $wf->flowContext->getFormKey();
} else {
$wf = new WorkFlow($system_id, $flow_id, $form_id, $form_key);
$wf = new WorkFlow($system_id, $flow_id, $form_id, $form_key);
}
#獲取簽核意見
@ -58,6 +68,7 @@ $wf->setFormData(['discount' => 100]);
$flowName = $wf->getFlowName();
$assigner = $wf->getAssignerList();
$assign_status = $wf->getAssignStatus($assigner);
$if_show_assign = true;
//加載流程圖
//$fc = WorkFLowItems::get_records($flow->getSystemID(), $flow->getFlowID());
@ -71,19 +82,19 @@ $isSplitable = $wf->isSplitable();
//表單數據
#客戶表
#1.電梯品牌選項
$sql = "select code_name value ,content label from code where field_name='elevator_brand' order by code_name asc ";
$sql = "SELECT code_name value ,content label FROM code WHERE field_name='elevator_brand' order by code_name asc ";
$elevator_brand_opt = DB::result($sql);
#2.保養方式
$sql = "select code_name value ,content label from code where field_name='maintain_kind'";
$sql = "SELECT code_name value ,content label FROM code WHERE field_name='maintain_kind'";
$maintain_kind_opt = DB::result($sql);
#3.電梯類型
$sql = "select code_name value ,content label from code where field_name='maintain_elevator_kind'";
$sql = "SELECT code_name value ,content label FROM code WHERE field_name='maintain_elevator_kind'";
$elevator_kind_opt = DB::result($sql);
#4.付款方式
$sql = "select code_name value ,content label from code where field_name='payment_kind' order by code_name+ 0 asc";
$sql = "SELECT code_name value ,content label FROM code WHERE field_name='payment_kind' order by code_name+ 0 asc";
$payment_kind_opt = DB::result($sql);
#5.契約性質
$sql = "select code_name value ,content label from code where field_name='contract_kind'";
$sql = "SELECT code_name value ,content label FROM code WHERE field_name='contract_kind'";
$contract_kind_opt = DB::result($sql);
#6.是否贈送M1
$is_m1_bundle_opt = [
@ -92,7 +103,7 @@ $is_m1_bundle_opt = [
];
#7.機種
$sql = "select code_name value ,content label from code where field_name='fp_kind'";
$sql = "SELECT code_name value ,content label FROM code WHERE field_name='fp_kind'";
$fp_kind_opt = DB::result($sql);
#抓取有望客戶資料
@ -100,30 +111,31 @@ $fp_kind_opt = DB::result($sql);
$vol_no = $_GET['vol_no'];
$where = " and vol_no='$vol_no'";
$sql = "SELECT * FROM hope_contract_customer where 1=1 $where ORDER BY vol_no";
// print_r($sql);
$hope_contract = DB::result($sql);
$hope_contract = empty($hope_contract) ? [] : $hope_contract[0];
#寫入 con_maintance_examine_apply
if ($apply_st==1) {
#獲取評審單號
$apply_key = get_sequnece_no('cmea_apply_key', date('ym'));
//var_dump($hope_contract);
$insert_data = [
'apply_key' => $apply_key,
'vol_no' => $vol_no,
'form_key' => $form_key,
'address' => $hope_contract['address'],
'case_name' => $hope_contract['customer'],
'num' => $hope_contract['num'],
'brand' => '',
'customer' => $hope_contract['customer'],
'salesman' => empty($hope_contract['salesman']) ? $user_id : $hope_contract['salesman'],
'progress_remark' => $hope_contract['progress_status']
//'platform_company'=>'',
// 'platforom_company_tel'=> ''
];
//var_dump($insert_data);
DB::insert_table('con_maintance_examine_apply', $insert_data);
if ($apply_st == 1) {
#獲取評審單號
$apply_key = get_sequnece_no('cmea_apply_key', date('ym'));
//var_dump($hope_contract);
$insert_data = [
'apply_key' => $apply_key,
'vol_no' => $vol_no,
'form_key' => $form_key,
'address' => $hope_contract['address'],
'case_name' => $hope_contract['customer'],
'num' => $hope_contract['num'],
'brand' => '',
'customer' => $hope_contract['customer'],
'salesman' => empty($hope_contract['salesman']) ? $user_id : $hope_contract['salesman'],
'progress_remark' => $hope_contract['progress_status']
//'platform_company'=>'',
// 'platforom_company_tel'=> ''
];
//var_dump($insert_data);
DB::insert_table('con_maintance_examine_apply', $insert_data);
}
$table = 'con_maintance_examine_apply';
@ -163,33 +175,34 @@ $con_maintance_examine_clear_columm = [
'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt],
'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt],
'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt],
'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'weight[]', 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']],
'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']],
'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', 'class' => 'form-control form-control-sm']],
'floors' => ['label' => "層數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'floors[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'persons' => ['label' => "人乘", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'persons[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'weight[]', "placeholder" => "載重", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']],
'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', "placeholder" => "速度", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']],
'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', "placeholder" => "停數", 'class' => 'form-control form-control-sm']],
'floors' => ['label' => "層數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'floors[]', 'min=1', 'required', "placeholder" => "層數", 'class' => 'form-control form-control-sm']],
'persons' => ['label' => "人乘", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'persons[]', 'min=1', 'required', "placeholder" => "人乘", 'class' => 'form-control form-control-sm']],
'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt],
'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'digits', 'attr' => ['colspan' => 2, 'required', 'gt=0', 'min=0', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']],
'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'last_check_date[]', 'colspan' => 2, 'class' => 'form-control form-control-sm']],
'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'digits', 'attr' => ['colspan' => 2, 'required', "placeholder" => "竣工檢查年度", 'gt=0', 'min=0', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']],
'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'last_check_date[]', "placeholder" => "上次年檢日期", 'colspan' => 2, 'class' => 'form-control form-control-sm']],
'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', 'colspan' => 2, 'class' => 'form-control form-control-sm ']],
'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', "placeholder" => "年檢費用", 'colspan' => 2, 'class' => 'form-control form-control-sm ']],
'maintain_times' => ['label' => "保養次數", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'register_code' => ['label' => "電梯許可證代碼", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', "placeholder" => "無證號請輸入A,B...", 'required', 'class' => 'form-control form-control-sm']],
'register_code' => ['label' => "電梯許可證代碼", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', "placeholder" => "無證號請輸入A,B...", 'required', 'class' => 'form-control form-control-sm']],
'maintain_months' => ['label' => "保養月數", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']],
'maintain_period' => ['label' => "保養周期", "tag" => 'digits', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt],
'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'option' => 'disable', 'options' => $is_m1_bundle_opt],
'stand_price' => ['label' => "標準價格(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']],
'contract_price' => ['label' => "契約報價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']],
'sold_price' => ['label' => "契約成交價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']],
'contract_price' => ['label' => "契約報價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, "placeholder" => "契約報價", 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']],
'sold_price' => ['label' => "契約成交價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'placeholder' => '契約成交價', 'class' => 'form-control form-control-sm']],
];
$con_maintance_examine_clear = DB::result("SELECT " . implode(',', array_keys($con_maintance_examine_clear_columm)) .
" FROM con_maintance_examine_clear where 1=1 and apply_key='$apply_key' and cmstatus='Y' ");
$j = 0;
$col_count = 12;
$cmecRow = " <tr>";
@ -205,8 +218,6 @@ foreach ($con_maintance_examine_clear_columm as $key => $val) {
$cmecRow .= "</tr><tr>";
}
}
$cmecRow .= "</tr>";
function base_url($url)
{
@ -227,9 +238,34 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
return $seq_no;
}
$sql = "SELECT * FROM account WHERE accountid = '$user_id' ";
list($result) = DB::result($sql);
if ($result['department_id'] == '511') {
$managerid = 'M0137';
$managername = '劉永德';
} else if ($result['department_id'] == '512') {
$managerid = 'M0137';
$managername = '劉永德';
} else if ($result['department_id'] == '513') {
$managerid = 'M0086';
$managername = '李烘銘';
} else if ($result['department_id'] == '514') {
$managerid = 'M0033';
$managername = '吳育宗';
}
if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' || $result['department_id'] == 'M0033') {
$managerid = 'M0008';
$managername = '詹益彰';
}
?>
<style>
button.disabled {
cursor: not-allowed;
background: #555;
}
</style>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/jquery.cleditor.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url('bootstrap4/css/bootstrap.min.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/layui.css'); ?>" />
@ -259,13 +295,13 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
is_m1_bundle: 'N',
};
let regDelStr = "";
let regDelStr = "";
$(document).ready(function() {
var tag_data;
$.ajax({
url: 'https://www.masada.com.tw/fds/index.php/DesignFlow/get_assigner',
//url: 'http://localhost/fds/index.php/DesignFlow/get_assigner',
//url: 'http://localhost/fds/index.php/DesignFlow/get_assigner',
type: 'post',
dataType: 'json',
success: function(data) {
@ -286,7 +322,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
return value > param;
}, $.validator.format("輸入值必須大於0"));
var assigner = eval('<?= json_encode($assigner) ?>');
//console.log(assigner);
//console.log(assigner);
var cmecRow = "<?= str_replace('"', '\'', $cmecRow) ?>";
// $('#cmecTbody').append(cmecRow);
@ -320,89 +356,91 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
$("#next_users").empty();
var _selected_status = $(this).children('option:selected').val(); //獲取被選擇的狀態
var _option_tmp = ""; //獲取下拉列表
for (a in assigner) { //遍曆assigner
if (assigner[a][0] == _selected_status) {
_tmp = assigner[a][1].split(',');
for (var b in _tmp) {
if (_tmp[b] == '') {
continue;
}
_uname = _tmp[b].split('-')[1];
_uid = _tmp[b].split('-')[0];
/* console.log(_tmp[b]);*/
_option_tmp += '<option value=' + _uid + '>' + _tmp[b] + '</option>';
}
}
}
// for (a in assigner) { //遍曆assigner
// if (assigner[a][0] == _selected_status) {
// _tmp = assigner[a][1].split(',');
// for (var b in _tmp) {
// if (_tmp[b] == '') {
// continue;
// }
// _uname = _tmp[b].split('-')[1];
// _uid = _tmp[b].split('-')[0];
// /* console.log(_tmp[b]);*/
// _option_tmp += '<option value=' + _uid + '>' + _tmp[b] + '</option>';
// }
// }
// }
_option_tmp = '<option value=' + '<?php echo $managerid ?>' + '>' + '<?php echo $managername ?>' + '</option>';
$("#next_users").append(_option_tmp);
});
$('#maintain_kind').change(function(){
if ($('#cmecTbody tr').length > 0) {
alert("保養方式已更動,請開始輸入電梯資料!");
$('#cmecTbody').find(':input').val('');
return false;
}
});
$('#maintain_kind').change(function() {
if ($('#cmecTbody tr').length > 0) {
alert("保養方式已更動,請開始輸入電梯資料!");
$('#cmecTbody').find(':input').val('');
return false;
}
});
$("#form").validate();
$("form").submit(function(e){
$('#reg_del').val(regDelStr);
});
$("form").submit(function(e) {
$('#reg_del').val(regDelStr);
});
});
addRow = function() {
if ($('#maintain_kind').val() == "") {
alert("請選擇保養方式!");
$('#maintain_kind').eq(0).focus();
return false;
}
if ($('#maintain_kind').val() == "") {
alert("請選擇保養方式!");
$('#maintain_kind').eq(0).focus();
return false;
}
var cmecRow = "<?= $cmecRow ?>";
$('#cmecTbody').append(cmecRow);
$("select[name^='elevator_kind'],select[name^='is_m1_bundle']").on('change', function(obj) {
//console.log('#'+$(this).attr('name')+'#');
var elen = 1;
if ('elevator_kind[]' == $(this).attr('name')) {
var children = $(this).parent().parent().parent();
var elementObj = $(children).next('tr').find("input[name^='stand_price']");
//var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle'] option:selected").val();
} else if ('is_m1_bundle[]' == $(this).attr('name')) {
var children = $(this).parent().parent().parent().prev('tr');
var elementObj = $(this).parent().parent().parent().find("input[name^='stand_price']");
//var is_m1_bundle = $(this).val();
}
var element = elementObj;
if ('elevator_kind[]' == $(this).attr('name')) {
var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle'] option:selected").val();
} else if ('is_m1_bundle[]' == $(this).attr('name')) {
var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle']").val();
}
var floors = $(children).find("input[name^='floors']").val();
var speed = $(children).find("input[name^='speed']").val();
var weight = $(children).find("input[name^='weight']").val();
var persons = $(children).find("input[name^='persons']").val();
var maintain_times = $(children).find("input[name^='maintain_times']").val();
var maintain_months = $(children).find("input[name^='maintain_months']").val();
var maintain_period = $(children).find("input[name^='maintain_period']").val();
var maintain_kind = $('#maintain_kind').val();
var elevator_type = $(children).find("select[name^='elevator_kind'] option:selected").val();
var param1 = {
...param,
persons,
floors,
speed,
weight,
maintain_times,
maintain_months,
maintain_period,
maintain_kind,
elevator_type,
is_m1_bundle
}
setStandPrice(param1, element);
//console.info(param1);
//console.log('#'+$(this).attr('name')+'#');
var elen = 1;
if ('elevator_kind[]' == $(this).attr('name')) {
var children = $(this).parent().parent().parent();
var elementObj = $(children).next('tr').find("input[name^='stand_price']");
//var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle'] option:selected").val();
} else if ('is_m1_bundle[]' == $(this).attr('name')) {
var children = $(this).parent().parent().parent().prev('tr');
var elementObj = $(this).parent().parent().parent().find("input[name^='stand_price']");
//var is_m1_bundle = $(this).val();
}
var element = elementObj;
if ('elevator_kind[]' == $(this).attr('name')) {
var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle'] option:selected").val();
} else if ('is_m1_bundle[]' == $(this).attr('name')) {
var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle']").val();
}
var floors = $(children).find("input[name^='floors']").val();
var speed = $(children).find("input[name^='speed']").val();
var weight = $(children).find("input[name^='weight']").val();
var persons = $(children).find("input[name^='persons']").val();
var maintain_times = $(children).find("input[name^='maintain_times']").val();
var maintain_months = $(children).find("input[name^='maintain_months']").val();
var maintain_period = $(children).find("input[name^='maintain_period']").val();
var maintain_kind = $('#maintain_kind').val();
var elevator_type = $(children).find("select[name^='elevator_kind'] option:selected").val();
var param1 = {
...param,
persons,
floors,
speed,
weight,
maintain_times,
maintain_months,
maintain_period,
maintain_kind,
elevator_type,
is_m1_bundle
}
setStandPrice(param1, element);
// console.log(param1);
});
$("input[name^='floors']" +
",input[name^='speed']" +
",input[name^='persons']" +
@ -420,7 +458,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
var maintain_times = $(children).find("input[name^='maintain_times']").val();
var maintain_months = $(children).find("input[name^='maintain_months']").val();
var maintain_period = $(children).find("input[name^='maintain_period']").val();
var maintain_kind = $('#maintain_kind').val();
var maintain_kind = $('#maintain_kind').val();
var elevator_type = $(children).find("select[name^='elevator_kind'] option:selected").val();
var is_m1_bundle = $(this).parent().parent().parent().next('tr').find("select[name^='is_m1_bundle'] option:selected").val();
@ -433,7 +471,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
maintain_times,
maintain_months,
maintain_period,
maintain_kind,
maintain_kind,
elevator_type,
is_m1_bundle
}
@ -443,17 +481,16 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
});
}
delRow = function(btn) {
if ($(btn).attr('name')=='btn1') {
//console.log($(btn).parent().parent().prev('tr').find('input[id=register_code]').val());
regDelStr += $(btn).parent().parent().find('input[id=register_code]').val()+",";
$(btn).parent().parent().next('tr').remove();
}
else {
//console.log($(btn).parent().parent().find('input[id=register_code]').val());
$(btn).parent().parent().next('tr').remove();
$(btn).parent().parent().remove();
}
$(btn).parent().parent().remove();
if ($(btn).attr('name') == 'btn1') {
//console.log($(btn).parent().parent().prev('tr').find('input[id=register_code]').val());
regDelStr += $(btn).parent().parent().find('input[id=register_code]').val() + ",";
$(btn).parent().parent().next('tr').remove();
} else {
//console.log($(btn).parent().parent().find('input[id=register_code]').val());
$(btn).parent().parent().next('tr').remove();
$(btn).parent().parent().remove();
}
$(btn).parent().parent().remove();
}
setStandPrice = function(p, obj) {
$.ajax({
@ -463,16 +500,33 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
dataType: 'json',
//success: function(data) {},
success: function(data) {
console.info(data);
console.log(data.price);
if (data.status == 'ok') {
$(obj).val(data.price);
} else {
$(obj).val(data.message);
}
if (data.message == '無此項目,請聯係業務部創建標準成本') {
console.log('1');
// $("button[name^=btn_save]").attr('disabled', true);
// $("button[name^=btn_save]").css('cursor', 'not-allowed')
$("#submit").css('background-color', '#666')
document.querySelector('#submit').classList.add('disabled')
document.querySelector('#submit').disabled = true
}
if (data.price) {
document.querySelector('#submit').classList.remove('disabled')
document.querySelector('#submit').disabled = false
$("#submit").css('background-color', '#007bff')
// $("button[name^=btn_save]").attr('disabled', false);
// $("button[name^=btn_save]").css('cursor', 'default')
// $("button[name^=btn_save]").css('background-color', '#666')
}
}
});
}
addNewBrand = function() {
var new_brand = $("#new_brand").val();
@ -487,17 +541,24 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
type: 'post',
dataType: 'json',
success: function(data) {
console.info(data);
// console.info(data);
$("#brand").append("<option value='" + data.seq + "'>" + new_brand + "</option>");
},
error: function(data) {
console.info(data);
// console.info(data);
}
});
}
}
$("input[name^='stand_price']").bind('input propertychang', function() {
if ($("input[name^='stand_price']").val() == '') {
console.log('無值');
$("button[name^=btn_save]").attr('disabled', true);
}
});
</script>
@ -523,7 +584,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
<!-- hidden域 -->
<input type="hidden" name="form_key" value='<?php echo $form_key; ?>' />
<input type="hidden" name="token" value='<?= $_GET['token'] ?>' />
<input type="hidden" name="reg_del" id="reg_del">
<input type="hidden" name="reg_del" id="reg_del">
<input type="hidden" name="form_src" id="form_src" value="apply_form">
<!--表單start-->
<div class=" form container-fluid pt-5">
@ -600,53 +661,54 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
<tr>
<td colspan='18' ;><button onClick='addRow()' type="button" style='float:right' class="btn btn-link btn-md">+新增</button></td>
</tr>
<tr style='margin-top:0px;text-align:center'>
<?php
$j = 0;
foreach ($con_maintance_examine_clear_columm as $val) {
echo FormHelper::tag("th", ['colspan' => empty($val['attr']['colspan']) ? 1 : $val['attr']['colspan']], $val['label']);
//echo "<th>" . $val['label'] . "</th>";
if ((++$j % $col_count) == 0) {
if ($j == $col_count) echo "<th>操作</th>";
<!-- <tr style='margin-top:0px;text-align:center'> -->
<?php
$j = 0;
echo "<tr style='margin-top:0px;text-align:center'>";
$i = 0;
$cmecRow = '<tr>';
foreach ($con_maintance_examine_clear_columm as $col => $col_def) {
echo FormHelper::tag("th", ['colspan' => empty($col_def['attr']['colspan']) ? 1 : $col_def['attr']['colspan']], $col_def['label']);
echo "</tr><tr style='margin-top:0px;text-align:center'>";
}
if ((++$j % $col_count) == 0) {
if ($j == $col_count) echo "<th>操作</th>";
echo "</tr><tr style='margin-top:0px;text-align:center'>";
}
}
echo '</tr>';
?>
?>
</tr>
</thead>
<tbody id='cmecTbody'>
<?php
foreach ($con_maintance_examine_clear as $key => $val) {
$j = 0;
$cmecRow = " <tr>";
foreach ($con_maintance_examine_clear_columm as $col => $col_def) {
$fieldVal = empty($val) ? "" : $val[$col];
$_input = $col_def['tag'] == 'select' ?
FormHelper::select($col, $col_def['options'], $fieldVal, $col_def['attr'])
: FormHelper::text($col, $fieldVal, $col_def['attr'], $col_def['tag']);
$cmecRow .= "<td colspan='" . (empty($col_def['attr']['colspan']) ? '' :
$col_def['attr']['colspan']) . "' ><div class=' col-12'>
<tr>
<?php
foreach ($con_maintance_examine_clear as $key => $val) {
$j = 0;
$cmecRow = "<tr>";
foreach ($con_maintance_examine_clear_columm as $col => $col_def) {
$fieldVal = empty($val) ? "" : $val[$col];
$_input = $col_def['tag'] == 'select' ?
FormHelper::select($col, $col_def['options'], $fieldVal, $col_def['attr'])
: FormHelper::text($col, $fieldVal, $col_def['attr'], $col_def['tag']);
$cmecRow .= "<td colspan='" . (empty($col_def['attr']['colspan']) ? '' :
$col_def['attr']['colspan']) . "' ><div class=' col-12'>
$_input</td>";
if ((++$j % $col_count) == 0) {
$cmecRow .= "<td><button name='btn1' onClick='delRow(this)' type='button' class='btn btn-link btn-md '>刪除</button></td>";
$cmecRow .= "</tr><tr>";
if ((++$j % $col_count) == 0) {
$cmecRow .= "<td><button name='btn1' onClick='delRow(this)' type='button' class='btn btn-link btn-md '>刪除</button></td>";
$cmecRow .= "</tr><tr>";
}
}
}
echo $cmecRow . "</tr>";
}
?>
echo $cmecRow . "</tr>";
}
?>
</tr>
</tbody>
</table>
@ -679,7 +741,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
</div>
<div class="col-3 form_field_title ">
<button type="submit" name="btn_save" class="btn btn-warning btn-sm" value="save" style='float:left;margin-right:4px;'>保存</button>&nbsp;
<button type="submit" name="btn_save" class="btn btn-primary btn-sm" value="tosign" style='float:left'>提交</button>
<button type="submit" name="btn_save" class="btn btn-primary btn-sm" value="tosign" style='float:left' id="submit">提交</button>
</div>
</div>

912
wms/cont/apply_form1.php

@ -0,0 +1,912 @@
<?php
require_once '../header_nomenu.php';
require_once './FormHelper.php';
require_once './wf_common.php';
$vol_no = empty($_GET['vol_no']) ? "" : $_GET['vol_no'];
/***
* 检查是否重复生成价审单
* con_maintance_examine_apply
*/
/*
list($cnt)=DB::fields("select count(*) cnt from con_maintance_examine_apply where vol_no='$vol_no'");
if($cnt>0) {
echo"<script>alert('卷號".$vol_no."已生成價審單,請勿重複生成!');history.go(-1);</script>";
exit;
}
*/
#係統ID
$system_id = 'con';
#流程ID
$flow_id = 'con01';
#表單號 $form_id;
$form_id = "";
#價審單狀態
$apply_st = "";
list($apply_key, $form_key, $salesman) = DB::fields("SELECT apply_key, form_key,salesman FROM con_maintance_examine_apply WHERE vol_no='$vol_no' ORDER BY apply_key desc limit 0, 1");
// echo '<pre>';
// print_r($salesman);
// echo '</pre>';
// exit;
if ($salesman != $user_id) {
echo '<script>alert("您並不是該單營業員,無法訪問。");history.go(-1);</script>';
exit;
}
if (empty($apply_key)) $apply_st = 1; // 準備新增
else {
//list($flow_code)=DB::fields("select flow_code from flow where form_key = '$form_key' and system_id = '$system_id' and flow_id = '$flow_id'");
list($current_assigner) = DB::fields("SELECT current_assigner FROM subflow WHERE form_key = '$form_key' ORDER BY seq desc limit 0, 1");
if ($current_assigner == $user_id) $apply_st = 2; // 修改中,還未提交
else $apply_st = 9; // 已到下一關,無法䖺改
}
// if ($apply_st > 2) {
// echo "<script>alert('卷號" . $vol_no . "已生成價審單,請勿重複生成!');history.go(-1);</script>";
// exit;
// }
if ($apply_st == 1) {
$wf = new WorkFlow($system_id, $flow_id, $form_id);
$wf->initWorkFlow($user_id);
$form_key = $wf->flowContext->getFormKey();
} else {
$wf = new WorkFlow($system_id, $flow_id, $form_id, $form_key);
}
#獲取簽核意見
$assign_opinions = Assign::get_records($form_key);
#會簽部門意見
$subflow_assign_opinions = SubflowManager::getCounterSignComments($form_key);
//預設冇有摺扣
$wf->setFormData(['discount' => 100]);
$flowName = $wf->getFlowName();
$assigner = $wf->getAssignerList();
$assign_status = $wf->getAssignStatus($assigner);
$if_show_assign = true;
//加載流程圖
//$fc = WorkFLowItems::get_records($flow->getSystemID(), $flow->getFlowID());
//$path = $fc[0]->wf_file;
//echo dirname(__DIR__)."/../"."$path";
//$flow_chart = file_get_contents(dirname(__DIR__) . '/' . $path);
#是否可會簽
$isSplitable = $wf->isSplitable();
//表單數據
#客戶表
#1.電梯品牌選項
$sql = "select code_name value ,content label from code where field_name='elevator_brand' order by code_name asc ";
$elevator_brand_opt = DB::result($sql);
#2.保養方式
$sql = "select code_name value ,content label from code where field_name='maintain_kind'";
$maintain_kind_opt = DB::result($sql);
#3.電梯類型
$sql = "select code_name value ,content label from code where field_name='maintain_elevator_kind'";
$elevator_kind_opt = DB::result($sql);
#4.付款方式
$sql = "select code_name value ,content label from code where field_name='payment_kind' order by code_name+ 0 asc";
$payment_kind_opt = DB::result($sql);
#5.契約性質
$sql = "select code_name value ,content label from code where field_name='contract_kind'";
$contract_kind_opt = DB::result($sql);
#6.是否贈送M1
$is_m1_bundle_opt = [
['label' => '是', 'value' => 'Y'],
['label' => '否', 'value' => 'N']
];
#7.機種
$sql = "select code_name value ,content label from code where field_name='fp_kind'";
$fp_kind_opt = DB::result($sql);
#抓取有望客戶資料
$vol_no = $_GET['vol_no'];
$where = " and vol_no='$vol_no'";
$sql = "SELECT * FROM hope_contract_customer where 1=1 $where ORDER BY vol_no";
$hope_contract = DB::result($sql);
$hope_contract = empty($hope_contract) ? [] : $hope_contract[0];
#寫入 con_maintance_examine_apply
if ($apply_st == 1) {
#獲取評審單號
$apply_key = get_sequnece_no('cmea_apply_key', date('ym'));
//var_dump($hope_contract);
$insert_data = [
'apply_key' => $apply_key,
'vol_no' => $vol_no,
'form_key' => $form_key,
'address' => $hope_contract['address'],
'case_name' => $hope_contract['customer'],
'num' => $hope_contract['num'],
'brand' => '',
'customer' => $hope_contract['customer'],
'salesman' => empty($hope_contract['salesman']) ? $user_id : $hope_contract['salesman'],
'progress_remark' => $hope_contract['progress_status']
//'platform_company'=>'',
// 'platforom_company_tel'=> ''
];
//var_dump($insert_data);
DB::insert_table('con_maintance_examine_apply', $insert_data);
}
#抓使用者主管
$sql = "SELECT * FROM account WHERE accountid = '$user_id' ";
list($result) = DB::result($sql);
if ($result['department_id'] == '511') {
$managerid = 'M0137';
$managername = '劉永德';
} else if ($result['department_id'] == '512') {
$managerid = 'M0137';
$managername = '劉永德';
} else if ($result['department_id'] == '513') {
$managerid = 'M0086';
$managername = '李烘銘';
} else if ($result['department_id'] == '514') {
$managerid = 'M0033';
$managername = '吳育宗';
}
if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' || $result['department_id'] == 'M0033') {
$managerid = 'M0008';
$managername = '詹益彰';
}
if ($result['department_id'] == 'M0008') {
$managerid = 'M0008';
$managername = '詹益彰';
}
$table = 'con_maintance_examine_apply';
#可編輯的列
$editableColumn = [
'apply_key' => [
'label' => "評審單號", "value" => "$apply_key", "tag" => 'text',
'attr' => [
'readonly=true ',
'class' => 'form-control form-control-sm'
]
],
'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']],
'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt],
'num' => ['label' => "數量", "value" => "", "tag" => 'digits', 'attr' => ['required', 'min=1', 'class' => 'form-control form-control-sm']],
'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $maintain_kind_opt],
'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm'], 'options' => $contract_kind_opt],
'introducer' => ['label' => "介紹人", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt],
];
$where = " and apply_key='$apply_key'";
$sql = "SELECT * FROM $table where 1=1 $where ORDER BY vol_no";
$data = [];
$data = DB::result($sql);
#電梯詳細資料
$con_maintance_examine_clear_columm = [
'register_code' => ['label' => "電梯許可證代碼", "value" => "", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', 'required', 'class' => 'form-control form-control-sm']],
'elevator_brand' => ['label' => "品牌", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'elevator_brand[]', 'class' => 'form-control form-control-sm'], 'options' => $elevator_brand_opt],
'elevator_kind' => ['label' => "電梯類型", "value" => "", "tag" => 'select', 'attr' => ['name' => 'elevator_kind[]', 'required', 'colspan' => 2, 'class' => 'form-control form-control-sm'], 'options' => $elevator_kind_opt],
'spec' => ['label' => "規格型號", "value" => "", "tag" => 'select', 'attr' => ['colspan' => 2, 'name' => 'spec[]', 'class' => 'form-control form-control-sm'], 'options' => $fp_kind_opt],
'weight' => ['label' => "載重(KG)", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'weight[]', "placeholder" => "載重", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']],
'speed' => ['label' => "速度(m/min)", "value" => "", "tag" => 'number', 'attr' => ['colspan' => 2, 'name' => 'speed[]', "placeholder" => "速度", 'gt=0', 'min=0', 'required', 'class' => 'form-control form-control-sm']],
'stop' => ['label' => "停數", "value" => "", "tag" => 'number', 'attr' => ['name' => 'stop[]', "placeholder" => "停數", 'class' => 'form-control form-control-sm']],
'floors' => ['label' => "層數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'floors[]', 'min=1', 'required', "placeholder" => "層數", 'class' => 'form-control form-control-sm']],
'persons' => ['label' => "人乘", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'persons[]', 'min=1', 'required', "placeholder" => "人乘", 'class' => 'form-control form-control-sm']],
'maintain_times' => ['label' => "保養次數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'maintain_months' => ['label' => "保養月數", "value" => "", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'maintain_period' => ['label' => "保養周期", "value" => "", "tag" => 'number', 'attr' => ['name' => 'maintain_period[]', 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'options' => $is_m1_bundle_opt],
'useful_years' => ['label' => "竣工檢查年度", "value" => "", "tag" => 'digits', 'attr' => ['colspan' => 2, 'required', "placeholder" => "竣工檢查年度", 'gt=0', 'min=0', 'name' => 'useful_years[]', 'class' => 'form-control form-control-sm']],
'last_check_date' => ['label' => "上次年檢日期", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'last_check_date[]', "placeholder" => "上次年檢日期", 'colspan' => 2, 'class' => 'form-control form-control-sm']],
'annual_survey_expense' => ['label' => "年檢費用(元)", "value" => "", "tag" => 'number', 'attr' => ['required', 'name' => 'annual_survey_expense[]', "placeholder" => "年檢費用", 'colspan' => 2, 'class' => 'form-control form-control-sm ']],
'maintain_times' => ['label' => "保養次數", "tag" => 'digits', 'attr' => ['name' => 'maintain_times[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'register_code' => ['label' => "電梯許可證代碼", "tag" => 'text', 'attr' => ['colspan' => 2, 'name' => 'register_code[]', "placeholder" => "無證號請輸入A,B...", 'required', 'class' => 'form-control form-control-sm']],
'maintain_months' => ['label' => "保養月數", "tag" => 'digits', 'attr' => ['name' => 'maintain_months[]', "value" => "12", 'min=12', 'required', 'class' => 'form-control form-control-sm']],
'maintain_period' => ['label' => "保養周期", "tag" => 'digits', 'attr' => ['name' => 'maintain_period[]', "value" => "1", 'min=1', 'required', 'class' => 'form-control form-control-sm']],
'is_m1_bundle' => ['label' => "贈送M1", "value" => "", "tag" => 'select', 'attr' => ['name' => 'is_m1_bundle[]', 'required', 'class' => 'form-control form-control-sm'], 'option' => 'disable', 'options' => $is_m1_bundle_opt],
'stand_price' => ['label' => "標準價格(元/月)", "value" => "", "tag" => 'text', 'attr' => ['required', "readonly", 'colspan' => 2, 'name' => 'stand_price[]', 'class' => 'form-control form-control-sm']],
'contract_price' => ['label' => "契約報價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, "placeholder" => "契約報價", 'name' => 'contract_price[]', 'class' => 'form-control form-control-sm']],
'sold_price' => ['label' => "契約成交價(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']],
];
$con_maintance_examine_clear = DB::result("SELECT " . implode(',', array_keys($con_maintance_examine_clear_columm)) .
" FROM con_maintance_examine_clear where 1=1 and apply_key='$apply_key' and cmstatus='Y' ");
$j = 0;
$col_count = 12;
$cmecRow = " <tr>";
foreach ($con_maintance_examine_clear_columm as $key => $val) {
$fieldVal = "";
$_input = $val['tag'] == 'select' ?
FormHelper::select('', $val['options'], $fieldVal, $val['attr'])
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']);
// : "<input type='" . $val['tag'] . "' class=' form-control form-control-sm' " . $val['attr'] . " value='" . $fieldVal . "' name='${key}[]' id='$key' placeholder='請輸入'>";
$cmecRow .= "<td colspan='" . (empty($val['attr']['colspan']) ? '' : $val['attr']['colspan']) . "' ><div class=' col-12' > $_input</td>";
if ((++$j % $col_count) == 0) {
if ($j == $col_count) $cmecRow .= "<td><button onClick='delRow(this)' type='button' class='btn btn-link btn-md'>刪除</button></td>";
$cmecRow .= "</tr><tr>";
}
}
$cmecRow .= "</tr>";
function base_url($url)
{
return "https://www.masada.com.tw/static/" . $url;
}
function get_sequnece_no($seq_name = '', $p_yyyymm = '')
{
if (empty($p_yyyymm) || empty($seq_name)) return null;
#當前年月
list($yyyymm, $prefix) = DB::fields("select yyyymm ,prefix from sequence where seq_name='$seq_name' ");
if ($p_yyyymm != $yyyymm) {
DB::query("update sequence set yyyymm='$p_yyyymm' , current_val='10000' where seq_name='$seq_name' ");
}
// echo "SELECT concat( $prefix,,substring(nextval('$seq_name'),2)) seq_no ";
list($seq_no) = DB::fields("SELECT concat( '$prefix','$p_yyyymm',substring( appwms.nextval('$seq_name'),2)) seq_no ");
return $seq_no;
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/jquery.cleditor.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url('bootstrap4/css/bootstrap.min.css'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/layui.css'); ?>" />
<script type="text/javascript" src="<?php echo base_url('js/jquery3.7.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('js/selectpage.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('js/jquery.cleditor.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('bootstrap4/js/bootstrap.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('js/layui.js?' . rand(10, 100)); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('js/wf_property.js?') . rand(10, 100); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('js/flow_chart.js?' . rand(10, 100)); ?>"></script>
<script src="<?php echo base_url('js/validate/jquery.validate.min.js?' . rand(10, 100)); ?>"></script>
<script src="<?php echo base_url('js/validate/messages_zh_TW.js?' . rand(10, 100)); ?>">
</script>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/form.css?') . rand(10, 100); ?>" />
<script type="text/javascript">
window.param = {
elevator_type: '',
floors: 1,
speed: 1,
persons: 6,
weight: 1000,
maintain_times: 1, //病床梯一月2次保養
maintain_months: 12,
maintain_kind: 2,
maintain_period: 1, //預設為1月1次, 2是為2月一次
is_m1_bundle: 'N',
};
let regDelStr = "";
$(document).ready(function() {
var tag_data;
$.ajax({
url: 'https://www.masada.com.tw/fds/index.php/DesignFlow/get_assigner',
//url: 'http://localhost/fds/index.php/DesignFlow/get_assigner',
type: 'post',
dataType: 'json',
success: function(data) {
window.tag_data = data;
$('#selectPage').selectPage({
showField: 'show_name',
keyField: 'val',
data: data,
multiple: true,
multipleControlbar: true,
pagination: false,
focusDropList: false
});
}
});
$.validator.addMethod('gt', function(value, element, param) {
return value > param;
}, $.validator.format("輸入值必須大於0"));
var assigner = eval('<?= json_encode($assigner) ?>');
//console.log(assigner);
var cmecRow = "<?= str_replace('"', '\'', $cmecRow) ?>";
// $('#cmecTbody').append(cmecRow);
$('.sp_element_box').attr("disabled", true);
$("#assign_opinion").cleditor({
height: 100, // height not including margins, borders or padding
controls: // controls to add to the toolbar
"bold italic underline strikethrough subscript superscript | font size " +
"style | color highlight removeformat | bullets numbering | outdent " +
"indent | alignleft center alignright justify | undo redo | "
});
$('#contract_begin_date').on('input propertychange', function(e) {
var date = new Date(e.target.value);
var yyyy = date.getFullYear() + 1;
var mm = date.getMonth() + 1;
var dd = date.getDate();
var time = yyyy + `-` + (mm < 10 ? '0' + mm : mm) + '-' + (dd < 10 ? '0' + dd : dd);
$('#contract_end_date').val(time);
});
$('#brand').change(function() {
var _selected_status = $(this).children('option:selected').val(); //獲取被選擇的狀態
if (_selected_status == 'Z') {
$('#brandModal').modal('show')
}
});
$('#assign_status').change(function() {
$("#next_users").empty();
var _selected_status = $(this).children('option:selected').val(); //獲取被選擇的狀態
var _option_tmp = ""; //獲取下拉列表
// for (a in assigner) { //遍曆assigner
// if (assigner[a][0] == _selected_status) {
// _tmp = assigner[a][1].split(',');
// for (var b in _tmp) {
// if (_tmp[b] == '') {
// continue;
// }
// _uname = _tmp[b].split('-')[1];
// _uid = _tmp[b].split('-')[0];
// /* console.log(_tmp[b]);*/
// _option_tmp += '<option value=' + _uid + '>' + _tmp[b] + '</option>';
// }
// }
// }
_option_tmp += '<option value=' + '<?php echo $managerid ?>' + '>' + '<?php echo $managername ?>' + '</option>';
console.log(_option_tmp);
$("#next_users").append(_option_tmp);
});
$('#maintain_kind').change(function() {
if ($('#cmecTbody tr').length > 0) {
alert("保養方式已更動,請開始輸入電梯資料!");
$('#cmecTbody').find(':input').val('');
return false;
}
});
$("#form").validate();
$("form").submit(function(e) {
$('#reg_del').val(regDelStr);
});
});
addRow = function() {
if ($('#maintain_kind').val() == "") {
alert("請選擇保養方式!");
$('#maintain_kind').eq(0).focus();
return false;
}
const cmecRow = $('#elevator_list').html();
console.log(cmecRow);
$('#elevator_list').append(cmecRow);
$("select[name^='elevator_kind'],select[name^='is_m1_bundle']").on('change', function(obj) {
//console.log('#'+$(this).attr('name')+'#');
var elen = 1;
if ('elevator_kind[]' == $(this).attr('name')) {
var children = $(this).parent().parent().parent();
var elementObj = $(children).next('tr').find("input[name^='stand_price']");
//var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle'] option:selected").val();
} else if ('is_m1_bundle[]' == $(this).attr('name')) {
var children = $(this).parent().parent().parent().prev('tr');
var elementObj = $(this).parent().parent().parent().find("input[name^='stand_price']");
//var is_m1_bundle = $(this).val();
}
var element = elementObj;
if ('elevator_kind[]' == $(this).attr('name')) {
var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle'] option: selected").val("");
} else if ('is_m1_bundle[]' == $(this).attr('name')) {
var is_m1_bundle = $(children).next('tr').find("select[name^='is_m1_bundle']").val();
}
var floors = $(children).find("input[name^='floors']").val();
var speed = $(children).find("input[name^='speed']").val();
var weight = $(children).find("input[name^='weight']").val();
var persons = $(children).find("input[name^='persons']").val();
var maintain_times = $(children).find("input[name^='maintain_times']").val();
var maintain_months = $(children).find("input[name^='maintain_months']").val();
var maintain_period = $(children).find("input[name^='maintain_period']").val();
var maintain_kind = $('#maintain_kind').val();
var elevator_type = $(children).find("select[name^='elevator_kind'] option:selected").val();
var param1 = {
...param,
persons,
floors,
speed,
weight,
maintain_times,
maintain_months,
maintain_period,
maintain_kind,
elevator_type,
is_m1_bundle
}
setStandPrice(param1, element);
//console.info(param1);
});
$("input[name^='floors']" +
",input[name^='speed']" +
",input[name^='persons']" +
",input[name^='weight']" +
",input[name^='maintain_times']" +
",input[name^='maintain_months']" +
",input[name^='maintain_period']"
).on('input propertychange', function(obj) {
// $(obj).parent().parent().parent().remove();
var children = $(this).parent().parent().parent().children();
var floors = $(children).find("input[name^='floors']").val();
var speed = $(children).find("input[name^='speed']").val();
var weight = $(children).find("input[name^='weight']").val();
var persons = $(children).find("input[name^='persons']").val();
var maintain_times = $(children).find("input[name^='maintain_times']").val();
var maintain_months = $(children).find("input[name^='maintain_months']").val();
var maintain_period = $(children).find("input[name^='maintain_period']").val();
var maintain_kind = $('#maintain_kind').val();
var elevator_type = $(children).find("select[name^='elevator_kind'] option:selected").val();
var is_m1_bundle = $(this).parent().parent().parent().next('tr').find("select[name^='is_m1_bundle'] option:selected").val();
var param1 = {
...param,
persons,
floors,
speed,
weight,
maintain_times,
maintain_months,
maintain_period,
maintain_kind,
elevator_type,
is_m1_bundle
}
var element = $(this).parent().parent().parent().next().children().find("input[name^='stand_price']");
setStandPrice(param1, element);
});
}
delRow = function(btn) {
if ($(btn).attr('name') == 'btn1') {
// console.log($(btn).parent().parent().prev('tr').find('input[id=register_code]').val());
regDelStr += $(btn).parent().parent().parent().find('input[id=register_code]').val() + ",";
$(btn).parent().parent().next('tr').remove();
console.log(regDelStr)
} else {
// console.log($(btn).parent().parent().find('input[id=register_code]').val());
$(btn).parent().parent().next('tr').remove();
$(btn).parent().parent().remove();
}
$(btn).parent().parent().parent().parent().remove();
}
setStandPrice = function(p, obj) {
$.ajax({
url: '../cont/t.php',
data: p,
type: 'get',
dataType: 'json',
//success: function(data) {},
success: function(data) {
console.info(data);
if (data.status == 'ok') {
$(obj).val(data.price);
} else {
$(obj).val(data.message);
}
}
});
}
addNewBrand = function() {
var new_brand = $("#new_brand").val();
if (new_brand != '') {
p = {
new_brand: new_brand,
method: 'add_brand'
}
$.ajax({
url: 'async_req.php',
data: p,
type: 'post',
dataType: 'json',
success: function(data) {
console.info(data);
$("#brand").append("<option value='" + data.seq + "'>" + new_brand + "</option>");
},
error: function(data) {
console.info(data);
}
});
}
}
</script>
<body>
<div id="toolbarmenu">
<!--<span id="objName" style="font-size:16px;margin-bottom:0px;margin-top:1px">流程:<?php echo $flowName; ?></span>-->
<!-- 導航欄 -->
<ul class="nav nav-tabs" role="tablist" id="tablist">
<li class=" nav-item ">
<a href="#tabassign" aria-controls="tabassign" role="tab" class=" active nav-link" data-toggle="tab">簽核表單</a>
</li>
</ul>
</div>
<!-- 導航欄 END-->
<div class="tab-content ">
<div class="tab-pane active assign_content " id="tabassign">
<form action="submit.php" id='form' method="post" style='width:98%;margin:0 auto'>
<!-- hidden域 -->
<input type="hidden" name="form_key" value='<?php echo $form_key; ?>' />
<input type="hidden" name="token" value='<?= $_GET['token'] ?>' />
<input type="hidden" name="reg_del" id="reg_del">
<input type="hidden" name="form_src" id="form_src" value="apply_form">
<!--表單start-->
<div class=" form container-fluid pt-5">
<div class="row form_head ">
<div class=" col-12 form_head_title ">
<h4> 保養契約價格審核單</h4>
</div>
</div>
<div class="row " style='padding-top:30px;'>
<div class=" col-lg-12 form_row_header ">
<b>契約信息</b>
</div>
</div>
<?php
//一行顯示三列
$i = 0;
echo " <div class='row '>";
foreach ($editableColumn as $key => $val) {
$j = (($i++) % 4);
$fieldVal = empty($data) ? "" : $data[0][$key];
$_input = $val['tag'] == 'select' ?
FormHelper::select("$key", $val['options'], $fieldVal, $val['attr'])
: FormHelper::text("$key", $fieldVal, $val['attr'], $val['tag']);
//"<input type='" . $val['tag'] . "' class=' form-control form-control-sm " . $val['class'] . "'
// value='" . $fieldVal . "' name='$key' id='$key' placeholder='請輸入'>";
if ($i != 1 && $j == 0) {
echo "
</div>
<div class='row'>
";
}
echo " <div class='col-1 form_field_title'>
" . $val['label'] . "
</div>
<div class=' col-2 form_field_content ' >
$_input
</div>
";
}
echo "</div>";
?>
<div id="assign_area " class="row ">
<div class="col-12 form_row_header ">
<b>洽商進度</b>
</div>
<div class="col-12 " style="padding:0">
<textarea class='form-control textarea' id="progress_remark" name="progress_remark" value='12' rows='6'><?= $hope_contract['progress_status'] ?></textarea>
</div>
</div>
<div id="elevator_list_area " class="row ">
<div class="col-12 form_row_header ">
<b>電梯詳細資料</b>
</div>
<table style='margin-top:0px;text-align:center' class=' table-condensed' id='elevator_list1'>
<thead>
<tr>
<td colspan='18' style='text-align:left;font-size:13px'>
<b>註意事項:</b>
<p>1.速度單位是 米/分.</p>
<p>2.選擇贈送M1,保養月數需填寫60.</p>
<p>3.標準價格未帶出,請聯係業務部建立該規格報價.</p>
<p>4.無機房速度20~60米 以60米為標準.</p>
</td>
</tr>
<tr>
<td colspan='18' ;><button onClick='addRow()' type="button" style='float:right' class="btn btn-link btn-md">+新增</button></td>
</tr>
</thead>
</table>
<table class=' table-condensed' id='elevator_list'>
<thead>
<tr style=' margin-top:0px;text-align:center'>
<th colspan="2">電梯許可代碼</th>
<th colspan="2">品牌</th>
<th colspan="2">電梯類型</th>
<th colspan="2">規格型號</th>
<th>載重(KG)</th>
<th colspan="2">速度(m/min)</th>
<th>停數</th>
<th>層數</th>
<th>人乘</th>
<th colspan="2">保養次數</th>
<th>保養月數</th>
<th>保養周期</th>
<th>贈送M1</th>
</tr>
</thead>
<tbody id='cmecTbody'>
<tr>
<td colspan="2">
<div class=' col-12'><input id="register_code" name="register_code[]" type="text" value placeholder="無證號請輸入A、B..." repuired class="form-control form=control-sm"></div>
</td>
<td colspan="2">
<div class=' col-12'>
<select name="elevator_brand[]" id="" class="form-control form-control-sm">
<option value=""></option>
<?php foreach ($elevator_brand_opt as $data) : ?>
<option value="<?php echo $data['value']; ?>"><?php echo $data['label'] ?></option>
<?php endforeach ?>
</select>
</div>
</td>
<td colspan="2">
<div class=' col-12'>
<select name="elevator_kind[]" id="" class="form-control form-control-sm">
<option value=""></option>
<?php foreach ($elevator_kind_opt as $data) : ?>
<option value="<?php echo $data['value'] ?>"><?php echo $data['label'] ?></option>
<?php endforeach ?>
</select>
</div>
</td>
<td colspan="2">
<div class=' col-12'>
<select name="spec[]" id="" class="form-control form-control-sm">
<option value=""></option>
<?php foreach ($fp_kind_opt as $data) : ?>
<option value="<?php echo $data['value'] ?>"><?php echo $data['label'] ?></option>
<?php endforeach ?>
</select>
</div>
</td>
<!-- <td><section name='spec'></section></td> -->
<td>
<div class=' col-12'><input type="digits" id="weight" name="weight[]" value gt="0" min="0" required class="form-control form-control-sm"></div>
</td>
<td colspan="2">
<div class=' col-12'><input type="number" id="speed" name="speed[]" valaue gt="0" min="0" require class="form-control form-control-sm"></div>
</td>
<td>
<div class=' col-12'><input type="number" id="stop" name="stop[]" class="form-control form-control-sm"></div>
</td>
<td>
<div class=' col-12'><input type="digits" id="floors" name="floors[]" value min="1" required class="form-control form-control-sm"></div>
</td>
<td>
<div class=' col-12'><input type="digits" id="persons" name="persons[]" value min='1' required class="form-control form-contorl-sm"></div>
</td>
<td colspan="2">
<div class=' col-12'><input type="digits" id="maintain_times" name="maintain_times[]" value='1' min='1' required class="form-control form-control-sm"></div>
</td>
<td>
<div class=' col-12'><input type="digits" id="maintain_months" name="maintain_months[]" value="12" min='12' required class="form-control form-control-sm"></div>
</td>
<td>
<div class=' col-12'><input type="digits" id="maintain_period" name="maintain_period[]" value="1" min='1' require class="form-control form-control-sm"></div>
</td>
<td>
<div class='col-12'>
<select name="is_m1_bundle[]" id required class="form-control form-control-sm" id="">
<option value=""></option>
<?php foreach ($is_m1_bundle_opt as $data) : ?>
<option value="<?php $data['value'] ?>"><?php echo $data['label'] ?></option>
<?php endforeach ?>
</select>
</div>
</td>
</tr>
</tbody>
<thead>
<tr style='margin-top:0px;text-align:center'>
<th colspan="2">竣工檢查年度</th>
<th colspan="2">上次年檢日期</th>
<th colspan="2">年檢費用(元)</th>
<th colspan="2">標準價格(元/月)</th>
<th colspan="2">契約報價(元/月)</th>
<th colspan="2">契約成交價(元/月)</th>
<th>刪除</th>
<th colspan="6"></th>
</tr>
</thead>
<tbody id='cmecTbody2'>
<tr>
<td colspan="2">
<div class="col-12"><input type="text" id="useful_years" name="useful_years[]" type="digits" value colspan='2' required gt='0' min='0' class="form-control form-control-sm"></div>
</td>
<td colspan="2">
<div class="col-12"><input type="number" id="last_check_date" name="last_check_date[]" value required colspan="2" class="form-control form-control-sn"></div>
</td>
<td colspan="2">
<div class="col-12"><input type="text" id="annual_survey_expense" name="annual_survey_exoense[]" type="number" value required colspan='2' class="form-control form-control-sm"></div>
</td>
<td colspan="2">
<div class="col-12"><input type="text" id='stand_price' name="stand_price[]" value required readonly colspan='2' class="form-control form-control-sm"></div>
</td>
<td colspan="2">
<div class="col-12"><input type="number" id="contract_price" name="contract_price[]" required colsapn="2" class="form-control form-control-sm"></div>
</td>
<td colspan="2">
<div class="col-12"><input type="number" id="sold_price" name="sold_price[]" colspan='2' class="form-control form-control-sm"></div>
</td>
<td>
<div class=' col-12'><button onclick="delRow(this)" name='btn1' type="button" class="btn btn-link btn md">刪除</button></div>
</td>
<td colspan="6"></td>
</tr>
</tbody>
</table>
</div>
<div id="assign_area " class="row ">
<div class="col-12 form_row_header ">
<b>簽核操作</b>
</div>
<div class="col-12 col-3 form_field_content " style="padding:0">
<textarea id="assign_opinion" name="assign_opinion" required></textarea>
</div>
</div>
<div class="row">
<div class=" col-3 form_field_title">
<b style='float:right'>簽核狀態</b>
</div>
<div class=" col-2 form_field_content ">
<select name="assign_status" id="assign_status" required class='form-control form-control form-control-sm '>
<?php echo $assign_status; ?>
</select>
</div>
<div class=" col-2 form_field_title">
<b>下位簽核者</b>
</div>
<div class="col-2 form_field_content">
<select lect name="next_users" id="next_users" class='form-control form-control-sm '></select>
</div>
<div class="col-3 form_field_title ">
<button type="submit" name="btn_save" class="btn btn-warning btn-sm" value="save" style='float:left;margin-right:4px;'>保存</button>&nbsp;
<button type="submit" name="btn_save" class="btn btn-primary btn-sm" value="tosign" style='float:left'>提交</button>
</div>
</div>
<div id="opinion_area " class="row form_comment ">
<div class='col-12 '>
<ul class=" form-control-md nav nav-tabs" role="tablist" style='line-height:20px'>
<li class="active nav-item ">
<a href="#main_flow_assign" aria-controls="main_flow_assign" role="tab" class=" active nav-link" role="tab" data-toggle="tab">簽核意見</a>
</li>
</ul>
</div>
<div class="tab-content col-12">
<div role="tabpanel" class="tab-pane active" id="main_flow_assign">
<div class="comment_items ">
<?php $cnt = 1;
$tmp_code = "0";
foreach ($assign_opinions as $as) { ?>
<div class="comment-item">
<!-- <div class="comment-title">
<b></b>
</div>-->
<?php
if (($as['flow_code']) != $tmp_code)
echo ' <div class="comment-title">
<b>' . $wf->getNodeDescriptions($as['flow_code']) . '</b>
</div>';
$tmp_code = $as['flow_code'];
?>
<div class="comment-content <?php if ($cnt++ % 2 == 0) echo "comment-odd" ?>">
<div class="comment-content-header">
<span>
<strong>
<?php echo Employee::get_employee($as['assigner'], 'name-employee_no') ?>
&nbsp;
<?php if ($as['lead_code'] < 90) echo
" <label class='comment-content-tag'>" . $as['position_name'] . " </label>"; ?>
</strong>
</span>
<span>
<strong>
&nbsp;
<?php if ($as['assign_status'] == 'S') echo
" <label class='comment-content-tag'>申請人 </label>"; ?>
<?php if (substr($as['assign_status'], 0, 1) == 'B')
echo " <label class='comment-content-tag red-tag'>退回</label>"; ?>
<?php if (substr($as['assign_status'], 0, 2) == 'X3')
echo " <label class='comment-content-tag red-tag'>會簽</label>"; ?>
</strong>
</span>
<span class="comment-content-header-time">
簽核於:<?= $as['assign_date'] ?>
</span>
<!-- <ul class="comment-content-tags">
<li class="">不同意</li>
<li class="comment-content-tag-alert">退回</li>
</ul>-->
</div>
<div class="comment-content-body">
<?= $as['assign_opinion'] ?>
</div>
<!-- <div class="comment-content-footer">
<span>已上載附件:&nbsp;</span><a href="#">附件1</a>
</div>-->
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- 模態框(Modal) -->
<div class="modal fade" id="brandModal" tabindex="-1" role="dialog" aria-labelledby="brandModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
新增廠牌
</div>
<div class="modal-body">
<input type="text" class='form-control form-control form-control-sm ' id='new_brand'>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onClick="addNewBrand()" data-dismiss="modal">保存</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
</div>
</div>
</body>

42
wms/cont/conn.php

@ -0,0 +1,42 @@
<?php
$envFile = __DIR__ . '/.env'; // .env 文件的路径
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines !== false) {
foreach ($lines as $line) {
list($key, $value) = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
// 设置环境变量
putenv("$key=$value");
}
}
}
$db_hostname = getenv('DB_HOST'); //資料庫主機名稱
$db_username = getenv('DB_USERNAME'); //登入資料庫的管理者的帳號
$db_password = getenv('DB_PASSWORD'); //登入密碼
$db_name = getenv('DB_DATABASE'); //使用的資料庫
$db_charset = 'utf8'; //設定字元編碼
//建立PDO的指定工作
$dsn = "mysql:host=$db_hostname;dbname=$db_name;charset=$db_charset";
try {
//使用PDO連接到MySQL資料庫,建立PDO物件
$conn = new PDO($dsn, $db_username, $db_password);
//當錯誤發生時會將錯誤資訊放到一個類物件裡(PDOException)
//PDO異常處理,PDO::ATTR_ERRMODE,有以下三種值的設定
//PDO::ERRMODE_SILENT: 預設模式,不主動報錯,需要以$conn->errorInfo()的形式獲取錯誤資訊
//PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯
//PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。
//設定主動以警告的形式報錯
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//如果連接錯誤,將抛出一個PDOException異常對象
} catch (PDOException $e) {
//如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作
die("ERROR!!!: " . $e->getMessage());
}
//$conn = null; //關閉資料庫的連線

11
wms/cont/query_form.php

@ -114,9 +114,9 @@ $con_maintance_examine_clear_columm = [
'sold_price' => ['label' => "契約成交價C(元/月)", "value" => "", "tag" => 'number', 'attr' => ['required', 'colspan' => 2, 'name' => 'sold_price[]', 'class' => 'form-control form-control-sm']],
'mi_cost' => ['label' => "標準成本D(元/月)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true','disabled', 'colspan' => 2, 'name' => 'mi_cost[]', 'class' => 'form-control form-control-sm']],
'discount' => ['label' => "折扣率E(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true','disabled', 'colspan' => 2, 'name' => 'mi_cost_rate[]', 'class' => 'form-control form-control-sm']],
'gross_profit' => ['label' => "毛利率F(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true','disabled', 'colspan' => 2, 'name' => 'gross_profit[]', 'class' => 'form-control form-control-sm']],
'mi_cost' => ['label' => "標準成本D(元/月)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'mi_cost[]', 'class' => 'form-control form-control-sm']],
'discount' => ['label' => "折扣率E(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'mi_cost_rate[]', 'class' => 'form-control form-control-sm']],
'gross_profit' => ['label' => "毛利率F(%)", "value" => "", "tag" => 'number', 'attr' => ['readonly=true', 'disabled', 'colspan' => 2, 'name' => 'gross_profit[]', 'class' => 'form-control form-control-sm']],
];
$con_maintance_examine_clear = DB::result("SELECT register_code,
@ -267,6 +267,7 @@ function base_url($url)
$i = 0;
echo " <div class='row '>";
foreach ($editableColumn as $key => $val) {
// print_r($val['label']);
$j = (($i++) % 4);
$fieldVal = empty($data) ? "" : $data[$key];
$fieldVal = empty($data) ? "" : $data[$key];
@ -275,8 +276,8 @@ function base_url($url)
FormHelper::select("$key", $val['options'], $fieldVal, $val['attr']) :
FormHelper::tag("label", $val['attr'], $fieldVal);
//"<input type='" . $val['tag'] . "' class=' form-control form-control-sm " . $val['class'] . "'
// value='" . $fieldVal . "' name='$key' id='$key' placeholder='請輸入'>";
// "<input type='" . $val['tag'] . "' class=' form-control form-control-sm " . $val['class'] . "'
// value='" . $fieldVal . "' name='$key' id='$key' placeholder='請輸入'>";
if ($i != 1 && $j == 0) {
echo "
</div>

11
wms/cont/sign_form.php

@ -1,5 +1,6 @@
<?php
// phpinfo();
// exit;
#error_reporting(E_ALL);
#ini_set("display_errors", "On");
@ -75,7 +76,7 @@ $editableColumn = [
$where = " and form_key='$form_key'";
$sql = "SELECT " . implode(',', array_keys($editableColumn)) .
" ,progress_remark FROM $table where 1=1 $where ORDER BY apply_key";
" ,progress_remark FROM $table where 1=1 $where ORDER BY apply_key";
$data = [];
list($data) = DB::result($sql);
@ -165,7 +166,7 @@ foreach ($con_maintance_examine_clear as $val) {
$total_stand_price += $val['stand_price'];
}
$total_discount_rate = $total_sold_price == 0 ? 0
: (100*round($total_sold_price / $total_stand_price, 4)) . "%";
: (100 * round($total_sold_price / $total_stand_price, 4)) . "%";
$wf->setFormData(['discount' => substr($total_discount_rate, 0, -1)]);
$assigner = $wf->getAssignerList();
@ -349,7 +350,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
</div>
<div class="col-12 " style="padding:0">
<textarea class='form-control textarea' disabled id="progress_remark" name="progress_remark" value='12' rows='6'> <?php echo empty($data['progress_remark'])?'':$data['progress_remark']?> </textarea>
<textarea class='form-control textarea' disabled id="progress_remark" name="progress_remark" value='12' rows='6'> <?php echo empty($data['progress_remark']) ? '' : $data['progress_remark'] ?> </textarea>
</div>
</div>
<div id="elevator_list_area " class="row ">
@ -411,7 +412,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
== 'ok' ? $res['price'] : $res['message']);
$con_maintance_examine_clear[$key]['gross_profit'] = $val['gross_profit'] = "/"; //$fieldVal==0?0: (round(($val['sold_price'] - $val['mi_cost']) / $fieldVal, 2) * 100) . "%"
#扣率
$val['discount'] = (100*round($val['sold_price'] / $val['stand_price'], 4)) . "%";
$val['discount'] = (100 * round($val['sold_price'] / $val['stand_price'], 4)) . "%";
}
$_input = FormHelper::tag("label", ['colspan' => empty($col_def['attr']['colspan']) ? 1

272
wms/cont/sign_list.php

@ -3,30 +3,34 @@ require_once "../header.php";
// 載入db.php來連結資料庫
$table = 'con_maintance_examine_apply';
$para = "function_name=pricereview&" . $token_link;
$status_arr = ["Y1" => "暫存", "YS" => "簽核中", "YY" => "結案同意", "YN" => "結案不同意"];
#可編輯的列
$editableColumn = [
'apply_key' => [
'label' => "評審單號", "value" => "", "tag" => 'text',
'attr' => [
'readonly=true ',
'class' => 'form-control form-control-sm'
]
],
'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']],
'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'num' => ['label' => "電梯臺數", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
//'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt],
];
// $editableColumn = [
// 'apply_key' => [
// 'label' => "評審單號", "value" => "", "tag" => 'text',
// 'attr' => [
// 'readonly=true ',
// 'class' => 'form-control form-control-sm'
// ]
// ],
// 'vol_no' => ['label' => "卷號", "value" => "", "tag" => 'text', 'attr' => ['readonly=true ', 'class' => 'form-control form-control-sm']],
// 'address' => ['label' => "現場地址", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'case_name' => ['label' => "現場名稱", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'brand' => ['label' => "電梯品牌", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'num' => ['label' => "電梯臺數", "value" => "", "tag" => 'number', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'salesman' => ['label' => "營業員", "value" => "", "tag" => 'text', 'attr' => ['required', 'class' => 'form-control form-control-sm']],
// 'maintain_kind' => ['label' => "保養方式", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
// 'contract_begin_date' => ['label' => "契約期限開始", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
// 'contract_end_date' => ['label' => "契約期限結束", "value" => "", "tag" => 'date', 'attr' => ['required', 'class' => 'date form-control form-control-sm']],
// 'contract_kind' => ['label' => "契約性質", "value" => "", "tag" => 'select', 'attr' => ['class' => 'form-control form-control-sm']],
// 'platform_company' => ['label' => "加盟公司名稱", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
// 'platforom_company_tel' => ['label' => "加盟公司電話", "value" => "", "tag" => 'text', 'attr' => ['class' => 'form-control form-control-sm']],
// //'payment_kind' => ['label' => "付款方式", "value" => "", "tag" => 'select', 'attr' => ['required', 'class' => 'form-control form-control-sm'], 'options' => $payment_kind_opt],
// ];
// 設置一個空陣列來放資料
$data = array();
@ -41,7 +45,7 @@ $res = mysqli_query($link, $sql);
$row = mysqli_fetch_row($res);
$user_department_id = $row[0];
mysqli_free_result($res);
if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006") $where = "";
if (in_array($user_department_id, $depart_arr) || $user_id == "M0008" || $user_id == "M0012" || $user_id == "M0006" || $user_id == "M0189" || $user_id == "TEST01" || $user_id == "TEST02" || $user_id == "TEST03" || $user_id == "M0225") $where = "";
// 電梯廠牌
$elevator_brand_arr = [];
@ -59,6 +63,7 @@ $sql = "SELECT
case_name,
brand ,
num ,
salesman as salesman_id,
f_return_name(salesman) salesman,
f_return_content('maintain_kind',maintain_kind ) maintain_kind,
date_format(contract_begin_date,'%Y/%m/%d') contract_begin_date,
@ -67,11 +72,13 @@ f_return_content('contract_kind',contract_kind ) contract_kind,
platform_company,
platforom_company_tel,
form_key,
status,
f_return_content('payment_kind',payment_kind ) payment_kind FROM $table
where 1=1 $where ORDER BY vol_no";
// echo $sql;
$data = mysqli_query($link, $sql);
?>
<?php
@ -87,60 +94,175 @@ if ($data) :
}
?>
<link rel="stylesheet" href="common.css">
<!-- <link rel="stylesheet" href="common.css"> -->
<style>
#table_index2 {
table-layout: fixed;
width: 100%;
}
<div style="overflow-x:auto;">
<form method='get' action='#'>
<table class='table query-table table-striped table-bordered display compact'
style='width:98%;text-align:center;margin:0 auto'>
<thead>
<tr>
<td colspan="8">
<h3 style='text-align:center'>(契約)價審單查詢</h3>
</td>
</tr>
#table_index2_filter {
float: right;
}
</thead>
</table>
<table id="table_index" class="table table-striped table-bordered" style="width:98%" >
<thead>
<?php
echo "<tr>";
foreach ($editableColumn as $key => $val) {
echo "<th>".$val['label']."</th>";
}
echo "<th>是否結案</th>";
// echo "<th>刪除</th>";
echo "</tr>";
?>
</thead>
<tbody>
<?php foreach ($data as $row) : ?>
<tr>
<?php
foreach ($editableColumn as $key => $val) {
if ( $key =='apply_key') {
echo "<td> <a href='query_form.php?apply_key=$row[$key]&token=".$_GET['token']."'>" . $row[$key] . "</td>";
} elseif ($key == 'brand') {
echo "<td>" . (!empty($row[$key])?$elevator_brand_arr[$row[$key]]:"") . "</td>";
} else {
echo "<td>" . $row[$key] . "</td>";
}
}
//list($signer)=DB::fields(");
//echo " select f_return_name(current_assigner) signer from subflow where form_key='". $row['form_key'] ."'"; ". (is_array($row['form_key'])?'': $row['form_key']) ."
list($signer)=mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='". $row['form_key'] ."'" ));
#table_index2_paginate {
float: right;
}
div.dataTables_scrollHead table.dataTable {
margin-bottom: 0 !important;
border-bottom-width: 0;
}
div.dataTables_scrollBody table.dataTable {
border-top-width: 0;
}
/*
.col-sm-12 {
width: auto;
}
*/
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
div a:hover {
text-decoration: none;
}
.btn-sm {
font-size: 14px;
margin: 2px 0;
line-height: 90%;
}
.glyphicon-ok,
.glyphicon-ban-circle {
font-size: 130%;
}
.btn-secondary {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
.btn-secondary:hover {
color: #fff;
background-color: #5a6268;
border-color: #545b62;
}
echo "<td>" .(empty($signer)?"結案":"N") . "</td>";
.applybtn {
color: #fff;
background-color: #1484c4;
display: block;
border-radius: 4px;
padding: 4px 2px;
font-size: 13px;
?>
}
.applybtn:hover {
background-color: #1494f9;
color: #fff;
}
</style>
<script>
$(function() {
$('#table_index2').DataTable({
"scrollX": true,
"pageLength": 50
});
/*
var api = $('#table_index').dataTable().api();
//var order = api.order();
//console.log(order);
api
.order([0, "desc"])
.draw();
*/
});
</script>
<link rel="stylesheet" href="../crm/common.css">
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div style="overflow-x:auto; white-space:nowrap;">
<table id="table_index2" 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>
<th>合約下載</th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $row) :
$oneself = ($row['salesman'] == $user_id) ? 1 : 0;
?>
<tr>
<td><?php echo $row['apply_key'] ?></td>
<td><?php echo $row['vol_no'] ?></td>
<td><?php echo $row['address'] ?></td>
<td><?php echo $row['case_name'] ?></td>
<td><?php echo $row['brand'] ?></td>
<td><?php echo $row['num'] ?></td>
<td><?php echo $row['salesman'] ?></td>
<td><?php echo $row['maintain_kindd'] ?></td>
<td><?php echo $row['contract_begin_date'] ?></td>
<td><?php echo $row['contract_end_date'] ?></td>
<td><?php echo $row['contract_kind'] ?></td>
<td><?php echo $row['platform_company'] ?></td>
<td><?php echo $row['platforom_company_tel'] ?></td>
<?php list($signer) = mysqli_fetch_array(mysqli_query($link, "select max(f_return_name(current_assigner) ) signer from subflow where form_key='" . $row['form_key'] . "'")); ?>
<td><?php echo empty($signer) ? '結案' : 'N' ?></td>
<td>
<a class="applybtn" href="../contract-repair/contract_maintance.php?apply_key=<?php echo $row['apply_key'] . '&' . $para; ?>">
<?php if (($row['status'] == 'YY' && $oneself)) {
echo '申請';
} else {
echo '檢視';
} ?>
</a>
<?php if ($row['status'] == 'YY' && ($user_id == "M0060" || $user_id == "M0107" || $user_id == "M0174" || $user_id == 'M0225') && $row['applystatus'] == 1) : ?>
<a class="applybtn" href="../contract-repaire/contract_maintance.php?id=<?php echo $row['id'] . '&' . $para; ?>">待簽核</a><br>
<?php endif; ?>
<?php if ($row['status'] != 'Y1') : ?>
<span style="font-size:13px;font-weight:600">--</span>
<?php endif; ?>
<?php if (($row['status'] === 'YY' && $row['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060")) || $user_id == "M0174" || $user_id == 'M0225') : ?>
<a class="applybtn" href="../contract-repair/contract-download.php?apply_key=<?php echo $row['apply_key'] . '&' . $para ?>">下載</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php

21
wms/cont/submit.php

@ -3,8 +3,9 @@
require_once './wf_common.php';
require_once './model/ConMaintanceExamineApplyModel.php';
require_once './model/ConMaintanceExamineClearModel.php';
//print_r($_POST);exit;
$request = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET : $_POST;
// print_r($request);
// exit;
$tosign = ($request["btn_save"] == "tosign") ? 1 : 0; // 1:提交
if ($request["form_src"] == "apply_form" && $tosign && (!isset($request["register_code"]) || empty($request["register_code"][0]) || !isset($request["next_users"]) || empty($request["next_users"]))) {
@ -17,13 +18,13 @@ if ($request["form_src"] == "apply_form" && $tosign && (!isset($request["registe
//更新表单ConMaintanceExamineApplyModel
$cmea = new ConMaintanceExamineApplyModel();
$apply_key=$request['apply_key'];
$apply_key = $request['apply_key'];
$cmea->update(['apply_key', $apply_key], array_diff_key($request, ['apply_key' => '']));
//更新电梯列表
if (!empty($request["reg_del"])) {
$register_code_del_arr = explode(",", rtrim($request["reg_del"], ","));
foreach ($register_code_del_arr as $val) {
$sql = "update con_maintance_examine_clear set cmstatus = 'D' where apply_key = '$apply_key' and register_code = '$val' and cmstatus <> 'D'";
$sql = "UPDATE con_maintance_examine_clear SET cmstatus = 'D' WHERE apply_key = '$apply_key' AND register_code = '$val' AND cmstatus <> 'D'";
DB::query($sql);
}
}
@ -36,7 +37,7 @@ if (!empty($request['register_code']) && count($request['register_code']) > 0) {
$cols = array_diff($cmec->fillable, ['apply_key']);
foreach ($cols as $col) {
$data[$col] = empty($request[$col][$i]) ? '' : $request[$col][$i];
if ($col=="annual_survey_expense") $data[$col] = '0.00';
if ($col == "annual_survey_expense") $data[$col] = '0.00';
}
$cmec->create($data);
}
@ -59,20 +60,20 @@ if ($tosign) {
#結案發通知給營業員
if ($request['assign_status'] == 'F4') {
list($salesman, $case_name ) = DB::fields("select salesman ,case_name from con_maintance_examine_apply where apply_key='" . $apply_key. "' ");
$ins_notice_sql = "INSERT INTO `notice` ( `kind`,`title`, `content`, `permission`)
VALUES ( '1', '契約價審單結案通知(" .$case_name . ")', '契約價審單結案通知(" . $case_name . ")', ' $salesman')";
list($salesman, $case_name) = DB::fields("select salesman ,case_name from con_maintance_examine_apply where apply_key='" . $apply_key . "' ");
$ins_notice_sql = "INSERT INTO `notice` ( `kind`,`title`, `content`, `permission`)
VALUES ( '1', '契約價審單結案通知(" . $case_name . ")', '契約價審單結案通知(" . $case_name . ")', ' $salesman')";
DB::query($ins_notice_sql);
// echo $ins_notice_sql;
// echo $ins_notice_sql;
}
}
echo "<script type = 'text/JavaScript'>";
//echo "<h4 style='text-align:center'>成功提交<a href='https://www.masada.com.tw/wms/sign/list.php?function_name=show&token=" . $request['token'] . "'>返回待签 </a></h4>";
if ($tosign) {
echo "alert('成功提交');";
echo "location.href='../cont/sign_list.php?function_name=sign_list&token=".$request['token']."';";
echo "location.href='../wms/index.php.php?function_name=sign_list&token=" . $request['token'] . "';";
} else {
echo "alert('資料已保存');";
echo "location.href='../crm/crmm02-index.php?function_name=contract_customer&token=".$request['token']."';";
echo "location.href='../crm/crmm02-index.php?function_name=contract_customer&token=" . $request['token'] . "';";
}
echo "</script>";

16
wms/cont/t.php

@ -4,7 +4,7 @@ ini_set('dispaly_errors', "On");
require_once './MSCalculator.php';
/* //客梯
//客梯
$param = [
'elevator_type' => 'A',
@ -18,8 +18,8 @@ $param = [
'maintain_period' => 1, //默认为1月1次, 2是为2月一次
'is_m1_bundle' => 'N',
];
*/
/* //货梯
//货梯
$param = [
'elevator_type' => 'B',
@ -33,9 +33,9 @@ $param = [
'maintain_period' => 1, //默认为1月1次, 2是为2月一次
'is_m1_bundle' => 'N',
];
*/
/*//病床梯
//病床梯
$param = [
'elevator_type' => 'C',
@ -48,9 +48,9 @@ $param = [
'maintain_kind' => 2,
'maintain_period' => 1, //默认为1月1次, 2是为2月一次
'is_m1_bundle' => 'N',
];*/
];
/*//无机房
//无机房
$param = [
'elevator_type' => 'D',
'floors' => 3,
@ -64,7 +64,7 @@ $param = [
'is_m1_bundle' => 'N',
];
*/
//家用梯
$param = [
'elevator_type' => 'E',

34
wms/contract-repair/api/deleteNewContractData.php

@ -0,0 +1,34 @@
<?php
require_once("../conn.php");
ini_set('date.timezone', 'Asia/Taipei');
if (isset($_GET['contractid']) && $_GET['contractid'] != "" && isset($_GET['contracttype']) && $_GET['contracttype'] == 'r') {
try {
$id = $_GET['contractid'];
$user_id = $_GET['user_id'];
$date = date('Y-m-d H:i:s');
$del = '2';
$sql = "UPDATE contract_r_signed_back SET delete_status = :del,delete_userid= :user_id, delete_date = :date WHERE id = :id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(":id", $id);
$stmt->bindParam(":del", $del);
$stmt->bindParam(":user_id", $user_id);
$stmt->bindParam(":date", $date);
$stmt->execute();
header("HTTP/1.1 204 NO Content");
} catch (PDOException $e) {
die("ERROR!!!" . $e->getMessage());
}
}
if (isset($_GET['contractid']) && $_GET['contractid'] != "") {
try {
$id = $_GET["contractid"];
$sql_str = "DELETE FROM contract_m_signed_back WHERE id = :contractid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(":contractid", $id);
$stmt->execute();
header("HTTP/1.1 204 No Content");
} catch (PDOException $e) {
die("ERROR!!!: " . $e->getMessage());
}
}

59
wms/contract-repair/api/getComboNo.php

@ -0,0 +1,59 @@
<?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);
}
}

122
wms/contract-repair/api/getContractData.php

@ -0,0 +1,122 @@
<?php
require_once('../conn.php');
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
WHERE con_maintance_examine_apply.vol_no = :vol_no ;";
$sql_str = "SELECT * FROM con_maintance_examine_apply WHERE vol_no = :vol_no ORDER BY create_at DESC;";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contractno);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
if (empty($contract)) {
echo false;
exit;
}
$apply_key = $contract['apply_key'];
$sql_str = "SELECT * FROM con_maintance_examine_clear WHERE apply_key = :apply_key";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':apply_key', $apply_key);
$stmt->execute();
$elevators = $stmt->fetchAll(PDO::FETCH_ASSOC);
$count = COUNT($elevators);
$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());
}
}
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";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contractno);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
$contractResponse = json_encode($contract);
// 設定回應標頭為 JSON
header('Content-Type: application/json');
// 將 JSON 回應返回給客戶端
echo $contractResponse;
} catch (PDOException $e) {
die("ERROR!!!: " . $e->getMessage());
}
}
//////////////////////////////
//// 合約簽回(修理)
////
//// 製作人:梓誠
/// 時間 :
//////////////////////////////
if (isset($_GET['repair_no']) && $_GET['repair_no'] != '' && isset($_GET['contracttype']) && $_GET['contracttype'] == 'r') {
try {
$repair_no = $_GET['repair_no'];
$fail_arr = [];
$d_status = '1';
// 判斷單號是否在合約簽核已建立
$sql = "SELECT COUNT(*) AS num FROM contract_r_signed_back WHERE repair_no = :repair_no AND delete_status = :d_status ";
$stmt = $conn->prepare($sql);
$stmt->bindParam(":repair_no", $repair_no);
$stmt->bindParam(":d_status", $d_status);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
$count = $result['num'];
if ($count >= 1) {
$fail_arr[] = '合約單號重複,請至契約管理(修理)查看。';
header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr);
exit();
}
// 判斷單號是否在價格審查中以建立。
$sql = "SELECT COUNT(*) AS num FROM pricereview_repair_main WHERE repair_no = :repair_no";
$stmt = $conn->prepare($sql);
$stmt->bindParam(":repair_no", $repair_no);
$stmt->execute();
$result2 = $stmt->fetch(PDO::FETCH_ASSOC);
$count2 = $result2['num'];
if ($count2 == 0) {
$fail_arr[] = '找不到單號,請再確認。';
header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr);
exit();
}
// $contractno = $_GET['contractno'];
$sql = "SELECT a.*,b.name,b.accountid
FROM pricereview_repair_main AS a
LEFT JOIN account AS b
ON a.repairerid = b.accountid
WHERE a.repair_no = :repair_no ";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':repair_no', $repair_no);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
$contractResponse = json_encode($contract);
// 設定回應標頭為 JSON
header('Content-Type : appliction/json');
// 將 JSON 回應給客戶端
echo $contractResponse;
} catch (PDOException $e) {
die("ERROR!!:" . $e->getMessage());
}
}

518
wms/contract-repair/api/getFacilityNo.php

@ -0,0 +1,518 @@
<?php
//ini_set('display_errors', 'on');
// 汰改 前三碼 流水號 + 後兩碼 號機
// 新梯 流水號
// 新增 seq 的初始值
// INSERT INTO `sequence` (`seq_name`, `current_val`, `increment_val`, `remark`, `yyyymm`, `prefix`, `creator`, `create_at`) VALUES ('bf_vol_no', '0', '1', '保養-作番編號', '202310', '', 'M0117', '2023-10-26 11:28:11'), ('mf_vol_no', '0', '1', '新梯-作番編號', '202310', '', 'M0117', '2023-10-26 11:28:11'), ('tf_vol_no', '0', '1', '汰改-作番編號', '202310', '', 'M0117', '2023-10-26 11:28:11')
class CreateFacilityNo
{
/**
* 連接資料庫
*/
function connectionDB()
{
$envFile = __DIR__ . '/../../../.env';
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines !== false) {
foreach ($lines as $line) {
list($key, $value) = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
putenv("$key=$value");
}
}
}
date_default_timezone_set("Asia/Taipei");
$host = getenv('DB_HOST');
$dbport = getenv('DB_PORT');
$dbuser = getenv('DB_USERNAME');
$dbpassword = getenv('DB_PASSWORD');
$dbname = getenv('DB_DATABASE');
try {
$options = [
PDO::ATTR_PERSISTENT => false,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_EMULATE_PREPARES => false,
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
];
$pdo = new PDO('mysql:host=' . $host . ';port=' . $dbport . ';dbname=' . $dbname . '', $dbuser, $dbpassword, $options);
$pdo->exec('SET CHARACTER SET utf8mb4');
return $pdo;
} catch (PDOException $e) {
die("Something wrong: {$e->getMessage()}");
}
}
/**
* 結束資料庫連線
*/
function endConnectionDB($pdo)
{
unset($pdo);
}
/**
* 取得下一個新的作番
* @param string $facility_type : M:新梯 T:汰改 B:保養
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @param int $num : 號機
* @return array $new_facility_arr
*/
function getNextFacilityNo($facility_type, $sale_type, $make_type, $num = 1)
{
$this->checkYearAndResetAllSeq();
$Y = substr(date("Y"), 3, 1);
switch ($facility_type) {
case "M":
$next_seq = $this->getNextFacilitySeq("mf_vol_no") + 1;
$new_facility_arr = [];
for ($start_num = 1; $start_num <= $num; $start_num++) {
$facility_no_tmp = $Y . $sale_type . $make_type[$start_num - 1]
. str_pad($next_seq, 5, "0", STR_PAD_LEFT);
array_push($new_facility_arr, $facility_no_tmp);
$next_seq++;
}
return $new_facility_arr;
case "T":
$next_seq = $this->getNextFacilitySeq("tf_vol_no");
$new_facility_arr = [];
for ($start_num = 1; $start_num <= $num; $start_num++) {
$facility_no_tmp = $Y . $sale_type . $make_type[$start_num - 1]
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT)
. str_pad($start_num, 2, "0", STR_PAD_LEFT);
array_push($new_facility_arr, $facility_no_tmp);
}
return $new_facility_arr;
case "B":
$next_seq = $this->getNextFacilitySeq("bf_vol_no");
$new_facility_arr = [];
for ($start_num = 1; $start_num <= $num; $start_num++) {
$facility_no_tmp = $Y . $sale_type . $make_type[$start_num - 1]
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT)
. str_pad($start_num, 2, "0", STR_PAD_LEFT);
array_push($new_facility_arr, $facility_no_tmp);
}
return $new_facility_arr;
default:
return "不存在的作番類型";
}
}
/**
* 建立新的作番
* @param string $facility_type : M:新梯 T:汰改 B:保養
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @param string $num : 號機 (非必填)
* @return string $new_facility_no
*/
function makeFacilityNo($facility_type, $sale_type, $make_type, $num = null)
{
$this->checkYearAndResetAllSeq();
$faclikity_details = array(
'facility_type' => $facility_type,
'sale_type' => $sale_type,
'make_type' => $make_type,
'num' => $num
);
switch ($facility_type) {
case "M":
return $this->makeNewMFacilityNo($faclikity_details);
break;
case "T":
return $this->makeNewTFacilityNo($faclikity_details);
break;
case "B":
return $this->makeNewBFacilityNo($faclikity_details);
break;
default:
return "不存在的作番類型";
}
}
/**
* 建立作番 -- 新梯
*/
function makeNewMFacilityNo($faclikity_details)
{
$Y = substr(date("Y"), 3, 1);
$sale_type = $faclikity_details['sale_type'];
$make_type = $faclikity_details['make_type'];
$num = $faclikity_details['num'];
$next_seq = $this->getNextFacilitySeq("mf_vol_no") + 1;
$new_facility_no_arr = [];
for ($i = 1; $i <= $num; $i++) {
$new_facility_no = $Y . $sale_type . $make_type[$i - 1]
. str_pad($next_seq, 5, "0", STR_PAD_LEFT);
array_push($new_facility_no_arr, $new_facility_no);
$next_seq++;
}
foreach ($new_facility_no_arr as $new_facility_no) {
if ($this->getMakeNewMFacilityNoStatus($faclikity_details) !== "1") {
return $new_facility_no . ":" . $this->getMakeNewTFacilityNoStatus($faclikity_details);
}
// seq +1
$this->facilitySeqAddOne("M");
}
return $new_facility_no_arr;
}
/**
* 建立作番 -- 汰改
*/
function makeNewTFacilityNo($faclikity_details)
{
$Y = substr(date("Y"), 3, 1);
$sale_type = $faclikity_details['sale_type'];
$make_type = $faclikity_details['make_type'];
$num = $faclikity_details['num'];
$next_seq = $this->getNextFacilitySeq("tf_vol_no");
$new_facility_no_arr = [];
for ($i = 1; $i <= $num; $i++) {
$new_facility_no = $Y . $sale_type . $make_type[$i - 1]
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT)
. str_pad($i, 2, "0", STR_PAD_LEFT);
array_push($new_facility_no_arr, $new_facility_no);
}
foreach ($new_facility_no_arr as $new_facility_no) {
if ($this->getMakeNewTFacilityNoStatus($faclikity_details) !== "1") {
return $new_facility_no . ":" . $this->getMakeNewTFacilityNoStatus($faclikity_details);
}
// seq +1
$this->facilitySeqAddOne("T");
return $new_facility_no_arr;
}
}
/**
* 建立作番 -- 保養
*/
function makeNewBFacilityNo($faclikity_details)
{
$Y = substr(date("Y"), 3, 1);
$sale_type = $faclikity_details['sale_type'];
$make_type = $faclikity_details['make_type'];
$num = $faclikity_details['num'];
$next_seq = $this->getNextFacilitySeq("bf_vol_no");
$new_facility_no_arr = [];
for ($i = 1; $i <= $num; $i++) {
$new_facility_no = $Y . $sale_type . $make_type[$i - 1]
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT)
. str_pad($i, 2, "0", STR_PAD_LEFT);
array_push($new_facility_no_arr, $new_facility_no);
}
foreach ($new_facility_no_arr as $new_facility_no) {
if ($this->getMakeNewBFacilityNoStatus($faclikity_details) !== "1") {
return $new_facility_no . ":" . $this->getMakeNewBFacilityNoStatus($faclikity_details);
}
// seq +1
$this->facilitySeqAddOne("B");
return $new_facility_no_arr;
}
}
/**
* 檢查作番編列狀態 - 新梯
* @param array $faclikity_details
* @return string $status : 1:正確 else:error message
*/
function getMakeNewMFacilityNoStatus($faclikity_details)
{
$sale_type = $faclikity_details['sale_type'];
$make_type = $faclikity_details['make_type'];
if ($this->checkSaleTypeStatus($sale_type) == false)
return "銷售代號錯誤";
if ($this->checkMakeTypeStatus($make_type) == false)
return "製造編號類型錯誤";
return "1";
}
/**
* 檢查作番編列狀態 - 汰改
* @param array $faclikity_details
* @return string $status : 1:正確 else:error message
*/
function getMakeNewTFacilityNoStatus($faclikity_details)
{
$sale_type = $faclikity_details['sale_type'];
$make_type = $faclikity_details['make_type'];
if ($this->checkSaleTypeStatus($sale_type) == false)
return "銷售代號錯誤";
if ($this->checkMakeTypeStatus($make_type) == false)
return "製造編號類型錯誤";
return "1";
}
/**
* 檢查作番編列狀態 - 保養
* @param array $faclikity_details
* @return string $status : 1:正確 else:error message
*/
function getMakeNewBFacilityNoStatus($faclikity_details)
{
$sale_type = $faclikity_details['sale_type'];
$make_type = $faclikity_details['make_type'];
if ($this->checkSaleTypeStatus($sale_type) == false)
return "銷售代號錯誤";
if ($this->checkMakeTypeStatus($make_type) == false)
return "製造編號類型錯誤";
return "1";
}
/**
* seq 取號
* @param string $type M:新梯 T:汰改 B:保養
*/
function facilitySeqAddOne($type)
{
$type_arr = array(
"M" => "mf_vol_no",
"T" => "tf_vol_no",
"B" => "bf_vol_no",
);
if (!empty($type_arr[$type])) {
$pdo = $this->connectionDB();
$pdo->exec('SET CHARACTER SET utf8mb4');
$sth = $pdo->prepare('UPDATE sequence SET current_val = current_val + 1 WHERE `seq_name` = ?');
$sth->bindValue(1, $type_arr[$type]);
$sth->execute();
}
}
/**
* 修正 seq 取號
* @param string $type M:新梯 T:汰改 B:保養
*/
function facilityFixSeq($type)
{
$pdo = $this->connectionDB();
$pdo->exec('SET CHARACTER SET utf8mb4');
$type_arr = array(
"M" => "mf_vol_no",
"T" => "tf_vol_no",
"B" => "bf_vol_no",
);
$after_fix_seq = $this->getMaxSeq($type);
$sql = "
UPDATE sequence
SET current_val = ?
WHERE seq_name = ?
";
$sth = $pdo->prepare($sql);
$sth->bindValue(1, $after_fix_seq);
$sth->bindValue(2, $type_arr[$type]);
$sth->execute();
}
function getMaxSeq($type)
{
$pdo = $this->connectionDB();
$pdo->exec('SET CHARACTER SET utf8mb4');
$Y = substr(date("Y"), 3, 1);
$seq_num = $type == 'M' ? 5 : 3;
$sql = "
SELECT MAX(SUBSTR(f.facilityno,4,?))+1 AS seq
FROM facility AS f
WHERE 1=1
AND SUBSTR(f.facilityno,1,1) = ?
AND f.define = ?
ORDER BY SUBSTR(f.facilityno,4,3) ASC
";
$sth = $pdo->prepare($sql);
$sth->bindValue(1, $seq_num);
$sth->bindValue(2, $Y);
$sth->bindValue(3, $type);
$sth->execute();
$result = $sth->fetch();
return $result['seq'];
}
/**
* 檢查年月後 新梯及汰改seq歸零
*/
function checkYearAndResetAllSeq()
{
$pdo = $this->connectionDB();
$pdo->exec('SET CHARACTER SET utf8mb4');
$sth = $pdo->prepare('SELECT * FROM `sequence` WHERE `seq_name` = ?');
$sth->bindValue(1, 'mf_vol_no');
$sth->execute();
$result = $sth->fetch();
$yyyymm = $result['yyyymm'];
$dataY = substr($yyyymm, 0, 4);
$today_Y = date("Y");
$today_Ym = date("Ym");
if ($dataY != $today_Y) {
$sth = $pdo->prepare('UPDATE `sequence` SET `current_val` = ? , `yyyymm` = ? WHERE `seq_name` = ?');
$sth->bindValue(1, '0');
$sth->bindValue(2, $today_Ym);
$sth->bindValue(3, 'mf_vol_no');
$sth->execute();
}
}
/**
* 檢查作番在 facility table 中是否重複
* @param string|array $facility_no
* @return boolean $status : true:沒重複 false:重複
*/
function checkFacilityRepeatStatus($facility_no)
{
if (gettype($facility_no) == "string") {
$pdo = $this->connectionDB();
$pdo->exec('SET CHARACTER SET utf8mb4');
$sth = $pdo->prepare('SELECT * FROM `facility` WHERE `facilityno` = ?');
$sth->bindValue(1, $facility_no);
$sth->execute();
if ($sth->rowCount() == 0)
return true;
return false;
}
if (gettype($facility_no) == "array") {
$pdo = $this->connectionDB();
$pdo->exec('SET CHARACTER SET utf8mb4');
$status = true;
foreach ($facility_no as $row) {
$sth = $pdo->prepare('SELECT * FROM `facility` WHERE `facilityno` = ?');
$sth->bindValue(1, $row);
$sth->execute();
if ($sth->rowCount() !== 0)
$status = false;
}
return $status;
}
}
/**
* 檢查 $sale_type 是否有存在規則之中
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
* @return boolean $status : true:合法代碼 false:非法代碼
*/
function checkSaleTypeStatus($sale_type)
{
if (!in_array($sale_type, ['M', 'E', 'T', 'J', 'X']))
return false;
return true;
}
/**
* 檢查 $sale_type 是否有存在規則之中
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @return boolean $status : true:合法代碼 false:非法代碼
*/
function checkMakeTypeStatus($make_type)
{
foreach ($make_type as $row)
if (!in_array($row, ['X', 'W', 'H', 'Z', 'F', 'B', 'Q', 'T', 'N', 'W', 'J', 'Y']))
return false;
return true;
}
/**
* 檢查 取得下個作番的 seq
* @param string $seq_name : 新梯:mf_vol_no 汰改:tf_vol_no 保養:bf_vol_no
* @return int $seq : 作番流水號
*/
function getNextFacilitySeq($seq_name)
{
$pdo = $this->connectionDB();
$pdo->exec('SET CHARACTER SET utf8mb4');
$sth = $pdo->prepare('SELECT * FROM `sequence` WHERE `seq_name` = ?');
$sth->bindValue(1, $seq_name);
$sth->execute();
$result = $sth->fetch();
return $result['current_val'];
}
/**
* 建立新的新梯作番
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @param int $seq_name : 幾個案場 0-99
* @return array $new_facilityno : 作番號
*/
function makeMFacilityNo($sale_type, $make_type, $num)
{
if (count($make_type) !== $num)
return "陣列數量不一致!";
$new_facility_no = $this->getNextFacilityNo("M", $sale_type, $make_type, $num);
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) {
// 如果作番號重複 使用此函數修正
$this->facilityFixSeq("M");
}
return $this->makeFacilityNo("M", $sale_type, $make_type, $num);
}
/**
* 建立新的汰改作番
* @param array $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @param int $seq_name : 幾個案場 0-99
* @return array $new_facilityno : 作番號
*/
function makeTFacilityNo($sale_type, $make_type, $num)
{
if (count($make_type) !== $num)
return "陣列數量不一致!";
$new_facility_no = $this->getNextFacilityNo("T", $sale_type, $make_type, $num);
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) {
// 如果作番號重複 使用此函數修正
$this->facilityFixSeq("T");
}
return $this->makeFacilityNo("T", $sale_type, $make_type, $num);
}
/**
* 建立新的保養作番
* @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
* @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @param int $seq_name : 幾個案場 0-99
* @return array $new_facilityno : 作番號
*/
function makeBFacilityNo($sale_type, $make_type, $num = 1)
{
if (count($make_type) !== $num)
return "陣列數量不一致!";
$new_facility_no = $this->getNextFacilityNo("B", $sale_type, $make_type, $num);
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) {
// 如果作番號重複 使用此函數修正
$this->facilityFixSeq("B");
}
return $this->makeFacilityNo("B", $sale_type, $make_type, $num);
}
}
// $cfn = new CreateFacilityNo;
// // 建立作番號 - 新梯
// print_r($cfn->makeMFacilityNo("M", ["X", "W"], 2));
// echo "<br/><br/>";
// // 建立作番號 - 汰改
// print_r($cfn->makeTFacilityNo("M", ["X", "W"], 2));
// echo "<br/><br/>";
// // 建立作番號 - 保養
// print_r($cfn->makeBFacilityNo("M", ["X", "W"], 2));
// echo "<br/><br/>";

16
wms/contract-repair/api/getPriceview.php

@ -0,0 +1,16 @@
<?php
require_once('../conn.php');
try{
$id = $_GET['id'];
$sql_str = "SELECT * FROM pricereview_main WHERE id = :id";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id',$id);
$stmt->execute();
$prices = $stmt->fetch(PDO::FETCH_ASSOC);
header("Content-Type: application/json");
echo json_encode(['prices'=> $prices]);
}catch (PDOException $e ){
die("ERROR!!!: ". $e->getMessage());
}

423
wms/contract-repair/api/postContractData.php

@ -0,0 +1,423 @@
<?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 (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'b') {
try {
$created_at = date('Y-m-d H:i:s');
$contractno = !empty($_POST['contractno']) ? $_POST['contractno'] : null;
$total_price = !empty($_POST['total_price']) ? $_POST['total_price'] : null;
$vat = !empty($_POST['vat']) ? $_POST['vat'] : null;
$mtype = !empty($_POST['mtype']) ? $_POST['mtype'] : null;
$opendoor = !empty($_POST['opendoor']) ? $_POST['opendoor'] : null;
$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;
$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;
$address = !empty($_POST['address']) ? $_POST['address'] : null;
$area = !empty($_POST['area']) ? $_POST['area'] : null;
$customer = !empty($_POST['customer']) ? $_POST['customer'] : null;
$partyA = !empty($_POST['partyA']) ? $_POST['partyA'] : null;
$partyAaddress = !empty($_POST['partyAaddress']) ? $_POST['partyAaddress'] : null;
$partyAphone = !empty($_POST['partyAphone']) ? $_POST['partyAphone'] : null;
$partyAemail = !empty($_POST['partyAemail']) ? $_POST['partyAemail'] : null;
$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
$user_name = !empty($_POST['user_name']) ? $_POST['user_name'] : null;
$num = !empty($_POST['num']) ? $_POST['num'] : null;
$files = !empty($_FILES['files']) ? $_FILES['files'] : null;
$elevators = !empty($_POST['elevators']) ? json_decode($_POST['elevators'], true) : [];
// validate
$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 ($mworker == '') $fail_arr[] = '保養員為必填';
if ($mcycle == '') $fail_arr[] = '保養頻率為必填';
if ($salesman == '') $fail_arr[] = '營業員為必填';
if ($contract_begin_date == '') $fail_arr[] = '合約開始時間為必填';
if ($contract_end_date == '') $fail_arr[] = '合約結束時間為必填';
if ($address == '') $fail_arr[] = '地址為必填';
if ($area == '') $fail_arr[] = '區域為必填';
if ($customer == '') $fail_arr[] = '客戶為必填';
if ($partyA == '') $fail_arr[] = '業務聯繫人為必填';
if ($partyAaddress == '') $fail_arr[] = '業務聯繫人地址為必填';
if ($partyAphone == '') $fail_arr[] = '業務聯繫人電話為必填';
if ($partyAemail == '') $fail_arr[] = '業務聯繫人Email為必填';
if ($num == '') $fail_arr[] = '電梯數量為必填';
if (count($fail_arr) > 0) {
header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr);
exit();
}
//create account table
$accounttype = "A";
$accountid = $vat;
$pwd = "123";
$name = $partyA;
$tel = $phone ?? '';
$repairerid = $mworker;
$creater = $user_id;
$create_at = date('Y-m-d H:i:s');
$conn->beginTransaction();
$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);
$stmt->bindParam(':accounttype', $accounttype);
$stmt->bindParam(':accountid', $accountid);
$stmt->bindParam(':pwd', $pwd);
$stmt->bindParam(':name', $name);
$stmt->bindParam(':tel', $tel);
$stmt->bindParam(':address', $address);
$stmt->bindParam(':email', $email);
$stmt->bindParam(':repairerid', $repairerid);
$stmt->bindParam(':creater', $creater);
$stmt->bindParam(':create_at', $create_at);
$stmt->execute();
//create contract table
$contracttype = $mtype;
$company = $partyA;
$taxid = $vat;
$tel = $phone;
$promiser = $partyA;
$contractperson = $partyA;
$contractaddress = $address;
$contracttel = $phone;
$contractemail = $email;
$contract_employee = $salesman;
$start_date = $contract_begin_date;
$end_date = $contract_end_date;
$sql_str = "INSERT INTO contract (contracttype, contractno, company, taxid, address, tel, promiser, contractperson, contractaddress, contracttel, contractemail, contract_employee, start_date, end_date, creater, create_at) VALUES (:contracttype, :contractno, :company, :taxid, :address, :tel, :promiser, :contractperson, :contractaddress, :contracttel, :contractemail, :contract_employee, :start_date, :end_date, :creater, :create_at)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contracttype', $contracttype);
$stmt->bindParam(':contractno', $contractno);
$stmt->bindParam(':company', $company);
$stmt->bindParam(':taxid', $taxid);
$stmt->bindParam(':address', $address);
$stmt->bindParam(':tel', $tel);
$stmt->bindParam(':promiser', $promiser);
$stmt->bindParam(':contractperson', $contractperson);
$stmt->bindParam(':contractaddress', $contractaddress);
$stmt->bindParam(':contracttel', $contracttel);
$stmt->bindParam(':contractemail', $contractemail);
$stmt->bindParam(':contract_employee', $contract_employee);
$stmt->bindParam(':start_date', $start_date);
$stmt->bindParam(':end_date', $end_date);
$stmt->bindParam(':creater', $creater);
$stmt->bindParam(':create_at', $create_at);
$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);
echo json_encode($facilityno);
echo '-------';
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accountid', $mworker);
$stmt->execute();
$worker = $stmt->fetch(PDO::FETCH_ASSOC);
$customerid = $vat;
$define = "B";
$repairtype = $mtype;
$repairerid = $mworker;
$repairername = $worker['name'];
foreach ($elevators as $idx => $elevator) {
$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);
$stmt->bindParam(':contractno', $contractno);
$stmt->bindParam(':define', $define);
$stmt->bindParam(':facilityno', $facilityno[$idx]);
$stmt->bindParam(':latitude', $elevator['latitude']);
$stmt->bindParam(':longitude', $elevator['longitude']);
$stmt->bindParam(':customerid', $customerid);
$stmt->bindParam(':weight', $elevator['weight']);
$stmt->bindParam(':numberofpassenger', $elevator['persons']);
$stmt->bindParam(':numberofstop', $elevator['stop']);
$stmt->bindParam(':numberoffloor', $elevator['floors']);
$stmt->bindParam(':opentype', $elevator['opendoor']);
$stmt->bindParam(':speed', $elevator['speed']);
$stmt->bindParam(':repairtype', $repairtype);
$stmt->bindParam(':maintainance', $elevator['maintainance']);
$stmt->bindParam(':facility_kind', $elevator['spec']);
$stmt->bindParam(':address', $address);
$stmt->bindParam(':repairerid', $repairerid);
$stmt->bindParam(':repairername', $repairername);
$stmt->bindParam(':creater', $creater);
$stmt->bindParam(':create_at', $create_at);
$stmt->bindParam(':area', $area);
$stmt->bindParam(':takecertificatedate', $elevator['takecertificatedate']);
$stmt->bindParam(':licensedate', $elevator['useful_date']);
$result = $stmt->execute();
}
//create schedule table
$comboNo = new CreateComboNo($mcycle, $contract_begin_date, $contract_end_date);
$comboArr = json_decode($comboNo->getComboNo(), true);
foreach ($facilityno as $no) {
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);
$stmt->bindParam(':contractno', $contractno);
$stmt->bindParam(':facilityno', $no);
$stmt->bindParam(':combono', $combo[0]);
$stmt->bindParam(':repairerid', $repairerid);
$stmt->bindParam(':repairername', $repairername);
$stmt->bindParam(':duedate', $combo[1]);
$stmt->bindParam(':creater', $creater);
$stmt->bindParam(':create_at', $create_at);
$result = $stmt->execute();
}
}
// create contract_b_signed_back table
$contract_type = $mtype;
$company = $customer;
$customer_no = $vat;
$salesperson = $salesman;
$customer_phone = $phone;
$customer_email = $email;
$repairman = $mworker;
$cycle = $mcycle;
$contact_person = $partyA;
$contact_address = $partyAaddress;
$contact_phone = $partyAphone;
$contract_email = $partyAemail;
$elevators_number = $num;
$bonus = 1000;
$max_bonus = 2000;
if (!empty($files)) {
$englisharr = range('a', 'z');
$file = $_FILES['files'];
$file_name = $file['name'];
$file_type = $file['type'];
$tmp_name = $file['tmp_name'];
$file_size = $file['size'];
$error = $file['error'];
$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 = 'b' . $datetime; // 保養=>b + 日期時間
foreach ($newfiles as $key => $file) {
$randNum = rand(1000, 9999);
$randEnglish = $englisharr[rand(0, 25)];
$file_name = 'b' . (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', $user_id);
$stmt->execute();
}
$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_b_signed_back (contract_no, contract_type, company, customer_no, salesperson, contract_start_date, contract_end_date, total_price, 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, :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)";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(":contract_no", $contractno);
$stmt->bindParam(":contract_type", $contract_type);
$stmt->bindParam(":company", $company);
$stmt->bindParam(":customer_no", $customer_no);
$stmt->bindParam(":salesperson", $salesperson);
$stmt->bindParam(":contract_start_date", $contract_begin_date);
$stmt->bindParam(":contract_end_date", $contract_end_date);
$stmt->bindParam(":total_price", $total_price);
$stmt->bindParam(":customer_phone", $customer_phone);
$stmt->bindParam(":customer_email", $customer_email);
$stmt->bindParam(":repairman", $repairman);
$stmt->bindParam(":cycle", $cycle);
$stmt->bindParam(":contact_person", $contact_person);
$stmt->bindParam(":contact_address", $contact_address);
$stmt->bindParam(":contact_phone", $contact_phone);
$stmt->bindParam(":contact_email", $contact_email);
$stmt->bindParam(":elevators_number", $elevators_number);
$stmt->bindParam(":area", $area);
$stmt->bindParam(":address", $address);
$stmt->bindParam(":files_id", $files_id);
$stmt->bindParam(":bonus", $bonus);
$stmt->bindParam(":max_bonus", $max_bonus);
$stmt->bindParam(":created_at", $created_at);
$stmt->bindParam(":created_by", $user_id);
$stmt->execute();
header('Content-Type: application/json');
// $jsonData = json_encode($files);
$conn->commit();
} catch (PDOException $e) {
$conn->rollback();
echo $e->getMessage();
die('Error!:' . $e->getMessage());
}
}
//////////////////////////////
//// 合約簽回(修理)
////
//// 製作人:梓誠
/// 時間 :
//////////////////////////////
if (isset($_POST['contractno']) && $_POST['contractno'] != "" && isset($_POST['contracttype']) && $_POST['contracttype'] == 'r') {
// echo $_POST;
// exit;
try {
$created_at = date('Y-m-d H:i:s');
$contractno = !empty($_POST['contractno']) ? $_POST['contractno'] : null;
$company = !empty($_POST['company']) ? $_POST['company'] : null;
$repairid = !empty($_POST['repairid']) ? $_POST['repairid'] : null;
$facilityno = !empty($_POST['facilityno']) ? $_POST['facilityno'] : null;
$taxid = !empty($_POST['taxid']) ? $_POST['taxid'] : null;
$invoice = !empty($_POST['invoice']) ? $_POST['invoice'] : null;
$address = !empty($_POST['address']) ? $_POST['address'] : null;
$repair_no = !empty($_POST['repair_no']) ? $_POST['repair_no'] : null;
$total_price = !empty($_POST['total_price']) ? $_POST['total_price'] : null;
$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
$type = !empty($_POST['type']) ? $_POST['type'] : null;
$sign_date = !empty($_POST['sign_date']) ? $_POST['sign_date'] : null;
$contract_status = !empty($_POST['contract_status']) ? $_POST['contract_status'] : 1;
$fail_arr = [];
if (empty($contractno)) $fail_arr[] = '合約號為必填';
if (empty($repair_no)) $fail_arr[] = '報價單編號為必填';
if (empty($company)) $fail_arr[] = '客戶名稱為必填';
if (empty($repairid)) $fail_arr[] = '為保人員為必填';
// iempty(f($taxid === '') return $fail_arr[] = '統一編號為必填';
if (empty($facilityno)) $fail_arr[] = '電梯編號為必填';
if (empty($address)) $fail_arr[] = '工程地址為必填';
if (empty($type)) $fail_arr[] = '工程類別為必填';
if (empty($invoice)) $fail_arr[] = '發票抬頭為必填';
if (empty($taxid)) $fail_arr[] = '統一編號為必填';
// echo json_encode($fail_arr);
// exit;
if (count($fail_arr) > 0) {
header("HTTP/1.1 422 Unprocessable Entity");
echo json_encode($fail_arr);
exit();
}
// exit();
//create contrac_r_signed_back table
$conn->beginTransaction();
$sql = "INSERT INTO contract_r_signed_back(
repair_no,
contractno,
company,
taxid,
facilityno,
address,
type,
invoice,
repaireid,
total_price,
sign_date,
contract_status,
create_user,
create_date) VALUES(
:repair_no,
:contractno,
:company,
:taxid,
:facilityno,
:address,
:type,
:invoice,
:repaireid,
:total_price,
:sign_date,
:contract_status,
:create_userid,
:create_date
)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(":repair_no", $repair_no);
$stmt->bindParam(":contractno", $contractno);
$stmt->bindParam(":company", $company);
$stmt->bindParam(":taxid", $taxid);
$stmt->bindParam(":facilityno", $facilityno);
$stmt->bindParam(":address", $address);
$stmt->bindParam(":type", $type);
$stmt->bindParam(":invoice", $invoice);
$stmt->bindParam(":repaireid", $repairid);
$stmt->bindParam(":total_price", $total_price);
$stmt->bindParam(":sign_date", $sign_date);
$stmt->bindParam(":contract_status", $contract_status);
$stmt->bindParam(":create_userid", $user_id);
$stmt->bindParam("create_date", $created_at);
$stmt->execute();
header('Content-Type: application/json');
// $jsonData = json_encode($files);
$conn->commit();
} catch (PDOException $e) {
$conn->rollback();
header("HTTP/1.1 422 Unprocessable Entity");
echo $e->getMessage();
die('Error!' . $e->getMessage());
}
}

68
wms/contract-repair/api/postContractNewApplyData.php

@ -0,0 +1,68 @@
<?php
require_once("../conn.php");
ini_set ( 'date.timezone' , 'Asia/Taipei' );
if(isset($_POST['vol_no']) && !empty($_POST['vol_no'])){
$mid = $_POST['mid'];
$vol_no = $_POST['vol_no'];
$salesman = $_POST['salesman'];
$apply_date = $_POST['apply_date'];
$apply_type = $_POST['apply_type'];
$case_name = $_POST['case_name'];
$customer = $_POST['company'];
$manager = $_POST['manager'];
$vat = $_POST['vat'];
$total_price = $_POST['total_price'];
$buy_fee = $_POST['price_a'];
$install_fee = $_POST['price_b'];
$contact_address = $_POST['address'];
$workdeadline_a = $_POST['workdeadline_a'];
$workdeadline_b = $_POST['workdeadline_b'];
$test_time = $_POST['regulations'];
$freedeadline = $_POST['freedeadline'];
$trade_address = $_POST['tradeaddress'];
$tradedeadline = $_POST['tradedeadline'];
$progress = 0;
$status = 0;
$created_at = date('Y-m-d H:i:s');
$created_by = $_POST['user_id'];
$isFirst = $_POST['isFirst'];
$conn->beginTransaction();
try{
if($isFirst == 1){
$sql_str = "INSERT INTO contract_new_apply (mid, contractno, sales_man, apply_date, apply_type, case_name, customer, manager, vat, total_price, buy_fee, install_fee, contact_address, workdeadline_a, workdeadline_b, test_time, freedeadline, trade_address, tradedeadline, progress, status, created_at, created_by) VALUES (:mid, :contractno, :sales_man, :apply_date, :apply_type, :case_name, :customer, :manager, :vat, :total_price, :buy_fee, :install_fee, :contact_address, :workdeadline_a, :workdeadline_b, :test_time, :freedeadline, :trade_address, :tradedeadline, :progress, :status, :created_at, :created_by)";
$stmt = $conn -> prepare($sql_str);
$stmt ->bindParam(':mid', $mid);
$stmt ->bindParam(':contractno', $vol_no);
$stmt ->bindParam(':sales_man', $salesman);
$stmt ->bindParam(':apply_date', $apply_date);
$stmt ->bindParam(':apply_type', $apply_type);
$stmt ->bindParam(':case_name', $case_name);
$stmt ->bindParam(':customer', $customer);
$stmt ->bindParam(':manager', $manager);
$stmt ->bindParam(':vat', $vat);
$stmt ->bindParam(':total_price', $total_price);
$stmt ->bindParam(':buy_fee', $buy_fee);
$stmt ->bindParam(':install_fee', $install_fee);
$stmt ->bindParam(':contact_address', $contact_address);
$stmt ->bindParam(':workdeadline_a', $workdeadline_a);
$stmt ->bindParam(':workdeadline_b', $workdeadline_b);
$stmt ->bindParam(':test_time', $test_time);
$stmt ->bindParam(':freedeadline', $freedeadline);
$stmt ->bindParam(':trade_address', $trade_address);
$stmt ->bindParam(':tradedeadline', $tradedeadline);
$stmt ->bindParam(':progress', $progress);
$stmt ->bindParam(':status', $status);
$stmt ->bindParam(':created_at', $created_at);
$stmt ->bindParam(':created_by', $created_by);
$stmt ->execute();
header("HTTP/1.1 201 success!");
$conn->commit();
}
}catch(PDOException $e){
$conn->rollback();
echo $e->getMessage();
die('Error!:'.$e->getMessage());
}
}

139
wms/contract-repair/api/postNewContractData.php

@ -0,0 +1,139 @@
<?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());
}
}

190
wms/contract-repair/api/putContractData.php

@ -0,0 +1,190 @@
<?php
require_once("../conn.php");
include_once("./upload_chk.php");
ini_set('date.timezone', 'Asia/Taipei');
// echo json_encode(explode(',', $_POST['deletefiles']));
if (isset($_POST['contracttype']) && $_POST['contracttype'] == 'r' && isset($_POST["id"]) && $_POST['id'] != "") {
try {
$create_date = date('Y-m-d H:i:s');
$repair_no = !empty($POST['repair_no']) ? $_POST['repair_no'] : null;
$contractno = !empty($_POST['contractno']) ? $_POST['contractno'] : null;
$company = !empty($_POST['company']) ? $_POST['company'] : null;
$taxid = !empty($_POST['taxid']) ? $_POST['taxid'] : null;
$facilityno = !empty($_POST['facilityno']) ? $_POST['facilityno'] : null;
$address = !empty($_POST['address']) ? $_POST['address'] : null;
$type = !empty($_POST['type']) ? $_POST['type'] : null;
$invoice = !empty($_POST['invoice']) ? $_POST['invoice'] : null;
$repaireid = !empty($_POST['repaireid']) ? $_POST['repaireid'] : null;
$contract_status = !empty($_POST['contract_status']) ? $_POST['contract_status'] : null;
// $total_price = !empty($_POST['total_price']) ? $_POST['total_price'] : null;
$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
$fail_arr = [];
// if (empty($repair_no)) $fail_arr[] = '號為必填';
if (empty($contractno)) $fail_arr[] = '合約號為必填';
if (empty($company)) $fail_arr[] = '客戶名稱為必填';
if (empty($taxid)) $fail_arr[] = '統一編號為必填';
if (empty($facilityno)) $fail_arr[] = '電梯號為必填';
if (empty($address)) $fail_arr[] = '工程地址為必填';
if (empty($type)) $fail_arr[] = '工程類行為必填';
if (empty($invoice)) $fail_arr[] = '發票抬頭為必填';
if (empty($repaireid)) $fail_arr[] = '維修人員為必填';
if (empty($contract_status)) $fail_arr[] = '工程類別為必填';
if (count($fail_arr) > 0) {
header("HTTP/1.1 442 Unprocessable Entity");
echo json_encode($fail_arr);
exit();
}
// $conn->beginTransaction();
$sql = "UPDATE contract_r_signed_back SET
repaireid = :repaireid,facilityno= :facilityno, invoice=:invoice, taxid=:taxid, address=:address,type=:type,contract_status=:contract_status,update_user=:update_user,update_date=:update_date
WHERE id = :id";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':repaireid', $repaireid);
$stmt->bindParam(':facilityno', $facilityno);
$stmt->bindParam(':invoice', $invoice);
$stmt->bindParam(':taxid', $taxid);
$stmt->bindParam(':address', $address);
$stmt->bindParam(':type', $type);
$stmt->bindParam(':contract_status', $contract_status);
$stmt->bindParam(':update_user', $user_id);
$stmt->bindParam(':update_date', $create_date);
$stmt->bindParam(':id', $_POST['id']);
// echo json_encode($sql);
// exit;
$stmt->execute();
// header("HTTP/1.1 204 NO Content");
// $conn->commit();
} catch (PDOException $e) {
// $conn->rollback();
header("HTTPP/1.1 500 Internal Server Error");
die('Error!:' . $e->getMessage());
}
}
// if (isset($_POST['contractno']) && $_POST['contractno'] != "" && isset($_POST["id"]) && $_POST['id'] != "") {
// try {
// $created_at = date('Y-m-d H:i:s');
// $created_by = $_POST['user_id'];
// $id = $_POST["id"];
// $contract_no = !empty($_POST['contractno']) ? $_POST['contractno'] : null;
// $customer = !empty($_POST['customer']) ? $_POST['customer'] : null;
// $manager = !empty($_POST['manager']) ? $_POST['manager'] : null;
// $vat = !empty($_POST['vat']) ? $_POST['vat'] : null;
// $case_name = !empty($_POST['case_name']) ? $_POST['case_name'] : null;
// $linkman = !empty($_POST['linkman']) ? $_POST['linkman'] : null;
// $lm_tel = !empty($_POST['lm_tel']) ? $_POST['lm_tel'] : null;
// $address = !empty($_POST['address']) ? $_POST['address'] : null;
// $salesman = !empty($_POST['salesman']) ? $_POST['salesman'] : null;
// $qc = !empty($_POST['qc']) ? $_POST['qc'] : null;
// $deletefiles = !empty($_POST['deletefiles']) ? $_POST['deletefiles'] : null;
// $files_id = !empty($_POST['files_id']) ? $_POST['files_id'] : null;
// $files = !empty($_FILES['files']) ? $_FILES['files'] : null;
// $deletefilesArr = explode(',', $_POST['deletefiles']);
// $fail_arr = [];
// if (empty($contract_no)) $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 = "UPDATE contract_m_signed_back SET contract_no=:contract_no, customer=:customer, manager=:manager, vat=:vat, case_name=:case_name, linkman=:linkman, lm_tel=:lm_tel, address=:address, salesman=:salesman, qc_official_type=:qc WHERE id = :id";
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':contract_no', $contract_no);
// $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(':qc', $qc);
// $stmt->bindParam(':id', $id);
// $stmt->execute();
// if (!empty($deletefiles)) {
// $sql_str = "DELETE FROM contract_back_files WHERE id IN ($deletefiles)";
// $stmt = $conn->prepare($sql_str);
// $stmt->execute();
// }
// 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 = ($files_id !== null) ? $files_id : 'm' . $datetime; // 新梯=>m + 日期時間
// 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;
// }
// $conn->commit();
// } catch (PDOException $e) {
// $conn->rollback();
// header("HTTP/1.1 500 Internal Server Error");
// die('Error!:' . $e->getMessage());
// }
// }

0
wms/contract-repair/api/store_contract.php

61
wms/contract-repair/api/upload_chk.php

@ -0,0 +1,61 @@
<?php
function upload_chk( $file, $path, $max_size, $allow_ext, $file_name ){
$source_file_name = $file['name']; //上傳檔案的原來檔案名稱
$file_type = $file['type']; //上傳檔案的類型(副檔名)
$tmp_name = $file['tmp_name']; //上傳到暫存空間的路徑/檔名
$file_size = $file['size']; //上傳檔案的檔案大小(容量)
$error = $file['error']; //上傳工作傳回的錯誤訊息編號
$msg = ''; //負責記錄回傳的訊息
//1.判斷錯誤編號只有為0時表示沒有錯誤發生,才表示上傳成功 =================
if( $error == 0 ){
//取得檔案延伸的副檔名, 以下函數可以取得檔案延伸的副檔名
//pathinfo(上傳檔案的原來檔案名稱, PATHINFO_EXTENSION)
$ext = pathinfo($source_file_name, PATHINFO_EXTENSION);
$ext = strtolower($ext); //將延伸的副檔名轉小寫
//2.判斷上傳檔案的大小 ====================================
if( $file_size > $max_size ){
//當目前檔案容量超過容量限制時, 以下準備顯示的資訊
if( $max_size >= 4096*4096 ){
$max_size /= (4096*4096);
$max_size .= 'M';
}elseif( $max_size >= 4096 ){
$max_size /= 4096;
$max_size .= 'K';
}
$msg ='上傳檔案過大,請選擇容量小於 '.$max_size.' 的檔案';
//3.判斷檔案類型 ===========================================
//in_array($ext, $allow_ext) 判斷 $ext變數的值 是否在 $allow_ext 這個陣列變數中
}elseif( !in_array( $ext, $allow_ext ) ){
$allow_str = ''; //準備將允許檔案類型的陣列內容, 組合成字串
foreach( $allow_ext as $key=>$value ){
//if的縮寫語法:條件?成立執行的工作:不成立執行的工作;
$key==0? $allow_str.= $value : $allow_str.=', '.$value;
}
$msg = '檔案類型不符合,請選擇 '.$allow_str.' 檔案';
//4.以上條件都沒問題的話, 則進行最後else中的工作===============
}else{
//搬移檔案 move_uploaded_file(要搬移的檔案, 目的地位置及目的檔案名稱), 成功傳回true(1)
$msg = @move_uploaded_file($tmp_name, $path.$file_name);
}
}else{
//這裡表示上傳有錯誤, 匹配錯誤編號顯示對應的訊息 ======================================
switch ($error) {
case 1: $msg = '上傳檔案超過 upload_max_filesize 容量最大值'; break;
case 2: $msg = '上傳檔案超過 post_max_size 總容量最大值'; break;
case 3: $msg = '檔案只有部份被上傳'; break;
case 4: $msg = '沒有檔案被上傳'; break;
case 6: $msg = '找不到主機端暫存檔案的目錄位置'; break;
case 7: $msg = '檔案寫入失敗'; break;
case 8: $msg = '上傳檔案被PHP程式中斷,表示主機端系統錯誤'; break;
}
} //if( $error == 0 ){ ..... end
return $msg; //回傳$msg的結果
}

43
wms/contract-repair/conn.php

@ -0,0 +1,43 @@
<?php
$envFile = __DIR__ . '/.env'; // .env 文件的路径
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines !== false) {
foreach ($lines as $line) {
list($key, $value) = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
// 设置环境变量
putenv("$key=$value");
}
}
}
$db_hostname = getenv('DB_HOST'); //資料庫主機名稱
$db_username = getenv('DB_USERNAME'); //登入資料庫的管理者的帳號
$db_password = getenv('DB_PASSWORD'); //登入密碼
$db_name = getenv('DB_DATABASE'); //使用的資料庫
$db_charset = 'utf8'; //設定字元編碼
//建立PDO的指定工作
$dsn = "mysql:host=$db_hostname;dbname=$db_name;charset=$db_charset";
try{
//使用PDO連接到MySQL資料庫,建立PDO物件
$conn = new PDO($dsn, $db_username, $db_password);
//當錯誤發生時會將錯誤資訊放到一個類物件裡(PDOException)
//PDO異常處理,PDO::ATTR_ERRMODE,有以下三種值的設定
//PDO::ERRMODE_SILENT: 預設模式,不主動報錯,需要以$conn->errorInfo()的形式獲取錯誤資訊
//PDO::ERRMODE_WARNING: 引發 E_WARNING 錯誤,主動報錯
//PDO::ERRMODE_EXCEPTION: 主動抛出 exceptions 異常,需要以try{}cath(){}輸出錯誤資訊。
//設定主動以警告的形式報錯
$conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
//如果連接錯誤,將抛出一個PDOException異常對象
}
catch ( PDOException $e ){
//如果連結資料庫失敗則顯示錯誤訊並停止本頁的工作
die("ERROR!!!: ". $e->getMessage());
}
//$conn = null; //關閉資料庫的連線

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

@ -0,0 +1,567 @@
<?php
include "../header.php";
require_once('./conn.php');
//買賣1、2、3,安裝5、6 (4跟7很少有)
if (!empty($_GET['apply_key'])) {
try {
$apply_key = $_GET['apply_key'];
// $sql_str = "SELECT pricereview_main.*, pricereview_pay.*, pricereview_item.note, pricereview_item.item_qty, account.name as accountname, account.id as accountid
// FROM pricereview_main
// JOIN pricereview_pay ON pricereview_main.id = pricereview_pay.mid
// JOIN pricereview_item ON pricereview_main.id = pricereview_item.mid
// JOIN account ON pricereview_main.person = account.accountid
// WHERE pricereview_main.id = :id AND pricereview_item.item_group = 'A' ORDER BY pay_kind ASC";
// 價審資料
$sql = "SELECT * FROM con_maintance_examine_apply AS a LEFT JOIN hope_contract_customer AS b ON a.vol_no = b.vol_no WHERE a.apply_key = :apply_key";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':apply_key', $apply_key);
$stmt->execute();
$contract_maintance = $stmt->fetchALL(PDO::FETCH_ASSOC);
echo '<pre>';
print_r($contract_maintance);
echo '</pre>';
// echo $contract_maintance;
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':id',$id);
// $stmt->execute();
// $contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
// $sql_str = "SELECT contract_new_apply.*,
// contract_new_apply_pays.pay_kind, contract_new_apply_pays.pay_scale, contract_new_apply_pays.pay_amount, contract_new_apply_pays.pay_period, contract_new_apply_pays.condition_date
// FROM contract_new_apply
// JOIN contract_new_apply_pays ON contract_new_apply.id = contract_new_apply_pays.contract_apply_id
// WHERE contract_new_apply.mid = :id";
// $stmt = $conn->prepare($sql_str);
// $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 != 'M0174' || $user_id != 'M0225') {
// echo '<script type="text/javascript">
// alert("非法訪問。");
// window.history.back();
// </script>';
// exit;
// }
// 抓有望客戶的資料
$sql_str = "SELECT * FROM hope_contract_customer WHERE vol_no = :vol_no";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contract_maintance['vol_no']);
$stmt->execute();
$customer = $stmt->fetchAll(PDO::FETCH_ASSOC);
// if (count($customer) <= 0) {
// echo "<script>
// alert('資料不齊或合約書已生成過。');
// window.history.back();
// </script>";
// exit;
// }
$buyArr = [];
$buyNo2Pay = false;
$buy_total_price = 0;
$installArr = [];
$install_total_price = 0;
// $noteArr = explode(",", $contracts[0]['note']);
$noteArr = array(1, 1, 1, 1, 1);
$qty = $contract_maintance[0]['num'];
// echo $qty;
// foreach ($contract_maintance as $idx => $amount) {
// $isset = false;
// if ($amount['payment_kind'] == 5 || $amount['payment_kind'] == 6) {
// if ($amount['pay_scale'] >= 0) {
// $install_total_price = $install_total_price + $amount['pay_amount'];
// $installArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
// }
// }
// if ($amount['pay_kind'] == 1 || $amount['pay_kind'] == 2 || $amount['pay_kind'] == 3) {
// if ($amount['pay_scale'] > 0) {
// $buy_total_price = $buy_total_price + $amount['pay_amount'];
// foreach ($buyArr as $buy) {
// if ($buy['installment'] == $amount['pay_kind']) {
// $isset = true;
// }
// }
// if (!$isset) { {
// $buyArr[] = ['installment' => $amount['pay_kind'], 'scale' => $amount['pay_scale'], 'amount' => $amount['pay_amount'], 'pay_period' => $amount['pay_period']];
// }
// if ($amount['pay_kind'] == 2) {
// $buyNo2Pay = true;
// }
// }
// }
// }
// }
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$sql_str = "SELECT contract_apply_files.*, contract_new_apply.id as apply_id FROM contract_apply_files LEFT JOIN contract_new_apply ON contract_apply_files.contract_id = contract_new_apply.id WHERE contract_new_apply.mid = :mid AND contract_apply_files.deleted_at IS NULL";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
$files = $stmt->fetchAll(PDO::FETCH_ASSOC);
$files_count = count($files);
} catch (PDOException $e) {
die("ERROR!!!: " . $e->getMessage());
}
}
?>
<link rel="stylesheet" href="./styles/style.css">
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<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 src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<main x-data="contractDownload">
<div class="sidebar">
<ul>
<button :class="isbuyShow ? 'active' : ''" @click="isbuyShow = true">電梯買賣合約書</button>
<button :class="!isbuyShow ?'active' : ''" @click="isbuyShow = false">電梯安裝合約書</button>
<a href="..wms/cont/sign_list.php?function_name=pricereview&<?php echo $token_link; ?>">回列表</a>
</ul>
</div>
<div class="inputDiv" x-show="isbuyShow && isBuyInputIng">
<!-- <label for="">
<p>交貨期限(日)</p>
<input type="number" x-model="buyfill1" @keyup="sendBuyInputKeyupFn($event)" />
</label> -->
<?php if ($buyNo2Pay) { ?>
<!-- <label for="">
<p>第二期款交貨期限(日)</p>
<input type="number" x-model="buyfill2">
</label> -->
<?php } ?>
<!-- <label for="">
<p>附件數</p>
<select x-model="buyAffix">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</label> -->
<label for="">
<button @click="sendBuyInputFn()">生成買賣合約書</button>
</label>
</div>
<div class="contract-material-component" x-show="isbuyShow && !isBuyInputIng">
<div class="btn-list">
<label for="standardBuyBtn">
<p>制式合約</p>
<input type="checkbox" class="scorll" x-model="toggleBuyStandard">
<!-- <input type="radio" checked id="standardBuyBtn" name="standardBuyBtn" @change="toggleBuyStandard = true" /> -->
</label>
<!-- <label for="noStandardBuyBtn">
<input type="radio" id="noStandardBuyBtn" name="standardBuyBtn" @change="toggleBuyStandard = false" />
非制式合約
</label> -->
</div>
<button @click="isBuyInputIng = true" class="rebtn">重新輸入</button>
<button @click="exportFn(1)" class="prviewbtn">預覽</button>
<div class="contract" id="noStandardBuyContract" x-show="!toggleBuyStandard">
<table class="my-2 contract" x-ref="contract1" id="contract1">
<tr>
<td class="center">
<h2 style="text-align:center">電梯買賣合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
立契約人 甲方:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</td>
<td>
<div style="margin-left: 100px">
乙方:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</div>
</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
<tr :class="buyonstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate', false)" x-on:mouseout="mouseout('illustrate')">
<td>
<span x-html='buydata.illustrate.plaintext'></span>
<div class="buttons" x-show="buyonstandardViewData.illustrate.editshow" x-cloak>
<button class="edit" @click="modelshowEditFn('更新合約書內容', 'illustrate', false, false)"><i class="glyphicon glyphicon-pencil"></i></button>
<button class="delete"><i class="glyphicon glyphicon-trash"></i></button>
</div>
</td>
</tr>
<template x-for="(item, idx) in buyonstandardViewData.list.plaintext" :key="item.id">
<tr :class="buyonstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx, false)" @mouseout="mouseoutlist(idx)">
<td class="list">
<div class="buttons" x-show="buyonstandardViewData.list.plaintext[idx].editshow" x-cloak>
<button class="edit" @click="modelshowEditFn('update contract list', idx, true, false)"><i class="glyphicon glyphicon-pencil"></i></button>
<button class="add" @click="modelshowAddUpFn(idx, false)"><i class="glyphicon glyphicon-arrow-up"></i></button>
<button class="add" @click="modelshowAddDownFn(idx, false)"><i class="glyphicon glyphicon-arrow-down"></i></button>
<button class="delete" @click="deleteEditor(idx, false)"><i class="glyphicon glyphicon-trash"></i></button>
</div>
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="buyonstandardViewData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
<div class="contract" id="standardBuyContract" x-show="toggleBuyStandard">
<table class="my-2 contract" id="contract0">
<tr>
<td class="center">
<h2 style="text-align:center">電梯買賣合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p x-html="data.partyA.plaintext"> </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
<tr :class="buystandardData.illustrate.editshow ? 'mouseover' : '' ">
<td>
<span x-html='buystandardData.illustrate.plaintext'></span>
</td>
</tr>
<template x-for="(item, idx) in buystandardData.list.plaintext" :key="item.id">
<tr :class="buystandardData.list.plaintext[idx].editshow ? 'mouseover' : '' ">
<td class="list">
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="buystandardData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
</div>
<div class="contract-model" x-show="modelshow" x-cloak>
<div class="contract-back"></div>
<div class="contract-content">
<div class="model-header"><span x-text='modelText'></span><i @click='modelcloseFn()' class="glyphicon glyphicon-remove"></i></div>
<div class="content">
<textarea name="content" id="editor" x-ref="editor"></textarea>
<input type="submit" value="update" @click='updateEditor()' />
</div>
</div>
</div>
<div class="inputDiv" x-show="!isbuyShow && isInstallInputIng">
<!-- <label for="">
<p>安裝試車期限(日)</p>
<input type="number" x-model="installfill1" @keyup="sendInstallInputKeyupFn($event)" />
</label>
<label for="">
<p>免費保養月數(月)</p>
<input type="number" x-model="installfill2" @keyup="sendInstallInputKeyupFn($event)" />
</label> -->
<!-- <label for="">
<p>附件數</p>
<select x-model="installAffix" @keyup="sendInstallInputKeyupFn($event)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</label> -->
<label for="">
<button @click="sendInstallInputFn()">生成安裝合約書</button>
</label>
</div>
<div class="contract-install-component" x-show="!isbuyShow && !isInstallInputIng" x-cloak>
<div class="btn-list">
<label for="standardBtn">
<p>制式合約</p>
<input type="checkbox" class="scorll" x-model="toggleBuyStandard">
<!-- <input type="radio" checked id="standardBtn" name="standardBtn" @change="toggleInstallStandard = true" /> -->
</label>
<!-- <label for="noStandardBtn">
<input type="radio" id="noStandardBtn" name="standardBtn" @change="toggleInstallStandard = false" />
非制式合約
</label> -->
</div>
<button @click="isInstallInputIng = true" class="rebtn">重新輸入</button>
<button @click="exportFn(2)" class="prviewbtn">預覽</button>
<div class="contract" id="noStandardContract" x-show="!toggleInstallStandard">
<table class="my-2 contract" x-ref="contract1" id="contract1">
<tr>
<td class="center">
<h2 style="text-align:center">電梯安裝合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="onstandardViewData.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p x-html="onstandardViewData.partyA.plaintext">一二營造有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
<tr :class="onstandardViewData.illustrate.editshow ? 'mouseover' : '' " x-on:mouseover="mouseover('illustrate')" x-on:mouseout="mouseout('illustrate')">
<td>
<span x-html='onstandardViewData.illustrate.plaintext'></span>
<div class="buttons" x-show="onstandardViewData.illustrate.editshow" x-cloak>
<button class="edit" @click="modelshowEditFn('更新合約書內容', 'illustrate', false, true)"><i class="glyphicon glyphicon-pencil"></i></button>
<button class="delete"><i class="glyphicon glyphicon-trash"></i></button>
</div>
</td>
</tr>
<template x-for="(item, idx) in onstandardViewData.list.plaintext" :key="item.text">
<tr :class="onstandardViewData.list.plaintext[idx].editshow ? 'mouseover' : '' " @mouseover="mouseoverlist(idx)" @mouseout="mouseoutlist(idx)">
<td class="list">
<div class="buttons" x-show="onstandardViewData.list.plaintext[idx].editshow" x-cloak>
<button class="edit" @click="modelshowEditFn('update contract list', idx, true, true)"><i class="glyphicon glyphicon-pencil"></i></button>
<button class="add" @click="modelshowAddUpFn(idx)"><i class="glyphicon glyphicon-arrow-up"></i></button>
<button class="add" @click="modelshowAddDownFn(idx)"><i class="glyphicon glyphicon-arrow-down"></i></button>
<button class="delete" @click="deleteEditor(idx)"><i class="glyphicon glyphicon-trash"></i></button>
</div>
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="onstandardViewData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
<div class="contract" id="standardContract" x-show="toggleInstallStandard">
<table class="my-2 contract" id="contract0">
<tr>
<td class="center">
<h2 style="text-align:center">電梯安裝合約書</h2>
</td>
</tr>
<tr>
<td colspan="1">
合約書編號:<article x-html="data.partyAcontractno.plaintext"></article>
</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p x-html="data.partyA.plaintext">一二營造有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即買方,以下簡稱為甲方)</div>
</td>
</tr>
<tr>
<td>立合約書人</td>
</tr>
<tr>
<td>
<div style="margin-left: 100px">
<p>永佳捷科技股份有限公司 </p>
</div>
<div style="margin-left: auto;margin-right:200px">(即賣方,以下簡稱為乙方)</div>
</td>
</tr>
<tr :class="standardData.illustrate.editshow ? 'mouseover' : '' ">
<td>
<span x-html='standardData.illustrate.plaintext'></span>
</td>
</tr>
<template x-for="(item, idx) in standardData.list.plaintext">
<tr :class="standardData.list.plaintext[idx].editshow ? 'mouseover' : '' ">
<td class="list">
<span x-text="'第' + chineseNumbers(idx+1) + '條'"></span>
<article x-html="standardData.list.plaintext[idx].text"></article>
</td>
</tr>
</template>
</table>
</div>
<form action="prviewPdf.php?id=<?php echo $id; ?>&<?php echo $token_link; ?>" id="form" method="post" x-ref="form" style="display:none">
<input type="hidden" name="contract_apply_id" id="contract_apply_id" value="<?php echo $contract_apply_id; ?>" />
<input type="hidden" name="list" id="prview-list" />
<input type="hidden" name="prviewType" id="prview-type" />
<input type="hidden" name="standardList" id="standard-prview-list" />
<input type="hidden" name="illustrate" id="illustrate" />
<input type="hidden" name="standardIllustrate" id="standard-illustrate" />
<input type="hidden" name="partyA" id="partyA" />
<input type="hidden" name="partyAcontractno" id="partyAcontractno" />
<input type="hidden" name="buystandard" x-model="toggleBuyStandard" />
<input type="hidden" name="installstandard" x-model="toggleInstallStandard" />
<input type="hidden" name="total_price" x-model="total_price" id="total_price" />
<input type="hidden" name="person" id="person" value="<?php echo $contract['accountname']; ?>" />
<input type="hidden" name="personid" id="personid" value="<?php echo $contract['accountid']; ?>" />
<input type="hidden" name="delivery_term" id="delivery_term" x-model="buyfill1" />
<input type="hidden" name="install_period" id="install_period" x-model="installfill1" />
<input type="hidden" name="free_maintainance" id="free_maintainance" x-model="installfill2" />
</form>
</div>
</main>
<!-- <script src="../ckeditor4/ckeditor.js"></script> -->
<script>
const partyAcompany = <?php echo json_encode($contract_maintance['customer']); ?>;
const partyAcontractno = <?php echo json_encode($contract_maintance['apply_key']); ?>;
const partyAaddress = <?php echo json_encode($contcontract_maintanceract['address']); ?>;
const totalPrice = 0;
const totalInstallPrice = <?php echo $install_total_price; ?>;
const totalBuyPrice = <?php echo $buy_total_price; ?>;
// const secondPayDeadline = <?php echo $contract['secondPayDeadline']; ?>;
// const buyfill1 = <?php echo $contract['tradedeadline']; ?>;
// const installfill1 = "<?php echo $contract_maintance['test_time']; ?>";
// const installfill2 = "<?php echo $contract_maintance['freedeadline']; ?>";
// const buyArr = [...<?php echo json_encode($buyArr); ?>];
// const installArr = [...<?php echo json_encode($installArr); ?>];
let install_pay_text = '付款方式:<br> ';
let buy_pay_text = ''
const chineseArr = ['零', '一', '二', '三', '四', '五', '六', '七']
const bigChineseArr = ['零', '壹', '貳', '參', '肆', '伍', '陸', '柒', '捌', '玖', '拾'];
const num = <?php echo $qty; ?>;
const people = <?php echo $noteArr[1]; ?>;
const floor = <?php echo $noteArr[2]; ?>;
const speed = <?php echo $noteArr[3]; ?>;
const buyAffix = ' <?php echo $files_count; ?>';
// console.log(buyAffix);
// console.log(installArr);
buyArr.forEach((item, idx) => {
if (item.scale > 0) {
if (item.installment == 1) {
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽定時,甲方應付合約定金新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
} else if (item.installment == 2) {
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:合約簽訂後&nbsp;____&nbsp;天付第二期款新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
} else if (item.installment == 3) {
buy_pay_text = `${buy_pay_text}第${chineseArr[idx+1]}期款:產品貨到工地時應付新台幣&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(&nbsp;含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
}
}
});;
buy_pay_text += '以上期款若以票據支付時,發票人需為本合約甲方,票面金額同於各期應付款項,票期於各期付款日三十日內,票據須屬有效並得兌現。<br>乙方收款帳戶名稱:永佳捷科技股份有限公司;收款銀行:兆豐國際商業銀行(桃興分行);帳戶號碼:207-09-08688-2。'
buy_pay_text = buy_pay_text.replace(/\n/g, "").replace(/\s+/g, '').trim();
installArr.forEach((item, idx) => {
if (item.scale > 0) {
if (item.installment == 5) {
install_pay_text = `${install_pay_text}第${chineseArr[idx+1]}期款:甲方應於安裝及試車完成後給付安裝費用&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
} else if (item.installment == 6) {
install_pay_text = `${install_pay_text}第二期款:甲方應於交車後給付&nbsp;${numberToChinese(item.amount)}&nbsp;元整(&nbsp;${numberWithCommas(item.amount)}&nbsp;)(含5%加值型營業稅)(${item.pay_period}天期票)。<br>`
}
}
})
install_pay_text += '以上期款若以票據支付時,發票人需為本合約甲方,票面金額同於各期應付款項,票期於各期付款日三十日內,票據須屬有效並得兌現。<br> 乙方收款帳戶名稱:永佳捷科技股份有限公司;收款銀行:兆豐國際商業銀行(桃興分行);帳戶號碼:207-09-08688-2。'
install_pay_text = install_pay_text.replace(/\n/g, "").replace(/\s+/g, '').trim();
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function numberToChinese(n) {
if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) return "Invalid number.";
let unit = "仟佰拾億仟佰拾萬仟佰拾元角分";
let str = "";
n += "00";
let pos = n.indexOf('.');
if (pos >= 0) {
n = n.substring(0, pos) + n.substr(pos + 1, 2);
}
unit = unit.substr(unit.length - n.length);
for (let i = 0; i < n.length; i++) {
str += '零壹貳參肆伍陸柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i);
}
str = ('_' + str + '_');
return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(萬|億|元)/g, "$1").replace(/(億)萬|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "").replace("元", "").replace(/^\s+|\s+$/g, '');
}
function numberToSmallChinese(num) {
const chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const chineseUnits = ['', '十', '百', '千'];
const numStr = num.toString();
const numLength = numStr.length;
let chineseStr = '';
for (let i = 0; i < numLength; i++) {
const digit = parseInt(numStr.charAt(i));
const unitPos = numLength - i - 1;
if (digit !== 0) {
chineseStr += chineseNumbers[digit] + chineseUnits[unitPos];
} else {
// 处理连续的零,只添加一个零到结果中
if (i < numLength - 1 && parseInt(numStr.charAt(i + 1)) !== 0) {
chineseStr += chineseNumbers[digit];
}
}
}
return chineseStr;
}
</script>
<script src="./js/alpine.js"></script>
<script>
const axiosClient = axios.create({
baseURL: './',
});
axiosClient.interceptors.request.use((config) => {
config.headers.Authorization = 'Bearer <?php echo $token ?>'
return config;
}, (error) => {
return Promise.reject(error);
});
axiosClient.interceptors.response.use((response) => {
return response;
}, (error) => {
if (error.response.status === 401) {
console.error(error);
}
throw error;
});
</script>
<script>
</script>

214
wms/contract-repair/contract-repair-edit.php

@ -0,0 +1,214 @@
<?php
include("../header.php");
require_once("./conn.php");
$id = $_GET['contractid'];
$sql_str = "SELECT a.*,b.name FROM contract_r_signed_back AS a LEFT JOIN account AS b ON a.repaireid = b.accountid
WHERE a.id = :id ORDER BY id DESC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id', $id);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r($contract['contract_status'] + 1);
// echo '</pre>';
// $files_id = $contract['files_id'];
// $sql_str = "SELECT * FROM contract_back_files WHERE files_id = :files_id ";
// $stmt = $conn->prepare($sql_str);
// $stmt->bindParam(':files_id', $files_id);
// $stmt->execute();
// $files= $stmt->fetchAll(PDO::FETCH_ASSOC);
// $files = json_encode($files);
$accounttype = "M";
$sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(":accounttype", $accounttype);
$stmt->execute();
$persons = $stmt->fetchAll(PDO::FETCH_ASSOC);
$persons = array_map(function ($person) {
return [
'view' => $person['accountid'] . '-' . $person['name'],
'value' => $person['accountid'],
'name' => $person['name']
];
}, $persons);
$contract_stauts = ["合約簽回", "採購", "工程發包", "工程中", "修理完成"];
?>
<link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="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 defer src="./js/alpinejs/cdn.min.js"></script>
<script src="./js/axios/axios.min.js"></script>
<!-- <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.umd.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.css" />
<div class="contract-management" x-data='contract_edit'>
<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>
<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_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" x-model="data.company">
<p class="alerttext" x-show="data.company==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">維保人員</td>
<td style="vertical-align: middle">
<select class="repaireid" id="repaireid" x-model="data.repaireid">
<option value="<?php echo $contract['repaireid'] ?>"><?php echo $contract['repaireid'] . '-' . $contract['name'] ?></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.repaireid==''"><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.facilityno">
<p class="alerttext" x-show="data.facilityno==''"><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.repair_no">
<p class="alerttext" x-show="data.repair_no==''"><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.type">
<p class="alerttext" x-show="data.type==''"><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="sign_date" x-model="data.sign_date">
<p class="alerttext" x-show="data.sign_date==''"><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.invoice">
<p class="alerttext" x-show="data.invoice==''"><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="data.taxid">
<p class="alerttext" x-show="data.taxid==''"><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" 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)" />
<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 style="vertical-align: middle">
<select class="contract_status" id="contract_status" x-model="data.contract_status">
<?php foreach ($contract_stauts as $key => $status) : ?>
<option value="<?php echo $key + 1 ?>"><?php echo $status; ?></option>
<?php endforeach ?>
</select>
<p class="alerttext" x-show="data.contract_status==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td></td>
<td></td>
</tr>
<!-- <tr>
<td style="vertical-align: middle">附件</td>
<td colspan=7>
<div class="images">
<template x-for="file in data.files" :key="file.id">
<div class="image">
<a :href="'./images/contracts/' + file.file_name" data-fancybox="gallery" :data-src="'./images/contracts/' + file.file_name" data-caption="">
<img :src="'./images/contracts/' + file.file_name" />
</a>
<i class="fas fa-times" @click="deleteFileFn(file.id)"></i>
</div>
</template>
</div>
</td>
</tr> -->
</tbody>
</table>
<button @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 type="button" class="btn btn-primary btn-lg pull-right savebtn" @click="window.location.href='./contract-repair-management.php?<?php echo $token_link; ?>'">回列表</button>
</div>
</div>
</div>
<script src="./js/jquery/jquery-3.1.1.min.js"></script>
<script src="semantic/dist/semantic.min.js"></script>
<script src="./js/alpine.js"></script>
<script>
const user_id = '<?php echo $user_id; ?>';
const user_name = '<?php echo $user_name; ?>';
const id = <?php echo $contract['id'] ?>;
const repair_no = '<?php echo $contract['repair_no']; ?>';
const contractno = '<?php echo $contract['contractno']; ?>';
const company = '<?php echo $contract['company']; ?>';
const taxid = '<?php echo $contract['taxid']; ?>';
const facilityno = '<?php echo $contract['facilityno']; ?>';
const address = '<?php echo $contract['address']; ?>';
const type = '<?php echo $contract['type']; ?>';
const repaireid = '<?php echo $contract['repaireid']; ?>';
const total_price = '<?php echo $contract['total_price']; ?>';
const sign_date = '<?php echo $contract['sign_date']; ?>';
const invoice = '<?php echo $contract['invoice']; ?>'
const contract_status = '<?php echo $contract['contract_status']; ?>'
// $('#table_index').DataTable(
// {
// "order": [
// [0, "desc"],
// ]
// }
// );
// Fancybox.bind('[data-fancybox="gallery"]', {
// });
</script>

185
wms/contract-repair/contract-repair-input.php

@ -0,0 +1,185 @@
<?php
include("../header.php");
require_once("./conn.php");
include_once("./api/getFacilityNo.php");
$accounttype = "B";
$sql_str = "SELECT accountid, name FROM account WHERE accounttype = :accounttype";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accounttype', $accounttype);
$stmt->execute();
$workers = $stmt->fetchAll(PDO::FETCH_ASSOC);
$accounttype = "M";
$sql_str = "SELECT id,accountid, name FROM account WHERE accounttype = :accounttype";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accounttype', $accounttype);
$stmt->execute();
$contractpersons = $stmt->fetchAll(PDO::FETCH_ASSOC);
$persons = array_map(function ($person) {
return [
'view' => $person['accountid'] . '-' . $person['name'],
'value' => $person['accountid'],
'name' => $person['name']
];
}, $contractpersons);
$contract_stauts = ["合約簽回", "採購", "工程發包", "工程中", "修理完成"];
?>
<link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="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 defer src="./js/alpinejs/cdn.min.js"></script>
<script src="./js/axios/axios.min.js"></script>
<div class="contract-input-component" x-data="contractRepair">
<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" x-show="step==1">
<tr>
<td style="vertical-align: middle">報價單編號</td>
<td colspan="5">
<input class="form-control" @keyup="nextStepKeyupFn($event)" type="text" name="repair_no" x-model="data.repair_no">
</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">
<!-- <template x-if="step==1"> -->
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==2">
<!-- <tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==1"> -->
<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 type="text" x-model="data.company" />
<p class="alerttext" x-show="data.company==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">維保人員</td>
<td style="vertical-align: middle">
<select class="repaireid" id="repaireid" x-model="data.repairerid">
<option value="<?php echo $contract['repaireid'] ?>"><?php echo $contract['repairerid'] . '-' . $contract['name'] ?></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.repaireid==''"><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="facilityno" x-model="data.facilityno">
<p class="alerttext" x-show="data.facilityno==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">報價單編號</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="text" name="repair_no" x-model="data.repair_no" disabled="disabled">
<p class="alerttext" x-show="data.repair_no==''"><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="type" x-model="data.type">
<p class="alerttext" x-show="data.type==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">簽訂時間</td>
<td>
<input class="form-control disabled_select" type="date" name="sign_date" x-model="data.sign_date">
<p class="alerttext" x-show="data.sign_date==''"><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="invoice" x-model="data.invoice">
<p class="alerttext" x-show="data.invoice==''"><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="taxid" x-model="data.taxid">
<p class="alerttext" x-show="data.taxid==''"><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" 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">
<select class="contract_status" id="contract_status" x-model="data.contract_status">
<option value="">選擇工程類別</option>
<?php foreach ($contract_stauts as $key => $status) : ?>
<option value="<?php echo $key + 1; ?>"><?php echo $status; ?></option>
<?php endforeach ?>
</select>
<p class="alerttext" x-show="data.contract_status==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</template>
</table>
<button x-show="step==2" @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="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 src="./js/jquery/jquery-3.1.1.min.js"></script>
<script src="semantic/dist/semantic.min.js"></script>
<script src="./js/alpine.js"></script>
<script>
const user_id = '<?php echo $user_id; ?>'
const user_name = '<?php echo $user_name; ?>'
</script>

131
wms/contract-repair/contract-repair-management.php

@ -0,0 +1,131 @@
<?php
include("../header.php");
require_once("./conn.php");
$sql_str = "SELECT * FROM contract_r_signed_back WHERE 1=1 AND delete_status = 1 ORDER BY id DESC";
$stmt = $conn->prepare($sql_str);
$stmt->execute();
$contracts = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<link rel="stylesheet" href="./styles/style.css">
<link rel="stylesheet" href="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 defer src="./js/alpinejs/cdn.min.js"></script>
<script src="./js/axios/axios.min.js"></script>
<div class="contract-management" x-data="{
deleteFn(id,user){
if(confirm('確定要刪除嗎?')){
axios.get('./api/deleteNewContractData.php?contracttype=r&contractid='+id+'&user_id='+user).then(res=> {
console.log(res);
if(res.status === 204){
alert('刪除成功!')
location.reload();
}
})
}
}
}">
<div style="overflow-x:auto;margin-top:12px">
<a href="contract-repair-input.php?function_name=repair&<?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>項次</th>
<th>合約號</th>
<th>客戶名稱</th>
<th>統編</th>
<th>總金額</th>
<th>工程進度</th>
<th>建檔者</th>
<th>建立時間</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<?php foreach ($contracts as $key => $contract) : ?>
<tr>
<td><?php echo $contract['id']; ?></td>
<td><?php echo $contract['contractno'] ?></td>
<td><?php echo $contract['company'] ?></td>
<td><?php echo $contract['taxid'] ?></td>
<td><?php echo $contract['total_price'] ?></td>
<th><?php if ($contract['contract_status'] == 1) {
echo '合約簽回';
} else if ($contract['contract_status'] == 2) {
echo '採購';
} else if ($contract['contract_status'] == 3) {
echo '工程發包';
} else if ($contract['contract_status'] == 4) {
echo '工程中';
} else if ($contract['contract_status'] == 5) {
echo '修理完成';
}
?></th>
<td><?php echo $contract['create_user'] ?></td>
<td><?php echo $contract['create_date'] ?></td>
<td style="width:30px">
<p>
<a href="contract-repair-edit.php?&contractid=<?php echo $contract['id']; ?>&function_name=repair&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<a href="javascript:;" class="btn btn-info btn-sm" style="margin-left:10px;" @click="deleteFn(<?php echo $contract['id']; ?>,'<?php echo $user_id; ?>')">
<span class="glyphicon glyphicon-remove"></span>
</a>
</p>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
</div>
<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>
<script src="semantic/dist/semantic.min.js"></script>
<script>
$('#table_index').DataTable({
"order": [
[0, "desc"],
]
});
</script>

662
wms/contract-repair/contract_maintance.php

@ -0,0 +1,662 @@
<?php
include_once("../header.php");
require_once("./conn.php");
// if (!(isset($_GET['id']) && !empty($_GET['id']))) {
// $para = "function_name=pricereview&" . $token_link;
// echo "<script>alert('非法訪問!!!');</script>";
// echo "<script>window.history.go(-1);</script>";
// exit;
// }
$id = $_GET["id"];
$sql_str = "SELECT contract_new_apply.*, account.name as review_person_name
FROM contract_new_apply
LEFT JOIN account ON contract_new_apply.review_person_id = account.accountid
WHERE contract_new_apply.mid = :mid";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $id);
$stmt->execute();
$contract_new_apply = $stmt->fetch(PDO::FETCH_ASSOC);
$contract = $contract_new_apply;
$isFirst = empty($contract_new_apply) ? 1 : 0;
if (empty($contract_new_apply)) {
$sql_str = "SELECT pricereview_main.contractno, pricereview_main.ekind, pricereview_main.person, pricereview_main.company, pricereview_main.case_name, pricereview_main.address, pricereview_main.price_lowest, pricereview_main.price_total, pricereview_main.price_rate, pricereview_main.status as priceview_status, pricereview_main.id as mainid, account.name as accountname
FROM pricereview_main
JOIN account ON pricereview_main.person = account.accountid
WHERE pricereview_main.id = :id";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':id', $id);
$stmt->execute();
$contract = $stmt->fetch(PDO::FETCH_ASSOC);
// print_r($contract);
$accounttype = "M";
$sql_str = "SELECT * FROM account WHERE accounttype = :accounttype";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':accounttype', $accounttype);
$stmt->execute();
$persons = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no ORDER BY created_at DESC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $contract['contractno']);
$stmt->execute();
$customer = $stmt->fetch(PDO::FETCH_ASSOC);
$mid = $contract['mainid'];
$sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A'";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
$total_items = 0;
foreach ($items as $item) {
$total_items += $item['item_qty'];
}
$sql_str = "SELECT * FROM pricereview_pay WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC);
$price_a = 0;
$price_b = 0;
foreach ($pays as $pay) {
if ($pay['pay_kind'] <= 4) {
$price_a = $price_a + $pay['pay_amount'];
} else {
$price_b = $price_b + $pay['pay_amount'];
}
}
} else {
$mid = $contract['mid'];
$contract_new_apply_id = $contract_new_apply['id'];
$sql_str = "SELECT * FROM contract_new_apply_pays WHERE mid = :mid ORDER BY pay_kind ASC";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$pays = $stmt->fetchAll(PDO::FETCH_ASSOC);
$sql_str = "SELECT * FROM pricereview_item WHERE mid = :mid AND item_group = 'A'";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':mid', $mid);
$stmt->execute();
$items = $stmt->fetchAll(PDO::FETCH_ASSOC);
$price_a = 0;
$price_b = 0;
foreach ($pays as $pay) {
if ($pay['pay_kind'] <= 4) {
$price_a = $price_a + $pay['pay_amount'];
} else {
$price_b = $price_b + $pay['pay_amount'];
}
}
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contract_id', $id);
$stmt->execute();
$files = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($files);
}
$secondPayDeadline = $contract['secondPayDeadline'] ?? 0;
$status = isset($contract['status']) ? $contract['status'] : -1;
$person = $contract['person'];
?>
<link rel="stylesheet" href="./styles/style.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" />
<link rel="stylesheet" href="semantic/dist/semantic.min.css">
<script defer src="./js/alpinejs/cdn.min.js"></script>
<script src="./js/axios/axios.min.js"></script>
<div class="contract-new-apply-component" x-data="contractNewApply">
<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>
<tbody style="font-weight: bolder;margin-bottom: 20px" x-show="step==1">
<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>
<div class="fixed" x-text="data.vol_no"></div>
<!-- <input class="form-control disabled_select" type="text" x-model="data.vol_no" > -->
<!-- <p class="alerttext" x-show="data.vol_no==''"><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="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>
<input class="form-control disabled_select" type="date" x-model="data.apply_date">
<p class="alerttext" x-show="data.apply_date==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">申請類別</td>
<td style="vertical-align: middle">
<select class="" id="apply_type" x-model="data.apply_type">
<option value="A">制式新合約</option>
</select>
<p class="alerttext" x-show="data.apply_type==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">案件名稱</td>
<td style="vertical-align: middle" colspan="3">
<input class="form-control disabled_select" type="text" x-model="data.case_name">
<p class="alerttext" x-show="data.case_name==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">立約人</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="text" x-model="data.company">
<p class="alerttext" x-show="data.company==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">負責人</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select" type="text" x-model="data.manager">
<p class="alerttext" x-show="data.manager==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">含稅給約總價</td>
<td colspan="3" style="vertical-align: middle">
<input class="form-control disabled_select lock" type="number" x-model="data.total_price">
<p class="alerttext" x-show="data.total_price==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">含稅貸款(A)</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select lock" type="number" x-model="data.price_a">
<p class="alerttext" x-show="data.price_a==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">含稅安裝款(A)</td>
<td style="vertical-align: middle">
<input class="form-control disabled_select lock" type="number" x-model="data.price_b">
<p class="alerttext" x-show="data.price_b==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">聯絡地址</td>
<td style="vertical-align: middle" colspan=3>
<input class="form-control disabled_select" 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" colspan=3>
<div class="ui labeled input">
<div class="ui label">
貨抵工地
</div>
<input type="text" placeholder="30" style="width:45px;padding:0 12px;" x-model="data.workdeadline_a">
<div class="ui label">
天內安裝完成,甲方應於貨底工地前
</div>
<input type="text" placeholder="7" style="width:45px;padding:0 12px;" x-model="data.workdeadline_b">
<div class="ui label">
天完成並整理完善。
</div>
</div>
<!-- <input class="form-control disabled_select" type="text" x-model="data.deadline" > -->
<p class="alerttext" x-show="data.deadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">附則</td>
<td style="vertical-align: middle" colspan=3>
<div class="ui labeled input">
<div class="ui label">
乙方應於
</div>
<input type="text" placeholder="10" style="width:45px;padding:0 12px;" x-model="data.regulations">
<div class="ui label">
天內試車完成
</div>
</div>
<p class="alerttext" x-show="data.regulations==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">免保期限</td>
<td style="vertical-align: middle" colspan=3>
<div class="ui labeled input">
<input type="text" placeholder="18" style="width:45px;padding:0 12px;" x-model="data.freedeadline">
<div class="ui label">
個月
</div>
</div>
<p class="alerttext" x-show="data.freedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
<tr>
<td style="vertical-align: middle">交貨地點</td>
<td style="vertical-align: middle" colspan=3>
<input class="form-control disabled_select" type="text" x-model="data.tradeaddress">
<p class="alerttext" x-show="data.tradeaddress==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">交貨期限</td>
<td style="vertical-align: middle" colspan=3>
<div class="ui labeled input">
<div class="ui label">
圖色確認第
</div>
<input type="text" placeholder="90" style="width:45px;padding:0 12px;" x-model="data.tradedeadline">
<div class="ui label">
天出貨
</div>
</div>
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td colspan="1">
<p style='text-align:center'>項次</p>
</td>
<td colspan="3">
<p style='text-align:center'>規格</p>
</td>
<td colspan="1">
<p style='text-align:center'>數量</p>
</td>
<td colspan="3">
<p style='text-align:center'>金額</p>
</td>
</tr>
</thead>
<tbody style="font-weight: bolder;margin-bottom: 20px">
<template x-for="(item, idx) in data.items">
<tr>
<td style="vertical-align: middle">
<p x-text="idx+1"></p>
</td>
<td colspan="3" style="vertical-align: middle">
<input class="form-control disabled_select lock" type="text" x-model="item.item_spec">
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td style="vertical-align: middle">
<span x-text="item.item_qty + '台'" style="padding:0 20px"></span>
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
<td colspan="3" style="vertical-align: middle">
<input class="form-control disabled_select lock" type="number" x-model="item.item_price_ct">
<p class="alerttext" x-show="data.tradedeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
</template>
<tr>
<td colspan=4></td>
<td>電梯總數</td>
<td colspan='3'> <span x-text="data.total_items + '台'" style="padding:0 20px"></span></td>
</tr>
</tbody>
</table>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td>
<p style='text-align:center'>合約類別</p>
</td>
<td>
<p style='text-align:center'>款別</p>
</td>
<td>
<p style='text-align:center'>條件名稱</p>
</td>
<td>
<p style='text-align:center'>收款條件日期區分</p>
</td>
<td>
<p style='text-align:center'>條件日期</p>
</td>
<td>
<p style='text-align:center'>票期</p>
</td>
<td>
<p style='text-align:center'>付款比率</p>
</td>
<td>
<p style='text-align:center'>金額</p>
</td>
</tr>
</thead>
<tbody style="font-weight: bolder;margin-bottom: 20px">
<?php
$day = 0;
$styles = [
1 => "訂金",
2 => "二次款",
3 => "貨到款",
4 => "",
5 => "安裝款",
6 => "尾款",
7 => "",
];
$paydate = [
1 => "合約日",
2 => "合約日",
3 => "出貨日",
4 => "",
5 => "竣檢日",
6 => "交車日",
7 => ""
];
?>
<?php foreach ($pays as $pay) :
if ($pay['pay_scale'] == 0) continue;
?>
<tr>
<td>
<p style='text-align:center'><?php echo ($pay['pay_kind'] <= 4) ? "銷售" : "按裝"; ?></p>
</td>
<td>
<p style='text-align:center'><?php echo $styles[$pay['pay_kind']]; ?></p>
</td>
<td>
<?php if ($pay['pay_kind'] == 1) { ?>
<template x-if="pays[1] > 0">
<p style='text-align:center'>簽約後<span x-text="pays[1]"></span>天付訂金</p>
</template>
<template x-if="pays[1] <= 0">
<p style='text-align:center'>簽約後付訂金</p>
</template>
<?php } elseif ($pay['pay_kind'] == 2) { ?>
<template x-if="pays[2] > 0">
<p style='text-align:center'>簽約後<span x-text="pays[2]"></span>天付二次款</p>
</template>
<template x-if="pays[2] <= 0">
<p style='text-align:center'>簽約後付二次款</p>
</template>
<?php } elseif ($pay['pay_kind'] == 3) { ?>
<p style='text-align:center'>貨抵工地付貨到款</p>
<?php } elseif ($pay['pay_kind'] == 5) { ?>
<template x-if="pays[5] > 0">
<p style='text-align:center'>安裝完成後<span x-text="pays[5]"></span>天收款</p>
</template>
<template x-if="pays[5] <= 0">
<p style='text-align:center'>安裝完成後收款</p>
</template>
<?php } elseif ($pay['pay_kind'] == 6) { ?>
<template x-if="pays[6] > 0">
<p style='text-align:center'>交車後<span x-text="pays[6]"></span>天付尾款</p>
</template>
<template x-if="pays[6] <= 0">
<p style='text-align:center'>交車後付尾款</p>
</template>
<?php } else { ?>
<p style='text-align:center'>-</p>
<?php } ?>
</td>
<td>
<p style='text-align:center'><?php echo $paydate[$pay['pay_kind']]; ?></p>
</td>
<td>
<div class="ui labeled input">
<input type="number" placeholder="90" style="width:65px;padding:0 12px;" x-model="pays[<?php echo $pay['pay_kind']; ?>].condition_date">
<div class="ui label">
</div>
</div>
</td>
<td>
<div class="ui labeled input">
<input type="number" placeholder="90" style="width:65px;padding:0 12px;" x-model="pays[<?php echo $pay['pay_kind']; ?>].pay_period">
<div class="ui label">
</div>
</div>
</td>
<td>
<p style='text-align:center' x-text="pays[<?php echo $pay['pay_kind']; ?>].scale + '%'"><?php echo $pay['pay_scale'] ?>%</p>
</td>
<td>
<p style='text-align:center' x-text="localnumber(data.total_price * pays[<?php echo $pay['pay_kind']; ?>].scale/100)"></p>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<template x-if="pays[2].pay_period > 0">
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<tbody style="font-weight: bolder;margin-bottom: 20px">
<tr>
<td>第二期款交貨期限(日)</td>
<td>
<input type="number" class="form-control" x-model="data.secondPayDeadline" />
<p class="alerttext" x-show="data.secondPayDeadline==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
</td>
</tr>
</tbody>
</table>
</template>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead style="font-weight: bolder;margin-bottom: 20px;">
<tr>
<td colspan=8>
<h4 style='text-align:center;font-weight: bolder'>附件上傳</h4>
</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="4">附件上傳</td>
<td colspan="4">
<?php if ($status < 1) : ?>
<input type="file" name="file[]" multiple draggable="true" @change="uploadFiles($event)" />
<?php endif; ?>
<?php foreach ($files as $file) : ?>
<a href="./images/contracts_new_files/<?php echo $file['file_name']; ?>" download><?php echo $file['file_name']; ?></a> <?php if ($status < 1) : ?><span style="margin-left:10px;cursor:pointer;color:#f019">X</span><?php endif; ?><br />
<?php endforeach; ?>
</td>
</tr>
</tbody>
</table>
<table class="table table-bordered query-table table-striped table-bordered display compact" style="width:99%;margin-left:.5%">
<thead style="font-weight: bolder;margin-bottom: 20px;">
<tr>
<td colspan=8>
<h4 style='text-align:center;font-weight: bolder'>簽核流程</h4>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>審核</td>
<td>審核人</td>
<td>結果</td>
<td colspan=2>意見</td>
<td>時間</td>
<td colspan=2><?php if ($user_id === "M0174" && $status == 1) : ?>審核意見<?php endif; ?></td>
</tr>
<tr>
<td>營業員</td>
<td><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td>
<td>
<?php if ($status >= 1) : ?><span class="successtext">已送審</span><?php endif; ?>
<?php if ($status == 0) : ?><span class="readtext">暫存</span><?php endif; ?>
<?php if ($status == -1) : ?><span class="">未提交</span><?php endif; ?>
</td>
<td colspan=2>---</td>
<td><?php echo ($contract['submit_date']) ?? "---"; ?> </td>
<td colspan=2 rowspan="2">
<?php if ($user_id === "M0174" && $status == 1) : ?>
<textarea class="form-control opinion" x-model="data.review_comment"></textarea>
<?php endif; ?>
</td>
</tr>
<tr>
<td>業務承辦人</td>
<td><span><?php echo (isset($contract['review_person_name']) || empty($contract['review_person_name'])) ? "---" : $contract['review_person_name'] . "(" . $contract['review_person_id'] . ")"; ?></span></td>
<td>
<?php if ($status == 3) : ?><span class="successtext">結案同意</span><?php endif; ?>
<?php if ($status == 2) : ?><span class="failtext">結案不同意</span><?php endif; ?>
<?php if ($status < 2) : ?><span>---</span><?php endif; ?>
</td>
<td colspan=2><?php echo $contract['review_comment'] ?? "---"; ?></td>
<td><?php echo $contract['review_date'] ?? "---"; ?></td>
</tr>
<!-- <tr>
<td colspan="2" style="font-weight:bold">業務部承辦人</td>
<td colspan="2">
<template x-if="false">
<span class="failtext">已退件</span>
</template>
<?php if ($status == 1) : ?>
<span class="readtext">審核中...</span>
<?php endif; ?>
<template x-if="false">
<span class="successtext">已通過</span>
</template>
</td>
<td colspan="2" style="font-weight:bold">營業員</td>
<td colspan="2"><span x-text="data.salesmanname + '(' + data.salesman + ')'"></span></td>
</tr> -->
</tbody>
</table>
<button @click="window.history.go(-1)" type="button" class="btn btn-primary btn-lg pull-right savebtn">回前頁</button>
<?php if (($isFirst == 1 && ($person == $user_id || $user_id == "M0174")) || ($isFirst == 0 && $status == 0 && ($person == $user_id || $user_id == "M0174"))) : ?>
<button x-show="true" x-on:click="submit()" :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="true" x-on:click="storageFn()" :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>
<?php endif; ?>
<?php if ($status == 1 && ($user_id == "M0107" || $user_id == "M0060" || $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>同意(結案)</span>
</template>
<template x-if="isLoading">
<div class="loader"></div>
</template>
</button>
<button x-show="true" x-on:click="disagree()" :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>
<?php endif; ?>
</div>
</div>
</div>
<script src="./js/jquery/jquery-3.1.1.min.js"></script>
<script src="semantic/dist/semantic.min.js"></script>
<script src="./js/alpine.js"></script>
<script>
window.onload = () => {
const lock = document.getElementsByClassName('lock');
for (let i = 0; i < lock.length; i++) {
lock[i].disabled = true
}
}
</script>
<?php if (empty($contract_new_apply)) : ?>
<script>
const contractno = '<?php echo $contract['contractno'] ?? ''; ?>';
const salesman = '<?php echo $contract['person'] ?? ''; ?>';
const salesmanname = '<?php echo $contract['accountname'] ?? ''; ?>';
const apply_date = '<?php echo date('Y-m-d') ?>';
const case_name = '<?php echo $contract['case_name'] ?? ''; ?>';
const company = '<?php echo $contract['company'] ?? ''; ?>';
const manager = '<?php echo $customer['manager'] ?? ''; ?>';
const vat = '<?php echo $customer['uscc'] ?? ''; ?>';
const price_total = <?php echo $contract['price_total'] ?? ''; ?>;
const address = '<?php echo $contract['address'] ?? ''; ?>';
const price_a = <?php echo $price_a ?? ''; ?>;
const price_b = <?php echo $price_b ?? ''; ?>;
const items = [...<?php echo json_encode($items) ?? []; ?>];
const user_id = '<?php echo $user_id ?>';
const mid = '<?php echo $_GET['id']; ?>';
const pays = [...<?php echo json_encode($pays) ?? []; ?>];
const secondPayDeadline = '';
const tradeaddress = '<?php echo $contract['address'] ?? ''; ?>';
const tradedeadline = 90
const freedeadline = 18;
const regulations = 10;
const workdeadline_a = 60;
const workdeadline_b = 7;
const total_items = <?php echo $total_items ?? ''; ?>;
const isFirst = <?php echo $isFirst; ?>;
</script>
<?php else : ?>
<script>
const contractno = '<?php echo $contract['contractno'] ?? ''; ?>';
const salesman = '<?php echo $contract['person'] ?? ''; ?>';
const salesmanname = '<?php echo $contract['personname'] ?? ''; ?>';
const apply_date = '<?php echo date('Y-m-d') ?>';
const case_name = '<?php echo $contract['case_name'] ?? ''; ?>';
const company = '<?php echo $contract['customer'] ?? ''; ?>';
const manager = '<?php echo $contract['manager'] ?? ''; ?>';
const vat = '<?php echo $contract['vat'] ?? ''; ?>';
const price_total = <?php echo $contract['total_price'] ?? ''; ?>;
const address = '<?php echo $contract['contact_address'] ?? ''; ?>';
const price_a = <?php echo $contract['buy_fee'] ?? ''; ?>;
const price_b = <?php echo $contract['install_fee'] ?? ''; ?>;
const items = [...<?php echo json_encode($items) ?? []; ?>];
const user_id = '<?php echo $user_id ?? ''; ?>';
const mid = '<?php echo $_GET['id']; ?>';
const pays = [...<?php echo json_encode($pays) ?? []; ?>];
const isFirst = <?php echo $isFirst; ?>;
const tradeaddress = '<?php echo $contract['trade_address'] ?? ''; ?>';
const tradedeadline = '<?php echo $contract['tradedeadline'] ?? ''; ?>';
const freedeadline = '<?php echo $contract['freedeadline'] ?? ''; ?>';
const regulations = '<?php echo $contract['test_time'] ?? ''; ?>';
const workdeadline_a = '<?php echo $contract['workdeadline_a'] ?? ''; ?>';
const workdeadline_b = '<?php echo $contract['workdeadline_b'] ?? ''; ?>';
const secondPayDeadline = <?php echo $secondPayDeadline ?? ''; ?>;
const total_items = <?php echo $contract['total_items'] ?? ''; ?>;
const contract_new_apply_id = <?php echo $contract_new_apply_id; ?>;
</script>
<?php endif; ?>
<?php if ($status > 0 || ($person != $user_id && $user_id != "M0174")) : ?>
<script>
window.onload = () => {
const input = document.querySelectorAll('input');
const alerttext = document.querySelectorAll('p.alerttext');
const select = document.querySelectorAll('select');
for (let i = 0; i < input.length; i++) {
input[i].disabled = true
}
for (let i = 0; i < select.length; i++) {
select[i].disabled = true
}
for (let i = 0; i < alerttext.length; i++) {
alerttext[i].style.display = "none"
}
}
</script>
<?php endif; ?>

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

@ -0,0 +1,842 @@
const contractDownload = () => {
return {
init() {
this.standarDate = this.deepClone(this.data);
this.onstandarViewData = this.deepClone(this.data);
this.buystandarData = this.deepClone(this.buydata);
this.buyonstandardViewData = this.deepClone(this.buydata);
},
css: `table { background - color: #fff; border: none; margin - top: 30px; font - family: '標楷體'; width: 600px; } table tr: nth - child(even), table tr: nth - child(odd) { background - color: #fff; } table tr { font - size: 12pt; width: 100 %; } table tr h2 { font - size: 18pt; } table tr td { width: 100 %; height: 100 %; line - height: 2; display: flex; } table tr td.center { display: flex; justify - content: center; align - items: center; } table tr td.list { width: 100 %; height: 100 %; white - space: nowrap; display: flex; } table tr td.list span { width: 60px; min - height: 100 %; display: block; } table tr td.list > p { display: block; text - align: justify; } table tr td.list div { max - width: calc(100 % - 60px); white - space: normal; } table tr td.list div.text - justify { display: flex; width: 100 %; justify - content: space - between; } table tr.date td > div { width: 100 %; text - align: right; } table tr.date td > div.text - justify { display: flex; justify - content: space - between; } table td, table th { padding: 8px; }`,
data: {
illustrate: {
editshow: false,
plaintext: '茲因甲乙雙方就電梯設備保養.檢修事宜,同意訂定本契約,議定條款如后,並相互遵守條款約定。',
},
partyA: {
editshow: false,
plaintext: partyAcompany,
},
partyAcontractno: {
editshow: false,
plaintext: partyAcontractno,
},
list: {
plaintext: [
{
editshow: false,
origin: true,
text: ``,
deleted: false,
id: 0,
input_id: null
},
{
editshow: false,
origin: true,
text: `規格`,
type: 'title',
deleted: false,
id: 1,
input_id: null
},
{
editshow: false
}
]
}
},
buydata: {
},
exportFn(type) {
const form = this.$refs.form;
const prviewType = this.$refs.form.querySelector('#prview-type');
const list = this.$refs.form.querySelector('#privew-list');
const standardList = this.$refs.form.querySelector('#standard-prview-list');
const illustrate = this.$refs.form.querySelector('illustrate');
const standardIllustrate = this.$refs.form.querySelector('#standard-illustrate');
const partyA = this.$refs.form.querySelector('#partyA');
const partyAcontractno = this.$refs.form.querySelector('#partyAcontractno');
const total_price = this.$refs.form.querySelector('#total_price');
prviewType.value = type;
if (type === 1) {
const standarJsonText = this.buystandarDate.list.plaintext.map((item, idx) => {
let text = '';
text = item.text.replace(/\s+/g, "");
this.buydata.list.plaintext[idx].text = this.buydata.list.plaintext[idx].text.replace(/\s+/g, "");
return {
text: text,
id: item.id
}
});
const jsonText = this.buydata.list.plaintext.map(item => {
let text = '';
text = item.text;
return {
text: text,
origin: item.origin ? 1 : 0,
deleted: item.deleted ? 1 : 0,
id: item.id,
updated: item.updated ? 1 : 0
}
});
list.value = JSON.stringify(jsonText);
standardList.value = JSON.stringify(standarJsonText);
illustrate.value = this.buydata.illustrate.plaintext;
standardIllustrate.value = this.buyonstandardViewData.illustrate.plaintext;
partyA.value = this.buydata.partyA.plaintext;
partyAcontractno.value = this.buydata.partyAcontractno.plaintext;
total_price.value = totalBuyPrice;
form.submit();
return;
}
if (type === 2) {
const standardJsonText = this.standarData.list.plaintext.map((item, idx) => {
let text = '';
text = item.text.replace(/\s+/g, "");
if (this.data.list.plaintext[idx] !== undefined) {
this.data.list.plaintext[idx].text = this.data.list.plaintext[idx].text.replace(/\s+/g, "");
}
return {
text: text,
id: item.id
}
})
const jsonText = this.data.list.plaintext.map(item => {
let text = '';
item.text;
text = item.text;
return {
text: text,
origin: item.origin ? 1 : 0,
deleted: item.deleted ? 1 : 0,
id: item.id,
updated: item.updated ? 1 : 0
}
})
list.value = JSON.stringify(jsonText);
standardList.value = JSON.stringify(standarJsonText);
illustrate.value = this.data.illustrate.plaintext;
standardIllustrate.value = this.standardData.illustrate.plaintext;
partyA.value = this.data.partyA.plaintext;
partyAcontractno.value = this.data.partyAcontractno.plaintext;
total_price.value = totalInstallPrice;
form.submit();
return;
}
}
}
};
const contractNewInput = () => {
return {
init() { },
data: {
contractno: '',
customer: '',
manager: '',
vat: '',
case_name: '',
linkman: '',
lm_tel: '',
address: '',
salesman: '',
qc: '',
qc: '',
// files:[],
},
step: 1,
isLoading: false,
customize: false,
nextStepFn() {
if (this.data.contractno == '') return alert('合約號為必填')
this.isLoading = true
if (this.step == 1) {
this.getContractDate();
}
},
nextStepKeyupFn(e) {
if (e.keyCode != 13) return
if (this.step == 1) {
this.getContractDate();
console.log(this.step);
}
},
preStepFn() {
if (this.step == 2) {
this.step = 1
}
},
getContractDate() {
axios.get('./api/getContractData.php?contracttype=m&contractno=' + this.data.contractno).then(res => {
if (!res.data) {
this.step = 2
this.isLoading = false
return
}
if (!this.customize) {
console.log(res.data);
this.data.customer = res.data.customer
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.step = 2
this.isLoading = false
}).catch(err => {
console.error(err)
this.isLoading = false
})
},
save() {
this.isLoading = true
const form = new FormData();
form.append('contractno', this.data.contractno);
form.append('customer', this.data.customer);
form.append('manager', this.data.manager);
form.append('vat', this.data.vat);
form.append('case_name', this.data.case_name);
form.append('linkman', this.data.linkman);
form.append('lm_tel', this.data.lm_tel);
form.append('address', this.data.address);
form.append('salesman', this.data.salesman);
form.append('qc', this.data.qc);
form.append('contracttype', 'm');
form.append('user_id', user_id);
for (var i = 0; i < this.data.files.length; i++) {
form.append('files[]', this.data.files[i]);
}
axios.post('./api/postNewContractData.php', form).then(res => {
console.log(res);
if (res.status === 201) {
alert('儲存成功');
this.step = 1
this.data.contractno = ''
this.data.customer = ''
this.data.manager = ''
this.data.vat = ''
this.data.case_name = ''
this.data.linkman = ''
this.data.lm_tel = ''
this.data.address = ''
this.data.salesman = ''
this.data.qc = ''
this.data.files = []
this.customize = false
} else {
alert('儲存失敗!可能為以下錯誤:\n' + res.data)
}
this.isLoading = false
}).catch(error => {
let code = error.response.status;
if (code == 422) {
this.fail_arr = error.response.data
this.errorFn();
}
if (code == 500) {
alert('儲存失敗!可能為以下錯誤:\n' + error.response.data)
}
this.isLoading = false
})
},
errorFn() {
let msg = ''
for (let i = 0; i < this.fail_arr.length; i++) {
msg += this.fail_arr[i] + '、'
}
alert(msg)
},
uploadFiles(e) {
this.data.files = e.target.files
},
}
};
//////////////////////////////
//// 合約簽回(修理)
////
//// 製作人:梓誠
/// 時間 :
//////////////////////////////
const contractRepair = () => {
return {
init() { },
data: {
contractno: '',
company: '',
repairer: '',
repaireid: '',
facilityno: '',
taxid: '',
invoice: '', //發票抬頭
type: '', //工程類別需新增,用 post
address: '',
repair_no: '',
total_price: '',
sign_date: '',
contract_status: ''
},
step: 1,
isLoading: false,
customize: false,
nextStepFn() {
if (this.data.contractno == '') return alert('合約號為必填')
this.isLoading = true
if (this.step == 1) {
this.getContractDate();
}
},
nextStepKeyupFn(e) {
if (e.keyCode != 13) return
if (this.step == 1) {
this.getContractDate();
console.log(this.step);
}
},
// 抓資料
getContractDate() {
axios.get('./api/getContractData.php?contracttype=r&repair_no=' + this.data.repair_no).then(res => {
if (!res.data) {
this.step = 2;
this.isLoading = false;
// console.log(123);
return
}
if (!this.customize) {
// console.log(res.data);
this.data.contractno = res.data.contractno;
this.data.company = res.data.company;
this.data.repairer = res.data.name;
this.data.facilityno = res.data.facilityno;
this.data.taxid = res.data.taxid;
this.data.invoice = res.data.invoice;
this.data.address = res.data.address;
this.data.repair_no = res.data.repair_no;
this.data.total_price = res.data.total_price;
this.data.repaireid = res.data.repairerid;
this.data.sign_date = res.data.sign_date;
this.data.contract_status = res.data.contract_status;
}
this.step = 2;
this.isLoading = false;
// console.log(user_name);
// console.log(this.data.sign_date);
}).catch(err => {
console.log(err);
alert(err.response.data);
this.isLoading = false
})
},
preStepFn() {
if (this.step == 2) {
if (confirm('回到上一頁會初始化資料,確定要返回嗎?')) {
this.step = 1;
this.data.contractno = '';
this.data.company = '';
this.data.repairer = '';
this.data.facilityno = '';
this.data.taxid = '';
this.data.invoice = '';
this.data.address = '';
this.data.repair_no = '';
this.data.total_price = '';
this.data.repaireid = '';
this.data.sign_date = '';
this.data.contract_status = '';
return;
}
}
},
save() {
this.isLoading = true;
const form = new FormData();
form.append('contractno', this.data.contractno);
form.append('company', this.data.company);
form.append('repairid', this.data.repaireid);
form.append('facilityno', this.data.facilityno);
form.append('taxid', this.data.taxid);
form.append('invoice', this.data.invoice);
form.append('address', this.data.address);
form.append('repair_no', this.data.repair_no);
form.append('total_price', this.data.total_price);
form.append('sign_date', this.data.sign_date);
form.append('contract_status', this.data.contract_status);
form.append('contracttype', 'r');
form.append('user_id', user_id);
form.append('type', this.data.type);
axios.post('./api/postContractData.php', form).then(res => {
console.log(res.status);
if (res.status === 200) {
alert('儲存成功');
this.step = 1;
this.data.contractno = '';
this.data.company = '';
this.data.repaireid = '';
this.data.facilityno = '';
this.data.repairer = '';
this.data.taxid = '';
this.data.invoice = '';
this.data.address = '';
this.data.repair_no = '';
this.data.total_price = '';
this.data.user_id = '';
this.data.type = '';
this.data.sign_date = '';
this.data.contract_status = '';
}
this.isLoading = false;
}).catch(error => {
let code = error.response.status;
if (code == 422) {
this.fail_arr = error.response.data;
this.errorFn();
console.log(error.response.data);
}
if (code == 500) {
alert('儲存失敗!可能為以下錯誤:\n' + error.response.data);
}
this.isLoading = false;
})
},
errorFn() {
let msg = '';
for (let i = 0; i < this.fail_arr.length; i++) {
msg += this.fail_arr[i] + '、';
}
alert(msg);
},
uploadFiles(e) {
this.data.files = e.target.files;
}
}
};
const contractInput = () => {
return {
init() {
$('.contract-input-component .form .dropdown').dropdown();
axios.get('./twzip.json').then(res => {
this.cities = res.data.cities
})
},
cities: [],
data: {
contractno: 'B23100060',
total_price: '', //合約總價
vat: '', //統一編號
mtype: 'A', //維修型態
phone: '', //客戶電話
email: '', //Email
mworker: '', //保養員
mcycle: '', //保養頻率
salesman: '', //營業員
contract_begin_date: '', //合約開始時間
contract_end_date: '', //合約終止時間
area: '', //區域
zip: '', //郵遞區號
address: '', //地址
customer: '', //立約人
partyA: '', //業務聯繫人
partyAaddress: '', //業務聯繫人地址
partyAphone: '', //業務聯繫人電話
partyAemail: '', //業務聯繫人email
files: [], //附件檔案
num: '', //電梯數量
disabled: false, //資料庫是否有電梯數量資料
elevators: [], //機種、載重、人乘、樓停、樓層、速度、緯度、經度、開門方式、保養別、廠牌、竣檢日、許可證日期
},
customize: false,
step: 1,
isLoading: false,
fail_arr: [],
nextStepFn() {
if (this.step == 1) {
if (this.data.repair_no == '') return alert('請輸入合約號');
this.isLoading = true
this.getContractDate();
} else if (this.step == 2) {
if (this.data.num <= 0) return alert('請填寫電梯數量!')
if (!this.data.disabled) {
this.createElevator();
}
this.step = 3
}
},
nextStepKeyupFn(e) {
if (e.keyCode !== 13) return
if (this.step == 1) {
if (this.data.repair_no == '') return alert('請輸入合約號');
this.isLoading = true
this.getContractDate();
} else if (this.step == 2) {
this.step = 3
}
},
createElevator() {
for (let i = 0; i < this.data.num; i++) {
this.data.elevators.push({
spec: '', //規格
weight: '', //載重
speed: '', //速度
persons: '', //人乘
stop: '', //樓停
floors: '', //樓層
latitude: '', //緯度
longitude: '', //經度
elevator_brand: '', //廠牌
opendoor: '', //開門方式
maintainance: '', //保養別
takecertificatedate: '', //竣檢日
useful_date: '', //許可證有效日期
})
}
},
getContractDate() {
axios.get('./api/getContractData.php?contracttype=b&contractno=' + this.data.contractno).then(res => {
if (!res.data) {
this.step = 2
this.isLoading = false
return
}
if (!this.customize) {
console.log(res.data);
this.data.total_price = res.data.sold_price
this.data.salesman = res.data.salesman
this.data.contract_begin_date = res.data.contract_begin_date
this.data.contract_end_date = res.data.contract_end_date
this.data.address = res.data.address
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.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) {
cityIndex = this.data.address.indexOf('縣');
}
if (cityIndex > 1) {
// 獲取''市''前面的兩個字
let city = this.data.address.substring(cityIndex - 2, cityIndex + 1);
this.data.area = city;
} else {
this.data.area = ''
}
}
this.step = 2
this.isLoading = false
}).catch(err => {
console.error(err)
this.isLoading = false
})
},
preStepFn() {
if (this.step == 2) {
if (confirm('回到上一頁會將會初始化資料,確定返回嗎?')) {
this.step = 1
this.data.total_price = ''
this.data.salesman = ''
this.data.contract_begin_date = ''
this.data.contract_end_date = ''
this.data.address = ''
this.data.customer = ''
this.data.partyA = ''
this.data.partyAaddress = ''
this.step = 1
this.data.num = ''
this.data.disabled = false
this.data.elevators = []
this.data.files = []
this.data.vat = ''
this.data.mtype = ''
this.data.phone = ''
this.data.email = ''
this.data.mworker = ''
this.data.mcycle = ''
this.data.area = ''
this.data.zip = ''
this.data.partyAphone = ''
this.data.partyAemail = ''
return;
}
} else if (this.step == 3) {
this.step = 2
}
},
save() {
this.isLoading = true
const form = new FormData();
form.append('contractno', this.data.contractno);
form.append('total_price', this.data.total_price);
form.append('vat', this.data.vat);
form.append('mtype', this.data.mtype);
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('salesman', this.data.salesman);
form.append('contract_begin_date', this.data.contract_begin_date);
form.append('contract_end_date', this.data.contract_end_date);
form.append('address', this.data.address);
form.append('area', this.data.area);
form.append('customer', this.data.customer);
form.append('partyA', this.data.partyA);
form.append('partyAaddress', this.data.partyAaddress);
form.append('partyAphone', this.data.partyAphone);
form.append('partyAemail', this.data.partyAemail);
form.append('user_id', user_id);
form.append('user_name', user_name);
form.append('num', this.data.num);
form.append('elevators', JSON.stringify(this.data.elevators));
form.append('contracttype', 'b');
// 如果有附件檔案,可以逐一加入
for (var i = 0; i < this.data.files.length; i++) {
form.append('files[]', this.data.files[i]);
}
axios.post('./api/postContractData.php', form).then(res => {
console.log(res.status);
if (res.status === 200) {
alert('儲存成功');
this.step = 1
this.data.total_price = ''
this.data.salesman = ''
this.data.contract_begin_date = ''
this.data.contract_end_date = ''
this.data.address = ''
this.data.customer = ''
this.data.partyA = ''
this.data.partyAaddress = ''
this.step = 1
this.data.num = ''
this.data.disabled = false
this.data.elevators = []
this.data.files = []
this.data.vat = ''
this.data.mtype = ''
this.data.phone = ''
this.data.email = ''
this.data.mworker = ''
this.data.mcycle = ''
this.data.area = ''
this.data.zip = ''
this.data.partyAphone = ''
this.data.partyAemail = ''
}
this.isLoading = false
}).catch(error => {
let code = error.response.status;
if (code == 422) {
this.fail_arr = error.response.data
this.errorFn();
}
if (code == 500) {
alert('儲存失敗!可能為以下錯誤:\n' + error.response.data)
}
this.isLoading = false
})
},
errorFn() {
let msg = ''
for (let i = 0; i < this.fail_arr.length; i++) {
msg += this.fail_arr[i] + '、'
}
alert(msg)
},
uploadFiles(e) {
this.data.files = e.target.files
},
}
};
const contractNewApply = () => {
return {
step: 1,
isLoading: false,
data: {
mid: mid,
vol_no: contractno,
salesman: salesman,
salesmanname: salesmanname,
apply_date: apply_date,
apply_type: 'A',
case_name: case_name,
company: company,
manager: manager,
vat: vat,
total_price: price_total,
price_a: price_a,
price_b: price_b,
address: address,
workdeadline_a: 30, //完工期限: 幾天內安裝完成,預設30
workdeadline_b: 7, //完工期限: 幾天內整理完善,預設7
regulations: 10, //附則
freedeadline: 18, //免保期限(月)
tradeaddress: '', //交貨地點
tradedeadline: 90, //交貨期限
items: items,
},
pays: {
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
},
tickets: {
1: 0,
2: 0,
3: 0,
4: 0,
5: 0,
6: 0,
7: 0,
},
localnumber(num) {
return num.toLocaleString();
},
storageFn() {
this.isLoading = true
const isFirst = 1;
const form = new FormData();
form.append('mid', this.data.mid);
form.append('vol_no', this.data.vol_no);
form.append('salesman', this.data.salesman);
form.append('apply_date', this.data.apply_date);
form.append('apply_type', this.data.apply_type);
form.append('case_name', this.data.case_name);
form.append('company', this.data.company);
form.append('manager', this.data.manager);
form.append('vat', this.data.vat);
form.append('total_price', this.data.total_price);
form.append('price_a', this.data.price_a);
form.append('price_b', this.data.price_b);
form.append('address', this.data.address);
form.append('workdeadline_a', this.data.workdeadline_a);
form.append('workdeadline_b', this.data.workdeadline_b);
form.append('regulations', this.data.regulations);
form.append('freedeadline', this.data.freedeadline);
form.append('tradeaddress', this.data.tradeaddress);
form.append('tradedeadline', this.data.tradedeadline);
form.append('isFirst', isFirst);
form.append('user_id', user_id);
axios.post('./api/postContractNewApplyData.php', form).then(res => {
if (res.status === 200) {
alert('暫存成功');
console.log(res.data);
}
this.isLoading = false
}).catch(error => {
alert('儲存失敗!可能為以下錯誤:\n' + error.response.data)
this.isLoading = false
})
}
}
}
const contract_edit = () => {
console.log(contract_status);
return {
isLoading: false,
data: {
id: id,
repair_no: repair_no,
contractno: contractno,
company: company,
taxid: taxid,
facilityno: facilityno,
address: address,
type: type,
invoice: invoice,
repaireid: repaireid,
total_price: total_price,
sign_date: sign_date,
user_id: user_id,
contract_status: contract_status
},
fail_arr: [],
deleteFileFn(id) {
if (!confirm("確定要刪除嗎?")) return
this.data.files = this.data.files.filter(file => id != file.id)
this.data.deletefiles.push(id)
console.log(this.data.deletefiles);
},
save() {
this.isLoading = true
const form = new FormData();
form.append("id", this.data.id);
form.append("repair_no", this.data.repair_no);
form.append("contractno", this.data.contractno);
form.append("company", this.data.company);
form.append("taxid", this.data.taxid);
form.append("facilityno", this.data.facilityno);
form.append("address", this.data.address);
form.append("type", this.data.type);
form.append("invoice", this.data.invoice);
form.append("repaireid", this.data.repaireid);
form.append("total_price", this.data.total_price);
form.append("sign_date", this.data.sign_date);
form.append("user_id", user_id);
form.append("contract_status", this.data.contract_status);
form.append('contracttype', 'r');
axios.post("./api/putContractData.php", form).then(res => {
console.log(res);
if (res.status === 200) {
alert("更新成功");
window.location.reload();
}
this.isLoading = false
}).catch(error => {
console.log(this.data);
console.log(error);
let code = error.response.status;
if (code == 422) {
this.fail_arr = error.response.data
this.errorFn()
}
if (code == 500) {
alert("更新失敗!可能為以下錯誤:\n" + error.response.data)
}
this.isLoading = false
})
},
uploadFiles(e) {
this.data.newfiles = e.target.files
},
errorFn() {
let msg = ""
for (let i = 0; i < this.fail_arr.length; i++) {
msg += this.fail_arr[i] + "、"
}
alert(msg)
}
}
}

5
wms/contract-repair/js/alpinejs/cdn.min.js

File diff suppressed because one or more lines are too long

25
wms/contract-repair/js/axios.js

@ -0,0 +1,25 @@
const axiosClient = axios.create({
baseURL : `${import.meta.env.VITE_API_BASE_URL}/api`,
});
axiosClient.interceptors.request.use( (config)=> {
config.headers.Authorization = `Bearer ${store.state.user.token}`
return config;
}, (error)=> {
return Promise.reject(error);
});
axiosClient.interceptors.response.use( (response)=> {
return response;
}, (error)=>{
if(error.response.status === 401){
store.commit('setToken', null)
sessionStorage.removeItem('TOKEN')
router.push({name:'login'})
}
throw error;
});
export default axiosClient;

2
wms/contract-repair/js/axios/axios.min.js

File diff suppressed because one or more lines are too long

48
wms/contract-repair/js/el.js

@ -0,0 +1,48 @@
export default {
data() {
return {
options: [],
value: [],
list: [],
loading: false,
states: ["Alabama", "Alaska", "Arizona",
"Arkansas", "California", "Colorado",
"Connecticut", "Delaware", "Florida",
"Georgia", "Hawaii", "Idaho", "Illinois",
"Indiana", "Iowa", "Kansas", "Kentucky",
"Louisiana", "Maine", "Maryland",
"Massachusetts", "Michigan", "Minnesota",
"Mississippi", "Missouri", "Montana",
"Nebraska", "Nevada", "New Hampshire",
"New Jersey", "New Mexico", "New York",
"North Carolina", "North Dakota", "Ohio",
"Oklahoma", "Oregon", "Pennsylvania",
"Rhode Island", "South Carolina",
"South Dakota", "Tennessee", "Texas",
"Utah", "Vermont", "Virginia",
"Washington", "West Virginia", "Wisconsin",
"Wyoming"]
}
},
mounted() {
this.list = this.states.map(item => {
return { value: `value:${item}`, label: `label:${item}` };
});
},
methods: {
remoteMethod(query) {
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.options = [];
}
}
}
}

4
wms/contract-repair/js/jquery/jquery-3.1.1.min.js

File diff suppressed because one or more lines are too long

649
wms/contract-repair/prviewPdf.php

@ -0,0 +1,649 @@
<?php
include "../header.php";
require_once('./conn.php');
if ($_POST['list']) {
$contract_id = $_POST['contract_apply_id'];
if ($_POST['prviewType'] == 1) {
$isStand = ($_POST['buystandard'] == "true") ? 1 : 0;
} else {
$isStand = $_POST['installstandard'] == "true" ? 1 : 0;
}
$type = $_POST['prviewType'] == '1' ? "電梯買賣合約書" : "電梯安裝合約書";
$list = json_decode($_POST['list']);
$standardList = json_decode($_POST['standardList']);
$illustrate = $_POST['illustrate'];
$updatedIllustrate = false;
$standardIllustrate = $_POST['standardIllustrate'];
$partyA = $_POST['partyA'];
$partyAcontractno = $_POST['partyAcontractno'];
$total_price = $_POST['total_price'];
$person = $_POST['person'];
$personid = $_POST['personid'];
$delivery_term = $_POST['delivery_term'];
$install_period = $_POST['install_period'];
$free_maintainance = $_POST['free_maintainance'];
// $originArr = array_filter(json_decode(json_encode($list), true), fn($item)=> $item['origin'] == 1);
$standardArr = json_decode(json_encode($standardList), true);
$nostandardArr = json_decode(json_encode($list), true);
$newlist = array_values(array_filter($list, fn ($item) => $item->deleted == 0));
foreach ($nostandardArr as $idx => &$item) {
if ($item['origin'] === 1) {
if (strip_tags($item['text']) != strip_tags($standardArr[$item['id']]['text'])) {
$item['updated'] = 1;
} else {
$item['updated'] = 0;
}
}
}
unset($item);
if (strip_tags($illustrate) != strip_tags($standardIllustrate)) {
$updatedIllustrate = true;
}
$sql_str = "SELECT * FROM hope_elevator_customer WHERE vol_no = :vol_no";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':vol_no', $partyAcontractno);
$stmt->execute();
$customer = $stmt->fetch(PDO::FETCH_ASSOC);
if (count($customer) <= 0) {
echo "<script>
alert('資料不齊或合約書已生成過。');
window.history.back();
</script>";
}
$sql_str = "SELECT file_name FROM contract_apply_files WHERE contract_id = :contract_id AND deleted_at IS NULL";
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contract_id', $contract_id);
$stmt->execute();
$files = $stmt->fetchAll(PDO::FETCH_ASSOC);
function numberToChinese($num)
{
$chineseNumbers = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
$units = ['', '十', '百', '千', '万'];
if ($num <= 10) {
return $chineseNumbers[$num];
} elseif ($num < 20) {
return $units[1] . $chineseNumbers[$num % 10];
} elseif ($num < 100) {
return $chineseNumbers[intval($num / 10)] . $units[1] . ($num % 10 > 0 ? $chineseNumbers[$num % 10] : '');
} else {
// 處理大於 99 的数字
$result = '';
$strNum = strval($num);
$length = strlen($strNum);
for ($i = 0; $i < $length; $i++) {
$currentDigit = intval($strNum[$i]);
if ($currentDigit > 0) {
$result .= $chineseNumbers[$currentDigit] . $units[$length - $i - 1];
} else {
$result .= $chineseNumbers[$currentDigit];
}
}
return $result;
}
}
function removeTrailingBr($string)
{
//刪除字串尾巴的<br><br />
return preg_replace('/(<br\s*\/?>)+$/', '', $string);
}
?>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<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 src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.3.3/purify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.3/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js" integrity="sha512-E8QSvWZ0eCLGk4km3hxSsNmGWbLtSCSUcewDQPQWZF6pEU8GlT8a5fF32wOl1i8ftdMhssTrF/OhyGWwonTcXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
.container {
background-color: transparent !important;
width: 100% !important;
}
.prview,
.footer {
width: 800px;
border: 1px #ccc solid;
padding: 20px;
font-family: '標楷體';
}
.prview.none {
display: none;
}
.prview h2 {
font-size: 18pt;
text-align: center;
}
.prview p {
font-size: 12pt;
margin: 0;
padding: 0;
}
td tr table th {
border: none !important;
background-color: #fff !important;
}
tr:nth-child(even) {
background-color: #fff !important;
}
.colorDiv {
display: flex;
margin: 10px 0;
}
.colorDiv .block {
width: 18px;
height: 18px;
}
.colorDiv span {
font-size: 15px;
margin: 0 5px 0 2px;
font-weight: 600;
}
.colorDiv .block.gray {
background-color: #DDDDDD;
}
.colorDiv .block.green {
background-color: #00B900;
}
.colorDiv .block.red {
background-color: #D11919;
}
#btn,
.pre {
background-color: #0D559D;
color: #fff;
outline: none;
border: none;
border: 1px #ccc solid;
width: 100px;
height: 32px;
font-weight: 600;
border-radius: 6px;
margin-right: 5px;
}
.pre {
background-color: #40C474;
}
</style>
<div class="container" x-data="{
css:'',
random:'',
init(){
const characters = '012345678901234567890123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
const charactersLength = characters.length;
let randomString = '';
const length = 15;
for (let i = 0; i < length; i++) {
const randomIndex = Math.floor(Math.random() * charactersLength);
randomString += characters.charAt(randomIndex);
}
this.random = randomString;
console.log(files);
},
exportFn(){
const now = new Date();
// 獲取年、月、日、小時、分鐘、秒
const year = now.getFullYear();
const month = now.getMonth() + 1; // 月份是從0開始的,所以要加1
const day = now.getDate();
const hours = now.getHours();
const minutes = now.getMinutes();
const seconds = now.getSeconds();
// 格式化日期和時間
const formattedDate = `${year}${month}${day}${hours}${minutes}${seconds}`;
let token = formattedDate + '<?php echo $partyAcontractno; ?><?php echo $partyA; ?>永佳捷<?php echo $total_price; ?>'
let newtoken = formattedDate + '-' + CryptoJS.MD5(CryptoJS.SHA256(CryptoJS.SHA256(CryptoJS.MD5(token).toString()).toString() + this.random).toString()).toString()
console.log(newtoken);
let html = this.$refs.prview.innerHTML
let footer = this.$refs.footer.innerHTML
let affix1 = this.$refs.affix1.innerHTML
// html = this.$refs.footer.innerHTML
// axios.post('./export-pdf.php', {'html':html}).then(res=>{
// console.log(res);
// })
const form = new FormData();
form.append('html', html);
form.append('footer', footer);
form.append('affix1', affix1);
form.append('css',this.css);
form.append('user_name', '<?php echo $user_name; ?>');
form.append('contract_no', '<?php echo $partyAcontractno; ?>');
form.append('party_a', '<?php echo $partyA; ?>');
form.append('total_price', '<?php echo $total_price; ?>');
form.append('person', '<?php echo $person; ?>');
form.append('token', newtoken);
form.append('formattedDate', formattedDate);
axiosClient({
method:'post',
responseType:'blob',
url:'./export-pdf.php',
data:form
}).then(response=>{
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', formattedDate + '.pdf'); // 指定下载的文件名
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.store(newtoken, formattedDate)
for(let i=0;i<files.length;i++){
let filename = document.createElement('a');
filename.href = './images/contracts_new_files/' + files[i].file_name;
filename.setAttribute('download', filename.href); // 指定下载的文件名
document.body.appendChild(filename);
filename.click();
document.body.removeChild(filename);
}
})
},
store(newtoken, formattedDate){
const form = new FormData();
form.append('contract_id', '<?php echo $partyAcontractno; ?>')
form.append('uscc', '<?php echo $customer['uscc']; ?>')
form.append('ekind', '新梯')
form.append('new_elevator', '<?php $_POST['prviewType'] == '1' ? "買賣" : "安裝"; ?>')
form.append('party_a', '<?php echo $partyA; ?>')
form.append('total_price', <?php echo (int)$total_price; ?>)
form.append('accound_id', '<?php echo $personid; ?>')
form.append('times', 1)
form.append('random', this.random)
form.append('hash', newtoken)
form.append('url', formattedDate+'.pdf' );
form.append('created_by', '<?php echo $user_id; ?>')
form.append('delivery_term', '<?php echo $delivery_term; ?>')
form.append('install_period', '<?php echo $install_period; ?>')
form.append('free_maintainance', '<?php echo $free_maintainance; ?>')
axiosClient({
method:'post',
url:'./store-contract.php',
data:form
}).then(res=>{
console.log(res);
})
},
}">
<button @click="history.go(-1)" class="pre">回前頁</button>
<button id="btn" @click="exportFn()">點我下載</button>
<?php if ($isStand == 0) { ?>
<div class="colorDiv">
<div class="block gray"></div>
<span>修改的條列</span>
<div class="block green"></div>
<span>新增的條列</span>
<div class="block red"></div>
<span>刪除的條列</span>
</div>
<?php } ?>
<div class="prview" id="prview" x-ref="prview" style="font-family:'標楷體'" x-show="false">
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2>
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p>
<table>
<tr>
<td style="width:100px"></td>
<td style="width:200px"><?php echo $_POST['partyA'] ?></td>
<td>(即買方,以下簡稱為甲方)</td>
</tr>
</table>
<p style="font-size: 12pt;">立合約書人</p>
<table>
<tr>
<td style="width:100px"></td>
<td style="width:200px">永佳捷科技股份有限公司</td>
<td>(即賣方,以下簡稱為乙方)</td>
</tr>
</table>
<p style="font-size: 12pt;width:440px"><?php echo $illustrate; ?></p>
<table style="width:100%">
<?php foreach ($newlist as $idx => $item) {
?>
<tr style="display:block;">
<td style="width:60px;"><?php echo numberToChinese($idx + 1); ?></td>
<td style="width:445px;"><?php echo nl2br(removeTrailingBr(json_decode(json_encode($item), true)['text'])); ?></td>
</tr>
<?php } ?>
</table>
</div>
<section style="display:flex;justify-content:center;">
<div class="prview" style="font-family:'標楷體';background-color:#fff;">
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2>
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px;"></td>
<td style="border:none;width:200px"><?php echo $_POST['partyA'] ?></td>
<td style="border:none">(即買方,以下簡稱為甲方)</td>
</tr>
</table>
<p style="font-size: 12pt;">立合約書人</p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px"></td>
<td style="border:none;width:200px">永佳捷科技股份有限公司</td>
<td style="border:none">(即賣方,以下簡稱為乙方)</td>
</tr>
</table>
<p style="font-size: 12pt;width:800px"><?php echo $standardIllustrate; ?></p>
<table style="width:100%;border:none">
<?php foreach ($standardList as $idx => $item) {
?>
<tr style="margin-bottom:10px;display:block;border:none">
<td style="width:100px;border:none"><?php echo numberToChinese($idx + 1); ?></td>
<td style="border:none"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
</tr>
<?php } ?>
</table>
</div>
<?php if ($isStand == 0) { ?>
<div class="prview nostandard" style="font-family:'標楷體'" x-ref="nostandard">
<h2 style="text-align:center;font-size:18pt;"><?php echo $type; ?></h2>
<p style="font-size: 12pt;">合約書編號:<?php echo $_POST['partyAcontractno'] ?></p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px;"></td>
<td style="border:none;width:200px"><?php echo $_POST['partyA'] ?></td>
<td style="border:none">(即買方,以下簡稱為甲方)</td>
</tr>
</table>
<p style="font-size: 12pt;">立合約書人</p>
<table style="border:none">
<tr style="border:none;">
<td style="border:none;width:100px"></td>
<td style="border:none;width:200px">永佳捷科技股份有限公司</td>
<td style="border:none">(即賣方,以下簡稱為乙方)</td>
</tr>
</table>
<p style="font-size: 12pt;width:800px;<?php if ($updatedIllustrate) {
echo 'background-color:#ddd';
} ?>"><?php echo $illustrate; ?></p>
<table style="width:100%;border:none">
<?php foreach ($nostandardArr as $idx => $item) {
?>
<tr style="margin-bottom:10px;display:block;border:none">
<td style="width:100px;border:none"><?php echo numberToChinese($idx + 1); ?></td>
<?php if ($item['updated'] == 1) { ?>
<td style="border:none;background-color:#ddd;"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
<?php } elseif ($item['deleted'] == 1) { ?>
<td style="border:none;background-color:#D11919;text-decoration:line-through"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
<?php } elseif ($item['id'] > 15) { ?>
<td style="border:none;background-color:#00B900;"><?php echo nl2br(json_decode(json_encode($item), true)['text']); ?></td>
<?php } else { ?>
<td style="border:none"><?php echo nl2br(removeTrailingBr(json_decode(json_encode($item), true)['text'])); ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
</section>
<div class="footer" x-ref="footer" x-show="false">
<br />
<p> 立合約書人:</p>
<table>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;<?php echo $_POST['partyA']; ?></td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:20px;border:none;"></td>
<td style="width:20px;border:none;text-align:center"></td>
<td style="width:20px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
<td style="border:none">&nbsp;<?php echo $customer['manager']; ?></td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:15px;border:none;"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
<td style="border:none">&nbsp;<?php echo $customer['uscc']; ?></td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none;"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
<td style="border:none">&nbsp;<?php echo $customer['address']; ?></td>
</tr>
</table>
<p style="line-height:0.1">&nbsp;</p>
<table>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;永佳捷科技股份有限公司</td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:20px;border:none;"></td>
<td style="width:20px;border:none;text-align:center"></td>
<td style="width:20px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;蔡定憲</td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:15px;border:none;"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:center"></td>
<td style="width:15px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;90493119</td>
</tr>
<tr style="line-height:2">
<td style="width:100px;border:none">
<table>
<tr>
<td style="width:30px;border:none;"></td>
<td style="width:30px;border:none;text-align:right"></td>
<td style="width:10px;border:none;text-align:right">:</td>
</tr>
</table>
</td>
<td style="border:none">&nbsp;臺北市中山區敬業一路128巷39號3樓之1</td>
</tr>
</table>
<p>&nbsp;</p>
<!-- <table>
<tr>
<td style="width:200px;border:none;text-align:justify">中華民國</td>
<td style="width:100px;border:none;text-align:right"></td>
<td style="width:100px;border:none;text-align:right"></td>
<td style="width:100px;border:none;text-align:right"></td>
</tr>
</table> -->
</div>
<div class="affix1" x-ref="affix1" x-show="false">
<h1 style="text-align:center">升降設備除外工程表</h1>
<table>
<tr>
<td style="width:40px">一、</td>
<td>機械室之建造,含預留出入口、通風照明、自動閉鎖裝置,及天花板上之保養用吊鉤。</td>
</tr>
<tr>
<td style="width:40px">二、</td>
<td style="width:460px">通往機械室之樓梯及加護欄杆工程。</td>
</tr>
<tr>
<td style="width:40px">三、</td>
<td style="width:460px">機械室基礎台需用防濕之瀝青鐵筋混凝土及地板防塵工事。</td>
</tr>
<tr>
<td style="width:40px">四、</td>
<td style="width:460px">機械室及升降路中間之橫樑或工字樑之安裝工程。</td>
</tr>
<tr>
<td style="width:40px">五、</td>
<td style="width:460px">自屋外至機械室之動力及照明用配線電源開關插座,及接地線等電路工程。</td>
</tr>
<tr>
<td style="width:40px">六、</td>
<td style="width:460px">升降路及機械室以外監視盤、電鈴、電話之配管與配線工程。</td>
</tr>
<tr>
<td style="width:40px">七、</td>
<td style="width:460px">升降路之建造及底部之防水工程及緩衝器水泥台工程。</td>
</tr>
<tr>
<td style="width:40px">八、</td>
<td style="width:460px">機坑照明保養用之開關及插座,鐵爬梯。</td>
</tr>
<tr>
<td style="width:40px">九、</td>
<td style="width:460px">各樓按鈕開關之留洞工程及安裝後之固定與週邊裝飾工程。</td>
</tr>
<tr>
<td style="width:40px">十、</td>
<td style="width:460px">升降路內甲方不得裝設有任何與升降設備無關之配線、電線配管、水管、風管等設備。</td>
</tr>
<tr>
<td style="width:40px">十一、</td>
<td style="width:460px">安裝所需水泥、砂石、水電與供試車用動力電源。</td>
</tr>
<tr>
<td style="width:40px">十二、</td>
<td style="width:460px">升降路及機房之建造,電源設備之容量及位置等,需符合國家標準(CNS-2866)及建築法規等規定。</td>
</tr>
<tr>
<td style="width:40px">十三、</td>
<td style="width:460px">機械運抵工地後供給儲存倉庫。</td>
</tr>
<tr>
<td colspan="2">備註:CNS-2866國家標準建築物電梯有關之法規: </td>
</tr>
<tr>
<td style="width:25px">1.</td>
<td style="width:475px">機械室內應設有照明及通風設備,以利管理檢查,照明應在100LUX(米一燭光)以上,通風設備應能使室內溫度保持在攝氏40度以下。</td>
</tr>
<tr>
<td style="width:25px">2.</td>
<td style="width:475px">機械室之出入口應加鎖,其裝置應良好。 </td>
</tr>
<tr>
<td style="width:25px">3.</td>
<td style="width:475px">由機械室至走廊,樓梯間應便於通行,樓梯應加裝扶手,其與水平面之傾斜角度,應不超過60度。 </td>
</tr>
<tr>
<td style="width:25px">4.</td>
<td style="width:475px">機械室出入門之構造,應有下述裝置: <br>
A:能自動關閉者。 <br>
B:有彈簧鎖或其類似裝置,以便室內不用鎖匙,而能開門。 <br>
C:除屋頂開口部份以外,機械式牆壁,應能耐火。(二小時防火時效)
</td>
</tr>
<tr>
<td style="width:25px">5.</td>
<td style="width:475px">升降路內不得設置與升降機無關之配管及配線。 </td>
</tr>
<tr>
<td style="width:25px">6.</td>
<td style="width:475px">任一升降路下部之任何部份,供人使用或類似使用時配重側比照車廂,同樣必須裝設緊急安全裝置。</td>
</tr>
<tr>
<td style="width:25px">7.</td>
<td style="width:475px">若有火警受信總機時,甲方需提供"火警受信總機"檢出信號及通往升降道內之配管配線(0.75MM² × 3) </td>
</tr>
</table>
</div>
</div>
<script>
const files = <?php echo json_encode($files); ?>;
const axiosClient = axios.create({
baseURL: ``,
});
axiosClient.interceptors.request.use((config) => {
config.headers.Authorization = `Bearer ${123}`
return config;
}, (error) => {
return Promise.reject(error);
});
axiosClient.interceptors.response.use((response) => {
return response;
}, (error) => {
if (error.response.status === 401) {}
throw error;
});
const btn = document.getElementById('btn')
console.log(<?php echo $contract_id; ?>);
</script>
<?php
} else {
echo "<script>alert('非法訪問!');window.history.back();</script>";
}
?>

5
wms/contract-repair/semantic/.browserlistrc

@ -0,0 +1,5 @@
last 2 versions
> 1%
opera 12.1
bb 10
android 4

322
wms/contract-repair/semantic/.csscomb.json

@ -0,0 +1,322 @@
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "upper",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"leading-zero": true,
"space-after-colon": " ",
"space-before-combinator": " ",
"space-after-combinator": " ",
"space-between-declarations": "\n",
"space-before-opening-brace": " ",
"space-after-opening-brace": "\n",
"space-after-selector-delimiter": "\n",
"space-before-selector-delimiter": "",
"space-before-closing-brace": "\n",
"strip-spaces": true,
"tab-size": true,
"vendor-prefix-align": true,
"sort-order": [
[
"display",
"visibility",
"float",
"clear",
"overflow",
"overflow-x",
"overflow-y",
"-webkit-box-sizing",
"-moz-box-sizing",
"box-sizing",
"-ms-overflow-x",
"-ms-overflow-y",
"clip",
"zoom",
"flex-direction",
"flex-order",
"flex-pack",
"flex-align"
],
[
"position",
"z-index",
"top",
"right",
"bottom",
"left"
],
[
"font",
"font-family",
"font-size",
"font-weight",
"font-style",
"font-variant",
"font-size-adjust",
"font-stretch",
"font-effect",
"font-emphasize",
"font-emphasize-position",
"font-emphasize-style",
"font-smooth",
"line-height"
],
[
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
],
[
"table-layout",
"empty-cells",
"caption-side",
"border-spacing",
"border-collapse",
"list-style",
"list-style-position",
"list-style-type",
"list-style-image"
],
[
"opacity",
"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
"-ms-interpolation-mode",
"color",
"border",
"border-width",
"border-style",
"border-color",
"border-top",
"border-top-width",
"border-top-style",
"border-top-color",
"border-right",
"border-right-width",
"border-right-style",
"border-right-color",
"border-bottom",
"border-bottom-width",
"border-bottom-style",
"border-bottom-color",
"border-left",
"border-left-width",
"border-left-style",
"border-left-color",
"-webkit-border-radius",
"-moz-border-radius",
"border-radius",
"-webkit-border-top-left-radius",
"-moz-border-radius-topleft",
"border-top-left-radius",
"-webkit-border-top-right-radius",
"-moz-border-radius-topright",
"border-top-right-radius",
"-webkit-border-bottom-right-radius",
"-moz-border-radius-bottomright",
"border-bottom-right-radius",
"-webkit-border-bottom-left-radius",
"-moz-border-radius-bottomleft",
"border-bottom-left-radius",
"-webkit-border-image",
"-moz-border-image",
"-o-border-image",
"border-image",
"-webkit-border-image-source",
"-moz-border-image-source",
"-o-border-image-source",
"border-image-source",
"-webkit-border-image-slice",
"-moz-border-image-slice",
"-o-border-image-slice",
"border-image-slice",
"-webkit-border-image-width",
"-moz-border-image-width",
"-o-border-image-width",
"border-image-width",
"-webkit-border-image-outset",
"-moz-border-image-outset",
"-o-border-image-outset",
"border-image-outset",
"-webkit-border-image-repeat",
"-moz-border-image-repeat",
"-o-border-image-repeat",
"border-image-repeat",
"outline",
"outline-width",
"outline-style",
"outline-color",
"outline-offset",
"background",
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
"background-color",
"background-image",
"background-repeat",
"background-attachment",
"background-position",
"background-position-x",
"-ms-background-position-x",
"background-position-y",
"-ms-background-position-y",
"-webkit-background-clip",
"-moz-background-clip",
"background-clip",
"background-origin",
"-webkit-background-size",
"-moz-background-size",
"-o-background-size",
"background-size",
"box-decoration-break",
"-webkit-box-shadow",
"-moz-box-shadow",
"box-shadow",
"filter:progid:DXImageTransform.Microsoft.gradient",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
"text-shadow"
],
[
"content",
"quotes",
"counter-reset",
"counter-increment",
"resize",
"cursor",
"-webkit-user-select",
"-moz-user-select",
"-ms-user-select",
"user-select",
"nav-index",
"nav-up",
"nav-right",
"nav-down",
"nav-left",
"-webkit-transition",
"-moz-transition",
"-ms-transition",
"-o-transition",
"transition",
"-webkit-transition-delay",
"-moz-transition-delay",
"-ms-transition-delay",
"-o-transition-delay",
"transition-delay",
"-webkit-transition-timing-function",
"-moz-transition-timing-function",
"-ms-transition-timing-function",
"-o-transition-timing-function",
"transition-timing-function",
"-webkit-transition-duration",
"-moz-transition-duration",
"-ms-transition-duration",
"-o-transition-duration",
"transition-duration",
"-webkit-transition-property",
"-moz-transition-property",
"-ms-transition-property",
"-o-transition-property",
"transition-property",
"-webkit-transform",
"-moz-transform",
"-ms-transform",
"-o-transform",
"transform",
"-webkit-transform-origin",
"-moz-transform-origin",
"-ms-transform-origin",
"-o-transform-origin",
"transform-origin",
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-name",
"-moz-animation-name",
"-ms-animation-name",
"-o-animation-name",
"animation-name",
"-webkit-animation-duration",
"-moz-animation-duration",
"-ms-animation-duration",
"-o-animation-duration",
"animation-duration",
"-webkit-animation-play-state",
"-moz-animation-play-state",
"-ms-animation-play-state",
"-o-animation-play-state",
"animation-play-state",
"-webkit-animation-timing-function",
"-moz-animation-timing-function",
"-ms-animation-timing-function",
"-o-animation-timing-function",
"animation-timing-function",
"-webkit-animation-delay",
"-moz-animation-delay",
"-ms-animation-delay",
"-o-animation-delay",
"animation-delay",
"-webkit-animation-iteration-count",
"-moz-animation-iteration-count",
"-ms-animation-iteration-count",
"-o-animation-iteration-count",
"animation-iteration-count",
"-webkit-animation-direction",
"-moz-animation-direction",
"-ms-animation-direction",
"-o-animation-direction",
"animation-direction",
"text-align",
"-webkit-text-align-last",
"-moz-text-align-last",
"-ms-text-align-last",
"text-align-last",
"vertical-align",
"white-space",
"text-decoration",
"text-emphasis",
"text-emphasis-color",
"text-emphasis-style",
"text-emphasis-position",
"text-indent",
"-ms-text-justify",
"text-justify",
"letter-spacing",
"word-spacing",
"-ms-writing-mode",
"text-outline",
"text-transform",
"text-wrap",
"text-overflow",
"-ms-text-overflow",
"text-overflow-ellipsis",
"text-overflow-mode",
"-ms-word-wrap",
"word-wrap",
"word-break",
"-ms-word-break",
"-moz-tab-size",
"-o-tab-size",
"tab-size",
"-webkit-hyphens",
"-moz-hyphens",
"hyphens",
"pointer-events"
]
]
}

18
wms/contract-repair/semantic/.csslintrc

@ -0,0 +1,18 @@
{
"vendor-prefix" : true,
"duplicate-properties" : true,
"display-property-grouping" : true,
"empty-rules" : true,
"adjoining-classes" : false,
"box-model" : false,
"compatible-vendor-prefixes" : false,
"box-sizing" : false,
"duplicate-background-images" : false,
"floats" : false,
"important" : false,
"overqualified-elements" : false,
"rules-count" : false,
"shorthand" : false,
"zero-units" : false
}

24
wms/contract-repair/semantic/.github/ISSUE_TEMPLATE.md

@ -0,0 +1,24 @@
✖ USAGE QUESTIONS → Use these dedicated resources:
Docs - http://www.semantic-ui.com
Chat - https://gitter.im/Semantic-Org/Semantic-UI
SO - https://stackoverflow.com/questions/tagged/semantic-ui?sort=votes
✔ Enhancements → Be specific. Assume backwards compatibility is a necessity. Suggest implementation when possible.
✔ BUGS → ❤❤❤. Keep in mind some bugs may not be immediately fixable due to backwards compatibility or CSS limitations.
### Title (Put in field above)
Use the format: [Component] Component Should Do X
i.e. [Checkbox] onChange Should Fire When Update Triggered via DOM
### Steps
### Expected Result
### Actual Result
### Version
x.y.z
### Testcase
[Fork, update, and replace to show the bug]:
https://jsfiddle.net/ca0rovs3/

28
wms/contract-repair/semantic/.github/PULL_REQUEST_TEMPLATE.md

@ -0,0 +1,28 @@
✖ Multiple features in one PR
✖ New Components Unless Previously Discussed with Maintainers (Consider creating separate repo, I'll link out to you)
✔ Add comments to complex/confusing code in "code" view of PR
✔ BUGS → This form is required:
✔ Enhancements → Only specific enhancements with detailed descriptions.
### Issue Titles
Use the format: [Component] Adds Support for Thing
For example: [Build Tools] Adds Source Map Support
Or: [Button] Fixes Inheritance for Red Basic Active State
### Closed Issues
#222 #333 #444
### Description
### Testcase
[Show before with this fiddle]
https://jsfiddle.net/ca0rovs3/
[Consider showing "fixed" case with your fiddle]()
You can link to your JS using https://rawgit.com/

33
wms/contract-repair/semantic/.github/stale.yml

@ -0,0 +1,33 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 90
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
There has been no activity in this thread for 90 days. While we care about
every issue and we’d love to see this fixed, the core team’s time is
limited so we have to focus our attention on the issues that are most
pressing. Therefore, we will likely not be able to get to this one.
However, PRs for this issue will of course be accepted and welcome!
If there is no more activity in the next 90 days, this issue will be closed
automatically for housekeeping. To prevent this, simply leave a reply here.
Thanks!
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue will be closed due to lack of activity for 6 months. If you’d
like this to be reopened, just leave a comment; we do monitor them!

38
wms/contract-repair/semantic/.gitignore

@ -0,0 +1,38 @@
node_modules/
test/coverage/
coverage/
src/**/site/
theme.config
semantic.json
tasks/**/oauth.js
package-lock.json
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.zip
*.vi
*~
*.sass-cache
*.ruby-version
# OS or Editor folders
.DS_Store
._*
Thumbs.db
.cache
.project
.settings
.tmproj
.docpad.db
*.esproj
nbproject
*.sublime-project
*.sublime-workspace
.build*
.idea

38
wms/contract-repair/semantic/.jshintrc

@ -0,0 +1,38 @@
{
"globals": {
"$" : true,
"afterEach" : true,
"AnimatedPNG" : true,
"beforeEach" : true,
"console" : true,
"describe" : true,
"expect" : true,
"it" : true,
"jQuery" : true,
"loadFixtures" : true,
"module" : true,
"requestAnimationFrame" : true,
"require" : true,
"semantic" : true
},
"debug" : false,
"devel" : true,
"browser" : true,
"curly" : true,
"immed" : true,
"latedef" : true,
"loopfunc" : true,
"noarg" : true,
"undef" : true,
"sub" : true,
"loopfunc" : true,
"laxbreak" : true,
"evil" : true,
"indent" : false,
"trailing" : false
}

58
wms/contract-repair/semantic/CONTRIBUTING.md

@ -0,0 +1,58 @@
# Contributing to Semantic UI
### Usage Questions
Questions about usage should be asked in our [Gitter chatroom](https://gitter.im/Semantic-Org/Semantic-UI), on [Semantic UI forums](http://forums.semantic-ui.com) or [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui).
Examples of usage questions
* *Why isn't my code working?*
* *Can Semantic UI do this?*
Once you receive feedback through community channels you may find your question is actually a bug. At this point it's a good idea to submit it as a bug report. Just keep in mind the following suggestions.
### Creating Bug Reports
[Github Issues Tracker](https://github.com/Semantic-Org/Semantic-UI/issues) is used to track all upcoming milestones and changes to the project.
**Please create a fork of this [JSFiddle](https://jsfiddle.net/ca0rovs3/) to demonstrate bugs.**
When submiting a bug report, include a set of steps to reproduce the issue and any related information, browser, OS etc. If we can't reproduce the issue then it will make solving things much more difficult.
If your bug uses a third party framework like Ember, Meteor, or Angular. Be sure to submit the issue to their respective issues boards. If you are confident the bug is part of the 'vanilla' SUI release, keep in mind not all maintainers are familiar with all framework and a simple test case is greatly appreciated.
If your bug is reproduced by a maintainer it will be assigned the [`confirmed bug`](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aopen+is%3Aissue+label%3A%22Confirmed+Bug%22) tag. Browsing this tag is a good way to keep track of known issues with SUI.
#### Naming Issues
Semantic UI boards use a special naming convention to help tag issue titles by the component the issue is related to.
##### Bugs
Please tag titles in the format "[Component] *Sub-type* should do *correct behavior*". Please use standard [title case](http://www.titlecase.com) for titles, including the bracketed tag.
For example
* [Dropdown] Multiple Selection Should Preserve "Set Selected" Order
* [Validation] - E-mail Validation Should Handle Cyrillic
* [Button] - Grouped Buttons Should Display Correctly on Mobile
##### Enhancements
For new feature requests, you can use the format "[Component] Add *new feature*"
For example
* [Dropdown] Add "Clearable" Setting
* [Validation] Add Rules for Zipcode Validation
* [API] Add "onProgress" callback setting
### Tracking Issue Progress
As bugs and features are triaged they will be assigned to milestones. The best indication of when a change will land is to check the date on the [upcoming milestones](https://github.com/Semantic-Org/Semantic-UI/milestones) page.
### Creating Pull Requests
**All pull requests should be merged into the `next` branch.**
Anyone can jump on the issues board and grab off bugs to fix. This is probably the best way to become a contributor to Semantic. Be sure to adhere to the style guides when submitting code.
* [Create a Pull Request](https://github.com/Semantic-Org/Semantic-UI/compare)
* [View Open Issues](https://github.com/Semantic-Org/Semantic-UI/issues)

7
wms/contract-repair/semantic/LICENSE.md

@ -0,0 +1,7 @@
# The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

112
wms/contract-repair/semantic/README.md

@ -0,0 +1,112 @@
![Semantic](http://semantic-ui.com/images/logo.png)
# Semantic UI
[![Join the chat at https://gitter.im/Semantic-Org/Semantic-UI](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Semantic-Org/Semantic-UI?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![CDNJS](https://img.shields.io/cdnjs/v/semantic-ui.svg)](https://cdnjs.com/libraries/semantic-ui/)
[Semantic](http://www.semantic-ui.com) is a UI framework designed for theming.
Key Features
* 50+ UI elements
* 3000 + CSS variables
* 3 Levels of variable inheritance (similar to SublimeText)
* Built with EM values for responsive design
* Flexbox friendly
Semantic allows developers to build beautiful websites fast, with **concise HTML**, **intuitive javascript**, and **simplified debugging**, helping make front-end development a delightful experience. Semantic is responsively designed allowing your website to scale on multiple devices. Semantic is production ready and partnered with frameworks such as **React**, **Angular**, **Meteor**, and **Ember**, which means you can integrate it with any of these frameworks to organize your UI layer alongside your application logic.
## 2.5.0 Release (Oct 6, 2022)
Semantic UI is now compatible with Node 18 and Gulp 4.
## User Support
Please help us keep the issue tracker organized. For technical questions that do not include a specific [JSFiddle test case](https://jsfiddle.net/ca0rovs3/) (bug reports), or feature request please use [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui) to find a solution.
Visit our [contributing guide](https://github.com/Semantic-Org/Semantic-UI/blob/master/CONTRIBUTING.md) for more on what should be posted to GitHub Issues.
## Install
#### Recommended Install
```bash
npm install semantic-ui # Use themes, import build/watch tasks into your own gulpfile.
```
Semantic UI includes an interactive installer to help setup your project.
* For more details on setup visit our [getting started guide](http://semantic-ui.com/introduction/getting-started.html).
* To learn more about theming please read our [theming guide](http://www.semantic-ui.com/usage/theming.html)
#### Additional Versions
Environment | Install Script | Repo
--- | --- | --- |
CSS Only | `npm install semantic-ui-css` | [CSS Repo](https://github.com/Semantic-Org/Semantic-UI-CSS)
[LESS](https://github.com/less/less.js/) Only | `npm install semantic-ui-less` | [LESS Repo](https://github.com/Semantic-Org/Semantic-UI-LESS)
[LESS](https://github.com/less/less.js/) plugin | `npm install less-plugin-semantic-ui` | [LESS Plugin Repo](https://github.com/bassjobsen/less-plugin-semantic-ui/)
[EmberJS](http://emberjs.com/) | `ember install:addon semantic-ui-ember` | [Ember Repo](https://github.com/Semantic-Org/Semantic-UI-Ember)
|[Meteor](https://www.meteor.com/) - [LESS](https://github.com/less/less.js/) | `meteor add semantic:ui` | [Meteor Repo](https://github.com/Semantic-Org/Semantic-UI-Meteor) |
|[Meteor](https://www.meteor.com/) - CSS | `meteor add semantic:ui-css` | [CSS Repo](https://github.com/Semantic-Org/Semantic-UI-CSS) |
[Bower](http://bower.io/) | `bower install semantic-ui` |
Check out our [integration wiki](https://github.com/Semantic-Org/Semantic-UI/wiki/Integration) for more options.
#### Browser Support
* Last 2 Versions FF, Chrome, Safari Mac
* IE 11+
* Android 4.4+, Chrome for Android 44+
* iOS Safari 7+
* Microsoft Edge 12+
Although some components will work in IE9, [grids](http://semantic-ui.com/collections/grid.html) and other [flexbox](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes) components are not supported by IE9 and may not appear correctly.
## Community
#### Getting Help
Please **do not post** usage questions to GitHub Issues. For these types of questions use our [Gitter chatroom][Gitter.im Room] or [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui).
#### Submitting Bugs and Enhancements
[GitHub Issues](https://github.com/Semantic-Org/Semantic-UI/issues) is for suggesting enhancements and reporting bugs. Before submiting a bug make sure you do the following:
* Check out our [contributing guide](https://github.com/Semantic-Org/Semantic-UI/blob/master/CONTRIBUTING.md) for info on our release cycle.
* [Fork this boilerplate JSFiddle](https://jsfiddle.net/ca0rovs3/) to create a test case for your bug. If a bug is apparent in the docs, that's ok as a test case, just make it clear exactly how to reproduce the issue. Only bugs that include a test case can be triaged.
#### Pull Requests
When adding pull requests, be sure to merge into the [next](https://github.com/Semantic-Org/Semantic-UI/tree/next) branch. If you need to demonstrate a fix in ``next`` release, you can use [this JSFiddle](https://jsfiddle.net/ca0rovs3/)
#### International
* **Chinese** A Chinese mirror site is available at [http://www.semantic-ui.cn](http://www.semantic-ui.cn).
* **Right-to-Left (RTL)** An RTL version can be created using our build tools by selecting `rtl` from the install script.
* **Translation** To help translate see the [Wiki Guide](https://github.com/Semantic-Org/Semantic-UI/wiki/Translating-Semantic-UI-Docs) for translations.
#### Resources
Resource | Description
--- | --- |
Bugs & Feature Requests | All bug submission **require** a link to a test case, and a set of steps to reproduce the issue. You can make a test case by forking this [JSFiddle](https://jsfiddle.net/ca0rovs3/), then submit your [bug report on GitHub Issues](https://github.com/Semantic-Org/Semantic-UI/issues)
Live Chat | Join our [Gitter.im Room][Gitter.im Room]
Newsletter Updates | Sign up for updates at [semantic-ui.com](http://www.semantic-ui.com)
Additional Resources | Submit a question on [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui) or ask our [Google Group](https://groups.google.com/forum/#!forum/semantic-ui)
#### Places to Help
Project | How To Help | Next Step
--- | --- | --- |
Localization | Help us translate Semantic UI into your language | [Join our Translation Community](https://github.com/Semantic-Org/Semantic-UI/wiki/Translating-Semantic-UI-Docs)
[SCSS](http://sass-lang.com/) | SASS needs PR to support variables inside `@import` | [Add Pull Request](https://github.com/sass/sass/pulls) for [#739](https://github.com/sass/sass/issues/739#issuecomment-73984809)
[Angular](https://angularjs.org/) | Help develop angular bindings | Reach Out on [GitHub Issues](https://github.com/Semantic-Org/Semantic-UI-Angular/issues/8)
Guides & Tutorials | Help write guides and tutorials | [Join the discussion](https://github.com/Semantic-Org/Semantic-UI/issues/1571)
#### Reaching Out
If you'd like to start a conversation about Semantic feel free to e-mail me at [jack@semantic-ui.com](mailto:jack@semantic-ui.com)
<a href="http://packagequality.com/#?package=semantic-ui"><img src="http://npm.packagequality.com/badge/semantic-ui.png"/></a>
[Gitter.im Room]: https://gitter.im/Semantic-Org/Semantic-UI

2959
wms/contract-repair/semantic/RELEASE-NOTES.md

File diff suppressed because it is too large

5
wms/contract-repair/semantic/Semantic-UI-master/.browserlistrc

@ -0,0 +1,5 @@
last 2 versions
> 1%
opera 12.1
bb 10
android 4

322
wms/contract-repair/semantic/Semantic-UI-master/.csscomb.json

@ -0,0 +1,322 @@
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "upper",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"leading-zero": true,
"space-after-colon": " ",
"space-before-combinator": " ",
"space-after-combinator": " ",
"space-between-declarations": "\n",
"space-before-opening-brace": " ",
"space-after-opening-brace": "\n",
"space-after-selector-delimiter": "\n",
"space-before-selector-delimiter": "",
"space-before-closing-brace": "\n",
"strip-spaces": true,
"tab-size": true,
"vendor-prefix-align": true,
"sort-order": [
[
"display",
"visibility",
"float",
"clear",
"overflow",
"overflow-x",
"overflow-y",
"-webkit-box-sizing",
"-moz-box-sizing",
"box-sizing",
"-ms-overflow-x",
"-ms-overflow-y",
"clip",
"zoom",
"flex-direction",
"flex-order",
"flex-pack",
"flex-align"
],
[
"position",
"z-index",
"top",
"right",
"bottom",
"left"
],
[
"font",
"font-family",
"font-size",
"font-weight",
"font-style",
"font-variant",
"font-size-adjust",
"font-stretch",
"font-effect",
"font-emphasize",
"font-emphasize-position",
"font-emphasize-style",
"font-smooth",
"line-height"
],
[
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
],
[
"table-layout",
"empty-cells",
"caption-side",
"border-spacing",
"border-collapse",
"list-style",
"list-style-position",
"list-style-type",
"list-style-image"
],
[
"opacity",
"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
"-ms-interpolation-mode",
"color",
"border",
"border-width",
"border-style",
"border-color",
"border-top",
"border-top-width",
"border-top-style",
"border-top-color",
"border-right",
"border-right-width",
"border-right-style",
"border-right-color",
"border-bottom",
"border-bottom-width",
"border-bottom-style",
"border-bottom-color",
"border-left",
"border-left-width",
"border-left-style",
"border-left-color",
"-webkit-border-radius",
"-moz-border-radius",
"border-radius",
"-webkit-border-top-left-radius",
"-moz-border-radius-topleft",
"border-top-left-radius",
"-webkit-border-top-right-radius",
"-moz-border-radius-topright",
"border-top-right-radius",
"-webkit-border-bottom-right-radius",
"-moz-border-radius-bottomright",
"border-bottom-right-radius",
"-webkit-border-bottom-left-radius",
"-moz-border-radius-bottomleft",
"border-bottom-left-radius",
"-webkit-border-image",
"-moz-border-image",
"-o-border-image",
"border-image",
"-webkit-border-image-source",
"-moz-border-image-source",
"-o-border-image-source",
"border-image-source",
"-webkit-border-image-slice",
"-moz-border-image-slice",
"-o-border-image-slice",
"border-image-slice",
"-webkit-border-image-width",
"-moz-border-image-width",
"-o-border-image-width",
"border-image-width",
"-webkit-border-image-outset",
"-moz-border-image-outset",
"-o-border-image-outset",
"border-image-outset",
"-webkit-border-image-repeat",
"-moz-border-image-repeat",
"-o-border-image-repeat",
"border-image-repeat",
"outline",
"outline-width",
"outline-style",
"outline-color",
"outline-offset",
"background",
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
"background-color",
"background-image",
"background-repeat",
"background-attachment",
"background-position",
"background-position-x",
"-ms-background-position-x",
"background-position-y",
"-ms-background-position-y",
"-webkit-background-clip",
"-moz-background-clip",
"background-clip",
"background-origin",
"-webkit-background-size",
"-moz-background-size",
"-o-background-size",
"background-size",
"box-decoration-break",
"-webkit-box-shadow",
"-moz-box-shadow",
"box-shadow",
"filter:progid:DXImageTransform.Microsoft.gradient",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
"text-shadow"
],
[
"content",
"quotes",
"counter-reset",
"counter-increment",
"resize",
"cursor",
"-webkit-user-select",
"-moz-user-select",
"-ms-user-select",
"user-select",
"nav-index",
"nav-up",
"nav-right",
"nav-down",
"nav-left",
"-webkit-transition",
"-moz-transition",
"-ms-transition",
"-o-transition",
"transition",
"-webkit-transition-delay",
"-moz-transition-delay",
"-ms-transition-delay",
"-o-transition-delay",
"transition-delay",
"-webkit-transition-timing-function",
"-moz-transition-timing-function",
"-ms-transition-timing-function",
"-o-transition-timing-function",
"transition-timing-function",
"-webkit-transition-duration",
"-moz-transition-duration",
"-ms-transition-duration",
"-o-transition-duration",
"transition-duration",
"-webkit-transition-property",
"-moz-transition-property",
"-ms-transition-property",
"-o-transition-property",
"transition-property",
"-webkit-transform",
"-moz-transform",
"-ms-transform",
"-o-transform",
"transform",
"-webkit-transform-origin",
"-moz-transform-origin",
"-ms-transform-origin",
"-o-transform-origin",
"transform-origin",
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-name",
"-moz-animation-name",
"-ms-animation-name",
"-o-animation-name",
"animation-name",
"-webkit-animation-duration",
"-moz-animation-duration",
"-ms-animation-duration",
"-o-animation-duration",
"animation-duration",
"-webkit-animation-play-state",
"-moz-animation-play-state",
"-ms-animation-play-state",
"-o-animation-play-state",
"animation-play-state",
"-webkit-animation-timing-function",
"-moz-animation-timing-function",
"-ms-animation-timing-function",
"-o-animation-timing-function",
"animation-timing-function",
"-webkit-animation-delay",
"-moz-animation-delay",
"-ms-animation-delay",
"-o-animation-delay",
"animation-delay",
"-webkit-animation-iteration-count",
"-moz-animation-iteration-count",
"-ms-animation-iteration-count",
"-o-animation-iteration-count",
"animation-iteration-count",
"-webkit-animation-direction",
"-moz-animation-direction",
"-ms-animation-direction",
"-o-animation-direction",
"animation-direction",
"text-align",
"-webkit-text-align-last",
"-moz-text-align-last",
"-ms-text-align-last",
"text-align-last",
"vertical-align",
"white-space",
"text-decoration",
"text-emphasis",
"text-emphasis-color",
"text-emphasis-style",
"text-emphasis-position",
"text-indent",
"-ms-text-justify",
"text-justify",
"letter-spacing",
"word-spacing",
"-ms-writing-mode",
"text-outline",
"text-transform",
"text-wrap",
"text-overflow",
"-ms-text-overflow",
"text-overflow-ellipsis",
"text-overflow-mode",
"-ms-word-wrap",
"word-wrap",
"word-break",
"-ms-word-break",
"-moz-tab-size",
"-o-tab-size",
"tab-size",
"-webkit-hyphens",
"-moz-hyphens",
"hyphens",
"pointer-events"
]
]
}

18
wms/contract-repair/semantic/Semantic-UI-master/.csslintrc

@ -0,0 +1,18 @@
{
"vendor-prefix" : true,
"duplicate-properties" : true,
"display-property-grouping" : true,
"empty-rules" : true,
"adjoining-classes" : false,
"box-model" : false,
"compatible-vendor-prefixes" : false,
"box-sizing" : false,
"duplicate-background-images" : false,
"floats" : false,
"important" : false,
"overqualified-elements" : false,
"rules-count" : false,
"shorthand" : false,
"zero-units" : false
}

24
wms/contract-repair/semantic/Semantic-UI-master/.github/ISSUE_TEMPLATE.md

@ -0,0 +1,24 @@
✖ USAGE QUESTIONS → Use these dedicated resources:
Docs - http://www.semantic-ui.com
Chat - https://gitter.im/Semantic-Org/Semantic-UI
SO - https://stackoverflow.com/questions/tagged/semantic-ui?sort=votes
✔ Enhancements → Be specific. Assume backwards compatibility is a necessity. Suggest implementation when possible.
✔ BUGS → ❤❤❤. Keep in mind some bugs may not be immediately fixable due to backwards compatibility or CSS limitations.
### Title (Put in field above)
Use the format: [Component] Component Should Do X
i.e. [Checkbox] onChange Should Fire When Update Triggered via DOM
### Steps
### Expected Result
### Actual Result
### Version
x.y.z
### Testcase
[Fork, update, and replace to show the bug]:
https://jsfiddle.net/ca0rovs3/

28
wms/contract-repair/semantic/Semantic-UI-master/.github/PULL_REQUEST_TEMPLATE.md

@ -0,0 +1,28 @@
✖ Multiple features in one PR
✖ New Components Unless Previously Discussed with Maintainers (Consider creating separate repo, I'll link out to you)
✔ Add comments to complex/confusing code in "code" view of PR
✔ BUGS → This form is required:
✔ Enhancements → Only specific enhancements with detailed descriptions.
### Issue Titles
Use the format: [Component] Adds Support for Thing
For example: [Build Tools] Adds Source Map Support
Or: [Button] Fixes Inheritance for Red Basic Active State
### Closed Issues
#222 #333 #444
### Description
### Testcase
[Show before with this fiddle]
https://jsfiddle.net/ca0rovs3/
[Consider showing "fixed" case with your fiddle]()
You can link to your JS using https://rawgit.com/

33
wms/contract-repair/semantic/Semantic-UI-master/.github/stale.yml

@ -0,0 +1,33 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 90
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 90
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
There has been no activity in this thread for 90 days. While we care about
every issue and we’d love to see this fixed, the core team’s time is
limited so we have to focus our attention on the issues that are most
pressing. Therefore, we will likely not be able to get to this one.
However, PRs for this issue will of course be accepted and welcome!
If there is no more activity in the next 90 days, this issue will be closed
automatically for housekeeping. To prevent this, simply leave a reply here.
Thanks!
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue will be closed due to lack of activity for 6 months. If you’d
like this to be reopened, just leave a comment; we do monitor them!

38
wms/contract-repair/semantic/Semantic-UI-master/.gitignore

@ -0,0 +1,38 @@
node_modules/
test/coverage/
coverage/
src/**/site/
theme.config
semantic.json
tasks/**/oauth.js
package-lock.json
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.zip
*.vi
*~
*.sass-cache
*.ruby-version
# OS or Editor folders
.DS_Store
._*
Thumbs.db
.cache
.project
.settings
.tmproj
.docpad.db
*.esproj
nbproject
*.sublime-project
*.sublime-workspace
.build*
.idea

38
wms/contract-repair/semantic/Semantic-UI-master/.jshintrc

@ -0,0 +1,38 @@
{
"globals": {
"$" : true,
"afterEach" : true,
"AnimatedPNG" : true,
"beforeEach" : true,
"console" : true,
"describe" : true,
"expect" : true,
"it" : true,
"jQuery" : true,
"loadFixtures" : true,
"module" : true,
"requestAnimationFrame" : true,
"require" : true,
"semantic" : true
},
"debug" : false,
"devel" : true,
"browser" : true,
"curly" : true,
"immed" : true,
"latedef" : true,
"loopfunc" : true,
"noarg" : true,
"undef" : true,
"sub" : true,
"loopfunc" : true,
"laxbreak" : true,
"evil" : true,
"indent" : false,
"trailing" : false
}

58
wms/contract-repair/semantic/Semantic-UI-master/CONTRIBUTING.md

@ -0,0 +1,58 @@
# Contributing to Semantic UI
### Usage Questions
Questions about usage should be asked in our [Gitter chatroom](https://gitter.im/Semantic-Org/Semantic-UI), on [Semantic UI forums](http://forums.semantic-ui.com) or [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui).
Examples of usage questions
* *Why isn't my code working?*
* *Can Semantic UI do this?*
Once you receive feedback through community channels you may find your question is actually a bug. At this point it's a good idea to submit it as a bug report. Just keep in mind the following suggestions.
### Creating Bug Reports
[Github Issues Tracker](https://github.com/Semantic-Org/Semantic-UI/issues) is used to track all upcoming milestones and changes to the project.
**Please create a fork of this [JSFiddle](https://jsfiddle.net/ca0rovs3/) to demonstrate bugs.**
When submiting a bug report, include a set of steps to reproduce the issue and any related information, browser, OS etc. If we can't reproduce the issue then it will make solving things much more difficult.
If your bug uses a third party framework like Ember, Meteor, or Angular. Be sure to submit the issue to their respective issues boards. If you are confident the bug is part of the 'vanilla' SUI release, keep in mind not all maintainers are familiar with all framework and a simple test case is greatly appreciated.
If your bug is reproduced by a maintainer it will be assigned the [`confirmed bug`](https://github.com/Semantic-Org/Semantic-UI/issues?q=is%3Aopen+is%3Aissue+label%3A%22Confirmed+Bug%22) tag. Browsing this tag is a good way to keep track of known issues with SUI.
#### Naming Issues
Semantic UI boards use a special naming convention to help tag issue titles by the component the issue is related to.
##### Bugs
Please tag titles in the format "[Component] *Sub-type* should do *correct behavior*". Please use standard [title case](http://www.titlecase.com) for titles, including the bracketed tag.
For example
* [Dropdown] Multiple Selection Should Preserve "Set Selected" Order
* [Validation] - E-mail Validation Should Handle Cyrillic
* [Button] - Grouped Buttons Should Display Correctly on Mobile
##### Enhancements
For new feature requests, you can use the format "[Component] Add *new feature*"
For example
* [Dropdown] Add "Clearable" Setting
* [Validation] Add Rules for Zipcode Validation
* [API] Add "onProgress" callback setting
### Tracking Issue Progress
As bugs and features are triaged they will be assigned to milestones. The best indication of when a change will land is to check the date on the [upcoming milestones](https://github.com/Semantic-Org/Semantic-UI/milestones) page.
### Creating Pull Requests
**All pull requests should be merged into the `next` branch.**
Anyone can jump on the issues board and grab off bugs to fix. This is probably the best way to become a contributor to Semantic. Be sure to adhere to the style guides when submitting code.
* [Create a Pull Request](https://github.com/Semantic-Org/Semantic-UI/compare)
* [View Open Issues](https://github.com/Semantic-Org/Semantic-UI/issues)

7
wms/contract-repair/semantic/Semantic-UI-master/LICENSE.md

@ -0,0 +1,7 @@
# The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

112
wms/contract-repair/semantic/Semantic-UI-master/README.md

@ -0,0 +1,112 @@
![Semantic](http://semantic-ui.com/images/logo.png)
# Semantic UI
[![Join the chat at https://gitter.im/Semantic-Org/Semantic-UI](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Semantic-Org/Semantic-UI?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![CDNJS](https://img.shields.io/cdnjs/v/semantic-ui.svg)](https://cdnjs.com/libraries/semantic-ui/)
[Semantic](http://www.semantic-ui.com) is a UI framework designed for theming.
Key Features
* 50+ UI elements
* 3000 + CSS variables
* 3 Levels of variable inheritance (similar to SublimeText)
* Built with EM values for responsive design
* Flexbox friendly
Semantic allows developers to build beautiful websites fast, with **concise HTML**, **intuitive javascript**, and **simplified debugging**, helping make front-end development a delightful experience. Semantic is responsively designed allowing your website to scale on multiple devices. Semantic is production ready and partnered with frameworks such as **React**, **Angular**, **Meteor**, and **Ember**, which means you can integrate it with any of these frameworks to organize your UI layer alongside your application logic.
## 2.5.0 Release (Oct 6, 2022)
Semantic UI is now compatible with Node 18 and Gulp 4.
## User Support
Please help us keep the issue tracker organized. For technical questions that do not include a specific [JSFiddle test case](https://jsfiddle.net/ca0rovs3/) (bug reports), or feature request please use [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui) to find a solution.
Visit our [contributing guide](https://github.com/Semantic-Org/Semantic-UI/blob/master/CONTRIBUTING.md) for more on what should be posted to GitHub Issues.
## Install
#### Recommended Install
```bash
npm install semantic-ui # Use themes, import build/watch tasks into your own gulpfile.
```
Semantic UI includes an interactive installer to help setup your project.
* For more details on setup visit our [getting started guide](http://semantic-ui.com/introduction/getting-started.html).
* To learn more about theming please read our [theming guide](http://www.semantic-ui.com/usage/theming.html)
#### Additional Versions
Environment | Install Script | Repo
--- | --- | --- |
CSS Only | `npm install semantic-ui-css` | [CSS Repo](https://github.com/Semantic-Org/Semantic-UI-CSS)
[LESS](https://github.com/less/less.js/) Only | `npm install semantic-ui-less` | [LESS Repo](https://github.com/Semantic-Org/Semantic-UI-LESS)
[LESS](https://github.com/less/less.js/) plugin | `npm install less-plugin-semantic-ui` | [LESS Plugin Repo](https://github.com/bassjobsen/less-plugin-semantic-ui/)
[EmberJS](http://emberjs.com/) | `ember install:addon semantic-ui-ember` | [Ember Repo](https://github.com/Semantic-Org/Semantic-UI-Ember)
|[Meteor](https://www.meteor.com/) - [LESS](https://github.com/less/less.js/) | `meteor add semantic:ui` | [Meteor Repo](https://github.com/Semantic-Org/Semantic-UI-Meteor) |
|[Meteor](https://www.meteor.com/) - CSS | `meteor add semantic:ui-css` | [CSS Repo](https://github.com/Semantic-Org/Semantic-UI-CSS) |
[Bower](http://bower.io/) | `bower install semantic-ui` |
Check out our [integration wiki](https://github.com/Semantic-Org/Semantic-UI/wiki/Integration) for more options.
#### Browser Support
* Last 2 Versions FF, Chrome, Safari Mac
* IE 11+
* Android 4.4+, Chrome for Android 44+
* iOS Safari 7+
* Microsoft Edge 12+
Although some components will work in IE9, [grids](http://semantic-ui.com/collections/grid.html) and other [flexbox](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes) components are not supported by IE9 and may not appear correctly.
## Community
#### Getting Help
Please **do not post** usage questions to GitHub Issues. For these types of questions use our [Gitter chatroom][Gitter.im Room] or [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui).
#### Submitting Bugs and Enhancements
[GitHub Issues](https://github.com/Semantic-Org/Semantic-UI/issues) is for suggesting enhancements and reporting bugs. Before submiting a bug make sure you do the following:
* Check out our [contributing guide](https://github.com/Semantic-Org/Semantic-UI/blob/master/CONTRIBUTING.md) for info on our release cycle.
* [Fork this boilerplate JSFiddle](https://jsfiddle.net/ca0rovs3/) to create a test case for your bug. If a bug is apparent in the docs, that's ok as a test case, just make it clear exactly how to reproduce the issue. Only bugs that include a test case can be triaged.
#### Pull Requests
When adding pull requests, be sure to merge into the [next](https://github.com/Semantic-Org/Semantic-UI/tree/next) branch. If you need to demonstrate a fix in ``next`` release, you can use [this JSFiddle](https://jsfiddle.net/ca0rovs3/)
#### International
* **Chinese** A Chinese mirror site is available at [http://www.semantic-ui.cn](http://www.semantic-ui.cn).
* **Right-to-Left (RTL)** An RTL version can be created using our build tools by selecting `rtl` from the install script.
* **Translation** To help translate see the [Wiki Guide](https://github.com/Semantic-Org/Semantic-UI/wiki/Translating-Semantic-UI-Docs) for translations.
#### Resources
Resource | Description
--- | --- |
Bugs & Feature Requests | All bug submission **require** a link to a test case, and a set of steps to reproduce the issue. You can make a test case by forking this [JSFiddle](https://jsfiddle.net/ca0rovs3/), then submit your [bug report on GitHub Issues](https://github.com/Semantic-Org/Semantic-UI/issues)
Live Chat | Join our [Gitter.im Room][Gitter.im Room]
Newsletter Updates | Sign up for updates at [semantic-ui.com](http://www.semantic-ui.com)
Additional Resources | Submit a question on [StackOverflow](http://stackoverflow.com/questions/tagged/semantic-ui) or ask our [Google Group](https://groups.google.com/forum/#!forum/semantic-ui)
#### Places to Help
Project | How To Help | Next Step
--- | --- | --- |
Localization | Help us translate Semantic UI into your language | [Join our Translation Community](https://github.com/Semantic-Org/Semantic-UI/wiki/Translating-Semantic-UI-Docs)
[SCSS](http://sass-lang.com/) | SASS needs PR to support variables inside `@import` | [Add Pull Request](https://github.com/sass/sass/pulls) for [#739](https://github.com/sass/sass/issues/739#issuecomment-73984809)
[Angular](https://angularjs.org/) | Help develop angular bindings | Reach Out on [GitHub Issues](https://github.com/Semantic-Org/Semantic-UI-Angular/issues/8)
Guides & Tutorials | Help write guides and tutorials | [Join the discussion](https://github.com/Semantic-Org/Semantic-UI/issues/1571)
#### Reaching Out
If you'd like to start a conversation about Semantic feel free to e-mail me at [jack@semantic-ui.com](mailto:jack@semantic-ui.com)
<a href="http://packagequality.com/#?package=semantic-ui"><img src="http://npm.packagequality.com/badge/semantic-ui.png"/></a>
[Gitter.im Room]: https://gitter.im/Semantic-Org/Semantic-UI

2959
wms/contract-repair/semantic/Semantic-UI-master/RELEASE-NOTES.md

File diff suppressed because it is too large

27
wms/contract-repair/semantic/Semantic-UI-master/bower.json

@ -0,0 +1,27 @@
{
"name" : "semantic",
"description" : "Semantic empowers designers and developers by creating a shared vocabulary for UI.",
"homepage" : "http://www.semantic-ui.com",
"author": {
"name" : "Jack Lukic",
"web" : "http://www.jacklukic.com"
},
"dependencies": {
"jquery" : ">=1.8"
},
"main": [
"src/semantic.less",
"dist/semantic.js"
],
"keywords": [
"semantic",
"ui",
"css3",
"framework"
],
"license" : "MIT",
"ignore": [
"src/site",
"test"
]
}

24
wms/contract-repair/semantic/Semantic-UI-master/composer.json

@ -0,0 +1,24 @@
{
"name" : "semantic/ui",
"description" : "Semantic empowers designers and developers by creating a shared vocabulary for UI.",
"homepage" : "http://www.semantic-ui.com",
"authors" : [
{
"name" : "Jack Lukic",
"email" : "jacklukic@gmail.com",
"homepage" : "http://www.jacklukic.com",
"role" : "Creator"
}
],
"support": {
"issues": "https://github.com/Semantic-Org/Semantic-UI/issues",
"source": "https://github.com/Semantic-Org/Semantic-UI"
},
"keywords" : [
"semantic",
"ui",
"css",
"framework"
],
"license" : "MIT"
}

244
wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.css

@ -0,0 +1,244 @@
/*!
* # Semantic UI 2.5.0 - Accordion
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Accordion
*******************************/
.ui.accordion,
.ui.accordion .accordion {
max-width: 100%;
}
.ui.accordion .accordion {
margin: 1em 0em 0em;
padding: 0em;
}
/* Title */
.ui.accordion .title,
.ui.accordion .accordion .title {
cursor: pointer;
}
/* Default Styling */
.ui.accordion .title:not(.ui) {
padding: 0.5em 0em;
font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 1em;
color: rgba(0, 0, 0, 0.87);
}
/* Content */
.ui.accordion .title ~ .content,
.ui.accordion .accordion .title ~ .content {
display: none;
}
/* Default Styling */
.ui.accordion:not(.styled) .title ~ .content:not(.ui),
.ui.accordion:not(.styled) .accordion .title ~ .content:not(.ui) {
margin: '';
padding: 0.5em 0em 1em;
}
.ui.accordion:not(.styled) .title ~ .content:not(.ui):last-child {
padding-bottom: 0em;
}
/* Arrow */
.ui.accordion .title .dropdown.icon,
.ui.accordion .accordion .title .dropdown.icon {
display: inline-block;
float: none;
opacity: 1;
width: 1.25em;
height: 1em;
margin: 0em 0.25rem 0em 0rem;
padding: 0em;
font-size: 1em;
transition: transform 0.1s ease, opacity 0.1s ease;
vertical-align: baseline;
transform: none;
}
/*--------------
Coupling
---------------*/
/* Menu */
.ui.accordion.menu .item .title {
display: block;
padding: 0em;
}
.ui.accordion.menu .item .title > .dropdown.icon {
float: right;
margin: 0.21425em 0em 0em 1em;
transform: rotate(180deg);
}
/* Header */
.ui.accordion .ui.header .dropdown.icon {
font-size: 1em;
margin: 0em 0.25rem 0em 0rem;
}
/*******************************
States
*******************************/
.ui.accordion .active.title .dropdown.icon,
.ui.accordion .accordion .active.title .dropdown.icon {
transform: rotate(90deg);
}
.ui.accordion.menu .item .active.title > .dropdown.icon {
transform: rotate(90deg);
}
/*******************************
Types
*******************************/
/*--------------
Styled
---------------*/
.ui.styled.accordion {
width: 600px;
}
.ui.styled.accordion,
.ui.styled.accordion .accordion {
border-radius: 0.28571429rem;
background: #FFFFFF;
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15);
}
.ui.styled.accordion .title,
.ui.styled.accordion .accordion .title {
margin: 0em;
padding: 0.75em 1em;
color: rgba(0, 0, 0, 0.4);
font-weight: bold;
border-top: 1px solid rgba(34, 36, 38, 0.15);
transition: background 0.1s ease, color 0.1s ease;
}
.ui.styled.accordion > .title:first-child,
.ui.styled.accordion .accordion .title:first-child {
border-top: none;
}
/* Content */
.ui.styled.accordion .content,
.ui.styled.accordion .accordion .content {
margin: 0em;
padding: 0.5em 1em 1.5em;
}
.ui.styled.accordion .accordion .content {
padding: 0em;
padding: 0.5em 1em 1.5em;
}
/* Hover */
.ui.styled.accordion .title:hover,
.ui.styled.accordion .active.title,
.ui.styled.accordion .accordion .title:hover,
.ui.styled.accordion .accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.87);
}
.ui.styled.accordion .accordion .title:hover,
.ui.styled.accordion .accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.87);
}
/* Active */
.ui.styled.accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.95);
}
.ui.styled.accordion .accordion .active.title {
background: transparent;
color: rgba(0, 0, 0, 0.95);
}
/*******************************
States
*******************************/
/*--------------
Active
---------------*/
.ui.accordion .active.content,
.ui.accordion .accordion .active.content {
display: block;
}
/*******************************
Variations
*******************************/
/*--------------
Fluid
---------------*/
.ui.fluid.accordion,
.ui.fluid.accordion .accordion {
width: 100%;
}
/*--------------
Inverted
---------------*/
.ui.inverted.accordion .title:not(.ui) {
color: rgba(255, 255, 255, 0.9);
}
/*******************************
Theme Overrides
*******************************/
@font-face {
font-family: 'Accordion';
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfOIKAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zryj6HgAAAFwAAAAyGhlYWT/0IhHAAACOAAAADZoaGVhApkB5wAAAnAAAAAkaG10eAJuABIAAAKUAAAAGGxvY2EAjABWAAACrAAAAA5tYXhwAAgAFgAAArwAAAAgbmFtZfC1n04AAALcAAABPHBvc3QAAwAAAAAEGAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQASAEkAtwFuABMAADc0PwE2FzYXFh0BFAcGJwYvASY1EgaABQgHBQYGBQcIBYAG2wcGfwcBAQcECf8IBAcBAQd/BgYAAAAAAQAAAEkApQFuABMAADcRNDc2MzIfARYVFA8BBiMiJyY1AAUGBwgFgAYGgAUIBwYFWwEACAUGBoAFCAcFgAYGBQcAAAABAAAAAQAAqWYls18PPPUACwIAAAAAAM/9o+4AAAAAz/2j7gAAAAAAtwFuAAAACAACAAAAAAAAAAEAAAHg/+AAAAIAAAAAAAC3AAEAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAQAAAAC3ABIAtwAAAAAAAAAKABQAHgBCAGQAAAABAAAABgAUAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype'), url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAASwAAoAAAAABGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAS0AAAEtFpovuE9TLzIAAAIkAAAAYAAAAGAIIweQY21hcAAAAoQAAABMAAAATA984gpnYXNwAAAC0AAAAAgAAAAIAAAAEGhlYWQAAALYAAAANgAAADb/0IhHaGhlYQAAAxAAAAAkAAAAJAKZAedobXR4AAADNAAAABgAAAAYAm4AEm1heHAAAANMAAAABgAAAAYABlAAbmFtZQAAA1QAAAE8AAABPPC1n05wb3N0AAAEkAAAACAAAAAgAAMAAAEABAQAAQEBB3JhdGluZwABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLa/iU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAABJBIABwEBBw0PERQZHnJhdGluZ3JhdGluZ3UwdTF1MjB1RjBEOXVGMERBAAACAYkABAAGAQEEBwoNVp38lA78lA78lA77lA773Z33bxWLkI2Qj44I9xT3FAWOj5CNkIuQi4+JjoePiI2Gi4YIi/uUBYuGiYeHiIiHh4mGi4aLho2Ijwj7FPcUBYeOiY+LkAgO+92L5hWL95QFi5CNkI6Oj4+PjZCLkIuQiY6HCPcU+xQFj4iNhouGi4aJh4eICPsU+xQFiIeGiYaLhouHjYePiI6Jj4uQCA74lBT4lBWLDAoAAAAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAADfYOJZfDzz1AAsCAAAAAADP/aPuAAAAAM/9o+4AAAAAALcBbgAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAAtwABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAAAtwASALcAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');
font-weight: normal;
font-style: normal;
}
/* Dropdown Icon */
.ui.accordion .title .dropdown.icon,
.ui.accordion .accordion .title .dropdown.icon {
font-family: Accordion;
line-height: 1;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
font-weight: normal;
font-style: normal;
text-align: center;
}
.ui.accordion .title .dropdown.icon:before,
.ui.accordion .accordion .title .dropdown.icon:before {
content: '\f0da' /*rtl:'\f0d9'*/;
}
/*******************************
User Overrides
*******************************/

613
wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.js

@ -0,0 +1,613 @@
/*!
* # Semantic UI 2.5.0 - Accordion
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
'use strict';
window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;
$.fn.accordion = function(parameters) {
var
$allModules = $(this),
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
requestAnimationFrame = window.requestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.msRequestAnimationFrame
|| function(callback) { setTimeout(callback, 0); },
returnedValue
;
$allModules
.each(function() {
var
settings = ( $.isPlainObject(parameters) )
? $.extend(true, {}, $.fn.accordion.settings, parameters)
: $.extend({}, $.fn.accordion.settings),
className = settings.className,
namespace = settings.namespace,
selector = settings.selector,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
moduleSelector = $allModules.selector || '',
$module = $(this),
$title = $module.find(selector.title),
$content = $module.find(selector.content),
element = this,
instance = $module.data(moduleNamespace),
observer,
module
;
module = {
initialize: function() {
module.debug('Initializing', $module);
module.bind.events();
if(settings.observeChanges) {
module.observeChanges();
}
module.instantiate();
},
instantiate: function() {
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.debug('Destroying previous instance', $module);
$module
.off(eventNamespace)
.removeData(moduleNamespace)
;
},
refresh: function() {
$title = $module.find(selector.title);
$content = $module.find(selector.content);
},
observeChanges: function() {
if('MutationObserver' in window) {
observer = new MutationObserver(function(mutations) {
module.debug('DOM tree modified, updating selector cache');
module.refresh();
});
observer.observe(element, {
childList : true,
subtree : true
});
module.debug('Setting up mutation observer', observer);
}
},
bind: {
events: function() {
module.debug('Binding delegated events');
$module
.on(settings.on + eventNamespace, selector.trigger, module.event.click)
;
}
},
event: {
click: function() {
module.toggle.call(this);
}
},
toggle: function(query) {
var
$activeTitle = (query !== undefined)
? (typeof query === 'number')
? $title.eq(query)
: $(query).closest(selector.title)
: $(this).closest(selector.title),
$activeContent = $activeTitle.next($content),
isAnimating = $activeContent.hasClass(className.animating),
isActive = $activeContent.hasClass(className.active),
isOpen = (isActive && !isAnimating),
isOpening = (!isActive && isAnimating)
;
module.debug('Toggling visibility of content', $activeTitle);
if(isOpen || isOpening) {
if(settings.collapsible) {
module.close.call($activeTitle);
}
else {
module.debug('Cannot close accordion content collapsing is disabled');
}
}
else {
module.open.call($activeTitle);
}
},
open: function(query) {
var
$activeTitle = (query !== undefined)
? (typeof query === 'number')
? $title.eq(query)
: $(query).closest(selector.title)
: $(this).closest(selector.title),
$activeContent = $activeTitle.next($content),
isAnimating = $activeContent.hasClass(className.animating),
isActive = $activeContent.hasClass(className.active),
isOpen = (isActive || isAnimating)
;
if(isOpen) {
module.debug('Accordion already open, skipping', $activeContent);
return;
}
module.debug('Opening accordion content', $activeTitle);
settings.onOpening.call($activeContent);
settings.onChanging.call($activeContent);
if(settings.exclusive) {
module.closeOthers.call($activeTitle);
}
$activeTitle
.addClass(className.active)
;
$activeContent
.stop(true, true)
.addClass(className.animating)
;
if(settings.animateChildren) {
if($.fn.transition !== undefined && $module.transition('is supported')) {
$activeContent
.children()
.transition({
animation : 'fade in',
queue : false,
useFailSafe : true,
debug : settings.debug,
verbose : settings.verbose,
duration : settings.duration
})
;
}
else {
$activeContent
.children()
.stop(true, true)
.animate({
opacity: 1
}, settings.duration, module.resetOpacity)
;
}
}
$activeContent
.slideDown(settings.duration, settings.easing, function() {
$activeContent
.removeClass(className.animating)
.addClass(className.active)
;
module.reset.display.call(this);
settings.onOpen.call(this);
settings.onChange.call(this);
})
;
},
close: function(query) {
var
$activeTitle = (query !== undefined)
? (typeof query === 'number')
? $title.eq(query)
: $(query).closest(selector.title)
: $(this).closest(selector.title),
$activeContent = $activeTitle.next($content),
isAnimating = $activeContent.hasClass(className.animating),
isActive = $activeContent.hasClass(className.active),
isOpening = (!isActive && isAnimating),
isClosing = (isActive && isAnimating)
;
if((isActive || isOpening) && !isClosing) {
module.debug('Closing accordion content', $activeContent);
settings.onClosing.call($activeContent);
settings.onChanging.call($activeContent);
$activeTitle
.removeClass(className.active)
;
$activeContent
.stop(true, true)
.addClass(className.animating)
;
if(settings.animateChildren) {
if($.fn.transition !== undefined && $module.transition('is supported')) {
$activeContent
.children()
.transition({
animation : 'fade out',
queue : false,
useFailSafe : true,
debug : settings.debug,
verbose : settings.verbose,
duration : settings.duration
})
;
}
else {
$activeContent
.children()
.stop(true, true)
.animate({
opacity: 0
}, settings.duration, module.resetOpacity)
;
}
}
$activeContent
.slideUp(settings.duration, settings.easing, function() {
$activeContent
.removeClass(className.animating)
.removeClass(className.active)
;
module.reset.display.call(this);
settings.onClose.call(this);
settings.onChange.call(this);
})
;
}
},
closeOthers: function(index) {
var
$activeTitle = (index !== undefined)
? $title.eq(index)
: $(this).closest(selector.title),
$parentTitles = $activeTitle.parents(selector.content).prev(selector.title),
$activeAccordion = $activeTitle.closest(selector.accordion),
activeSelector = selector.title + '.' + className.active + ':visible',
activeContent = selector.content + '.' + className.active + ':visible',
$openTitles,
$nestedTitles,
$openContents
;
if(settings.closeNested) {
$openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
$openContents = $openTitles.next($content);
}
else {
$openTitles = $activeAccordion.find(activeSelector).not($parentTitles);
$nestedTitles = $activeAccordion.find(activeContent).find(activeSelector).not($parentTitles);
$openTitles = $openTitles.not($nestedTitles);
$openContents = $openTitles.next($content);
}
if( ($openTitles.length > 0) ) {
module.debug('Exclusive enabled, closing other content', $openTitles);
$openTitles
.removeClass(className.active)
;
$openContents
.removeClass(className.animating)
.stop(true, true)
;
if(settings.animateChildren) {
if($.fn.transition !== undefined && $module.transition('is supported')) {
$openContents
.children()
.transition({
animation : 'fade out',
useFailSafe : true,
debug : settings.debug,
verbose : settings.verbose,
duration : settings.duration
})
;
}
else {
$openContents
.children()
.stop(true, true)
.animate({
opacity: 0
}, settings.duration, module.resetOpacity)
;
}
}
$openContents
.slideUp(settings.duration , settings.easing, function() {
$(this).removeClass(className.active);
module.reset.display.call(this);
})
;
}
},
reset: {
display: function() {
module.verbose('Removing inline display from element', this);
$(this).css('display', '');
if( $(this).attr('style') === '') {
$(this)
.attr('style', '')
.removeAttr('style')
;
}
},
opacity: function() {
module.verbose('Removing inline opacity from element', this);
$(this).css('opacity', '');
if( $(this).attr('style') === '') {
$(this)
.attr('style', '')
.removeAttr('style')
;
}
},
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
if($.isPlainObject(settings[name])) {
$.extend(true, settings[name], value);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
module.debug('Changing internal', name, value);
if(value !== undefined) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else {
module[name] = value;
}
}
else {
return module[name];
}
},
debug: function() {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
}
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 500);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
module.error(error.method, query);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
instance.invoke('destroy');
}
module.initialize();
}
})
;
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.fn.accordion.settings = {
name : 'Accordion',
namespace : 'accordion',
silent : false,
debug : false,
verbose : false,
performance : true,
on : 'click', // event on title that opens accordion
observeChanges : true, // whether accordion should automatically refresh on DOM insertion
exclusive : true, // whether a single accordion content panel should be open at once
collapsible : true, // whether accordion content can be closed
closeNested : false, // whether nested content should be closed when a panel is closed
animateChildren : true, // whether children opacity should be animated
duration : 350, // duration of animation
easing : 'easeOutQuad', // easing equation for animation
onOpening : function(){}, // callback before open animation
onClosing : function(){}, // callback before closing animation
onChanging : function(){}, // callback before closing or opening animation
onOpen : function(){}, // callback after open animation
onClose : function(){}, // callback after closing animation
onChange : function(){}, // callback after closing or opening animation
error: {
method : 'The method you called is not defined'
},
className : {
active : 'active',
animating : 'animating'
},
selector : {
accordion : '.accordion',
title : '.title',
trigger : '.title',
content : '.content'
}
};
// Adds easing
$.extend( $.easing, {
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
}
});
})( jQuery, window, document );

9
wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.min.css

File diff suppressed because one or more lines are too long

1
wms/contract-repair/semantic/Semantic-UI-master/dist/components/accordion.min.js

File diff suppressed because one or more lines are too long

274
wms/contract-repair/semantic/Semantic-UI-master/dist/components/ad.css

@ -0,0 +1,274 @@
/*!
* # Semantic UI 2.5.0 - Ad
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Advertisement
*******************************/
.ui.ad {
display: block;
overflow: hidden;
margin: 1em 0em;
}
.ui.ad:first-child {
margin: 0em;
}
.ui.ad:last-child {
margin: 0em;
}
.ui.ad iframe {
margin: 0em;
padding: 0em;
border: none;
overflow: hidden;
}
/*--------------
Common
---------------*/
/* Leaderboard */
.ui.leaderboard.ad {
width: 728px;
height: 90px;
}
/* Medium Rectangle */
.ui[class*="medium rectangle"].ad {
width: 300px;
height: 250px;
}
/* Large Rectangle */
.ui[class*="large rectangle"].ad {
width: 336px;
height: 280px;
}
/* Half Page */
.ui[class*="half page"].ad {
width: 300px;
height: 600px;
}
/*--------------
Square
---------------*/
/* Square */
.ui.square.ad {
width: 250px;
height: 250px;
}
/* Small Square */
.ui[class*="small square"].ad {
width: 200px;
height: 200px;
}
/*--------------
Rectangle
---------------*/
/* Small Rectangle */
.ui[class*="small rectangle"].ad {
width: 180px;
height: 150px;
}
/* Vertical Rectangle */
.ui[class*="vertical rectangle"].ad {
width: 240px;
height: 400px;
}
/*--------------
Button
---------------*/
.ui.button.ad {
width: 120px;
height: 90px;
}
.ui[class*="square button"].ad {
width: 125px;
height: 125px;
}
.ui[class*="small button"].ad {
width: 120px;
height: 60px;
}
/*--------------
Skyscrapers
---------------*/
/* Skyscraper */
.ui.skyscraper.ad {
width: 120px;
height: 600px;
}
/* Wide Skyscraper */
.ui[class*="wide skyscraper"].ad {
width: 160px;
}
/*--------------
Banners
---------------*/
/* Banner */
.ui.banner.ad {
width: 468px;
height: 60px;
}
/* Vertical Banner */
.ui[class*="vertical banner"].ad {
width: 120px;
height: 240px;
}
/* Top Banner */
.ui[class*="top banner"].ad {
width: 930px;
height: 180px;
}
/* Half Banner */
.ui[class*="half banner"].ad {
width: 234px;
height: 60px;
}
/*--------------
Boards
---------------*/
/* Leaderboard */
.ui[class*="large leaderboard"].ad {
width: 970px;
height: 90px;
}
/* Billboard */
.ui.billboard.ad {
width: 970px;
height: 250px;
}
/*--------------
Panorama
---------------*/
/* Panorama */
.ui.panorama.ad {
width: 980px;
height: 120px;
}
/*--------------
Netboard
---------------*/
/* Netboard */
.ui.netboard.ad {
width: 580px;
height: 400px;
}
/*--------------
Mobile
---------------*/
/* Large Mobile Banner */
.ui[class*="large mobile banner"].ad {
width: 320px;
height: 100px;
}
/* Mobile Leaderboard */
.ui[class*="mobile leaderboard"].ad {
width: 320px;
height: 50px;
}
/*******************************
Types
*******************************/
/* Mobile Sizes */
.ui.mobile.ad {
display: none;
}
@media only screen and (max-width: 767px) {
.ui.mobile.ad {
display: block;
}
}
/*******************************
Variations
*******************************/
.ui.centered.ad {
margin-left: auto;
margin-right: auto;
}
.ui.test.ad {
position: relative;
background: #545454;
}
.ui.test.ad:after {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
text-align: center;
transform: translateX(-50%) translateY(-50%);
content: 'Ad';
color: #FFFFFF;
font-size: 1em;
font-weight: bold;
}
.ui.mobile.test.ad:after {
font-size: 0.85714286em;
}
.ui.test.ad[data-text]:after {
content: attr(data-text);
}
/*******************************
Theme Overrides
*******************************/
/*******************************
User Variable Overrides
*******************************/

10
wms/contract-repair/semantic/Semantic-UI-master/dist/components/ad.min.css

@ -0,0 +1,10 @@
/*!
* # Semantic UI 2.5.0 - Ad
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2013 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/.ui.ad{display:block;overflow:hidden;margin:1em 0}.ui.ad:first-child{margin:0}.ui.ad:last-child{margin:0}.ui.ad iframe{margin:0;padding:0;border:none;overflow:hidden}.ui.leaderboard.ad{width:728px;height:90px}.ui[class*="medium rectangle"].ad{width:300px;height:250px}.ui[class*="large rectangle"].ad{width:336px;height:280px}.ui[class*="half page"].ad{width:300px;height:600px}.ui.square.ad{width:250px;height:250px}.ui[class*="small square"].ad{width:200px;height:200px}.ui[class*="small rectangle"].ad{width:180px;height:150px}.ui[class*="vertical rectangle"].ad{width:240px;height:400px}.ui.button.ad{width:120px;height:90px}.ui[class*="square button"].ad{width:125px;height:125px}.ui[class*="small button"].ad{width:120px;height:60px}.ui.skyscraper.ad{width:120px;height:600px}.ui[class*="wide skyscraper"].ad{width:160px}.ui.banner.ad{width:468px;height:60px}.ui[class*="vertical banner"].ad{width:120px;height:240px}.ui[class*="top banner"].ad{width:930px;height:180px}.ui[class*="half banner"].ad{width:234px;height:60px}.ui[class*="large leaderboard"].ad{width:970px;height:90px}.ui.billboard.ad{width:970px;height:250px}.ui.panorama.ad{width:980px;height:120px}.ui.netboard.ad{width:580px;height:400px}.ui[class*="large mobile banner"].ad{width:320px;height:100px}.ui[class*="mobile leaderboard"].ad{width:320px;height:50px}.ui.mobile.ad{display:none}@media only screen and (max-width:767px){.ui.mobile.ad{display:block}}.ui.centered.ad{margin-left:auto;margin-right:auto}.ui.test.ad{position:relative;background:#545454}.ui.test.ad:after{position:absolute;top:50%;left:50%;width:100%;text-align:center;transform:translateX(-50%) translateY(-50%);content:'Ad';color:#fff;font-size:1em;font-weight:700}.ui.mobile.test.ad:after{font-size:.85714286em}.ui.test.ad[data-text]:after{content:attr(data-text)}

1167
wms/contract-repair/semantic/Semantic-UI-master/dist/components/api.js

File diff suppressed because it is too large

1
wms/contract-repair/semantic/Semantic-UI-master/dist/components/api.min.js

File diff suppressed because one or more lines are too long

124
wms/contract-repair/semantic/Semantic-UI-master/dist/components/breadcrumb.css

@ -0,0 +1,124 @@
/*!
* # Semantic UI 2.5.0 - Breadcrumb
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Breadcrumb
*******************************/
.ui.breadcrumb {
line-height: 1;
display: inline-block;
margin: 0em 0em;
vertical-align: middle;
}
.ui.breadcrumb:first-child {
margin-top: 0em;
}
.ui.breadcrumb:last-child {
margin-bottom: 0em;
}
/*******************************
Content
*******************************/
/* Divider */
.ui.breadcrumb .divider {
display: inline-block;
opacity: 0.7;
margin: 0em 0.21428571rem 0em;
font-size: 0.92857143em;
color: rgba(0, 0, 0, 0.4);
vertical-align: baseline;
}
/* Link */
.ui.breadcrumb a {
color: #4183C4;
}
.ui.breadcrumb a:hover {
color: #1e70bf;
}
/* Icon Divider */
.ui.breadcrumb .icon.divider {
font-size: 0.85714286em;
vertical-align: baseline;
}
/* Section */
.ui.breadcrumb a.section {
cursor: pointer;
}
.ui.breadcrumb .section {
display: inline-block;
margin: 0em;
padding: 0em;
}
/* Loose Coupling */
.ui.breadcrumb.segment {
display: inline-block;
padding: 0.78571429em 1em;
}
/*******************************
States
*******************************/
.ui.breadcrumb .active.section {
font-weight: bold;
}
/*******************************
Variations
*******************************/
.ui.mini.breadcrumb {
font-size: 0.78571429rem;
}
.ui.tiny.breadcrumb {
font-size: 0.85714286rem;
}
.ui.small.breadcrumb {
font-size: 0.92857143rem;
}
.ui.breadcrumb {
font-size: 1rem;
}
.ui.large.breadcrumb {
font-size: 1.14285714rem;
}
.ui.big.breadcrumb {
font-size: 1.28571429rem;
}
.ui.huge.breadcrumb {
font-size: 1.42857143rem;
}
.ui.massive.breadcrumb {
font-size: 1.71428571rem;
}
/*******************************
Theme Overrides
*******************************/
/*******************************
Site Overrides
*******************************/

9
wms/contract-repair/semantic/Semantic-UI-master/dist/components/breadcrumb.min.css

@ -0,0 +1,9 @@
/*!
* # Semantic UI 2.5.0 - Breadcrumb
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/.ui.breadcrumb{line-height:1;display:inline-block;margin:0 0;vertical-align:middle}.ui.breadcrumb:first-child{margin-top:0}.ui.breadcrumb:last-child{margin-bottom:0}.ui.breadcrumb .divider{display:inline-block;opacity:.7;margin:0 .21428571rem 0;font-size:.92857143em;color:rgba(0,0,0,.4);vertical-align:baseline}.ui.breadcrumb a{color:#4183c4}.ui.breadcrumb a:hover{color:#1e70bf}.ui.breadcrumb .icon.divider{font-size:.85714286em;vertical-align:baseline}.ui.breadcrumb a.section{cursor:pointer}.ui.breadcrumb .section{display:inline-block;margin:0;padding:0}.ui.breadcrumb.segment{display:inline-block;padding:.78571429em 1em}.ui.breadcrumb .active.section{font-weight:700}.ui.mini.breadcrumb{font-size:.78571429rem}.ui.tiny.breadcrumb{font-size:.85714286rem}.ui.small.breadcrumb{font-size:.92857143rem}.ui.breadcrumb{font-size:1rem}.ui.large.breadcrumb{font-size:1.14285714rem}.ui.big.breadcrumb{font-size:1.28571429rem}.ui.huge.breadcrumb{font-size:1.42857143rem}.ui.massive.breadcrumb{font-size:1.71428571rem}

3561
wms/contract-repair/semantic/Semantic-UI-master/dist/components/button.css

File diff suppressed because it is too large

9
wms/contract-repair/semantic/Semantic-UI-master/dist/components/button.min.css

File diff suppressed because one or more lines are too long

937
wms/contract-repair/semantic/Semantic-UI-master/dist/components/card.css

@ -0,0 +1,937 @@
/*!
* # Semantic UI 2.5.0 - Item
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Standard
*******************************/
/*--------------
Card
---------------*/
.ui.cards > .card,
.ui.card {
max-width: 100%;
position: relative;
display: flex;
flex-direction: column;
width: 290px;
min-height: 0px;
background: #FFFFFF;
padding: 0em;
border: none;
border-radius: 0.28571429rem;
box-shadow: 0px 1px 3px 0px #D4D4D5, 0px 0px 0px 1px #D4D4D5;
transition: box-shadow 0.1s ease, transform 0.1s ease;
z-index: '';
}
.ui.card {
margin: 1em 0em;
}
.ui.cards > .card a,
.ui.card a {
cursor: pointer;
}
.ui.card:first-child {
margin-top: 0em;
}
.ui.card:last-child {
margin-bottom: 0em;
}
/*--------------
Cards
---------------*/
.ui.cards {
display: flex;
margin: -0.875em -0.5em;
flex-wrap: wrap;
}
.ui.cards > .card {
display: flex;
margin: 0.875em 0.5em;
float: none;
}
/* Clearing */
.ui.cards:after,
.ui.card:after {
display: block;
content: ' ';
height: 0px;
clear: both;
overflow: hidden;
visibility: hidden;
}
/* Consecutive Card Groups Preserve Row Spacing */
.ui.cards ~ .ui.cards {
margin-top: 0.875em;
}
/*--------------
Rounded Edges
---------------*/
.ui.cards > .card > :first-child,
.ui.card > :first-child {
border-radius: 0.28571429rem 0.28571429rem 0em 0em !important;
border-top: none !important;
}
.ui.cards > .card > :last-child,
.ui.card > :last-child {
border-radius: 0em 0em 0.28571429rem 0.28571429rem !important;
}
.ui.cards > .card > :only-child,
.ui.card > :only-child {
border-radius: 0.28571429rem !important;
}
/*--------------
Images
---------------*/
.ui.cards > .card > .image,
.ui.card > .image {
position: relative;
display: block;
flex: 0 0 auto;
padding: 0em;
background: rgba(0, 0, 0, 0.05);
}
.ui.cards > .card > .image > img,
.ui.card > .image > img {
display: block;
width: 100%;
height: auto;
border-radius: inherit;
}
.ui.cards > .card > .image:not(.ui) > img,
.ui.card > .image:not(.ui) > img {
border: none;
}
/*--------------
Content
---------------*/
.ui.cards > .card > .content,
.ui.card > .content {
flex-grow: 1;
border: none;
border-top: 1px solid rgba(34, 36, 38, 0.1);
background: none;
margin: 0em;
padding: 1em 1em;
box-shadow: none;
font-size: 1em;
border-radius: 0em;
}
.ui.cards > .card > .content:after,
.ui.card > .content:after {
display: block;
content: ' ';
height: 0px;
clear: both;
overflow: hidden;
visibility: hidden;
}
.ui.cards > .card > .content > .header,
.ui.card > .content > .header {
display: block;
margin: '';
font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
color: rgba(0, 0, 0, 0.85);
}
/* Default Header Size */
.ui.cards > .card > .content > .header:not(.ui),
.ui.card > .content > .header:not(.ui) {
font-weight: bold;
font-size: 1.28571429em;
margin-top: -0.21425em;
line-height: 1.28571429em;
}
.ui.cards > .card > .content > .meta + .description,
.ui.cards > .card > .content > .header + .description,
.ui.card > .content > .meta + .description,
.ui.card > .content > .header + .description {
margin-top: 0.5em;
}
/*----------------
Floated Content
-----------------*/
.ui.cards > .card [class*="left floated"],
.ui.card [class*="left floated"] {
float: left;
}
.ui.cards > .card [class*="right floated"],
.ui.card [class*="right floated"] {
float: right;
}
/*--------------
Aligned
---------------*/
.ui.cards > .card [class*="left aligned"],
.ui.card [class*="left aligned"] {
text-align: left;
}
.ui.cards > .card [class*="center aligned"],
.ui.card [class*="center aligned"] {
text-align: center;
}
.ui.cards > .card [class*="right aligned"],
.ui.card [class*="right aligned"] {
text-align: right;
}
/*--------------
Content Image
---------------*/
.ui.cards > .card .content img,
.ui.card .content img {
display: inline-block;
vertical-align: middle;
width: '';
}
.ui.cards > .card img.avatar,
.ui.cards > .card .avatar img,
.ui.card img.avatar,
.ui.card .avatar img {
width: 2em;
height: 2em;
border-radius: 500rem;
}
/*--------------
Description
---------------*/
.ui.cards > .card > .content > .description,
.ui.card > .content > .description {
clear: both;
color: rgba(0, 0, 0, 0.68);
}
/*--------------
Paragraph
---------------*/
.ui.cards > .card > .content p,
.ui.card > .content p {
margin: 0em 0em 0.5em;
}
.ui.cards > .card > .content p:last-child,
.ui.card > .content p:last-child {
margin-bottom: 0em;
}
/*--------------
Meta
---------------*/
.ui.cards > .card .meta,
.ui.card .meta {
font-size: 1em;
color: rgba(0, 0, 0, 0.4);
}
.ui.cards > .card .meta *,
.ui.card .meta * {
margin-right: 0.3em;
}
.ui.cards > .card .meta :last-child,
.ui.card .meta :last-child {
margin-right: 0em;
}
.ui.cards > .card .meta [class*="right floated"],
.ui.card .meta [class*="right floated"] {
margin-right: 0em;
margin-left: 0.3em;
}
/*--------------
Links
---------------*/
/* Generic */
.ui.cards > .card > .content a:not(.ui),
.ui.card > .content a:not(.ui) {
color: '';
transition: color 0.1s ease;
}
.ui.cards > .card > .content a:not(.ui):hover,
.ui.card > .content a:not(.ui):hover {
color: '';
}
/* Header */
.ui.cards > .card > .content > a.header,
.ui.card > .content > a.header {
color: rgba(0, 0, 0, 0.85);
}
.ui.cards > .card > .content > a.header:hover,
.ui.card > .content > a.header:hover {
color: #1e70bf;
}
/* Meta */
.ui.cards > .card .meta > a:not(.ui),
.ui.card .meta > a:not(.ui) {
color: rgba(0, 0, 0, 0.4);
}
.ui.cards > .card .meta > a:not(.ui):hover,
.ui.card .meta > a:not(.ui):hover {
color: rgba(0, 0, 0, 0.87);
}
/*--------------
Buttons
---------------*/
.ui.cards > .card > .buttons,
.ui.card > .buttons,
.ui.cards > .card > .button,
.ui.card > .button {
margin: 0px -1px;
width: calc(100% + 2px );
}
/*--------------
Dimmer
---------------*/
.ui.cards > .card .dimmer,
.ui.card .dimmer {
background-color: '';
z-index: 10;
}
/*--------------
Labels
---------------*/
/*-----Star----- */
/* Icon */
.ui.cards > .card > .content .star.icon,
.ui.card > .content .star.icon {
cursor: pointer;
opacity: 0.75;
transition: color 0.1s ease;
}
.ui.cards > .card > .content .star.icon:hover,
.ui.card > .content .star.icon:hover {
opacity: 1;
color: #FFB70A;
}
.ui.cards > .card > .content .active.star.icon,
.ui.card > .content .active.star.icon {
color: #FFE623;
}
/*-----Like----- */
/* Icon */
.ui.cards > .card > .content .like.icon,
.ui.card > .content .like.icon {
cursor: pointer;
opacity: 0.75;
transition: color 0.1s ease;
}
.ui.cards > .card > .content .like.icon:hover,
.ui.card > .content .like.icon:hover {
opacity: 1;
color: #FF2733;
}
.ui.cards > .card > .content .active.like.icon,
.ui.card > .content .active.like.icon {
color: #FF2733;
}
/*----------------
Extra Content
-----------------*/
.ui.cards > .card > .extra,
.ui.card > .extra {
max-width: 100%;
min-height: 0em !important;
flex-grow: 0;
border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
position: static;
background: none;
width: auto;
margin: 0em 0em;
padding: 0.75em 1em;
top: 0em;
left: 0em;
color: rgba(0, 0, 0, 0.4);
box-shadow: none;
transition: color 0.1s ease;
}
.ui.cards > .card > .extra a:not(.ui),
.ui.card > .extra a:not(.ui) {
color: rgba(0, 0, 0, 0.4);
}
.ui.cards > .card > .extra a:not(.ui):hover,
.ui.card > .extra a:not(.ui):hover {
color: #1e70bf;
}
/*******************************
Variations
*******************************/
/*-------------------
Raised
--------------------*/
.ui.raised.cards > .card,
.ui.raised.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 4px 0px rgba(34, 36, 38, 0.12), 0px 2px 10px 0px rgba(34, 36, 38, 0.15);
}
.ui.raised.cards a.card:hover,
.ui.link.cards .raised.card:hover,
a.ui.raised.card:hover,
.ui.link.raised.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 4px 0px rgba(34, 36, 38, 0.15), 0px 2px 10px 0px rgba(34, 36, 38, 0.25);
}
.ui.raised.cards > .card,
.ui.raised.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 4px 0px rgba(34, 36, 38, 0.12), 0px 2px 10px 0px rgba(34, 36, 38, 0.15);
}
/*-------------------
Centered
--------------------*/
.ui.centered.cards {
justify-content: center;
}
.ui.centered.card {
margin-left: auto;
margin-right: auto;
}
/*-------------------
Fluid
--------------------*/
.ui.fluid.card {
width: 100%;
max-width: 9999px;
}
/*-------------------
Link
--------------------*/
.ui.cards a.card,
.ui.link.cards .card,
a.ui.card,
.ui.link.card {
transform: none;
}
.ui.cards a.card:hover,
.ui.link.cards .card:hover,
a.ui.card:hover,
.ui.link.card:hover {
cursor: pointer;
z-index: 5;
background: #FFFFFF;
border: none;
box-shadow: 0px 1px 3px 0px #BCBDBD, 0px 0px 0px 1px #D4D4D5;
transform: translateY(-3px);
}
/*-------------------
Colors
--------------------*/
/* Red */
.ui.red.cards > .card,
.ui.cards > .red.card,
.ui.red.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #DB2828, 0px 1px 3px 0px #D4D4D5;
}
.ui.red.cards > .card:hover,
.ui.cards > .red.card:hover,
.ui.red.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #d01919, 0px 1px 3px 0px #BCBDBD;
}
/* Orange */
.ui.orange.cards > .card,
.ui.cards > .orange.card,
.ui.orange.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #F2711C, 0px 1px 3px 0px #D4D4D5;
}
.ui.orange.cards > .card:hover,
.ui.cards > .orange.card:hover,
.ui.orange.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #f26202, 0px 1px 3px 0px #BCBDBD;
}
/* Yellow */
.ui.yellow.cards > .card,
.ui.cards > .yellow.card,
.ui.yellow.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #FBBD08, 0px 1px 3px 0px #D4D4D5;
}
.ui.yellow.cards > .card:hover,
.ui.cards > .yellow.card:hover,
.ui.yellow.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #eaae00, 0px 1px 3px 0px #BCBDBD;
}
/* Olive */
.ui.olive.cards > .card,
.ui.cards > .olive.card,
.ui.olive.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #B5CC18, 0px 1px 3px 0px #D4D4D5;
}
.ui.olive.cards > .card:hover,
.ui.cards > .olive.card:hover,
.ui.olive.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #a7bd0d, 0px 1px 3px 0px #BCBDBD;
}
/* Green */
.ui.green.cards > .card,
.ui.cards > .green.card,
.ui.green.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #21BA45, 0px 1px 3px 0px #D4D4D5;
}
.ui.green.cards > .card:hover,
.ui.cards > .green.card:hover,
.ui.green.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #16ab39, 0px 1px 3px 0px #BCBDBD;
}
/* Teal */
.ui.teal.cards > .card,
.ui.cards > .teal.card,
.ui.teal.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #00B5AD, 0px 1px 3px 0px #D4D4D5;
}
.ui.teal.cards > .card:hover,
.ui.cards > .teal.card:hover,
.ui.teal.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #009c95, 0px 1px 3px 0px #BCBDBD;
}
/* Blue */
.ui.blue.cards > .card,
.ui.cards > .blue.card,
.ui.blue.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #2185D0, 0px 1px 3px 0px #D4D4D5;
}
.ui.blue.cards > .card:hover,
.ui.cards > .blue.card:hover,
.ui.blue.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #1678c2, 0px 1px 3px 0px #BCBDBD;
}
/* Violet */
.ui.violet.cards > .card,
.ui.cards > .violet.card,
.ui.violet.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #6435C9, 0px 1px 3px 0px #D4D4D5;
}
.ui.violet.cards > .card:hover,
.ui.cards > .violet.card:hover,
.ui.violet.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #5829bb, 0px 1px 3px 0px #BCBDBD;
}
/* Purple */
.ui.purple.cards > .card,
.ui.cards > .purple.card,
.ui.purple.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #A333C8, 0px 1px 3px 0px #D4D4D5;
}
.ui.purple.cards > .card:hover,
.ui.cards > .purple.card:hover,
.ui.purple.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #9627ba, 0px 1px 3px 0px #BCBDBD;
}
/* Pink */
.ui.pink.cards > .card,
.ui.cards > .pink.card,
.ui.pink.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #E03997, 0px 1px 3px 0px #D4D4D5;
}
.ui.pink.cards > .card:hover,
.ui.cards > .pink.card:hover,
.ui.pink.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #e61a8d, 0px 1px 3px 0px #BCBDBD;
}
/* Brown */
.ui.brown.cards > .card,
.ui.cards > .brown.card,
.ui.brown.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #A5673F, 0px 1px 3px 0px #D4D4D5;
}
.ui.brown.cards > .card:hover,
.ui.cards > .brown.card:hover,
.ui.brown.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #975b33, 0px 1px 3px 0px #BCBDBD;
}
/* Grey */
.ui.grey.cards > .card,
.ui.cards > .grey.card,
.ui.grey.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #767676, 0px 1px 3px 0px #D4D4D5;
}
.ui.grey.cards > .card:hover,
.ui.cards > .grey.card:hover,
.ui.grey.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #838383, 0px 1px 3px 0px #BCBDBD;
}
/* Black */
.ui.black.cards > .card,
.ui.cards > .black.card,
.ui.black.card {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #1B1C1D, 0px 1px 3px 0px #D4D4D5;
}
.ui.black.cards > .card:hover,
.ui.cards > .black.card:hover,
.ui.black.card:hover {
box-shadow: 0px 0px 0px 1px #D4D4D5, 0px 2px 0px 0px #27292a, 0px 1px 3px 0px #BCBDBD;
}
/*--------------
Card Count
---------------*/
.ui.one.cards {
margin-left: 0em;
margin-right: 0em;
}
.ui.one.cards > .card {
width: 100%;
}
.ui.two.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.two.cards > .card {
width: calc( 50% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.three.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.three.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.four.cards {
margin-left: -0.75em;
margin-right: -0.75em;
}
.ui.four.cards > .card {
width: calc( 25% - 1.5em );
margin-left: 0.75em;
margin-right: 0.75em;
}
.ui.five.cards {
margin-left: -0.75em;
margin-right: -0.75em;
}
.ui.five.cards > .card {
width: calc( 20% - 1.5em );
margin-left: 0.75em;
margin-right: 0.75em;
}
.ui.six.cards {
margin-left: -0.75em;
margin-right: -0.75em;
}
.ui.six.cards > .card {
width: calc( 16.66666667% - 1.5em );
margin-left: 0.75em;
margin-right: 0.75em;
}
.ui.seven.cards {
margin-left: -0.5em;
margin-right: -0.5em;
}
.ui.seven.cards > .card {
width: calc( 14.28571429% - 1em );
margin-left: 0.5em;
margin-right: 0.5em;
}
.ui.eight.cards {
margin-left: -0.5em;
margin-right: -0.5em;
}
.ui.eight.cards > .card {
width: calc( 12.5% - 1em );
margin-left: 0.5em;
margin-right: 0.5em;
font-size: 11px;
}
.ui.nine.cards {
margin-left: -0.5em;
margin-right: -0.5em;
}
.ui.nine.cards > .card {
width: calc( 11.11111111% - 1em );
margin-left: 0.5em;
margin-right: 0.5em;
font-size: 10px;
}
.ui.ten.cards {
margin-left: -0.5em;
margin-right: -0.5em;
}
.ui.ten.cards > .card {
width: calc( 10% - 1em );
margin-left: 0.5em;
margin-right: 0.5em;
}
/*-------------------
Doubling
--------------------*/
/* Mobile Only */
@media only screen and (max-width: 767px) {
.ui.two.doubling.cards {
margin-left: 0em;
margin-right: 0em;
}
.ui.two.doubling.cards > .card {
width: 100%;
margin-left: 0em;
margin-right: 0em;
}
.ui.three.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.three.doubling.cards > .card {
width: calc( 50% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.four.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.four.doubling.cards > .card {
width: calc( 50% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.five.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.five.doubling.cards > .card {
width: calc( 50% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.six.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.six.doubling.cards > .card {
width: calc( 50% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.seven.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.seven.doubling.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.eight.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.eight.doubling.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.nine.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.nine.doubling.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.ten.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.ten.doubling.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
}
/* Tablet Only */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui.two.doubling.cards {
margin-left: 0em;
margin-right: 0em;
}
.ui.two.doubling.cards > .card {
width: 100%;
margin-left: 0em;
margin-right: 0em;
}
.ui.three.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.three.doubling.cards > .card {
width: calc( 50% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.four.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.four.doubling.cards > .card {
width: calc( 50% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.five.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.five.doubling.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.six.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.six.doubling.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.eight.doubling.cards {
margin-left: -1em;
margin-right: -1em;
}
.ui.eight.doubling.cards > .card {
width: calc( 33.33333333% - 2em );
margin-left: 1em;
margin-right: 1em;
}
.ui.eight.doubling.cards {
margin-left: -0.75em;
margin-right: -0.75em;
}
.ui.eight.doubling.cards > .card {
width: calc( 25% - 1.5em );
margin-left: 0.75em;
margin-right: 0.75em;
}
.ui.nine.doubling.cards {
margin-left: -0.75em;
margin-right: -0.75em;
}
.ui.nine.doubling.cards > .card {
width: calc( 25% - 1.5em );
margin-left: 0.75em;
margin-right: 0.75em;
}
.ui.ten.doubling.cards {
margin-left: -0.75em;
margin-right: -0.75em;
}
.ui.ten.doubling.cards > .card {
width: calc( 20% - 1.5em );
margin-left: 0.75em;
margin-right: 0.75em;
}
}
/*-------------------
Stackable
--------------------*/
@media only screen and (max-width: 767px) {
.ui.stackable.cards {
display: block !important;
}
.ui.stackable.cards .card:first-child {
margin-top: 0em !important;
}
.ui.stackable.cards > .card {
display: block !important;
height: auto !important;
margin: 1em 1em;
padding: 0 !important;
width: calc( 100% - 2em ) !important;
}
}
/*--------------
Size
---------------*/
.ui.cards > .card {
font-size: 1em;
}
/*******************************
Theme Overrides
*******************************/
/*******************************
User Variable Overrides
*******************************/

9
wms/contract-repair/semantic/Semantic-UI-master/dist/components/card.min.css

File diff suppressed because one or more lines are too long

608
wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.css

@ -0,0 +1,608 @@
/*!
* # Semantic UI 2.5.0 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Checkbox
*******************************/
/*--------------
Content
---------------*/
.ui.checkbox {
position: relative;
display: inline-block;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
outline: none;
vertical-align: baseline;
font-style: normal;
min-height: 17px;
font-size: 1rem;
line-height: 17px;
min-width: 17px;
}
/* HTML Checkbox */
.ui.checkbox input[type="checkbox"],
.ui.checkbox input[type="radio"] {
cursor: pointer;
position: absolute;
top: 0px;
left: 0px;
opacity: 0 !important;
outline: none;
z-index: 3;
width: 17px;
height: 17px;
}
/*--------------
Box
---------------*/
.ui.checkbox .box,
.ui.checkbox label {
cursor: auto;
position: relative;
display: block;
padding-left: 1.85714em;
outline: none;
font-size: 1em;
}
.ui.checkbox .box:before,
.ui.checkbox label:before {
position: absolute;
top: 0px;
left: 0px;
width: 17px;
height: 17px;
content: '';
background: #FFFFFF;
border-radius: 0.21428571rem;
transition: border 0.1s ease, opacity 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
border: 1px solid #D4D4D5;
}
/*--------------
Checkmark
---------------*/
.ui.checkbox .box:after,
.ui.checkbox label:after {
position: absolute;
font-size: 14px;
top: 0px;
left: 0px;
width: 17px;
height: 17px;
text-align: center;
opacity: 0;
color: rgba(0, 0, 0, 0.87);
transition: border 0.1s ease, opacity 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}
/*--------------
Label
---------------*/
/* Inside */
.ui.checkbox label,
.ui.checkbox + label {
color: rgba(0, 0, 0, 0.87);
transition: color 0.1s ease;
}
/* Outside */
.ui.checkbox + label {
vertical-align: middle;
}
/*******************************
States
*******************************/
/*--------------
Hover
---------------*/
.ui.checkbox .box:hover::before,
.ui.checkbox label:hover::before {
background: #FFFFFF;
border-color: rgba(34, 36, 38, 0.35);
}
.ui.checkbox label:hover,
.ui.checkbox + label:hover {
color: rgba(0, 0, 0, 0.8);
}
/*--------------
Down
---------------*/
.ui.checkbox .box:active::before,
.ui.checkbox label:active::before {
background: #F9FAFB;
border-color: rgba(34, 36, 38, 0.35);
}
.ui.checkbox .box:active::after,
.ui.checkbox label:active::after {
color: rgba(0, 0, 0, 0.95);
}
.ui.checkbox input:active ~ label {
color: rgba(0, 0, 0, 0.95);
}
/*--------------
Focus
---------------*/
.ui.checkbox input:focus ~ .box:before,
.ui.checkbox input:focus ~ label:before {
background: #FFFFFF;
border-color: #96C8DA;
}
.ui.checkbox input:focus ~ .box:after,
.ui.checkbox input:focus ~ label:after {
color: rgba(0, 0, 0, 0.95);
}
.ui.checkbox input:focus ~ label {
color: rgba(0, 0, 0, 0.95);
}
/*--------------
Active
---------------*/
.ui.checkbox input:checked ~ .box:before,
.ui.checkbox input:checked ~ label:before {
background: #FFFFFF;
border-color: rgba(34, 36, 38, 0.35);
}
.ui.checkbox input:checked ~ .box:after,
.ui.checkbox input:checked ~ label:after {
opacity: 1;
color: rgba(0, 0, 0, 0.95);
}
/*--------------
Indeterminate
---------------*/
.ui.checkbox input:not([type=radio]):indeterminate ~ .box:before,
.ui.checkbox input:not([type=radio]):indeterminate ~ label:before {
background: #FFFFFF;
border-color: rgba(34, 36, 38, 0.35);
}
.ui.checkbox input:not([type=radio]):indeterminate ~ .box:after,
.ui.checkbox input:not([type=radio]):indeterminate ~ label:after {
opacity: 1;
color: rgba(0, 0, 0, 0.95);
}
/*--------------
Active Focus
---------------*/
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ .box:before,
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ label:before,
.ui.checkbox input:checked:focus ~ .box:before,
.ui.checkbox input:checked:focus ~ label:before {
background: #FFFFFF;
border-color: #96C8DA;
}
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ .box:after,
.ui.checkbox input:not([type=radio]):indeterminate:focus ~ label:after,
.ui.checkbox input:checked:focus ~ .box:after,
.ui.checkbox input:checked:focus ~ label:after {
color: rgba(0, 0, 0, 0.95);
}
/*--------------
Read-Only
---------------*/
.ui.read-only.checkbox,
.ui.read-only.checkbox label {
cursor: default;
}
/*--------------
Disabled
---------------*/
.ui.disabled.checkbox .box:after,
.ui.disabled.checkbox label,
.ui.checkbox input[disabled] ~ .box:after,
.ui.checkbox input[disabled] ~ label {
cursor: default !important;
opacity: 0.5;
color: #000000;
}
/*--------------
Hidden
---------------*/
/* Initialized checkbox moves input below element
to prevent manually triggering */
.ui.checkbox input.hidden {
z-index: -1;
}
/* Selectable Label */
.ui.checkbox input.hidden + label {
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/*******************************
Types
*******************************/
/*--------------
Radio
---------------*/
.ui.radio.checkbox {
min-height: 15px;
}
.ui.radio.checkbox .box,
.ui.radio.checkbox label {
padding-left: 1.85714em;
}
/* Box */
.ui.radio.checkbox .box:before,
.ui.radio.checkbox label:before {
content: '';
transform: none;
width: 15px;
height: 15px;
border-radius: 500rem;
top: 1px;
left: 0px;
}
/* Bullet */
.ui.radio.checkbox .box:after,
.ui.radio.checkbox label:after {
border: none;
content: '' !important;
width: 15px;
height: 15px;
line-height: 15px;
}
/* Radio Checkbox */
.ui.radio.checkbox .box:after,
.ui.radio.checkbox label:after {
top: 1px;
left: 0px;
width: 15px;
height: 15px;
border-radius: 500rem;
transform: scale(0.46666667);
background-color: rgba(0, 0, 0, 0.87);
}
/* Focus */
.ui.radio.checkbox input:focus ~ .box:before,
.ui.radio.checkbox input:focus ~ label:before {
background-color: #FFFFFF;
}
.ui.radio.checkbox input:focus ~ .box:after,
.ui.radio.checkbox input:focus ~ label:after {
background-color: rgba(0, 0, 0, 0.95);
}
/* Indeterminate */
.ui.radio.checkbox input:indeterminate ~ .box:after,
.ui.radio.checkbox input:indeterminate ~ label:after {
opacity: 0;
}
/* Active */
.ui.radio.checkbox input:checked ~ .box:before,
.ui.radio.checkbox input:checked ~ label:before {
background-color: #FFFFFF;
}
.ui.radio.checkbox input:checked ~ .box:after,
.ui.radio.checkbox input:checked ~ label:after {
background-color: rgba(0, 0, 0, 0.95);
}
/* Active Focus */
.ui.radio.checkbox input:focus:checked ~ .box:before,
.ui.radio.checkbox input:focus:checked ~ label:before {
background-color: #FFFFFF;
}
.ui.radio.checkbox input:focus:checked ~ .box:after,
.ui.radio.checkbox input:focus:checked ~ label:after {
background-color: rgba(0, 0, 0, 0.95);
}
/*--------------
Slider
---------------*/
.ui.slider.checkbox {
min-height: 1.25rem;
}
/* Input */
.ui.slider.checkbox input {
width: 3.5rem;
height: 1.25rem;
}
/* Label */
.ui.slider.checkbox .box,
.ui.slider.checkbox label {
padding-left: 4.5rem;
line-height: 1rem;
color: rgba(0, 0, 0, 0.4);
}
/* Line */
.ui.slider.checkbox .box:before,
.ui.slider.checkbox label:before {
display: block;
position: absolute;
content: '';
border: none !important;
left: 0em;
z-index: 1;
top: 0.4rem;
background-color: rgba(0, 0, 0, 0.05);
width: 3.5rem;
height: 0.21428571rem;
transform: none;
border-radius: 500rem;
transition: background 0.3s ease;
}
/* Handle */
.ui.slider.checkbox .box:after,
.ui.slider.checkbox label:after {
background: #FFFFFF linear-gradient(transparent, rgba(0, 0, 0, 0.05));
position: absolute;
content: '' !important;
opacity: 1;
z-index: 2;
border: none;
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15) inset;
width: 1.5rem;
height: 1.5rem;
top: -0.25rem;
left: 0em;
transform: none;
border-radius: 500rem;
transition: left 0.3s ease;
}
/* Focus */
.ui.slider.checkbox input:focus ~ .box:before,
.ui.slider.checkbox input:focus ~ label:before {
background-color: rgba(0, 0, 0, 0.15);
border: none;
}
/* Hover */
.ui.slider.checkbox .box:hover,
.ui.slider.checkbox label:hover {
color: rgba(0, 0, 0, 0.8);
}
.ui.slider.checkbox .box:hover::before,
.ui.slider.checkbox label:hover::before {
background: rgba(0, 0, 0, 0.15);
}
/* Active */
.ui.slider.checkbox input:checked ~ .box,
.ui.slider.checkbox input:checked ~ label {
color: rgba(0, 0, 0, 0.95) !important;
}
.ui.slider.checkbox input:checked ~ .box:before,
.ui.slider.checkbox input:checked ~ label:before {
background-color: #545454 !important;
}
.ui.slider.checkbox input:checked ~ .box:after,
.ui.slider.checkbox input:checked ~ label:after {
left: 2rem;
}
/* Active Focus */
.ui.slider.checkbox input:focus:checked ~ .box,
.ui.slider.checkbox input:focus:checked ~ label {
color: rgba(0, 0, 0, 0.95) !important;
}
.ui.slider.checkbox input:focus:checked ~ .box:before,
.ui.slider.checkbox input:focus:checked ~ label:before {
background-color: #000000 !important;
}
/*--------------
Toggle
---------------*/
.ui.toggle.checkbox {
min-height: 1.5rem;
}
/* Input */
.ui.toggle.checkbox input {
width: 3.5rem;
height: 1.5rem;
}
/* Label */
.ui.toggle.checkbox .box,
.ui.toggle.checkbox label {
min-height: 1.5rem;
padding-left: 4.5rem;
color: rgba(0, 0, 0, 0.87);
}
.ui.toggle.checkbox label {
padding-top: 0.15em;
}
/* Switch */
.ui.toggle.checkbox .box:before,
.ui.toggle.checkbox label:before {
display: block;
position: absolute;
content: '';
z-index: 1;
transform: none;
border: none;
top: 0rem;
background: rgba(0, 0, 0, 0.05);
box-shadow: none;
width: 3.5rem;
height: 1.5rem;
border-radius: 500rem;
}
/* Handle */
.ui.toggle.checkbox .box:after,
.ui.toggle.checkbox label:after {
background: #FFFFFF linear-gradient(transparent, rgba(0, 0, 0, 0.05));
position: absolute;
content: '' !important;
opacity: 1;
z-index: 2;
border: none;
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15) inset;
width: 1.5rem;
height: 1.5rem;
top: 0rem;
left: 0em;
border-radius: 500rem;
transition: background 0.3s ease, left 0.3s ease;
}
.ui.toggle.checkbox input ~ .box:after,
.ui.toggle.checkbox input ~ label:after {
left: -0.05rem;
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15) inset;
}
/* Focus */
.ui.toggle.checkbox input:focus ~ .box:before,
.ui.toggle.checkbox input:focus ~ label:before {
background-color: rgba(0, 0, 0, 0.15);
border: none;
}
/* Hover */
.ui.toggle.checkbox .box:hover::before,
.ui.toggle.checkbox label:hover::before {
background-color: rgba(0, 0, 0, 0.15);
border: none;
}
/* Active */
.ui.toggle.checkbox input:checked ~ .box,
.ui.toggle.checkbox input:checked ~ label {
color: rgba(0, 0, 0, 0.95) !important;
}
.ui.toggle.checkbox input:checked ~ .box:before,
.ui.toggle.checkbox input:checked ~ label:before {
background-color: #2185D0 !important;
}
.ui.toggle.checkbox input:checked ~ .box:after,
.ui.toggle.checkbox input:checked ~ label:after {
left: 2.15rem;
box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15), 0px 0px 0px 1px rgba(34, 36, 38, 0.15) inset;
}
/* Active Focus */
.ui.toggle.checkbox input:focus:checked ~ .box,
.ui.toggle.checkbox input:focus:checked ~ label {
color: rgba(0, 0, 0, 0.95) !important;
}
.ui.toggle.checkbox input:focus:checked ~ .box:before,
.ui.toggle.checkbox input:focus:checked ~ label:before {
background-color: #0d71bb !important;
}
/*******************************
Variations
*******************************/
/*--------------
Fitted
---------------*/
.ui.fitted.checkbox .box,
.ui.fitted.checkbox label {
padding-left: 0em !important;
}
.ui.fitted.toggle.checkbox,
.ui.fitted.toggle.checkbox {
width: 3.5rem;
}
.ui.fitted.slider.checkbox,
.ui.fitted.slider.checkbox {
width: 3.5rem;
}
/*******************************
Theme Overrides
*******************************/
@font-face {
font-family: 'Checkbox';
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBD8AAAC8AAAAYGNtYXAYVtCJAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zn4huwUAAAF4AAABYGhlYWQGPe1ZAAAC2AAAADZoaGVhB30DyAAAAxAAAAAkaG10eBBKAEUAAAM0AAAAHGxvY2EAmgESAAADUAAAABBtYXhwAAkALwAAA2AAAAAgbmFtZSC8IugAAAOAAAABknBvc3QAAwAAAAAFFAAAACAAAwMTAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADoAgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6AL//f//AAAAAAAg6AD//f//AAH/4xgEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAEUAUQO7AvgAGgAAARQHAQYjIicBJjU0PwE2MzIfAQE2MzIfARYVA7sQ/hQQFhcQ/uMQEE4QFxcQqAF2EBcXEE4QAnMWEP4UEBABHRAXFhBOEBCoAXcQEE4QFwAAAAABAAABbgMlAkkAFAAAARUUBwYjISInJj0BNDc2MyEyFxYVAyUQEBf9SRcQEBAQFwK3FxAQAhJtFxAQEBAXbRcQEBAQFwAAAAABAAAASQMlA24ALAAAARUUBwYrARUUBwYrASInJj0BIyInJj0BNDc2OwE1NDc2OwEyFxYdATMyFxYVAyUQEBfuEBAXbhYQEO4XEBAQEBfuEBAWbhcQEO4XEBACEm0XEBDuFxAQEBAX7hAQF20XEBDuFxAQEBAX7hAQFwAAAQAAAAIAAHRSzT9fDzz1AAsEAAAAAADRsdR3AAAAANGx1HcAAAAAA7sDbgAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADuwABAAAAAAAAAAAAAAAAAAAABwQAAAAAAAAAAAAAAAIAAAAEAABFAyUAAAMlAAAAAAAAAAoAFAAeAE4AcgCwAAEAAAAHAC0AAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAIAAAAAQAAAAAAAgAHAGkAAQAAAAAAAwAIADkAAQAAAAAABAAIAH4AAQAAAAAABQALABgAAQAAAAAABgAIAFEAAQAAAAAACgAaAJYAAwABBAkAAQAQAAgAAwABBAkAAgAOAHAAAwABBAkAAwAQAEEAAwABBAkABAAQAIYAAwABBAkABQAWACMAAwABBAkABgAQAFkAAwABBAkACgA0ALBDaGVja2JveABDAGgAZQBjAGsAYgBvAHhWZXJzaW9uIDIuMABWAGUAcgBzAGkAbwBuACAAMgAuADBDaGVja2JveABDAGgAZQBjAGsAYgBvAHhDaGVja2JveABDAGgAZQBjAGsAYgBvAHhSZWd1bGFyAFIAZQBnAHUAbABhAHJDaGVja2JveABDAGgAZQBjAGsAYgBvAHhGb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype');
}
/* Checkmark */
.ui.checkbox label:after,
.ui.checkbox .box:after {
font-family: 'Checkbox';
}
/* Checked */
.ui.checkbox input:checked ~ .box:after,
.ui.checkbox input:checked ~ label:after {
content: '\e800';
}
/* Indeterminate */
.ui.checkbox input:indeterminate ~ .box:after,
.ui.checkbox input:indeterminate ~ label:after {
font-size: 12px;
content: '\e801';
}
/* UTF Reference
.check:before { content: '\e800'; }
.dash:before { content: '\e801'; }
.plus:before { content: '\e802'; }
*/
/*******************************
Site Overrides
*******************************/

831
wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.js

@ -0,0 +1,831 @@
/*!
* # Semantic UI 2.5.0 - Checkbox
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
;(function ($, window, document, undefined) {
'use strict';
window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;
$.fn.checkbox = function(parameters) {
var
$allModules = $(this),
moduleSelector = $allModules.selector || '',
time = new Date().getTime(),
performance = [],
query = arguments[0],
methodInvoked = (typeof query == 'string'),
queryArguments = [].slice.call(arguments, 1),
returnedValue
;
$allModules
.each(function() {
var
settings = $.extend(true, {}, $.fn.checkbox.settings, parameters),
className = settings.className,
namespace = settings.namespace,
selector = settings.selector,
error = settings.error,
eventNamespace = '.' + namespace,
moduleNamespace = 'module-' + namespace,
$module = $(this),
$label = $(this).children(selector.label),
$input = $(this).children(selector.input),
input = $input[0],
initialLoad = false,
shortcutPressed = false,
instance = $module.data(moduleNamespace),
observer,
element = this,
module
;
module = {
initialize: function() {
module.verbose('Initializing checkbox', settings);
module.create.label();
module.bind.events();
module.set.tabbable();
module.hide.input();
module.observeChanges();
module.instantiate();
module.setup();
},
instantiate: function() {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
},
destroy: function() {
module.verbose('Destroying module');
module.unbind.events();
module.show.input();
$module.removeData(moduleNamespace);
},
fix: {
reference: function() {
if( $module.is(selector.input) ) {
module.debug('Behavior called on <input> adjusting invoked element');
$module = $module.closest(selector.checkbox);
module.refresh();
}
}
},
setup: function() {
module.set.initialLoad();
if( module.is.indeterminate() ) {
module.debug('Initial value is indeterminate');
module.indeterminate();
}
else if( module.is.checked() ) {
module.debug('Initial value is checked');
module.check();
}
else {
module.debug('Initial value is unchecked');
module.uncheck();
}
module.remove.initialLoad();
},
refresh: function() {
$label = $module.children(selector.label);
$input = $module.children(selector.input);
input = $input[0];
},
hide: {
input: function() {
module.verbose('Modifying <input> z-index to be unselectable');
$input.addClass(className.hidden);
}
},
show: {
input: function() {
module.verbose('Modifying <input> z-index to be selectable');
$input.removeClass(className.hidden);
}
},
observeChanges: function() {
if('MutationObserver' in window) {
observer = new MutationObserver(function(mutations) {
module.debug('DOM tree modified, updating selector cache');
module.refresh();
});
observer.observe(element, {
childList : true,
subtree : true
});
module.debug('Setting up mutation observer', observer);
}
},
attachEvents: function(selector, event) {
var
$element = $(selector)
;
event = $.isFunction(module[event])
? module[event]
: module.toggle
;
if($element.length > 0) {
module.debug('Attaching checkbox events to element', selector, event);
$element
.on('click' + eventNamespace, event)
;
}
else {
module.error(error.notFound);
}
},
event: {
click: function(event) {
var
$target = $(event.target)
;
if( $target.is(selector.input) ) {
module.verbose('Using default check action on initialized checkbox');
return;
}
if( $target.is(selector.link) ) {
module.debug('Clicking link inside checkbox, skipping toggle');
return;
}
module.toggle();
$input.focus();
event.preventDefault();
},
keydown: function(event) {
var
key = event.which,
keyCode = {
enter : 13,
space : 32,
escape : 27
}
;
if(key == keyCode.escape) {
module.verbose('Escape key pressed blurring field');
$input.blur();
shortcutPressed = true;
}
else if(!event.ctrlKey && ( key == keyCode.space || key == keyCode.enter) ) {
module.verbose('Enter/space key pressed, toggling checkbox');
module.toggle();
shortcutPressed = true;
}
else {
shortcutPressed = false;
}
},
keyup: function(event) {
if(shortcutPressed) {
event.preventDefault();
}
}
},
check: function() {
if( !module.should.allowCheck() ) {
return;
}
module.debug('Checking checkbox', $input);
module.set.checked();
if( !module.should.ignoreCallbacks() ) {
settings.onChecked.call(input);
settings.onChange.call(input);
}
},
uncheck: function() {
if( !module.should.allowUncheck() ) {
return;
}
module.debug('Unchecking checkbox');
module.set.unchecked();
if( !module.should.ignoreCallbacks() ) {
settings.onUnchecked.call(input);
settings.onChange.call(input);
}
},
indeterminate: function() {
if( module.should.allowIndeterminate() ) {
module.debug('Checkbox is already indeterminate');
return;
}
module.debug('Making checkbox indeterminate');
module.set.indeterminate();
if( !module.should.ignoreCallbacks() ) {
settings.onIndeterminate.call(input);
settings.onChange.call(input);
}
},
determinate: function() {
if( module.should.allowDeterminate() ) {
module.debug('Checkbox is already determinate');
return;
}
module.debug('Making checkbox determinate');
module.set.determinate();
if( !module.should.ignoreCallbacks() ) {
settings.onDeterminate.call(input);
settings.onChange.call(input);
}
},
enable: function() {
if( module.is.enabled() ) {
module.debug('Checkbox is already enabled');
return;
}
module.debug('Enabling checkbox');
module.set.enabled();
settings.onEnable.call(input);
// preserve legacy callbacks
settings.onEnabled.call(input);
},
disable: function() {
if( module.is.disabled() ) {
module.debug('Checkbox is already disabled');
return;
}
module.debug('Disabling checkbox');
module.set.disabled();
settings.onDisable.call(input);
// preserve legacy callbacks
settings.onDisabled.call(input);
},
get: {
radios: function() {
var
name = module.get.name()
;
return $('input[name="' + name + '"]').closest(selector.checkbox);
},
otherRadios: function() {
return module.get.radios().not($module);
},
name: function() {
return $input.attr('name');
}
},
is: {
initialLoad: function() {
return initialLoad;
},
radio: function() {
return ($input.hasClass(className.radio) || $input.attr('type') == 'radio');
},
indeterminate: function() {
return $input.prop('indeterminate') !== undefined && $input.prop('indeterminate');
},
checked: function() {
return $input.prop('checked') !== undefined && $input.prop('checked');
},
disabled: function() {
return $input.prop('disabled') !== undefined && $input.prop('disabled');
},
enabled: function() {
return !module.is.disabled();
},
determinate: function() {
return !module.is.indeterminate();
},
unchecked: function() {
return !module.is.checked();
}
},
should: {
allowCheck: function() {
if(module.is.determinate() && module.is.checked() && !module.should.forceCallbacks() ) {
module.debug('Should not allow check, checkbox is already checked');
return false;
}
if(settings.beforeChecked.apply(input) === false) {
module.debug('Should not allow check, beforeChecked cancelled');
return false;
}
return true;
},
allowUncheck: function() {
if(module.is.determinate() && module.is.unchecked() && !module.should.forceCallbacks() ) {
module.debug('Should not allow uncheck, checkbox is already unchecked');
return false;
}
if(settings.beforeUnchecked.apply(input) === false) {
module.debug('Should not allow uncheck, beforeUnchecked cancelled');
return false;
}
return true;
},
allowIndeterminate: function() {
if(module.is.indeterminate() && !module.should.forceCallbacks() ) {
module.debug('Should not allow indeterminate, checkbox is already indeterminate');
return false;
}
if(settings.beforeIndeterminate.apply(input) === false) {
module.debug('Should not allow indeterminate, beforeIndeterminate cancelled');
return false;
}
return true;
},
allowDeterminate: function() {
if(module.is.determinate() && !module.should.forceCallbacks() ) {
module.debug('Should not allow determinate, checkbox is already determinate');
return false;
}
if(settings.beforeDeterminate.apply(input) === false) {
module.debug('Should not allow determinate, beforeDeterminate cancelled');
return false;
}
return true;
},
forceCallbacks: function() {
return (module.is.initialLoad() && settings.fireOnInit);
},
ignoreCallbacks: function() {
return (initialLoad && !settings.fireOnInit);
}
},
can: {
change: function() {
return !( $module.hasClass(className.disabled) || $module.hasClass(className.readOnly) || $input.prop('disabled') || $input.prop('readonly') );
},
uncheck: function() {
return (typeof settings.uncheckable === 'boolean')
? settings.uncheckable
: !module.is.radio()
;
}
},
set: {
initialLoad: function() {
initialLoad = true;
},
checked: function() {
module.verbose('Setting class to checked');
$module
.removeClass(className.indeterminate)
.addClass(className.checked)
;
if( module.is.radio() ) {
module.uncheckOthers();
}
if(!module.is.indeterminate() && module.is.checked()) {
module.debug('Input is already checked, skipping input property change');
return;
}
module.verbose('Setting state to checked', input);
$input
.prop('indeterminate', false)
.prop('checked', true)
;
module.trigger.change();
},
unchecked: function() {
module.verbose('Removing checked class');
$module
.removeClass(className.indeterminate)
.removeClass(className.checked)
;
if(!module.is.indeterminate() && module.is.unchecked() ) {
module.debug('Input is already unchecked');
return;
}
module.debug('Setting state to unchecked');
$input
.prop('indeterminate', false)
.prop('checked', false)
;
module.trigger.change();
},
indeterminate: function() {
module.verbose('Setting class to indeterminate');
$module
.addClass(className.indeterminate)
;
if( module.is.indeterminate() ) {
module.debug('Input is already indeterminate, skipping input property change');
return;
}
module.debug('Setting state to indeterminate');
$input
.prop('indeterminate', true)
;
module.trigger.change();
},
determinate: function() {
module.verbose('Removing indeterminate class');
$module
.removeClass(className.indeterminate)
;
if( module.is.determinate() ) {
module.debug('Input is already determinate, skipping input property change');
return;
}
module.debug('Setting state to determinate');
$input
.prop('indeterminate', false)
;
},
disabled: function() {
module.verbose('Setting class to disabled');
$module
.addClass(className.disabled)
;
if( module.is.disabled() ) {
module.debug('Input is already disabled, skipping input property change');
return;
}
module.debug('Setting state to disabled');
$input
.prop('disabled', 'disabled')
;
module.trigger.change();
},
enabled: function() {
module.verbose('Removing disabled class');
$module.removeClass(className.disabled);
if( module.is.enabled() ) {
module.debug('Input is already enabled, skipping input property change');
return;
}
module.debug('Setting state to enabled');
$input
.prop('disabled', false)
;
module.trigger.change();
},
tabbable: function() {
module.verbose('Adding tabindex to checkbox');
if( $input.attr('tabindex') === undefined) {
$input.attr('tabindex', 0);
}
}
},
remove: {
initialLoad: function() {
initialLoad = false;
}
},
trigger: {
change: function() {
var
events = document.createEvent('HTMLEvents'),
inputElement = $input[0]
;
if(inputElement) {
module.verbose('Triggering native change event');
events.initEvent('change', true, false);
inputElement.dispatchEvent(events);
}
}
},
create: {
label: function() {
if($input.prevAll(selector.label).length > 0) {
$input.prev(selector.label).detach().insertAfter($input);
module.debug('Moving existing label', $label);
}
else if( !module.has.label() ) {
$label = $('<label>').insertAfter($input);
module.debug('Creating label', $label);
}
}
},
has: {
label: function() {
return ($label.length > 0);
}
},
bind: {
events: function() {
module.verbose('Attaching checkbox events');
$module
.on('click' + eventNamespace, module.event.click)
.on('keydown' + eventNamespace, selector.input, module.event.keydown)
.on('keyup' + eventNamespace, selector.input, module.event.keyup)
;
}
},
unbind: {
events: function() {
module.debug('Removing events');
$module
.off(eventNamespace)
;
}
},
uncheckOthers: function() {
var
$radios = module.get.otherRadios()
;
module.debug('Unchecking other radios', $radios);
$radios.removeClass(className.checked);
},
toggle: function() {
if( !module.can.change() ) {
if(!module.is.radio()) {
module.debug('Checkbox is read-only or disabled, ignoring toggle');
}
return;
}
if( module.is.indeterminate() || module.is.unchecked() ) {
module.debug('Currently unchecked');
module.check();
}
else if( module.is.checked() && module.can.uncheck() ) {
module.debug('Currently checked');
module.uncheck();
}
},
setting: function(name, value) {
module.debug('Changing setting', name, value);
if( $.isPlainObject(name) ) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
if($.isPlainObject(settings[name])) {
$.extend(true, settings[name], value);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
}
},
internal: function(name, value) {
if( $.isPlainObject(name) ) {
$.extend(true, module, name);
}
else if(value !== undefined) {
module[name] = value;
}
else {
return module[name];
}
},
debug: function() {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.debug.apply(console, arguments);
}
}
},
verbose: function() {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
else {
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
module.verbose.apply(console, arguments);
}
}
},
error: function() {
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
}
},
performance: {
log: function(message) {
var
currentTime,
executionTime,
previousTime
;
if(settings.performance) {
currentTime = new Date().getTime();
previousTime = time || currentTime;
executionTime = currentTime - previousTime;
time = currentTime;
performance.push({
'Name' : message[0],
'Arguments' : [].slice.call(message, 1) || '',
'Element' : element,
'Execution Time' : executionTime
});
}
clearTimeout(module.performance.timer);
module.performance.timer = setTimeout(module.performance.display, 500);
},
display: function() {
var
title = settings.name + ':',
totalTime = 0
;
time = false;
clearTimeout(module.performance.timer);
$.each(performance, function(index, data) {
totalTime += data['Execution Time'];
});
title += ' ' + totalTime + 'ms';
if(moduleSelector) {
title += ' \'' + moduleSelector + '\'';
}
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
console.groupCollapsed(title);
if(console.table) {
console.table(performance);
}
else {
$.each(performance, function(index, data) {
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
});
}
console.groupEnd();
}
performance = [];
}
},
invoke: function(query, passedArguments, context) {
var
object = instance,
maxDepth,
found,
response
;
passedArguments = passedArguments || queryArguments;
context = element || context;
if(typeof query == 'string' && object !== undefined) {
query = query.split(/[\. ]/);
maxDepth = query.length - 1;
$.each(query, function(depth, value) {
var camelCaseValue = (depth != maxDepth)
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
: query
;
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
object = object[camelCaseValue];
}
else if( object[camelCaseValue] !== undefined ) {
found = object[camelCaseValue];
return false;
}
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
object = object[value];
}
else if( object[value] !== undefined ) {
found = object[value];
return false;
}
else {
module.error(error.method, query);
return false;
}
});
}
if ( $.isFunction( found ) ) {
response = found.apply(context, passedArguments);
}
else if(found !== undefined) {
response = found;
}
if($.isArray(returnedValue)) {
returnedValue.push(response);
}
else if(returnedValue !== undefined) {
returnedValue = [returnedValue, response];
}
else if(response !== undefined) {
returnedValue = response;
}
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
}
module.invoke(query);
}
else {
if(instance !== undefined) {
instance.invoke('destroy');
}
module.initialize();
}
})
;
return (returnedValue !== undefined)
? returnedValue
: this
;
};
$.fn.checkbox.settings = {
name : 'Checkbox',
namespace : 'checkbox',
silent : false,
debug : false,
verbose : true,
performance : true,
// delegated event context
uncheckable : 'auto',
fireOnInit : false,
onChange : function(){},
beforeChecked : function(){},
beforeUnchecked : function(){},
beforeDeterminate : function(){},
beforeIndeterminate : function(){},
onChecked : function(){},
onUnchecked : function(){},
onDeterminate : function() {},
onIndeterminate : function() {},
onEnable : function(){},
onDisable : function(){},
// preserve misspelled callbacks (will be removed in 3.0)
onEnabled : function(){},
onDisabled : function(){},
className : {
checked : 'checked',
indeterminate : 'indeterminate',
disabled : 'disabled',
hidden : 'hidden',
radio : 'radio',
readOnly : 'read-only'
},
error : {
method : 'The method you called is not defined'
},
selector : {
checkbox : '.ui.checkbox',
label : 'label, .box',
input : 'input[type="checkbox"], input[type="radio"]',
link : 'a[href]'
}
};
})( jQuery, window, document );

9
wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.min.css

File diff suppressed because one or more lines are too long

1
wms/contract-repair/semantic/Semantic-UI-master/dist/components/checkbox.min.js

File diff suppressed because one or more lines are too long

268
wms/contract-repair/semantic/Semantic-UI-master/dist/components/comment.css

@ -0,0 +1,268 @@
/*!
* # Semantic UI 2.5.0 - Comment
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Standard
*******************************/
/*--------------
Comments
---------------*/
.ui.comments {
margin: 1.5em 0em;
max-width: 650px;
}
.ui.comments:first-child {
margin-top: 0em;
}
.ui.comments:last-child {
margin-bottom: 0em;
}
/*--------------
Comment
---------------*/
.ui.comments .comment {
position: relative;
background: none;
margin: 0.5em 0em 0em;
padding: 0.5em 0em 0em;
border: none;
border-top: none;
line-height: 1.2;
}
.ui.comments .comment:first-child {
margin-top: 0em;
padding-top: 0em;
}
/*--------------------
Nested Comments
---------------------*/
.ui.comments .comment .comments {
margin: 0em 0em 0.5em 0.5em;
padding: 1em 0em 1em 1em;
}
.ui.comments .comment .comments:before {
position: absolute;
top: 0px;
left: 0px;
}
.ui.comments .comment .comments .comment {
border: none;
border-top: none;
background: none;
}
/*--------------
Avatar
---------------*/
.ui.comments .comment .avatar {
display: block;
width: 2.5em;
height: auto;
float: left;
margin: 0.2em 0em 0em;
}
.ui.comments .comment img.avatar,
.ui.comments .comment .avatar img {
display: block;
margin: 0em auto;
width: 100%;
height: 100%;
border-radius: 0.25rem;
}
/*--------------
Content
---------------*/
.ui.comments .comment > .content {
display: block;
}
/* If there is an avatar move content over */
.ui.comments .comment > .avatar ~ .content {
margin-left: 3.5em;
}
/*--------------
Author
---------------*/
.ui.comments .comment .author {
font-size: 1em;
color: rgba(0, 0, 0, 0.87);
font-weight: bold;
}
.ui.comments .comment a.author {
cursor: pointer;
}
.ui.comments .comment a.author:hover {
color: #1e70bf;
}
/*--------------
Metadata
---------------*/
.ui.comments .comment .metadata {
display: inline-block;
margin-left: 0.5em;
color: rgba(0, 0, 0, 0.4);
font-size: 0.875em;
}
.ui.comments .comment .metadata > * {
display: inline-block;
margin: 0em 0.5em 0em 0em;
}
.ui.comments .comment .metadata > :last-child {
margin-right: 0em;
}
/*--------------------
Comment Text
---------------------*/
.ui.comments .comment .text {
margin: 0.25em 0em 0.5em;
font-size: 1em;
word-wrap: break-word;
color: rgba(0, 0, 0, 0.87);
line-height: 1.3;
}
/*--------------------
User Actions
---------------------*/
.ui.comments .comment .actions {
font-size: 0.875em;
}
.ui.comments .comment .actions a {
cursor: pointer;
display: inline-block;
margin: 0em 0.75em 0em 0em;
color: rgba(0, 0, 0, 0.4);
}
.ui.comments .comment .actions a:last-child {
margin-right: 0em;
}
.ui.comments .comment .actions a.active,
.ui.comments .comment .actions a:hover {
color: rgba(0, 0, 0, 0.8);
}
/*--------------------
Reply Form
---------------------*/
.ui.comments > .reply.form {
margin-top: 1em;
}
.ui.comments .comment .reply.form {
width: 100%;
margin-top: 1em;
}
.ui.comments .reply.form textarea {
font-size: 1em;
height: 12em;
}
/*******************************
State
*******************************/
.ui.collapsed.comments,
.ui.comments .collapsed.comments,
.ui.comments .collapsed.comment {
display: none;
}
/*******************************
Variations
*******************************/
/*--------------------
Threaded
---------------------*/
.ui.threaded.comments .comment .comments {
margin: -1.5em 0 -1em 1.25em;
padding: 3em 0em 2em 2.25em;
box-shadow: -1px 0px 0px rgba(34, 36, 38, 0.15);
}
/*--------------------
Minimal
---------------------*/
.ui.minimal.comments .comment .actions {
opacity: 0;
position: absolute;
top: 0px;
right: 0px;
left: auto;
transition: opacity 0.2s ease;
transition-delay: 0.1s;
}
.ui.minimal.comments .comment > .content:hover > .actions {
opacity: 1;
}
/*-------------------
Sizes
--------------------*/
.ui.mini.comments {
font-size: 0.78571429rem;
}
.ui.tiny.comments {
font-size: 0.85714286rem;
}
.ui.small.comments {
font-size: 0.92857143rem;
}
.ui.comments {
font-size: 1rem;
}
.ui.large.comments {
font-size: 1.14285714rem;
}
.ui.big.comments {
font-size: 1.28571429rem;
}
.ui.huge.comments {
font-size: 1.42857143rem;
}
.ui.massive.comments {
font-size: 1.71428571rem;
}
/*******************************
Theme Overrides
*******************************/
/*******************************
User Variable Overrides
*******************************/

9
wms/contract-repair/semantic/Semantic-UI-master/dist/components/comment.min.css

@ -0,0 +1,9 @@
/*!
* # Semantic UI 2.5.0 - Comment
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/.ui.comments{margin:1.5em 0;max-width:650px}.ui.comments:first-child{margin-top:0}.ui.comments:last-child{margin-bottom:0}.ui.comments .comment{position:relative;background:0 0;margin:.5em 0 0;padding:.5em 0 0;border:none;border-top:none;line-height:1.2}.ui.comments .comment:first-child{margin-top:0;padding-top:0}.ui.comments .comment .comments{margin:0 0 .5em .5em;padding:1em 0 1em 1em}.ui.comments .comment .comments:before{position:absolute;top:0;left:0}.ui.comments .comment .comments .comment{border:none;border-top:none;background:0 0}.ui.comments .comment .avatar{display:block;width:2.5em;height:auto;float:left;margin:.2em 0 0}.ui.comments .comment .avatar img,.ui.comments .comment img.avatar{display:block;margin:0 auto;width:100%;height:100%;border-radius:.25rem}.ui.comments .comment>.content{display:block}.ui.comments .comment>.avatar~.content{margin-left:3.5em}.ui.comments .comment .author{font-size:1em;color:rgba(0,0,0,.87);font-weight:700}.ui.comments .comment a.author{cursor:pointer}.ui.comments .comment a.author:hover{color:#1e70bf}.ui.comments .comment .metadata{display:inline-block;margin-left:.5em;color:rgba(0,0,0,.4);font-size:.875em}.ui.comments .comment .metadata>*{display:inline-block;margin:0 .5em 0 0}.ui.comments .comment .metadata>:last-child{margin-right:0}.ui.comments .comment .text{margin:.25em 0 .5em;font-size:1em;word-wrap:break-word;color:rgba(0,0,0,.87);line-height:1.3}.ui.comments .comment .actions{font-size:.875em}.ui.comments .comment .actions a{cursor:pointer;display:inline-block;margin:0 .75em 0 0;color:rgba(0,0,0,.4)}.ui.comments .comment .actions a:last-child{margin-right:0}.ui.comments .comment .actions a.active,.ui.comments .comment .actions a:hover{color:rgba(0,0,0,.8)}.ui.comments>.reply.form{margin-top:1em}.ui.comments .comment .reply.form{width:100%;margin-top:1em}.ui.comments .reply.form textarea{font-size:1em;height:12em}.ui.collapsed.comments,.ui.comments .collapsed.comment,.ui.comments .collapsed.comments{display:none}.ui.threaded.comments .comment .comments{margin:-1.5em 0 -1em 1.25em;padding:3em 0 2em 2.25em;box-shadow:-1px 0 0 rgba(34,36,38,.15)}.ui.minimal.comments .comment .actions{opacity:0;position:absolute;top:0;right:0;left:auto;transition:opacity .2s ease;transition-delay:.1s}.ui.minimal.comments .comment>.content:hover>.actions{opacity:1}.ui.mini.comments{font-size:.78571429rem}.ui.tiny.comments{font-size:.85714286rem}.ui.small.comments{font-size:.92857143rem}.ui.comments{font-size:1rem}.ui.large.comments{font-size:1.14285714rem}.ui.big.comments{font-size:1.28571429rem}.ui.huge.comments{font-size:1.42857143rem}.ui.massive.comments{font-size:1.71428571rem}

147
wms/contract-repair/semantic/Semantic-UI-master/dist/components/container.css

@ -0,0 +1,147 @@
/*!
* # Semantic UI 2.5.0 - Container
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Container
*******************************/
/* All Sizes */
.ui.container {
display: block;
max-width: 100% !important;
}
/* Mobile */
@media only screen and (max-width: 767px) {
.ui.container {
width: auto !important;
margin-left: 1em !important;
margin-right: 1em !important;
}
.ui.grid.container {
width: auto !important;
}
.ui.relaxed.grid.container {
width: auto !important;
}
.ui.very.relaxed.grid.container {
width: auto !important;
}
}
/* Tablet */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui.container {
width: 723px;
margin-left: auto !important;
margin-right: auto !important;
}
.ui.grid.container {
width: calc( 723px + 2rem ) !important;
}
.ui.relaxed.grid.container {
width: calc( 723px + 3rem ) !important;
}
.ui.very.relaxed.grid.container {
width: calc( 723px + 5rem ) !important;
}
}
/* Small Monitor */
@media only screen and (min-width: 992px) and (max-width: 1199px) {
.ui.container {
width: 933px;
margin-left: auto !important;
margin-right: auto !important;
}
.ui.grid.container {
width: calc( 933px + 2rem ) !important;
}
.ui.relaxed.grid.container {
width: calc( 933px + 3rem ) !important;
}
.ui.very.relaxed.grid.container {
width: calc( 933px + 5rem ) !important;
}
}
/* Large Monitor */
@media only screen and (min-width: 1200px) {
.ui.container {
width: 1127px;
margin-left: auto !important;
margin-right: auto !important;
}
.ui.grid.container {
width: calc( 1127px + 2rem ) !important;
}
.ui.relaxed.grid.container {
width: calc( 1127px + 3rem ) !important;
}
.ui.very.relaxed.grid.container {
width: calc( 1127px + 5rem ) !important;
}
}
/*******************************
Types
*******************************/
/* Text Container */
.ui.text.container {
font-family: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
max-width: 700px !important;
line-height: 1.5;
}
.ui.text.container {
font-size: 1.14285714rem;
}
/* Fluid */
.ui.fluid.container {
width: 100%;
}
/*******************************
Variations
*******************************/
.ui[class*="left aligned"].container {
text-align: left;
}
.ui[class*="center aligned"].container {
text-align: center;
}
.ui[class*="right aligned"].container {
text-align: right;
}
.ui.justified.container {
text-align: justify;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
/*******************************
Theme Overrides
*******************************/
/*******************************
Site Overrides
*******************************/

9
wms/contract-repair/semantic/Semantic-UI-master/dist/components/container.min.css

@ -0,0 +1,9 @@
/*!
* # Semantic UI 2.5.0 - Container
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/.ui.container{display:block;max-width:100%!important}@media only screen and (max-width:767px){.ui.container{width:auto!important;margin-left:1em!important;margin-right:1em!important}.ui.grid.container{width:auto!important}.ui.relaxed.grid.container{width:auto!important}.ui.very.relaxed.grid.container{width:auto!important}}@media only screen and (min-width:768px) and (max-width:991px){.ui.container{width:723px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(723px + 2rem)!important}.ui.relaxed.grid.container{width:calc(723px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(723px + 5rem)!important}}@media only screen and (min-width:992px) and (max-width:1199px){.ui.container{width:933px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(933px + 2rem)!important}.ui.relaxed.grid.container{width:calc(933px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(933px + 5rem)!important}}@media only screen and (min-width:1200px){.ui.container{width:1127px;margin-left:auto!important;margin-right:auto!important}.ui.grid.container{width:calc(1127px + 2rem)!important}.ui.relaxed.grid.container{width:calc(1127px + 3rem)!important}.ui.very.relaxed.grid.container{width:calc(1127px + 5rem)!important}}.ui.text.container{font-family:Lato,'Helvetica Neue',Arial,Helvetica,sans-serif;max-width:700px!important;line-height:1.5}.ui.text.container{font-size:1.14285714rem}.ui.fluid.container{width:100%}.ui[class*="left aligned"].container{text-align:left}.ui[class*="center aligned"].container{text-align:center}.ui[class*="right aligned"].container{text-align:right}.ui.justified.container{text-align:justify;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}

235
wms/contract-repair/semantic/Semantic-UI-master/dist/components/dimmer.css

@ -0,0 +1,235 @@
/*!
* # Semantic UI 2.5.0 - Dimmer
* http://github.com/semantic-org/semantic-ui/
*
*
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Dimmer
*******************************/
.dimmable:not(body) {
position: relative;
}
.ui.dimmer {
display: none;
position: absolute;
top: 0em !important;
left: 0em !important;
width: 100%;
height: 100%;
text-align: center;
vertical-align: middle;
padding: 1em;
background-color: rgba(0, 0, 0, 0.85);
opacity: 0;
line-height: 1;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation-duration: 0.5s;
animation-duration: 0.5s;
transition: background-color 0.5s linear;
flex-direction: column;
align-items: center;
justify-content: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
will-change: opacity;
z-index: 1000;
}
/* Dimmer Content */
.ui.dimmer > .content {
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
color: #FFFFFF;
}
/* Loose Coupling */
.ui.segment > .ui.dimmer {
border-radius: inherit !important;
}
/* Scrollbars */
.ui.dimmer:not(.inverted)::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
}
.ui.dimmer:not(.inverted)::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.25);
}
.ui.dimmer:not(.inverted)::-webkit-scrollbar-thumb:window-inactive {
background: rgba(255, 255, 255, 0.15);
}
.ui.dimmer:not(.inverted)::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.35);
}
/*******************************
States
*******************************/
/* Animating */
.animating.dimmable:not(body),
.dimmed.dimmable:not(body) {
overflow: hidden;
}
/* Animating / Active / Visible */
.dimmed.dimmable > .ui.animating.dimmer,
.dimmed.dimmable > .ui.visible.dimmer,
.ui.active.dimmer {
display: flex;
opacity: 1;
}
/* Disabled */
.ui.disabled.dimmer {
width: 0 !important;
height: 0 !important;
}
/*******************************
Variations
*******************************/
/*--------------
Legacy
---------------*/
/* Animating / Active / Visible */
.dimmed.dimmable > .ui.animating.legacy.dimmer,
.dimmed.dimmable > .ui.visible.legacy.dimmer,
.ui.active.legacy.dimmer {
display: block;
}
/*--------------
Alignment
---------------*/
.ui[class*="top aligned"].dimmer {
justify-content: flex-start;
}
.ui[class*="bottom aligned"].dimmer {
justify-content: flex-end;
}
/*--------------
Page
---------------*/
.ui.page.dimmer {
position: fixed;
transform-style: '';
perspective: 2000px;
transform-origin: center center;
}
body.animating.in.dimmable,
body.dimmed.dimmable {
overflow: hidden;
}
body.dimmable > .dimmer {
position: fixed;
}
/*--------------
Blurring
---------------*/
.blurring.dimmable > :not(.dimmer) {
-webkit-filter: blur(0px) grayscale(0);
filter: blur(0px) grayscale(0);
transition: 800ms -webkit-filter ease;
transition: 800ms filter ease;
transition: 800ms filter ease, 800ms -webkit-filter ease;
}
.blurring.dimmed.dimmable > :not(.dimmer) {
-webkit-filter: blur(5px) grayscale(0.7);
filter: blur(5px) grayscale(0.7);
}
/* Dimmer Color */
.blurring.dimmable > .dimmer {
background-color: rgba(0, 0, 0, 0.6);
}
.blurring.dimmable > .inverted.dimmer {
background-color: rgba(255, 255, 255, 0.6);
}
/*--------------
Aligned
---------------*/
.ui.dimmer > .top.aligned.content > * {
vertical-align: top;
}
.ui.dimmer > .bottom.aligned.content > * {
vertical-align: bottom;
}
/*--------------
Inverted
---------------*/
.ui.inverted.dimmer {
background-color: rgba(255, 255, 255, 0.85);
}
.ui.inverted.dimmer > .content > * {
color: #FFFFFF;
}
/*--------------
Simple
---------------*/
/* Displays without javascript */
.ui.simple.dimmer {
display: block;
overflow: hidden;
opacity: 1;
width: 0%;
height: 0%;
z-index: -100;
background-color: rgba(0, 0, 0, 0);
}
.dimmed.dimmable > .ui.simple.dimmer {
overflow: visible;
opacity: 1;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.85);
z-index: 1;
}
.ui.simple.inverted.dimmer {
background-color: rgba(255, 255, 255, 0);
}
.dimmed.dimmable > .ui.simple.inverted.dimmer {
background-color: rgba(255, 255, 255, 0.85);
}
/*******************************
Theme Overrides
*******************************/
/*******************************
User Overrides
*******************************/

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save