Fix: Product, Product Category, Product Permutation, Supplier, Supplier Purchase Order, and Manufacturing Purchase Order architecture update for getting and saving data.

This commit is contained in:
2024-11-02 15:49:40 +00:00
parent 373ed9cebf
commit 4c2e05f4ae
87 changed files with 2891 additions and 1472 deletions

View File

@@ -27,11 +27,7 @@
<script src="{{ url_for('static', filename='js/store/home.js') }}"></script>
<script>
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_HOME }}";
$(document).ready(function() {
console.log('Hooking up home page...');
hookupStorePageHome();
// hookupStore(); // in _shared_store.html
});
{#
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_HOME }}";
#}
</script>

View File

@@ -30,6 +30,13 @@
{{ product.form_delivery_option() }}
</div>
{% endif %}
<script>console.log('creating basket item for:');console.log('product id: {{ product.id_product }}');console.log('permutation id: {{ product.get_id_permutation() }}');console.log('quantity: {{ basket_item.quantity }}');</script>
<script>
if (_verbose) {
console.log('creating basket item for:');
console.log('product id: {{ product.id_product }}');
console.log('permutation id: {{ product.get_id_permutation() }}');
console.log('quantity: {{ basket_item.quantity }}');
}
</script>
</form>
</div>

View File

@@ -1,6 +1,9 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }} {{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}" {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}>
<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_CURRENCY }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
@@ -30,15 +33,20 @@
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<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 }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
</td>
</tr>
{% else %}
<tr class="{{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}" {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}="{{ order.id_order }}">
{% 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' %}
#}
{% include 'components/store/_preview_order_items.html' %}
</td>
{% 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' %}
@@ -71,14 +79,6 @@
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.price_total_local_VAT_incl }}"
></div>
</td>
{% 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' %}
#}
{% include 'components/store/_preview_order_items.html' %}
</td>
<td class="{{ model.FLAG_ACTIVE }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" {% if order.active %}checked{% endif %} {{ model.ATTR_VALUE_CURRENT }}="{{ order.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ order.active | lower }}">
</td>

View File

@@ -17,7 +17,10 @@
<td class="{{ model.FLAG_HAS_VARIATIONS }}">
<input class="{{ model.FLAG_HAS_VARIATIONS }}" type="checkbox" {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_FALSE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_FALSE }}">
</td>
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="View">
<td class="{{ model.FLAG_ACCESS_LEVEL }}"
{{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="View"
{{ model.ATTR_VALUE_CURRENT }}="1" {{ model.ATTR_VALUE_PREVIOUS }}="1"
>
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1">View</div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">
@@ -46,7 +49,10 @@
<input class="{{ model.FLAG_HAS_VARIATIONS }}" type="checkbox" {% if product.has_variations %}checked{% endif %}
{{ model.ATTR_VALUE_CURRENT }}="{{ product.has_variations | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.has_variations | lower }}">
</td>
<td class="{{ model.FLAG_ACCESS_LEVEL }}" {{ model.ATTR_ID_ACCESS_LEVEL }}="1" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="{{ product.name_access_level_required }}">
<td class="{{ model.FLAG_ACCESS_LEVEL }}"
{{ model.ATTR_ID_ACCESS_LEVEL }}="{{ product.id_access_level_required }}" {{ model.FLAG_ACCESS_LEVEL_REQUIRED }}="{{ product.name_access_level_required }}"
{{ model.ATTR_VALUE_CURRENT }}="{{ product.id_access_level_required }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_access_level_required }}"
>
<div class="{{ model.FLAG_ACCESS_LEVEL}}" {{ model.ATTR_ID_ACCESS_LEVEL }}="{{ product.id_access_level_required }}" {{ model.ATTR_VALUE_CURRENT }}="{{ product.id_access_level_required }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ product.id_access_level_required }}">{{ product.name_access_level_required }}</div>
</td>
<td class="{{ model.FLAG_ACTIVE }}">

View File

@@ -52,9 +52,18 @@
<td class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% include 'components/store/_preview_DDL_product_permutation_interval_expiration_unsealed.html' %}
</td>
<td class="{{ model.FLAG_COST_LOCAL }}">
<td class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}">
<!--
<input class="{{ model.FLAG_COST_LOCAL }}" type="number" min="0" step="0.01"
value="0" {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
-->
<div {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
0
</div>
</td>
<td class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_INCL }}">
<div {{ model.ATTR_VALUE_CURRENT }}="0" {{ model.ATTR_VALUE_PREVIOUS }}>
0
</div>
</td>
<td class="{{ model.FLAG_CURRENCY_COST }}" {{ model.ATTR_VALUE_CURRENT }} {{ model.ATTR_VALUE_PREVIOUS }}>
{% include 'components/store/_preview_DDL_currency.html' %}
@@ -140,8 +149,11 @@
<td class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}" {{ model.ATTR_VALUE_CURRENT }}="{{ value }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ value }}">
{% include 'components/store/_preview_DDL_product_permutation_interval_expiration_unsealed.html' %}
</td>
<td class="{{ model.FLAG_COST_LOCAL }}">
<input class="{{ model.FLAG_COST_LOCAL }}" type="number" min="0" value="{{ permutation.cost_local }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.cost_local }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.cost_local }}">
<td class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}">
<input class="{{ model.FLAG_COST_UNIT_LOCAL_VAT_EXCL }}" type="number" min="0" value="{{ permutation.cost_local_VAT_excl }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.cost_local_VAT_excl }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.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" min="0" value="{{ permutation.cost_local_VAT_incl }}" {{ model.ATTR_VALUE_CURRENT }}="{{ permutation.cost_local_VAT_incl }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ permutation.cost_local_VAT_incl }}">
</td>
{% set currency = permutation.currency_cost %}

