webERP Forum

Full Version: Question about the creation of Work Orders
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all


I am starting to use work orders and the first thing I did was to read the file DeliveryDetails.php where WOs are created, always referred to a sales order.

Now i have the next question:

When I change a quote to a sales order, the following line is executed:

PHP Code:
if($_SESSION['Items'.$identifier]->Quotation==0

Where we deduct if the quote has changed, all fine.. But then the following is executed looking for an existing contract:

PHP Code:
$ContractResult DB_query("SELECT contractref,
                                            requireddate
                                    FROM contracts WHERE orderno='" 
.  $_SESSION['ExistingOrder'.$identifier] ."'
                                    AND status=1"
);
                                    
        if(
DB_num_rows($ContractResult)==1

Inside the last if, are executed the sentences for create the WO, but since I do not have contracts created, those sentences are never executed and the WO is never created.


Whenever I change a quote to a sales order, I do not get a work order and it's something I need a lot... some ideas to help me? HuhHuh

Sorry for my english Undecided
Work orders are only created for contracts automatically. They are not created for all sales orders automatically. Under manufacturing you can create WOs
Hi,
If your Bom set up properly, you can use the Sales order no to search the finished goods needed in work order entry interface.
It also can be a reference to write some script to automatically create WOs for your scenery.

Hope it's help.

Thanks and best regards!

Exson



(07-26-2017, 01:43 AM)facubustos Wrote: [ -> ]Hi all


I am starting to use work orders and the first thing I did was to read the file DeliveryDetails.php where WOs are created, always referred to a sales order.

Now i have the next question:

When I change a quote to a sales order, the following line is executed:

PHP Code:
if($_SESSION['Items'.$identifier]->Quotation==0

Where we deduct if the quote has changed, all fine.. But then the following is executed looking for an existing contract:

PHP Code:
$ContractResult DB_query("SELECT contractref,
                                            requireddate
                                    FROM contracts WHERE orderno='" 
.  $_SESSION['ExistingOrder'.$identifier] ."'
                                    AND status=1"
);
                                    
        if(
DB_num_rows($ContractResult)==1

Inside the last if, are executed the sentences for create the WO, but since I do not have contracts created, those sentences are never executed and the WO is never created.


Whenever I change a quote to a sales order, I do not get a work order and it's something I need a lot... some ideas to help me? HuhHuh

Sorry for my english Undecided