dojo.query('[attr=title]', row)[0].onclick = function() {self.drawInfo(li.id())};
dojo.query('[name=copieslink]', row)[0].onclick = function() {self.drawCopies(li.id())};
- dojo.query('[name=count]', row)[0].innerHTML = li.item_count();
+ dojo.query('[name=count]', row)[0].innerHTML = li.item_count() || 0;
dojo.query('[name=notes_count]', row)[0].innerHTML = li.lineitem_notes().length;
dojo.query('[name=noteslink]', row)[0].onclick = function() {self.drawLiNotes(li)};
- var priceInput = dojo.query('[name=estimated_price]', row)[0];
+ var priceInput = dojo.query('[name=price]', row)[0];
var priceData = liWrapper.getPrice();
priceInput.value = (priceData) ? priceData.price : '';
priceInput.onchange = function() { self.updateLiPrice(priceInput, li) };
+ var recv_link = dojo.query('[name=receive_link]', row)[0];
+ if(li.state() == 'received') {
+ openils.Util.hide(recv_link)
+ } else {
+ recv_link.onclick = function() {
+ self.receiveLi(li);
+ openils.Util.hide(recv_link)
+ }
+ }
+
self.tbody.appendChild(row);
self.selectors.push(dojo.query('[name=selectbox]', row)[0]);
};
}
);
+ var recv_link = dojo.query('[name=receive]', row)[0];
+ if(copy.recv_time()) {
+ openils.Util.hide(recv_link);
+ } else {
+ recv_link.onclick = function() {
+ self.receiveLid(copy);
+ openils.Util.hide(recv_link);
+ }
+ }
+
if(this.isPO) {
openils.Util.hide(dojo.query('[name=delete]', row)[0].parentNode);
} else {
);
}
+ this.receiveLi = function(li) {
+ if(!this.isPO) return;
+ progressDialogInd.show();
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem.receive'],
+ { async: true,
+ params: [this.authtoken, li.id()],
+ onresponse : function(r) {
+ var resp = openils.Util.readResponse(r);
+ progressDialogInd.hide();
+ },
+ }
+ );
+ }
+
+ this.receiveLid = function(li) {
+ if(!this.isPO) return;
+ progressDialogInd.show();
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.lineitem_detail.receive'],
+ { async: true,
+ params: [this.authtoken, li.id()],
+ onresponse : function(r) {
+ var resp = openils.Util.readResponse(r);
+ progressDialogInd.hide();
+ },
+ }
+ );
+ }
+
this.rollbackPoReceive = function() {
if(!this.isPO) return;
if(!confirm(localeStrings.ROLLBACK_PO_RECEIVE_CONFIRM)) return;
<tr>
<td><span><a id='acq-lit-select-toggle' href='javascript:void(0);'>✓</a></span></td>
<td>Line Items</td>
- <td>Estimated Price</td>
+ <td></td>
+ <td>Price</td>
<td>Items</td>
<td>Notes</td>
</tr>
<tbody id='acq-lit-tbody'>
<tr id='acq-lit-row' class='acq-lit-row'>
<td name='selector'><input type='checkbox' name='selectbox'/></td>
- <td style='width:100%;'>
+ <td style='width:75%;'>
<table style='width:100%;'>
<tbody>
<tr>
<span attr='edition'></span>
<span attr='pubdate'></span>
<span attr='publisher'></span>
- <span name='source_label'/>
+ <span name='source_label'></span>
</td>
</tr>
</tbody>
</table>
</td>
- <td>
- <input type='text' size='8' name='estimated_price'/>
- </td>
- <td>
- <a name='copieslink' href='javascript:void(0);'>Copies(<span name='count'>0</span>)</a>
- </td>
+ <td><a name='receive_link' href='javascript:void(0);'>Mark Received</a></td>
+ <td><input type='text' size='8' name='price'/></td>
+ <td><a name='copieslink' href='javascript:void(0);'>Copies(<span name='count'>0</span>)</a></td>
<td>
<a name='noteslink' href='javascript:void(0);'
style='margin-right:15px;'>Notes(<span name='notes_count'>0</span>)</a>
<td>Callnumber</td>
<td>Barcode</td>
<td>Notes</td>
- <td/>
+ <td colspan='0'>
</tr>
</tbody>
<tbody id='acq-lit-li-details-tbody' class='oils-generic-table'>
<td><div name='cn_label'/></td>
<td><div name='barcode'/></td>
<td><div name='note'/></td>
+ <td><a href='javascript:void(0);' name='receive'>Mark Received</a></td>
<td><div name='delete' dojoType='dijit.form.Button' style='color:red;'>X</div></td>
</tr>
</tbody>