]> git.evergreen-ils.org Git - working/Evergreen.git/commit
Fix LP800480, ACQ - Vendor Invoice Won't Save
authorSteven Chan <schan@sitka.bclibraries.ca>
Wed, 18 Jul 2012 18:22:14 +0000 (11:22 -0700)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 24 Jul 2012 17:52:44 +0000 (13:52 -0400)
commit9332a68d06cb6caa0af3f560d5acfaaf6b716be7
treef558b01bcb00b59095b6cd41f822b68d2bdeb3db
parent4e6f44ab34f1c53c7d462d6077f1073bd3ab40d1
Fix LP800480, ACQ - Vendor Invoice Won't Save

1. Upon submitting the form, the client prepares two auxiliary data
objects containing service charges and line items. The two objects are
normally 'fleshed', ie, contain references to other data objects, but in
the versions sent to the server, they must be 'unfleshed', ie, the
referent objects are converted back to ID values. If the user resubmits
the form, the client should not unflesh again. However, the software for
preparing line items contain lines of code that unfleshes without
checking if the objects are already unflesh. When unfleshing a second
time, we get an uncaught reference error. Ironically, the software also
contains lines of code to do it correctly, so the errant lines of code
are also duplicates.

To fix problem 1, we remove the duplicate errant lines of code. We
define a helper unflesh() method and use it to replace the current lines
of code to unflesh.

2. When the user submits the form without filling in required data
fields in the invoice, including Vendor Invoice ID, the client does not
validate before making a service request. The server tries to complete
the database transaction, but gets an error.  When the response comes
back, the client shows the same form so that the user can retry.
However, the message alert to the user is not informative; it indicates
an error at the database level, but does not indicate the probable
reason.

To fix problem 2, We move the lines of code preparing the invoice object
earlier in the sequence.  We define a helper method mapValues() to
prepare the invoice object from the values in the UI widget object.
mapValues() will return an error object if it detects that required
values are null. We check for the error object, and will show an alert
message to the user and abort the submit operation early, allowing the
user to retry.

3. When an invoice with line items is saved, the invoice is re-rendered
with new buttons to allow receiving. It also contains a new button to
enable the user to view the line items in list format. However, it does
not work in a non-Firefox browser, because a debug statement using the
'dump()' function is left uncommented. (Inspection of all other
appearances of dump() show they are all commented out.) There is an
uncaught reference because dump() is not found.

Signed-off-by: James Fournie <jfournie@sitka.bclibraries.ca>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/web/js/dojo/openils/widget/EditPane.js
Open-ILS/web/js/ui/default/acq/invoice/receive.js
Open-ILS/web/js/ui/default/acq/invoice/view.js