address customer link
This commit is contained in:
parent
0868e90916
commit
4ae49f097c
BIN
csv/Item (1).xlsx
Normal file
BIN
csv/Item (1).xlsx
Normal file
Binary file not shown.
147
csv/Item Price-import-ready.csv
Normal file
147
csv/Item Price-import-ready.csv
Normal file
@ -0,0 +1,147 @@
|
||||
"name","item_code","uom","price_list","price_list_rate","packing_unit","item_name","brand","item_description","customer","supplier","batch_no","buying","selling","currency","valid_from","lead_time_days","valid_upto","note","reference"
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
"","","","","","","","","","","","","","","","","","","",""
|
||||
|
3
csv/Item Price-template.csv
Normal file
3
csv/Item Price-template.csv
Normal file
@ -0,0 +1,3 @@
|
||||
"ID","Item Code","UOM","Price List","Rate","Packing Unit","Item Name","Brand","Item Description","Customer","Supplier","Batch No","Buying","Selling","Currency","Valid From","Lead Time in days","Valid Upto","Note","Reference"
|
||||
|
||||
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 2.
|
BIN
csv/Item Price.xlsx
Normal file
BIN
csv/Item Price.xlsx
Normal file
Binary file not shown.
2314
csv/Item-import-ready.csv
Normal file
2314
csv/Item-import-ready.csv
Normal file
File diff suppressed because it is too large
Load Diff
1
csv/Item-template.csv
Normal file
1
csv/Item-template.csv
Normal file
@ -0,0 +1 @@
|
||||
"Item Code","Item Group","Default Unit of Measure","Series","Item Name","Markup Percentage","Disabled","Allow Alternative Item","Maintain Stock","Has Variants","Opening Stock","Valuation Rate","Standard Selling Rate","Is Fixed Asset","Auto Create Assets on Purchase","Create Grouped Asset","Asset Category","Asset Naming Series","Over Delivery/Receipt Allowance (%)","Over Billing Allowance (%)","Image","Description","Brand","Shelf Life In Days","End of Life","Default Material Request Type","Valuation Method","Warranty Period (in days)","Weight Per Unit","Weight UOM","Allow Negative Stock","Has Batch No","Automatically Create New Batch","Batch Number Series","Has Expiry Date","Retain Sample","Max Sample Quantity","Has Serial No","Serial Number Series","Variant Of","Variant Based On","Enable Deferred Expense","No of Months (Expense)","Enable Deferred Revenue","No of Months (Revenue)","Default Purchase Unit of Measure","Minimum Order Qty","Safety Stock","Allow Purchase","Lead Time in days","Last Purchase Rate","Is Customer Provided Item","Customer","Delivered by Supplier (Drop Ship)","Country of Origin","Customs Tariff Number","Default Sales Unit of Measure","Grant Commission","Allow Sales","Max Discount (%)","Inspection Required before Purchase","Quality Inspection Template","Inspection Required before Delivery","Include Item In Manufacturing","Supply Raw Materials for Purchase","Default BOM","Customer Code","Default Item Manufacturer","Default Manufacturer Part No","Total Projected Qty","ID (Barcodes)","Barcode (Barcodes)","Barcode Type (Barcodes)","UOM (Barcodes)","ID (Reorder level based on Warehouse)","Check in (group) (Reorder level based on Warehouse)","Material Request Type (Reorder level based on Warehouse)","Re-order Level (Reorder level based on Warehouse)","Re-order Qty (Reorder level based on Warehouse)","Request for (Reorder level based on Warehouse)","ID (UOMs)","Conversion Factor (UOMs)","UOM (UOMs)","ID (Variant Attributes)","Attribute (Variant Attributes)","Attribute Value (Variant Attributes)","Disabled (Variant Attributes)","From Range (Variant Attributes)","Increment (Variant Attributes)","Numeric Values (Variant Attributes)","To Range (Variant Attributes)","Variant Of (Variant Attributes)","ID (Item Defaults)","Company (Item Defaults)","Default Buying Cost Center (Item Defaults)","Default Discount Account (Item Defaults)","Default Expense Account (Item Defaults)","Default Income Account (Item Defaults)","Default Price List (Item Defaults)","Default Provisional Account (Item Defaults)","Default Selling Cost Center (Item Defaults)","Default Supplier (Item Defaults)","Default Warehouse (Item Defaults)","Deferred Expense Account (Item Defaults)","Deferred Revenue Account (Item Defaults)","ID (Supplier Items)","Supplier (Supplier Items)","Supplier Part Number (Supplier Items)","ID (Customer Items)","Customer Group (Customer Items)","Customer Name (Customer Items)","Ref Code (Customer Items)","ID (Taxes)","Item Tax Template (Taxes)","Maximum Net Rate (Taxes)","Minimum Net Rate (Taxes)","Tax Category (Taxes)","Valid From (Taxes)"
|
||||
|
|
Can't render this file because it is too large.
|
2328
csv/Item2.csv
Normal file
2328
csv/Item2.csv
Normal file
File diff suppressed because it is too large
Load Diff
58
csv/data.py
Normal file
58
csv/data.py
Normal file
@ -0,0 +1,58 @@
|
||||
import csv
|
||||
|
||||
# FILES
|
||||
export_file = "Item Price.csv" # ERPNext export
|
||||
output_file = "Item Price-import-ready.csv" # clean import CSV
|
||||
|
||||
# Template columns (exact Column Name values for ERPNext import)
|
||||
template_columns = [
|
||||
"name","item_code","uom","price_list","price_list_rate","packing_unit",
|
||||
"item_name","brand","item_description","customer","supplier","batch_no",
|
||||
"buying","selling","currency","valid_from","lead_time_days","valid_upto",
|
||||
"note","reference"
|
||||
]
|
||||
|
||||
# Which row has the Column Name row in ERPNext export? Usually 20th (0-index 19)
|
||||
COLUMN_NAME_ROW = 19
|
||||
DATA_START_ROW = 21 # 0-indexed row where actual data starts
|
||||
|
||||
def clean_cell(cell):
|
||||
# Remove extra quotes around the data
|
||||
if cell.startswith('"""') and cell.endswith('"""'):
|
||||
return cell[3:-3]
|
||||
elif cell.startswith('"') and cell.endswith('"'):
|
||||
return cell[1:-1]
|
||||
return cell
|
||||
|
||||
# Read the export
|
||||
with open(export_file, newline='', encoding='utf-8') as f:
|
||||
reader = list(csv.reader(f))
|
||||
|
||||
export_columns = [clean_cell(c) for c in reader[COLUMN_NAME_ROW]]
|
||||
data_rows = reader[DATA_START_ROW-1:]
|
||||
|
||||
# Build column index map
|
||||
col_indexes = []
|
||||
for col in template_columns:
|
||||
if col in export_columns:
|
||||
col_indexes.append(export_columns.index(col))
|
||||
else:
|
||||
col_indexes.append(None) # fill missing columns with empty string
|
||||
|
||||
# Write clean CSV
|
||||
with open(output_file, "w", newline='', encoding='utf-8') as f_out:
|
||||
writer = csv.writer(f_out, quoting=csv.QUOTE_ALL)
|
||||
|
||||
# Header row: template
|
||||
writer.writerow(template_columns)
|
||||
|
||||
for row in data_rows:
|
||||
clean_row = []
|
||||
for idx in col_indexes:
|
||||
if idx is not None and idx < len(row):
|
||||
clean_row.append(clean_cell(row[idx]))
|
||||
else:
|
||||
clean_row.append("")
|
||||
writer.writerow(clean_row)
|
||||
|
||||
print(f"Clean Item Price CSV written to {output_file}")
|
||||
BIN
csv/item.xlsx
Normal file
BIN
csv/item.xlsx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user