- result = number_format(result, 2, '[% myconfig.numberformat %]');
- window.opener.document.getElementsByName(document.Form.input_name.value)[0].value = result;
- self.close();
+ result = number_format(result, 2, '[% MYCONFIG.numberformat %]');
+ if (document.CalcQtyForm.input_id.value) {
+ document.getElementById(document.CalcQtyForm.input_id.value).value = result;
+ } else {
+ document.getElementsByName(document.CalcQtyForm.input_name.value)[0].value = result;
+ }
+ $('#calc_qty_dialog').dialog('close');