Topic: Work Order

I already installed 1.0.1 (fresh installation from wizard), but this error remains when viewing Work Order
e.g: http://localhost/frontacc/manufacturing/view/work_order_view.php?trans_no=10

DATABASE ERROR : The work order requirements could not be retrieved
error code : 1054
error message : Unknown column '0_wo_requirements.stock_id' in 'on clause'
sql that failed was : SELECT 0_wo_requirements.*, 0_stock_master.description, 0_stock_master.mb_flag, 0_locations.location_name, 0_workcentres.name AS WorkCentreDescription FROM 0_wo_requirements, 0_locations, 0_workcentres INNER JOIN 0_stock_master ON 0_wo_requirements.stock_id = 0_stock_master.stock_id WHERE workorder_id=10 AND 0_locations.loc_code = 0_wo_requirements.loc_code AND 0_workcentres.id=workcentre

When saving Work Order Entry, always showing multiple dialog box "bokade bom- cost 0", "bokade additional cost -35, acc = 1410", "bokade total- cost 35", before displaying the result screen saying "The work order been added."

Thanks in advance,
I'm looking forward to try out another enhancements.

Re: Work Order

Thanks for the bug report. The last one with the debug boxes has been fixed.
Another bug, according the Issue link in Work Order Inquires, produced an empty screen, has been fixed.
Affected files:
/manufacturing/work_order_entry.php
/manufacturing/includes/work_order_issue_ui.inc
/manufacturing/includes/db/work_orders_quick_db.inc
Please check them out from the CVS repository on Sourceforge.

We couldn't reproduce your first error (viewing the work order). Could you please, after downloading the affected files, tell us if the bug still exists. That is, try to enter a new work-order and view it.
If the bug still exists, please tell us exactly what you entered. That way we should be able to fix it rapidly.

Admin

Re: Work Order

We have been doing some more research and detected some differences in declaring the work centre id in the database. It might cause problems in newer versions of MySQL. We have solved it by casting the string versions into unsigned. It should fix the problems.
Please check out the following files from the CVS.
/includes/db/manufacturing_db.inc
/manufacturing/work_order_entry.php
/manufacturing/includes/work_order_issue_ui.inc
/manufacturing/includes/db/work_order_requirements_db.inc
/manufacturing/includes/db/work_orders_quick_db.inc
/manufacturing/inquiry/where_used_inquiry.php

We hope that this solves your problems.

Admin

Re: Work Order

I had also also found error to get details of work order. error details given below. I am using latest checked out codes from CVS
--------------------------------------------------------------------------------------------------------------------
Work Order # 8
#     Reference     Type     Manufactured Item     Into Location     Date     Quantity
8     8     Assemble     001 - ABCD    PLACE     24/05/2007     1
This work order is closed.

Work Order Requirements
DATABASE ERROR : The work order requirements could not be retrieved
error code : 1054
error message : Unknown column '0_wo_requirements.stock_id' in 'on clause'
sql that failed was : SELECT 0_wo_requirements.*, 0_stock_master.description, 0_stock_master.mb_flag, 0_locations.location_name, 0_workcentres.name AS WorkCentreDescription FROM 0_wo_requirements, 0_locations, 0_workcentres INNER JOIN 0_stock_master ON 0_wo_requirements.stock_id = 0_stock_master.stock_id WHERE workorder_id=8 AND 0_locations.loc_code = 0_wo_requirements.loc_code AND 0_workcentres.id=CAST(workcentre AS UNSIGNED)

Re: Work Order

Hello,
We can not reproduce this error. Can you tell us which version of MySQL you are using? Maybe there are people out there that can help us with this?

Re: Work Order

There seems to be a problem with joins in version 5.0.12 of MySQL. Look at this topic, https://frontaccounting.com/punbb/viewtopic.php?id=13
This SQL statement is inside the file
/manufacturing/includes/db/work_order_requirements_db.inc in a function called get_wo_requirements:

function get_wo_requirements($woid)
{
    $sql = "SELECT ".TB_PREF."wo_requirements.*, ".TB_PREF."stock_master.description,
        ".TB_PREF."stock_master.mb_flag, 
        ".TB_PREF."locations.location_name, 
        ".TB_PREF."workcentres.name AS WorkCentreDescription FROM 
        ".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres INNER JOIN ".TB_PREF."stock_master ON 
        ".TB_PREF."wo_requirements.stock_id = ".TB_PREF."stock_master.stock_id 
        WHERE workorder_id=$woid
        AND ".TB_PREF."locations.loc_code = ".TB_PREF."wo_requirements.loc_code
        AND ".TB_PREF."workcentres.id=CAST(workcentre AS UNSIGNED)";    

    return db_query($sql, "The work order requirements could not be retrieved");    
}

Put parentheses around the FROM tables

....... FROM (".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres) 
INNER JOIN ".TB_PREF."stock_master ON .......

Please report if this helps!
New edited files with JOIN's from multiple tables will be put on the CVS on Sourceforge.

/includes/db/manufacturing_db.inc
/manufacturing/includes/db/work_order_requirements_db.inc

Admin

Re: Work Order

i am using my-sql version 5.0.27

Re: Work Order

admin wrote:

There seems to be a problem with joins in version 5.0.12 of MySQL. Look at this topic, https://frontaccounting.com/punbb/viewtopic.php?id=13
This SQL statement is inside the file
/manufacturing/includes/db/work_order_requirements_db.inc in a function called get_wo_requirements:

function get_wo_requirements($woid)
{
    $sql = "SELECT ".TB_PREF."wo_requirements.*, ".TB_PREF."stock_master.description,
        ".TB_PREF."stock_master.mb_flag, 
        ".TB_PREF."locations.location_name, 
        ".TB_PREF."workcentres.name AS WorkCentreDescription FROM 
        ".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres INNER JOIN ".TB_PREF."stock_master ON 
        ".TB_PREF."wo_requirements.stock_id = ".TB_PREF."stock_master.stock_id 
        WHERE workorder_id=$woid
        AND ".TB_PREF."locations.loc_code = ".TB_PREF."wo_requirements.loc_code
        AND ".TB_PREF."workcentres.id=CAST(workcentre AS UNSIGNED)";    

    return db_query($sql, "The work order requirements could not be retrieved");    
}

Put parentheses around the FROM tables

....... FROM (".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres) 
INNER JOIN ".TB_PREF."stock_master ON .......

Please report if this helps!
New edited files with JOIN's from multiple tables will be put on the CVS on Sourceforge.

/includes/db/manufacturing_db.inc
/manufacturing/includes/db/work_order_requirements_db.inc

Admin

With new codes there is no error.
Thanks
shukla

9 (edited by dkshukla 05/04/2007 04:28:38 am)

Re: Work Order

I had also get error in issuing items to work order. Following error message for your reference,
I am using Mysql server version 5.0.27
please check and rectify the bug

Issue Items to Work Order

DATABASE ERROR : The work order issue could not be added
error code : 1064
error message : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' '2', '2007/05/04', 'DEF', 1)' at line 2
sql that failed was : INSERT INTO 0_wo_issues (workorder_id, reference, issue_date, loc_code, workcentre_id) VALUES (, '2', '2007/05/04', 'DEF', 1)

Re: Work Order

Yes this is a bug. Edited files in CVS on SourceForge.

/manufacturing/includes/db/work_order_issues_db.inc

We are closing this topic now, it is rather long.