2
0
forked from Wavyzz/dolibarr

Merge remote-tracking branch 'origin/3.9' into develop

Conflicts:
	htdocs/fourn/commande/card.php
	htdocs/imports/import.php
	htdocs/langs/en_US/admin.lang
This commit is contained in:
Laurent Destailleur
2016-06-05 02:20:27 +02:00
22 changed files with 113 additions and 91 deletions

View File

@@ -2570,7 +2570,7 @@ class Propal extends CommonObject
$response = new WorkboardResponse(); $response = new WorkboardResponse();
$response->warning_delay = $delay_warning/60/60/24; $response->warning_delay = $delay_warning/60/60/24;
$response->label = $label; $response->label = $label;
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut; $response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals';
$response->img = img_object($langs->trans("Propals"),"propal"); $response->img = img_object($langs->trans("Propals"),"propal");
// This assignment in condition is not a bug. It allows walking the results. // This assignment in condition is not a bug. It allows walking the results.

View File

@@ -2974,7 +2974,7 @@ class Commande extends CommonOrder
$response = new WorkboardResponse(); $response = new WorkboardResponse();
$response->warning_delay=$conf->commande->client->warning_delay/60/60/24; $response->warning_delay=$conf->commande->client->warning_delay/60/60/24;
$response->label=$langs->trans("OrdersToProcess"); $response->label=$langs->trans("OrdersToProcess");
$response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3'; $response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3&mainmenu=commercial&leftmenu=orders';
$response->img=img_object($langs->trans("Orders"),"order"); $response->img=img_object($langs->trans("Orders"),"order");
$generic_commande = new Commande($this->db); $generic_commande = new Commande($this->db);

View File

@@ -3464,7 +3464,7 @@ class Facture extends CommonInvoice
$response = new WorkboardResponse(); $response = new WorkboardResponse();
$response->warning_delay=$conf->facture->client->warning_delay/60/60/24; $response->warning_delay=$conf->facture->client->warning_delay/60/60/24;
$response->label=$langs->trans("CustomerBillsUnpaid"); $response->label=$langs->trans("CustomerBillsUnpaid");
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1'; $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=customers_bills';
$response->img=img_object($langs->trans("Bills"),"bill"); $response->img=img_object($langs->trans("Bills"),"bill");
$generic_facture = new Facture($this->db); $generic_facture = new Facture($this->db);

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
@@ -877,7 +877,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql.= " AND ff.fk_soc = ".$socid; if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,"; $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur"; $sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
$sql.= " ORDER BY ff.date_lim_reglement ASC"; $sql.= " ORDER BY ff.date_lim_reglement ASC";
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@@ -240,7 +240,10 @@ if ($section)
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$useglobalvars=1; $useglobalvars=1;
$form = new Form($db); $form = new Form($db);
$formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile')); $formquestion=array(
'urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile'),
'section'=>array('type'=>'hidden','value'=>$section,'name'=>'section')
);
print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0)); print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0));
} }

View File

@@ -2329,7 +2329,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " WHERE p.entity IN (".getEntity('productprice', 1).")";
$sql.= " AND p.tobuy = 1"; $sql.= " AND p.tobuy = 1";
$sql.= " AND s.fournisseur = 1"; $sql.= " AND s.fournisseur = 1";
$sql.= " AND p.rowid = ".$productid; $sql.= " AND p.rowid = ".$productid;

View File

