Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
b169f93abc
@ -628,12 +628,6 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||||
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
||||||
|
|
||||||
if ($id == 2) // Special cas for state page
|
|
||||||
{
|
|
||||||
if ($fieldlist[$field]=='region_id') { $valuetoshow=' '; $showfield=1; }
|
|
||||||
if ($fieldlist[$field]=='region') { $valuetoshow=$langs->trans("Country").'/'.$langs->trans("Region"); $showfield=1; }
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($valuetoshow != '')
|
if ($valuetoshow != '')
|
||||||
{
|
{
|
||||||
print '<td align="'.$align.'">';
|
print '<td align="'.$align.'">';
|
||||||
@ -674,37 +668,16 @@ if ($id)
|
|||||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
|
||||||
if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit')
|
|
||||||
{
|
|
||||||
fieldList($fieldlist,$obj,$tabname[$id],'hide');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
fieldList($fieldlist,$obj,$tabname[$id],'add');
|
fieldList($fieldlist,$obj,$tabname[$id],'add');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
print '<td colspan="4" align="right">';
|
print '<td colspan="4" align="right">';
|
||||||
if ($tabname[$id] != MAIN_DB_PREFIX.'c_email_templates' || $action != 'edit')
|
|
||||||
{
|
|
||||||
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates')
|
|
||||||
{
|
|
||||||
print '<tr><td colspan="8">* '.$langs->trans("AvailableVariables").": ";
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
|
||||||
$formmail=new FormMail($db);
|
|
||||||
$tmp=$formmail->getAvailableSubstitKey('form');
|
|
||||||
print implode(', ', $tmp);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$colspan=count($fieldlist)+3;
|
$colspan=count($fieldlist)+3;
|
||||||
if ($id == 4) $colspan++;
|
|
||||||
|
|
||||||
if (! empty($alabelisused)) // If there is one label among fields, we show legend of *
|
if (! empty($alabelisused)) // If there is one label among fields, we show legend of *
|
||||||
{
|
{
|
||||||
@ -1175,7 +1148,7 @@ $db->close();
|
|||||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
global $form;
|
global $form, $mysoc;
|
||||||
global $region_id;
|
global $region_id;
|
||||||
global $elementList,$sourceList,$localtax_typeList;
|
global $elementList,$sourceList,$localtax_typeList;
|
||||||
global $bc;
|
global $bc;
|
||||||
@ -1197,7 +1170,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
|||||||
} // For state page, we do not show the country input (we link to region, not country)
|
} // For state page, we do not show the country input (we link to region, not country)
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$fieldname='country';
|
$fieldname='country';
|
||||||
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:$mysoc->country_code)), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'country_id')
|
elseif ($fieldlist[$field] == 'country_id')
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||||
@ -1929,6 +1929,7 @@ class Adherent extends CommonObject
|
|||||||
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
||||||
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
|
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
|
||||||
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||||
|
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // md5 for OpenLdap TODO add type of encryption
|
||||||
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
||||||
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
||||||
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
||||||
|
|||||||
@ -248,6 +248,7 @@ class Categories extends DolibarrApi
|
|||||||
if( ! count($obj_ret)) {
|
if( ! count($obj_ret)) {
|
||||||
throw new RestException(404, 'No category found');
|
throw new RestException(404, 'No category found');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj_ret;
|
return $obj_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,8 +352,46 @@ class Categories extends DolibarrApi
|
|||||||
|
|
||||||
$object = parent::_cleanObjectDatas($object);
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
// Remove the subscriptions because they are handled as a subresource.
|
// Remove fields not relevent to categories
|
||||||
//unset($object->subscriptions);
|
unset($object->country);
|
||||||
|
unset($object->country_id);
|
||||||
|
unset($object->country_code);
|
||||||
|
unset($object->total_ht);
|
||||||
|
unset($object->total_ht);
|
||||||
|
unset($object->total_localtax1);
|
||||||
|
unset($object->total_localtax2);
|
||||||
|
unset($object->total_ttc);
|
||||||
|
unset($object->total_tva);
|
||||||
|
unset($object->lines);
|
||||||
|
unset($object->fk_incoterms);
|
||||||
|
unset($object->libelle_incoterms);
|
||||||
|
unset($object->location_incoterms);
|
||||||
|
unset($object->civility_id);
|
||||||
|
unset($object->name);
|
||||||
|
unset($object->lastname);
|
||||||
|
unset($object->firstname);
|
||||||
|
unset($object->shipping_method_id);
|
||||||
|
unset($object->fk_delivery_address);
|
||||||
|
unset($object->cond_reglement);
|
||||||
|
unset($object->cond_reglement_id);
|
||||||
|
unset($object->mode_reglement_id);
|
||||||
|
unset($object->barcode_type_coder);
|
||||||
|
unset($object->barcode_type_label);
|
||||||
|
unset($object->barcode_type_code);
|
||||||
|
unset($object->barcode_type);
|
||||||
|
unset($object->canvas);
|
||||||
|
unset($object->cats);
|
||||||
|
unset($object->motherof);
|
||||||
|
unset($object->context);
|
||||||
|
unset($object->socid);
|
||||||
|
unset($object->thirdparty);
|
||||||
|
unset($object->contact);
|
||||||
|
unset($object->contact_id);
|
||||||
|
unset($object->user);
|
||||||
|
unset($object->fk_account);
|
||||||
|
unset($object->fk_project);
|
||||||
|
unset($object->note);
|
||||||
|
unset($object->statut);
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -291,7 +291,7 @@ class CategoryApi extends DolibarrApi
|
|||||||
* @url GET /customer/{cusid}/categories
|
* @url GET /customer/{cusid}/categories
|
||||||
*/
|
*/
|
||||||
function getListCustomerCategories($cusid, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getListCustomerCategories($cusid, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
return $this->getListForItem('customer', $sortfield, $sortorder, $limit, $page, $cusid);
|
return $this->getListForItem($sortfield, $sortorder, $limit, $page, 'customer', $cusid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -64,6 +64,7 @@ $langs->load('propal');
|
|||||||
$langs->load('deliveries');
|
$langs->load('deliveries');
|
||||||
$langs->load('sendings');
|
$langs->load('sendings');
|
||||||
$langs->load('products');
|
$langs->load('products');
|
||||||
|
$langs->load('other');
|
||||||
if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
|
if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
|
||||||
if (! empty($conf->margin->enabled)) $langs->load('margins');
|
if (! empty($conf->margin->enabled)) $langs->load('margins');
|
||||||
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
|
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
|
||||||
@ -2054,7 +2055,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
print $object->date ? dol_print_date($object->date, 'daytext') : ' ';
|
print $object->date ? dol_print_date($object->date, 'day') : ' ';
|
||||||
if ($object->hasDelay() && empty($object->date_livraison)) {
|
if ($object->hasDelay() && empty($object->date_livraison)) {
|
||||||
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
|
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,6 +53,8 @@ if (! $object->fetch($id, $ref) > 0)
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
|
llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes');
|
||||||
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -122,7 +122,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
|||||||
}
|
}
|
||||||
if (isset($_POST['orders_to_invoice']))
|
if (isset($_POST['orders_to_invoice']))
|
||||||
{
|
{
|
||||||
$orders_id = GETPOST('orders_to_invoice','',1);
|
$orders_id = GETPOST('orders_to_invoice','',2);
|
||||||
$nn = count($orders_id);
|
$nn = count($orders_id);
|
||||||
$ii = 0;
|
$ii = 0;
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,7 @@ $search_dv_end = dol_mktime(0, 0, 0, GETPOST('search_end_dvmonth', 'int'), GETPO
|
|||||||
$search_thirdparty=GETPOST("thirdparty",'alpha');
|
$search_thirdparty=GETPOST("thirdparty",'alpha');
|
||||||
$search_req_nb=GETPOST("req_nb",'alpha');
|
$search_req_nb=GETPOST("req_nb",'alpha');
|
||||||
$search_num_releve=GETPOST("search_num_releve",'alpha');
|
$search_num_releve=GETPOST("search_num_releve",'alpha');
|
||||||
|
$search_conciliated=GETPOST("search_conciliated",'int');
|
||||||
$num_releve=GETPOST("num_releve");
|
$num_releve=GETPOST("num_releve");
|
||||||
$cat=GETPOST("cat");
|
$cat=GETPOST("cat");
|
||||||
|
|
||||||
@ -150,6 +151,7 @@ $arrayfields=array(
|
|||||||
'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605),
|
'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605),
|
||||||
'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>1000),
|
'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>1000),
|
||||||
'b.num_releve'=>array('label'=>$langs->trans("AccountStatement"), 'checked'=>1, 'position'=>1010),
|
'b.num_releve'=>array('label'=>$langs->trans("AccountStatement"), 'checked'=>1, 'position'=>1010),
|
||||||
|
'b.conciliated'=>array('label'=>$langs->trans("Conciliated"), 'enabled'=> $object->rappro, 'checked'=>($action == 'reconcile'?1:0), 'position'=>1020),
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
@ -190,6 +192,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
$search_req_nb='';
|
$search_req_nb='';
|
||||||
$search_thirdparty='';
|
$search_thirdparty='';
|
||||||
$search_num_releve='';
|
$search_num_releve='';
|
||||||
|
$search_conciliated='';
|
||||||
$thirdparty='';
|
$thirdparty='';
|
||||||
|
|
||||||
$account="";
|
$account="";
|
||||||
@ -444,7 +447,7 @@ else
|
|||||||
llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param);
|
llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq,";
|
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,";
|
||||||
$sql.= " b.fk_account, b.fk_type,";
|
$sql.= " b.fk_account, b.fk_type,";
|
||||||
$sql.= " ba.rowid as bankid, ba.ref as bankref,";
|
$sql.= " ba.rowid as bankid, ba.ref as bankref,";
|
||||||
$sql.= " bu.url_id,";
|
$sql.= " bu.url_id,";
|
||||||
@ -474,6 +477,7 @@ if (dol_strlen($search_dv_end)>0) $sql .= " AND b.datev <= '" . $db->idate($sear
|
|||||||
if ($search_ref) $sql.=natural_search("b.rowid", $search_ref);
|
if ($search_ref) $sql.=natural_search("b.rowid", $search_ref);
|
||||||
if ($search_req_nb) $sql.= natural_search("b.num_chq", $search_req_nb);
|
if ($search_req_nb) $sql.= natural_search("b.num_chq", $search_req_nb);
|
||||||
if ($search_num_releve) $sql.= natural_search("b.num_releve", $search_num_releve);
|
if ($search_num_releve) $sql.= natural_search("b.num_releve", $search_num_releve);
|
||||||
|
if ($search_conciliated != '' && $search_conciliated != '-1') $sql.= " AND b.rappro = ".$search_conciliated;
|
||||||
if ($search_thirdparty) $sql.= natural_search("s.nom", $search_thirdparty);
|
if ($search_thirdparty) $sql.= natural_search("s.nom", $search_thirdparty);
|
||||||
if ($description) $sql.= natural_search("b.label", $description); // Warning some text are just translation keys, not translated strings
|
if ($description) $sql.= natural_search("b.label", $description); // Warning some text are just translation keys, not translated strings
|
||||||
if ($bid) $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid;
|
if ($bid) $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid;
|
||||||
@ -776,6 +780,7 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['b.credit']['checked'])) print_liste_field_titre($arrayfields['b.credit']['label'],$_SERVER['PHP_SELF'],'b.amount','',$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'],$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'],$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['b.num_releve']['checked'])) print_liste_field_titre($arrayfields['b.num_releve']['label'],$_SERVER['PHP_SELF'],'b.num_releve','',$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['b.conciliated']['checked'])) print_liste_field_titre($arrayfields['b.conciliated']['label'],$_SERVER['PHP_SELF'],'b.rappro','',$param,'align="center"',$sortfield,$sortorder);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -857,11 +862,18 @@ if ($resql)
|
|||||||
print $form->textwithpicto('', $htmltext, 1);
|
print $form->textwithpicto('', $htmltext, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Numero statement
|
||||||
if (! empty($arrayfields['b.num_releve']['checked']))
|
if (! empty($arrayfields['b.num_releve']['checked']))
|
||||||
{
|
{
|
||||||
// Numero statement
|
|
||||||
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_num_releve" value="'.dol_escape_htmltag($search_num_releve).'" size="3"></td>';
|
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_num_releve" value="'.dol_escape_htmltag($search_num_releve).'" size="3"></td>';
|
||||||
}
|
}
|
||||||
|
// Conciliated
|
||||||
|
if (! empty($arrayfields['b.conciliated']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre" align="center">';
|
||||||
|
print $form->selectyesno('search_conciliated', $search_conciliated, 1, False, 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre" align="middle">';
|
print '<td class="liste_titre" align="middle">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre" align="middle">';
|
print '<td class="liste_titre" align="middle">';
|
||||||
@ -1207,7 +1219,7 @@ if ($resql)
|
|||||||
// Transaction reconciliated or edit link
|
// Transaction reconciliated or edit link
|
||||||
if ($bankaccount->canBeConciliated() > 0)
|
if ($bankaccount->canBeConciliated() > 0)
|
||||||
{
|
{
|
||||||
if ($objp->rappro) // If line not conciliated and account can be conciliated
|
if ($objp->conciliated) // If line not conciliated and account can be conciliated
|
||||||
{
|
{
|
||||||
print '<a href="releve.php?num='.$objp->num_releve.'&account='.$objp->bankid.'">'.$objp->num_releve.'</a>';
|
print '<a href="releve.php?num='.$objp->num_releve.'&account='.$objp->bankid.'">'.$objp->num_releve.'</a>';
|
||||||
}
|
}
|
||||||
@ -1220,10 +1232,18 @@ if ($resql)
|
|||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($arrayfields['b.conciliated']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="nowrap" align="center">';
|
||||||
|
print $objp->conciliated?$langs->trans("Yes"):$langs->trans("No");
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Action edit/delete
|
// Action edit/delete
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
// Transaction reconciliated or edit link
|
// Transaction reconciliated or edit link
|
||||||
if ($objp->rappro && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$objp->bankid.'&page='.$page.'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$objp->bankid.'&page='.$page.'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
@ -1243,7 +1263,7 @@ if ($resql)
|
|||||||
print img_view();
|
print img_view();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
if ($bankaccount->canBeConciliated() > 0 && empty($objp->rappro))
|
if ($bankaccount->canBeConciliated() > 0 && empty($objp->conciliated))
|
||||||
{
|
{
|
||||||
if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay))
|
if ($db->jdate($objp->dv) < ($now - $conf->bank->rappro->warning_delay))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -496,7 +496,7 @@ class Contrat extends CommonObject
|
|||||||
$sql.= " ref_supplier, ref_customer,";
|
$sql.= " ref_supplier, ref_customer,";
|
||||||
$sql.= " ref_ext,";
|
$sql.= " ref_ext,";
|
||||||
$sql.= " fk_user_mise_en_service, date_contrat as datecontrat,";
|
$sql.= " fk_user_mise_en_service, date_contrat as datecontrat,";
|
||||||
$sql.= " fk_user_author,";
|
$sql.= " fk_user_author, fin_validite, date_cloture,";
|
||||||
$sql.= " fk_projet,";
|
$sql.= " fk_projet,";
|
||||||
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
|
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
|
||||||
$sql.= " note_private, note_public, model_pdf, extraparams";
|
$sql.= " note_private, note_public, model_pdf, extraparams";
|
||||||
@ -527,6 +527,10 @@ class Contrat extends CommonObject
|
|||||||
$this->date_contrat = $this->db->jdate($result["datecontrat"]);
|
$this->date_contrat = $this->db->jdate($result["datecontrat"]);
|
||||||
$this->date_creation = $this->db->jdate($result["datecontrat"]);
|
$this->date_creation = $this->db->jdate($result["datecontrat"]);
|
||||||
|
|
||||||
|
$this->fin_validite = $this->db->jdate($result["fin_validite"]);
|
||||||
|
$this->date_cloture = $this->db->jdate($result["date_cloture"]);
|
||||||
|
|
||||||
|
|
||||||
$this->user_author_id = $result["fk_user_author"];
|
$this->user_author_id = $result["fk_user_author"];
|
||||||
|
|
||||||
$this->commercial_signature_id = $result["fk_commercial_signature"];
|
$this->commercial_signature_id = $result["fk_commercial_signature"];
|
||||||
|
|||||||
@ -209,7 +209,26 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
if (count($listofqualifiedinvoice) > 0)
|
if (count($listofqualifiedinvoice) > 0)
|
||||||
{
|
{
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
|
$fromtype = GETPOST('fromtype');
|
||||||
|
if ($fromtype === 'user') {
|
||||||
$from = $user->getFullName($langs) .' <'.$user->email.'>';
|
$from = $user->getFullName($langs) .' <'.$user->email.'>';
|
||||||
|
}
|
||||||
|
elseif ($fromtype === 'company') {
|
||||||
|
$from = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
|
||||||
|
}
|
||||||
|
elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
|
||||||
|
$tmp=explode(',', $user->email_aliases);
|
||||||
|
$from = trim($tmp[($reg[1] - 1)]);
|
||||||
|
}
|
||||||
|
elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) {
|
||||||
|
$tmp=explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES);
|
||||||
|
$from = trim($tmp[($reg[1] - 1)]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
|
||||||
|
}
|
||||||
|
|
||||||
$replyto = $from;
|
$replyto = $from;
|
||||||
$subject = GETPOST('subject');
|
$subject = GETPOST('subject');
|
||||||
$message = GETPOST('message');
|
$message = GETPOST('message');
|
||||||
|
|||||||
@ -157,7 +157,14 @@ class FormProjets
|
|||||||
$sql.= " WHERE p.entity IN (".getEntity('project', 1).")";
|
$sql.= " WHERE p.entity IN (".getEntity('project', 1).")";
|
||||||
if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||||
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
|
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
|
||||||
if ($socid > 0 && empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
|
if ($socid > 0)
|
||||||
|
{
|
||||||
|
if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
|
||||||
|
else if ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
|
||||||
|
{
|
||||||
|
$sql.= " AND (p.fk_soc IN (".$socid.", ".$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") OR p.fk_soc IS NULL)";
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!empty($filterkey)) {
|
if (!empty($filterkey)) {
|
||||||
$sql .= ' AND (';
|
$sql .= ' AND (';
|
||||||
$sql .= ' p.title LIKE "%'.$this->db->escape($filterkey).'%"';
|
$sql .= ' p.title LIKE "%'.$this->db->escape($filterkey).'%"';
|
||||||
|
|||||||
@ -107,27 +107,6 @@ class Interfaces
|
|||||||
|
|
||||||
$nbfile++;
|
$nbfile++;
|
||||||
|
|
||||||
$modName = "Interface".ucfirst($reg[3]);
|
|
||||||
//print "file=$file - modName=$modName\n";
|
|
||||||
if (in_array($modName,$modules))
|
|
||||||
{
|
|
||||||
$langs->load("errors");
|
|
||||||
dol_syslog(get_class($this)."::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger",$modName,"/htdocs/core/triggers/"), LOG_ERR);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
//print 'Todo for '.$modName." : ".$newdir.'/'.$file."\n";
|
|
||||||
include_once $newdir.'/'.$file;
|
|
||||||
//print 'Done for '.$modName."\n";
|
|
||||||
}
|
|
||||||
catch(Exception $e)
|
|
||||||
{
|
|
||||||
dol_syslog('ko for '.$modName." ".$e->getMessage()."\n", LOG_ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if trigger file is disabled by name
|
// Check if trigger file is disabled by name
|
||||||
if (preg_match('/NORUN$/i',$file)) continue;
|
if (preg_match('/NORUN$/i',$file)) continue;
|
||||||
// Check if trigger file is for a particular module
|
// Check if trigger file is for a particular module
|
||||||
@ -145,8 +124,28 @@ class Interfaces
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$modName = "Interface".ucfirst($reg[3]);
|
||||||
|
//print "file=$file - modName=$modName\n";
|
||||||
|
if (in_array($modName,$modules)) // $modules = list of modName already loaded
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
dol_syslog(get_class($this)."::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger", $newdir."/".$file, $fullpathfiles[$modName]), LOG_WARNING);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
//print 'Todo for '.$modName." : ".$newdir.'/'.$file."\n";
|
||||||
|
include_once $newdir.'/'.$file;
|
||||||
|
//print 'Done for '.$modName."\n";
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
dol_syslog('ko for '.$modName." ".$e->getMessage()."\n", LOG_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
$modules[$i] = $modName;
|
$modules[$i] = $modName;
|
||||||
$files[$i] = $file;
|
$files[$i] = $file;
|
||||||
|
$fullpathfiles[$modName] = $newdir.'/'.$file;
|
||||||
$orders[$i] = $part1.'_'.$part2.'_'.$part3; // Set sort criteria value
|
$orders[$i] = $part1.'_'.$part2.'_'.$part3; // Set sort criteria value
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -1572,6 +1572,7 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta
|
|||||||
function dol_check_secure_access_document($modulepart,$original_file,$entity,$fuser='',$refname='')
|
function dol_check_secure_access_document($modulepart,$original_file,$entity,$fuser='',$refname='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $db;
|
global $user, $conf, $db;
|
||||||
|
global $dolibarr_main_data_root;
|
||||||
|
|
||||||
if (! is_object($fuser)) $fuser=$user;
|
if (! is_object($fuser)) $fuser=$user;
|
||||||
|
|
||||||
@ -2044,7 +2045,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
|
|||||||
elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
|
elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
|
||||||
{
|
{
|
||||||
$accessallowed=1;
|
$accessallowed=1;
|
||||||
global $dolibarr_main_data_root;
|
|
||||||
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
|
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -635,7 +635,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
|
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
|
||||||
{
|
{
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
print '<td class="nowrap">';
|
print '<td class="tdoverflowmax100">';
|
||||||
$thirdpartystatic->id=$lines[$i]->socid;
|
$thirdpartystatic->id=$lines[$i]->socid;
|
||||||
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
|
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
|
||||||
print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
||||||
@ -839,10 +839,10 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
|||||||
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY))
|
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY))
|
||||||
{
|
{
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
print '<td class="nowrap">';
|
print '<td class="tdoverflowmax100">';
|
||||||
$thirdpartystatic->id=$lines[$i]->thirdparty_id;
|
$thirdpartystatic->id=$lines[$i]->thirdparty_id;
|
||||||
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
|
$thirdpartystatic->name=$lines[$i]->thirdparty_name;
|
||||||
print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
print $thirdpartystatic->getNomUrl(1, 'project');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -74,7 +74,7 @@ function dol_decode($chain)
|
|||||||
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt.
|
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt.
|
||||||
*
|
*
|
||||||
* @param string $chain String to hash
|
* @param string $chain String to hash
|
||||||
* @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0.
|
* @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5, 3:md5, 4:md5 for OpenLdap). Use 3 here, if hash is not needed for security purpose, for security need, prefer 0.
|
||||||
* @return string Hash of string
|
* @return string Hash of string
|
||||||
*/
|
*/
|
||||||
function dol_hash($chain,$type=0)
|
function dol_hash($chain,$type=0)
|
||||||
@ -87,6 +87,7 @@ function dol_hash($chain,$type=0)
|
|||||||
if ($type == 1) return sha1($chain);
|
if ($type == 1) return sha1($chain);
|
||||||
else if ($type == 2) return sha1(md5($chain));
|
else if ($type == 2) return sha1(md5($chain));
|
||||||
else if ($type == 3) return md5($chain);
|
else if ($type == 3) return md5($chain);
|
||||||
|
else if ($type == 4) return '{md5}'.base64_encode(mhash(MHASH_MD5,$chain)); // For OpenLdap with md5
|
||||||
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
|
||||||
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
|
||||||
|
|
||||||
|
|||||||
@ -1425,7 +1425,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$newmenu->add('/compta/bank/card.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
$newmenu->add('/compta/bank/card.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||||
if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
|
if ($objp->rappro && $objp->courant != Account::TYPE_CASH && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
|
||||||
{
|
{
|
||||||
$newmenu->add('/compta/bank/bankentries.php?id='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
$newmenu->add('/compta/bank/bankentries.php?action=reconcile&contextpage=banktransactionlist-'.$objp->rowid.'&account='.$objp->rowid.'&id='.$objp->rowid.'&search_conciliated=0',$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
@ -1744,10 +1744,10 @@ else if ($id || $ref)
|
|||||||
{
|
{
|
||||||
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
|
$sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
|
||||||
$sql.= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot";
|
$sql.= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot";
|
||||||
$sql.= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition,";
|
$sql.= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition";
|
||||||
//if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,";
|
//if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
|
||||||
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
|
$sql.= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch';
|
||||||
$sql.= ' p.description as product_desc';
|
$sql.= ', p.description as product_desc';
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
|
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
|
$sql.= ", ".MAIN_DB_PREFIX."expedition as e";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX.$origin."det as obj";
|
$sql.= ", ".MAIN_DB_PREFIX.$origin."det as obj";
|
||||||
|
|||||||
@ -329,7 +329,7 @@ class Export
|
|||||||
$szFilterQuery=" ".$NameField."='".$ValueField."'";
|
$szFilterQuery=" ".$NameField."='".$ValueField."'";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dol_syslog("Error we try to forge an sql export request with a condition on a field with type '".$InfoFieldList[0]."' (defined into module descriptor) but this type is unknown/not supported. It looks like a bug into module descriptor.", LOG_ERROR);
|
dol_syslog("Error we try to forge an sql export request with a condition on a field with type '".$InfoFieldList[0]."' (defined into module descriptor) but this type is unknown/not supported. It looks like a bug into module descriptor.", LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $szFilterQuery;
|
return $szFilterQuery;
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
||||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.0-alpha');
|
if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||||
|
|
||||||
if (! defined('EURO')) define('EURO',chr(128));
|
if (! defined('EURO')) define('EURO',chr(128));
|
||||||
|
|
||||||
|
|||||||
@ -350,10 +350,10 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||||
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||||
|
|
||||||
$this->special_code = $objp->special_code;
|
$line->special_code = $objp->special_code;
|
||||||
$this->fk_parent_line = $objp->fk_parent_line;
|
$line->fk_parent_line = $objp->fk_parent_line;
|
||||||
|
|
||||||
$this->rang = $objp->rang;
|
$line->rang = $objp->rang;
|
||||||
|
|
||||||
$this->lines[$i] = $line;
|
$this->lines[$i] = $line;
|
||||||
|
|
||||||
@ -1399,7 +1399,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if ($prod->fetch($fk_product) > 0)
|
if ($prod->fetch($fk_product) > 0)
|
||||||
{
|
{
|
||||||
$product_type = $prod->type;
|
$product_type = $prod->type;
|
||||||
$label = $prod->libelle;
|
$label = $prod->label;
|
||||||
|
|
||||||
// We use 'none' instead of $fourn_ref, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
|
// We use 'none' instead of $fourn_ref, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
|
||||||
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
|
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
|
||||||
@ -1506,7 +1506,6 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->line->product_type=$product_type;
|
$this->line->product_type=$product_type;
|
||||||
$this->line->remise_percent=$remise_percent;
|
$this->line->remise_percent=$remise_percent;
|
||||||
$this->line->subprice=$pu_ht;
|
$this->line->subprice=$pu_ht;
|
||||||
$this->line->rang=$this->rang;
|
|
||||||
$this->line->info_bits=$info_bits;
|
$this->line->info_bits=$info_bits;
|
||||||
|
|
||||||
$this->line->vat_src_code=$vat_src_code;
|
$this->line->vat_src_code=$vat_src_code;
|
||||||
@ -3099,7 +3098,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_unit,";
|
$sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_unit,";
|
||||||
$sql.= " fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc";
|
$sql.= " fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
$sql.= " VALUES (".$this->fk_commande.", '" . $this->db->escape($this->product_label) . "','" . $this->db->escape($this->desc) . "',";
|
$sql.= " VALUES (".$this->fk_commande.", '" . $this->db->escape($this->label) . "','" . $this->db->escape($this->desc) . "',";
|
||||||
$sql.= " ".($this->date_start?"'".$this->db->idate($this->date_start)."'":"null").",";
|
$sql.= " ".($this->date_start?"'".$this->db->idate($this->date_start)."'":"null").",";
|
||||||
$sql.= " ".($this->date_end?"'".$this->db->idate($this->date_end)."'":"null").",";
|
$sql.= " ".($this->date_end?"'".$this->db->idate($this->date_end)."'":"null").",";
|
||||||
if ($this->fk_product) { $sql.= $this->fk_product.","; }
|
if ($this->fk_product) { $sql.= $this->fk_product.","; }
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
@ -116,7 +116,7 @@ if (($action == 'create' || $action == 'add') && ! $error) {
|
|||||||
$_GET['originid'] = $orders_id[0];
|
$_GET['originid'] = $orders_id[0];
|
||||||
}
|
}
|
||||||
if (isset($_POST['orders_to_invoice'])) {
|
if (isset($_POST['orders_to_invoice'])) {
|
||||||
$orders_id = GETPOST('orders_to_invoice','',1);
|
$orders_id = GETPOST('orders_to_invoice','',2);
|
||||||
$nn = count($orders_id);
|
$nn = count($orders_id);
|
||||||
$ii = 0;
|
$ii = 0;
|
||||||
|
|
||||||
|
|||||||
@ -255,6 +255,10 @@ ALTER TABLE llx_contrat ADD COLUMN fk_user_modif integer;
|
|||||||
|
|
||||||
UPDATE llx_accounting_account set account_parent = 0 where account_parent = '';
|
UPDATE llx_accounting_account set account_parent = 0 where account_parent = '';
|
||||||
|
|
||||||
|
-- VMYSQL4.3 ALTER TABLE llx_product_price MODIFY COLUMN date_price DATETIME NULL;
|
||||||
|
-- VPGSQL8.2 ALTER TABLE llx_product_price ALTER COLUMN date_price DROP NOT NULL;
|
||||||
|
ALTER TABLE llx_product_price ALTER COLUMN date_price SET DEFAULT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_product_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
ALTER TABLE llx_product_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
||||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10) after tva_tx;
|
||||||
|
|
||||||
|
|||||||
@ -401,7 +401,7 @@ LeopardNumRefModelDesc=The code is free. This code can be modified at any time.
|
|||||||
ManagingDirectors=Manager(s) name (CEO, director, president...)
|
ManagingDirectors=Manager(s) name (CEO, director, president...)
|
||||||
MergeOriginThirdparty=Duplicate third party (third party you want to delete)
|
MergeOriginThirdparty=Duplicate third party (third party you want to delete)
|
||||||
MergeThirdparties=Merge third parties
|
MergeThirdparties=Merge third parties
|
||||||
ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one? All linked objects (invoices, orders, ...) will be moved to current third party so you will be able to delete the duplicate one.
|
ConfirmMergeThirdparties=Are you sure you want to merge this third party into the current one? All linked objects (invoices, orders, ...) will be moved to current third party, then the thirdparty will be deleted.
|
||||||
ThirdpartiesMergeSuccess=Thirdparties have been merged
|
ThirdpartiesMergeSuccess=Thirdparties have been merged
|
||||||
SaleRepresentativeLogin=Login of sales representative
|
SaleRepresentativeLogin=Login of sales representative
|
||||||
SaleRepresentativeFirstname=First name of sales representative
|
SaleRepresentativeFirstname=First name of sales representative
|
||||||
|
|||||||
@ -184,6 +184,7 @@ ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter tim
|
|||||||
ErrorTaskAlreadyAssigned=Task already assigned to user
|
ErrorTaskAlreadyAssigned=Task already assigned to user
|
||||||
ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format.
|
ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format.
|
||||||
ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (<strong>%s</strong>) does not match expected name syntax: <strong>%s</strong>
|
ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (<strong>%s</strong>) does not match expected name syntax: <strong>%s</strong>
|
||||||
|
ErrorDuplicateTrigger=Error, duplicate trigger name %s. Already loaded from %s.
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
|
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
|
||||||
|
|||||||
@ -264,7 +264,7 @@ class Products extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
$categories = new Categories();
|
$categories = new Categories();
|
||||||
return $categories->getListForItem('product', $sortfield, $sortorder, $limit, $page, $id);
|
return $categories->getListForItem($sortfield, $sortorder, $limit, $page, 'product', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -415,11 +415,11 @@ if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
|
|||||||
{
|
{
|
||||||
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||||
}
|
}
|
||||||
print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>';
|
print '<td align="right" class="maxwidth100">'.$langs->trans("PlannedWorkload").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
|
print '<td align="right" class="maxwidth100">'.$langs->trans("ProgressDeclared").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpent").'</td>';
|
||||||
if ($usertoprocess->id == $user->id) print '<td align="right">'.$langs->trans("TimeSpentByYou").'</td>';
|
if ($usertoprocess->id == $user->id) print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpentByYou").'</td>';
|
||||||
else print '<td align="right">'.$langs->trans("TimeSpentByUser").'</td>';
|
else print '<td align="right" class="maxwidth100">'.$langs->trans("TimeSpentByUser").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("HourStart").'</td>';
|
print '<td align="center">'.$langs->trans("HourStart").'</td>';
|
||||||
print '<td align="center" colspan="2">'.$langs->trans("Duration").'</td>';
|
print '<td align="center" colspan="2">'.$langs->trans("Duration").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("Note").'</td>';
|
print '<td align="right">'.$langs->trans("Note").'</td>';
|
||||||
|
|||||||
@ -262,7 +262,7 @@ if ($action == 'addtime' && $user->rights->projet->lire)
|
|||||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||||
|
|
||||||
// Redirect to avoid submit twice on back
|
// Redirect to avoid submit twice on back
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].($projectid?'?id='.$projectid:'?').($mode?'&mode='.$mode:''));
|
header('Location: '.$_SERVER["PHP_SELF"].($projectid?'?id='.$projectid:'?').($mode?'&mode='.$mode:'').($day?'&day='.$day:'').($month?'&month='.$month:'').($year?'&year='.$year:''));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -410,17 +410,17 @@ if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY))
|
|||||||
{
|
{
|
||||||
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||||
}
|
}
|
||||||
print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>';
|
print '<td align="right" class="maxwidth75">'.$langs->trans("PlannedWorkload").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
|
print '<td align="right" class="maxwidth75">'.$langs->trans("ProgressDeclared").'</td>';
|
||||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpent").'</td>';
|
||||||
if ($usertoprocess->id == $user->id) print '<td align="right">'.$langs->trans("TimeSpentByYou").'</td>';
|
if ($usertoprocess->id == $user->id) print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpentByYou").'</td>';
|
||||||
else print '<td align="right">'.$langs->trans("TimeSpentByUser").'</td>';
|
else print '<td align="right" class="maxwidth75">'.$langs->trans("TimeSpentByUser").'</td>';
|
||||||
|
|
||||||
$startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']);
|
$startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']);
|
||||||
|
|
||||||
for($i=0;$i<7;$i++)
|
for($i=0;$i<7;$i++)
|
||||||
{
|
{
|
||||||
print '<td width="7%" align="center" class="hide'.$i.'">'.dol_print_date($startday + ($i * 3600 * 24), '%a').'<br>'.dol_print_date($startday + ($i * 3600 * 24), 'dayreduceformat').'</td>';
|
print '<td width="6%" align="center" class="hide'.$i.'">'.dol_print_date($startday + ($i * 3600 * 24), '%a').'<br>'.dol_print_date($startday + ($i * 3600 * 24), 'dayreduceformat').'</td>';
|
||||||
}
|
}
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -462,13 +462,13 @@ if (count($tasksarray) > 0)
|
|||||||
|
|
||||||
print '<tr class="liste_total">
|
print '<tr class="liste_total">
|
||||||
<td class="liste_total" colspan="'.$colspan.'" align="right">'.$langs->trans("Total").'</td>
|
<td class="liste_total" colspan="'.$colspan.'" align="right">'.$langs->trans("Total").'</td>
|
||||||
<td class="liste_total hide0" width="7%" align="center"><div id="totalDay[0]"> </div></td>
|
<td class="liste_total hide0" align="center"><div id="totalDay[0]"> </div></td>
|
||||||
<td class="liste_total hide1" width="7%" align="center"><div id="totalDay[1]"> </div></td>
|
<td class="liste_total hide1" align="center"><div id="totalDay[1]"> </div></td>
|
||||||
<td class="liste_total hide2" width="7%" align="center"><div id="totalDay[2]"> </div></td>
|
<td class="liste_total hide2" align="center"><div id="totalDay[2]"> </div></td>
|
||||||
<td class="liste_total hide3" width="7%" align="center"><div id="totalDay[3]"> </div></td>
|
<td class="liste_total hide3" align="center"><div id="totalDay[3]"> </div></td>
|
||||||
<td class="liste_total hide4" width="7%" align="center"><div id="totalDay[4]"> </div></td>
|
<td class="liste_total hide4" align="center"><div id="totalDay[4]"> </div></td>
|
||||||
<td class="liste_total hide5" width="7%" align="center"><div id="totalDay[5]"> </div></td>
|
<td class="liste_total hide5" align="center"><div id="totalDay[5]"> </div></td>
|
||||||
<td class="liste_total hide6" width="7%" align="center"><div id="totalDay[6]"> </div></td>
|
<td class="liste_total hide6" align="center"><div id="totalDay[6]"> </div></td>
|
||||||
<td class="liste_total"></td>
|
<td class="liste_total"></td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -318,7 +318,7 @@ class Contacts extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
$categories = new Categories();
|
$categories = new Categories();
|
||||||
return $categories->getListForItem('contact', $sortfield, $sortorder, $limit, $page, $id);
|
return $categories->getListForItem($sortfield, $sortorder, $limit, $page, 'contact', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -267,7 +267,7 @@ class Thirdparties extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
|
||||||
$categories = new Categories();
|
$categories = new Categories();
|
||||||
return $categories->getListForItem('customer', $sortfield, $sortorder, $limit, $page, $id);
|
return $categories->getListForItem($sortfield, $sortorder, $limit, $page, 'customer', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -70,7 +70,7 @@ class CompanyBankAccount extends Account
|
|||||||
function create(User $user = null, $notrigger=0)
|
function create(User $user = null, $notrigger=0)
|
||||||
{
|
{
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
$error = 0;
|
||||||
// Correct default_rib to be sure to have always one default
|
// Correct default_rib to be sure to have always one default
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".$this->socid." AND default_rib = 1";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".$this->socid." AND default_rib = 1";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -89,8 +89,30 @@ class CompanyBankAccount extends Account
|
|||||||
if ($this->db->affected_rows($resql))
|
if ($this->db->affected_rows($resql))
|
||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_rib");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."societe_rib");
|
||||||
|
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$result=$this->call_trigger('COMPANY_RIB_CREATE',$user);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
|
||||||
|
if(! $error )
|
||||||
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -123,15 +123,14 @@ if (empty($reshook))
|
|||||||
$soc_origin_id = GETPOST('soc_origin', 'int');
|
$soc_origin_id = GETPOST('soc_origin', 'int');
|
||||||
$soc_origin = new Societe($db);
|
$soc_origin = new Societe($db);
|
||||||
|
|
||||||
if ($soc_origin_id < 1)
|
if ($soc_origin_id <= 0)
|
||||||
{
|
{
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
$langs->load('companies');
|
$langs->load('companies');
|
||||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->trans('MergeOriginThirdparty')), null, 'errors');
|
setEventMessages($langs->trans('ErrorThirdPartyIdIsMandatory', $langs->trans('MergeOriginThirdparty')), null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$errors && $soc_origin->fetch($soc_origin_id) < 1)
|
if (!$errors && $soc_origin->fetch($soc_origin_id) < 1)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
|
setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
|
||||||
@ -140,8 +139,44 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (!$errors)
|
if (!$errors)
|
||||||
{
|
{
|
||||||
|
// TODO Move the merge function into class of object.
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
// Recopy some data
|
||||||
|
$object->client = $object->client | $soc_origin->client;
|
||||||
|
$object->fournisseur = $object->fournisseur | $soc_origin->fournisseur;
|
||||||
|
$listofproperties=array(
|
||||||
|
'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_pro', 'fax', 'email', 'skype', 'url', 'barcode', 'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6',
|
||||||
|
'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis',
|
||||||
|
'stcomm_id', 'outstanding_limit', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency',
|
||||||
|
'code_client', 'code_fournisseur', 'code_compta', 'code_compta_fournisseur',
|
||||||
|
'model_pdf', 'fk_projet'
|
||||||
|
);
|
||||||
|
foreach ($listofproperties as $property)
|
||||||
|
{
|
||||||
|
if (empty($object->$property)) $object->$property = $soc_origin->$property;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Concat some data
|
||||||
|
$listofproperties=array(
|
||||||
|
'note_public', 'note_private'
|
||||||
|
);
|
||||||
|
foreach ($listofproperties as $property)
|
||||||
|
{
|
||||||
|
$object->$property = dol_concatdesc($object->$property, $soc_origin->$property);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merge extrafields
|
||||||
|
foreach ($soc_origin->array_options as $key => $val)
|
||||||
|
{
|
||||||
|
if (empty($object->array_options[$key])) $object->array_options[$key] = $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO Merge categories
|
||||||
|
$object->update($object->id, $user);
|
||||||
|
|
||||||
|
// Move links
|
||||||
$objects = array(
|
$objects = array(
|
||||||
'Adherent' => '/adherents/class/adherent.class.php',
|
'Adherent' => '/adherents/class/adherent.class.php',
|
||||||
'Societe' => '/societe/class/societe.class.php',
|
'Societe' => '/societe/class/societe.class.php',
|
||||||
@ -159,6 +194,7 @@ if (empty($reshook))
|
|||||||
'Fichinter' => '/fichinter/class/fichinter.class.php',
|
'Fichinter' => '/fichinter/class/fichinter.class.php',
|
||||||
'CommandeFournisseur' => '/fourn/class/fournisseur.commande.class.php',
|
'CommandeFournisseur' => '/fourn/class/fournisseur.commande.class.php',
|
||||||
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
|
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
|
||||||
|
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
|
||||||
'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php',
|
'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php',
|
||||||
'Livraison' => '/livraison/class/livraison.class.php',
|
'Livraison' => '/livraison/class/livraison.class.php',
|
||||||
'Product' => '/product/class/product.class.php',
|
'Product' => '/product/class/product.class.php',
|
||||||
@ -451,6 +487,7 @@ if (empty($reshook))
|
|||||||
if (empty($object->fournisseur)) $object->code_fournisseur='';
|
if (empty($object->fournisseur)) $object->code_fournisseur='';
|
||||||
|
|
||||||
$result = $object->create($user);
|
$result = $object->create($user);
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
if ($object->particulier)
|
if ($object->particulier)
|
||||||
|
|||||||
@ -2530,6 +2530,24 @@ class SupplierProposal extends CommonObject
|
|||||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function used to replace a thirdparty id with another one.
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param int $origin_id Old thirdparty id
|
||||||
|
* @param int $dest_id New thirdparty id
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
|
||||||
|
{
|
||||||
|
$tables = array(
|
||||||
|
'supplier_proposal'
|
||||||
|
);
|
||||||
|
|
||||||
|
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
||||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||||
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
@ -2214,6 +2214,7 @@ class User extends CommonObject
|
|||||||
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN)) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login;
|
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN)) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login;
|
||||||
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN_SAMBA)) $info[$conf->global->LDAP_FIELD_LOGIN_SAMBA] = $this->login;
|
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN_SAMBA)) $info[$conf->global->LDAP_FIELD_LOGIN_SAMBA] = $this->login;
|
||||||
if ($this->pass && ! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
if ($this->pass && ! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||||
|
if ($this->pass && ! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // md5 for OpenLdap TODO add type of encryption
|
||||||
if ($this->ldap_sid && ! empty($conf->global->LDAP_FIELD_SID)) $info[$conf->global->LDAP_FIELD_SID] = $this->ldap_sid;
|
if ($this->ldap_sid && ! empty($conf->global->LDAP_FIELD_SID)) $info[$conf->global->LDAP_FIELD_SID] = $this->ldap_sid;
|
||||||
if ($this->societe_id > 0)
|
if ($this->societe_id > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user