The fields Customer and Store indicate where products sold will be delivered. That means a given customer can buy a product to be delivered to another customer. However, the bill is generated to the main customer, that is, the one selected in field C5_CLIENTE.

When placing the cursor on the Customer field and clicking F9, if parameter MV_CNPEDVE is enabled, the Association with Contract screen is displayed, you can add an order and associate it with a contract, making all measurement process automatic, through sales order data.