Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007205Openbravo ERP03. Procurement managementpublic2009-01-28 18:022011-02-04 09:11
emartinez 
rmorley 
normalminoralways
acknowledgedopen 
5
2.40 
 
Core
No
0007205: Automatic creation of a Goods Receipt from a Goods Shipment
Imagine the following case for understanding why this feature is requested. Let's say we have different organizations A and B which correspond to different companies. In this situation, let's imagine company A buys a product to company B. We suggest to automate the following: Create automatically the Goods Receipt in company A When company B completes the corresponding Goods Shipment.

We have developed this automation for a client. Contact us in case you need it.

Regards,
To develop this automation you would have to:

*Modify the process which is executed when "completing" a goods shipment.
*We suggest to leave in state "Draft" the goods receipt generated automatically in organization A. Thus, a user of company A should validate it personally, even it has been generated automatically.
*In case that company B voids the goods shipment (already completed), this will not affect to the goods receipt generated in company A.
*In order to inform users in company A that new goods receipts have been generated automatically, new alerts can be created.
Then, going to more technical details:

In the procedure M_INOUT_POST you will have to add the following:

*If it is a goods shipment
*which is being complete
*and there is not a goods shipment already related to it (you should add a new column in M_INOUT in order to inform of the Goods Receipt ID related to the current goods shipment document)
*and it is a transaction between two organizations belonging to the same client (the business partner of the goods shipment document, organization A, is related to an organization in AD_ORGINFO)

Then:

**Then create the header of the goods receipt in organization A
**Create the lines with the same products as in the goods shipment of organization B. For this, the products should be defined by organization "*", in order to see them in both organizations A and B.
***First of all, we will have to take care of the attributes, since they should be defined twice in the tables M_ATTRIBUTESETINSTANCE, M_ATTRIBUTEINSTANCE y M_ATTRIBUTEVALUE. Thus, if we change the attributes of products in organization B should not affect the attribute definition of the same products in organization A.
***When creating each line, we will observe if each product is contained in the corresponding Purchase Order line. If not, we will create the line in the goods receipt and in its description field we will write "We could not related this product to any Purchase Order". Thus, the user of organization A will have to modify manually the corresponding purchase order.


Finally, when the goods receipt is generated in organization A, you should inform the field POREFERENCE with the DocumentNo of the goods shipment of organization B. In the same way, you will have to inform the POREFERENCE field of the goods shipment of organization B with the DocumentNo of the goods receipt of organization A.
No tags attached.
related to feature request 0007202 acknowledged rmorley Automatic creation of a Sales Order from a Purchase Order 
blocks feature request 0007248 acknowledged rmorley Intercompany shipments 
Issue History
2009-01-28 18:02emartinezNew Issue
2009-01-28 18:02emartinezAssigned To => rafaroda
2009-01-28 18:02emartinezsf_bug_id0 => 2543437
2009-01-29 11:04rafarodaRelationship addedrelated to 0007202
2009-01-29 11:05rafarodaAssigned Torafaroda => pjuvara
2009-01-29 21:52pjuvaraRelationship addedblocks 0007248
2009-01-29 21:53pjuvaraStatusnew => acknowledged
2009-10-10 18:55camcalNote Added: 0020927
2011-02-04 09:11jpabloaeAssigned Topjuvara => rmorley

Notes
(0020927)
camcal   
2009-10-10 18:55   
Hi,

I'm actually working with the Intercompany module and i wonder if you can send me the code to create the shipments and the receipts.

Plus i want to mention that i found a bug in the procedures, they are trying to store the name of the product into a varchar(32) and the table m_product uses varchar(60), so when the product has more than 32 characters it crashes.

To solve this just change "v_productName VARCHAR(32)" to "v_productName VARCHAR(60)" in both procedures, "interco_create_order" and "interco_create_invoice".

Theres no need to compile openbravo since the modification it's on the procedure and it doesn't involves additional parameters or fields.