allow deletion of incomplete invoice LIs
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Jan 2011 23:18:21 +0000 (23:18 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 11 Jan 2011 23:18:21 +0000 (23:18 +0000)
Fix silent failure when attempting to delete a LI
whose type or cost was not set; dojo.string.subtitute
does not like replacement values to be null.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19160 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/invoice/view.js

index 281189f..38465b9 100644 (file)
@@ -385,8 +385,8 @@ function addInvoiceItem(item) {
         var cost = widgetRegistry.acqii[item.id()].cost_billed.getFormattedValue();
         var msg = dojo.string.substitute(
             localeStrings.INVOICE_CONFIRM_ITEM_DELETE, [
-                cost,
-                widgetRegistry.acqii[item.id()].inv_item_type.getFormattedValue()
+                cost || 0,
+                widgetRegistry.acqii[item.id()].inv_item_type.getFormattedValue() || ''
             ]
         );
         if(!confirm(msg)) return;