*
* 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
@@ -98,7 +98,7 @@ class FormMargin
$pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
- if ($object->type == Facture::TYPE_SITUATION) {
+ if ($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) {
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
} else {
$pa = $line->qty * $pa_ht;
diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php
index ca712c456f9..21e5e82c13b 100644
--- a/htdocs/fourn/class/api_supplier_invoices.class.php
+++ b/htdocs/fourn/class/api_supplier_invoices.class.php
@@ -208,7 +208,7 @@ class SupplierInvoices extends DolibarrApi
foreach($request_data as $field => $value) {
$this->invoice->$field = $value;
}
- if(! array_keys($request_data, 'date')) {
+ if(! array_key_exists('date', $request_data)) {
$this->invoice->date = dol_now();
}
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index bc9abb9753d..ac411f56f3e 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1012,3 +1012,4 @@ ContactDefault_propal=Proposal
ContactDefault_supplier_proposal=Supplier Proposal
ContactDefault_ticketsup=Ticket
ContactAddedAutomatically=Contact added from contact thirdparty roles
+More=More
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index 6e9b6d66f32..7ee672f089b 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -56,7 +56,7 @@ Notify_BILL_SUPPLIER_PAYED=Vendor invoice paid
Notify_BILL_SUPPLIER_SENTBYMAIL=Vendor invoice sent by mail
Notify_BILL_SUPPLIER_CANCELED=Vendor invoice cancelled
Notify_CONTRACT_VALIDATE=Contract validated
-Notify_FICHEINTER_VALIDATE=Intervention validated
+Notify_FICHINTER_VALIDATE=Intervention validated
Notify_FICHINTER_ADD_CONTACT=Added contact to Intervention
Notify_FICHINTER_SENTBYMAIL=Intervention sent by mail
Notify_SHIPPING_VALIDATE=Shipping validated
@@ -272,4 +272,4 @@ WEBSITE_KEYWORDS=Keywords
LinesToImport=Lines to import
MemoryUsage=Memory usage
-RequestDuration=Duration of request
\ No newline at end of file
+RequestDuration=Duration of request
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index aeb4f77550b..ac27da29628 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -624,7 +624,7 @@ if ($id > 0)
else
{
print '| ';
- print $langs->trans("LoanAccountancyCapitalCode");
+ print $langs->trans("LoanAccountancyInsuranceCode");
print ' | ';
if (!empty($conf->accounting->enabled))
diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php
index a3813963cc5..6a3f8a898eb 100644
--- a/htdocs/product/admin/product_tools.php
+++ b/htdocs/product/admin/product_tools.php
@@ -135,7 +135,7 @@ if ($action == 'convert')
$newlevel=$level;
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr \n";
- $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatratclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode);
+ $retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvatrateclean, $newminprice, $newlevel, $newnpr, 0, 0, $localtaxes_type, $newdefaultvatcode);
if ($retm < 0)
{
$error++;
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index ca0f8112fc1..ba143057b59 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1876,6 +1876,9 @@ class Product extends CommonObject
if (empty($newminprice)) {
$newminprice = 0;
}
+ if (empty($newminprice)) {
+ $newminprice=0;
+ }
// Check parameters
if ($newvat == '') {
@@ -2677,7 +2680,7 @@ class Product extends CommonObject
* Charge tableau des stats expedition client pour le produit/service
*
* @param int $socid Id societe pour filtrer sur une societe
- * @param string $filtrestatut Id statut pour filtrer sur un statut
+ * @param string $filtrestatut [=''] Ids order status separated by comma
* @param int $forVirtualStock Ignore rights filter for virtual stock calculation.
* @param string $filterShipmentStatus [=''] Ids shipment status separated by comma
* @return int <0 if KO, >0 if OK (Tableau des stats)
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index 48d336e8ace..c107693b8c6 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -122,7 +122,8 @@ $sql .= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desir
$sql .= ' SUM(s.reel) as stock_physique';
if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= ', u.short_label as unit_short';
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
-$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product';
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
+$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON s.fk_entrepot = e.rowid AND e.entity IN ('.getEntity('entrepot').')';
if (!empty($conf->global->PRODUCT_USE_UNITS)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
// We'll need this table joined to the select in order to filter by categ
if ($search_categ) $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 777c0dcb360..1cb88b47a28 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -463,7 +463,7 @@ $listofreferent = array(
'table'=>'projet_task',
'datefieldname'=>'task_date',
'disableamount'=>0,
- 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?id='.$id,
+ 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id,
'buttonnew'=>'AddTimeSpent',
'testnew'=>$user->rights->projet->creer,
'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))),
@@ -538,7 +538,7 @@ if ($action=="addelement")
elseif ($action == "unlink")
{
$tablename = GETPOST("tablename", "aZ09");
- $projectField = GETPOST('projectfield', 'aZ09') ? GETPOST('projectfield', 'aZ09') : 'fk_projet';
+ $projectField = GETPOSTISSET('projectfield') ? GETPOST('projectfield', 'aZ09') : 'fk_projet';
$elementselectid = GETPOST("elementselect", "int");
$result = $object->remove_element($tablename, $elementselectid, $projectField);
diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php
index 798ef8dab4a..39f7fee3397 100644
--- a/htdocs/salaries/card.php
+++ b/htdocs/salaries/card.php
@@ -44,7 +44,7 @@ if (! empty($conf->projet->enabled)) $langs->load("projects");
$id = GETPOST("id", 'int');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
-$accountid = GETPOST("accountid", 'int');
+$accountid = GETPOST('accountid', 'int') > 0 ? GETPOST('accountid', 'int') : 0;
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOST('fk_project', 'int'));
$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int'));
|