Merge branch '3.1' of ssh://git@github.com/Dolibarr/dolibarr.git into 3.1
This commit is contained in:
commit
daf4ef87f2
@ -700,35 +700,35 @@ class Commande extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->ref="(PROV".$this->id.")";
|
$this->ref="(PROV".$this->id.")";
|
||||||
|
|
||||||
// Add linked object
|
// Add linked object and contacts
|
||||||
if ($this->origin && $this->origin_id)
|
if ($this->origin && $this->origin_id)
|
||||||
{
|
{
|
||||||
$ret = $this->add_object_linked();
|
$ret = $this->add_object_linked();
|
||||||
if (! $ret) dol_print_error($this->db);
|
if (! $ret) dol_print_error($this->db);
|
||||||
}
|
|
||||||
|
// TODO mutualiser
|
||||||
// TODO mutualiser
|
if ($this->origin == 'propal')
|
||||||
if ($this->origin == 'propal' && $this->origin_id)
|
{
|
||||||
{
|
// On recupere les differents contact interne et externe
|
||||||
// On recupere les differents contact interne et externe
|
$prop = new Propal($this->db, $this->socid, $this->origin_id);
|
||||||
$prop = new Propal($this->db, $this->socid, $this->origin_id);
|
|
||||||
|
// On recupere le commercial suivi propale
|
||||||
// On recupere le commercial suivi propale
|
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
|
||||||
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
|
|
||||||
|
if ($this->userid)
|
||||||
if ($this->userid)
|
{
|
||||||
{
|
//On passe le commercial suivi propale en commercial suivi commande
|
||||||
//On passe le commercial suivi propale en commercial suivi commande
|
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
|
||||||
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
|
}
|
||||||
}
|
|
||||||
|
// On recupere le contact client suivi propale
|
||||||
// On recupere le contact client suivi propale
|
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
|
||||||
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
|
|
||||||
|
if ($this->contactid)
|
||||||
if ($this->contactid)
|
{
|
||||||
{
|
//On passe le contact client suivi propale en contact client suivi commande
|
||||||
//On passe le contact client suivi propale en contact client suivi commande
|
$this->add_contact($this->contactid[0], 'CUSTOMER', 'external');
|
||||||
$this->add_contact($this->contactid[0], 'CUSTOMER', 'external');
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1190,6 +1190,9 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
|
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
|
||||||
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
|
||||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
|
||||||
|
|
||||||
|
$note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : ''));
|
||||||
|
$note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : '');
|
||||||
|
|
||||||
// Object source contacts list
|
// Object source contacts list
|
||||||
$srccontactslist = $objectsrc->liste_contact(-1,'external',1);
|
$srccontactslist = $objectsrc->liste_contact(-1,'external',1);
|
||||||
@ -1327,8 +1330,8 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
|
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td valign="top" colspan="2">';
|
||||||
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
|
||||||
print '</textarea></td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Note privee
|
// Note privee
|
||||||
if (! $user->societe_id)
|
if (! $user->societe_id)
|
||||||
@ -1336,8 +1339,8 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
|
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td valign="top" colspan="2">';
|
||||||
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
|
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
|
||||||
print '</textarea></td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($objectsrc))
|
if (is_object($objectsrc))
|
||||||
|
|||||||
@ -38,8 +38,12 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/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.'/lib/project.lib.php');
|
if ($conf->projet->enabled)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
|
||||||
|
require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load('bills');
|
$langs->load('bills');
|
||||||
//print 'ee'.$langs->trans('BillsCustomer');exit;
|
//print 'ee'.$langs->trans('BillsCustomer');exit;
|
||||||
|
|||||||
@ -275,6 +275,32 @@ class Facture extends CommonObject
|
|||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO mutualiser
|
||||||
|
if ($this->origin == 'commande')
|
||||||
|
{
|
||||||
|
// On recupere les differents contact interne et externe
|
||||||
|
$order = new Commande($this->db);
|
||||||
|
$order->id = $this->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');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1194,7 +1194,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $html->load_tva('tva_tx',$line->tva_tx);
|
print $form->load_tva('tva_tx',$line->tva_tx,$soc,$mysoc);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right"><input size="5" type="text" name="pu" value="'.price($line->subprice).'"></td>';
|
print '<td align="right"><input size="5" type="text" name="pu" value="'.price($line->subprice).'"></td>';
|
||||||
print '<td align="right"><input size="2" type="text" name="qty" value="'.$line->qty.'"></td>';
|
print '<td align="right"><input size="2" type="text" name="qty" value="'.$line->qty.'"></td>';
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class mailing_contacts3 extends MailingTargets
|
|||||||
$sql.= " AND sp.entity = ".$conf->entity;
|
$sql.= " AND sp.entity = ".$conf->entity;
|
||||||
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
|
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
|
||||||
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_societe = sp.fk_soc";
|
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_societe = sp.fk_soc";
|
||||||
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db>escape($filtersarray[0])."'";
|
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'";
|
||||||
$sql.= " ORDER BY sp.name, sp.firstname";
|
$sql.= " ORDER BY sp.name, sp.firstname";
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user