{% macro state_badge(state) -%} {{ t({'draft': 'Draft', 'posted': 'Posted', 'cancelled': 'Cancelled', 'proforma': 'Issued', 'converted': 'Converted'}.get(state, state)) }} {%- endmacro %} {% macro pay_badge(ps) -%} {% if ps %}{{ t({'paid': 'Paid', 'partial': 'Partially paid', 'not_paid': 'Not paid'}[ps]) }}{% endif %} {%- endmacro %} {% macro order_badge(state, kind) -%} {% set labels = {'draft': 'Quotation' if kind == 'sale' else 'Draft PO', 'to_approve': 'Waiting Approval', 'confirmed': 'Sales Order' if kind == 'sale' else 'Purchase Order', 'cancelled': 'Cancelled'} %} {{ t(labels.get(state, state)) }} {%- endmacro %} {% macro progress_badge(st) -%} {% if st %}{{ t({'full': 'Fully', 'partial': 'Partially', 'no': 'Nothing yet'}[st]) }}{% endif %} {%- endmacro %} {% macro picking_badge(state) -%} {{ t({'ready': 'Ready', 'done': 'Done', 'cancelled': 'Cancelled'}[state]) }} {%- endmacro %} {% macro list_filters(f, states, extra='') -%}
{% for fv in favs %}{% endfor %} {%- endmacro %} {% macro branch_tag(branches, bid) -%} {% set b = branches.get(bid) %}{{ b.code if b else bid }} {%- endmacro %} {% macro report_filters(f, show_group=True, extra=None) -%} {%- endmacro %} {% macro wf_badge(state) -%} {% set cls = {'draft': 'draft', 'submitted': 'warn', 'approved': 'posted', 'done': 'posted', 'rejected': 'cancelled', 'cancelled': 'cancelled', 'sent': 'warn', 'awarded': 'posted', 'running': 'posted', 'closed': 'draft', 'disposed': 'cancelled', 'invited': 'draft', 'quoted': 'posted', 'declined': 'cancelled', 'prospect': 'warn', 'blocked': 'cancelled', 'award_pending': 'warn'} %} {% set lbl = {'draft': 'Draft', 'submitted': 'Waiting Approval', 'approved': 'Approved', 'done': 'Done', 'rejected': 'Rejected', 'cancelled': 'Cancelled', 'sent': 'Sent', 'awarded': 'Awarded', 'running': 'Running', 'closed': 'Fully Depreciated', 'disposed': 'Disposed', 'invited': 'Invited', 'quoted': 'Quoted', 'declined': 'Declined', 'prospect': 'Prospect', 'blocked': 'Blocked', 'award_pending': 'Award waiting approval'} %} {{ t(lbl.get(state, state)) }} {%- endmacro %} {% macro icon(name, cls='ic') -%}{%- endmacro %} {% macro attachments_card(model, rid) -%} {% set files = attachments_for(model, rid) %}{{ t('No attachments.') }}
{% endif %}| {{ e.at[:16]|replace('T', ' ') }} | {{ e.full_name or e.username or t('System') }} | {{ t({'submitted': 'Submitted', 'approved_step': 'Approved', 'rejected': 'Rejected', 'approved': 'Fully approved', 'cancelled': 'Withdrawn', 'override_approve': 'Approved in place of the approvers', 'override_reject': 'Rejected in place of the approvers'}.get(e.action, e.action)) }}{% if e.step_no %} · {{ t('Step') }} {{ e.step_no }}{% endif %} | {{ e.comment or '' }} |