added dynamic date to the payout table
This commit is contained in:
parent
8eb07ad94f
commit
1067ee2efd
|
@ -242,8 +242,10 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php
|
||||
foreach ($vendorPayoutData as $x => $val) {
|
||||
$vendorIdCheck = $val['vendor_details'][0]['vendor_id'];
|
||||
if ((empty($vendorIdCheck) == false) && ($vendorIdCheck == $vendorId) && ($val['status'] == "DEPOSITED")) {
|
||||
$payoutId = $val['_id'] ?>
|
||||
$status = ucfirst(strtolower($val['status']));
|
||||
$payoutDate = date("F d, Y", strtotime($val['updatedAt']));
|
||||
$payoutId = $val['_id'];
|
||||
if ((empty($vendorIdCheck) == false) && ($vendorIdCheck == $vendorId) && ($status == "Deposited")) { ?>
|
||||
<tr>
|
||||
<td> <?php echo "₱ " . $val['net_amount'] ?> </td>
|
||||
<?php if (empty($val['bank_information'][0]['bank_name']) == false) {
|
||||
|
@ -260,8 +262,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php } else { ?>
|
||||
<td> N/A </td>
|
||||
<?php } ?>
|
||||
<td> December 08, 2023 </td>
|
||||
<td> <?php echo $val['status'] ?> </td>
|
||||
<td> <?php echo $payoutDate ?> </td>
|
||||
<td> <?php echo $status ?> </td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary showSinglePayoutBtn" data-order-id="<?php echo $payoutId; ?>" data-bs-toggle="modal" data-bs-target="#payoutsModal">View</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#payoutModal">
|
||||
|
@ -658,17 +660,40 @@ if ($_SESSION["userId"] <> "") {
|
|||
var totalFees = response.fees_deduction_adjustment;
|
||||
var netAmount = response.net_amount;
|
||||
var payoutStatus = response.status;
|
||||
payoutStatus = payoutStatus.charAt(0).toUpperCase() + payoutStatus.slice(1).toLowerCase();
|
||||
var bankName = response.bank_information[0].bank_name;
|
||||
var bankNum = response.bank_information[0].bank_account_number;
|
||||
var bankNumEnding = bankNum.slice(-3); // Extract last three characters of bankNum
|
||||
var maskedBankNum = "Ending in " + bankNumEnding; // Create message
|
||||
var bankAccName = response.bank_information[0].bank_account_name;
|
||||
var paymentType = response.transaction_logs[0].Type;
|
||||
// var transDate = response.transaction_logs[0].Transaction + " " + date;
|
||||
// var transGrossAmt = response.transaction_logs[0].Gross + " " + amount;
|
||||
var transFee = response.transaction_logs[0].Fee;
|
||||
// var transNetAmt = response.transaction_logs[0].Net + " " + amount;
|
||||
var transDesc = response.transaction_logs[0].Description;
|
||||
// var paymentType = response.transaction_logs[0].Type;
|
||||
// // var transDate = response.transaction_logs[0].Transaction + " " + date;
|
||||
// // var transGrossAmt = response.transaction_logs[0].Gross + " " + amount;
|
||||
// var transFee = response.transaction_logs[0].Fee;
|
||||
// // var transNetAmt = response.transaction_logs[0].Net + " " + amount;
|
||||
// var transDesc = response.transaction_logs[0].Description;
|
||||
var transactionLogsHtml = ''; // Initialize empty string to store HTML for transaction logs
|
||||
// Inside the success callback function
|
||||
var transactionLogsHtml = ''; // Initialize empty string to store HTML for transaction logs
|
||||
response.transaction_logs.forEach(function(log) {
|
||||
var paymentType = log.Type; // Assuming Transaction field holds the date
|
||||
var grossAmount = log.Gross; // Assuming Gross field holds the gross amount
|
||||
var transFee = log.Fee;
|
||||
var netAmount = log.Net;
|
||||
var transDesc = log.Description;
|
||||
|
||||
// Append HTML for current transaction log to the transactionLogsHtml string
|
||||
transactionLogsHtml += `
|
||||
<tr>
|
||||
<td>${paymentType}</td>
|
||||
<td>December 08, 2024</td>
|
||||
<td>₱ Wala muna</td>
|
||||
<td>- ₱ ${transFee}</td>
|
||||
<td>₱ Wala Muna</td>
|
||||
<td>${transDesc}</td>
|
||||
</tr>`;
|
||||
});
|
||||
|
||||
|
||||
// Populate data dynamically using the response
|
||||
var payoutDetailsHtml = `
|
||||
|
@ -735,12 +760,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<td> ${paymentType} </td>
|
||||
<td> December 08, 2024 </td>
|
||||
<td> ₱ 350</td>
|
||||
<td> - ₱ ${transFee}</td>
|
||||
<td> ₱ 300</td>
|
||||
<td> ${transDesc} </td>
|
||||
${transactionLogsHtml} <!-- Insert transaction logs HTML here -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue