8 changed files with 2002 additions and 1575 deletions
@ -0,0 +1,69 @@ |
|||
<?php |
|||
require_once('../../contract/connt8.php'); |
|||
|
|||
if (!empty($_GET['contract_no'])) { |
|||
$contract_no = $_GET['contract_no']; |
|||
$sql = "SELECT |
|||
a.BillNo, |
|||
b.OTaxAmt as amount, |
|||
a.CU_EstPayDate as createDate, |
|||
b.PersonId as personId, |
|||
c.BillNo as CBno, |
|||
c.CU_MaterialId as facility |
|||
FROM salIncomeApplyDetail as a |
|||
LEFT JOIN salIncomeApplyMaster as b ON a.BillNo = b.BillNo |
|||
LEFT JOIN ( |
|||
SELECT aMaster.BillNo,aMaster.BizPartnerId,aDetail.CU_MaterialId FROM arCheckBill as aMaster |
|||
LEFT JOIN arCheckBillDetail as aDetail ON aMaster.BizPartnerId = aDetail.FromBillNo |
|||
WHERE aMaster.BizPartnerId = 'Q23080067' AND aMaster.TypeId = 'RVS' |
|||
) AS c ON a.BillNo = c.BizPartnerId |
|||
WHERE a.BillNo = 'Q23080067' |
|||
AND a.RowNo = '1' |
|||
"; |
|||
$stmt = $connT8->prepare($sql); |
|||
$stmt->execute(); |
|||
$data = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
$data['amount'] = intval($data['amount']); |
|||
$checkBillNo = $data['CBno']; |
|||
|
|||
|
|||
$sql = "SELECT |
|||
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 = '$checkBillNo' |
|||
"; |
|||
|
|||
$stmt = $connT8->prepare($sql); |
|||
$stmt->execute(); |
|||
$check = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
|
|||
|
|||
$sql = "SELECT SQuantity FROM salIncomeApplyMaster WHERE BillNo = '$contract_no'"; |
|||
$stmt = $connT8->prepare($sql); |
|||
$stmt->execute(); |
|||
$result = $stmt->fetch(PDO::FETCH_ASSOC); |
|||
$count = COUNT($result); |
|||
$data['maintain_month'] = intval($conunt * $result['Squantity']) |
|||
|
|||
|
|||
|
|||
|
|||
if (!empty($check['CheckBillDate'])) { |
|||
header('Content-Type: application/json'); |
|||
echo json_encode($data); |
|||
} else { |
|||
echo false; |
|||
exit; |
|||
} |
|||
} |
@ -0,0 +1,118 @@ |
|||
<?php |
|||
include('../header.php'); |
|||
require_once('../contract-repair/conn.php'); |
|||
?> |
|||
|
|||
<link rel="stylesheet" href="../contract-repair/styles/style.css"> |
|||
<link rel="stylesheet" href="../contract-repair/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 src="../contract-repair/js/alpine.js"></script> |
|||
<script defer src="../contract-repair/js/alpinejs/cdn.min.js"></script> |
|||
<script src="../contract-repair/js/axios/axios.min.js"></script> |
|||
<script src="../contract-repair/js/jquery/jquery-3.1.1.min.js"></script> |
|||
<script src="../contract-repair/semantic/dist/semantic.min.js"></script> |
|||
|
|||
<div class="bons_index" x-data="bonsIndex"> |
|||
<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: botton 20px;"> |
|||
<tr> |
|||
<td style="vertical-align: middle;">合約號</td> |
|||
<td colspan="5"> |
|||
<input class="form-control" @keyup="nextStepKeyupFn($event)" type="text" name="contract_no" x-model="data.contract_no"> |
|||
</td> |
|||
<td colspan="2" style="vertical-align:middle"></td> |
|||
</tr> |
|||
</tbody> |
|||
</template> |
|||
|
|||
<template x-if="step==2"> |
|||
<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_back" 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.contract_no" disabled="disabled"> |
|||
</td> |
|||
<td style="vertical-align:middle">合約類別</td> |
|||
<td> |
|||
<select id="client_type" x-model="data.client_type"> |
|||
<option value="">--請選擇--</option> |
|||
<option value="1">新簽約</option> |
|||
<option value="2">免保轉有費</option> |
|||
<option value="3">續簽約</option> |
|||
</select> |
|||
</td> |
|||
<td style="vertical-align:middle">作番號</td> |
|||
<td> |
|||
<input type="text" x-model="data.facility_no" disabled="disabled"> |
|||
</td> |
|||
|
|||
<td style="vertical-align:middle">獎金適用版本</td> |
|||
<td> |
|||
<input type="text" x-model="data.bons_verson" disabled="disabled"> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="vertical-align:middle">獎金發放人員</td> |
|||
<td> |
|||
<input type="text" x-model="data.receiver" disabled="disabled"> |
|||
</td> |
|||
<td style="vertical-align:middle">保養月份</td> |
|||
<td> |
|||
<input type="text" x-model="data.maintain_month" disabled="disabled"> |
|||
</td> |
|||
<td style="vertical-align:middle">保養總額</td> |
|||
<td> |
|||
<input type="text" x-model="data.maintain_price_toal" disabled="disabled"> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</template> |
|||
</table> |
|||
|
|||
<button x-show="step==3" @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<=2" @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> |
@ -0,0 +1,15 @@ |
|||
<?php |
|||
require_once dirname(__FILE__) . "/../../mkt/database.php"; |
|||
include "/Users/LO_2342/Desktop/httpdocs/wms/fun_global.php"; |
|||
// phpinfo(); |
|||
// exit(); |
|||
try { |
|||
$connT8 = new PDO("sqlsrv:Server=220.130.203.251;Database=T8test", "M0225", "IFFBU1E="); |
|||
if ($connT8) { |
|||
$connT8->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
|||
} |
|||
} catch (PDOException $e) { |
|||
// echo "fail"; |
|||
// echo $e->getMessage(); |
|||
die("ERROR!!!: " . $e->getMessage()); |
|||
} |
Loading…
Reference in new issue