10994015 1 year ago
parent
commit
fce5ff799b
  1. 1074
      wms/account-receivable-renovate-index.php
  2. 8
      wms/api/bpm/draw_update.php
  3. 69
      wms/contract/testT8API.php
  4. 12
      wms/estimated_shipping_date_report.php
  5. 399
      wms/maintainance_contract_payment_status.php
  6. 7
      wms/rib02-create.php
  7. 31
      wms/rib02-submit.php
  8. 21
      wms/wipwhole-index-function.php
  9. 13
      wms/wipwhole-rec-invoice-edit-submit.php
  10. 39
      wms/wipwhole-rec-invoice-edit.php
  11. 21
      wms/wipwhole-renovate-index-function.php
  12. 16
      wms/wipwhole-renovate-rec-invoice-edit-submit.php
  13. 41
      wms/wipwhole-renovate-rec-invoice-edit.php
  14. 92
      wms/wipwhole-wipinstallstatus-index-modal.php
  15. 23
      wms/wipwhole-wipinstallstatus-index.php
  16. 2
      wms/wipwholeinstall-index-export-excel.php
  17. 8
      wms/wipwholeinstall-index-table-html.php
  18. 2
      wms/wipwholeinstall-renovate-index-export-excel.php
  19. 8
      wms/wipwholeinstall-renovate-index-table-html.php

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

File diff suppressed because it is too large

8
wms/api/bpm/draw_update.php

@ -0,0 +1,8 @@
<?php
header('Access-Control-Allow-Origin:*');
echo json_encode([
'success' => true
], JSON_UNESCAPED_UNICODE);
?>

69
wms/contract/testT8API.php

