You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
6.6 KiB
142 lines
6.6 KiB
<?php
|
|
include "./header.php";
|
|
$Bill = $_POST['Bill'];
|
|
$BillData = json_decode($Bill, true);
|
|
$pay_id = $_GET['pay_id'];
|
|
// echo $pay_id."<br>";
|
|
// print_r($BillData);
|
|
$sql_pay = "SELECT * from account_received where pay_id = '$pay_id'";
|
|
$pay = mysqli_query($link, $sql_pay);
|
|
$pay = mysqli_fetch_assoc($pay);
|
|
|
|
?>
|
|
<div style="width: 90%;">
|
|
|
|
<div style="padding-left: 2rem; padding-bottom: 1rem;">
|
|
<button type="button" onclick="backToIndex()" class="btn btn-outline-primary btn-lg"><span class="glyphicon glyphicon-menu-left"></span></button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container">
|
|
<div class="text-center">
|
|
<h3><strong><?= $BillData[4] ?></strong></h3>
|
|
<h4>編輯收款資訊</h4>
|
|
</div>
|
|
<form class="form-horizontal" id="pay_received" method="POST" action="account-receivable-received-submit.php?type=edit&<?= $token_link ?>" enctype="multipart/form-data">
|
|
<div class="form-group" style="margin-left: 1%;margin-right: 1%;">
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<label for="BillNo">合約號</label>
|
|
<input type="text" class="form-control" id="BillNo" name="BillNo" value="<?= $BillData[0] ?>" disabled>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="DeptName">部門</label>
|
|
<input type="text" class="form-control" id="DeptName" name="DeptName" value="<?= $BillData[1] ?>" disabled>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="ManagerName">經理</label>
|
|
<input type="text" class="form-control" id="ManagerName" name="ManagerName" value="<?= $BillData[2] ?>" disabled>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="PersonName">營業員</label>
|
|
<input type="text" class="form-control" id="PersonName" name="PersonName" value="<?= $BillData[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="<?= $BillData[14] ?>" disabled>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="TaxNo">統一編號</label>
|
|
<input type="text" class="form-control" id="TaxNo" name="TaxNo" value="<?= $BillData[15] ?>" disabled>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="ContactAddress">聯絡地址</label>
|
|
<input type="text" class="form-control" id="ContactAddress" name="ContactAddress" value="<?= $BillData[16] ?>" disabled>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
<label for="InvoiceDate">發票開立日期</label>
|
|
<input type="date" class="form-control" id="InvoiceDate" name="InvoiceDate" value="<?= $pay['invoice_date'] ?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="InvoiceAmount">發票金額</label>
|
|
<input type="number" class="form-control" id="InvoiceAmount" name="InvoiceAmount" value="<?= $pay['invoice_amount'] ?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="InvoiceNo">發票號碼</label>
|
|
<input type="text" class="form-control" id="InvoiceNo" name="InvoiceNo" value="<?= $pay['invoice_no'] ?>">
|
|
</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" value="<?= $pay['received_date'] ?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="ReceivedAmount">收款金額</label>
|
|
<input type="number" class="form-control" id="ReceivedAmount" name="ReceivedAmount" value="<?= $pay['received_amount'] ?>">
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label for="remark">備註</label>
|
|
<input type="text" class="form-control" id="remark" name="remark" value="<?= $pay['remark'] ?>">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<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>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<input type="hidden" name="pay_id" value="<?= $pay['pay_id'] ?>">
|
|
<input type="hidden" name="Bill" id="Bill" value="">
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-3">
|
|
</div>
|
|
<div class="col-md-9">
|
|
<button type="button" onclick="send()" class="btn btn-primary btn-lg pull-right">送出</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
function backToIndex() {
|
|
var Bill = <?= $Bill ?>;
|
|
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();
|
|
}
|
|
|
|
function send() {
|
|
event.preventDefault();
|
|
var Bill = <?= $Bill ?>;
|
|
Bill = JSON.stringify(Bill);
|
|
$("#Bill").val(Bill);
|
|
$("#pay_received").submit();
|
|
}
|
|
</script>
|