Files
parts_website/templates/components/store/_row_stock_item.html

147 lines
9.4 KiB
HTML

{% if date_time_now is not defined %}
{% set date_time_now = model.format_date(datetime.now()) %}
{% endif %}
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_STOCK_ITEM }}" {{ model.ATTR_ID_STOCK_ITEM }}>
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
{% include 'components/store/_preview_DDL_product_category.html' %}
</td>
<td class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}="0">
{% include 'components/store/_preview_DDL_product.html' %}
</td>
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }} {{ model.FLAG_COLLAPSED }}" {{ model.ATTR_ID_PRODUCT_PERMUTATION }}="0">
{% include 'components/store/_preview_product_permutation_variations.html' %}
</td>
<td class="{{ model.FLAG_CURRENCY_COST }}">
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}">
<input class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}" type="number" min="0" value="" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_INCL }}">
<input class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_INCL }}" type="number" min="0" value="" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_DATE_PURCHASED }}">
<input class="{{ model.FLAG_DATE_PURCHASED }}" type="datetime-local" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
</td>
<td class="{{ model.FLAG_DATE_RECEIVED }}">
<input type="datetime-local" class="{{ model.FLAG_DATE_RECEIVED }} {{ model.FLAG_COLLAPSED }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
</td>
<td class="{{ model.FLAG_STORAGE_LOCATION }}">
{% include 'components/store/_preview_DDL_stock_item_storage_location.html' %}
</td>
<td class="{{ model.FLAG_IS_SEALED }}">
<input type="checkbox" class="{{ model.FLAG_IS_SEALED }}" checked
{{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}" />
</td>
<td class="{{ model.FLAG_DATE_UNSEALED }}">
<input type="datetime-local" class="{{ model.FLAG_DATE_UNSEALED }} {{ model.FLAG_COLLAPSED }}"
value = "{{ date_time_now }}"
{{ model.ATTR_VALUE_CURRENT }} = "{{ date_time_now }}"
{{ model.ATTR_VALUE_PREVIOUS }}
/>
</td>
<td class="{{ model.FLAG_DATE_EXPIRATION }}">
<input type="datetime-local" class="{{ model.FLAG_DATE_EXPIRATION }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }} />
</td>
<td class="{{ model.FLAG_IS_CONSUMED }}">
<input type="checkbox" class="{{ model.FLAG_IS_CONSUMED }}" {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_FALSE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_FALSE }}" />
</td>
<td class="{{ model.FLAG_DATE_CONSUMED }}">
<input type="datetime-local" class="{{ model.FLAG_DATE_CONSUMED }} {{ model.FLAG_COLLAPSED }}"
value = "{{ date_time_now }}"
{{ model.ATTR_VALUE_CURRENT }} = "{{ date_time_now }}"
{{ model.ATTR_VALUE_PREVIOUS }}
/>
</td>
{% set active = true %}
{% include 'components/store/_td_active.html' %}
</tr>
{% else %}
<tr class="{{ model.FLAG_STOCK_ITEM }}" {{ model.ATTR_ID_STOCK_ITEM }}="{{ stock_item.id_stock }}">
<td class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_category }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_category }}">
{% include 'components/store/_preview_DDL_product_category.html' %}
</td>
<td class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.id_product }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.id_product }}">
{% include 'components/store/_preview_DDL_product.html' %}
</td>
{% set variation_tree = permutation.variation_tree %}
{% set str_ids_variations = variation_tree.to_variation_id_pairs_str() if not (variation_tree is none) else '' %}
<td class="{{ model.FLAG_PRODUCT_VARIATIONS }} {{ model.FLAG_COLLAPSED }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ str_ids_variations }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ str_ids_variations }}"
{{ model.ATTR_ID_PRODUCT_PERMUTATION }}="{{ permutation.id_permutation }}"
>
{% include 'components/store/_preview_product_permutation_variations.html' %}
</td>
{% set currency = stock_item.currency_cost %}
<td class="{{ model.FLAG_CURRENCY_COST }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ currency.id_currency }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ currency.id_currency }}"
>
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}">
<input class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}" type="number" step="0.001"
value="{{ stock_item.cost_local_VAT_excl }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.cost_local_VAT_excl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.cost_local_VAT_excl }}"
>
</td>
<td class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_INCL }}">
<input class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_INCL }}" type="number" step="0.001"
value="{{ stock_item.cost_local_VAT_incl }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.cost_local_VAT_incl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.cost_local_VAT_incl }}"
>
</td>
<td class="{{ model.FLAG_DATE_PURCHASED }}">
<input type="datetime-local" value="{{ model.format_datetime(stock_item.date_purchased) }}" {{ model.ATTR_VALUE_CURRENT }}="{{ model.format_datetime(stock_item.date_purchased) }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_datetime(stock_item.date_purchased) }}" />
</td>
<td class="{{ model.FLAG_DATE_RECEIVED }}">
<input type="datetime-local"
class="{{ model.FLAG_DATE_RECEIVED }} {% if stock_item.date_purchased is none %}{{ model.FLAG_COLLAPSED }}{% endif %}"
value="{{ model.format_datetime(stock_item.date_received) }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ model.format_datetime(stock_item.date_received) }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_datetime(stock_item.date_received) }}"
/>
</td>
<td class="{{ model.FLAG_STORAGE_LOCATION }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.id_location_storage }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.id_location_storage }}"
>
{% set storage_location = stock_item.storage_location %}
{% include 'components/store/_preview_DDL_stock_item_storage_location.html' %}
</td>
<td class="{{ model.FLAG_IS_SEALED }}">
<input type="checkbox" {{ "checked" if stock_item.is_sealed else "" }}
{{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.is_sealed | lower }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.is_sealed | lower }}"
/>
</td>
<td class="{{ model.FLAG_DATE_UNSEALED }}">
<input type="datetime-local"
class="{{ model.FLAG_DATE_UNSEALED }} {% if stock_item.is_sealed %}{{ model.FLAG_COLLAPSED }}{% endif %}"
value="{{ model.format_datetime(stock_item.date_unsealed) }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ model.format_datetime(stock_item.date_unsealed) }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_datetime(stock_item.date_unsealed) }}"
/>
</td>
<td class="{{ model.FLAG_DATE_EXPIRATION }}">
<input type="datetime-local" value="{{ model.format_datetime(stock_item.date_expiration) }}" {{ model.ATTR_VALUE_CURRENT }}="{{ model.format_datetime(stock_item.date_expiration) }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_datetime(stock_item.date_expiration) }}" />
</td>
<td class="{{ model.FLAG_IS_CONSUMED }}">
<input type="checkbox" {{ "checked" if stock_item.is_consumed else "" }} {{ model.ATTR_VALUE_CURRENT }}="{{ stock_item.is_consumed | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ stock_item.is_consumed | lower }}" />
</td>
<td class="{{ model.FLAG_DATE_CONSUMED }}">
<input type="datetime-local"
class="{{ model.FLAG_DATE_CONSUMED }} {% if not stock_item.is_consumed %}{{ model.FLAG_COLLAPSED }}{% endif %}"
value="{{ model.format_datetime(stock_item.date_consumed) }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ model.format_datetime(stock_item.date_consumed) }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ model.format_datetime(stock_item.date_consumed) }}"
/>
</td>
{% set active = stock_item.active %}
{% include 'components/store/_td_active.html' %}
</tr>
{% endif %}