| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/innoutstorage/webadmin/ |
Upload File : |
<?php
require_once('check_login.php');
$invoice_info = get_invoice((int)$_GET["id"]);
$customer_id = $invoice_info["customer_id"];
if(!empty($invoice_info["order_id"])){
$order_info = get_order($invoice_info["order_id"]);
$invoice_info["customer_code"] = $order_info["customer_code"];
$invoice_info["customer_name"] = $order_info["customer_name"];
}else{
$customer_info = get_customer($customer_id);
$invoice_info["customer_code"] = $customer_info["code"];
$invoice_info["customer_name"] = $customer_info["customer_name"];
}
$invoice_status = get_master_type_code("INVOICE_STATUS", $invoice_info["invoice_status"]);
//$invoice_dtl_info = get_invoice_detail($invoice_info["invoice_id"]);
//$order_product_info = get_order_product($invoice_info["order_id"]);
//$payment_info = get_payment($invoice_info["order_id"], "INVOICE", $invoice_info["invoice_id"]);
$invoice_dtl_info_in_type = array();
$invoice_dtl_type_info = get_master_type_code("INVOICE_TYPE");
foreach ($invoice_dtl_type_info as $type) {
$invoice_dtl_info_in_type[$type["code"]][] = get_invoice_dtl_type($invoice_info["invoice_id"], $type["code"]);
}
$sql99 = "SELECT * FROM sys_cms_login WHERE cmsloginid=?";
$parameters99 = array((int)$invoice_info{'invoice_lastupby'});
$row99 = bind_pdo($sql99, $parameters99, "selectone");
?>
<!DOCTYPE html>
<html>
<head>
<?php require_once("html_head.php"); ?>
</head>
<body>
<form action="invoice_modify.php" method="post" name="modifyform" enctype="multipart/form-data">
<input type="hidden" name="invoice_id" value="<?= $invoice_info['invoice_id']; ?>"/>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="70" align="right" valign="middle" class="icontxt">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="50" align="center" style="font-size: 12px;">
<div onClick="location.href='output_invoice2.php?type=INVOICE&invoice_id=<?=$_GET["id"]?>'" style="cursor:pointer;">
<img src="images/print.png" width="32" height="32" border="0"/>
<br>
列印
</div>
</td>
<td width="60" align="center" style="font-size: 12px;">
<div onClick="location.href='_ajax.php?for=invoice_email&type=INVOICE&invoice_id=<?=$_GET["id"]?>'" style="cursor:pointer;">
<img src="images/mail.png" width="32" height="32" border="0"/>
<br>
電郵發票
</div>
</td>
<td width="50" align="center" style="font-size: 12px;">
<input type="image" alt="submit" src="images/iconSave.png" width="32" height="32" border="0"><br>
儲存 </td>
<td width="50" align="center">
<a href="order_index.php?<?php
if (isset($_SESSION["index_url_parameter"])){
if(substr($_SESSION["index_url_parameter"],-18) == urlencode("取消")){
echo $_SESSION["index_url_parameter"];
} else {
echo $_SESSION["index_url_parameter"] . "&msg=取消";
}
}
?>"
>
<img src="images/iconCancel.png" alt="取消" width="32" height="32" border="0"><br>
取消
</a>
</td>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<span style="float:left;" class="pagetitletxt">
<b><img src="images/iconList.jpg" width="48" height="48" align="absmiddle"/> 發票詳情
</b></span><span style="float:right;" class="msg">最近更新: <?= $row99{'cmsusername'} . ' ' . $invoice_info{'invoice_lastupdate'}; ?></span>
</td>
</tr>
<tr>
<td align="left" valign="middle"><!-- Content -->
<table style="width: 1000px; padding-left: 15px;">
<tr>
<td>
<p>狀態: </p>
</td>
<td>
<?php
if($invoice_info["invoice_status"] == "SETTLED"){
$invoice_status_info = get_master_type_code("INVOICE_STATUS", $invoice_info["invoice_status"]);
echo "<input type='hidden' name='invoice_status' value='SETTLED' />";
echo $invoice_status_info["name_tc"];
}else{
echo "<select name='invoice_status'>";
$invoice_status_info = get_master_type_code("INVOICE_STATUS");
foreach ($invoice_status_info as $invoice_status) {
if ($invoice_status["code"] == $invoice_info["invoice_status"]) {
$selected = "selected";
} else {
$selected = "";
}
echo "<option value='" . $invoice_status["code"] . "' " . $selected . ">" . $invoice_status["name_tc"] . "</option>";
}
echo "</select>";
}
?>
</td>
</tr>
<tr>
<td style="width: 100px;">
<p>發票編號: </p>
</td>
<td>
<?= $invoice_info["invoice_code"] ?>
</td>
</tr>
<?php
if (!empty($invoice_info["order_id"])) {
$order_info = get_order($invoice_info["order_id"]);
$order_room_list = "";
$order_room_info = get_order_room($invoice_info["order_id"]);
if(!empty($order_room_info)){
foreach($order_room_info as $order_room){
$room_info = get_room($order_room["room_id"]);
$master_room_info = get_master_room($room_info["master_room_id"]);
$order_room_list .= check_combine_room($room_info["code"]) ." (".$master_room_info["length"]."'x".$master_room_info["width"]."'x".$master_room_info["height"]."'), ";
}
$order_room_list = substr_replace($order_room_list ,"",-2);
}
?>
<tr>
<td>
<p>合約編號: </p>
</td>
<td>
<a href='order_modifyform.php?order_id=<?= $invoice_info["order_id"] ?>' target='_blank'><?= $order_info["code"] ?></a>
</td>
</tr>
<tr>
<td>
<p>租用單位: </p>
</td>
<td>
<?=$order_room_list?>
</td>
</tr>
<?php } ?>
<tr>
<td>
<p>客戶編號: </p>
</td>
<td>
<a href='customer_modifyform.php?id=<?= $invoice_info["customer_id"] ?>' target='_blank'><?= $invoice_info["customer_code"] ?></a>
</td>
</tr>
<tr>
<td>
<p>客戶姓名: </p>
</td>
<td>
<?= $invoice_info["customer_name"] ?>
</td>
</tr>
<tr>
<td>
<p>發票日期: </p>
</td>
<td>
<?= $invoice_info["invoice_docdate"] ?>
</td>
</tr>
<tr>
<td>
<p>發票到期: </p>
</td>
<td>
<?= $invoice_info["invoice_duedate"] ?>
</td>
</tr>
<tr>
<td>
<p>發票細項: </p>
</td>
<td>
<?php
foreach ($invoice_dtl_info_in_type as $type => $invoice_dtl_info) {
if ($type == "RENT") {
if (!empty($invoice_dtl_info[0])) {
?>
<hr>
<p>租金項目 : </p>
<table cellpadding="5" id="product_table">
<tr>
<td>
租用月份
</td>
<td>
租金
</td>
<td>
備註
</td>
</tr>
<?php
$rent_total = 0;
foreach ($invoice_dtl_info as $invoice_dtl) {
foreach ($invoice_dtl as $dtl) {
/*$month_from = Date('Y-m-d', strtotime($order_info["warehousing_date"] . "+" . ($dtl["month"] - 1) . " month"));
$month_to = Date('Y-m-d', strtotime($order_info["warehousing_date"] . "+" . $dtl["month"] . " month -1 day"));*/
$result = get_rent_date_from_to($order_info["warehousing_date"], $dtl["month"]);
$month_from = $result["start"];
$month_to = $result["end"];
echo "<tr>
<td>" . $month_from . " 至 " . $month_to . "</td>
<td>$" . numberformat($dtl["amount"]) . "</td>
<td><textarea name='remark[".$dtl["id"]."]'>".$dtl["remark"]."</textarea></td>
</tr>";
$rent_total += $dtl["amount"];
}
}
?>
</table>
<?php echo "<br>租金小計: $" . numberformat($rent_total); ?>
<?php
}
}
if ($type == "ORDER_PRODUCT") {
if (!empty($invoice_dtl_info[0])) {
?>
<hr>
<p>選購物品項目 : </p>
<table cellpadding="5" id="product_table">
<tr>
<td>
名稱
</td>
<td>
數量
</td>
<td>
價錢
</td>
<td>
小計
</td>
</tr>
<?php
$order_product_total = 0;
$remark = "";
foreach ($invoice_dtl_info as $invoice_dtl) {
foreach ($invoice_dtl as $dtl) {
$remark = $dtl["remark"];
$product_info = get_product($dtl["order_dtl_id"]);
echo "<tr>
<td>" . $product_info["name_tc"] . "</td>
<td>" . (int)$dtl["qty"] . "</td>
<td>$" . numberformat($dtl["price"]) . "</td>
<td>$" . numberformat($dtl["price"] * $dtl["qty"]) . "</td>
</tr>";
$order_product_total += $dtl["price"] * $dtl["qty"];
}
}
?>
</table>
<?php echo "<br>物品小計: $" . numberformat($order_product_total) .""; ?>
<?php
}
}
if ($type == "PENALTY") {
if (!empty($invoice_dtl_info[0])) {
?>
<hr>
<p>罰款項目 : </p>
<table cellpadding="5" id="product_table">
<tr>
<td>
罰款
</td>
<td>
類型
</td>
</tr>
<?php
$penalty_total = 0;
foreach ($invoice_dtl_info as $invoice_dtl) {
foreach ($invoice_dtl as $dtl) {
echo "<tr>
<td>$" . numberformat($dtl["amount"]) . "</td>
<td><input type='text' name='remark[".$dtl["id"]."]' value='".$dtl["remark"]."' /></td>
</tr>";
$penalty_total += $dtl["amount"];
}
}
?>
</table>
<?php echo "<br>罰款小計: $" . numberformat($penalty_total); ?>
<?php
}
}
}
?>
</td>
</tr>
<tr>
<td>
<p>總金額: </p>
</td>
<td>
$<?= numberformat($invoice_info["amount"]); ?>
</td>
</tr>
<tr>
<td>
<p>結欠: </p>
</td>
<td>
$<?= numberformat($invoice_info["invoice_balance"]); ?>
</td>
</tr>
<tr>
<td>
<p>發票備註 : </p>
</td>
<td>
<textarea name="invoice_remark" style="width: 500px; height: 100px;"><?=$invoice_info["remark"]?></textarea>
</td>
</tr>
</table>
<br><br><br><br>
<!-- End Content -->
</td>
</tr>
</table>
</form>
</body>
</html>