Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
fa77bf9d5b
@ -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/invoice.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->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php');
|
||||
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.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');
|
||||
//print 'ee'.$langs->trans('BillsCustomer');exit;
|
||||
@ -739,6 +743,7 @@ if ($action == 'add' && $user->rights->facture->creer)
|
||||
if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; }
|
||||
if ($element == 'contract') { $element = $subelement = 'contrat'; }
|
||||
if ($element == 'inter') { $element = $subelement = 'ficheinter'; }
|
||||
if ($element == 'shipping') {$element = $subelement = 'expedition'; }
|
||||
|
||||
$object->origin = $_POST['origin'];
|
||||
$object->origin_id = $_POST['originid'];
|
||||
|
||||
@ -253,6 +253,32 @@ class Facture extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
$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');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -30,6 +30,11 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
require('../../main.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/genericobject.class.php");
|
||||
|
||||
$field = GETPOST('field','alpha');
|
||||
$element = GETPOST('element','alpha');
|
||||
$table_element = GETPOST('table_element','alpha');
|
||||
$fk_element = GETPOST('fk_element','alpha');
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -39,18 +44,12 @@ top_httphead();
|
||||
//print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
|
||||
|
||||
// Load original field value
|
||||
if((isset($_GET['field']) && ! empty($_GET['field']))
|
||||
&& (isset($_GET['element']) && ! empty($_GET['element']))
|
||||
&& (isset($_GET['table_element']) && ! empty($_GET['table_element']))
|
||||
&& (isset($_GET['fk_element']) && ! empty($_GET['fk_element'])))
|
||||
if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($fk_element))
|
||||
{
|
||||
$element = GETPOST('element','alpha');
|
||||
$table_element = GETPOST('table_element','alpha');
|
||||
$fk_element = GETPOST('fk_element','alpha');
|
||||
$ext_element = GETPOST('ext_element','alpha');
|
||||
$field = substr(GETPOST('field','alpha'), 8); // remove prefix val_
|
||||
$type = GETPOST('type','alpha');
|
||||
$loadmethod = (GETPOST('loadmethod','alpha') ? GETPOST('loadmethod','alpha') : 'getValueFrom');
|
||||
$ext_element = GETPOST('ext_element','alpha');
|
||||
$field = substr($field, 8); // remove prefix val_
|
||||
$type = GETPOST('type','alpha');
|
||||
$loadmethod = (GETPOST('loadmethod','alpha') ? GETPOST('loadmethod','alpha') : 'getValueFrom');
|
||||
|
||||
if ($element != 'order_supplier' && $element != 'invoice_supplier' && preg_match('/^([^_]+)_([^_]+)/i',$element,$regs))
|
||||
{
|
||||
@ -78,7 +77,7 @@ if((isset($_GET['field']) && ! empty($_GET['field']))
|
||||
if ($type == 'select')
|
||||
{
|
||||
$methodname = 'load_cache_'.$loadmethod;
|
||||
$cachename = 'cache_'.GETPOST('loadmethod');
|
||||
$cachename = 'cache_'.GETPOST('loadmethod','alpha');
|
||||
|
||||
$form = new Form($db);
|
||||
if (method_exists($form, $methodname))
|
||||
|
||||
@ -30,6 +30,11 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
require('../../main.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/genericobject.class.php");
|
||||
|
||||
$field = GETPOST('field','alpha');
|
||||
$element = GETPOST('element','alpha');
|
||||
$table_element = GETPOST('table_element','alpha');
|
||||
$fk_element = GETPOST('fk_element','alpha');
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -40,16 +45,10 @@ top_httphead();
|
||||
//print_r($_POST);
|
||||
|
||||
// Load original field value
|
||||
if((isset($_POST['field']) && ! empty($_POST['field']))
|
||||
&& (isset($_POST['element']) && ! empty($_POST['element']))
|
||||
&& (isset($_POST['table_element']) && ! empty($_POST['table_element']))
|
||||
&& (isset($_POST['fk_element']) && ! empty($_POST['fk_element'])))
|
||||
if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($fk_element))
|
||||
{
|
||||
$element = GETPOST('element','alpha');
|
||||
$table_element = GETPOST('table_element','alpha');
|
||||
$fk_element = GETPOST('fk_element','alpha');
|
||||
$ext_element = GETPOST('ext_element','alpha');
|
||||
$field = substr(GETPOST('field','alpha'), 8); // remove prefix val_
|
||||
$field = substr($field, 8); // remove prefix val_
|
||||
$value = GETPOST('value','alpha');
|
||||
$type = GETPOST('type','alpha');
|
||||
$savemethod = GETPOST('savemethod','alpha');
|
||||
@ -99,15 +98,15 @@ if((isset($_POST['field']) && ! empty($_POST['field']))
|
||||
}
|
||||
else if ($type == 'datepicker')
|
||||
{
|
||||
$timestamp = GETPOST('timestamp');
|
||||
$timestamp = GETPOST('timestamp','int');
|
||||
$format = 'date';
|
||||
$newvalue = ($timestamp / 1000);
|
||||
}
|
||||
else if ($type == 'select')
|
||||
{
|
||||
$loadmethodname = 'load_cache_'.GETPOST('loadmethod');
|
||||
$loadcachename = 'cache_'.GETPOST('loadmethod');
|
||||
$loadviewname = 'view_'.GETPOST('loadmethod');
|
||||
$loadmethodname = 'load_cache_'.GETPOST('loadmethod','alpha');
|
||||
$loadcachename = 'cache_'.GETPOST('loadmethod','alpha');
|
||||
$loadviewname = 'view_'.GETPOST('loadmethod','alpha');
|
||||
|
||||
$form = new Form($db);
|
||||
if (method_exists($form, $loadmethodname))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user