@@ -162,68 +162,52 @@ class Ldap
return -1; return -1;
} }
if (! function_exists('ldap_connect')) if (! function_exists("ldap_connect"))
{ {
$this->error='Your PHP need extension ldap'; $this->error='LDAPFunctionsNotAvailableOnPHP';
dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING); dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING);
return -1; $return=-1;
} }
// Loop on each ldap server if (empty($this->error))
foreach ($this->server as $key => $host)
{ {
if ($connected) break; // Loop on each ldap server
if (empty($host)) continue; foreach ($this->server as $key => $host)
if (preg_match('/^ldap/',$host))
{ {
$this->connection = ldap_connect($host); if ($connected) break;
} if (empty($host)) continue;
else
{ if (preg_match('/^ldap/',$host))
$this->connection = ldap_connect($host,$this->serverPort);
}
if (is_resource($this->connection))
{
// Begin TLS if requested by the configuration
if (! empty($conf->global->LDAP_SERVER_USE_TLS))
{
if (! ldap_start_tls($this->connection))
{
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
$connected = 0;
$this->close();
}
}
// Execute the ldap_set_option here (after connect and before bind)
$this->setVersion();
ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true.
if ($this->serverType == "activedirectory")
{ {
$result=$this->setReferrals(); $this->connection = ldap_connect($host);
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
if ($this->result)
{
$this->bind=$this->result;
$connected=2;
break;
}
else
{
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
}
} }
else else
{ {
// Try in auth mode $this->connection = ldap_connect($host,$this->serverPort);
if ($this->searchUser && $this->searchPassword) }
if (is_resource($this->connection))
{
// Begin TLS if requested by the configuration
if (! empty($conf->global->LDAP_SERVER_USE_TLS))
{
if (! ldap_start_tls($this->connection))
{
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
$connected = 0;
$this->close();
}
}
// Execute the ldap_set_option here (after connect and before bind)
$this->setVersion();
ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true.
if ($this->serverType == "activedirectory")
{ {
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG); $result=$this->setReferrals();
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
$this->result=$this->bindauth($this->searchUser,$this->searchPassword); $this->result=$this->bindauth($this->searchUser,$this->searchPassword);
if ($this->result) if ($this->result)
{ {
@@ -236,26 +220,45 @@ class Ldap
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection); $this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
} }
} }
// Try in anonymous else
if (! $this->bind)
{ {
dol_syslog(get_class($this)."::connect_bind try bind on ".$host,LOG_DEBUG); // Try in auth mode
$result=$this->bind(); if ($this->searchUser && $this->searchPassword)
if ($result)
{ {
$this->bind=$this->result; dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
$connected=1; $this->result=$this->bindauth($this->searchUser,$this->searchPassword);
break; if ($this->result)
{
$this->bind=$this->result;
$connected=2;
break;
}
else
{
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
}
} }
else // Try in anonymous
if (! $this->bind)
{ {
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection); dol_syslog(get_class($this)."::connect_bind try bind on ".$host,LOG_DEBUG);
$result=$this->bind();
if ($result)
{
$this->bind=$this->result;
$connected=1;
break;
}
else
{
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
}
} }
} }
} }
if (! $connected) $this->close();
} }
if (! $connected) $this->close();
} }
if ($connected) if ($connected)

View File

@@ -736,17 +736,24 @@ function activateModule($value,$withdeps=1)
if (isset($objMod->depends) && is_array($objMod->depends) && ! empty($objMod->depends)) if (isset($objMod->depends) && is_array($objMod->depends) && ! empty($objMod->depends))
{ {
// Activation des modules dont le module depend // Activation des modules dont le module depend
$TError=array();
$num = count($objMod->depends); $num = count($objMod->depends);
for ($i = 0; $i < $num; $i++) for ($i = 0; $i < $num; $i++)
{ {
$activate = false;
foreach ($modulesdir as $dir) foreach ($modulesdir as $dir)
{ {
if (file_exists($dir.$objMod->depends[$i].".class.php")) if (file_exists($dir.$objMod->depends[$i].".class.php"))
{ {
activateModule($objMod->depends[$i]); activateModule($objMod->depends[$i]);
$activate = true;
} }
} }
if (!$activate) $TError[] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $objMod->depends[$i]);
} }
setEventMessages('', $TError, 'errors');
} }
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith)) if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))

View File

@@ -436,7 +436,7 @@ function dol_size($size,$type='')
*/ */
function dol_sanitizeFileName($str,$newstr='_',$unaccent=1) function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
{ {
$filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"'); $filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"','°');
return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars); return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars);
} }

View File

