__PACKAGE__->register_method(
method => 'receive_lineitem_batch_api',
api_name => 'open-ils.acq.lineitem.receive.batch',
+ stream => 1,
signature => {
desc => 'Mark lineitems as received',
params => [
__PACKAGE__->register_method(
method => 'rollback_receive_lineitem_batch_api',
api_name => 'open-ils.acq.lineitem.receive.rollback.batch',
+ stream => 1,
signature => {
desc => 'Mark a list of lineitems as Un-received',
params => [
"CREATE_PO_INVALID": "A purchase order must have an ordering agency and a provider.",
"INVOICE_COPY_COUNT_INFO": "Copies received on this invoice: ${0} out of ${1}.",
"INVOICE_IDENT_COLLIDE": "There is already an invoice in the system with the given combination of 'Vendor Invoice ID' and 'Provider,' which is not allowed.",
- "NEW_INVOICE": "New Invoice"
+ "NEW_INVOICE": "New Invoice",
+ "NO_LI_GENERAL" : "You have not selected any line items.",
}
this.receiveSelectedLineitems = function() {
var li_list = this.getSelected();
+ if (!li_list.length) {
+ alert(localeStrings.NO_LI_GENERAL);
+ return;
+ }
+
for (var i = 0; i < li_list.length; i++) {
var li = li_list[i];
};
this.rollbackReceiveLineitems = function() {
+ var li_id_list = this.getSelected(false, null, true);
+ if (!li_id_list.length) {
+ alert(localeStrings.NO_LI_GENERAL);
+ return;
+ }
+
if (!confirm(localeStrings.ROLLBACK_LI_RECEIVE_CONFIRM)) return;
this.show('acq-lit-progress-numbers');
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.lineitem.receive.rollback.batch'],
{ async: true,
- params: [this.authtoken, this.getSelected(false, null, true)],
+ params: [this.authtoken, li_id_list],
onresponse : function(r) {
var resp = openils.Util.readResponse(r);
self._updateProgressNumbers(resp, true);