Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/fourn/commande/card.php
	htdocs/langs/en_US/admin.lang
This commit is contained in:
Laurent Destailleur 2018-06-13 23:07:30 +02:00
commit 910652eb6d
12 changed files with 33 additions and 19 deletions

View File

@ -178,24 +178,30 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
// TODO We add/delete permission here until permission can have a condition on a global var
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
$newmodule=new modFournisseur($db);
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
{
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
// Insert
$newmodule->insert_permissions(1);
}
else
{
// Remove all rights with Permission1190
$newmodule->delete_permissions();
// Add all right without Permission1190
$newmodule->insert_permissions(1);
}
}

View File

@ -414,6 +414,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
$txlocaltax1=price2num($txlocaltax1);
@ -635,6 +636,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu = price2num($pu);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva = price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);

View File

@ -1278,6 +1278,7 @@ class Commande extends CommonOrder
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva = price2num($txtva);
@ -2844,6 +2845,7 @@ class Commande extends CommonOrder
$qty=price2num($qty);
$pu = price2num($pu);
$pa_ht=price2num($pa_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);

View File

@ -409,7 +409,7 @@ if (empty($reshook))
//var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit;
if ($discount->amount_ttc > $object->getRemainToPay(0))
if (price2num($discount->amount_ttc) > price2num($object->getRemainToPay(0)))
{
// TODO Split the discount in 2 automatically
$error++;

View File

@ -2608,6 +2608,7 @@ class Facture extends CommonInvoice
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva=price2num($txtva);
@ -2832,6 +2833,7 @@ class Facture extends CommonInvoice
$remise_percent = price2num($remise_percent);
$qty = price2num($qty);
$pu = price2num($pu);
$pu_ht_devise = price2num($pu_ht_devise);
$pa_ht = price2num($pa_ht);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);

View File

@ -463,7 +463,7 @@ else if ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
if ($month_lim > 0)
if ($search_month_lim > 0)
{
if ($search_year_lim > 0 && empty($search_day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($search_year_lim,$search_month_lim,false))."' AND '".$db->idate(dol_get_last_day($search_year_lim,$search_month_lim,false))."'";

View File

@ -2651,7 +2651,7 @@ class Form
$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."societe as s ON pfp.fk_soc = s.rowid";
$sql.= " WHERE p.entity IN (".getEntity('productprice').")";
$sql.= " WHERE pfp.entity IN (".getEntity('productprice').")";
$sql.= " AND p.tobuy = 1";
$sql.= " AND s.fournisseur = 1";
$sql.= " AND p.rowid = ".$productid;

View File

@ -1397,11 +1397,11 @@ class FichinterLigne extends CommonObjectLine
$resql=$this->db->query($sql);
if ($resql)
{
$this->rowid=$this->db->last_insert_id(MAIN_DB_PREFIX.'fichinterdet');
$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX.'fichinterdet');
$this->rowid=$this->id;
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$this->id=$this->id;
$result=$this->insertExtraFields();
if ($result < 0)
{
@ -1472,7 +1472,6 @@ class FichinterLigne extends CommonObjectLine
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$this->id=$this->id;
$result=$this->insertExtraFields();
if ($result < 0)
{

View File

@ -1458,6 +1458,7 @@ class CommandeFournisseur extends CommonOrder
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);
@ -2419,6 +2420,7 @@ class CommandeFournisseur extends CommonOrder
$qty=price2num($qty);
if (! $qty) $qty=1;
$pu = price2num($pu);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);

View File

@ -964,6 +964,7 @@ if (empty($reshook))
if ($result < 0)
{
$error++;
setEventMessages($object->error,$object->errors,'errors');
}
}
}

View File

@ -454,7 +454,7 @@ ModuleCompanyCodeDigitaria=Accounting code depends on third party code. The code
Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).<br>Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required.
UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than...
WarningPHPMail=WARNING: It is often better to setup outgoing emails to use the email server of your provider instead of the default setup. Some email providers (like Yahoo) does not allow you to send an email from another server than their own server. Your current setup use the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not a server of them, so few of your sent Emails may not be accepted (be carefull also to your email provider sending quota).<br>If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account).
WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of your ERP CRM application: <strong>%s</strong>.
WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: <strong>%s</strong>.
ClickToShowDescription=Click to show description
DependsOn=This module need the module(s)
RequiredBy=This module is required by module(s)

View File

@ -987,7 +987,7 @@ class Product extends CommonObject
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
if (empty($conf->barcode->enabled)) $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
if (empty($conf->barcode->enabled) || empty($this->barcode)) $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductAlreadyExists",$this->ref);
else $this->error=$langs->trans("Error")." : ".$langs->trans("ErrorProductBarCodeAlreadyExists",$this->barcode);
$this->errors[]=$this->error;
$this->db->rollback();