1. PostgreSQL copy of all MySQL created and tested.\n 2. Purchase Orders and Sales Orders and stock level management added to MySQL, PostgreSQL, and server and front end code.

This commit is contained in:
2024-07-05 20:34:11 +01:00
parent 3a2a164213
commit 6f4e329258
3049 changed files with 535753 additions and 3022 deletions

View File

@@ -0,0 +1,60 @@
{% if is_blank_row %}
<tr class="{{ model.FLAG_ROW_NEW }}">
<td class="{{ model.FLAG_CATEGORY }}">
<select class="{{ model.FLAG_CATEGORY}}">
{% for cat in model.category_list.categories %}
<option value="{{ cat.id_category }}">{{ cat.name }}</option>
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_PRODUCT }}">
<select class="{{ model.FLAG_PRODUCT }}"></select>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
<textarea class="{{ model.FLAG_VARIATIONS }}"></textarea>
</td>
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="0">
</td>
<td class="{{ model.FLAG_QUANTITY_MIN }}">
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="0">
</td>
<td class="{{ model.FLAG_QUANTITY_MAX }}">
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="0">
</td>
<td class="{{ model.FLAG_COST_LOCAL }}">
<input class="{{ model.FLAG_COST_LOCAL }}" type="number" min="0" value="0">
</td>
<!-- <td><strong>{ { permutation.output_currency() }}</strong>{ { permutation.get_price_local() }}</td> -->
</tr>
{% else %}
<tr {{ model.ATTR_ID_CATEGORY }}="{{ category.id_category }}" {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}" {{ model.ATTR_ID_PERMUTATION }}="{{ permutation.id_permutation }}">
<td class="{{ model.FLAG_CATEGORY }}">
<select class="{{ model.FLAG_CATEGORY }}" {{ model.ATTR_ID_CATEGORY }}="{{ category.id_category }}"></select>
</td>
<td class="{{ model.FLAG_PRODUCT }}">
<select class="{{ model.FLAG_PRODUCT }}" {{ model.ATTR_ID_PRODUCT }}="{{ product.id_product }}">
{% for p in model.category_list.categories[model.category_list.get_index_category_from_id(category.id_category)].products %}
<option value="{{ p.id_product }}">{{ p.name }}</option>
{% endfor %}
</select>
</td>
<td class="{{ model.FLAG_VARIATIONS }}">
<textarea class="{{ model.FLAG_VARIATIONS }}">{{ permutation.output_variations() }}</textarea>
</td>
<td class="{{ model.FLAG_QUANTITY_STOCK }}">
<input class="{{ model.FLAG_QUANTITY_STOCK }}" type="number" min="0" value="{{ permutation.quantity_stock }}">
</td>
<td class="{{ model.FLAG_QUANTITY_MIN }}">
<input class="{{ model.FLAG_QUANTITY_MIN }}" type="number" min="0" value="{{ permutation.quantity_min }}">
</td>
<td class="{{ model.FLAG_QUANTITY_MAX }}">
<input class="{{ model.FLAG_QUANTITY_MAX }}" type="number" min="0" value="{{ permutation.quantity_max }}">
</td>
<td class="{{ model.FLAG_COST_LOCAL }}">
<strong>{{ permutation.output_currency() }}</strong>{{ permutation.cost_local }}
</td>
<!-- <td><strong>{{ permutation.output_currency() }}</strong>{ { permutation.get_price_local() }}</td> -->
</tr>
{% endif %}

View File

