AUTO CALCULATION WHILE TEXT CHANGE EVENT

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
skumar
Posts: 5
Joined: 2018-11-14 17:50

AUTO CALCULATION WHILE TEXT CHANGE EVENT

Post by skumar » 2018-11-15 05:19

Hi,

I know only few basics of PHP. Pls advice me on writing code

Pls go through the attached screen shot of my app gini application.

I want to calculate some field values(CGST @ 1.5 %, SGST@ 1.5% on Taxable Amount) automatically; and the calculation should be done during text change event.

I have found before or after insert code to be written on hooks files . But it is not helpful for me. I need calculation to happen during text change event

PLEASE HELP
APPGINI CUST.jpg
APPGINI CUST.jpg (126.73 KiB) Viewed 1691 times
Regards,
SAMPATH
Regards,
SAMPATH

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: AUTO CALCULATION WHILE TEXT CHANGE EVENT

Post by pbottcher » 2018-11-15 16:58

Hi,

you need to do this via Javascript (here in combination with jquery).

You can put the code in the <tablename>-dv.js file in the hooks folder.

You need to so something like:

$j('#taxalbleamount').on('change', function () {
var tax=+($j('#taxalbleamount').val());
$j('#cgst').val(tax*1.5/100);
$j('#sgst').val(tax*1.5/100);
$j('#billtotal').val(tax+tax*1.5/100+tax*1.5/100);

}

You need your identifiere of course, as I cannot see them :-).
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

skumar
Posts: 5
Joined: 2018-11-14 17:50

Re: AUTO CALCULATION WHILE TEXT CHANGE EVENT

Post by skumar » 2018-11-16 17:14

THANKS :D YOU SOLVED MY PROBLEM
regards,
Sampath
Regards,
SAMPATH

Post Reply