CHANGE_PDF : AADHAVAN
This commit is contained in:
parent
c78945fee6
commit
8f0c40e091
@ -122,6 +122,7 @@ class Purchase extends BaseController
|
||||
->where('products.isactive',1)
|
||||
->findAll();
|
||||
$data['productAll']= json_encode($productAll);
|
||||
$data['purchase_order_id']= $purchase_order_id;
|
||||
echo view('purchase_form',$data);
|
||||
}
|
||||
|
||||
|
||||
@ -302,7 +302,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_bikeModel.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -93,7 +93,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_make.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -221,7 +221,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_complaint.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -42,6 +42,8 @@
|
||||
.term_condition {border-collapse: collapse;width: 100%;}
|
||||
.term_condition td {border: 0.5px solid black;padding: 8px;text-align: center;}
|
||||
</style>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<h3 style="text-align:center;text-decoration: underline;">Tax Invoice</h3>
|
||||
@ -197,8 +199,8 @@
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td colspan="7" style="border-top: 0.5px solid black;border-left: 0.5px solid black;"></td>
|
||||
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Total Taxable Value</td>
|
||||
<td style="border: 0.5px solid black;"><?= $sales[0]->tax ?></td>
|
||||
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Subtotal</td>
|
||||
<td style="border: 0.5px solid black;"><?= $sales[0]->subtotal ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7" style="border-left: 0.5px solid black;"></td>
|
||||
@ -213,10 +215,10 @@
|
||||
<tr>
|
||||
<td colspan="7" style="border-left: 0.5px solid black;"></td>
|
||||
<td colspan="3" style="text-align:center;border: 0.5px solid black;">Total</td>
|
||||
<td style="border: 0.5px solid black;"><?= $sales[0]->total ?></td>
|
||||
<td style="border: 0.5px solid black;" id="total_amount"><?= $sales[0]->total ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11" style="border: 0.5px solid black;">Amount Chargeable (in words)</td>
|
||||
<td colspan="11" style="border: 0.5px solid black;">Amount Chargeable (in words) <p id="amountInWords" style="float: right;"></p></td>
|
||||
</tr>
|
||||
|
||||
<tr><td></td></tr>
|
||||
@ -227,5 +229,70 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
function numberToWords(number) {
|
||||
var words = {
|
||||
'0': 'zero', '1': 'one', '2': 'two', '3': 'three', '4': 'four',
|
||||
'5': 'five', '6': 'six', '7': 'seven', '8': 'eight', '9': 'nine',
|
||||
'10': 'ten', '11': 'eleven', '12': 'twelve', '13': 'thirteen',
|
||||
'14': 'fourteen', '15': 'fifteen', '16': 'sixteen', '17': 'seventeen',
|
||||
'18': 'eighteen', '19': 'nineteen', '20': 'twenty', '30': 'thirty',
|
||||
'40': 'forty', '50': 'fifty', '60': 'sixty', '70': 'seventy',
|
||||
'80': 'eighty', '90': 'ninety'
|
||||
};
|
||||
|
||||
var units = ['', 'thousand', 'million', 'billion', 'trillion', 'quadrillion'];
|
||||
|
||||
// Function to convert a number less than 1000 to words
|
||||
function convertLessThan1000(num) {
|
||||
if (num === 0) {
|
||||
return '';
|
||||
} else if (num < 20) {
|
||||
return words[num] + ' ';
|
||||
} else if (num < 100) {
|
||||
return words[Math.floor(num / 10) * 10] + ' ' + convertLessThan1000(num % 10);
|
||||
} else {
|
||||
return words[Math.floor(num / 100)] + ' hundred ' + convertLessThan1000(num % 100);
|
||||
}
|
||||
}
|
||||
|
||||
// Function to convert a number to words
|
||||
function convert(num) {
|
||||
if (num === 0) {
|
||||
return 'zero';
|
||||
}
|
||||
|
||||
var result = '';
|
||||
var i = 0;
|
||||
|
||||
while (num > 0) {
|
||||
if (num % 1000 !== 0) {
|
||||
result = convertLessThan1000(num % 1000) + units[i] + ' ' + result;
|
||||
}
|
||||
num = Math.floor(num / 1000);
|
||||
i++;
|
||||
}
|
||||
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
// Convert the number to words
|
||||
return convert(number);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// Calculate amount and update amount in words
|
||||
console.log($('#total_amount').html());
|
||||
// Call numberToWords function to get amount in words
|
||||
var amountInWords = numberToWords($('#total_amount').html());
|
||||
|
||||
// Update the span with the amount in words
|
||||
$('#amountInWords').html(amountInWords);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -151,7 +151,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_jobcard.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -328,7 +328,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_make.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -186,7 +186,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_manufacturer.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -235,7 +235,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_outsource.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
data_table_set.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -274,9 +274,12 @@ $(document).ready(function() {
|
||||
|
||||
// Event listener for vendor selection change
|
||||
$('.vendor-select').change(function() {
|
||||
var purchase_order_id = <?php echo $purchase_order_id; ?>;
|
||||
var vendorId = $(this).val();
|
||||
fetchVendorProducts(vendorId);
|
||||
if(purchase_order_id == 0){
|
||||
$('tbody').empty();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_purchase_order.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -156,9 +156,7 @@
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!isset($purchase['status']) || $purchase['status'] !== 'Received') : ?>
|
||||
<button type="submit" id="editaddbutton"class="btn btn-primary">Submit</button>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -129,7 +129,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_return_list.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_service.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_user.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_vehicle.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
}
|
||||
// Move DataTable to the saved page and draw
|
||||
datatable_vendor.page(savedPage).draw(false);
|
||||
$('.'+hightlight_tr).css('background','lightpink');
|
||||
$('.'+hightlight_tr).css('background','#faf6ca');
|
||||
$('html, body').animate({
|
||||
scrollTop: $('.'+hightlight_tr).offset().top
|
||||
}, 2000);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user