Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
eldy committed Jul 8, 2012
2 parents fb1034c + c25254e commit d0943be
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions htdocs/admin/workflow.php
Expand Up @@ -83,6 +83,7 @@
),
'order' => array(
'propal' => array('WORKFLOW_PROPAL_AUTOCREATE_ORDER')
,'invoice' => array('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')
),
'invoice' => array (
'order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE')
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -1673,7 +1673,7 @@ function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype=
else if ($justtarget)
{
$sql.= "fk_target = '".$targetid."' AND targettype = '".$targettype."'";
if ($withsourcetype) $sql.= "AND sourcetype = '".$sourcetype."'";
if ($withsourcetype) $sql.= " AND sourcetype = '".$sourcetype."'";
}
}
else
Expand Down
Expand Up @@ -148,6 +148,24 @@ function run_trigger($action,$object,$user,$langs,$conf)
}
}

// Invoice classify billed order
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;
}

Expand Down
3 changes: 2 additions & 1 deletion htdocs/langs/en_US/workflow.lang
Expand Up @@ -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
3 changes: 2 additions & 1 deletion htdocs/langs/fr_FR/workflow.lang
Expand Up @@ -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

0 comments on commit d0943be

Please sign in to comment.