Function Module to copy purchase order to another order - bapi

I'm creating documents using the function module BAPI_PO_CREATE1 and modifying documents using BAPI_PO_CHANGE to update some parts of the purchase order.
I need to create two orders with the same purchase order lines, one for purchasing and another for transferring.
I can do it calling BAPI_PO_CREATE1 twice with the same POITEMs. Is there a function module to create a copy of a purchase order using a reference number (PO_NUMBER) and a modified header?

I think you could use BAPI_PO_CREATE1 using fields PREQ_NO and PREQ_ITEM from POITEM structure.
Just ensure you have update structure POITEMX with these fields...
Try it out and let me know.

Related

Adding new product with category tree - specific price problems

I installed an add-on for bulk action (called ba_importer v 1.1.24), I upload an Excel file with my data and create a group of products.
I can set the categories' tree or manually add ID of main categories and associated. I tried with no luck to use the tree features (like Home/Products/etc) and so I use all the ID of main category and all the associated. The result is a product with the correct categories set, but with no specific price from the customer group linked to a category.
I tried to edit a single product, remove all categories and set it one by one (set one, save, set one, save etc.) and then the specific price from the group linked to a category appears to the product.
Is there a better solution? I'm thinking about make a personal PHP page that reads an Excel file and sets all the information about the product, but I'm scared to face the same problem with the specific price. 
There is no such thing as "category-related specific price",
if you have specific prices tied to customer groups , these are created as a result of the add/update product action with ps_specific_price DB entries having id_group with your restricted ID.
It is likely that the bulk module acts directly with DB queries to speed up things and bypasses this operation, I've seen this behaviour with those kind of modules in the past.
Since you are talking of a paid add-on, I would definitely seek help from the developer.

Keep product id same from csv import products

I want a solution from your idea I want to keep product id same which one I have listed into my product CSV. As I know when we import the products the products id field should be ignored, but I want to use the id from my list in CSV I do not want bigcommerce to generate the new id for products
Please check the Screenshot:
I want to keep these id's for my products remains the same
Is there any solutions, please
Thanks
There is not a way to use your own product_id. They are automatically generated and assigned by the platform. If you need to keep track of them in a certain way, you can use Product Metafields. They allow you to create a key and namespace on each product for use in your system. They are only available via API.

Prestashop wrong invoice order

I have a problem, a customer places an order and the invoice doesn't match what he bought and paid for.
he buys 3 articles the invoice displays 12....
where should I look for to solve this BIG problem? I am on Prestashop 1.6.9
I didn't delete orders manually throught database, this is my first order...
Thanks !
Are these products combinations and if so do they contain one attribute or more than one? Do you have any modules that are overriding the OrderInvoice class? Check in override--classes--order.
I would probably start in classes--order--OrderInvoice.php. The Invoices are created using this class and I believe they use the method getProducts to loop through the products from the order.

When relating 3 entities in CRM 2011 using Advanced Find only 2 entities show up in edit columns

I'm trying to create a view in CRM 2011 that will show a few columns from Customers (Account), Orders (SalesOrder), and Order Products (SalesOrderDetail). I already know I need to start at the child-most entity so under Advanced Find I select "Order Products" under Look for. When I do this I'm able to select columns from Orders but unable to select columns from Customers.
Is this even possible to accomplish in CRM?
I'm trying to create the following result set:
Account.Name,
Account.Email,
SalesOrder.OrderNumber,
SalesOrderDetail.NetAmount,
SalesOrderDetail.ShipDate
I verified that you cannot manually add a second link within a view query. To my knowledge it is also not possible to add these columns though javascript. You can get the account name in your view simply by using the account lookup on the Order. If you need for the account email to also be in the view, then I suggest you add this field to the order entity and populate it with post callout logic on the account.
I Second Zach’s idea, but suggest adding a direct relationship between customer and orderdetail . This way you can use fetchxml to show account.email or any other account.* for that matter.
The downside is you’ll need to sync order.customer changes to orderdetail.customer.
The better option is to simply create a report and show that in an iframe or a webresource.
This is not possible even if we edit the fetch xml it wont work

Create external reference id

I have duplicated a new group in OpenERP 6.1.1 .
Now I need to create an external reference id for it since I need to refer it in a view.
Normally, I guess, I should have created the group using an xml file but now I have already been using the group and assigned users to it so I don't wan't to redo the whole thing again.
Is there a simpler way ? Please suggest. Thanks in advance.
You can manually insert a row in the table ir_model_data. name is the external id and res_id is integer id. Other required fields are module and model.