|
|
@ -50,11 +50,11 @@ Main.CurrentState |
|
|
|
LEFT JOIN comGroupPerson AS Person ON MainAll.PersonId= Person.PersonId |
|
|
|
LEFT JOIN comDepartment AS Dept ON MainAll.DeptId= Dept.DeptId |
|
|
|
WHERE MainAll.TypeId = 'SP' AND (MainAll.CurrentState=2 OR MainAll.CurrentState=4) "; |
|
|
|
if(!is_null($start_date)){ |
|
|
|
if (!is_null($start_date)) { |
|
|
|
$start_date = (int)date('Ymd', strtotime($start_date)); |
|
|
|
$sql_contractNumber .= " AND MainAll.BillDate >= $start_date "; |
|
|
|
} |
|
|
|
if(!is_null($end_date)){ |
|
|
|
if (!is_null($end_date)) { |
|
|
|
$end_date = (int)date('Ymd', strtotime($end_date)); |
|
|
|
$sql_contractNumber .= " AND MainAll.BillDate <= $end_date "; |
|
|
|
} |
|
|
@ -314,7 +314,7 @@ $total_data = json_encode($excel_aray); |
|
|
|
<table class="table table-striped table-bordered" style='width:98%;text-align:center;margin:0 auto'> |
|
|
|
<tbody> |
|
|
|
<tr> |
|
|
|
<th class="text-center">合約日期</th> |
|
|
|
<th class="text-center" style="vertical-align: middle;">合約日期</th> |
|
|
|
<td colspan="2"> |
|
|
|
<input type="date" class='form-control' id='date_start' name='date_start' style='width:40%;display:inline;'> |
|
|
|
~ |
|
|
@ -322,13 +322,51 @@ $total_data = json_encode($excel_aray); |
|
|
|
<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="sum_total_budget" name="sum_total_budget" value="<?= number_format($sum_total_budget) ?> 元" disabled> |
|
|
|
</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="請輸入合約號" oninput="searchFront('contract')"> |
|
|
|
</div> |
|
|
|
<div class="col-md-4"> |
|
|
|
<label for="search_customerid">查詢客戶編號</label> |
|
|
|
<input type="text" id="search_customerid" name="search_customerid" class="form-control" placeholder="請輸入客戶編號" oninput="searchFront('customerid')"> |
|
|
|
</div> |
|
|
|
<div class="col-md-4"> |
|
|
|
<label for="search_customername">查詢客戶名稱</label> |
|
|
|
<input type="text" id="search_customername" name="search_customername" class="form-control" placeholder="請輸入客戶名稱" oninput="searchFront('customername')"> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<div class="col-md-3"> |
|
|
|
<label for="sum_total_budget">合約總金額</label> |
|
|
|
<input type="text" class="form-control" id="sum_total_budget" name="sum_total_budget" value="<?= number_format($sum_total_budget) ?>" disabled> |
|
|
|
<div class="col-md-4"> |
|
|
|
<label for="search_department">查詢部門</label> |
|
|
|
<input type="text" id="search_department" name="search_department" class="form-control" placeholder="請輸入部門" oninput="searchFront('department')"> |
|
|
|
</div> |
|
|
|
<div class="col-md-4"> |
|
|
|
<label for="search_personId">查詢契約員</label> |
|
|
|
<input type="text" id="search_personId" name="search_personId" class="form-control" placeholder="請輸入契約員工號/姓名" oninput="searchFront('personId')"> |
|
|
|
</div> |
|
|
|
<div class="col-md-4"> |
|
|
|
<label for="search_manager">查詢主管</label> |
|
|
|
<input type="text" id="search_manager" name="search_manager" class="form-control" placeholder="請輸入主管工號/姓名" oninput="searchFront('manager')"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<div class="col-md-2"> |
|
|
|
<input type="text" id="search_manager" name="search_manager" class="form-control" placeholder="請輸入主管工號/姓名" oninput="searchFront('manager')"> |
|
|
|
</div> |
|
|
|
<div class="col-md-2"> |
|
|
|
<input class="form-control" value="催收次數" disabled> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -361,23 +399,25 @@ include "./footer.php"; |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<?php foreach ($excel_aray as $key => $row) { ?> |
|
|
|
|
|
|
|
<tr class="data-row" style="display: '';" id="<?= $key; ?>"> |
|
|
|
<td style='text-align:center;vertical-align: middle;'><?= $row[0]; ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;'><?= $row[1]; ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;'><?= $row[2] ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;'><?= $row[3] ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;'><?= $row[4] ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;'><?= $row[7] . "<br>" . $row[8]; ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;'><?= $row[5] . "<br>" . $row[6]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;'><?= $row[9]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;'><?= $row[10]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;'><?= $row[11]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;'><?= $row[12]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;'><?= $row[13]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;'><?= $row[14]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;'><?= $row[15]; ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;' class="contract"><?= $row[0]; ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;' class="contractdate"><?= $row[1]; ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;' class="customerid"><?= $row[2] ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;' class="customername"><?= $row[3] ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;' class="department"><?= $row[4] ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;' class="manager"><?= $row[7] . "<br>" . $row[8]; ?></td> |
|
|
|
<td style='text-align:center;vertical-align: middle;' class="personId"><?= $row[5] . "<br>" . $row[6]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;' class="total_budget"><?= $row[9]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;' class="receivable_budget"><?= $row[10]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;' class="invoice_budget"><?= $row[11]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;' class="un_invoice_budget"><?= $row[12]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;' class="received_budget"><?= $row[13]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;' class="un_received_budget"><?= $row[14]; ?></td> |
|
|
|
<td style='text-align:end;vertical-align: middle;' class="collect_month"><?= $row[15]; ?></td> |
|
|
|
</tr> |
|
|
|
<?php } ?> |
|
|
|
<?php } |
|
|
|
?> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
@ -397,6 +437,21 @@ include "./footer.php"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function searchFront(area) { |
|
|
|
var term = 'search_' + area; |
|
|
|
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() { |
|
|
|
var xhr = new XMLHttpRequest(); |
|
|
|
var url = window.location.origin + "/wms/account-receivable-renovate-excel.php?type=repair&<?= $token_link ?>"; |
|
|
|