Denomination (currency), problem with Legacy App

7 views
Skip to first unread message

Dean D. Babic

unread,
Feb 2, 2026, 3:13:59 AM (6 days ago) Feb 2
to Jam.py Users Mailing List
Hi all, 

the legacy app is writing currency and quantity  values like this:
value_num, value_denom
4500         ,100

the result is $45.00 on legacy Forms/Reports etc

This is a problem for Calculation! For example, on Demo, 
if all Tracks quantity were like above, the calculated Total,
would be 100 times bigger. 

This exact problem is visible here:
Screenshot from 2026-02-02 15-45-08.png
  
The above -$703.27 is calculated by on_field_get_summary,
with format((value/100)

However, the -$70327.00 is Calculated total by SUM - Server side on Builder for the field! It is 100x bigger. 
Hence, we need to use on_field_get_html and on_field_get_summary 
on Master and Detail!
This is the result:
Screenshot from 2026-02-02 16-12-27.png

Enjoy

D.

Dean D. Babic

unread,
Feb 2, 2026, 8:10:14 AM (6 days ago) Feb 2
to Jam.py Users Mailing List
The above:
value_num, value_denom
4500         ,100

has issues with Dashboards as well!
For example, a Salary and everything else is 100x bigger!
It is not 4.4 millions, but 44k!

Screenshot from 2026-02-02 21-05-07.png
So we need to denominate values by 100 in both, the Graph and table:
function on_view_form_created(item) {
show_acc(item, item.view_form.find('#acc-canvas').get(0).getContext('2d'));
}

function show_acc(item, ctx) {
var acc = item.task.splits.copy({handlers: false});

acc.open(
{
fields: ['accountGuid', 'valueNum'],
funcs: { valueNum: 'sum' },
group_by: ['accountGuid'],
order_by: ['-accountGuid'],
limit: 15
},
function () {

acc.each(function (r) {
if (r.valueNum.value !== null) {
r.valueNum.value = r.valueNum.value / 100;
}
});

var labels = [],
data = [],
colors = [];

acc.each(function (i) {
labels.push(i.accountGuid.display_text);
data.push(i.valueNum.value.toFixed(2));
colors.push(lighten('#006bb3', (i.rec_no - 1) / 15));
});

acc.first();
acc.accountGuid.field_caption = 'Splits';
acc.valueNum.field_caption = 'Total';
draw_chart(item, ctx, labels, data, colors, 'Accounts');

acc.create_table(
item.view_form.find('#acc-table'),
{ row_count: 15, dblclick_edit: false }
);
}
);

return acc;
}
Reply all
Reply to author
Forward
0 new messages