@@ -788,8 +788,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->facture->enabled)) if (! empty($conf->facture->enabled))
{ {
$langs->load("bills"); $langs->load("bills");
$newmenu->add("/compta/facture/list.php",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills'); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
$newmenu->add("/compta/facture.php?action=create",$langs->trans("NewBill"),1,$user->rights->facture->creer); $newmenu->add("/compta/facture.php?action=create&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire); $newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire);
if (empty($leftmenu) || ($leftmenu == 'customers_bills')) if (empty($leftmenu) || ($leftmenu == 'customers_bills'))

View File

@@ -397,6 +397,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);
$object->fetch_optionals();
// Call the ODTSubstitution hook // Call the ODTSubstitution hook
$parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray); $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks

View File

@@ -175,10 +175,9 @@ if ($action == 'confirm_deletefile')
dol_print_error($db,$ecmdir->error); dol_print_error($db,$ecmdir->error);
exit; exit;
} }
$relativepath=$ecmdir->getRelativePath();
} }
else $relativepath=''; else $relativepath='';
$upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:''); $upload_dir = $conf->ecm->dir_output;
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP). $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
$ret=dol_delete_file($file); $ret=dol_delete_file($file);

View File

@@ -819,7 +819,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
} }
} }
if ($action == "addline") if ($action == "addline" && $user->rights->expensereport->creer)
{ {
$error = 0; $error = 0;
@@ -911,7 +911,7 @@ if ($action == "addline")
$action=''; $action='';
} }
if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes") if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes" && $user->rights->expensereport->creer)
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
@@ -954,7 +954,7 @@ if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes")
} }
} }
if ($action == "updateligne" ) if ($action == "updateligne" && $user->rights->expensereport->creer)
{ {
$object = new ExpenseReport($db); $object = new ExpenseReport($db);
$object->fetch($id); $object->fetch($id);
@@ -1640,8 +1640,11 @@ else
print '<td style="text-align:right;">'.$langs->trans('AmountHT').'</td>'; print '<td style="text-align:right;">'.$langs->trans('AmountHT').'</td>';
print '<td style="text-align:right;">'.$langs->trans('AmountTTC').'</td>'; print '<td style="text-align:right;">'.$langs->trans('AmountTTC').'</td>';
} }
print '<td style="text-align:right;"></td>'; // Ajout des boutons de modification/suppression
if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer)
{
print '<td style="text-align:right;"></td>';
}
print '</tr>'; print '</tr>';
$var=true; $var=true;
@@ -1682,7 +1685,7 @@ else
// Ajout des boutons de modification/suppression // Ajout des boutons de modification/suppression
print '<td style="text-align:right;" class="nowrap">'; print '<td style="text-align:right;" class="nowrap">';
if($object->fk_statut<2 OR $object->fk_statut==99) if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer)
{ {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;rowid='.$objp->rowid.'#'.$objp->rowid.'">'; print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;rowid='.$objp->rowid.'#'.$objp->rowid.'">';
print img_edit(); print img_edit();
@@ -1768,7 +1771,7 @@ else
//print '</div>'; //print '</div>';
// Add a line // Add a line
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline') if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer)
{ {
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2"></td>'; print '<td colspan="2"></td>';

View File

@@ -2492,7 +2492,7 @@ class CommandeFournisseur extends CommonOrder
$response = new WorkboardResponse(); $response = new WorkboardResponse();
$response->warning_delay=$conf->commande->fournisseur->warning_delay/60/60/24; $response->warning_delay=$conf->commande->fournisseur->warning_delay/60/60/24;
$response->label=$langs->trans("SuppliersOrdersToProcess"); $response->label=$langs->trans("SuppliersOrdersToProcess");
$response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2,3'; $response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2,3&mainmenu=commercial&leftmenu=orders_suppliers';
$response->img=img_object($langs->trans("Orders"),"order"); $response->img=img_object($langs->trans("Orders"),"order");
while ($obj=$this->db->fetch_object($resql)) while ($obj=$this->db->fetch_object($resql))

View File

@@ -1507,7 +1507,7 @@ class FactureFournisseur extends CommonInvoice
$response = new WorkboardResponse(); $response = new WorkboardResponse();
$response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
$response->label=$langs->trans("SupplierBillsToPay"); $response->label=$langs->trans("SupplierBillsToPay");
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=fac.fk_statut:1,paye:0'; $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=fac.fk_statut:1,paye:0&mainmenu=accountancy&leftmenu=suppliers_bills';
$response->img=img_object($langs->trans("Bills"),"bill"); $response->img=img_object($langs->trans("Bills"),"bill");
$facturestatic = new FactureFournisseur($this->db); $facturestatic = new FactureFournisseur($this->db);

View File

@@ -445,7 +445,7 @@ class ProductFournisseur extends Product
$sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation"; $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE pfp.entity IN (".getEntity('product', 1).")"; $sql.= " WHERE pfp.entity IN (".getEntity('productprice', 1).")";
$sql.= " AND pfp.fk_soc = s.rowid"; $sql.= " AND pfp.fk_soc = s.rowid";
$sql.= " AND s.status=1"; // only enabled company selected $sql.= " AND s.status=1"; // only enabled company selected
$sql.= " AND pfp.fk_product = ".$prodid; $sql.= " AND pfp.fk_product = ".$prodid;

View File

@@ -1055,7 +1055,6 @@ if (empty($reshook))
} }
$result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty); $result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty);
if ($result>=0) if ($result>=0)
{ {
$tva_tx = $lines[$i]->tva_tx; $tva_tx = $lines[$i]->tva_tx;
@@ -1089,6 +1088,7 @@ if (empty($reshook))
$lines[$i]->fk_unit $lines[$i]->fk_unit
); );
} }
if ($result < 0) { if ($result < 0) {
$error++; $error++;
break; break;

View File

@@ -634,6 +634,10 @@ if ($step == 4 && $datatoimport)
} }
} }
if(!empty(GETPOST('update'))) {
$array_match_file_to_database=array();
}
// Load source fields in input file // Load source fields in input file
$fieldssource=array(); $fieldssource=array();
@@ -757,7 +761,7 @@ if ($step == 4 && $datatoimport)
print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>'; print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>';
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : '; print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : ';
print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>'; print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>';
print '<input type="submit" value="'.$langs->trans('Update').'" class="button" />'; print '<input name="update" type="submit" value="'.$langs->trans('Update').'" class="button" />';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
} }

