feat: Shop Supplier Purchase Order get, filter, and add new.

This commit is contained in:
2024-10-25 16:42:13 +01:00
parent 002551c0a9
commit ea5b8e8ca1
121 changed files with 3835 additions and 865 deletions

View File

@@ -0,0 +1,17 @@
{% with _is_blank_row = (is_blank_row or model.suppliers | length == 0 or supplier is not defined or supplier is none) %}
{% if not _is_blank_row %}
<div
class="{{ model.FLAG_SUPPLIER }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ supplier.id_supplier }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ supplier.id_supplier }}"
>{{ supplier.name_company }}</div>
{% else %}
<div
class="{{ model.FLAG_SUPPLIER }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
{% endif %}
{% endwith %}

View File

@@ -1,7 +1,7 @@
{% with _is_blank_row = (is_blank_row or order_items is not defined or order_items is none or is_blank_row is not defined) %}
{% if not _is_blank_row %}
{% set str_items = order_items.to_preview_str() %}
{% set str_items = model.convert_list_objects_to_preview_str(order_items) %}
<div
class="{{ model.FLAG_ITEMS }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ json_str_items }}"

View File

@@ -1,13 +1,13 @@
{% with _is_blank_row = (is_blank_row or order_items is not defined or order_items is none or is_blank_row is not defined) %}
{% if not _is_blank_row %}
{% set str_items = order_items.to_preview_str() %}
{% set str_items = model.convert_list_objects_to_preview_str(order_items) %}
<div
class="{{ model.FLAG_ITEMS }}"
class="{{ model.FLAG_ORDER_ITEMS }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ json_str_items }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_items }}"
>{{ str_items }}</div>
{% else %}
<div class="{{ model.FLAG_ITEMS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></div>
<div class="{{ model.FLAG_ORDER_ITEMS }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></div>
{% endif %}
{% endwith %}

View File

@@ -1,22 +1,36 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}>
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}" {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}>
<td class="{{ model.FLAG_CURRENCY }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}">
<input type="number" min="0" step="0.001" class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""/>
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">
<input type="number" min="0" step="0.001" class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""/>
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_EXCL }}">
<input type="number" min="0" step="0.001" class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_EXCL }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""/>
<div
class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_INCL }}">
<input type="number" min="0" step="0.001" class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_INCL }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""/>
<div
class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_INCL }}"
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_ITEMS }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
<td class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_order_items.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
@@ -24,42 +38,42 @@
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}="{{ order.id_order }}">
<tr class="{{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}" {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}="{{ order.id_order }}">
{% set currency = order.currency %}
<td class="{{ model.FLAG_CURRENCY }}" {{ 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_TOTAL_LOCAL_VAT_EXCL }}">
<input type="number" min="0" step="0.001"
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ order.cost_total_local_VAT_excl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.cost_total_local_VAT_excl }}"
/>
></div>
</td>
<td class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">
<input type="number" min="0" step="0.001"
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ order.cost_total_local_VAT_incl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.cost_total_local_VAT_incl }}"
/>
></div>
</td>
<td class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_EXCL }}">
<input type="number" min="0" step="0.001"
<div
class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ order.price_total_local_VAT_excl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.price_total_local_VAT_excl }}"
/>
></div>
</td>
<td class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_INCL }}">
<input type="number" min="0" step="0.001"
<div
class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_INCL }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ order.price_total_local_VAT_incl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.price_total_local_VAT_incl }}"
/>
></div>
</td>
{% set order_items = order.order_items %}
{% set json_str_items = jsonify(order_items.to_json_list()) %}
<td class="{{ model.FLAG_ITEMS }}" {{ model.ATTR_VALUE_CURRENT }}="{{ json_str_items }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_items }}">
{% set order_items = order.items %}
{% set json_str_items = model.jsonify(model.convert_list_objects_to_list_options(order_items)) %}
<td class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}" {{ model.ATTR_VALUE_CURRENT }}="{{ json_str_items }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_items }}">
{#
{% include 'components/store/_preview_manufacturing_purchase_order_items.html' %}
#}

View File

@@ -1,5 +1,5 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% include 'components/common/buttons/_slider_display_order.html' %}
</td>
@@ -25,7 +25,7 @@
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}">
<tr class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}">
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% set display_order = category.display_order %}
{% include 'components/common/buttons/_slider_display_order.html' %}

View File

@@ -1,5 +1,5 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}>
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% include 'components/common/buttons/_slider_display_order.html' %}
</td>
@@ -20,7 +20,7 @@
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_PRODUCT_CATEGORY }}="{{ category.id_category }}">
<tr class="{{ model.FLAG_PRODUCT_CATEGORY }}" {{ model.ATTR_ID_PRODUCT_CATEGORY }}="{{ category.id_category }}">
<td class="{{ model.FLAG_DISPLAY_ORDER }}">
{% set display_order = category.display_order %}
{% include 'components/common/buttons/_slider_display_order.html' %}

View File

