{# Copyright (c) 2015 Chintalagiri Shashank Released under the MIT license #} {% macro render_indicative_source_info(isinfo) -%}
{{ isinfo.vobj.sname|upper() }}
{{ isinfo.vpart.mpartno or '' }}
{{ isinfo.vpart.manufacturer or '' }}
{% if isinfo.vpart.last_updated %}
Data retrieved {{ isinfo.vpart.last_updated.humanize() or '' }}.
{% endif %}
{% if isinfo.vpart.datasheet %} {% endif %}
{{ isinfo.vpart.vpno or '' }}
{% if isinfo.vpart.vpartdesc %}
{{ isinfo.vpart.vpartdesc }}
{% endif %}
Available Quantity : {{ isinfo.vpart.vqtyavail or '' }}
Package Quantity : {{ isinfo.vpart.pkgqty or '' }}
{% set not_yet_found = True %} {% set selrow = [] %} {% for price in isinfo.vpart.effective_prices %} {% if not_yet_found %} {% if isinfo.oqty < price.moq %} {% set not_yet_found = False %} {% set _ = selrow.append(loop.index - 1) %} {% elif loop.last %} {% set _ = selrow.append(loop.index) %} {% endif %} {% endif %} {% endfor %} {% for up, ap, ep in isinfo.vpart.detailed_prices %}
@{{ ep.moq }}
{{ ep.unit_price.native_string|unicode or '' }}
{{ ep.oqmultiple }}
{% endfor %}
{% endmacro %} {% macro render_indicative_sources(title, isinfos, ident) -%}
{{ title }}
{% if isinfos|length > 0 %} {% for isinfo in isinfos %} {{ render_indicative_source_info(isinfo) }} {% endfor %} {% else %}
No Sources Found!
Could not find any sources for {{ ident }}.
{% endif %}
Notes
{% endmacro %}