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

This commit is contained in:
2024-10-25 16:42:13 +01:00
parent 7b6266e2f6
commit 437e094776
125 changed files with 3913 additions and 966 deletions

View File

@@ -55,17 +55,21 @@ class DataStore_Store_Manufacturing_Purchase_Order(DataStore_Store_Base):
result_set_1 = cursor.fetchall()
print(f'raw manufacturing_purchase_orders: {result_set_1}')
manufacturing_purchase_orders = []
indices_manufacturing_purchase_order = {}
for row in result_set_1:
new_manufacturing_purchase_order = Manufacturing_Purchase_Order.from_DB_manufacturing_purchase_order(row)
indices_manufacturing_purchase_order[new_manufacturing_purchase_order.id_order] = len(manufacturing_purchase_orders)
manufacturing_purchase_orders.append(new_manufacturing_purchase_order)
# Manufacturing_Purchase_Orders Items
cursor.nextset()
result_set_1 = cursor.fetchall()
print(f'raw manufacturing_purchase_order_product_links: {result_set_1}')
order_product_links = []
for row in result_set_1:
new_link = Manufacturing_Purchase_Order_Product_Link.from_DB_manufacturing_purchase_order(row)
manufacturing_purchase_orders.append(new_manufacturing_purchase_order)
order_product_links.append(new_link)
manufacturing_purchase_orders[indices_manufacturing_purchase_order[new_link.id_order]].items.append(new_link)
# Errors
cursor.nextset()

View File

@@ -66,7 +66,7 @@ class DataStore_Store_Product_Permutation(DataStore_Store_Base):
cost_local,
id_currency_cost,
profit_local_min,
latency_manufacture_days,
latency_manufacture,
id_unit_measurement_quantity,
count_unit_measurement_quantity,
quantity_min,

View File

@@ -36,11 +36,12 @@ class DataStore_Store_Supplier(DataStore_Store_Base):
def __init__(self):
super().__init__()
def get_many_supplier(self, parameters_supplier):
@classmethod
def get_many_supplier(cls, parameters_supplier):
_m = 'DataStore_Store_Supplier.get_many_supplier'
av.val_instance(parameters_supplier, 'parameters_supplier', _m, Parameters_Supplier)
argument_dict = parameters_supplier.to_json()
user = self.get_user_session()
user = cls.get_user_session()
argument_dict = {
'a_id_user': user.id_user
, **argument_dict
@@ -48,7 +49,7 @@ class DataStore_Store_Supplier(DataStore_Store_Base):
}
print(f'argument_dict: {argument_dict}')
print('executing p_shop_get_many_supplier')
result = self.db_procedure_execute('p_shop_get_many_supplier', argument_dict)
result = cls.db_procedure_execute('p_shop_get_many_supplier', argument_dict)
cursor = result.cursor
print('data received')

View File

@@ -55,9 +55,22 @@ class DataStore_Store_Supplier_Purchase_Order(DataStore_Store_Base):
result_set_1 = cursor.fetchall()
print(f'raw supplier_purchase_orders: {result_set_1}')
supplier_purchase_orders = []
indices_supplier_purchase_order = {}
for row in result_set_1:
new_supplier_purchase_order = Supplier_Purchase_Order.from_DB_supplier_purchase_order(row)
supplier_purchase_orders.append(new_supplier_purchase_order) # , row)
indices_supplier_purchase_order[new_supplier_purchase_order.id_order] = len(supplier_purchase_orders)
supplier_purchase_orders.append(new_supplier_purchase_order)
# Supplier_Purchase_Orders Items
cursor.nextset()
result_set_2 = cursor.fetchall()
print(f'raw supplier_purchase_order_product_links: {result_set_2}')
order_product_links = []
for row in result_set_2:
new_link = Supplier_Purchase_Order_Product_Link.from_DB_supplier_purchase_order(row)
order_product_links.append(new_link)
supplier_purchase_orders[indices_supplier_purchase_order[new_link.id_order]].items.append(new_link)
# Errors
cursor.nextset()