diff --git a/wms/account-receivable-check.php b/wms/account-receivable-check.php index 727c015d..32b0aa04 100644 --- a/wms/account-receivable-check.php +++ b/wms/account-receivable-check.php @@ -2,33 +2,35 @@ include "./header.php"; $Bill = $_POST['Bill']; $Bill = json_decode($Bill, true); -$sql_received = "SELECT * from account_received where BillNo = '$Bill[0]' ORDER BY `pay_id` ASC"; -$pay_received = mysqli_query($link, $sql_received); -$had_received_amount = intval(0); -$had_invoice_amount=intval(0); -$status_summary = intval(0); -if (mysqli_num_rows($pay_received) > 0) { - foreach ($pay_received as $received) { - $had_received_amount += intval($received['received_amount']); - $had_invoice_amount += intval($received['invoice_amount']); - if(in_array(intval($received['status']),array(0,4,5,99))){ - $tem_status = intval(0); - }else{ - $tem_status = intval($received['status']); - } - if($status_summary < $tem_status){ - $status_summary = $tem_status; - } - } -} - -$unreceived_amount = intval($Bill[12]) - intval($had_received_amount); -$uninvoice_amount = intval($Bill[12]) - intval($had_invoice_amount); -$Bill[19] =$had_invoice_amount; -$Bill[20] =$had_received_amount; -$Bill[21] =$uninvoice_amount; -$Bill[22] =$unreceived_amount; -$Bill[23] =$status_summary; +print_r($Bill); + +// $sql_received = "SELECT * from account_received where BillNo = '$Bill[0]' ORDER BY `pay_id` ASC"; +// $pay_received = mysqli_query($link, $sql_received); +// $had_received_amount = intval(0); +// $had_invoice_amount=intval(0); +// $status_summary = intval(0); +// if (mysqli_num_rows($pay_received) > 0) { +// foreach ($pay_received as $received) { +// $had_received_amount += intval($received['received_amount']); +// $had_invoice_amount += intval($received['invoice_amount']); +// if(in_array(intval($received['status']),array(0,4,5,99))){ +// $tem_status = intval(0); +// }else{ +// $tem_status = intval($received['status']); +// } +// if($status_summary < $tem_status){ +// $status_summary = $tem_status; +// } +// } +// } + +// $unreceived_amount = intval($Bill[12]) - intval($had_received_amount); +// $uninvoice_amount = intval($Bill[12]) - intval($had_invoice_amount); +// $Bill[19] =$had_invoice_amount; +// $Bill[20] =$had_received_amount; +// $Bill[21] =$uninvoice_amount; +// $Bill[22] =$unreceived_amount; +// $Bill[23] =$status_summary; $data = json_encode($Bill); ?> + +
安裝款 | 試車款 | 官檢款 | -交車款 | --> +交車款 | +尾款 | -->目前應收 | -未開發票金額 | -未收金額 | +作番狀態 | -收款狀態 | +操作 | $value) { ?>|||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
= $contract[0] ?> | -= $contract[1] ?> | -= $contract[2] ?> | -= $contract[3] ?> | -= $contract[4] ?> | - -= number_format(round($contract[12])) ?> | -= number_format(round($contract[21])) ?> | -= number_format(round($contract[22])) ?> | -= $contract[13] ?> | -催收"; - } else { - echo "法務件"; - } - ?> | -+ | = $key ?> | += $value[1] ?> | += $value[2] ?> | += $value[4] ?> | += $value[5] ?> | + += number_format(round($value['receivable_budget'])) ?> | + += $value['facilities'] ?> | +