08-07-2016, 04:33 PM
Ok, I had a look. This is what you have to do
https://github.com/tsolucio/corebos/blob/master/modules/Invoice/EditView.php#L57
basically repeat that logic. It will be something in this line:
that should be all you need.
Please BE CAREFUL I have NOT tested the code above
https://github.com/tsolucio/corebos/blob/master/modules/Invoice/EditView.php#L57
basically repeat that logic. It will be something in this line:
PHP Code:
$focus = CRMEntity::getInstance('Invoice');
list($so_wsid,$soid) = explode('x',$entity->getId());
$so_focus = CRMEntity::getInstance('SalesOrder');
$so_focus->id = $soid;
$so_focus->retrieve_entity_info($soid, "SalesOrder");
$focus = getConvertSoToInvoice($focus, $so_focus, $soid); // this will do the Mapping for the duedate and others SalesOrder2Invoice
// we do this to get the pdoInformation array
$wsso = vtws_retrieve($entity->getId(), $current_user);
$focus->column_fields['pdoInformation'] = $wsso['pdoInformation'];
$invoice = vtws_create('Invoice', $focus->column_fields, $current_user);
that should be all you need.
Please BE CAREFUL I have NOT tested the code above
Joe
TSolucio
TSolucio