Topic: Problem when generating the bill of material listing report

there was a problem when generating bill of material listing report and this message came to me

DATABASE ERROR : could not retreive the location name for DEF
sql that failed was : SELECT location_name FROM 3_locations WHERE loc_code='DEF'
Abdelhamid M. Abdelhamid - Partner & Managing Director
Abdelhamid & Co Certified Public Accountants & Auditors - UAE - Sharjah
(ACPA & IACPA) - (International Arab Certified Public Accountant)- IASCA Fellow Member
Mobile "WhatsApp" : +971 50 7948028

Re: Problem when generating the bill of material listing report

I think this is because i delete DIF location from the list of lacation , but it is very strange here in designing , as you have to put a compo box include the locations to be selected and not to be defined by sql query .

Abdelhamid M. Abdelhamid - Partner & Managing Director
Abdelhamid & Co Certified Public Accountants & Auditors - UAE - Sharjah
(ACPA & IACPA) - (International Arab Certified Public Accountant)- IASCA Fellow Member
Mobile "WhatsApp" : +971 50 7948028

Re: Problem when generating the bill of material listing report

you have to delete this part in sql code

WHERE loc_code='DEF'
Abdelhamid M. Abdelhamid - Partner & Managing Director
Abdelhamid & Co Certified Public Accountants & Auditors - UAE - Sharjah
(ACPA & IACPA) - (International Arab Certified Public Accountant)- IASCA Fellow Member
Mobile "WhatsApp" : +971 50 7948028

Re: Problem when generating the bill of material listing report

Currently, when deleting locations, we check for locations in:
table stock_moves
table work_orders
table cust_branches
It seems that we have to extend the check.
You can insert the location DEF again, and then the report will work ok.

/Joe

5 (edited by infotechaccountant 06/02/2009 08:00:32 am)

Re: Problem when generating the bill of material listing report

Dear Joe

I don’t think that this is a permanent solution , I think you have two options for that , the first is to add criteria will be selected from compo box which will include the query about the location , the second is to delete this code “WHERE loc_code='DEF'” and make the sorting according to the location
I think you have reform the sql code here in version 2.1.3 , and really it is very bad practice in developing when you force your end user to use particular data like this case I have to maintain a record for a location its code “DEF”
Best Regards

Abdelhamid M. Abdelhamid - Partner & Managing Director
Abdelhamid & Co Certified Public Accountants & Auditors - UAE - Sharjah
(ACPA & IACPA) - (International Arab Certified Public Accountant)- IASCA Fellow Member
Mobile "WhatsApp" : +971 50 7948028

Re: Problem when generating the bill of material listing report

Probably you have broken database consistency as a result of manual playing with database content. AFAIK there is no one place in source code where 'DEF' hardcoded, and the problem is that you have deleted location record, while it is referenced in BOM.

But if the deletion was made normally at Inventory Locations page it mean there is lack of some pre-deletion check as Joe said. Anyway it can be a bug, not a design flow.

Janusz

Re: Problem when generating the bill of material listing report

This database error was arising because when deleting the DEF location the deleting routine inside locations.php didn't check for BOM values and some other relating records in other tables. This has now been fixed and will be uploade to CVS Main trunk. Which, of course, will be included in 2.1.3.
Please, infotechaccountant, be good to us. Under no circumstances will we be developing in a bad practice. Both the main developers have over 30 years of serious developing experience. But, unfortunately, bugs comes and goes. And as said we try to fix them ASAP. I am just waiting for another bugfix before committing to CVS Main trunk.

/Joe

Re: Problem when generating the bill of material listing report

Don't Worry Joe

I'll not leave this solution untill I'll make a complete try for all the options inside it and now I'm working in Demo Data which help me to discover the bugs .

Best Regards

Abdelhamid M. Abdelhamid - Partner & Managing Director
Abdelhamid & Co Certified Public Accountants & Auditors - UAE - Sharjah
(ACPA & IACPA) - (International Arab Certified Public Accountant)- IASCA Fellow Member
Mobile "WhatsApp" : +971 50 7948028