Browse Source

20240111

main
Cheng 1 year ago
parent
commit
76c868d107
  1. 13
      wms/cont/apply_form.php
  2. 138
      wms/contract/api/testT8API.php
  3. 2
      wms/contract/contract-download.php
  4. 15
      wms/contract/contract-new-apply.php
  5. 5
      wms/crm/crmm03-edit.php
  6. 2
      wms/crm/crmm06-edit.php
  7. 6
      wms/fun_global.php
  8. 4
      wms/mkt/pricereview-index.php

13
wms/cont/apply_form.php

@ -67,11 +67,10 @@ $subflow_assign_opinions = SubflowManager::getCounterSignComments($form_key);
$wf->setFormData(['discount' => 100]);
$flowName = $wf->getFlowName();
$assigner = $wf->getAssignerList();
$assign_status = $wf->getAssignStatus($assigner);
echo '<pre>';
print_r($assigner);
echo '</pre>';
// echo '<pre>';
// print_r($assign_status);
// echo '</pre>';
$if_show_assign = true;
//加載流程圖
//$fc = WorkFLowItems::get_records($flow->getSystemID(), $flow->getFlowID());
@ -247,8 +246,8 @@ if ($result['department_id'] == '511') {
$managerid = 'M0137';
$managername = '劉永德';
} else if ($result['department_id'] == '512') {
$managerid = 'M0137';
$managername = '劉永德';
$managerid = 'M0054';
$managername = '陳志文';
} else if ($result['department_id'] == '513') {
$managerid = 'M0086';
$managername = '李烘銘';
@ -662,7 +661,7 @@ if ($result['department_id'] == 'M0137' || $result['department_id'] == 'M0086' |
</td>
</tr>
<tr>
<td colspan='18' ;><button onClick='addRow()' type="button" style='float:right' class="btn btn-link btn-md">+新增</button></td>
<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

138
wms/contract/api/testT8API.php

@ -1,86 +1,66 @@
<?php
require_once('../../T8_Authorization_from_bpm.php');
require_once('../connt8.php');
$sql = "SELECT * FROM salIncomeApplyMaster WHERE BillNo = '3TX10701' ";
$stmt = $connT8->prepare($sql);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$validation = get_Auth();
$data = [
[
"name" => "OtherStockOutMtable",
"rows" => [
[
"BillNo" => "00850110", // 單據編號 varchar(20)
"BillDate" => 20210427, // 單據日期 int
"OrgId" => "1000", //組織 varchar(20)
"FOrgId" => "1000", //核算組織 varchar(20)
"TypeId" => "OS", //單據類型 varchar(10)
"BizPartnerId" => "", //往來對象(供應商) 可為空
"PersonId" => "C0003", // 經辦人員 varchar(20)
"DeptId" => "250", // 經辦部門 varchar(20)
"CompId" => "1001" // 公司 varchar(20)
]
]
], [
"name" => "OtherStockOutDetail",
"rows" => [
[
"BillNo" => "00850110", //單據編號 varchar(20)
"RowCode" => 1, // 序號 int(10)
"MaterialId" => "MX00021003", // 產品代碼 -> 產品集成 varchar(40)
"SupplyOrgId" => "1000", // 供貨組織代碼 varchar(20)
"SQuantity" => 1, // 交易數量 numeric(19)
"WarehouseId" => "100" // 倉庫代碼 varchar(20)
]
]
]
];
$api_url = 'https://erp.masada.com.tw:780/twWebAPI/V1/STKOTHERSTOCKOUT/PostERPData';
$header = [
"CHI_Authorization :" . $validation
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url); // 设置请求的URL
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if ($response === false) {
echo 'Curl error: ' . curl_error($ch);
} else {
$result = json_decode($response, true);
if ($result['Status'] == 'Error') {
echo '<pre>';
print_r($result);
echo '</pre>';
// $date = date("Y-m-d");
// $date1 = str_replace('-', '', $date);
// $arr = [
// "date" => $date1
// ];
// echo '<pre>';
// print_r($arr);
// echo '</pre>';
// $validation = get_Auth();
// $data = [
// [
// "name" => "OtherStockOutMtable",
// "rows" => [
// [
// "BillNo" => "00850110", // 單據編號 varchar(20)
// "BillDate" => 20210427, // 單據日期 int
// "OrgId" => "1000", //組織 varchar(20)
// "FOrgId" => "1000", //核算組織 varchar(20)
// "TypeId" => "OS", //單據類型 varchar(10)
// "BizPartnerId" => "", //往來對象(供應商) 可為空
// "PersonId" => "C0003", // 經辦人員 varchar(20)
// "DeptId" => "250", // 經辦部門 varchar(20)
// "CompId" => "1001" // 公司 varchar(20)
// ]
// ]
// ], [
// "name" => "OtherStockOutDetail",
// "rows" => [
// [
// "BillNo" => "00850110", //單據編號 varchar(20)
// "RowCode" => 1, // 序號 int(10)
// "MaterialId" => "MX00021003", // 產品代碼 -> 產品集成 varchar(40)
// "SupplyOrgId" => "1000", // 供貨組織代碼 varchar(20)
// "SQuantity" => 1, // 交易數量 numeric(19)
// "WarehouseId" => "100" // 倉庫代碼 varchar(20)
// ]
// ]
// ]
// ];
// $data = file_get_contents('test.json');
// echo '<pre>';
// print_r($data);
// echo '</pre>';
// $api_url = 'https://erp.masada.com.tw:780/twWebAPI/V1/STKOTHERSTOCKOUT/PostERPData';
// $header = [
// "CHI_Authorization :" . $validation
// ];
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $api_url); // 设置请求的URL
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
// curl_setopt($ch, CURLOPT_POST, 1);
// curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
// $response = curl_exec($ch);
// if ($response === false) {
// echo 'Curl error: ' . curl_error($ch);
// } else {
// $result = json_decode($response, true);
// if ($result['Status'] == 'Error') {
// echo '<pre>';
// print_r($result);
// echo '</pre>';
// echo 'API 傳入錯誤,' . $result['ErrorMsg'];
// } else {
// echo '<pre>';
// print_r($result['Status']);
// echo '</pre>';
// return $result;
// }
// }
echo 'API 傳入錯誤,' . $result['ErrorMsg'];
} else {
echo '<pre>';
print_r($result['Status']);
echo '</pre>';
return $result;
}
}
// curl_close($ch);
curl_close($ch);

2
wms/contract/contract-download.php

@ -26,7 +26,7 @@ if (isset($_GET['id']) && $_GET['id'] != "") {
$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') {
if (($contract['status'] !== "YY" && $user_id != 'M0107' && $user_id != "TEST02" && $user_id == "TEST01") && $user_id != 'M0174' && $user_id != 'M0225') {
echo '<script type="text/javascript">
alert("非法訪問。");
window.history.back();

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

@ -67,7 +67,6 @@ if(empty($contract_new_apply)){
$price_b = $price_b + $pay['pay_amount'];
}
}
} else {
$mid = $contract['mid'];
$contract_new_apply_id = $contract_new_apply['id'];
@ -283,7 +282,9 @@ $person = $contract['person'];
<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 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.item_spec==''"><i class="fa-solid fa-circle-xmark"></i>未填寫</p>
@ -492,7 +493,7 @@ $person = $contract['person'];
<td>結果</td>
<td colspan=2>意見</td>
<td>時間</td>
<td colspan=2><?php if(($user_id === "M0174" || $user_id === "M0107" || $user_id === "M0060") && $status == 1): ?>審核意見<?php endif; ?></td>
<td colspan=2><?php if (($user_id === "M0174" || $user_id === "M0107" || $user_id === "M0060" || $user_id == "TEST02" || $user_id == "TEST03") && $status == 1) : ?>審核意見<?php endif; ?></td>
</tr>
<tr>
<td>營業員</td>
@ -505,7 +506,7 @@ $person = $contract['person'];
<td colspan=2>---</td>
<td><?php echo ($contract['submit_date']) ?? "---"; ?> </td>
<td colspan=2 rowspan="3">
<?php if(($user_id === "M0174" || $user_id === "M0107" || $user_id === "M0060") && $status == 1): ?>
<?php if (($user_id === "M0174" || $user_id === "M0107" || $user_id === "M0060" || $user_id == "TEST02" || $user_id == "TEST03") && $status == 1) : ?>
<textarea class="form-control opinion" x-model="data.review_comment"></textarea>
<?php endif; ?>
</td>
@ -569,14 +570,14 @@ $person = $contract['person'];
</template>
</button>
<?php endif; ?>
<?php if($status == 1 && (($user_id == "M0107" && $contract['progress'] <= 1 ) || ($user_id == "M0060" && $contract['progress'] == 2 ) || $user_id == "M0174")): ?>
<?php if ($status == 1 && ((($user_id == "M0107" || $user_id == "TEST02") && $contract['progress'] <= 1) || (($user_id == "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) || $user_id == "M0174")) : ?>
<button x-show="true" x-on:click="agree()" :disabled="isLoading" type="button" class="btn btn-primary btn-lg pull-right savebtn">
<template x-if="!isLoading">
<span>
<?php
if($user_id === "M0107" && $contract['progress'] <= 1 ){
if (($user_id === "M0107" || $user_id == "TEST02") && $contract['progress'] <= 1) {
echo "同意(上呈)";
}elseif($user_id === "M0060" && $contract['progress'] == 2){
} elseif (($user_id === "M0060" || $user_id == "TEST03") && $contract['progress'] == 2) {
echo "同意(結案)";
}
?>

5
wms/crm/crmm03-edit.php

@ -18,7 +18,7 @@ $customer_source_opt = DB::result($sql);
$sql = "select code_name value ,content label from code where field_name='elevator_kind'";
$elevator_kind_opt = DB::result($sql);
#4.營業員
$sql = "select employee_no value ,name label from employee where depart_no in ('320','311','312','313','314','511','512','513','514')";
$sql = "select employee_no value ,name label from employee where depart_no in ('320','311','312','313','314','511','512','513','514','322','515')";
$salesman_opt = DB::result($sql);
#5.有望客戶狀態
$sql = "select code_name value ,content label from code where field_name='hope_customer_status'";
@ -345,8 +345,7 @@ function get_sequnece_no($seq_name = '', $p_yyyymm = '')
</div>
<div class="col-12 " style="padding:0">
<textarea class='form-control textarea' id="progress_status" name="progress_status"
value='' rows='6'></textarea>
<textarea class='form-control textarea' id="progress_status" name="progress_status" value='' rows='6'></textarea>
</div>
</div>
<div id="elevator_list_area" class="row ">

2
wms/crm/crmm06-edit.php

@ -19,7 +19,7 @@ $customer_source_opt = DB::result($sql);
$sql = "select code_name value ,content label from code where field_name='elevator_kind'";
$elevator_kind_opt = DB::result($sql);
#4.營業員
$sql = "select employee_no value ,name label from employee where depart_no in ('511','512','513','514')";
$sql = "select employee_no value ,name label from employee where depart_no in ('511','512','513','514','515')";
$salesman_opt = DB::result($sql);
#5.有望客戶狀態
$sql = "select code_name value ,content label from code where field_name='hope_customer_status'";

6
wms/fun_global.php

@ -97,6 +97,7 @@ function pricereview_class($rate, $user_id, &$ret = [], $special_fee)
$ret[3] = "test03,,";
$ret[4] = "test05,,";
return $ret;
exit;
} else {
if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") {
$ret[1] = $row["manager"] . ",,";
@ -130,12 +131,13 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag)
$res = mysqli_query($link, $sql);
if ($row = mysqli_fetch_assoc($res)) {
if ($row["manager"] == "M0001") return; // 董事長略過
if ($row["manager"] == "TEST04" || $user_id = 'TEST01') {
if ($row["manager"] == "TEST04" || $user_id == 'TEST01') {
$ret[1] = "test04,,";
$ret[2] = "test02,,";
$ret[3] = "test03,,";
$ret[4] = "test05,,";
return $ret;
exit();
} else {
if ($row["manager"] != "M0060" && $row["manager"] != "M0006" && $row["manager"] != "M0008") {
$ret[1] = $row["manager"];
@ -144,7 +146,7 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag)
}
}
}
$ret[1] = "M0029";
// $ret[1] = "M0029";
mysqli_free_result($res);
$ret[2] = 'M0012';
if ($renovate_flag == "REN") {

4
wms/mkt/pricereview-index.php

@ -550,14 +550,14 @@ if ($data) :
<?php endif; ?>
<?php if ($data['status'] == 'YY' && (($user_id == "M0060" && $data['applyprogress'] == 2) || (($user_id == "M0107" || $user_id == "M0175") && $data['applyprogress'] <= 1) || $user_id == "M0174" || $user_id == 'M0225') && $data['applystatus'] == 1) : ?>
<?php if ($data['status'] == 'YY' && ((($user_id == "M0060" || $user_id === "TEST03") && $data['applyprogress'] == 2) || (($user_id == "M0107" || $user_id == "M0175" || $user_id == "TEST02") && $data['applyprogress'] <= 1) || $user_id == "M0174" || $user_id == 'M0225') && $data['applystatus'] == 1) : ?>
<a class="applybtn" href="../contract/contract-new-apply.php?id=<?php echo $data['id'] . '&' . $para; ?>">待簽核</a><br>
<?php endif; ?>
<?php if ($data['status'] != 'YY') : ?>
<span style="font-size:13px;font-weight:600">--</span>
<?php endif; ?>
<!-- 工號M0107、M0174有所有權限 -->
<?php if (($data['status'] === 'YY' && $data['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060" || $user_id == "M0175")) || $user_id == "M0174" || $user_id == 'M0225') : ?>
<?php if (($data['status'] === 'YY' && $data['applystatus'] == 3 && ($user_id == "M0107" || $user_id == "M0060" || $user_id == "M0175" || $user_id === "TEST02")) || $user_id == "M0174" || $user_id == 'M0225') : ?>
<a class="applybtn" href="../contract/contract-download.php?id=<?php echo $data['id'] . '&' . $para ?>">下載</a>
<?php endif; ?>
</td>

Loading…
Cancel
Save