this.claim = function(lid_ids) {
progressDialog.show(true);
- var win = null;
fieldmapper.standardRequest(
- ["open-ils.acq", "open-ils.acq.claim.lineitem_detail"], {
+ ["open-ils.acq", "open-ils.acq.claim.lineitem_detail.atomic"], {
"params": [
openils.User.authtoken, lid_ids, null,
this.claimType.attr("value"),
"async": true,
"onresponse": function(r) {
if (r = openils.Util.readResponse(r)) {
- if (!win)
- win = openClaimVoucherWindow();
- dojo.byId("main", win.document).innerHTML +=
- (r.template_output().data() + "<hr />");
- }
- else {
- progressDialog.hide();
+ if (r.length) {
+ openils.Util.printHtmlString(
+ r.map(
+ function(o) {
+ return o.template_output().data();
+ }
+ ).join("<hr />")
+ );
+ }
}
- },
- "oncomplete": function() {
progressDialog.hide();
- dojo.byId("print", win.document).innerHTML =
- localeStrings.PRINT;
- dojo.byId("print", win.document).disabled = false;
self.claimCallback(self.workingLi);
}
}
};
this.reconsiderClaimControl = function(li, row) {
+ if (!row) row = this._findLiRow(li);
var option = nodeByName("action_manage_claims", row);
var eligible = this.claimEligibleLidByLi[li.id()].length;
var count = this._liCountClaims(li);
- if (!row) row = this._findLiRow(li);
option.disabled = !(count || eligible);
option.innerHTML =
};
this.checkClaimEligibility = function(li, callback, row) {
+ /* Assume always eligible, i.e. from this interface we don't care about
+ * claim eligibility any more. this is where the user would force a
+ * claime. */
+ this.clearEligibility(li);
+ this.claimEligibleLidByLi[li.id()] = li.lineitem_details().map(
+ function(lid) { return lid.id(); }
+ );
+ li.lineitem_details().forEach(
+ function(lid) { self.claimEligibleLid[lid.id()] = true; }
+ );
+ this.reconsiderClaimControl(li, row);
+ if (callback) callback();
+ /*
this.clearEligibility(li);
fieldmapper.standardRequest(
["open-ils.acq", "open-ils.acq.claim.eligible.lineitem_detail"], {
}
}
);
+ */
};
this.updateLiNotesCount = function(li, row) {