Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2013-08-08 01:54:22 +02:00
commit b7dd059f99
6 changed files with 33 additions and 4 deletions

View File

@ -81,6 +81,8 @@ $workflowcodes=array(
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'),
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'),
'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
);
if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))

View File

@ -166,6 +166,25 @@ class InterfaceWorkflowManager
return $ret;
}
}
// classify billed order
if ($action == 'BILL_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_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;
}

View File

@ -155,7 +155,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fourn
$result=$object->delete($id);
if ($result > 0)
{
header('Location: index.php');
header('Location: list.php');
exit;
}
else

View File

@ -8,4 +8,5 @@ descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Create a customer invoice automatically a
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 linked source proposal to billed when customer order is set to paid
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order to billed when customer invoice is set to paid
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order to billed when customer invoice is set to paid
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify the customer's order as invoiced when the bill(s) are higher than the order

View File

@ -9,3 +9,4 @@ descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Créer une facture client automatiqueme
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Créer une facture client automatiquement à la clôture d'une commande client
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classer facturée la proposition commerciale source quand la commande client dérivée est classée payée
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classer facturée la ou les commandes clients source quand la facture client dérivée est classée payée
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classer facturée la commande client source lorsque la facture ou les factures sont supérieures à la commande

View File

@ -1580,7 +1580,7 @@ class Societe extends CommonObject
{
$contact_property = array();
$sql = "SELECT rowid, email, phone_mobile, lastname, firstname";
$sql = "SELECT rowid, email, phone_mobile, lastname, poste, firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople";
$sql.= " WHERE fk_soc = '".$this->id."'";
@ -1596,7 +1596,13 @@ class Societe extends CommonObject
$obj = $this->db->fetch_object($resql);
if ($mode == 'email') $property=$obj->email;
else if ($mode == 'mobile') $property=$obj->phone_mobile;
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." <".$property.">";
if(!empty($obj->poste)){
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." (".$obj->poste.")"." <".$property.">";
}
else
{
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." <".$property.">";
}
$i++;
}
}