View File

@@ -1753,3 +1753,4 @@ AddSubstitutions=Add keys substitutions
DetectionNotPossible=Detection not possible DetectionNotPossible=Detection not possible
UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and will be checked on each future access) UrlToGetKeyToUseAPIs=Url to get token to use API (once token has been received it is saved on database user table and will be checked on each future access)
ListOfAvailableAPIs=List of available APIs ListOfAvailableAPIs=List of available APIs
activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise

View File

@@ -158,6 +158,7 @@ Save=Save
SaveAs=Save As SaveAs=Save As
TestConnection=Test connection TestConnection=Test connection
ToClone=Clone ToClone=Clone
ConfirmCloneAction=Are you sure you want to clone this event ?
ConfirmClone=Choose data you want to clone : ConfirmClone=Choose data you want to clone :
NoCloneOptionsSpecified=No data to clone defined. NoCloneOptionsSpecified=No data to clone defined.
Of=of Of=of

View File

@@ -2666,7 +2666,7 @@ class Product extends CommonObject
$sql.= " WHERE fk_soc = ".$id_fourn; $sql.= " WHERE fk_soc = ".$id_fourn;
$sql.= " AND ref_fourn = '".$this->db->escape($ref_fourn)."'"; $sql.= " AND ref_fourn = '".$this->db->escape($ref_fourn)."'";
$sql.= " AND fk_product != ".$this->id; $sql.= " AND fk_product != ".$this->id;
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity IN (".getEntity('productprice', 1).")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
@@ -2689,7 +2689,7 @@ class Product extends CommonObject
else $sql.= " AND (ref_fourn = '' OR ref_fourn IS NULL)"; else $sql.= " AND (ref_fourn = '' OR ref_fourn IS NULL)";
$sql.= " AND quantity = '".$quantity."'"; $sql.= " AND quantity = '".$quantity."'";
$sql.= " AND fk_product = ".$this->id; $sql.= " AND fk_product = ".$this->id;
$sql.= " AND entity = ".$conf->entity; $sql.= " AND entity IN (".getEntity('productprice', 1).")";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)

View File

@@ -155,7 +155,7 @@ if (empty($reshook))
{ {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
setEventMessages($langs->trans("ErrorFieldMustBeANumeric",'eeee'), null, 'errors'); setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("VATRateForSupplierProduct")), null, 'errors');
} }
if (empty($quantity)) if (empty($quantity))
{ {