Browse Source

新增會計人員權限; 修改通知

gary
Ellin 1 year ago
parent
commit
72d8aa0528
  1. BIN
      wms/WriteOff.xlsx
  2. 28
      wms/rib01-check.php
  3. 4
      wms/rib01-delete.php
  4. 2
      wms/rib01-edit.php
  5. 8
      wms/rib01-index.php
  6. 2
      wms/rib01-submit.php
  7. 2
      wms/rib02-check.php
  8. 4
      wms/rib02-create.php
  9. 8
      wms/rib02-edit.php
  10. 2
      wms/rib02-submit.php
  11. 32
      wms/rib03-submit.php

BIN
wms/WriteOff.xlsx

Binary file not shown.

28
wms/rib01-check.php

@ -88,7 +88,7 @@ if ($state == 0) :
</p>
</div>
<?php
elseif ($state == 1 && $user_id == "M0056") :
elseif ($state == 1 && ($user_id == "M0056" || $user_id == "M0209")) :
?>
<div style="width: 90%;">
@ -107,7 +107,7 @@ elseif ($state == 1 && $user_id == "M0056") :
</p>
</div>
<?php
elseif ($state == 1 && $user_id != "M0056") :
elseif ($state == 1 && ($user_id == "M0056" || $user_id == "M0209")) :
?>
<div style="padding-left: 2rem;">
@ -179,28 +179,6 @@ endif
</div>
<div class="form-group">
<!-- <div class="col-md-3">
<label for="WriteOffType">報銷人類型</label>
<select name="WriteOffType" id="WriteOffType" class="form-control" disabled>
<option value=0 <?php if ($data['WriteOffType'] == 0) {
echo "selected";
} ?>>客戶</option>
<option value=1 <?php if ($data['WriteOffType'] == 1) {
echo "selected";
} ?>>廠商</option>
<option value=2 <?php if ($data['WriteOffType'] == 2) {
echo "selected";
} ?>>員工</option>
<option value=3 <?php if ($data['WriteOffType'] == 3) {
echo "selected";
} ?>>其他</option>
<option value=4 <?php if ($data['WriteOffType'] == 4) {
echo "selected";
} ?>>公司</option>
</select>
</div> -->
<div class="col-md-3">
<label for="DeptId">報銷單位</label>
<select name="DeptId" id="DeptId" class="form-control" required disabled>
@ -253,7 +231,7 @@ endif
</div>
</div>
<?php
if ($user_id == "M0056" && $state == 1) { ?>
if (($user_id == "M0056" || $user_id == "M0209") && $state == 1) { ?>
<div class="form-group">
<div class="col-md-3">

4
wms/rib01-delete.php

@ -2,7 +2,7 @@
include "./header.php";
$rib_id = isset($_GET['id']) ? $_GET['id'] : die('ERROR:Rib_id is not found.');
$state = isset($_GET['state'])?$_GET['state']:0;
if ($state==1&& $user_id=="M0056"){
if ($state==1&& ($user_id == "M0056" || $user_id == "M0209")){
?>
<script type="text/javascript">
@ -22,7 +22,7 @@ if ($state==1&& $user_id=="M0056"){
</script>
<?php
}
elseif($state==1&& $user_id!="M0056"){
elseif($state==1&& $user_id!="M0056" && $user_id!="M0209"){
?>
<script type="text/javascript">

2
wms/rib01-edit.php

@ -205,7 +205,7 @@ if ($pay_data) {
</div>
<div class="form-group">
<?php
if ($user_id == "M0056" && $state == 1) { ?>
if (($user_id == "M0056" || $user_id == "M0209") && $state == 1) { ?>
<div class="form-group">
<div class="col-md-3">

8
wms/rib01-index.php

@ -8,7 +8,7 @@ $data = array();
$sql = "select * from rib ";
// 是否為會計 阿娥
if ($user_id == 'M0056') {
if (($user_id == "M0056" || $user_id == "M0209")) {
$sql .= "WHERE ((CurrentState =1) or (TransactId= '$user_id') or (WriteOffId='$user_id') or (GatheringPersonId='$user_id'))";
$data = mysqli_query($link, $sql);
} else {
@ -96,7 +96,7 @@ if ($data) :
<th>報銷人</th>
<th>幣別</th>
<?php
if ($user_id == "M0056") { ?>
if (($user_id == "M0056" || $user_id == "M0209")) { ?>
<th>報銷金額</th>
<?php } ?>
<th style="width: 8%;">狀態</th>
@ -129,7 +129,7 @@ if ($data) :
elseif ($data['CurrId'] == "EUR") : echo "歐元";
endif; ?> </td>
<?php
if ($user_id == "M0056") { ?>
if (($user_id == "M0056" || $user_id == "M0209")) { ?>
<td><?php echo $data['OAmountWithTax']; ?> </td>
<?php } ?>
<td><?php if ($data['CurrentState'] == 0) : echo "草稿";
@ -142,7 +142,7 @@ if ($data) :
</td>
<td>
<p>
<?php if ($user_id == 'M0056' && $data['CurrentState'] == 1) {
<?php if (($user_id == "M0056" || $user_id == "M0209") && $data['CurrentState'] == 1) {
?>
<a href="rib01-check.php?id=<?php echo $data['rib_id'] ?>&state=1&<?= $token_link ?>" class="btn btn-success btn-sm">
<span class="glyphicon glyphicon-pawn"></span>

2
wms/rib01-submit.php

@ -82,7 +82,7 @@ if (mysqli_affected_rows($link)) {
}
//增加紀錄
if ($user_id == 'M0056') {
if (($user_id == "M0056" || $user_id == "M0209")) {
$sql_submit = str_replace("'", "", $SQL1);
$sql_rib = "UPDATE rib SET LastOperatorId = '$user_id', LastOperation='$sql_submit' WHERE rib_id=$rib_id";
mysqli_query($link, $sql_rib);

2
wms/rib02-check.php

@ -172,7 +172,7 @@ $unit = mysqli_fetch_all($unit_query, MYSQLI_ASSOC);
</div>
</div>
<?php
if ($user_id == "M0056") {
if ($user_id == "M0056" || $user_id == "M0209") {
?>
<div class="form-group">
<div class="col-md-3">

4
wms/rib02-create.php

@ -105,7 +105,7 @@ $materials = $conn->query($sql_Material);
<input class="form-control" type="int" name="FeeDate" id="FeeDate" placeholder="西元年(4碼)+月(2碼)+日(2碼)" required>
</div>
<?php if ($user_id == "M0056") { ?>
<?php if ($user_id == "M0056" || $user_id == "M0209") { ?>
<div class="col-md-3">
<label for="FeeTypeId" style="color: red;">費用項目代碼</label>
<select name="FeeTypeId" class="form-control" required>
@ -282,7 +282,7 @@ $materials = $conn->query($sql_Material);
<option value="25">一般電子發票-> 進項三聯式收銀機統一發票及一般稅額計算之電子發票</option>
<option value="21">三聯式手開發票-> 進項三聯式、電子計算機統一發票</option>
<option value="22">二聯式收銀機發票 -> 進項二聯式收銀機統一發票、載有稅額之其他憑證</option>
<?php if ($user_id == "M0056") { ?>
<?php if ($user_id == "M0056" || $user_id == "M0209") { ?>
<option value="23">三聯式、電子計算機、三聯式收銀機統一發票及一般稅額計算之電子發票之進貨退出或折讓證明單</option>
<option value="24">二聯式收銀機統一發票及載有稅額之其他憑證之進貨退出或折讓證明單</option>
<option value="26">彙總登錄每張稅額伍佰元以下之進項三聯式、電子計算機統一發票</option>

8
wms/rib02-edit.php

@ -89,7 +89,7 @@ $materials = $conn->query($sql_Material);
<input class="form-control" type="int" name="FeeDate" id="FeeDate" placeholder="西元年(4碼)+月(2碼)+日(2碼)" value="<?= $ribsub['FeeDate'] ?>" required>
</div>
<?php if ($user_id == "M0056") { ?>
<?php if ($user_id == "M0056" || $user_id == "M0209") { ?>
<div class="col-md-3">
<label for="FeeTypeId" style="color: red;">費用項目代碼</label>
<select name="FeeTypeId" class="form-control" required>
@ -296,7 +296,7 @@ $materials = $conn->query($sql_Material);
</div>
</div>
<?php
if ($user_id == "M0056" && $state == 1) {
if (($user_id == "M0056" || $user_id == "M0209") && $state == 1) {
?>
<div class="form-group">
<div class="col-md-3">
@ -385,7 +385,7 @@ $materials = $conn->query($sql_Material);
<option value="22" <?php if ($ribsub['InvoiceId'] == "22") {
echo "selected";
} ?>>二聯式收銀機發票 -> 進項二聯式收銀機統一發票、載有稅額之其他憑證</option>
<?php if ($user_id == "M0056") { ?>
<?php if ($user_id == "M0056" || $user_id == "M0209") { ?>
<option value="23" <?php if ($ribsub['InvoiceId'] == "23") {
echo "selected";
} ?>>三聯式、電子計算機、三聯式收銀機統一發票及一般稅額計算之電子發票之進貨退出或折讓證明單</option>
@ -649,7 +649,7 @@ $materials = $conn->query($sql_Material);
} else {
$("#OAmount").prop("disabled", false);
<?php
if ($user_id == "M0056" && $state == 1) { ?>
if (($user_id == "M0056" || $user_id == "M0209") && $state == 1) { ?>
$("#OTax").prop("disabled", false);
$("#LTax").prop("disabled", false);
$("#OAmountUnWithTax").prop("disabled", false);

2
wms/rib02-submit.php

@ -128,7 +128,7 @@ if ($submit == "add") {
$SQL1 .= isset($OAmountUnWithTax) ? ",OAmountUnWithTax=$OAmountUnWithTax" : "";
$SQL1 .= isset($LAmountUnWithTax) ? ",LAmountUnWithTax=$LAmountUnWithTax" : "";
$SQL1 .= isset($LAmount) ? ",LAmount=$LAmount" : "";
if ($user_id == "M0056" && $state == 1) {
if (($user_id == "M0056" || $user_id == "M0209") && $state == 1) {
$SQL1 .= ",FeeBalance=$LAmountUnWithTax";
$SQL1 .= ",WriteOffAmount=$OAmount";
}

32
wms/rib03-submit.php

@ -200,16 +200,10 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan
}
$notice_rib_num = mysqli_num_rows($notice_rib);
$notice_rib = mysqli_fetch_row($notice_rib);
$notice_sql = "SELECT * FROM notice WHERE related_id = 810";
$notice_num = mysqli_query($link, $notice_sql);
$notice_num = mysqli_num_rows($notice_num);
$title = "有" . $notice_rib_num . "個費用報銷單待審核";
if ($notice_num == 0) {
$insert_notice_sql = "INSERT INTO notice (kind, related_id, title, content, haveread, permission, creater) VALUES(1,810,'$title','$content',1,'M0056','system')";
} else {
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',permission='M0056' WHERE related_id=810";
}
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1654";
mysqli_query($link, $insert_notice_sql);
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1959";
mysqli_query($link, $insert_notice_sql);
} elseif ($state == 2) {
//取得表頭資料
@ -392,23 +386,11 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan
}
$notice_rib_num = mysqli_num_rows($notice_rib);
$notice_rib = mysqli_fetch_row($notice_rib);
$notice_sql = "SELECT * FROM notice WHERE related_id = 810";
$notice_num = mysqli_query($link, $notice_sql);
$notice_num = mysqli_num_rows($notice_num);
$title = "有" . $notice_rib_num . "個費用報銷單待審核";
if ($notice_rib_num > 0) {
if ($notice_num == 0) {
$insert_notice_sql = "INSERT INTO notice (kind, related_id, title, content, haveread, permission, creater) VALUES(1,810,'$title','$content',1,'M0056','system')";
} else {
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',permission='M0056' WHERE related_id=810";
}
mysqli_query($link, $insert_notice_sql);
} else {
if ($notice_num != 0) {
$insert_notice_sql = "DELETE FROM notice WHERE related_id = 810";
}
mysqli_query($link, $insert_notice_sql);
}
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1654";
mysqli_query($link, $insert_notice_sql);
$insert_notice_sql = "UPDATE notice SET title= '$title', content='$content',haveread=NULL WHERE id=1959";
mysqli_query($link, $insert_notice_sql);
}
?>
<script>

Loading…
Cancel
Save