Hi guys.
Hope you are all doing well. Please I need some help
I have a table with these fields:
- Description
- Purchase price
- Tax (in percentage %)
- Sells price
I want to make this calculation
- Purchase price + tax = sells price
Example:
- Purchase price = 4000
- Tax = 3%
- Sells price = 4120
Thank you
Tax calculation
Re: Tax calculation
Hello Moh Youba,
Do you want to make the sells price auto filled with equation's value?
Do you want to make the sells price auto filled with equation's value?
Re: Tax calculation
Hello Tammam
Thank you for your reply. Yes it is what I want
Thank you
Thank you for your reply. Yes it is what I want
Thank you
Re: Tax calculation
Hello guys
Any idea for my problem !!!
Thank you
Any idea for my problem !!!
Thank you
Re: Tax calculation
Hi there. Thanks to all for assistance. I am sharing here with you the solution I found by following Appgini course. The solution was really easy than I though, here what I do.
I just create a file "credits-dv.js" on hooks folder and add these code
"
function show_error(field, msg){
modal_window({
message: '<div class="alert alert-danger">' + msg + '</div>',
title: 'Error in ' + field,
close: function(){
$j('#' + field).focus();
$j('#' + field).parents('.form-group').addClass('has-error');
}
});
return false;
}
$j(function(){
$j('#update, #insert').click(function(){
/* Make sure Taux is valid */
var taux = $j('#taux').val();
if(isNaN(taux) || taux < 0 || taux > 100){
return show_error('taux', 'Le taux doit etre entre 0 et 100.');
}
});
/* Set montant a payer to read-only */
$j('#montant_a_payer').prop('readonly', true);
/* calculer le total */
$j('#montant_credit, #taux').change(function(){
var montantCredit = parseFloat($j('#montant_credit').val()) || 0;
var taux = parseFloat($j('#taux').val()) || 0;
var montantPayer = montantCredit * taux / 100 + montantCredit;
$j('#montant_a_payer').val(montantPayer);
});
})
"
Thank to all
I just create a file "credits-dv.js" on hooks folder and add these code
"
function show_error(field, msg){
modal_window({
message: '<div class="alert alert-danger">' + msg + '</div>',
title: 'Error in ' + field,
close: function(){
$j('#' + field).focus();
$j('#' + field).parents('.form-group').addClass('has-error');
}
});
return false;
}
$j(function(){
$j('#update, #insert').click(function(){
/* Make sure Taux is valid */
var taux = $j('#taux').val();
if(isNaN(taux) || taux < 0 || taux > 100){
return show_error('taux', 'Le taux doit etre entre 0 et 100.');
}
});
/* Set montant a payer to read-only */
$j('#montant_a_payer').prop('readonly', true);
/* calculer le total */
$j('#montant_credit, #taux').change(function(){
var montantCredit = parseFloat($j('#montant_credit').val()) || 0;
var taux = parseFloat($j('#taux').val()) || 0;
var montantPayer = montantCredit * taux / 100 + montantCredit;
$j('#montant_a_payer').val(montantPayer);
});
})
"
Thank to all
Re: Tax calculation
Hello Moh Youba,
Sorry for the late reply , and i happy that you could solve your problem easily , good luck
Sorry for the late reply , and i happy that you could solve your problem easily , good luck