@ -0,0 +1,69 @@
<?php
require_once('../T8_Authorization_from_bpm.php');
// require_once('../connt8.php');
// 其他出庫申請單
$validation = get_Auth();
$data = [
[
"name" => "OtherStockOutMtable",
"rows" => [
[
"BillNo" => "TEST01", // 單據編號 varchar(20)
"BillDate" =>20240120, // 單據日期 int
"OrgId" => "1000", //組織 varchar(20)
"FOrgId" => "1000", //核算組織 varchar(20)
"TypeId" => "OS", //單據類型 varchar(10)
"BizPartnerId" => "03051501", //往來對象(供應商) 可為空
"PersonId" => "C0003", // 經辦人員 varchar(20)
"DeptId" => "250", // 經辦部門 varchar(20)
"CompId" => "1001" // 公司 varchar(20)
]
]
], [
"name" => "OtherStockOutDetail",
"rows" => [
[
"BillNo" => "TEST01", //單據編號 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>';
echo 'API 傳入錯誤,' . $result['ErrorMsg'];
} else {
echo '<pre>';
print_r($result['Status']);
echo '</pre>';
return $result;
}
}
curl_close($ch);

12
wms/estimated_shipping_date_report.php

@ -8,8 +8,8 @@ use PhpOffice\PhpSpreadsheet\Style\Fill;
include "header.php"; include "header.php";
$start_y = empty($_POST['start_month']) ? '2023' : substr($_POST['start_month'], 0, 4); $start_y = empty($_POST['start_month']) ? date("Y") : substr($_POST['start_month'], 0, 4);
$end_y = empty($_POST['end_month']) ? '2023' : substr($_POST['end_month'], 0, 4); $end_y = empty($_POST['end_month']) ? date("Y") : substr($_POST['end_month'], 0, 4);
$start_m = empty($_POST['start_month']) ? '01' : substr($_POST['start_month'], 5, 2); $start_m = empty($_POST['start_month']) ? '01' : substr($_POST['start_month'], 5, 2);
$end_m = empty($_POST['end_month']) ? '12' : substr($_POST['end_month'], 5, 2); $end_m = empty($_POST['end_month']) ? '12' : substr($_POST['end_month'], 5, 2);
@ -29,8 +29,8 @@ $sql = "
w.contract_type w.contract_type
FROM wipwholestatus AS w FROM wipwholestatus AS w
WHERE status = '1' WHERE status = '1'
AND real_contract_arrival_date >= '$start_y-$start_m-1' AND DATE_FORMAT(real_contract_arrival_date, '%Y-%m-%d') >= '$start_y-$start_m-01'
AND real_contract_arrival_date <= '$end_y-$end_m-31' AND DATE_FORMAT(real_contract_arrival_date, '%Y-%m-%d') <= '$end_y-$end_m-31'
) AS this_order ) AS this_order
WHERE 1 = 1 WHERE 1 = 1
GROUP BY this_order.contract_type, GROUP BY this_order.contract_type,
@ -38,6 +38,7 @@ $sql = "
this_order.date_year, this_order.date_year,
this_order.date_month this_order.date_month
"; ";
$result = mysqli_query($link, $sql); $result = mysqli_query($link, $sql);
$data = []; $data = [];
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
@ -286,7 +287,8 @@ function alpha2num($a)
return $n - 1; return $n - 1;
} }
if ($_SERVER["REQUEST_METHOD"] == 'POST') { if ($_SERVER["REQUEST_METHOD"] == 'POST') {
if ($_POST['excel_output'] == 'excel_output') { $excel_output = !empty($_POST['excel_output']) ? $_POST['excel_output'] : '';
if ($excel_output == 'excel_output') {
$spreadsheet = new Spreadsheet(); $spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet(); $sheet = $spreadsheet->getActiveSheet();
$sheet->setTitle('出貨總表'); $sheet->setTitle('出貨總表');

399
wms/maintainance_contract_payment_status.php

@ -0,0 +1,399 @@
<?php
include "header.php";
include "css/view/wipwhole-index.php";
// 設置一個空陣列來放資料
$data = array();
$contractno = empty($_POST['contractno']) ? null : $_POST['contractno'];
$contractno = getContractnoDetails($link, $user_id, $contractno);
$sql = "
SELECT
siamd.RowNo,
siamd.RowCode,
siam.BillNo,
siamd.CU_EstPayDate,
siamd.UnTransCheckBLAmtWTax ,
siamd.HadTransCheckBLAmtWTax,
siamd.CU_MaterialId,
acb_tmp.BillNo2,
acb_tmp.RowCode2,
asim.BillNo AS BillNo3,
asim.InvoiceName,
asim.OAmountWithTax,
asi.InvoiceNo
FROM salIncomeApplyMaster AS siam -- 收入申請單
LEFT JOIN salIncomeApplyDetail AS siamd -- 收入申請單明細
ON siam.BillNo = siamd.BillNo
LEFT JOIN (
SELECT
acbd.FromRowCode,
acb.FromBillNo,
acbd.BillNo AS BillNo2,
acbd.RowCode AS RowCode2
FROM arCheckBill AS acb -- 應收確認單
LEFT JOIN arCheckBillDetail AS acbd -- 應收確認單明細
ON acb.BillNo = acbd.BillNo
WHERE 1 = 1
AND acb.TypeId = 'RVS'
";
$sql .= !empty($contractno) ? " AND acb.FromBillNo IN ($contractno) " : "";
$sql .= "
) AS acb_tmp
ON siamd.RowNo = acb_tmp.FromRowCode
AND siamd.BillNo = acb_tmp.FromBillNo
LEFT JOIN arSellInvoiceMaterial AS asim -- 買賣發票明細
ON asim.FromBillNo = acb_tmp.BillNo2
AND asim.RowCode = acb_tmp.RowCode2
LEFT JOIN arSellInvoice AS asi
ON asim.BillNo = asi.BillNo
WHERE 1 = 1
";
$sql .= !empty($contractno) ? " AND siam.BillNo IN ($contractno)" : "";
$data = $conn->query($sql);
function getContractnoDetails($link, $user_id, $contractno = null)
{
$sql = "
SELECT
c.contractno
FROM contract AS c
LEFT JOIN con_maintance_examine_apply AS cmea
ON c.contractno = cmea.vol_no
WHERE 1 = 1
AND cmea.salesman IN (" . getAccountids($link, $user_id) . ")
";
if (!empty($contractno)) {
$sql .= "
AND c.contractno = '$contractno'
";
}
$result = mysqli_query($link, $sql);
$data = [];
foreach ($result as $row) {
array_push($data, $row['contractno']);
}
return "'" . implode("','", $data) . "'";
}
function getSalesmanNo($link, $contractno)
{
$sql = "
SELECT
cmea.salesman
FROM contract AS c
LEFT JOIN con_maintance_examine_apply AS cmea
ON c.contractno = cmea.vol_no
WHERE 1 = 1
AND c.contractno IN ('$contractno')
";
$result = mysqli_query($link, $sql);
$data = [];
foreach ($result as $row)
return $row['salesman'];
return "";
}
function getSalesmanName($link, $contractno)
{
$sql = "
SELECT
a.name
FROM contract AS c
LEFT JOIN con_maintance_examine_apply AS cmea
ON c.contractno = cmea.vol_no
LEFT JOIN account AS a
ON cmea.salesman = a.accountid
WHERE 1 = 1
AND c.contractno IN ('$contractno')
";
$result = mysqli_query($link, $sql);
$data = [];
foreach ($result as $row)
return $row['name'];
return "";
}
function getAccountids($link, $user_id)
{
$sql = "
SELECT
accountid
FROM account
WHERE 1 = 1
AND (accountid = '$user_id'
OR accountid IN (
SELECT
accountid
FROM account
WHERE 1 = 1
AND manager = '$user_id'
AND accounttype IN ('B','E','M','W')
)
)
";
$result = mysqli_query($link, $sql);
$data = [];
foreach ($result as $row) {
array_push($data, $row['accountid']);
}
return "'" . implode("','", $data) . "'";
}
function checkArCheckBillStatus($row)
{
$CU_EstPayDate = $row['CU_EstPayDate'];
$BillNo2 = $row['BillNo2'];
if (substr($CU_EstPayDate, 0, 6) <= date("Ym")) {
if (empty($BillNo2)) {
return "<span class='text-danger'>未轉應收確認單</span>";
} else {
return "<span class='text-primary'>已轉應收確認單</span>";
}
} else {
return "時間未到";
}
}
function arSellInvoiceMaterial($row)
{
$CU_EstPayDate = $row['CU_EstPayDate'];
$InvoiceName = $row['InvoiceName'];
if (substr($CU_EstPayDate, 0, 6) <= date("Ym")) {
if (empty($InvoiceName)) {
return "<span class='text-danger'>未開發票</span>";
} else {
return "<span class='text-primary'>已開發票</span>";
}
} else {
return "時間未到";
}
}
function checkArWriteOffBill($conn, $row)
{
$BillNo = $row['BillNo2'];
$sql = "
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 c.checkBillNo = '$BillNo'
";
$del = $conn->query($sql);
$i = 0;
foreach ($del as $row)
$i++;
if (empty($i)) {
return "<span class='text-danger'>未收款</span>";
} else {
return "<span class='text-primary'>已收款</span>";
}
}
?>
<?php if ($user_auth & 2) { ?>
<!-- <p>
<a href="board-create.php?function_name=board&<?php echo $token_link; ?>" class="btn btn-info btn-sm">
<span class="glyphicon glyphicon-plus"></span>
</a>
</p> -->
<?php
}
if ($data) :
?>
<style>
table {
table-layout: fixed;
width: 100%;
}
td {
word-wrap: break-word;
}
img {
width: 125px;
}
.width_style_1 {
width: 125px;
}
table {
width: 100%;
}
#table_index_filter {
float: right;
}
#table_index_paginate {
float: right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
</style>
<div style="overflow-x:auto;">
<form id='myForm' method='post' action='maintainance_contract_payment_status.php?<?= $token_link ?>'>
<table class='table query-table table-striped table-bordered display compact' style='width:98%;text-align:center;margin:0 auto'>
<thead>
<tr>
<td colspan="5">
<h3 style='text-align:center'>保養合約-應收款項明細</h3>
</td>
</tr>
</thead>
<tbody>
<tr>
<th style='text-align:center;vertical-align: middle;'>合約號</th>
<td style='text-align:center;vertical-align: middle;'>
<input type="text" class='form-control' id='contractno' name='contractno' value="">
</td>
<td style='text-align:left;vertical-align: middle;'>
<button type="submit" style='text-align:center; margin:0 auto' class="btn btn-primary btn-sm">查詢</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
<div style="overflow-x:auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th style='text-align:center;vertical-align: middle;'>營業人員/契約人員</th>
<th style='text-align:center;vertical-align: middle;'>合約號</th>
<th style='text-align:center;vertical-align: middle;width:50px;'>標示號</th>
<th style='text-align:center;vertical-align: middle;'>電梯編號</th>
<th style='text-align:center;vertical-align: middle;'>預計請款日</th>
<th style='text-align:center;vertical-align: middle;width:50px;'>催收次數</th>
<th style='text-align:center;vertical-align: middle;'>應收申請單狀態</th>
<th style='text-align:center;vertical-align: middle;'>請款金額(未轉應收)</th>
<th style='text-align:center;vertical-align: middle;'>請款金額(已轉應收)</th>
<th style='text-align:center;vertical-align: middle;'>應收申請單號</th>
<th style='text-align:center;vertical-align: middle;'>發票狀態</th>
<th style='text-align:center;vertical-align: middle;width:50px;'>發票單標示號</th>
<th style='text-align:center;vertical-align: middle;'>發票單號</th>
<th style='text-align:center;vertical-align: middle;'>發票明細</th>
<th style='text-align:center;vertical-align: middle;width:80px;'>發票金額</th>
<th style='text-align:center;vertical-align: middle;width:120px;'>發票號碼</th>
<th style='text-align:center;vertical-align: middle;'>核銷</th>
<!-- <th style='text-align:center;vertical-align: middle;'>核銷日期</th>
<th style='text-align:center;vertical-align: middle;'>未核銷金額</th>
<th style='text-align:center;vertical-align: middle;'>已核銷金額</th> -->
</tr>
</thead>
<tbody>
<?php foreach ($data as $row) { ?>
<tr>
<td>
<?php
echo getSalesmanNo($link, $row['BillNo']);
echo "<br/>";
echo getSalesmanName($link, $row['BillNo']);
?>
</td>
<td>
<?php echo $row['BillNo']; ?>
</td>
<td>
<?php echo $row['RowNo']; ?>
</td>
<td>
<?php echo $row['CU_MaterialId']; ?>
</td>
<td>
<?php echo date('Y/m/d', strtotime($row['CU_EstPayDate'])); ?>
</td>
<td>
<?php echo collect_month(strtotime($row['CU_EstPayDate'])); ?>
</td>
<td>
<?php echo checkArCheckBillStatus($row); ?>
</td>
<td>
<?php echo number_format(intval($row['UnTransCheckBLAmtWTax']), 0, '', ','); ?>
</td>
<td>
<?php echo number_format(intval($row['HadTransCheckBLAmtWTax']), 0, '', ','); ?>
</td>
<td>
<?php echo $row['BillNo2']; ?>
</td>
<td>
<?php echo arSellInvoiceMaterial($row); ?>
</td>
<td>
<?php echo $row['RowCode2']; ?>
</td>
<td>
<?php echo $row['BillNo3']; ?>
</td>
<td>
<?php echo $row['InvoiceName']; ?>
</td>
<td>
<?php echo number_format(intval($row['OAmountWithTax']), 0, '', ','); ?>
</td>
<td>
<?php echo $row['InvoiceNo']; ?>
</td>
<td>
<?php
echo checkArWriteOffBill($conn, $row)
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<script>
$(function() {
document.getElementById('loadingOverlay').classList.add('hidden');
})
</script>
<?php
else :
echo "<h2>There is no record!</h2>";
endif;
#代表結束連線
mysqli_close($link);
include "footer.php";
?>

7
wms/rib02-create.php

@ -120,11 +120,12 @@ foreach ($BizPartner as $biz) {
$invoiceNo = mysqli_query($link, $sql_invoiceNo); $invoiceNo = mysqli_query($link, $sql_invoiceNo);
$invoiceNo_array = array(); $invoiceNo_array = array();
foreach ($invoiceNo as $invoice) { if(is_iterable($invoiceNo)){
array_push($invoiceNo_array, $invoice['InvoiceNo']); foreach ($invoiceNo as $invoice) {
array_push($invoiceNo_array, $invoice['InvoiceNo']);
}
} }
$BizJSON = json_encode($BusinessPartner); $BizJSON = json_encode($BusinessPartner);
$InvoiceJSON = json_encode($invoiceNo_array); $InvoiceJSON = json_encode($invoiceNo_array);
$sql_Project = "SELECT * FROM comProject"; $sql_Project = "SELECT * FROM comProject";

31
wms/rib02-submit.php

@ -19,10 +19,20 @@ foreach ($BizPartner as $biz) {
$sql_invoiceNo = "SELECT DISTINCT InvoiceNo FROM rib_sub WHERE rib_id !== $rib_id"; $sql_invoiceNo = "SELECT DISTINCT InvoiceNo FROM rib_sub WHERE rib_id !== $rib_id";
$invoiceNo = mysqli_query($link, $sql_invoiceNo); $invoiceNo = mysqli_query($link, $sql_invoiceNo);
$invoiceNo_array = array(); $invoiceNo_array = array();
foreach ($invoiceNo as $invoice) { if (is_iterable($invoiceNo)) {
array_push($invoiceNo_array, $invoice['InvoiceNo']); foreach ($invoiceNo as $invoice) {
array_push($invoiceNo_array, $invoice['InvoiceNo']);
}
} }
// 取得同筆報銷單的明細資料
$sql_all_ribsub = "SELECT * FROM rib_sub WHERE rib_id = $rib_id";
$all_ribsub_data = mysqli_query($link, $sql_all_ribsub);
if (is_iterable($all_ribsub_data)) {
foreach ($all_ribsub_data as $allribsub) {
$CurrLAmount = $allribsub['CurrentLAmount'];
}
}
$RowCode = $_POST['RowCode']; $RowCode = $_POST['RowCode'];
$FeeDate = $_POST['FeeDate']; $FeeDate = $_POST['FeeDate'];
$FeeTypeGen = isset($_POST['FeeTypeGen']) ? $_POST['FeeTypeGen'] : null; $FeeTypeGen = isset($_POST['FeeTypeGen']) ? $_POST['FeeTypeGen'] : null;
@ -42,9 +52,10 @@ $IsCounteract = $_POST['IsCounteract'];
$InvoiceId = $_POST['InvoiceId']; $InvoiceId = $_POST['InvoiceId'];
$VoucherCount = empty($_POST['VoucherCount']) ? 1 : $_POST['VoucherCount']; $VoucherCount = empty($_POST['VoucherCount']) ? 1 : $_POST['VoucherCount'];
$VoucherType = isset($_POST['VoucherType']) ? $_POST['VoucherType'] : 0; $VoucherType = isset($_POST['VoucherType']) ? $_POST['VoucherType'] : 0;
$InvoiceNo = empty($_POST['InvoiceNo']) ? " ": (in_array(str_replace("-", "",$_POST['InvoiceNo']), $invoiceNo_array) ? " ": str_replace("-", "",$_POST['InvoiceNo'])); $InvoiceNo = empty($_POST['InvoiceNo']) ? " " : (in_array(str_replace("-", "", $_POST['InvoiceNo']), $invoiceNo_array) ? " " : str_replace("-", "", $_POST['InvoiceNo']));
$CurrLAmount = empty($_POST['CurrLAmount']) ? ($CurrId == "TWD" ? 1 : null) : $_POST['CurrLAmount'];
$CurrLAmount = empty($_POST['CurrLAmount']) ? null : $_POST['CurrLAmount'];
// $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName']; // $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName'];
$FromSourceTag = 0; $FromSourceTag = 0;
$TaxRate = ($TaxId == "ST005") ? 0.05 : 0; $TaxRate = ($TaxId == "ST005") ? 0.05 : 0;
@ -54,7 +65,7 @@ if ($CurrId == "TWD") {
$OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? round($_POST['OAmountUnWithTax']) : null; $OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? round($_POST['OAmountUnWithTax']) : null;
$LAmountUnWithTax = isset($_POST['LAmountUnWithTax']) ? round($_POST['LAmountUnWithTax']) : null; $LAmountUnWithTax = isset($_POST['LAmountUnWithTax']) ? round($_POST['LAmountUnWithTax']) : null;
$LAmount = isset($_POST['LAmount']) ? round($_POST['LAmount']) : null; $LAmount = isset($_POST['LAmount']) ? round($_POST['LAmount']) : null;
}else{ } else {
$OTax = isset($_POST['OTax']) ? round($_POST['OTax'], 2) : NULL; $OTax = isset($_POST['OTax']) ? round($_POST['OTax'], 2) : NULL;
$LTax = isset($_POST['LTax']) ? round($_POST['LTax'], 2) : NULL; $LTax = isset($_POST['LTax']) ? round($_POST['LTax'], 2) : NULL;
$OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? round($_POST['OAmountUnWithTax'], 2) : null; $OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? round($_POST['OAmountUnWithTax'], 2) : null;
@ -62,7 +73,7 @@ if ($CurrId == "TWD") {
$LAmount = isset($_POST['LAmount']) ? round($_POST['LAmount'], 2) : null; $LAmount = isset($_POST['LAmount']) ? round($_POST['LAmount'], 2) : null;
} }
$TaxNo = empty($_POST['TaxNo']) ? '' : $_POST['TaxNo']; $TaxNo = empty($_POST['TaxNo']) ? ' ' : $_POST['TaxNo'];
if (empty($TaxNo)) { if (empty($TaxNo)) {
$comSupplierName = "雜項請款用"; $comSupplierName = "雜項請款用";
} else { } else {
@ -90,10 +101,13 @@ if (isset($comSupplierName) && ($comSupplierName != "雜項請款用")) {
$SQL1 = ""; $SQL1 = "";
if ($submit == "add") { if ($submit == "add") {
if (($user_id == "M0056") || ($user_id == "M0209")) { if (($user_id == "M0056") || ($user_id == "M0209")) {
$ribsub_query = "SELECT * FROM rib_sub WHERE rib_id = $rib_id";
$ribsub_data = mysqli_query($link, $ribsub_query);
$SQL1 = "INSERT INTO rib_sub (`RowCode`,`rib_id`,`RowNo`,`FeeDate`,`FeeTypeId`,`WriteOffType`, $SQL1 = "INSERT INTO rib_sub (`RowCode`,`rib_id`,`RowNo`,`FeeDate`,`FeeTypeId`,`WriteOffType`,
`BizOrgId`,`WriteOffId`,`FeeOrgId`,`FeeDeptId`,`FeeCompanyId`,`UnitId`,`Quantity`, `BizOrgId`,`WriteOffId`,`FeeOrgId`,`FeeDeptId`,`FeeCompanyId`,`UnitId`,`Quantity`,
`Price`,`OAmount`,`FeeNoteShow`,`CurrId`,`SupplyOrgId`,`CurrOAmount`,`FromSourceTag`,`TaxId`,`IsCounteract`,`InvoiceId`,`TaxRate`,`CreatorId`,`TaxNo`,`CurrentLAmount`,`OTax`,`LTax`, `Price`,`OAmount`,`FeeNoteShow`,`CurrId`,`SupplyOrgId`,`CurrOAmount`,`FromSourceTag`,`TaxId`,`IsCounteract`,`InvoiceId`,`TaxRate`,`CreatorId`,`TaxNo`,`OTax`,`LTax`,
`OAmountUnWithTax`,`LAmountUnWithTax`,`LAmount`"; `OAmountUnWithTax`,`LAmountUnWithTax`,`LAmount`";
$SQL1 .= isset($CurrLAmount) ? ",`CurrentLAmount`" : "";
$SQL1 .= empty($ProjectId) ? "" : ",`ProjectId`"; $SQL1 .= empty($ProjectId) ? "" : ",`ProjectId`";
$SQL1 .= isset($FeeTypeGen) ? ",`FeeTypeGen`" : ""; $SQL1 .= isset($FeeTypeGen) ? ",`FeeTypeGen`" : "";
$SQL1 .= empty($CU_MaterialId) ? "" : ",`CU_MaterialId`"; $SQL1 .= empty($CU_MaterialId) ? "" : ",`CU_MaterialId`";
@ -105,8 +119,9 @@ if ($submit == "add") {
$SQL2 = ") VALUES ($RowCode, $rib_id, $RowCode,$FeeDate,'$FeeTypeId',2, $SQL2 = ") VALUES ($RowCode, $rib_id, $RowCode,$FeeDate,'$FeeTypeId',2,
'1000','$WriteOffId','1000','$FeeDeptId','1000','$UnitId',$Quantity, '1000','$WriteOffId','1000','$FeeDeptId','1000','$UnitId',$Quantity,
$Price,$OAmount,'$FeeNoteShow','$CurrId','1000',1,0,'$TaxId',$IsCounteract,'$InvoiceId',$TaxRate,'$user_id','$TaxNo',$CurrLAmount,$OTax,$LTax, $Price,$OAmount,'$FeeNoteShow','$CurrId','1000',1,0,'$TaxId',$IsCounteract,'$InvoiceId',$TaxRate,'$user_id','$TaxNo',$OTax,$LTax,
$OAmountUnWithTax,$LAmountUnWithTax,$LAmount"; $OAmountUnWithTax,$LAmountUnWithTax,$LAmount";
$SQL2 .= isset($CurrLAmount) ? "," . $CurrLAmount : "";
$SQL2 .= empty($ProjectId) ? "" : ",'" . $ProjectId . "'"; $SQL2 .= empty($ProjectId) ? "" : ",'" . $ProjectId . "'";
$SQL2 .= isset($FeeTypeGen) ? "," . $FeeTypeGen : ""; $SQL2 .= isset($FeeTypeGen) ? "," . $FeeTypeGen : "";
$SQL2 .= empty($CU_MaterialId) ? "" : ",'" . $CU_MaterialId . "'"; $SQL2 .= empty($CU_MaterialId) ? "" : ",'" . $CU_MaterialId . "'";

21
wms/wipwhole-index-function.php

@ -1337,8 +1337,8 @@ function checkUseridIsManager($user_id)
// 中區 李烘銘 // 中區 李烘銘
if (in_array($user_id, ['M0086'])) if (in_array($user_id, ['M0086']))
return true; return true;
// 桃竹 張莉凱 // 桃竹 張莉凱 改 陳家文
if (in_array($user_id, ['M0026'])) if (in_array($user_id, ['M0029']))
return true; return true;
// 宜花東 陳志文 // 宜花東 陳志文
if (in_array($user_id, ['M0054'])) if (in_array($user_id, ['M0054']))
@ -1348,3 +1348,20 @@ function checkUseridIsManager($user_id)
return true; return true;
return false; return false;
} }
function manage_class_gary_ver($user_id)
{
global $link;
$sql = "
SELECT manager
FROM account
WHERE accountid = '$user_id'";
$res = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($res);
$manager = $row["manager"];
mysqli_free_result($res);
if ($manager == "M0001")
return ""; // 董事長略過
return $manager;
}

13
wms/wipwhole-rec-invoice-edit-submit.php

@ -140,6 +140,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$tryrun_start_date_owner = $_POST['tryrun_start_date_owner']; $tryrun_start_date_owner = $_POST['tryrun_start_date_owner'];
$tryrun_end_date = $_POST['tryrun_end_date']; $tryrun_end_date = $_POST['tryrun_end_date'];
$tryrun_end_date_owner = $_POST['tryrun_end_date_owner']; $tryrun_end_date_owner = $_POST['tryrun_end_date_owner'];
$association_check_type = $_POST['association_check_type'];
$salesname = accountid2name($salesid)[$salesid]; $salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid]; $salesmail = accountid2email([$salesid])[$salesid];
@ -378,6 +379,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
delivery_date_owner = '$delivery_date_owner', delivery_date_owner = '$delivery_date_owner',
marketing_remark = '', marketing_remark = '',
real_custom_name = '$real_custom_name', real_custom_name = '$real_custom_name',
association_check_type = '$association_check_type',
"; ";
if (!empty(trim($marketing_remark))) { if (!empty(trim($marketing_remark))) {
$updatesql .= " $updatesql .= "
@ -1080,8 +1082,8 @@ function checkWwsAssianStatus($link, $user_id, $id = null)
$data['salesname'] = accountid2name($data['salesid'])[$data['salesid']]; $data['salesname'] = accountid2name($data['salesid'])[$data['salesid']];
$data['salesmail'] = accountid2email([$data['salesid']])[$data['salesid']]; $data['salesmail'] = accountid2email([$data['salesid']])[$data['salesid']];
$data['salesmanagername'] = accountid2name(manage_class($data['salesid'])[0])[manage_class($data['salesid'])[0]]; $data['salesmanagername'] = accountid2name(manage_class_gary_ver($data['salesid']))[manage_class_gary_ver($data['salesid'])];
$data['salesmanagermail'] = accountid2email([manage_class($data['salesid'])[0]])[manage_class($data['salesid'])[0]]; $data['salesmanagermail'] = accountid2email([manage_class_gary_ver($data['salesid'])])[manage_class_gary_ver($data['salesid'])];
$data['designname'] = accountid2name("M0023")["M0023"]; $data['designname'] = accountid2name("M0023")["M0023"];
$data['designmail'] = accountid2email(["M0023"])["M0023"]; $data['designmail'] = accountid2email(["M0023"])["M0023"];
$data['designleadername'] = accountid2name(getSheJiokLeaderNo($link))[getSheJiokLeaderNo($link)]; $data['designleadername'] = accountid2name(getSheJiokLeaderNo($link))[getSheJiokLeaderNo($link)];
@ -1123,7 +1125,12 @@ function checkWwsAssianStatus($link, $user_id, $id = null)
], ],
"永佳捷科技" "永佳捷科技"
); );
do_wws_next_assign(manage_class($data['salesid'])[0], $form_YD_key, 'I'); // 如果是桃竹區 主管是家文的新梯 簽到劉永德經理那
if (manage_class_gary_ver($data['salesid']) == 'M0029') {
do_wws_next_assign("M0137", $form_YD_key, 'I');
} else {
do_wws_next_assign(manage_class_gary_ver($data['salesid']), $form_YD_key, 'I');
}
return true; return true;
} }
} }

39
wms/wipwhole-rec-invoice-edit.php

@ -300,18 +300,27 @@ include "wipwhole-rec-invoice-edit-submit.php";
<tbody style="font-weight: bolder;margin-bottom: 20px"> <tbody style="font-weight: bolder;margin-bottom: 20px">
<tr> <tr>
<td>營業人員確認項</td> <td>營業人員確認項</td>
<td> <td colspan="3">
<?php <?php
echo "營業擔當:" . $row['salesid'] . accountid2name()[$row['salesid']]; echo "營業擔當:" . $row['salesid'] . accountid2name()[$row['salesid']];
?> ?>
<br /> <br />
<?php <?php
if (!checkUseridIsManager($row['salesid'])) { if (!checkUseridIsManager($row['salesid'])) {
echo "營業擔當主管:" . manage_class($row['salesid'])[0] . accountid2name(manage_class($row['salesid'])[0])[manage_class($row['salesid'])[0]]; echo "營業擔當主管:" . manage_class_gary_ver($row['salesid']) . accountid2name(manage_class_gary_ver($row['salesid']))[manage_class_gary_ver($row['salesid'])];
} }
?> ?>
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: middle">官檢類型</td>
<td colspan="3">
<input type='radio' id="association_check_type_1" name='association_check_type' value='1' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '1' ? "checked disabled" : ""; ?> />
<label for='association_check_type_1'>需要</label>
<input type='radio' id="association_check_type_2" name='association_check_type' value='2' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '2' ? "checked disabled" : ""; ?> />
<label for='association_check_type_2'>不需要</label>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle;width:auto;">營業/契約確認規格</td> <td style="vertical-align: middle;width:auto;">營業/契約確認規格</td>
<td style="width:150px;"> <td style="width:150px;">
@ -384,7 +393,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
</td> </td>
<td style="vertical-align: middle;">附件</td> <td style="vertical-align: middle;">附件</td>
<td style="vertical-align: middle;"> <td style="vertical-align: middle;">
客戶姓名:<input type="text" name="real_custom_name" id="real_custom_name" style="width:70%;display:inline;" value="<?= $row["real_custom_name"]; ?>" <?= $marketing; ?> placeholder="輸入後即可上傳附件" /> 客戶姓名:<input type="text" name="real_custom_name" id="real_custom_name" style="width:70%;display:inline;" value="<?= $row["real_custom_name"]; ?>" <?= $marketing2; ?> placeholder="輸入後即可上傳附件" />
<br /> <br />
<input style="width:70%;display:inline;" type="file" id="customer_planning_verify_file" name="customer_planning_verify_file" disabled> <input style="width:70%;display:inline;" type="file" id="customer_planning_verify_file" name="customer_planning_verify_file" disabled>
<?php <?php
@ -1437,12 +1446,12 @@ include "wipwhole-rec-invoice-edit-submit.php";
<tr> <tr>
<td style="vertical-align: middle">QC及官檢類型</td> <td style="vertical-align: middle">QC及官檢類型</td>
<td> <td>
<input type='radio' id="qc_official_type_Q" name='qc_official_type' value='Q' <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'Q' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_0" disabled <?php echo $row['association_check_type'] == '0' ? "checked" : ""; ?> />
<label for='qc_official_type_Q'>只需QC</label> <label for='qc_official_type_0'>未選擇</label>
<input type='radio' id="qc_official_type_O" name='qc_official_type' value='O' <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'O' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_2" disabled <?php echo $row['association_check_type'] == '2' ? "checked" : ""; ?> />
<label for='qc_official_type_O'>只需官檢</label> <label for='qc_official_type_2'>只需QC</label>
<input type='radio' id="qc_official_type_QO" name='qc_official_type' value='QO' <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'QO' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_1" disabled <?php echo $row['association_check_type'] == '1' ? "checked" : ""; ?> />
<label for='qc_official_type_QO'>QC+官檢</label> <label for='qc_official_type_1'>QC+官檢</label>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -1467,9 +1476,9 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">QC合格日</td> <td style="vertical-align: middle">QC合格日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<div class="input-group"> <div class="input-group">
<input class="form-control" type="date" id="end_qc_date" name="end_qc_date" value="<?= $row['end_qc_date']; ?>" <?= $pinzheng; ?>> <input class="form-control" type="date" id="end_qc_date" name="end_qc_date" value="<?= $row['end_qc_date']; ?>" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#end_qc_date").val("");' <?= $pinzheng; ?>>清除</button> <button class="btn btn-default" type='button' onclick='$("#end_qc_date").val("");' <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>清除</button>
</span> </span>
</div> </div>
</td> </td>
@ -1485,10 +1494,10 @@ include "wipwhole-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">官檢日</td> <td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<div class="input-group"> <div class="input-group">
<input class="form-control" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?>> <input class="form-control" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "" : "disabled"; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>"> <input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?php echo $row['association_check_type'] == '2' ? "" : "disabled"; ?>>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?= $pinzheng; ?>>清除</button> <button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "" : "disabled"; ?>>清除</button>
</span> </span>
</div> </div>
</td> </td>
@ -1503,7 +1512,7 @@ include "wipwhole-rec-invoice-edit-submit.php";
<tr> <tr>
<td style='width:180px;'>官檢附件</td> <td style='width:180px;'>官檢附件</td>
<td> <td>
<input style="width:70%;display:inline;" type="file" id="official_check_file" name="official_check_file" <?= $pinzheng; ?>> <input style="width:70%;display:inline;" type="file" id="official_check_file" name="official_check_file" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<?php <?php
echo !empty($row['official_check_file']) ? "<a id='official_check_file' style='color:#00F;' href='" . $row['official_check_file'] . "' target='_blank'>下載附件</a>" : ""; echo !empty($row['official_check_file']) ? "<a id='official_check_file' style='color:#00F;' href='" . $row['official_check_file'] . "' target='_blank'>下載附件</a>" : "";
?> ?>

21
wms/wipwhole-renovate-index-function.php

@ -1279,8 +1279,8 @@ function checkUseridIsManager($user_id)
// 中區 李烘銘 // 中區 李烘銘
if (in_array($user_id, ['M0086'])) if (in_array($user_id, ['M0086']))
return true; return true;
// 桃竹 張莉凱 // 桃竹 張莉凱 改 陳家文
if (in_array($user_id, ['M0026'])) if (in_array($user_id, ['M0029']))
return true; return true;
// 宜花東 陳志文 // 宜花東 陳志文
if (in_array($user_id, ['M0054'])) if (in_array($user_id, ['M0054']))
@ -1290,3 +1290,20 @@ function checkUseridIsManager($user_id)
return true; return true;
return false; return false;
} }
function manage_class_gary_ver($user_id)
{
global $link;
$sql = "
SELECT manager
FROM account
WHERE accountid = '$user_id'";
$res = mysqli_query($link, $sql);
$row = mysqli_fetch_assoc($res);
$manager = $row["manager"];
mysqli_free_result($res);
if ($manager == "M0001")
return ""; // 董事長略過
return $manager;
}

16
wms/wipwhole-renovate-rec-invoice-edit-submit.php

@ -128,9 +128,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date']; $delivery_date = $_POST['delivery_date'] ?: $row['delivery_date'];
$old_delivery_date = $_POST['old_delivery_date'] ?: $row['old_delivery_date']; $old_delivery_date = $_POST['old_delivery_date'] ?: $row['old_delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner']; $delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner'];
$salesid = $_POST['salesid'] ?: $row['salesid'];
$warehouseid = $_POST['warehouseid'] ?: $row['warehouseid']; $warehouseid = $_POST['warehouseid'] ?: $row['warehouseid'];
$old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid']; $old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid'];
$association_check_type = $_POST['association_check_type'] ?: $row['association_check_type'];
$salesname = accountid2name($salesid)[$salesid];
$salesmail = accountid2email([$salesid])[$salesid];
$creater = $_POST['creater']; $creater = $_POST['creater'];
$create_at = date("Y-m-d H:i:s"); $create_at = date("Y-m-d H:i:s");
@ -328,11 +332,12 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
. " . "
移交日:" . $old_delivery_date . " => " . $delivery_date; 移交日:" . $old_delivery_date . " => " . $delivery_date;
} }
$cmail->sendx( $cmail->sendx(
$mail_title, $mail_title,
$mail_content, $mail_content,
[ [
[$salesname, $salesmail] [$salesname, $salesmail],
// ['gary', 'gary_chen@masada.com.tw'] // ['gary', 'gary_chen@masada.com.tw']
], ],
"永佳捷科技" "永佳捷科技"
@ -382,6 +387,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
customer_planning_verify = '$customer_planning_verify', customer_planning_verify = '$customer_planning_verify',
customer_planning_verify_at = '$customer_planning_verify_at', customer_planning_verify_at = '$customer_planning_verify_at',
customer_planning_verify_owner = '$customer_planning_verify_owner', customer_planning_verify_owner = '$customer_planning_verify_owner',
association_check_type = '$association_check_type',
marketing_remark = '', marketing_remark = '',
"; ";
if (!empty(trim($marketing_remark))) { if (!empty(trim($marketing_remark))) {
@ -1149,8 +1155,8 @@ function checkWwsAssianStatus($link, $user_id)
$data['salesname'] = accountid2name($data['salesid'])[$data['salesid']]; $data['salesname'] = accountid2name($data['salesid'])[$data['salesid']];
$data['salesmail'] = accountid2email([$data['salesid']])[$data['salesid']]; $data['salesmail'] = accountid2email([$data['salesid']])[$data['salesid']];
$data['salesmanagername'] = accountid2name(manage_class($data['salesid'])[0])[manage_class($data['salesid'])[0]]; $data['salesmanagername'] = accountid2name(manage_class_gary_ver($data['salesid']))[manage_class_gary_ver($data['salesid'])];
$data['salesmanagermail'] = accountid2email([manage_class($data['salesid'])[0]])[manage_class($data['salesid'])[0]]; $data['salesmanagermail'] = accountid2email([manage_class_gary_ver($data['salesid'])])[manage_class_gary_ver($data['salesid'])];
$data['designname'] = accountid2name("M0023")["M0023"]; $data['designname'] = accountid2name("M0023")["M0023"];
$data['designmail'] = accountid2email(["M0023"])["M0023"]; $data['designmail'] = accountid2email(["M0023"])["M0023"];
$data['designleadername'] = accountid2name(getSheJiokLeaderNo($link))[getSheJiokLeaderNo($link)]; $data['designleadername'] = accountid2name(getSheJiokLeaderNo($link))[getSheJiokLeaderNo($link)];
@ -1197,7 +1203,7 @@ function checkWwsAssianStatus($link, $user_id)
], ],
"永佳捷科技" "永佳捷科技"
); );
do_wws_next_assign(manage_class($data['salesid'])[0], $form_key, 'F'); do_wws_next_assign(manage_class_gary_ver($data['salesid']), $form_key, 'F');
} }
} }

