Fix: missing contacts with order to invoice
This commit is contained in:
parent
733350f2b8
commit
3871f3a6dd
@ -38,8 +38,12 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php');
|
||||||
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php');
|
if ($conf->projet->enabled)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php');
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
//print 'ee'.$langs->trans('BillsCustomer');exit;
|
//print 'ee'.$langs->trans('BillsCustomer');exit;
|
||||||
|
|||||||
@ -253,6 +253,32 @@ class Facture extends CommonObject
|
|||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO mutualiser
|
||||||
|
if ($origin == 'commande')
|
||||||
|
{
|
||||||
|
// On recupere les differents contact interne et externe
|
||||||
|
$order = new Commande($this->db);
|
||||||
|
$order->id = $origin_id;
|
||||||
|
|
||||||
|
// On recupere le commercial suivi propale
|
||||||
|
$this->userid = $order->getIdcontact('internal', 'SALESREPFOLL');
|
||||||
|
|
||||||
|
if ($this->userid)
|
||||||
|
{
|
||||||
|
//On passe le commercial suivi commande en commercial suivi paiement
|
||||||
|
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
|
||||||
|
}
|
||||||
|
|
||||||
|
// On recupere le contact client facturation commande
|
||||||
|
$this->contactid = $order->getIdcontact('external', 'BILLING');
|
||||||
|
|
||||||
|
if ($this->contactid)
|
||||||
|
{
|
||||||
|
//On passe le contact client facturation commande en contact client facturation
|
||||||
|
$this->add_contact($this->contactid[0], 'BILLING', 'external');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user