Topic: direct invoice error

Hi, my name is luciano, i've installed FA a few days ago. it is an excelent software.
But i am having a little problem. My knowledge in MySQL is about 3 in a 1 to 10 scale, and 0 in php.
However y could relaize why my installation can`t make DIRECT INVOICE's.
when y click on PLACE INVOICE i have a red error:
"""
ERROR DE BASE DE DATOS : FATAL : sales order return nothing - 0
sql that failed was : SELECT 1_sales_orders.*, 1_debtors_master.name, 1_debtors_master.curr_code, 1_debtors_master.email AS master_email, 1_locations.location_name, 1_debtors_master.payment_terms, 1_debtors_master.discount, 1_sales_types.sales_type, 1_sales_types.id AS sales_type_id, 1_sales_types.tax_included, 1_shippers.shipper_name, 1_tax_groups.name AS tax_group_name , 1_tax_groups.id AS tax_group_id FROM 1_sales_orders, 1_debtors_master, 1_sales_types, 1_tax_groups, 1_cust_branch, 1_locations, 1_shippers WHERE 1_sales_orders.order_type=1_sales_types.id AND 1_cust_branch.branch_code = 1_sales_orders.branch_code AND 1_cust_branch.tax_group_id = 1_tax_groups.id AND 1_sales_orders.debtor_no = 1_debtors_master.debtor_no AND 1_locations.loc_code = 1_sales_orders.from_stk_loc AND 1_shippers.shipper_id = 1_sales_orders.ship_via AND 1_sales_orders.trans_type = '30' AND 1_sales_orders.order_no = '1'
The field from_stk_loc in sales_orders is empty at the time the DIRECT INVOICE is generated. i dont know if i´m expleing myself.
"""
When you search for " 1_locations.loc_code = 1_sales_orders.from_stk_loc", the result is 0 because the values are different. In my case it is OFI in the first sentence and EMPTY in the second.
There must be some function that is not working ...??
I´m running FA 2.2, windows XP,with XAMPP, My DB installed from  en_US-new.sql, I ve removed many non critical "INSERT" lines. if you want i can send my SQL backup.
Tell me what else do you need from my working enviroment.
P.S.: Excuse my english
Thanks and regards!

Re: direct invoice error

I think you have missed something important when manually deleting 'non critical' insert lines. Maybe you have no POS defined or location for te POS is not 'OFI' but 'DEF' or something else?
Janusz

Re: direct invoice error

yes, y do delete the insert line taht creats default POS,
but later in the setup, i do create a new location called OFI before make any direct invoice.

CLUES

i've installed 2 enterprise, E1 and E2
in E1 the default .SQL was executed to create de DB.
at the first time it`s works ok, but after DEF POS deletion and NEW POS creation, i started to have this problem.
Then, I've created a second Entreprise, with "non critical" insert lines, and the problem shows up at the beginning
I haven't modified the default entrprise Training Co. here, direct invoice Work fine.
Later i will create with the default. SQL file a new E3, and recreater the scenario.
I will keep you notice.

Re: direct invoice error

I found the problem!
In thr 0_sales_pos table, the only record in the table has ID = 2
I change it to 1, and problem fixed
Thanks and regards!!!!