While performing the initial import of my example data I got a strange behavior of the Sales order state.
I will show here my source files (CSV) and the multiple steps that are getting to a wrong state for the sales orders
sales-order.csv
ID,Series,Customer,Order Type,Company,Date,Delivery Date,Currency,Exchange Rate,Price List,Price List Currency,Price List Exchange Rate,Status,% Amount Billed,% Delivered,ID (Sales Taxes and Charges),Type (Sales Taxes and Charges),Account Head (Sales Taxes and Charges),Description (Sales Taxes and Charges),Rate (Sales Taxes and Charges),ID (Items),Item Code (Items),Item Name (Items),Description (Items),Quantity (Items),UOM (Items),UOM Conversion Factor (Items),Quotation (Items)
,SAL-ORD-.YYYY.-,Alstom,Sales,Best Desk,2022-07-08,2022-07-09,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0012,Industrial,Worktable Rustic Asian Hardwood Computer Desk,47,Unit,1.0,SAL-QTN-2022-00001
,,,,,,,,,,,,,"
","
",,,,,,,ITM-0018,Burgundy,Fabric Contemporary Upholstered Executive Chair,31,Unit,1.0,SAL-QTN-2022-00001
,,,,,,,,,,,,,,,,,,,,,ITM-0022,Milford,Contemporary Mesh Executive Chair,8,Unit,1.0,SAL-QTN-2022-00001
,,,,,,,,,,,,,"
","
",,,,,,,ITM-0006,Regallo,Computer desk,10,Unit,1.0,SAL-QTN-2022-00001
,SAL-ORD-.YYYY.-,Engie,Sales,Best Desk,2022-07-11,2022-07-12,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0014,Flintan,Chaise de bureau av accoudoirs,17,Unit,1.0,SAL-QTN-2022-00002
,,,,,,,,,,,,,,,,,,,,,ITM-0009,Essential,Traditional Computer Desk Hutch Included,7,Unit,1.0,SAL-QTN-2022-00002
,,,,,,,,,,,,,"
","
",,,,,,,ITM-0015,Lidkullen,Tabouret assis/debout,16,Unit,1.0,SAL-QTN-2022-00002
,SAL-ORD-.YYYY.-,Orange,Sales,Best Desk,2022-07-14,2022-07-15,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0003,Tommaryd,Table,19,Unit,1.0,SAL-QTN-2022-00003
,,,,,,,,,,,,,,,,,,,,,ITM-0017,Stoljan,Chaise conférence,17,Unit,1.0,SAL-QTN-2022-00003
,SAL-ORD-.YYYY.-,Société Générale,Sales,Best Desk,2022-07-15,2022-07-18,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0005,Rodulf,Bureau assis/debout,49,Unit,1.0,SAL-QTN-2022-00004
,,,,,,,,,,,,,,,,,,,,,ITM-0022,Milford,Contemporary Mesh Executive Chair,29,Unit,1.0,SAL-QTN-2022-00004
,,,,,,,,,,,,,,,,,,,,,ITM-0008,Hoga,Modern/Contemporary Computer Desk Hutch Included,41,Unit,1.0,SAL-QTN-2022-00004
,,,,,,,,,,,,,,,,,,,,,ITM-0017,Stoljan,Chaise conférence,15,Unit,1.0,SAL-QTN-2022-00004
,,,,,,,,,,,,,,,,,,,,,ITM-0001,Bekant,Bureau d'angle droit,40,Unit,1.0,SAL-QTN-2022-00004
,SAL-ORD-.YYYY.-,Stellantis,Sales,Best Desk,2022-07-15,2022-07-18,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0012,Industrial,Worktable Rustic Asian Hardwood Computer Desk,37,Unit,1.0,SAL-QTN-2022-00005
,,,,,,,,,,,,,,,,,,,,,ITM-0018,Burgundy,Fabric Contemporary Upholstered Executive Chair,28,Unit,1.0,SAL-QTN-2022-00005
,,,,,,,,,,,,,,,,,,,,,ITM-0022,Milford,Contemporary Mesh Executive Chair,14,Unit,1.0,SAL-QTN-2022-00005
,SAL-ORD-.YYYY.-,Sanofi,Sales,Best Desk,2022-07-18,2022-07-19,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0006,Regallo,Computer desk,46,Unit,1.0,SAL-QTN-2022-00006
,,,,,,,,,,,,,,,,,,,,,ITM-0014,Flintan,Chaise de bureau av accoudoirs,13,Unit,1.0,SAL-QTN-2022-00006
,SAL-ORD-.YYYY.-,Alstom,Sales,Best Desk,2022-07-18,2022-07-19,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0009,Essential,Traditional Computer Desk Hutch Included,16,Unit,1.0,SAL-QTN-2022-00007
,SAL-ORD-.YYYY.-,Thales,Sales,Best Desk,2022-07-18,2022-07-19,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0015,Lidkullen,Tabouret assis/debout,14,Unit,1.0,SAL-QTN-2022-00008
,,,,,,,,,,,,,,,,,,,,,ITM-0003,Tommaryd,Table,19,Unit,1.0,SAL-QTN-2022-00008
,,,,,,,,,,,,,,,,,,,,,ITM-0017,Stoljan,Chaise conférence,2,Unit,1.0,SAL-QTN-2022-00008
,SAL-ORD-.YYYY.-,Veolia,Sales,Best Desk,2022-07-18,2022-07-19,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0005,Rodulf,Bureau assis/debout,21,Unit,1.0,SAL-QTN-2022-00009
,,,,,,,,,,,,,,,,,,,,,ITM-0022,Milford,Contemporary Mesh Executive Chair,48,Unit,1.0,SAL-QTN-2022-00009
,SAL-ORD-.YYYY.-,Engie,Sales,Best Desk,2022-07-21,2022-07-22,EUR,1.0,Standard Selling,EUR,1.0,Completed,100,100,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0008,Hoga,Modern/Contemporary Computer Desk Hutch Included,19,Unit,1.0,SAL-QTN-2022-00010
,SAL-ORD-.YYYY.-,Orange,Sales,Best Desk,2022-07-21,2022-07-22,EUR,1.0,Standard Selling,EUR,1.0,To Deliver,0,0,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0017,Stoljan,Chaise conférence,11,Unit,1.0,SAL-QTN-2022-00011
,,,,,,,,,,,,,,,,,,,,,ITM-0001,Bekant,Bureau d'angle droit,31,Unit,1.0,SAL-QTN-2022-00011
,SAL-ORD-.YYYY.-,Vinci,Sales,Best Desk,2022-07-22,2022-07-23,EUR,1.0,Standard Selling,EUR,1.0,To Deliver,0,0,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,ITM-0023,Commodore,Transitional Leather Executive Chair,31,Unit,1.0,SAL-QTN-2022-00013
,,,,,,,,,,,,,,,,,,,,,ITM-0009,Essential,Traditional Computer Desk Hutch Included,39,Unit,1.0,SAL-QTN-2022-00013
sales-invoices.csv
ID,Series,Company,Date,Payment Due Date,Status,Currency,Exchange Rate,Price List,Price List Currency,Price List Exchange Rate,Net Total (Company Currency),Grand Total (Company Currency),Grand Total,Debit To,Customer,Customer Name,ID (Sales Taxes and Charges),Type (Sales Taxes and Charges),Account Head (Sales Taxes and Charges),Description (Sales Taxes and Charges),Rate (Sales Taxes and Charges),ID (Items),Item Name (Items),Description (Items),UOM (Items)," Stock UOM (Items)",UOM Conversion Factor (Items),Sales Order (Items),Quantity (Items),Rate (Items),Amount (Items),Rate (Company Currency) (Items),Amount (Company Currency) (Items),Income Account (Items),Cost Center (Items)
,ACC-SINV-.YYYY.-,Best Desk,2022-07-10,2022-07-20,Paid,EUR,1.0,Standard Selling,EUR,1.0,40761,"48913,2","48913,2",4188 - Clients - Intérêts courus - BD,Alstom,Alstom,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Industrial,Worktable Rustic Asian Hardwood Computer Desk,Unit,"Unit",1.0,SAL-ORD-2022-00001,47,700,32900,700,32900,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Burgundy,Fabric Contemporary Upholstered Executive Chair,Unit,"Unit",1.0,SAL-ORD-2022-00001,31,175,5425,175,5425,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Milford,Contemporary Mesh Executive Chair,Unit,"Unit",1.0,SAL-ORD-2022-00001,8,117,936,117,936,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Regallo,Computer desk,Unit,"Unit",1.0,SAL-ORD-2022-00001,10,150,1500,150,1500,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-13,2022-07-23,Overdue,EUR,1.0,Standard Selling,EUR,1.0,4827,"5792,4","5792,4",4188 - Clients - Intérêts courus - BD,Engie,Engie,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Flintan,Chaise de bureau av accoudoirs,Unit,"Unit",1.0,SAL-ORD-2022-00002,17,129,2193,129,2193,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Essential,Traditional Computer Desk Hutch Included,Unit,"Unit",1.0,SAL-ORD-2022-00002,7,150,1050,150,1050,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Lidkullen,Tabouret assis/debout,Unit,"Unit",1.0,SAL-ORD-2022-00002,16,99,1584,99,1584,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-18,2022-07-28,Paid,EUR,1.0,Standard Selling,EUR,1.0,4404,"5284,8","5284,8",4188 - Clients - Intérêts courus - BD,Orange,Orange,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Tommaryd,Table,Unit,"Unit",1.0,SAL-ORD-2022-00003,19,179,3401,179,3401,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Stoljan,Chaise conférence,Unit,"Unit",1.0,SAL-ORD-2022-00003,17,59,1003,59,1003,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-18,2022-07-28,Paid,EUR,1.0,Standard Selling,EUR,1.0,44554,"53464,8","53464,8",4188 - Clients - Intérêts courus - BD,Société Générale,Société Générale,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Rodulf,Bureau assis/debout,Unit,"Unit",1.0,SAL-ORD-2022-00004,49,399,19551,399,19551,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Milford,Contemporary Mesh Executive Chair,Unit,"Unit",1.0,SAL-ORD-2022-00004,29,117,3393,117,3393,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Hoga,Modern/Contemporary Computer Desk Hutch Included,Unit,"Unit",1.0,SAL-ORD-2022-00004,41,165,6765,165,6765,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Stoljan,Chaise conférence,Unit,"Unit",1.0,SAL-ORD-2022-00004,15,59,885,59,885,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Bekant,Bureau d'angle droit,Unit,"Unit",1.0,SAL-ORD-2022-00004,40,349,13960,349,13960,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-18,2022-07-28,Paid,EUR,1.0,Standard Selling,EUR,1.0,32438,"38925,6","38925,6",4188 - Clients - Intérêts courus - BD,Stellantis,Stellantis,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Industrial,Worktable Rustic Asian Hardwood Computer Desk,Unit,"Unit",1.0,SAL-ORD-2022-00005,37,700,25900,700,25900,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Burgundy,Fabric Contemporary Upholstered Executive Chair,Unit,"Unit",1.0,SAL-ORD-2022-00005,28,175,4900,175,4900,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Milford,Contemporary Mesh Executive Chair,Unit,"Unit",1.0,SAL-ORD-2022-00005,14,117,1638,117,1638,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-20,2022-07-28,Paid,EUR,1.0,Standard Selling,EUR,1.0,8577,"10292,4","10292,4",4188 - Clients - Intérêts courus - BD,Sanofi,Sanofi,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Regallo,Computer desk,Unit,"Unit",1.0,SAL-ORD-2022-00006,46,150,6900,150,6900,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Flintan,Chaise de bureau av accoudoirs,Unit,"Unit",1.0,SAL-ORD-2022-00006,13,129,1677,129,1677,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-20,2022-10-20,Unpaid,EUR,1.0,Standard Selling,EUR,1.0,2400,2880,2880,4188 - Clients - Intérêts courus - BD,Alstom,Alstom,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Essential,Traditional Computer Desk Hutch Included,Unit,"Unit",1.0,SAL-ORD-2022-00007,16,150,2400,150,2400,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-20,2022-07-28,Paid,EUR,1.0,Standard Selling,EUR,1.0,4905,5886,5886,4188 - Clients - Intérêts courus - BD,Thales,Thales,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Lidkullen,Tabouret assis/debout,Unit,"Unit",1.0,SAL-ORD-2022-00008,14,99,1386,99,1386,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Tommaryd,Table,Unit,"Unit",1.0,SAL-ORD-2022-00008,19,179,3401,179,3401,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Stoljan,Chaise conférence,Unit,"Unit",1.0,SAL-ORD-2022-00008,2,59,118,59,118,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-20,2022-07-28,Paid,EUR,1.0,Standard Selling,EUR,1.0,13995,16794,16794,4188 - Clients - Intérêts courus - BD,Veolia,Veolia,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Rodulf,Bureau assis/debout,Unit,"Unit",1.0,SAL-ORD-2022-00009,21,399,8379,399,8379,7011 - Produits finis (ou groupe) A - BD,Main - BD
,,,,,,,,,,,,,,,,,,,,,,,Milford,Contemporary Mesh Executive Chair,Unit,"Unit",1.0,SAL-ORD-2022-00009,48,117,5616,117,5616,7011 - Produits finis (ou groupe) A - BD,Main - BD
,ACC-SINV-.YYYY.-,Best Desk,2022-07-23,2022-10-23,Unpaid,EUR,1.0,Standard Selling,EUR,1.0,3135,3762,3762,4188 - Clients - Intérêts courus - BD,Engie,Engie,,On Net Total,VAT 20% - BD,VAT 20% @ 20,20,,Hoga,Modern/Contemporary Computer Desk Hutch Included,Unit,"Unit",1.0,SAL-ORD-2022-00010,19,165,3135,165,3135,7011 - Produits finis (ou groupe) A - BD,Main - BD
First step import sales orders give me this
Second import sales invoices give me the following
Third import the payment entries updates the invoices but not the sales order
Expectation is to have the sales orders in the complete OR close status