Hi Anand,
thank you very much again.
But the case where ref_rate is > 0 is hardly reachable in sales_common on line 754 to 765.
Would'nt it make more sense to change to this like i tried in my custom script:
} else if(consider_incl_rate) {
if((flt(cl[i].ref_rate) > 0) && (flt(cl[i].adj_rate) > 0)) {
var export_rate = flt(cl[i].ref_rate) * flt(1 - flt(cl[i].adj_rate / 100));
set_multiple(tname, cl[i].name, { 'export_rate': flt(export_rate) }, fname);
}
else if(flt(cl[i].export_rate) > 0) {
// calculate basic rate based on taxes
// then calculate and set basic_rate, base_ref_rate, ref_rate, amount, export_amount
var ref_rate = flt(cl[i].adj_rate)!=flt(100) ?
flt((100 * flt(cl[i].export_rate))/flt(100 - flt(cl[i].adj_rate))) :
flt(0)
set_multiple(tname, cl[i].name, { 'ref_rate': ref_rate }, fname);
}
If one uses Price lists always both fields are filled but if i enter manually i could respekt to first add add adj_rate and then the Export rate to calculate the empty ref_rate.
Those are already observing the table.
Do you have a better Idea to serve booth Needs, of clients using Price_list and those who enter manually?