Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gaps csv & insert sql script #5968

Merged
merged 9 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions server/gaps/items/gaps_insert_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def item_link_stmt(item_id):
return f"INSERT INTO item_link (id, item_id) VALUES ('{item_id}', '{item_id}') ON CONFLICT DO NOTHING;\n"

def upsert_item_stmt(item_id, row):
item_name = row['mSupply item name']
item_code = row['mSupply item code']
item_name = row['Item name']
item_code = row['Item code']
ven_category = "NOT_ASSIGNED"
item_type = "STOCK"
legacy_record = ""
Expand All @@ -31,8 +31,8 @@ def upsert_item_stmt(item_id, row):
return sql_statements

def upsert_diluent_stmt(item_id, row):
item_name = row['mSupply item name'] + " Diluent"
item_code = row['mSupply item code'] + "_DIL"
item_name = row['Item name'] + " Diluent"
item_code = row['Item code'] + "_DIL"
ven_category = "NOT_ASSIGNED"
item_type = "STOCK"
legacy_record = ""
Expand Down Expand Up @@ -134,11 +134,11 @@ def upsert_diluent_packaging_variant_stmt(packaging_variant_id, item_variant_id,
packaging_name = get_packaging_variant_name(packaging_level)
volume_per_unit = 0
if packaging_level == 1:
volume_per_unit= float(row["DiluentPrimaryVolume"]) / 1000
volume_per_unit= float(row["DiluentPrimaryVolume"])
elif packaging_level == 2:
volume_per_unit= float(row["DiluentSecondaryVolume"]) / 1000
volume_per_unit= float(row["DiluentSecondaryVolume"])
elif packaging_level == 3:
volume_per_unit= float(row["DiluentTertiaryVolume"]) / 1000
volume_per_unit= float(row["DiluentTertiaryVolume"])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only python change, the csv has been updated though with various changes...

else:
volume_per_unit = 0

Expand Down
Loading
Loading