Browse Source

Merge branch 'kaiyu'

main
Ellin 1 year ago
parent
commit
6e53956322
  1. 193
      wms/account-receivable-new-index.php

193
wms/account-receivable-new-index.php

@ -305,7 +305,7 @@ foreach ($query_wip as $wip) {
$arrayData[$wip['contractno']]['facility_status'] .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) ; ";
} elseif ($wip['real_contract_arrival_date'] != NULL && $wip['real_contract_arrival_date'] !== '1970-01-01' && $wip['delivery_date'] !== '1970-01-11' && !empty($wip['real_contract_arrival_date'])) {
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['real_contract_arrival_date'] . "預計出貨";
$arrayData[$wip['contractno']]['facility_status'] .= $wip['facilityno'] . " (" . $wip['real_contract_arrival_date'] . "預計出貨) ; ";
$arrayData[$wip['contractno']]['facility_status'] .= $wip['facilityno'] . " (" .date('Y-m-d',strtotime($wip['real_contract_arrival_date'])) . "預計出貨) ; ";
} elseif ($wip['estimated_shipping_date'] != NULL && $wip['estimated_shipping_date'] !== '1970-01-01' && $wip['delivery_date'] !== '1970-01-11' && !empty($wip['estimated_shipping_date'])) {
$arrayData[$wip['contractno']]['facility'][$wip['facilityno']]['status'] = $wip['estimated_shipping_date'] . "預計出港";
$arrayData[$wip['contractno']]['facility_status'] .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計出港) ; ";
@ -761,7 +761,7 @@ $excel_contract_boga_array = array();
$excel_contract_noboga_array = array();
$excel_facility_array = array();
foreach ($arrayData as $key => $value) {
foreach ($arrayData as $key => &$value) {
$excel_contract_array[$key] = array_fill(0, 76, '');
$excel_contract_array[$key][0] = (isset($value['BillNo']) && !is_null($value['BillNo'])) ? $value['BillNo'] : '';
@ -781,6 +781,7 @@ foreach ($arrayData as $key => $value) {
$excel_contract_array[$key][14] = (isset($value['receivable_budget']) && !is_null($value['receivable_budget'])) ? $value['receivable_budget'] : 0;
$excel_contract_array[$key][15] = (isset($value['invoice_budget']) && !is_null($value['invoice_budget'])) ? number_format(round($value['invoice_budget'])) : '0';
$excel_contract_array[$key][16] = (isset($value['received_budget']) && !is_null($value['received_budget'])) ? $value['received_budget'] : 0;
$value['collect_budget'] = ($excel_contract_array[$key][14] - $excel_contract_array[$key][16]) > 0 ? $excel_contract_array[$key][14] - $excel_contract_array[$key][16] : 0;
$excel_contract_array[$key][17] = number_format(round($excel_contract_array[$key][14] - $excel_contract_array[$key][16]));
$excel_contract_array[$key][18] = (isset($value['collect_month']) && !is_null($value['collect_month'])) ? number_format(round($value['collect_month'])) : '0';
$excel_contract_array[$key][19] = (isset($value['facility_num']) && !is_null($value['facility_num'])) ? number_format(round($value['facility_num'])) : '0';
@ -1110,6 +1111,7 @@ $noboga_data = json_encode($excel_contract_noboga_array);
</div>
</div>
</form>
<hr>
<form class="form-horizontal" id='myForm' method='post' action='account-receivable-new-index.php?<?= $token_link ?>'>
<table class="table table-striped table-bordered" style='width:98%;text-align:center;margin:0 auto'>
<tbody>
@ -1125,16 +1127,55 @@ $noboga_data = json_encode($excel_contract_noboga_array);
<tr>
<th class="text-center" style="vertical-align: middle;">合約催收次數</th>
<td colspan="2">
<input type="text" class='form-control' id='collect_time_start' name='collect_time_start' style='width:10%;display:inline;' oninput="searchFront('collect_time_start')">
≤ 催收次數 ≤
<input type="text" class='form-control' id='collect_time_end' name='collect_time_end' style='width:10%;display:inline;'>
<input type="text" class='form-control' id='search_collectstart' name='collect_time_start' style='width:10%;display:inline;' oninput="searchFront('collectstart')">
≤ 催收次數 ≤
<input type="text" class='form-control' id='search_collectend' name='collect_time_end' style='width:10%;display:inline;' oninput="searchFront('collectend')">
<!-- <button type="submit" class="btn btn-primary btn-sm">搜尋</button> -->
</td>
</tr>
<tr>
<th class="text-center" style="vertical-align: middle;">合約催收金額</th>
<td colspan="2">
<input type="text" class='form-control' id='search_CBudgetstart' name='collect_budget_start' style='width:40%;display:inline;' onblur="searchFront('CBudgetstart')">
≤ 催收金額 ≤
<input type="text" class='form-control' id='search_CBudgetend' name='collect_budget_end' style='width:40%;display:inline;' onblur="searchFront('CBudgetend')">
<!-- <button type="submit" class="btn btn-primary btn-sm">搜尋</button> -->
</td>
</tr>
</tbody>
</table>
</form>
<hr>
<div class="form-group">
<div class="col-md-4">
<label for="search_contract">查詢合約號</label>
<input type="text" id="search_contract" name="search_contract" class="form-control" placeholder="請輸入合約號" onblur="searchFront('contract')">
</div>
<div class="col-md-4">
<label for="search_dept">查詢部門</label>
<input type="text" id="search_dept" name="search_dept" class="form-control" placeholder="請輸入部門" onblur="searchFront('dept')">
</div>
<div class="col-md-4">
<label for="search_manager">查詢主管</label>
<input type="text" id="search_manager" name="search_manager" class="form-control" placeholder="請輸入主管工號/姓名" onblur="searchFront('manager')">
</div>
</div>
<div class="form-group">
<div class="col-md-4">
<label for="search_personId">查詢營業員</label>
<input type="text" id="search_personId" name="search_personId" class="form-control" placeholder="請輸入契約員工號/姓名" onblur="searchFront('personId')">
</div>
<div class="col-md-4">
<label for="search_customerid">查詢客戶編號</label>
<input type="text" id="search_customerid" name="search_customerid" class="form-control" placeholder="請輸入客戶編號" onblur="searchFront('customerid')">
</div>
<div class="col-md-4">
<label for="search_facility">查詢作番號</label>
<input type="text" id="search_facility" name="search_facility" class="form-control" placeholder="請輸入作番號" onblur="searchFront('facility')">
</div>
</div>
</div>
<?php
@ -1143,25 +1184,25 @@ include "./footer.php";
<div style="width:98%;margin:1% ;overflow-x: auto;">
<table id="table_index" class="table table-striped table-bordered" style="width:100%;">
<table class="table table-striped table-bordered" style="width:100%;">
<thead>
<tr>
<th style="width: 120px;">合約號</th>
<th style="width: 120px;">部門</th>
<th style="width: 120px;">主管</th>
<th style="width: 120px;">營業員</th>
<th style="width: 180px;">客戶</th>
<th style="width: 300px;">作番狀態</th>
<th style="width: 150px;">合約-設備金額</th>
<th style="width: 150px;">合約-安裝金額</th>
<th style="width: 150px;">合約總金額</th>
<th style="width: 150px;">合約目前應收</th>
<th style="width: 150px;">已開票金額</th>
<th style="width: 150px;">已收金額金額</th>
<th style="width: 150px;">催收金額金額</th>
<th style="width: 100px;">催收次數</th>
<th style="width: 100px;">作番數量</th>
<th style="width: 100px;">合約號</th>
<th style="width: 100px;">部門</th>
<th style="width: 100px;">主管</th>
<th style="width: 100px;">營業員</th>
<th style="width: 150px;">客戶</th>
<th style="width: 280px;">作番狀態</th>
<th style="width: 110px;">合約<br>設備金額</th>
<th style="width: 110px;">合約<br>安裝金額</th>
<th style="width: 110px;">合約<br>總金額</th>
<th style="width: 110px;">合約<br>目前應收</th>
<th style="width: 110px;">合約<br>已開票金額</th>
<th style="width: 110px;">合約<br>已收金額</th>
<th style="width: 110px;">合約<br>催收金額</th>
<th style="width: 90px;">合約<br>催收次數</th>
<th style="width: 90px;">作番數量</th>
<th style="width: 120px;">訂金 <br>名稱</th>
<th style="width: 120px;">訂金<br>合約金額</th>
@ -1235,22 +1276,22 @@ include "./footer.php";
<?php
foreach ($arrayData as $key => $value) {
?>
<tr>
<th><?= $key ?></th>
<td style="text-align: center;"><?= $value['DeptId'] . "<br>" . $value['DeptName'] ?></td>
<td style="text-align: center;"><?= $value['ManagerId'] . "<br>" . $value['ManagerName'] ?></td>
<td style="text-align: center;"><?= $value['PersonId'] . "<br>" . $value['PersonName'] ?></td>
<td style="text-align: center;"><?= $value['CustomerId'] . "<br>" . $value['CustomerName'] ?></td>
<td style="text-align: end;"><?= $value['facility_status'] ?></td>
<tr class="data-row" style="display: '';" id="<?= $key ?>">
<th class="contract"><?= $key ?></th>
<td style="text-align: center;" class="dept"><?= $value['DeptId'] . "<br>" . $value['DeptName'] ?></td>
<td style="text-align: center;" class="manager"><?= $value['ManagerId'] . "<br>" . $value['ManagerName'] ?></td>
<td style="text-align: center;" class="personId"><?= $value['PersonId'] . "<br>" . $value['PersonName'] ?></td>
<td style="text-align: center;" class="customerid"><?= $value['CustomerId'] . "<br>" . $value['CustomerName'] ?></td>
<td style="text-align: end;" class="facility"><?= $value['facility_status'] ?></td>
<td style="text-align: end;"><?= number_format(round($value['A40001'])) ?></td>
<td style="text-align: end;"><?= number_format(round($value['A40008'])) ?></td>
<td style="text-align: end;"><?= number_format(round($value['total_budget'])) ?></td>
<td style="text-align: end;"><?= number_format(round($value['receivable_budget'])) ?></td>
<td style="text-align: end;"><?= number_format(round($value['invoice_budget'])) ?></td>
<td style="text-align: end;"><?= number_format(round($value['received_budget'])) ?></td>
<td style="text-align: end;"><?= number_format(round($value['collect_budget'])) ?></td>
<td style="text-align: end;"><?= $value['collect_month'] ?></td>
<td style="text-align: end;" class="CBudget"><?= number_format(round($value['collect_budget'])) ?></td>
<td style="text-align: end;" class="collect"><?= $value['collect_month'] ?></td>
<td style="text-align: end;"><?= $value['facility_num'] ?></td>
<td style="text-align: center;"><?= $excel_contract_array[$key][21] ?></td>
@ -1327,6 +1368,92 @@ include "./footer.php";
<script>
function searchFront(area) {
var term = 'search_' + area;
if (area == 'collectstart') {
var searchTerm = parseInt(document.getElementById(term).value);
var searchArea = document.getElementsByClassName('collect');
var rows = document.getElementsByClassName('data-row');
var criterion = parseInt(document.getElementById('search_collectend').value);
for (var i = 0; i < rows.length; i++) {
var rowText = parseInt(searchArea[i].textContent);
if (rowText >= searchTerm) {
rows[i].style.display = '';
} else {
rows[i].style.display = 'none';
}
if (criterion !== '' && rowText > criterion) {
rows[i].style.display = 'none';
}
}
} else if (area == 'collectend') {
var searchTerm = parseInt(document.getElementById(term).value);
var searchArea = document.getElementsByClassName('collect');
var rows = document.getElementsByClassName('data-row');
var criterion = parseInt(document.getElementById('search_collectstart').value);
for (var i = 0; i < rows.length; i++) {
var rowText = parseInt(searchArea[i].textContent);
if (rowText <= searchTerm) {
rows[i].style.display = '';
} else {
rows[i].style.display = 'none';
}
if (criterion !== '' && rowText < criterion) {
rows[i].style.display = 'none';
}
}
} else if (area == 'CBudgetstart') {
var searchTerm = parseInt(document.getElementById(term).value);
var searchArea = document.getElementsByClassName('CBudget');
var rows = document.getElementsByClassName('data-row');
var criterion = parseInt(document.getElementById('search_CBudgetend').value);
for (var i = 0; i < rows.length; i++) {
var rowText = parseInt(searchArea[i].textContent.replace(/,/g, ''));
if (isNaN(searchTerm) || searchTerm == 0) {
rows[i].style.display = '';
} else if (rowText >= searchTerm) {
rows[i].style.display = '';
} else {
rows[i].style.display = 'none';
}
if (criterion !== '' && rowText > criterion) {
rows[i].style.display = 'none';
}
}
} else if (area == 'CBudgetend') {
var searchTerm = parseInt(document.getElementById(term).value);
var searchArea = document.getElementsByClassName('CBudget');
var rows = document.getElementsByClassName('data-row');
var criterion = parseInt(document.getElementById('search_CBudgetstart').value);
for (var i = 0; i < rows.length; i++) {
var rowText = parseInt(searchArea[i].textContent.replace(/,/g, ''));
if (isNaN(searchTerm) || searchTerm == 0) {
rows[i].style.display = '';
} else if (rowText <= searchTerm) {
rows[i].style.display = '';
} else {
rows[i].style.display = 'none';
}
if (!isNaN(criterion) && rowText < criterion) {
rows[i].style.display = 'none';
}
}
} else {
var searchTerm = document.getElementById(term).value.toLowerCase();
var searchArea = document.getElementsByClassName(area);
var rows = document.getElementsByClassName('data-row');
for (var i = 0; i < rows.length; i++) {
var rowText = searchArea[i].textContent.toLowerCase();
if (rowText.includes(searchTerm)) {
rows[i].style.display = '';
} else {
rows[i].style.display = 'none';
}
}
}
}
function downloadData(content) {
if (content == 'all') {
var BillData = <?= $total_data ?>;

Loading…
Cancel
Save