@@ -1,39 +1,95 @@
{% extends 'layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
{% set product = model.product %}
{% set permutation = product.get_permutation_selected() %}
<!--
{ % set product = model.product %}
{ % set permutation = product.get_permutation_selected() %}
-->
{% set block_id = 'styles' %}
{% include '_shared_store.html' %}
<script>console.log("test 1");</script>
<link rel="stylesheet" href="{{ url_for('static', filename='css/store_product.css') }}">
<!-- HTML content -->
<div class="row">
<div class="leftcolumn">
<div class="card">
<div class="container">
<div class="card subcard">
<div class="container column">
<h2>{{ product.get_name() }}</h2>
<div class="container-img-gallery">
<img class="img-product" src="{{ product.get_image_from_index(0).url }}" alt="Template product image"> <!-- model.get_many_product_image_src(product.id, '', True, 'FULL') -->
</div>
</div>
{% include '_block_store_product_price.html' %}
</div>
<div class="card subcard">
<div>{{ permutation.description }}</div>
</div>
<div class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<form id="{{ model.ID_FORM_CONTACT }}" class="container" action="{{ url_for('contact') }}" method="POST">
{{ model.form_filters.hidden_tag() }}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.id_category.label }}
{{ model.form_filters.id_category() }}
{% for error in model.form_filters.id_category.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
</div>
<div id="{{ model.ID_BASKET_CONTAINER }}" class="rightcolumn">
{% include '_block_store_basket.html' %}
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.id_product.label }}
{{ model.form_filters.id_product() }}
{% for error in model.form_filters.id_product.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.is_out_of_stock.label }}
{{ model.form_filters.is_out_of_stock() }}
{% for error in model.form_filters.is_out_of_stock.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.quantity_min.label }}
{{ model.form_filters.quantity_min() }}
{% for error in model.form_filters.quantity_min.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
<div class="{{ model.FLAG_CONTAINER_INPUT }}">
{{ model.form_filters.quantity_max.label }}
{{ model.form_filters.quantity_max() }}
{% for error in model.form_filters.quantity_max.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
</div>
</div>
</form>
</div>
<!--
<div class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_COLUMN }}">
</div>
</div>
-->
<table id="{{ model.ID_TABLE_MAIN }}" class="{{ model.FLAG_ROW }} {{ model.FLAG_CARD }}">
<head>
<tr>
<th class="{{ model.FLAG_CATEGORY }}">Category</th>
<th class="{{ model.FLAG_PRODUCT }}">Product</th>
<th class="{{ model.FLAG_VARIATIONS }}">Variations</th>
<th class="{{ model.FLAG_QUANTITY_STOCK }}">Quantity Stock</th>
<th class="{{ model.FLAG_QUANTITY_MIN }}">Quantity Min</th>
<th class="{{ model.FLAG_QUANTITY_MAX }}">Quantity Max</th>
<th class="{{ model.FLAG_COST_LOCAL }}">Cost</th>
<!-- <th>Price</th> -->
</tr>
</head>
<tbody>
{% set is_blank_row = False %}
{% for category in model.category_list.categories %}
{% for product in category.products %}
{% for permutation in product.permutations %}
{% include '_block_store_permutation.html' %}
{% endfor %}
{% endfor %}
{% endfor %}
{% set is_blank_row = True %}
{% include '_block_store_permutation.html' %}
</tbody>
</table>
{% set block_id = 'scripts' %}
{% include '_shared_store.html' %}
@@ -42,7 +98,25 @@
<script>
// pass arguments from model to JS
var attrIdCategory = "{{ model.ATTR_ID_CATEGORY }}";
var attrIdProduct = "{{ model.ATTR_ID_PRODUCT }}";
var attrIdPermutation = "{{ model.ATTR_ID_PERMUTATION }}";
var flagCategory = "{{ model.FLAG_CATEGORY }}";
var flagProduct = "{{ model.FLAG_PRODUCT }}";
var flagVariations = "{{ model.FLAG_VARIATIONS }}";
var flagQuantityStock = "{{ model.FLAG_QUANTITY_STOCK }}";
var flagQuantityMin = "{{ model.FLAG_QUANTITY_MIN }}";
var flagQuantityMax = "{{ model.FLAG_QUANTITY_MAX }}";
var flagCostLocal = "{{ model.FLAG_COST_LOCAL }}";
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_PRODUCT }}";
var idFilterCategory = "{{ model.ID_FILTER_CATEGORY }}";
var idFilterProduct = "{{ model.ID_FILTER_PRODUCT }}";
var idFilterOutOfStock = "{{ model.ID_FILTER_OUT_OF_STOCK }}";
var idFilterQuantityMin = "{{ model.ID_FILTER_QUANTITY_MIN }}";
var idFilterQuantityMax = "{{ model.ID_FILTER_QUANTITY_MAX }}";
var dictListsProducts = {{ model.category_list.to_dict_lists_products() }};
var listCategories = {{ model.category_list.to_list_categories() }};
var listProducts = {{ model.category_list.to_list_products() }};
// hookup elements
$(document).ready(function() {

View File

@@ -0,0 +1,110 @@
{% extends 'layout.html' %}
{% block title %}{{ model.title }}{% endblock %}
{% block page_body %}
{% set supplier = model.supplier %}
{% set block_id = 'styles' %}
{% include '_shared_store.html' %}
<link rel="stylesheet" href="{{ url_for('static', filename='css/store_supplier.css') }}">
<!-- HTML content -->
<div class="card">
<form id="{{ model.ID_FORM_SUPPLIER }}" class="{{ model.FLAG_CONTAINER }}" action="{{ url_for('supplier') }}" method="POST">
<h2 class="label-title">Supplier</h2>
{{ model.form.hidden_tag() }}
<div class="card subcard">
<div class="container-input">
{{ model.form.name_company.label }}
{{ model.form.name_company(size=100) }}
{% for error in model.form.name_company.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
</div>
<div class="card subcard">
<h3>Contact</h3>
<div class="container-input">
{{ model.form.name_contact.label }}
{{ model.form.name_contact(size=50) }}
{% for error in model.form.name_contact.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.department_contact.label }}
{{ model.form.department_contact(size=50) }}
{% for error in model.form.department_contact.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.id_address.label }}
{{ model.form.id_address() }}
{% for error in model.form.id_address.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
<button id="{{ model.ID_BUTTON_ADD_SUPPLIER }}">Add new address</button>
</div>
<div class="container-input">
{{ model.form.phone_number.label }}
{{ model.form.phone_number(size=20) }}
{% for error in model.form.phone_number.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.fax.label }}
{{ model.form.fax(size=20) }}
{% for error in model.form.fax.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.email.label }}
{{ model.form.email(size=254) }}
{% for error in model.form.email.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.website.label }}
{{ model.form.website(size=254) }}
{% for error in model.form.website.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.id_currency.label }}
{{ model.form.id_currency() }}
{% for error in model.form.id_currency.errors %}
<p class="{{ model.FLAG_ERROR }}">{{ error }}</p>
{% endfor %}
</div>
<div class="container-input">
{{ model.form.recaptcha() }}
</div>
<div class="container-input">
{{ model.form.submit() }}
</div>
</div>
</form>
</div>
{% set block_id = 'scripts' %}
{% include '_shared_store.html' %}
<!-- Include JavaScript -->
<script src="{{ url_for('static', filename='js/store_product.js') }}"></script>
<script>
// pass arguments from model to JS
var hashPageCurrent = "{{ model.HASH_PAGE_STORE_SUPPLIER }}";
// hookup elements
$(document).ready(function() {
console.log('Hooking up store supplier page...');
hookupStorePageSupplier();
});
</script>
{% endblock %}