@@ -1,6 +1,6 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_PERMUTATION }}>
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_PRODUCT_PERMUTATION }}" {{ model.ATTR_ID_PERMUTATION }}>
<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>
@@ -63,15 +63,15 @@
<input class="{{ model.FLAG_PROFIT_LOCAL_MIN }}" type="number" min="0" step="0.01"
value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}" type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}>
<td class="{{ model.FLAG_LATENCY_MANUFACTURE }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE }}" type="number" min="0" value="1" {{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}" checked>
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_PRODUCT_PERMUTATION }}="{{ permutation.id_permutation }}">
<tr class="{{ model.FLAG_PRODUCT_PERMUTATION }}" {{ model.ATTR_ID_PRODUCT_PERMUTATION }}="{{ permutation.id_permutation }}">
<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>
@@ -151,8 +151,8 @@
<td class="{{ model.FLAG_PROFIT_LOCAL_MIN }}">
<input class="{{ model.FLAG_PROFIT_LOCAL_MIN }}" type="number" min="0" value="{{ permutation.profit_local_min }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.profit_local_min }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.profit_local_min }}">
</td>
<td class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE_DAYS }}" type="number" min="0" value="{{ permutation.latency_manufacture_days }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.latency_manufacture_days }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.latency_manufacture_days }}">
<td class="{{ model.FLAG_LATENCY_MANUFACTURE }}">
<input class="{{ model.FLAG_LATENCY_MANUFACTURE }}" type="number" min="0" value="{{ permutation.latency_manufacture }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.latency_manufacture }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.latency_manufacture }}">
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.active | lower }}" {% if permutation.active %}checked{% endif %}>

View File

@@ -2,7 +2,7 @@
{% set date_time_now = model.format_date(datetime.now()) %}
{% endif %}
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_STOCK_ITEM }}>
<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>
@@ -59,7 +59,7 @@
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_STOCK_ITEM }}="{{ stock_item.id_stock }}">
<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>

View File

@@ -1,5 +1,5 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_SUPPLIER }}>
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_SUPPLIER }}" {{ model.ATTR_ID_SUPPLIER }}>
<td class="{{ model.FLAG_NAME_COMPANY }}">
<textarea class="{{ model.FLAG_NAME_COMPANY }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
</td>
@@ -32,7 +32,7 @@
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_SUPPLIER }}="{{ supplier.id_supplier }}">
<tr class="{{ model.FLAG_SUPPLIER }}" {{ model.ATTR_ID_SUPPLIER }}="{{ supplier.id_supplier }}">
<td class="{{ model.FLAG_NAME_COMPANY }}">
<textarea class="{{ model.FLAG_NAME_COMPANY }}" {{ model.ATTR_VALUE_CURRENT }}="{{ supplier.name_company }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ supplier.name_company }}">{{ supplier.name_company }}</textarea>
</td>

View File

@@ -1,27 +1,25 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}" {{ model.ATTR_ID_SUPPLIER_PURCHASE_ORDER }}>
<td class="{{ model.FLAG_SUPPLIER }}">
<textarea class="{{ model.FLAG_SUPPLIER }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}></textarea>
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_SUPPLIER_PURCHASE_ORDER }}" {{ model.ATTR_ID_SUPPLIER_PURCHASE_ORDER }}>
<td class="{{ model.FLAG_SUPPLIER }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_DDL_supplier.html' %}
</td>
<td class="{{ model.FLAG_CURRENCY }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}">
<input type="number" min="0" step="0.001"
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
/>
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">
<input type="number" min="0" step="0.001"
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}"
{{ model.ATTR_VALUE_CURRENT }}=""
{{ model.ATTR_VALUE_PREVIOUS }}=""
/>
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<td class="{{ model.FLAG_ITEMS }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
<td class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_order_items.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
@@ -29,7 +27,7 @@
</td>
</tr>
{% else %}
<tr {{ model.ATTR_ID_SUPPLIER_PURCHASE_ORDER }}="{{ order.id_order }}">
<tr class="{{ model.FLAG_SUPPLIER_PURCHASE_ORDER }}" {{ model.ATTR_ID_SUPPLIER_PURCHASE_ORDER }}="{{ order.id_order }}">
{% set supplier = order.supplier %}
<td class="{{ model.FLAG_SUPPLIER }}" {{ model.ATTR_VALUE_CURRENT }}="{{ supplier.id_supplier }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ supplier.id_supplier }}">
{% include 'components/store/_preview_DDL_supplier.html' %}
@@ -39,22 +37,28 @@
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
<td class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}">
<input type="number" min="0" step="0.001"
{#
<input type="number" min="0" step="0.001" >
#}
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ order.cost_total_local_VAT_excl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.cost_total_local_VAT_excl }}"
/>
></div>
</td>
<td class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">
<input type="number" min="0" step="0.001"
{#
<input type="number" min="0" step="0.001" >
#}
<div
class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ order.cost_total_local_VAT_incl }}"
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.cost_total_local_VAT_incl }}"
/>
></div>
</td>
{% set order_items = supplier_purchase_order.order_items %}
{% set json_str_items = jsonify(order_items.to_json_list()) %}
<td class="{{ model.FLAG_ITEMS }}" {{ model.ATTR_VALUE_CURRENT }}="{{ json_str_items }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_items }}">
{% set order_items = order.items %}
{% set json_str_items = model.jsonify(model.convert_list_objects_to_list_options(order_items)) %}
<td class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}" {{ model.ATTR_VALUE_CURRENT }}="{{ json_str_items }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ json_str_items }}">
{% include 'components/store/_preview_order_items.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">