Expose notes field for purchasing batches

Plus various other tweaks for styles and coding conventions etc.
This commit is contained in:
Lance Edgar 2017-02-21 14:27:16 -06:00
parent 59799302bd
commit 555935c71e
5 changed files with 16 additions and 13 deletions

View file

@ -6,3 +6,8 @@
div.field-wrapper { div.field-wrapper {
padding: 0; padding: 0;
} }
.field-wrapper.notes .field {
line-height: 1.1em;
white-space: pre;
}

View file

@ -13,9 +13,7 @@
<div class="field-error">${error}</div> <div class="field-error">${error}</div>
% endfor % endfor
${field.label_tag()|n} ${field.label_tag()|n}
<div class="field"> <div class="field">${field.render()|n}</div>
${field.render()|n}
</div>
% if 'instructions' in field.metadata: % if 'instructions' in field.metadata:
<span class="instructions">${field.metadata['instructions']}</span> <span class="instructions">${field.metadata['instructions']}</span>
% endif % endif

View file

@ -4,9 +4,7 @@
% if field.requires_label: % if field.requires_label:
<div class="field-wrapper ${field.name}"> <div class="field-wrapper ${field.name}">
${field.label_tag()|n} ${field.label_tag()|n}
<div class="field"> <div class="field">${field.render_readonly()}</div>
${field.render_readonly()}
</div>
</div> </div>
% endif % endif
</%def> </%def>

View file

@ -1,13 +1,8 @@
## -*- coding: utf-8 -*- ## -*- coding: utf-8 -*-
<%inherit file="/newbatch/view.mako" /> <%inherit file="/newbatch/view.mako" />
<%def name="extra_styles()"> <%def name="extra_javascript()">
${parent.extra_styles()} ${parent.extra_javascript()}
${h.stylesheet_link(request.static_url('tailbone:static/css/purchases.css'))}
</%def>
<%def name="head_tags()">
${parent.head_tags()}
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
@ -32,6 +27,11 @@
</script> </script>
</%def> </%def>
<%def name="extra_styles()">
${parent.extra_styles()}
${h.stylesheet_link(request.static_url('tailbone:static/css/purchases.css'))}
</%def>
<%def name="leading_buttons()"> <%def name="leading_buttons()">
% if batch.mode == enum.PURCHASE_BATCH_MODE_ORDERING and not batch.complete and not batch.executed and request.has_perm('purchases.batch.order_form'): % if batch.mode == enum.PURCHASE_BATCH_MODE_ORDERING and not batch.complete and not batch.executed and request.has_perm('purchases.batch.order_form'):
<button type="button" id="order-form">Ordering Form</button> <button type="button" id="order-form">Ordering Form</button>

View file

@ -143,6 +143,7 @@ class PurchaseBatchView(BatchMasterView):
fs.po_number.set(label="PO Number") fs.po_number.set(label="PO Number")
fs.po_total.set(label="PO Total", readonly=True, renderer=forms.renderers.CurrencyFieldRenderer) fs.po_total.set(label="PO Total", readonly=True, renderer=forms.renderers.CurrencyFieldRenderer)
fs.invoice_total.set(readonly=True, renderer=forms.renderers.CurrencyFieldRenderer) fs.invoice_total.set(readonly=True, renderer=forms.renderers.CurrencyFieldRenderer)
fs.notes.set(renderer=fa.TextAreaFieldRenderer, size=(80, 10))
fs.append(fa.Field('vendor_email', readonly=True, fs.append(fa.Field('vendor_email', readonly=True,
value=lambda b: b.vendor.email.address if b.vendor.email else None)) value=lambda b: b.vendor.email.address if b.vendor.email else None))
@ -188,6 +189,7 @@ class PurchaseBatchView(BatchMasterView):
fs.invoice_date, fs.invoice_date,
fs.invoice_number, fs.invoice_number,
fs.invoice_total, fs.invoice_total,
fs.notes,
fs.created, fs.created,
fs.created_by, fs.created_by,
fs.complete, fs.complete,