41
wms/wipwhole-renovate-rec-invoice-edit.php

@ -613,11 +613,21 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<br /> <br />
<?php <?php
if (!checkUseridIsManager($row['salesid'])) { if (!checkUseridIsManager($row['salesid'])) {
echo "營業擔當主管:" . manage_class($row['salesid'])[0] . accountid2name(manage_class($row['salesid'])[0])[manage_class($row['salesid'])[0]]; echo "營業擔當主管:" . manage_class_gary_ver($row['salesid']) . accountid2name(manage_class_gary_ver($row['salesid']))[manage_class_gary_ver($row['salesid'])];
} }
?> ?>
</td> </td>
</tr> </tr>
</tr>
<tr>
<td style="vertical-align: middle">官檢類型</td>
<td colspan="3">
<input type='radio' id="association_check_type_1" name='association_check_type' value='1' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '1' ? "checked disabled" : ""; ?> />
<label for='association_check_type_1'>需要</label>
<input type='radio' id="association_check_type_2" name='association_check_type' value='2' <?= $marketing2; ?> <?php echo $row['association_check_type'] == '2' ? "checked disabled" : ""; ?> />
<label for='association_check_type_2'>不需要</label>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: middle;width:auto;">營業確認規格</td> <td style="vertical-align: middle;width:auto;">營業確認規格</td>
<td style="width:150px;"> <td style="width:150px;">
@ -693,7 +703,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
</td> </td>
<td style="vertical-align: middle;">附件</td> <td style="vertical-align: middle;">附件</td>
<td style="vertical-align: middle;"> <td style="vertical-align: middle;">
客戶姓名:<input type="text" name="real_custom_name" id="real_custom_name" style="width:70%;display:inline;" value="<?= $row["real_custom_name"]; ?>" placeholder="輸入後即可上傳附件" <?= $marketing; ?> /> 客戶姓名:<input type="text" name="real_custom_name" id="real_custom_name" style="width:70%;display:inline;" value="<?= $row["real_custom_name"]; ?>" placeholder="輸入後即可上傳附件" <?= $marketing2; ?> />
<br /> <br />
<input style="width:70%;display:inline;" type="file" id="customer_planning_verify_file" name="customer_planning_verify_file" disabled> <input style="width:70%;display:inline;" type="file" id="customer_planning_verify_file" name="customer_planning_verify_file" disabled>
<?php <?php
@ -1430,12 +1440,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<tr> <tr>
<td style="vertical-align: middle">QC及官檢類型</td> <td style="vertical-align: middle">QC及官檢類型</td>
<td> <td>
<input type='radio' id="qc_official_type_Q" name='qc_official_type' value="Q" <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'Q' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_0" disabled <?php echo $row['association_check_type'] == '0' ? "checked" : ""; ?> />
<label for='qc_official_type_Q'>只需QC</label> <label for='qc_official_type_0'>未選擇</label>
<input type='radio' id="qc_official_type_O" name='qc_official_type' value="O" <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'O' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_2" disabled <?php echo $row['association_check_type'] == '2' ? "checked" : ""; ?> />
<label for='qc_official_type_O'>只需官檢</label> <label for='qc_official_type_2'>只需QC</label>
<input type='radio' id="qc_official_type_QO" name='qc_official_type' value="QO" <?= $pinzheng; ?> <?php echo $row['qc_official_type'] == 'QO' ? "checked" : ""; ?> /> <input type='radio' id="qc_official_type_1" disabled <?php echo $row['association_check_type'] == '1' ? "checked" : ""; ?> />
<label for='qc_official_type_QO'>QC+官檢</label> <label for='qc_official_type_1'>QC+官檢</label>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -1478,10 +1488,10 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<td style="vertical-align: middle">官檢日</td> <td style="vertical-align: middle">官檢日</td>
<td style="vertical-align: middle"> <td style="vertical-align: middle">
<div class="input-group"> <div class="input-group">
<input class="form-control" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?>> <input class="form-control" type="date" id="official_check_date" name="official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "" : "disabled"; ?>>
<input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?>> <input type="hidden" id="old_official_check_date" name="old_official_check_date" value="<?= $row['official_check_date']; ?>" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "" : "disabled"; ?>>
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?= $pinzheng; ?>>清除</button> <button class="btn btn-default" type='button' onclick='$("#official_check_date").val("");' <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "" : "disabled"; ?>>清除</button>
</span> </span>
</div> </div>
</td> </td>
@ -1496,7 +1506,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
<tr> <tr>
<td style='width:180px;'>官檢附件</td> <td style='width:180px;'>官檢附件</td>
<td> <td>
<input style="width:70%;display:inline;" type="file" id="official_check_file" name="official_check_file" <?= $pinzheng; ?>> <input style="width:70%;display:inline;" type="file" id="official_check_file" name="official_check_file" <?= $pinzheng; ?> <?php echo $row['association_check_type'] == '2' ? "disabled" : ""; ?>>
<?php <?php
echo !empty($row['official_check_file']) ? "<a id='official_check_file' style='color:#00F;' href='" . $row['official_check_file'] . "' target='_blank'>下載附件</a>" : ""; echo !empty($row['official_check_file']) ? "<a id='official_check_file' style='color:#00F;' href='" . $row['official_check_file'] . "' target='_blank'>下載附件</a>" : "";
?> ?>
@ -2054,6 +2064,11 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
'install_end_date2', 'install_end_date2',
'tryrun_start_date2', 'tryrun_start_date2',
'tryrun_end_date2', 'tryrun_end_date2',
'install_start_date',
'install_end_date',
'tryrun_start_date',
'tryrun_end_date',
'delivery_date'
] ]
for (var i = 0; i < catchTime_input_arr.length; i++) { for (var i = 0; i < catchTime_input_arr.length; i++) {
inputChangeCatchTime(catchTime_input_arr[i]); inputChangeCatchTime(catchTime_input_arr[i]);
@ -2369,7 +2384,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
} }
} }
function sendExpressionMailToPlatform(id){ function sendExpressionMailToPlatform(id) {
if (confirm('確定要發送郵件嗎?') == true) { if (confirm('確定要發送郵件嗎?') == true) {
$("#wipwholestatusid").val(id); $("#wipwholestatusid").val(id);
$('#send_expression_mail_to_platform_form').submit(); $('#send_expression_mail_to_platform_form').submit();

92
wms/wipwhole-wipinstallstatus-index-modal.php

@ -19,7 +19,14 @@ if ($method == 'getInstallingDetails')
if ($method == 'getInstalling2Details') if ($method == 'getInstalling2Details')
echo getInstalling2Details($type, $mtype, $radsY, $radsM, $year, $month); echo getInstalling2Details($type, $mtype, $radsY, $radsM, $year, $month);
if ($method == 'getShippingDetailsSql')
echo getShippingDetailsSql($type, $mtype, $radsY, $radsM, $year, $month);
if ($method == 'getEndingDetailsSql')
echo getEndingDetailsSql($type, $mtype, $radsY, $radsM, $year, $month);
if ($method == 'getInstallingDetailsSql')
echo getInstallingDetailsSql($type, $mtype, $radsY, $radsM, $year, $month);
if ($method == 'getInstalling2DetailsSql')
echo getInstalling2DetailsSql($type, $mtype, $radsY, $radsM, $year, $month);
// 出貨台數 // 出貨台數
@ -44,6 +51,25 @@ function getShippingDetails($type, $mtype, $radsY, $radsM, $year, $month)
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode($data, JSON_UNESCAPED_UNICODE);
} }
function getShippingDetailsSql($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND (
real_arrival_date IS NOT NULL
AND real_arrival_date != ''
)
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
return $sql;
}
// 工收台數 // 工收台數
function getEndingDetails($type, $mtype, $radsY, $radsM, $year, $month) function getEndingDetails($type, $mtype, $radsY, $radsM, $year, $month)
@ -67,6 +93,24 @@ function getEndingDetails($type, $mtype, $radsY, $radsM, $year, $month)
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode($data, JSON_UNESCAPED_UNICODE);
} }
function getEndingDetailsSql($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
AND (delivery_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
OR
official_check_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
)
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
return $sql;
}
// 試車完台數 // 試車完台數
function getInstallingDetails($type, $mtype, $radsY, $radsM, $year, $month) function getInstallingDetails($type, $mtype, $radsY, $radsM, $year, $month)
@ -93,6 +137,27 @@ function getInstallingDetails($type, $mtype, $radsY, $radsM, $year, $month)
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode($data, JSON_UNESCAPED_UNICODE);
} }
function getInstallingDetailsSql($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND (
real_arrival_date IS NOT NULL
AND real_arrival_date != ''
)
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
AND tryrun_end_date <= '$year-$month-31'
AND tryrun_end_date != ''
AND tryrun_end_date IS NOT NULL
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
return $sql;
}
// 在裝中台數 // 在裝中台數
function getInstalling2Details($type, $mtype, $radsY, $radsM, $year, $month) function getInstalling2Details($type, $mtype, $radsY, $radsM, $year, $month)
@ -121,3 +186,28 @@ function getInstalling2Details($type, $mtype, $radsY, $radsM, $year, $month)
$data = mysqli_fetch_all($result, MYSQLI_ASSOC); $data = mysqli_fetch_all($result, MYSQLI_ASSOC);
return json_encode($data, JSON_UNESCAPED_UNICODE); return json_encode($data, JSON_UNESCAPED_UNICODE);
} }
function getInstalling2DetailsSql($type, $mtype, $radsY, $radsM, $year, $month)
{
global $link;
$sql = "
SELECT
*
FROM wipwholestatus
WHERE status = '1'
AND real_arrival_date BETWEEN '$radsY-$radsM-01' AND '$year-$month-31'
AND (
delivery_date IS NULL
OR delivery_date = ''
OR delivery_date >= '$year-$month-31'
)
AND(
official_check_date IS NULL
OR official_check_date = ''
OR official_check_date >= '$year-$month-31'
)
";
$sql .= !empty($type) ? " AND contract_type = '$type'" : "";
$sql .= !empty($mtype) ? " AND renovate_type Like '%$mtype%'" : "";
return $sql;
}

23
wms/wipwhole-wipinstallstatus-index.php

@ -617,6 +617,29 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
function showDetails(method, contract_type, renovate_type, radsY, radsM, radsYi, start_month) { function showDetails(method, contract_type, renovate_type, radsY, radsM, radsYi, start_month) {
$("#myModal").show(); $("#myModal").show();
$.ajax({
type: "POST",
dataType: "html",
url: "wipwhole-wipinstallstatus-index-modal.php",
data: {
method: method+'Sql',
contract_type: contract_type,
renovate_type: renovate_type,
radsY: radsY,
radsM: radsM,
radsYi: radsYi,
start_month: start_month
},
success: function(data) {
console.log(data);
},
error: function(data) {
console.log(data);
}
})
$.ajax({ $.ajax({
type: "POST", type: "POST",
dataType: "json", dataType: "json",

2
wms/wipwholeinstall-index-export-excel.php

@ -175,7 +175,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['tryrun_end_date'], 0, 10), substr($row['tryrun_end_date'], 0, 10),
substr($row['qc_date'], 0, 10), substr($row['qc_date'], 0, 10),
substr($row['end_qc_date'], 0, 10), substr($row['end_qc_date'], 0, 10),
substr($row['official_check_date'], 0, 10), $row['association_check_type'] == '1' ? "-" : substr($row['official_check_date'], 0, 10),
substr($row['delivery_date'], 0, 10), substr($row['delivery_date'], 0, 10),
accountidToName($row['salesid']) accountidToName($row['salesid'])
]; ];

8
wms/wipwholeinstall-index-table-html.php

@ -172,8 +172,12 @@
</td> </td>
<td> <td>
<?php <?php
if (!empty($data['official_check_date'])) if ($data['association_check_type'] == '1') {
echo date("Y/m/d", strtotime($data['official_check_date'])); echo "-";
} else {
if (!empty($data['official_check_date']))
echo date("Y/m/d", strtotime($data['official_check_date']));
}
?> ?>
</td> </td>
<td> <td>

2
wms/wipwholeinstall-renovate-index-export-excel.php

@ -177,7 +177,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
substr($row['tryrun_end_date'], 0, 10), substr($row['tryrun_end_date'], 0, 10),
substr($row['qc_date'], 0, 10), substr($row['qc_date'], 0, 10),
substr($row['end_qc_date'], 0, 10), substr($row['end_qc_date'], 0, 10),
substr($row['official_check_date'], 0, 10), $row['association_check_type'] == '1' ? "-" : substr($row['official_check_date'], 0, 10),
substr($row['delivery_date'], 0, 10), substr($row['delivery_date'], 0, 10),
accountidToName($row['salesid']) accountidToName($row['salesid'])
]; ];

8
wms/wipwholeinstall-renovate-index-table-html.php

@ -155,8 +155,12 @@
</td> </td>
<td> <td>
<?php <?php
if (!empty($data['official_check_date'])) if ($data['association_check_type'] == '1') {
echo date("Y/m/d", strtotime($data['official_check_date'])); echo "-";
} else {
if (!empty($data['official_check_date']))
echo date("Y/m/d", strtotime($data['official_check_date']));
}
?> ?>
</td> </td>
<td> <td>

Loading…
Cancel
Save