View File

@@ -4,6 +4,9 @@
<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_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_CURRENCY }}" {{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}="">
{% include 'components/store/_preview_DDL_currency.html' %}
</td>
@@ -19,9 +22,6 @@
{{ model.ATTR_VALUE_CURRENT }}="" {{ model.ATTR_VALUE_PREVIOUS }}=""
></div>
</td>
<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 }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ model.FLAG_BOOL_TRUE }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ model.FLAG_BOOL_TRUE }}">
</td>
@@ -32,6 +32,11 @@
<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' %}
</td>
{% 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>
{% 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' %}
@@ -56,11 +61,6 @@
{{ model.ATTR_VALUE_PREVIOUS }}="{{ order.cost_total_local_VAT_incl }}"
></div>
</td>
{% 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 }}">
<input class="{{ model.FLAG_ACTIVE }}" type="checkbox" checked {{ model.ATTR_VALUE_CURRENT }}="{{ order.active | lower }}" {{ model.ATTR_VALUE_PREVIOUS }}="{{ order.active | lower }}">
</td>

View File

@@ -235,13 +235,17 @@
var _pathHost = "{{ model.get_url_host() }}";
var _rowBlank = null;
var titlePageCurrent = "{{ model.title }}";
var _verbose = ("{{ model.app.app_config.DEBUG }}" == "True");
</script>
<!-- Stylesheets
<link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" loading="eager" href="{{ url_for('static', filename='dist/css/main.bundle.css') }}">
-->
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/main.bundle.css') }}">
<link rel="preload" as="style" href="{{ url_for('static', filename='dist/css/main.bundle.css') }}" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{ url_for('static', filename='dist/css/main.bundle.css') }}"></noscript>
{% block page_head %}{% endblock %}
</head>
<body data-page="{{ model.hash_page_current }}">
<div class="topnav">

View File

@@ -1,14 +1,12 @@
{% extends 'layouts/layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_head %}
<link rel="preload" as="style" href="{{ url_for('static', filename='dist/css/store_basket.bundle.css') }}" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_basket.bundle.css') }}"></noscript>
{% endblock %}
{% block page_body %}
<!-- Include Stylesheets
<link rel="stylesheet" href="{{ url_for('static', filename='css/sections/store.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='css/store/basket.css') }}">
-->
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_basket.bundle.css') }}">
<!-- HTML content -->
<div class="{{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">

View File

@@ -1,6 +1,10 @@
{% extends 'layouts/layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_head %}
<link rel="preload" as="style" href="{{ url_for('static', filename='dist/css/store_home.bundle.css') }}" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_home.bundle.css') }}"></noscript>
{% endblock %}
{% block page_body %}
{% include 'components/store/_home_body.html' %}

View File

@@ -1,8 +1,11 @@
{% extends 'layouts/layout.html' %}
{% block page_head %}
<link rel="preload" as="style" href="{{ url_for('static', filename='dist/css/store_manufacturing_purchase_orders.bundle.css') }}" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_manufacturing_purchase_orders.bundle.css') }}"></noscript>
{% endblock %}
{% block page_body %}
<link rel="stylesheet" href="{{ url_for('static', filename='dist/css/store_manufacturing_purchase_orders.bundle.css') }}">
<form id="{{ model.ID_FORM_FILTERS }}" class="{{ model.FLAG_FILTER }} {{ model.FLAG_ROW }} {{ model.FLAG_CARD }}" action="{{ url_for('routes_store_manufacturing_purchase_order.filter_manufacturing_purchase_order') }}" method="POST"> <!-- {{ model.FLAG_CONTAINER }} -->
{{ model.form_filters.hidden_tag() }}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
@@ -41,12 +44,12 @@
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<thead>
<tr class="{{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}">
<th class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}">Items</th>
<th class="{{ model.FLAG_CURRENCY }}">Currency</th>
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}">Cost Total VAT Excl.</th>
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">Cost Total VAT Incl.</th>
<th class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_EXCL }}">Price Total VAT Excl.</th>
<th class="{{ model.FLAG_PRICE_TOTAL_LOCAL_VAT_INCL }}">Price Total VAT Incl.</th>
<th class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}">Items</th>
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
</tr>
</thead>

View File

@@ -112,7 +112,8 @@
<th class="{{ model.FLAG_DOES_EXPIRE_FASTER_ONCE_UNSEALED }}">Expires Faster Once Unsealed?</th>
<th class="{{ model.FLAG_COUNT_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}">Count Interval Expiration Unsealed</th>
<th class="{{ model.FLAG_UNIT_MEASUREMENT_INTERVAL_EXPIRATION_UNSEALED }}">Interval Expiration Unsealed</th>
<th class="{{ model.FLAG_COST_LOCAL }}">Cost</th>
<th class="{{ model.FLAG_COST_LOCAL_VAT_EXCL }}">Cost Local VAT Excl.</th>
<th class="{{ model.FLAG_COST_LOCAL_VAT_INCL }}">Cost Local VAT Incl.</th>
<th class="{{ model.FLAG_CURRENCY_COST }}">Cost Currency</th>
<th class="{{ model.FLAG_PROFIT_LOCAL_MIN }}">Profit Local Min</th>
<th class="{{ model.FLAG_LATENCY_MANUFACTURE }}">Manufacturing Latency</th>

View File

@@ -42,10 +42,10 @@
<thead>
<tr class="{{ model.FLAG_SUPPLIER_PURCHASE_ORDER }}">
<th class="{{ model.FLAG_SUPPLIER }}">Supplier</th>
<th class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}">Items</th>
<th class="{{ model.FLAG_CURRENCY }}">Currency</th>
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_EXCL }}">Cost Total VAT Excl.</th>
<th class="{{ model.FLAG_COST_TOTAL_LOCAL_VAT_INCL }}">Cost Total VAT Incl.</th>
<th class="{{ model.FLAG_ORDER_ITEMS }} {{ model.FLAG_COLLAPSED }}">Items</th>
<th class="{{ model.FLAG_ACTIVE}}">Active</th>
</tr>
</thead>