Add "declare credit" UI for receiving batch rows
This commit is contained in:
parent
c869516449
commit
5b9e97b4eb
3 changed files with 122 additions and 1 deletions
49
tailbone/templates/receiving/declare_credit.mako
Normal file
49
tailbone/templates/receiving/declare_credit.mako
Normal file
|
@ -0,0 +1,49 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/base.mako" />
|
||||
|
||||
<%def name="title()">Declare Credit for Row #${row.sequence}</%def>
|
||||
|
||||
<%def name="context_menu_items()">
|
||||
% if master.rows_viewable and request.has_perm('{}.view'.format(permission_prefix)):
|
||||
<li>${h.link_to("View this {}".format(row_model_title), row_action_url('view', row))}</li>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="extra_javascript()">
|
||||
${parent.extra_javascript()}
|
||||
<script type="text/javascript">
|
||||
|
||||
function toggleFields(creditType) {
|
||||
if (creditType === undefined) {
|
||||
creditType = $('select[name="credit_type"]').val();
|
||||
}
|
||||
if (creditType == 'expired') {
|
||||
$('.field-wrapper.expiration_date').show();
|
||||
} else {
|
||||
$('.field-wrapper.expiration_date').hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
toggleFields();
|
||||
|
||||
$('select[name="credit_type"]').on('selectmenuchange', function(event, ui) {
|
||||
toggleFields(ui.item.value);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render()|n}
|
||||
</div><!-- form-wrapper -->
|
||||
|
||||
<ul id="context-menu">
|
||||
${self.context_menu_items()}
|
||||
</ul>
|
||||
|
||||
</div>
|
|
@ -7,7 +7,10 @@
|
|||
<div class="object-helper">
|
||||
<h3>Receiving Tools</h3>
|
||||
<div class="object-helper-content">
|
||||
${h.link_to("Receive Product", url('{}.receive_row'.format(route_prefix), uuid=batch.uuid, row_uuid=row.uuid), class_='button autodisable')}
|
||||
<div style="white-space: nowrap;">
|
||||
${h.link_to("Receive Product", url('{}.receive_row'.format(route_prefix), uuid=batch.uuid, row_uuid=row.uuid), class_='button autodisable')}
|
||||
${h.link_to("Declare Credit", url('{}.declare_credit'.format(route_prefix), uuid=batch.uuid, row_uuid=row.uuid), class_='button autodisable')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue