sanity check input value
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Jul 2006 17:55:10 +0000 (17:55 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Jul 2006 17:55:10 +0000 (17:55 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5067 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/bill_wizard.xul

index ac239ce..1b4f268 100644 (file)
                                                        [ ses(), grocery ]
                                                );
                                }
-                               if (xact_id) {
+                               if (typeof xact_id.ilsevent == 'undefined') {
+                                       JSAN.use('util.money');
                                        var billing = new mb();
                                                billing.isnew('1');
                                                billing.note( $('bill_note').value );
                                                billing.xact( xact_id );
-                                               billing.amount( $('bill_amount').value );
+                                               billing.amount( util.money.sanitize( $('bill_amount').value ) );
                                                billing.billing_type( $('billing_type').value );
                                        var mb_id = g.network.request(
                                                api.FM_MB_CREATE.app,
                                                api.FM_MB_CREATE.method,
                                                [ ses(), billing ]
                                        );
-                                       if (mb_id) {
-                                       } else {
-                                               throw('mb_id = ' + mb_id);
-                                       }
+                                       if (typeof mb_id.ilsevent != 'undefined') throw(mb_id);
                                } else {
-                                       throw('xact_id = ' + xact_id);
+                                       throw(xact_id);
                                }
                        } catch(E) {
-                               g.error.sdump('D_ERROR',js2JSON(E));
-                               alert(js2JSON(E));
+                               g.error.standard_unexpected_error_alert('bill_wizard',E);
                        }
                }