Two reference numbers -> same invoice line
Make sure the partner G0001 has consolidation for shipment sllowed flag on true;
Create a sales order for G0001, reference Ref1;
Create a line for product P0001, qty 40, make sute it has a price set;
Complete the order;
Create another sales order for G0001, reference Ref2;
Create a line for product P0002, qty 5, make sure it has a price set;
Complete the order;
Go to the Shipment schedule window and create a selection for the orders above;
Go to the created shipment, to the line of P0002 and set its qty to 0;
Complete the shipment;
Go to the Invoice Candidates window ;
Create a filter for the orders above;
Same product from different inout lines -> same invoice line
Make sure the partner G0002 has invoice aggregation per PO_Reference;
Create a sales order for G0002, reference Ref3;
Create a line for product P0003, qty 40, make sute it has a price set;
Complete the order;
Go to the created shipment schedule;
Create a shipment out of the shipment schedule without completing;
Complete the inout;
Go back to the shipment schedule which is now updated to only deliver qty 20;
Create a shipment out of the shipment schedule above, complete it;
Go to invoice candidates, create a selection for the order
Create an invoice out of the selected invoice candidates
Same product from different inout lines -> different invoice lines
Create a sales order for G0002, reference Ref4;
Create a line for product P0003, qty 20, make sute it has a price set;
Complete the order;
Go to the created shipment schedule;
Create a shipment out of the shipment schedule with completing;
Create another sales order for G0002, reference Ref4;
Create a line for product P0003, qty 20, make sute it has the same price set;
Complete the order;
Go to the created shipment schedule;
Create a shipment out of the shipment schedule with completing;
Go to invoice candidates, create a selection for both the orders
Create an invoice out of the selected invoice candidates