Topic: error while doing delivery of Sale order

I am getting following error while doing delivery against sale order. When checked there is no duplicate in table sale order. Require urgent help to solve this.

error message " You have duplicate document in database: (type:30, number:3)"

Thanks for your help

Re: error while doing delivery of Sale order

Line 45 in includes/types.inc is:

define('ST_SALESORDER', 30);

The execution of the $sql defined from Line 224 in sales/includes/db/sales_order_db.inc provides a non unique resultset which triggers the error message you stated. The simplified query (assuming company db table prefix as "_1") to test this case is:

SELECT * FROM 1_sales_orders WHERE trans_no=30 AND order_no=3;

If you get more than 1 row output, then your Chart of Accounts is not proper as the primary key has not been defined to be a compound one comprising trans_no and order_no.

Since you say that there is no duplicate sales order with that combination of fields, then the new sales order you are trying to insert may have these same values which comes from the type and reference fields in the 1_refs table.

All of this is assuming you are using FA v2.4.x. When you ask for assistance, please provide details of versions of server components and platform used.