};
this.updatePoNotesCount = function() {
- dojo.byId("acq-po-view-notes").innerHTML = PO.notes().length;
+ dojo.byId("acq-po-view-notes").innerHTML =
+ "(" + PO.notes().length + ")";
};
this.updatePoNotes = function(newNote) {
if (!invoiceLinkDialogManager)
invoiceLinkDialogManager = new InvoiceLinkDialogManager("po", PO);
- openils.Util.show("acq-po-view-invoices", "table-row");
+ openils.Util.show("acq-po-invoice-stuff", "table-cell");
}
function renderPo() {
dojo.byId("acq-po-view-cancel-reason"),
dojo.byId("acq-po-cancel-label")
);
- dojo.byId("acq-po-view-notes").innerHTML = PO.notes().length;
+ // dojo.byId("acq-po-view-notes").innerHTML = PO.notes().length;
+ poNoteTable.updatePoNotesCount();
- if(PO.state() == "pending") {
- openils.Util.show("acq-po-activate", "table-row");
+ if (PO.state() == "pending") {
checkCouldActivatePo();
if (PO.lineitem_count() > 1)
openils.Util.show("acq-po-split");
+ } else {
+ dojo.byId("acq-po-activate-checking").innerHTML = localeStrings.NO;
}
// XXX we probably don't *always* need to do this...
);
poItemTable.show();
+ dojo.attr(
+ "acq-po-view-history", "href",
+ oilsBasePath + "/acq/po/history/" + PO.id()
+ );
+ openils.Util.show("acq-po-view-history", "inline");
+
prepareInvoiceFeatures();
}
<div dojoType="dijit.layout.ContentPane" style="height:100%">
<div>
<div id='oils-acq-picklist-header'>
- <div>
- Purchase Order
- </div>
- <table class='oils-generic-table'>
- <tr><td>ID</td><td><a id='acq-po-view-id'/></td></tr>
- <tr><td>Name</td><td><a id='acq-po-view-name' href='javascript:void(0);' onclick='updatePoName()'></a></td></tr>
- <tr><td>Provider</td><td><span id="acq-po-view-provider"/></td></tr>
- <tr><td>Total Lineitems</td><td><span id='acq-po-view-total-li'/></td></tr>
- <tr><td>Total Estimated</td><td>$<span id='acq-po-view-total-estimated'/></td></tr>
- <tr><td>Total Encumbered</td><td>$<span id='acq-po-view-total-enc'/></td></tr>
- <tr><td>Total Spent</td><td>$<span id='acq-po-view-total-spent'/></td></tr>
- <tr><td>Status</td><td><span id='acq-po-view-state'/></td></tr>
- <tr><td>Prepayment Required?</td><td><span id="acq-po-view-prepay"/></td></tr>
+ <big>Purchase Order</big>
+ <table class="oils-generic-table acq-po-info">
<tr>
- <td id="acq-po-cancel-label"></td>
+ <th>ID</th><td><a id="acq-po-view-id"/></td>
+ <th>Prepayment Required?</th>
+ <td><span id="acq-po-view-prepay"/></td>
+ </tr>
+ <tr>
+ <th>Name</th>
+ <td><a id="acq-po-view-name" href="javascript:void(0);"
+ onclick="updatePoName()"></a></td>
+ <th>Activatable?</th>
<td>
- <span id="acq-po-view-cancel-reason"></span>
- <span id="acq-po-choose-cancel-reason" class="hidden">
- <span dojoType="dijit.form.DropDownButton">
- <span>Cancel order</span>
- <span dojoType="dijit.TooltipDialog">
- <label for="acq-po-cancel-reason">
- Reason:
- </label>
- <span id="acq-po-cancel-reason"></span>
- <button jsId="acqPoCancelReasonSubmit"
- dojoType="dijit.form.Button"
- type="submit">Cancel order</button>
- </span>
- </span>
- </span>
+ <span id="acq-po-activate-checking"></span>
+ <a class="hidden" id="acq-po-activate-link" href="javascript:void(0);" onclick="activatePo()">Activate Order</a>
</td>
</tr>
<tr>
- <td>Notes</td>
+ <th>Provider</th>
+ <td><span id="acq-po-view-provider"/></td>
+ <th>Notes</th>
<td>
<a href="javascript:void(0);"
id="acq-po-view-notes"></a>
</td>
</tr>
<tr>
- <td>EDI Messages</td>
+ <th>Total Lineitems</th>
+ <td><span id="acq-po-view-total-li"/></td>
+ <th>EDI Messages</th>
<td>
<a href="javascript:void(0);"
id="acq-po-view-edi-messages"></a>
</td>
</tr>
- <tr id="acq-po-activate" class="hidden">
- <td>Activatable?</td>
+ <tr>
+ <th>Total Estimated</th>
+ <td>$<span id="acq-po-view-total-estimated"/></td>
+ <th>History</th>
<td>
- <span id="acq-po-activate-checking"></span>
- <a class="hidden" id="acq-po-activate-link" href="javascript:void(0);" onclick="activatePo()">Activate Order</a>
+ <a class="hidden" href="javascript:void(0);"
+ id="acq-po-view-history">View</a>
</td>
</tr>
- <tr><td><a class="hidden" id="acq-po-split" href="javascript:void(0);" onclick="if (confirm(localeStrings.CONFIRM_SPLIT_PO)) splitPo();">Split Order by Lineitems</a></td></tr>
- <tr id="acq-po-view-invoices" class="hidden"><!-- TODO: only reveal when really applicable -->
- <td>Invoicing</td>
- <td>
+ <tr>
+ <th>Total Encumbered</th>
+ <td>$<span id="acq-po-view-total-enc"/></td>
+ <th>Invoicing</th>
+ <td id="acq-po-invoice-stuff" class="hidden">
<button dojoType="dijit.form.Button"
id="acq-po-view-invoice-link">
View Invoices
</button>
</td>
</tr>
+ <tr>
+ <th>Total Spent</th>
+ <td>$<span id="acq-po-view-total-spent"/></td>
+ <th id="acq-po-cancel-label"></th>
+ <td>
+ <span id="acq-po-view-cancel-reason"></span>
+ <span id="acq-po-choose-cancel-reason" class="hidden">
+ <span dojoType="dijit.form.DropDownButton">
+ <span>Cancel order</span>
+ <span dojoType="dijit.TooltipDialog">
+ <label for="acq-po-cancel-reason">
+ Reason:
+ </label>
+ <span id="acq-po-cancel-reason"></span>
+ <button jsId="acqPoCancelReasonSubmit"
+ dojoType="dijit.form.Button"
+ type="submit">Cancel order</button>
+ </span>
+ </span>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <th>Status</th>
+ <td><span id="acq-po-view-state"/></td>
+ <td>
+ <a class="hidden" id="acq-po-split" href="javascript:void(0);"
+ onclick="if (confirm(localeStrings.CONFIRM_SPLIT_PO)) splitPo();">
+ Split Order by Lineitems
+ </a>
+ </td>
+ </tr>
</table>
</div>
</div>