function updateTotalCost() {
var totalCost = 0;
- if(!totalInvoicedBox) {
- totalInvoicedBox = new dijit.form.CurrencyTextBox(
- {style : 'width: 6em'}, dojo.byId('acq-invoice-total-invoiced'));
- }
for(var id in widgetRegistry.acqii)
if(!widgetRegistry.acqii[id]._object.isdeleted())
totalCost += widgetRegistry.acqii[id].cost_billed.getFormattedValue();
totalInvoicedBox.attr('value', totalCost);
totalPaid = 0;
- if(!totalPaidBox) {
- totalPaidBox = new dijit.form.CurrencyTextBox(
- {style : 'width: 6em'}, dojo.byId('acq-invoice-total-paid'));
- }
for(var id in widgetRegistry.acqii)
if(!widgetRegistry.acqii[id]._object.isdeleted())
totalPaid += widgetRegistry.acqii[id].amount_paid.getFormattedValue();
}
}
- if(!balanceOwedBox) {
- balanceOwedBox = new dijit.form.CurrencyTextBox(
- {style : 'width: 6em'}, dojo.byId('acq-invoice-balance-owed'));
- }
balanceOwedBox.attr('value', (totalCost - totalPaid));
}
<button jsId='invoiceProrateButton'
dojoType='dijit.form.Button' onclick='saveChanges(true);'>Save & Prorate Charges</button>
</td>
- <td><div id='acq-invoice-total-invoiced'/></td>
- <td><div id='acq-invoice-total-paid'/></td>
- <td><div id='acq-invoice-balance-owed'/></td>
+ <td><div jsId='totalInvoicedBox' dojoType='dijit.form.CurrencyTextBox' style='width:6em;'/></td>
+ <td><div jsId='totalPaidBox' dojoType='dijit.form.CurrencyTextBox' style='width:6em;'/></td>
+ <td><div jsId='balanceOwedBox' dojoType='dijit.form.CurrencyTextBox' style='width:6em;'/></td>
</tr>
</tbody>
</table>