Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
4817da49ef
@ -2687,6 +2687,10 @@ class PolicyTransactionController extends BaseController
|
|||||||
$gst = $gstTotal[$index];
|
$gst = $gstTotal[$index];
|
||||||
$paymentDate = $paymentDates[$index];
|
$paymentDate = $paymentDates[$index];
|
||||||
|
|
||||||
|
if($utrNo == "" && $tds == "" && $gst == "" && $receivedAmount == "")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Prepare data for insert/update
|
// Prepare data for insert/update
|
||||||
$childData = [
|
$childData = [
|
||||||
'inv_amt' => $receivedAmount,
|
'inv_amt' => $receivedAmount,
|
||||||
|
|||||||
@ -959,6 +959,23 @@
|
|||||||
return parts[2] + '/' + parts[1] + '/' + parts[0]; // Rearrange to DD-MM-YYYY
|
return parts[2] + '/' + parts[1] + '/' + parts[0]; // Rearrange to DD-MM-YYYY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function togglePaymentCardRequired(flag) {
|
||||||
|
// Select the default payment card container
|
||||||
|
const card = document.getElementById("default_payment_card");
|
||||||
|
if (!card) return;
|
||||||
|
|
||||||
|
// Select all input elements inside the card
|
||||||
|
const inputs = card.querySelectorAll("input");
|
||||||
|
|
||||||
|
inputs.forEach(input => {
|
||||||
|
if (flag) {
|
||||||
|
input.setAttribute("required", "required");
|
||||||
|
} else {
|
||||||
|
input.removeAttribute("required");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function showInvoiceStatusModal(event) {
|
function showInvoiceStatusModal(event) {
|
||||||
console.log('############ showInvoiceStatusModal function called ##################');
|
console.log('############ showInvoiceStatusModal function called ##################');
|
||||||
var modal_received_amt_div = document.getElementById('modal_received_amt_div');
|
var modal_received_amt_div = document.getElementById('modal_received_amt_div');
|
||||||
@ -1102,6 +1119,7 @@
|
|||||||
// Clear existing payment cards in the container
|
// Clear existing payment cards in the container
|
||||||
var defaultPaymentCardContainer = document.getElementById('default_payment_card');
|
var defaultPaymentCardContainer = document.getElementById('default_payment_card');
|
||||||
defaultPaymentCardContainer.style.display = 'block';
|
defaultPaymentCardContainer.style.display = 'block';
|
||||||
|
togglePaymentCardRequired(true);
|
||||||
var paymentCardContainer = document.getElementById('payment_card_container');
|
var paymentCardContainer = document.getElementById('payment_card_container');
|
||||||
paymentCardContainer.innerHTML = '';
|
paymentCardContainer.innerHTML = '';
|
||||||
|
|
||||||
@ -1110,6 +1128,10 @@
|
|||||||
// Populate payment cards
|
// Populate payment cards
|
||||||
if (response.data.payments.length) {
|
if (response.data.payments.length) {
|
||||||
defaultPaymentCardContainer.style.display = 'none';
|
defaultPaymentCardContainer.style.display = 'none';
|
||||||
|
togglePaymentCardRequired(false);
|
||||||
|
// if (defaultPaymentCardContainer) {
|
||||||
|
// defaultPaymentCardContainer.remove();
|
||||||
|
// }
|
||||||
response.data.payments.forEach(function(payment, index) {
|
response.data.payments.forEach(function(payment, index) {
|
||||||
var paymentCard = document.createElement('div');
|
var paymentCard = document.createElement('div');
|
||||||
paymentCard.className = 'payment-card';
|
paymentCard.className = 'payment-card';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user