View File

@@ -41,13 +41,14 @@
var typeFormBasketAdd = "{{ model.TYPE_FORM_BASKET_ADD }}";
var typeFormBasketEdit = "{{ model.TYPE_FORM_BASKET_EDIT }}";
if (!isEmpty({{ model.basket.items }})) {
localStorage.setItem(keyBasket, JSON.parse(JSON.stringify({'items': "{{ model.basket.items }}"})));
/*
if (!isEmpty({ { model.basket.items }})) {
localStorage.setItem(keyBasket, JSON.parse(JSON.stringify({'items': "{ { model.basket.items }}"})));
}
*/
$(document).ready(function() {
hookupStore();
// hookupStore();
});
</script>

View File

@@ -3,7 +3,7 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/>
<title>{% block title %}{% endblock %} - {{ model.NAME_COMPANY }}</title>
<title>{{ model.title }} - {{ model.NAME_COMPANY }}</title>
<meta name="description" content="Explore our wide range of software engineering services. We specialize in various tech stacks including MySQL, Python, Microsoft SQL Server, C#, Firebase, Node.js, Java, HTML5, React, CSS3, Flask, JavaScript, MVC, and REST." />
<meta name="keywords" content="software engineering, software development, software design, software testing, software maintenance, software support, software consultancy, software training, software documentation, software project management, software quality assurance, software process improvement, software configuration management, software requirements engineering, software architecture, software design patterns, software design principles, software testing principles, software testing techniques, software testing tools, software testing automation, software testing manual, software testing exploratory, software testing regression, software testing performance, software testing security, software testing usability, software testing accessibility, software testing compatibility, software testing reliability, software testing maintainability, software testing portability, software testing scalability, software testing test-driven development, software testing behaviour-driven development, software testing acceptance test-driven development, software testing continuous integration, software testing continuous deployment, software testing continuous delivery, software testing continuous monitoring, software testing continuous feedback, software testing continuous improvement, software testing agile, software testing scrum, software testing kanban, software testing lean, software testing waterfall, software testing v-model, software testing spiral, software testing incremental, software testing iterative, software testing adaptive, software testing predictive, software testing hybrid, software testing manual, software testing automated, software testing exploratory, software testing regression, software testing performance, software testing security, software testing usability, software testing accessibility, software testing compatibility, software testing reliability, software testing maintainability, software testing portability, software testing scalability, software testing test-driven development, software testing behaviour-driven development, software testing acceptance test-driven development, software testing continuous integration, software testing continuous deployment, software testing continuous delivery, software testing continuous monitoring, software testing continuous feedback, software testing continuous improvement, software testing agile, software testing scrum, software testing kanban, software testing lean, software testing waterfall, software testing v-model, software testing spiral, software testing incremental, software testing iterative, software testing adaptive, software testing predictive, software testing hybrid, software testing manual, software testing automated, software testing exploratory, software testing regression, software testing performance, software testing security, software testing usability, software testing accessibility, software testing compatibility, software testing reliability, software testing maintainability, software testing portability, software testing scalability, software testing test-driven development, software testing behaviour-driven development, software testing acceptance test-driven development, software testing continuous integration, software testing continuous deployment, software testing continuous delivery, software testing continuous monitoring, software testing continuous feedback, software testing continuous improvement, software testing agile, software testing, MySQL, Python, Microsoft SQL Server, MS SQL Server, C#, Firebase, Node.js, Java, HTML5, React, CSS3, Flask, JavaScript, MVC, REST" />
<link rel="canonical" href="{{ model.URL_HOST }}" />
@@ -53,6 +53,7 @@
var flagExpanded = "{{ model.FLAG_EXPANDED }}";
var flagInitialised = "{{ model.FLAG_INITIALISED }}";
var flagRow = "{{ model.FLAG_ROW }}";
var flagRowNew = "{{ model.FLAG_ROW_NEW }}";
var flagScrollable = "{{ model.FLAG_SCROLLABLE }}";
var flagSubmitted = "{{ model.FLAG_SUBMITTED }}";
var hashPageContact = "{{ model.HASH_PAGE_CONTACT }}";
@@ -60,6 +61,7 @@
var hashPageHome = "{{ model.HASH_PAGE_HOME }}";
var hashPageServices = "{{ model.HASH_PAGE_SERVICES }}";
var hashPageStoreHome = "{{ model.HASH_PAGE_STORE_HOME }}";
var hashPageStorePermutations = "{{ model.HASH_PAGE_STORE_PERMUTATIONS }}";
var hashPageStoreProduct = "{{ model.HASH_PAGE_STORE_PRODUCT }}";
var idButtonHamburger = "#{{ model.ID_BUTTON_HAMBURGER }}";
var idFormCurrency = "#{{ model.ID_FORM_CURRENCY }}";
@@ -69,9 +71,11 @@
var idNavHome = "#{{ model.ID_NAV_HOME }}";
var idNavServices = "#{{ model.ID_NAV_SERVICES }}";
var idNavStoreHome = "#{{ model.ID_NAV_STORE_HOME }}";
var idNavStorePermutations = "#{{ model.ID_NAV_STORE_PERMUTATIONS }}";
var idNavStoreProduct = "#{{ model.ID_NAV_STORE_PRODUCT }}";
var idOverlayHamburger = "#{{ model.ID_OVERLAY_HAMBURGER }}";
var idPageBody = "#{{ model.ID_PAGE_BODY }}";
var idTableMain = "#{{ model.ID_TABLE_MAIN }}";
var isUserLoggedIn = "{{ model.output_bool(model.IS_USER_LOGGED_IN) }}";
var keyBasket = "{{ model.KEY_BASKET }}";
var keyForm = "{{ model.KEY_FORM }}";
@@ -93,7 +97,7 @@
<img class="header-logo" src="{{ url_for('static', filename='images/Logo.png') }}" alt="{{ model.NAME_COMPANY }} logo" aria-label="{{ model.NAME_COMPANY }} logo" tabindex="0">
</div>
<div class="{{ model.FLAG_CONTAINER }}" style="width: 75vw; min-width: 65vw; max-width: 80vw;">
<h1 class="company-name">Precision And Research Technology Systems</h1>
<h1 class="company-name">{{ model.NAME_COMPANY }} - {{ model.title }}</h1>
</div>
<div class="{{ model.FLAG_CONTAINER }}" style="width: 7vw; min-width: 7vw; max-width: 15vw; justify-content: flex-end; "> <!-- padding-left: 25%; -->
<button id="{{ model.ID_BUTTON_HAMBURGER }}" tabindex="1" alt="Hamburger menu button" aria-label="Hamburger menu button">=</button>
@@ -118,47 +122,53 @@
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<a id="{{ model.ID_NAV_CONTACT }}">Contact</a> <!-- href="{{ url_for('contact') }}" -->
</div>
<div class="container column">
<a id="{{ model.ID_NAV_STORE_PERMUTATIONS }}">Product Permutations</a>
</div>
{% if model.is_page_store %}
<!--
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<!-- <a href="{ url_ for('create_price_dummy') }">Create template price</a> -->
<form id="{{ model.ID_FORM_IS_INCLUDED_VAT }}" class="{{ model.FLAG_CONTAINER }}" action="{{ url_for('set_is_included_VAT') }}" method="POST">
{{ model.form_is_included_VAT.hidden_tag() }}
<!-- <a href="{ url_ for('create_price_dummy') }">Create template price</a> --
<form id="{{ model.ID_FORM_IS_INCLUDED_VAT }}" class="{{ model.FLAG_CONTAINER }}" action="{ { url_ for('set_is_included_VAT') } }" method="POST">
{ { model.form_is_included_VAT.hidden_tag() }}
<div class="container-input">
{{ model.form_is_included_VAT.is_included.label }}
{{ model.form_is_included_VAT.is_included( checked = model.is_included_VAT ) }}
{% for error in model.form_is_included_VAT.is_included.errors %}
{ { model.form_is_included_VAT.is_included.label }}
{ { model.form_is_included_VAT.is_included( checked = model.is_included_VAT ) }}
{ % for error in model.form_is_included_VAT.is_included.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
{ % endfor %}
</div>
</form>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<form id="{{ model.ID_FORM_DELIVERY_REGION }}" class="{{ model.FLAG_CONTAINER }}" action="{{ url_for('set_delivery_region') }}" method="POST">
{{ model.form_delivery_region.hidden_tag() }}
<form id="{{ model.ID_FORM_DELIVERY_REGION }}" class="{{ model.FLAG_CONTAINER }}" action="{ { url_ for('set_delivery_region') } }" method="POST">
{ { model.form_delivery_region.hidden_tag() }}
<div class="container-input">
{{ model.form_delivery_region.id_region_delivery.label }}
{{ model.form_delivery_region.id_region_delivery() }}
{% for error in model.form_delivery_region.id_region_delivery.errors %}
{ { model.form_delivery_region.id_region_delivery.label }}
{ { model.form_delivery_region.id_region_delivery() }}
{ % for error in model.form_delivery_region.id_region_delivery.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
{ % endfor %}
</div>
</form>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<form id="{{ model.ID_FORM_CURRENCY }}" class="{{ model.FLAG_CONTAINER }}" action="{{ url_for('set_currency') }}" method="POST">
{{ model.form_currency.hidden_tag() }}
<form id="{{ model.ID_FORM_CURRENCY }}" class="{{ model.FLAG_CONTAINER }}" action="{ { url_ for('set_currency') } }" method="POST">
{ { model.form_currency.hidden_tag() }}
<div class="container-input">
{{ model.form_currency.id_currency.label }}
{{ model.form_currency.id_currency() }}
{% for error in model.form_currency.id_currency.errors %}
{ { model.form_currency.id_currency.label }}
{ { model.form_currency.id_currency() }}
{ % for error in model.form_currency.id_currency.errors %}
<p class="error">{{ error }}</p>
{% endfor %}
{ % endfor %}
</div>
</form>
</div>
<div class="{{ model.FLAG_CONTAINER }} {{ model.FLAG_ROW }}">
<a href="{{ url_for('logout') if model.is_user_logged_in else url_for('login') }}" style="float:right">{{ 'Logout' if model.is_user_logged_in else 'Login' }}</a>
<a href="{ { url_for('logout') if model.is_user_logged_in else url_for('login') }}" style="float:right">{{ 'Logout' if model.is_user_logged_in else 'Login' }}</a>
</div>
-->
{% endif %}
</div>