This commit is contained in:
bagtaib 2022-06-22 16:29:15 +02:00
parent fd0e3861b0
commit 03de870751
3 changed files with 13 additions and 0 deletions

View File

@ -65,6 +65,12 @@ $workflowcodes = array(
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
'picto'=>'order'
),
'WORKFLOW_PROPAL_NOTCREATE_ORDER_IFEXISTS'=>array(
'family'=>'create',
'position'=>15,
'enabled'=>(!empty($conf->propal->enabled) && !empty($conf->commande->enabled)),
'picto'=>'order'
),
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array(
'family'=>'create',
'position'=>20,

View File

@ -86,8 +86,14 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
return $ret;
}
if (!empty($conf->global->WORKFLOW_PROPAL_NOTCREATE_ORDER_IFEXISTS)) {
$object->fetchObjectLinked();
if (!empty($object->linkedObjectsIds['commande']))
return $ret;
}
}
// Order to invoice
if ($action == 'ORDER_CLOSE') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

View File

@ -3,6 +3,7 @@ WorkflowSetup=Workflow module setup
WorkflowDesc=This module provides some automatic actions. By default, the workflow is open (you can do things in the order you want) but here you can activate some automatic actions.
ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules.
# Autocreate
descWORKFLOW_PROPAL_NOTCREATE_ORDER_IFEXISTS=Do not Automatically create a sales order after a commercial proposal is signed if it already exists
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a sales order after a commercial proposal is signed (the new order will have same amount as the proposal)
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed (the new invoice will have same amount as the proposal)
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice after a contract is validated