Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the standard 'create invoice from salesorder' in workflows
#10
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:


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
Reply


Messages In This Thread
RE: Using the standard 'create invoice from salesorder' in workflows - joebordes - 08-07-2016, 04:33 PM

Forum Jump:


Users browsing this thread: 5 Guest(s)