New: classify billed order if invoice billed (workflow
manager)
This commit is contained in:
parent
c9a2c70110
commit
2804ef2252
@ -83,6 +83,7 @@ $workflow=array(
|
||||
),
|
||||
'order' => array(
|
||||
'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_ORDER')
|
||||
,'invoice' => array('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')
|
||||
),
|
||||
'invoice' => array (
|
||||
'order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')
|
||||
|
||||
@ -1673,7 +1673,7 @@ abstract class CommonObject
|
||||
else if ($justtarget)
|
||||
{
|
||||
$sql.= "fk_target = '".$targetid."' AND targettype = '".$targettype."'";
|
||||
if ($withsourcetype) $sql.= "AND sourcetype = '".$sourcetype."'";
|
||||
if ($withsourcetype) $sql.= " AND sourcetype = '".$sourcetype."'";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -148,6 +148,24 @@ class InterfaceWorkflowManager
|
||||
}
|
||||
}
|
||||
|
||||
// Order classify billed proposal
|
||||
if ($action == 'BILL_PAYED')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER))
|
||||
{
|
||||
$object->fetchObjectLinked('','commande',$object->id,$object->element);
|
||||
if (! empty($object->linkedObjects))
|
||||
{
|
||||
foreach($object->linkedObjects['commande'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled();
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -7,4 +7,5 @@ descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Create a customer order automatically after
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Create a customer invoice automatically after a commercial proposal is signed
|
||||
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Create a customer invoice automatically after a contract is validated
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Create a customer invoice automatically after a customer order is closed
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify billed the original proposal along with a customer order
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify billed the original proposal along with a customer order
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify billed originals customer orders along with a customer invoice
|
||||
@ -7,4 +7,5 @@ descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Créer une commande client automatiquement
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Créer une facture client automatiquement à la signature d'une proposition commerciale
|
||||
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Créer une facture client automatiquement à la validation d'un contrat
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Créer une facture client automatiquement à la cloture d'une commande client
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classer facturée la proposition commerciale d'origine en même temps que la commande
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classer facturée la proposition commerciale d'origine en même temps que la commande
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classer facturée la ou les commandes clients d'origine en même temps que la facture
|
||||
Loading…
Reference in New Issue
Block a user