diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 99ff663689e..8c1c579b0c2 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1301,8 +1301,18 @@ if ($action == 'create')
// Replicate extrafields
$objectsrc->fetch_optionals($originid);
$object->array_options = $objectsrc->array_options;
+
+ if (!empty($conf->multicurrency->enabled))
+ {
+ if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code;
+ if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx;
+ }
}
}
+ else
+ {
+ if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
+ }
$object = new Propal($db);
@@ -1480,7 +1490,6 @@ if ($action == 'create')
print '
';
print '| '.fieldLabel('Currency','multicurrency_code').' | ';
print '';
- $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency));
print $form->selectMultiCurrency($currency_code, 'multicurrency_code', 0);
print ' |
';
}
@@ -2018,7 +2027,7 @@ if ($action == 'create')
print '';
print '';
@@ -2029,7 +2038,7 @@ if ($action == 'create')
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
- if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
+ if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '';
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index fda37a88467..749f40fef4e 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2213,7 +2213,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
print ' | ';
@@ -2224,7 +2224,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
- if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
+ if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 73959687527..b71dbe0cc70 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -3257,7 +3257,7 @@ else if ($id > 0 || ! empty($ref))
print '';
print ' | ';
@@ -3268,7 +3268,7 @@ else if ($id > 0 || ! empty($ref))
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
- if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
+ if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '';
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index ab39df1d0f4..aa15fbea86b 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -2102,7 +2102,7 @@ class Contrat extends CommonObject
$sql = "SELECT count(c.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";
- if (!$user->rights->contrat->lire && !$user->societe_id)
+ if (!$user->rights->societe->client->voir && !$user->societe_id)
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql.= " WHERE sc.fk_user = " .$user->id;
diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php
index 67c4d4dbfcc..d3336500263 100644
--- a/htdocs/core/boxes/box_factures_imp.php
+++ b/htdocs/core/boxes/box_factures_imp.php
@@ -78,8 +78,9 @@ class box_factures_imp extends ModeleBoxes
$sql.= " f.total_ttc,";
$sql.= " f.paye, f.fk_statut, f.rowid as facid";
$sql.= ", sum(pf.amount) as am";
- $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
+ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= ", ".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid=pf.fk_facture ";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity = ".$conf->entity;
diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php
index 5cce3254bfb..51ee156fbeb 100644
--- a/htdocs/core/boxes/box_produits.php
+++ b/htdocs/core/boxes/box_produits.php
@@ -106,13 +106,13 @@ class box_produits extends ModeleBoxes
$productstatic->entity = $objp->entity;
$this->info_box_contents[$line][] = array(
- 'td' => 'align="left"',
+ 'td' => '',
'text' => $productstatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$line][] = array(
- 'td' => 'align="left"',
+ 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
'text' => $objp->label,
);
@@ -144,7 +144,7 @@ class box_produits extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'align="left" class="nowrap"',
+ 'td' => 'class="nowrap"',
'text' => $price_base_type,
);
@@ -174,14 +174,14 @@ class box_produits extends ModeleBoxes
$db->free($result);
} else {
$this->info_box_contents[0][0] = array(
- 'td' => 'align="left"',
+ 'td' => '',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql),
);
}
} else {
$this->info_box_contents[0][0] = array(
- 'td' => 'align="left"',
+ 'td' => '',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php
index 3ec0fc7070c..884cf92b52a 100644
--- a/htdocs/core/boxes/box_produits_alerte_stock.php
+++ b/htdocs/core/boxes/box_produits_alerte_stock.php
@@ -113,13 +113,13 @@ class box_produits_alerte_stock extends ModeleBoxes
$productstatic->entity = $objp->entity;
$this->info_box_contents[$line][] = array(
- 'td' => 'align="left"',
+ 'td' => '',
'text' => $productstatic->getNomUrl(1),
'asis' => 1,
);
$this->info_box_contents[$line][] = array(
- 'td' => 'align="left"',
+ 'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
'text' => $objp->label,
);
@@ -153,7 +153,7 @@ class box_produits_alerte_stock extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'align="left" class="nowrap"',
+ 'td' => 'class="nowrap"',
'text' => $price_base_type,
);
@@ -180,7 +180,7 @@ class box_produits_alerte_stock extends ModeleBoxes
else
{
$this->info_box_contents[0][0] = array(
- 'td' => 'align="left"',
+ 'td' => '',
'maxlength'=>500,
'text' => ($db->error().' sql='.$sql),
);
@@ -188,7 +188,7 @@ class box_produits_alerte_stock extends ModeleBoxes
}
else {
$this->info_box_contents[0][0] = array(
- 'td' => 'align="left"',
+ 'td' => '',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php
index 4c0689cd282..a47ae3d0cb5 100644
--- a/htdocs/core/boxes/box_project.php
+++ b/htdocs/core/boxes/box_project.php
@@ -72,33 +72,46 @@ class box_project extends ModeleBoxes
$totalnb = 0;
$totalnbTask=0;
- $textHead = $langs->trans("Projects");
+ $textHead = $langs->trans("OpenedProjects");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the orders
if ($user->rights->projet->lire) {
-
- $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
+
+ include_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
+ $projectstatic = new Project($this->db);
+
+ $socid=$user->societe_id;
+
+ // Get list of project id allowed to user (in a string list separated by coma)
+ $projectsListId='';
+ if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1,$socid);
+
+ $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
- $sql.= " WHERE p.entity = ".$conf->entity;
- if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
+ $sql.= " WHERE p.entity IN (".getEntity('project',1).')';
+ if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
+ if ($user->socid) $sql.= " AND s.rowid = ".$user->socid;
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
- $sql.= " ORDER BY p.datec DESC";
- $sql.= $db->plimit($max, 0);
+ if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
+ if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
+
+ $sql.= " ORDER BY p.datec DESC";
+ //$sql.= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$i = 0;
- while ($i < $num) {
+ while ($i < min($num, $max)) {
$objp = $db->fetch_object($result);
$tooltip = $langs->trans('Project') . ': ' . $objp->ref;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
- 'logo' => 'object_project',
+ 'logo' => 'object_project'.($objp->public?'pub':''),
'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid,
);
@@ -117,30 +130,35 @@ class box_project extends ModeleBoxes
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
- $sql.=" WHERE p.entity = ".$conf->entity;
- $sql.=" AND p.rowid = ".$objp->rowid;
+ $sql.= " WHERE p.entity IN (".getEntity('project',1).')';
+ $sql.=" AND p.rowid = ".$objp->rowid;
$resultTask = $db->query($sql);
if ($resultTask) {
$objTask = $db->fetch_object($resultTask);
$this->info_box_contents[$i][3] = array(
- 'td' => 'align="right"',
- 'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"),
+ 'td' => 'class="right"',
+ 'text' => $objTask->nb." ".$langs->trans("Tasks"),
);
- if ($objTask->nb > 0 )
+ if ($objTask->nb > 0)
$this->info_box_contents[$i][4] = array(
- 'td' => 'align="right"',
- 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%",
+ 'td' => 'class="right"',
+ 'text' => round($objTask->totprogress/$objTask->nb, 0)."%",
);
else
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");
$totalnbTask += $objTask->nb;
} else {
- $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format(0, 0, ',', ' '));
- $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");
+ $this->info_box_contents[$i][3] = array('td' => 'class="right"', 'text' => round(0));
+ $this->info_box_contents[$i][4] = array('td' => 'class="right"', 'text' => "N/A ");
}
$i++;
}
+ if ($max < $num)
+ {
+ $this->info_box_contents[$i][0] = array('td' => 'colspan="5"', 'text' => '...');
+ $i++;
+ }
}
}
@@ -158,11 +176,11 @@ class box_project extends ModeleBoxes
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="right" ',
- 'text' => number_format($num, 0, ',', ' ')." ".$langs->trans("Projects"),
+ 'text' => round($num, 0)." ".$langs->trans("Projects"),
);
$this->info_box_contents[$i][3] = array(
'td' => 'align="right" ',
- 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$langs->trans("Tasks"),
+ 'text' => (($max < $num) ? '' : (round($totalnbTask, 0)." ".$langs->trans("Tasks"))),
);
$this->info_box_contents[$i][4] = array(
'td' => '',
diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php
index 752509a0616..4d7759ff081 100644
--- a/htdocs/core/boxes/box_services_contracts.php
+++ b/htdocs/core/boxes/box_services_contracts.php
@@ -135,7 +135,7 @@ class box_services_contracts extends ModeleBoxes
'asis' => 1
);
- $this->info_box_contents[$i][] = array('td' => '',
+ $this->info_box_contents[$i][] = array('td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
'text' => $thirdpartytmp->getNomUrl(1),
'asis' => 1
);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 709dc58d769..b2de5ff9d54 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1024,7 +1024,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
$morehtmlleft.='';
}
}
- elseif ($conf->browser->layout != 'phone') // Show no photo link
+ elseif ($conf->browser->layout != 'phone') // Show No photo link (picto of pbject)
{
$morehtmlleft.='';
if ($object->element == 'action')
@@ -1036,7 +1036,9 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
else
{
$width=14; $cssclass='photorefcenter';
- $nophoto=img_picto('', 'object_'.$object->picto, '', false, 1);
+ $picto = $object->picto;
+ if ($object->element == 'project' && ! $object->public) $picto = 'project'; // instead of projectpub
+ $nophoto=img_picto('', 'object_'.$picto, '', false, 1);
$morehtmlleft.=' ';
}
$morehtmlleft.=' ';
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index 3aa1c95ae69..6242f5d736d 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -721,7 +721,7 @@ class pdf_standard extends ModeleExpenseReport
* @param string $currency Currency code
* @return void
*/
- function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
+ function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='')
{
global $conf;
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 41cd29f8b35..972a75eecc8 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -554,6 +554,7 @@ class pdf_azur extends ModelePDFPropales
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
else $tvaligne=$object->lines[$i]->total_tva;
+
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
index 9865fc86136..1e7e6f4bcad 100644
--- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -430,7 +430,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- $tvaligne=$object->lines[$i]->total_tva;
+ if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
+ else $tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
index 2c699190a7c..c882ed89800 100644
--- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -437,8 +437,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- $tvaligne=$object->lines[$i]->total_tva;
-
+ if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
+ else $tvaligne=$object->lines[$i]->total_tva;
+
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
index 650be00c25d..3b2812c7b90 100644
--- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php
@@ -460,7 +460,9 @@ class pdf_aurore extends ModelePDFSupplierProposal
*/
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
- $tvaligne=$object->lines[$i]->total_tva;
+ if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
+ else $tvaligne=$object->lines[$i]->total_tva;
+
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
@@ -560,7 +562,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
$posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
// Affiche zone totaux
- $posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs);
+ //$posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs);
// Affiche zone versements
/*
diff --git a/htdocs/expensereport/info.php b/htdocs/expensereport/info.php
index 21ee44df97a..0ea405e08c3 100644
--- a/htdocs/expensereport/info.php
+++ b/htdocs/expensereport/info.php
@@ -39,6 +39,9 @@ $result = restrictedArea($user, 'expensereport', $id, 'expensereport');
/*
* View
*/
+
+$form = new Form($db);
+
$title=$langs->trans("ExpenseReport") . " - " . $langs->trans("Info");
$helpurl="EN:Module_Expense_Reports";
llxHeader("",$title,$helpurl);
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 8d45b11beb3..98939ee01f2 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -176,7 +176,7 @@ class CommandeFournisseur extends CommonOrder
// Check parameters
if (empty($id) && empty($ref)) return -1;
- $sql = "SELECT c.rowid, c.ref, ref_supplier, c.fk_soc, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva,";
+ $sql = "SELECT c.rowid, c.ref, ref_supplier, c.fk_soc, c.fk_statut, c.amount_ht, c.total_ht, c.total_ttc, c.tva as total_vat,";
$sql.= " c.localtax1, c.localtax2, ";
$sql.= " c.date_creation, c.date_valid, c.date_approve, c.date_approve2,";
$sql.= " c.fk_user_author, c.fk_user_valid, c.fk_user_approve, c.fk_user_approve2,";
@@ -222,7 +222,7 @@ class CommandeFournisseur extends CommonOrder
$this->user_approve_id = $obj->fk_user_approve;
$this->user_approve_id2 = $obj->fk_user_approve2;
$this->total_ht = $obj->total_ht;
- $this->total_tva = $obj->tva;
+ $this->total_tva = $obj->total_vat;
$this->total_localtax1 = $obj->localtax1;
$this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total_ttc;
@@ -1340,9 +1340,11 @@ class CommandeFournisseur extends CommonOrder
* @param array $array_options extrafields array
* @param string $fk_unit Code of the unit to use. Null to use the default one
* @param string $pu_ht_devise Amount in currency
+ * @param string $origin 'order', ...
+ * @param int $origin_id Id of origin object
* @return int <=0 if KO, >0 if OK
*/
- public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0)
+ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0, $origin='', $origin_id=0)
{
global $langs,$mysoc,$conf;
@@ -1511,7 +1513,8 @@ class CommandeFournisseur extends CommonOrder
$this->line->total_ttc=$total_ttc;
$this->line->product_type=$type;
$this->line->special_code=$this->special_code;
- $this->line->origin=$this->origin;
+ $this->line->origin=$origin;
+ $this->line->origin_id=$origin_id;
$this->line->fk_unit=$fk_unit;
$this->line->date_start=$date_start;
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index fb6bc840354..033e9d43382 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1068,7 +1068,10 @@ if (empty($reshook))
null,
null,
array(),
- $lines[$i]->fk_unit
+ $lines[$i]->fk_unit,
+ 0,
+ $element,
+ !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid
);
}
@@ -1862,7 +1865,7 @@ elseif (! empty($object->id))
print '';
print ' | ';
@@ -1873,7 +1876,7 @@ elseif (! empty($object->id))
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
- if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
+ if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '';
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 09ce7ef46aa..b0cdd488adf 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1796,17 +1796,14 @@ if ($action == 'create')
echo ' | ';
print '| '.$langs->trans('TotalHT').' | '.price($objectsrc->total_ht).' |
';
print '| '.$langs->trans('TotalVAT').' | '.price($objectsrc->total_tva)." |
";
- if ($mysoc->country_code=='ES')
+ if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
{
- if ($mysoc->localtax1_assuj=="1" || $object->total_localtax1 != 0) //Localtax1
- {
- print '| '.$langs->transcountry("AmountLT1",$mysoc->country_code).' | '.price($objectsrc->total_localtax1)." |
";
- }
+ print '| '.$langs->transcountry("AmountLT1",$mysoc->country_code).' | '.price($objectsrc->total_localtax1)." |
";
+ }
- if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
- {
- print '| '.$langs->transcountry("AmountLT2",$mysoc->country_code).' | '.price($objectsrc->total_localtax2)." |
";
- }
+ if ($mysoc->localtax2_assuj=="1" || $object->total_localtax2 != 0) //Localtax2
+ {
+ print '| '.$langs->transcountry("AmountLT2",$mysoc->country_code).' | '.price($objectsrc->total_localtax2)." |
";
}
print '| '.$langs->trans('TotalTTC').' | '.price($objectsrc->total_ttc)." |
";
@@ -2165,7 +2162,7 @@ else
print '';
print '';
@@ -2176,7 +2173,7 @@ else
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
- if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code != $conf->currency) {
+ if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
print '';
diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
index 05d059d2bf5..81191e7a84e 100644
--- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
+++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
@@ -166,6 +166,7 @@ ALTER TABLE llx_commandedet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER
ALTER TABLE llx_commande_fournisseurdet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_propaldet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_supplier_proposaldet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
+ALTER TABLE llx_supplier_proposaldet ADD COLUMN fk_unit integer DEFAULT NULL;
ALTER TABLE llx_contratdet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_c_payment_term change fdm type_cdr tinyint;
diff --git a/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql b/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql
index f94df8f2e74..ebe44b0f702 100644
--- a/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql
+++ b/htdocs/install/mysql/tables/llx_supplier_proposaldet.sql
@@ -51,5 +51,6 @@ CREATE TABLE llx_supplier_proposaldet (
multicurrency_subprice double(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,
- multicurrency_total_ttc double(24,8) DEFAULT 0
+ multicurrency_total_ttc double(24,8) DEFAULT 0,
+ fk_unit integer DEFAULT NULL -- lien vers table des unités
) ENGINE=innodb;
\ No newline at end of file
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 213c8d4767e..7cd29345e98 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -82,7 +82,7 @@ Mask=Mask
NextValue=Next value
NextValueForInvoices=Next value (invoices)
NextValueForCreditNotes=Next value (credit notes)
-NextValueForDeposit=Next value (deposit)
+NextValueForDeposit=Next value (down payment)
NextValueForReplacements=Next value (replacements)
MustBeLowerThanPHPLimit=Note: your PHP limits each file upload's size to %s %s, whatever this parameter's value is
NoMaxSizeByPHPLimit=Note: No limit is set in your PHP configuration
@@ -1079,7 +1079,7 @@ TotalNumberOfActivatedModules=Total number of activated feature modules: %s
YouMustEnableOneModule=You must at least enable 1 module
ClassNotFoundIntoPathWarning=Class %s not found into PHP path
YesInSummer=Yes in summer
-OnlyFollowingModulesAreOpenedToExternalUsers=Note, only following modules are open to external users (whatever are permission of such users) and only if permissions were granted:
+OnlyFollowingModulesAreOpenedToExternalUsers=Note, only following modules are opened to external users (whatever are permission of such users) and only if permissions were granted:
SuhosinSessionEncrypt=Session storage encrypted by Suhosin
ConditionIsCurrently=Condition is currently %s
YouUseBestDriver=You use driver %s that is best driver available currently.
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index a6e21b6ff8c..a429fc7159e 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -51,8 +51,8 @@ MemberResiliatedInDolibarr=Member %s terminated
MemberDeletedInDolibarr=Member %s deleted
MemberSubscriptionAddedInDolibarr=Subscription for member %s added
ShipmentValidatedInDolibarr=Shipment %s validated
-ShipmentClassifyClosedInDolibarr=Shipment %s classify billed
-ShipmentUnClassifyCloseddInDolibarr=Shipment %s classify reopened
+ShipmentClassifyClosedInDolibarr=Shipment %s classified billed
+ShipmentUnClassifyCloseddInDolibarr=Shipment %s classified reopened
ShipmentDeletedInDolibarr=Shipment %s deleted
OrderCreatedInDolibarr=Order %s created
OrderValidatedInDolibarr=Order %s validated
diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang
index a6071e38fa5..07a720e6537 100644
--- a/htdocs/langs/en_US/banks.lang
+++ b/htdocs/langs/en_US/banks.lang
@@ -74,13 +74,13 @@ Conciliate=Reconcile
Conciliation=Reconciliation
ReconciliationLate=Reconciliation late
IncludeClosedAccount=Include closed accounts
-OnlyOpenedAccount=Only opened accounts
+OnlyOpenedAccount=Only open accounts
AccountToCredit=Account to credit
AccountToDebit=Account to debit
DisableConciliation=Disable reconciliation feature for this account
ConciliationDisabled=Reconciliation feature disabled
LinkedToAConciliatedTransaction=Linked to a conciliated entry
-StatusAccountOpened=Opened
+StatusAccountOpened=Open
StatusAccountClosed=Closed
AccountIdShort=Number
LineRecord=Transaction
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 7d9fcf3aa63..9ea58263dfd 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -15,9 +15,9 @@ DisabledBecauseNotErasable=Disabled because cannot be erased
InvoiceStandard=Standard invoice
InvoiceStandardAsk=Standard invoice
InvoiceStandardDesc=This kind of invoice is the common invoice.
-InvoiceDeposit=Deposit invoice
-InvoiceDepositAsk=Deposit invoice
-InvoiceDepositDesc=This kind of invoice is done when a deposit has been received.
+InvoiceDeposit=Down payment invoice
+InvoiceDepositAsk=Down payment invoice
+InvoiceDepositDesc=This kind of invoice is done when a down payment has been received.
InvoiceProForma=Proforma invoice
InvoiceProFormaAsk=Proforma invoice
InvoiceProFormaDesc=Proforma invoice is an image of a true invoice but has no accountancy value.
@@ -63,7 +63,7 @@ paymentInInvoiceCurrency=in invoices currency
PaidBack=Paid back
DeletePayment=Delete payment
ConfirmDeletePayment=Are you sure you want to delete this payment?
-ConfirmConvertToReduc=Do you want to convert this credit note or deposit into an absolute discount? The amount will so be saved among all discounts and could be used as a discount for a current or a future invoice for this customer.
+ConfirmConvertToReduc=Do you want to convert this credit note or down payment into an absolute discount? The amount will so be saved among all discounts and could be used as a discount for a current or a future invoice for this customer.
SupplierPayments=Suppliers payments
ReceivedPayments=Received payments
ReceivedCustomersPayments=Payments received from customers
@@ -196,12 +196,12 @@ ShowBill=Show invoice
ShowInvoice=Show invoice
ShowInvoiceReplace=Show replacing invoice
ShowInvoiceAvoir=Show credit note
-ShowInvoiceDeposit=Show deposit invoice
+ShowInvoiceDeposit=Show down payment invoice
ShowInvoiceSituation=Show situation invoice
ShowPayment=Show payment
AlreadyPaid=Already paid
AlreadyPaidBack=Already paid back
-AlreadyPaidNoCreditNotesNoDeposits=Already paid (without credit notes and deposits)
+AlreadyPaidNoCreditNotesNoDeposits=Already paid (without credit notes and down payments)
Abandoned=Abandoned
RemainderToPay=Remaining unpaid
RemainderToTake=Remaining amount to take
@@ -268,10 +268,10 @@ RelativeDiscount=Relative discount
GlobalDiscount=Global discount
CreditNote=Credit note
CreditNotes=Credit notes
-Deposit=Deposit
-Deposits=Deposits
+Deposit=Down payment
+Deposits=Down payments
DiscountFromCreditNote=Discount from credit note %s
-DiscountFromDeposit=Payments from deposit invoice %s
+DiscountFromDeposit=Down payments from invoice %s
AbsoluteDiscountUse=This kind of credit can be used on invoice before its validation
CreditNoteDepositUse=Invoice must be validated to use this kind of credits
NewGlobalDiscount=New absolute discount
@@ -422,7 +422,7 @@ ChequeDeposits=Checks deposits
Cheques=Checks
DepositId=Id deposit
NbCheque=Number of checks
-CreditNoteConvertedIntoDiscount=This credit note or deposit invoice has been converted into %s
+CreditNoteConvertedIntoDiscount=This credit note or down payment invoice has been converted into %s
UsBillingContactAsIncoiveRecipientIfExist=Use customer billing contact address instead of third party address as recipient for invoices
ShowUnpaidAll=Show all unpaid invoices
ShowUnpaidLateOnly=Show late unpaid invoices only
@@ -451,9 +451,9 @@ YouMustCreateStandardInvoiceFirstDesc=You have to create a standard invoice firs
PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (recommended Template)
PDFCrevetteDescription=Invoice PDF template Crevette. A complete invoice template for situation invoices
TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
-MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for deposit invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
+MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for down payment invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module.
-CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for deposit invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
+CactusNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for credit notes and %syymm-nnnn for down payment invoices where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
##### Types de contacts #####
TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice
TypeContact_facture_external_BILLING=Customer invoice contact
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 355f9f3f31c..a8485b1ec6e 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -254,7 +254,7 @@ CustomerRelativeDiscountShort=Relative discount
CustomerAbsoluteDiscountShort=Absolute discount
CompanyHasRelativeDiscount=This customer has a default discount of %s%%
CompanyHasNoRelativeDiscount=This customer has no relative discount by default
-CompanyHasAbsoluteDiscount=This customer still has discount credits or deposits for %s %s
+CompanyHasAbsoluteDiscount=This customer has discount available (credits notes or down payments) for %s %s
CompanyHasCreditNote=This customer still has credit notes for %s %s
CompanyHasNoAbsoluteDiscount=This customer has no discount credit available
CustomerAbsoluteDiscountAllUsers=Absolute discounts (granted by all users)
@@ -385,7 +385,7 @@ ListCustomersShort=List of customers
ThirdPartiesArea=Third parties and contact area
LastModifiedThirdParties=Latest %s modified third parties
UniqueThirdParties=Total of unique third parties
-InActivity=Opened
+InActivity=Open
ActivityCeased=Closed
ThirdPartyIsClosed=Third party is closed
ProductsIntoElements=List of products/services into %s
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index 08f17ed995e..a4080b76b07 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -133,8 +133,8 @@ RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whet
RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries. - It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation.
RulesCADue=- It includes the client's due invoices whether they are paid or not. - It is based on the validation date of these invoices.
RulesCAIn=- It includes all the effective payments of invoices received from clients. - It is based on the payment date of these invoices
-DepositsAreNotIncluded=- Deposit invoices are nor included
-DepositsAreIncluded=- Deposit invoices are included
+DepositsAreNotIncluded=- Down payment invoices are nor included
+DepositsAreIncluded=- Down payment invoices are included
LT2ReportByCustomersInInputOutputModeES=Report by third party IRPF
LT1ReportByCustomersInInputOutputModeES=Report by third party RE
VATReport=VAT report
@@ -168,7 +168,7 @@ DescSellsJournal=Sales Journal
DescPurchasesJournal=Purchases Journal
InvoiceRef=Invoice ref.
CodeNotDef=Not defined
-WarningDepositsNotIncluded=Deposits invoices are not included in this version with this accountancy module.
+WarningDepositsNotIncluded=Down payment invoices are not included in this version with this accountancy module.
DatePaymentTermCantBeLowerThanObjectDate=Payment term date can't be lower than object date.
Pcg_version=Chart of accounts models
Pcg_type=Pcg type
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 1de57126615..216c9187b0f 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -171,7 +171,7 @@ SearchOf=Search
Valid=Valid
Approve=Approve
Disapprove=Disapprove
-ReOpen=Re-Open
+ReOpen=Re-Opened
Upload=Send file
ToLink=Link
Select=Select
@@ -406,7 +406,7 @@ Duration=Duration
TotalDuration=Total duration
Summary=Summary
DolibarrStateBoard=Statistics
-DolibarrWorkBoard=Work tasks board
+DolibarrWorkBoard=Open items board
Available=Available
NotYetAvailable=Not yet available
NotAvailable=Not available
@@ -434,7 +434,7 @@ Reportings=Reporting
Draft=Draft
Drafts=Drafts
Validated=Validated
-Opened=Opened
+Opened=Open
New=New
Discount=Discount
Unknown=Unknown
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index f9c603ce113..8e40307cac6 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -29,9 +29,9 @@ DeleteAProject=Delete a project
DeleteATask=Delete a task
ConfirmDeleteAProject=Are you sure you want to delete this project?
ConfirmDeleteATask=Are you sure you want to delete this task?
-OpenedProjects=Opened projects
-OpenedTasks=Opened tasks
-OpportunitiesStatusForOpenedProjects=Opportunities amount of opened projects by status
+OpenedProjects=Open projects
+OpenedTasks=Open tasks
+OpportunitiesStatusForOpenedProjects=Opportunities amount of open projects by status
OpportunitiesStatusForProjects=Opportunities amount of projects by status
ShowProject=Show project
SetProject=Set project
@@ -47,7 +47,7 @@ TaskTimeSpent=Time spent on tasks
TaskTimeUser=User
TaskTimeNote=Note
TaskTimeDate=Date
-TasksOnOpenedProject=Tasks on opened projects
+TasksOnOpenedProject=Tasks on open projects
WorkloadNotDefined=Workload not defined
NewTimeSpent=New time spent
MyTimeSpent=My time spent
@@ -179,9 +179,9 @@ ProjectsStatistics=Statistics on projects/leads
TaskAssignedToEnterTime=Task assigned. Entering time on this task should be possible.
IdTaskTime=Id task time
YouCanCompleteRef=If you want to complete the ref with some information (to use it as search filters), it is recommanded to add a - character to separate it, so the automatic numbering will still work correctly for next projects. For example %s-ABC. You may also prefer to add search keys into label. But best practice may be to add a dedicated field, also called complementary attributes.
-OpenedProjectsByThirdparties=Opened projects by thirdparties
+OpenedProjectsByThirdparties=Open projects by thirdparties
OnlyOpportunitiesShort=Only opportunities
-OpenedOpportunitiesShort=Opened opportunities
+OpenedOpportunitiesShort=Open opportunities
NotAnOpportunityShort=Not an opportunity
OpportunityTotalAmount=Opportunities total amount
OpportunityPonderatedAmount=Opportunities weighted amount
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index cd76dd46f43..f383af9f1af 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -3,7 +3,7 @@ Proposals=Commercial proposals
Proposal=Commercial proposal
ProposalShort=Proposal
ProposalsDraft=Draft commercial proposals
-ProposalsOpened=Opened commercial proposals
+ProposalsOpened=Open commercial proposals
Prop=Commercial proposals
CommercialProposal=Commercial proposal
ProposalCard=Proposal card
@@ -26,9 +26,9 @@ AmountOfProposalsByMonthHT=Amount by month (net of tax)
NbOfProposals=Number of commercial proposals
ShowPropal=Show proposal
PropalsDraft=Drafts
-PropalsOpened=Opened
+PropalsOpened=Open
PropalStatusDraft=Draft (needs to be validated)
-PropalStatusValidated=Validated (proposal is opened)
+PropalStatusValidated=Validated (proposal is open)
PropalStatusSigned=Signed (needs billing)
PropalStatusNotSigned=Not signed (closed)
PropalStatusBilled=Billed
diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang
index 1b90020edde..ef6fe44856b 100644
--- a/htdocs/langs/en_US/sendings.lang
+++ b/htdocs/langs/en_US/sendings.lang
@@ -51,10 +51,10 @@ ActionsOnShipping=Events on shipment
LinkToTrackYourPackage=Link to track your package
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
ShipmentLine=Shipment line
-ProductQtyInCustomersOrdersRunning=Product quantity into opened customers orders
-ProductQtyInSuppliersOrdersRunning=Product quantity into opened suppliers orders
-ProductQtyInShipmentAlreadySent=Product quantity from opened customer order already sent
-ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from opened supplier order already received
+ProductQtyInCustomersOrdersRunning=Product quantity into open customers orders
+ProductQtyInSuppliersOrdersRunning=Product quantity into open suppliers orders
+ProductQtyInShipmentAlreadySent=Product quantity from oped customer order already sent
+ProductQtyInSuppliersShipmentAlreadyRecevied=Product quantity from open supplier order already received
NoProductToShipFoundIntoStock=No product to ship found into warehouse %s. Correct stock or go back to choose another warehouse.
WeightVolShort=Weight/Vol.
ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments.
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 58a71b08857..746268f7e98 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -72,7 +72,7 @@ RealStock=Real Stock
RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements.
RealStockWillAutomaticallyWhen=The real stock will automatically change according to this rules (see stock module setup to change this):
VirtualStock=Virtual stock
-VirtualStockDesc=Virtual stock is the stock you will get once all opened pending actions that affect stocks will be closed (supplier order received, customer order shipped, ...)
+VirtualStockDesc=Virtual stock is the stock you will get once all open pending actions that affect stocks will be closed (supplier order received, customer order shipped, ...)
IdWarehouse=Id warehouse
DescWareHouse=Description warehouse
LieuWareHouse=Localisation warehouse
diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang
index 61b031459b0..621d7784e35 100644
--- a/htdocs/langs/en_US/supplier_proposal.lang
+++ b/htdocs/langs/en_US/supplier_proposal.lang
@@ -8,7 +8,7 @@ SearchRequest=Find a request
DraftRequests=Draft requests
SupplierProposalsDraft=Draft supplier proposals
LastModifiedRequests=Latest %s modified price requests
-RequestsOpened=Opened price requests
+RequestsOpened=Open price requests
SupplierProposalArea=Supplier proposals area
SupplierProposalShort=Supplier proposal
SupplierProposals=Supplier proposals
@@ -23,7 +23,7 @@ ConfirmValidateAsk=Are you sure you want to validate this price request under na
DeleteAsk=Delete request
ValidateAsk=Validate request
SupplierProposalStatusDraft=Draft (needs to be validated)
-SupplierProposalStatusValidated=Validated (request is opened)
+SupplierProposalStatusValidated=Validated (request is open)
SupplierProposalStatusClosed=Closed
SupplierProposalStatusSigned=Accepted
SupplierProposalStatusNotSigned=Refused
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index c5181edf0bc..dd45222fa42 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -577,9 +577,10 @@ if (! defined('NOLOGIN'))
{
// We are already into an authenticated session
$login=$_SESSION["dol_login"];
- dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login, LOG_DEBUG);
+ $entity=$_SESSION["dol_entity"];
+ dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);
- $resultFetchUser=$user->fetch('',$login);
+ $resultFetchUser=$user->fetch('',$login,'',1,($entity > 0 ? $entity : -1));
if ($resultFetchUser <= 0)
{
// Account has been removed after login
diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php
index e284572e7e7..224acd9c04b 100644
--- a/htdocs/product/admin/price_rules.php
+++ b/htdocs/product/admin/price_rules.php
@@ -155,7 +155,6 @@ $genPriceOptions = function($level) use ($price_options) {
return $return;
};
-
?>
@@ -173,7 +172,8 @@ $genPriceOptions = function($level) use ($price_options) {
trans('SellingPrice').' '.$i;
// Label of price
- if (! empty($conf->global->{"PRODUIT_MULTIPRICES_LABEL$i"})) {
+ $keyforlabel='PRODUIT_MULTIPRICES_LABEL'.$i;
+ if (! empty($conf->global->$keyforlabel)) {
print ' - '.$langs->trans($conf->global->$keyforlabel);
}
?>
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index e34e7c2cfce..48badb5623e 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -12,7 +12,7 @@
* Copyright (C) 2014 Henry Florian
* Copyright (C) 2014-2016 Philippe Grand
* Copyright (C) 2014 Ion agorria
- * Copyright (C) 2016 Ferran Marcet
+ * Copyright (C) 2016-2017 Ferran Marcet
*
* 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
@@ -816,7 +816,7 @@ class Product extends CommonObject
// End call triggers
}
- if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref != $this->ref))
+ if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
{
// We remove directory
if ($conf->product->dir_output)
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index fc1eb7410e3..416c0fd5dcc 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -3,7 +3,8 @@
* Copyright (C) 2005-2016 Laurent Destailleur
* Copyright (C) 2005-2010 Regis Houssin
* Copyright (C) 2013 Florian Henry
- * Copyright (C) 2014-2015 Marcos García
+ * Copyright (C) 2014-2017 Marcos García
+ * Copyright (C) 2017 Ferran Marcet
*
* 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
@@ -301,7 +302,7 @@ class Project extends CommonObject
}
}
- if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref != $this->ref))
+ if (! $error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref))
{
// We remove directory
if ($conf->projet->dir_output)
@@ -1736,16 +1737,19 @@ class Project extends CommonObject
*/
function load_state_board()
{
- global $conf;
+ global $user;
$this->nb=array();
- $sql = "SELECT count(u.rowid) as nb";
- $sql.= " FROM ".MAIN_DB_PREFIX."projet as u";
+ $sql = "SELECT count(p.rowid) as nb";
+ $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " WHERE";
- //$sql.= " WHERE u.fk_statut > 0";
- //$sql.= " AND employee != 0";
- $sql.= " u.entity IN (".getEntity('projet', 1).")";
+ $sql.= " p.entity IN (".getEntity('projet', 1).")";
+ if (! $user->rights->projet->all->lire)
+ {
+ $projectsListId = $this->getProjectsAuthorizedForUser($user,0,1);
+ $sql .= "AND p.rowid IN (".$projectsListId.")";
+ }
$resql=$this->db->query($sql);
if ($resql)
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index a39c05c8999..fea4093e175 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -680,7 +680,9 @@ foreach ($listofreferent as $key => $value)
{
$addform.='';
if ($testnew) $addform.=' '.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).'';
- else $addform.=' '.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).'';
+ elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) {
+ $addform.=' '.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).'';
+ }
$addform.=' ';
}
@@ -1041,7 +1043,7 @@ foreach ($listofreferent as $key => $value)
print ' ';
if (empty($value['disableamount']))
{
- if (! empty($conf->salaries->enabled)) print ''.$langs->trans("TotalHT").' : '.price($total_ht);
+ if ($tablename != 'projet_task' || ! empty($conf->salaries->enabled)) print ''.$langs->trans("TotalHT").' : '.price($total_ht);
}
print ' | ';
//if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("TotalTTC").' : '.price($total_ttc).' | ';
@@ -1049,8 +1051,7 @@ foreach ($listofreferent as $key => $value)
print '';
if (empty($value['disableamount']))
{
-
- if (! empty($conf->salaries->enabled)) print $langs->trans("TotalTTC").' : '.price($total_ttc);
+ if ($tablename != 'projet_task' || ! empty($conf->salaries->enabled)) print $langs->trans("TotalTTC").' : '.price($total_ttc);
}
print ' | ';
print ' | ';
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 68077621771..dadc199d146 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -196,6 +196,7 @@ $title=$langs->trans("Projects");
if ($search_user == $user->id) $title=$langs->trans("MyProjects");
// Get list of project id allowed to user (in a string list separated by coma)
+$projectsListId='';
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1,$socid);
// Get id of types of contacts for projects (This list never contains a lot of elements)
@@ -245,7 +246,7 @@ if ($search_user > 0)
$sql.= " WHERE p.entity IN (".getEntity('project',1).')';
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
// No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser
-if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
+if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$db->escape($search_categ);
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index e02a512f327..050e0186444 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -354,7 +354,7 @@ if (empty($reshook))
$array_options = $lines[$i]->array_options;
}
- $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options);
+ $result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $lines[$i]->tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $array_options, $lines[$i]->ref_fourn, $lines[$i]->fk_unit);
if ($result > 0) {
$lineid = $result;
@@ -633,7 +633,8 @@ if (empty($reshook))
$buyingprice,
$label,
$array_options,
- $ref_fourn
+ $ref_fourn,
+ $fk_unit
);
//var_dump($tva_tx);var_dump($productsupplier->fourn_pu);var_dump($price_base_type);exit;
}
@@ -683,7 +684,7 @@ if (empty($reshook))
$price_base_type = 'HT';
}
- $result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_fourn);
+ $result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $ttc, $info_bits, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $ref_fourn, $fk_unit);
//$result = $object->addline($desc, $ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 0, '', $remise_percent, $price_base_type, $ttc, $type,'','', $date_start, $date_end, $array_options, $fk_unit);
}
@@ -826,7 +827,8 @@ if (empty($reshook))
if (! $error) {
$db->begin();
$ref_fourn = GETPOST('fourn_ref');
- $result = $object->updateline(GETPOST('lineid'), $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $array_options, $ref_fourn);
+ $fk_unit = GETPOST('units');
+ $result = $object->updateline(GETPOST('lineid'), $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $array_options, $ref_fourn, $fk_unit);
if ($result >= 0) {
$db->commit();
@@ -1040,6 +1042,15 @@ if ($action == 'create')
$objectsrc->fetch_optionals($originid);
$object->array_options = $objectsrc->array_options;
+ if (!empty($conf->multicurrency->enabled))
+ {
+ if (!empty($objectsrc->multicurrency_code)) $currency_code = $objectsrc->multicurrency_code;
+ if (!empty($conf->global->MULTICURRENCY_USE_ORIGIN_TX) && !empty($objectsrc->multicurrency_tx)) $currency_tx = $objectsrc->multicurrency_tx;
+ }
+ }
+ else
+ {
+ if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
}
$object = new SupplierProposal($db);
@@ -1149,7 +1160,6 @@ if ($action == 'create')
print '';
print '| '.fieldLabel('Currency','multicurrency_code').' | ';
print '';
- $currency_code = (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : ($object->multicurrency_code ? $object->multicurrency_code : $conf->currency));
print $form->selectMultiCurrency($currency_code, 'multicurrency_code');
print ' | ';
}
@@ -1196,6 +1206,13 @@ if ($action == 'create')
print '| ' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ' | ' . price($objectsrc->total_localtax2) . " | ";
}
print '| ' . $langs->trans('TotalTTC') . ' | ' . price($objectsrc->total_ttc) . " | ";
+
+ if (!empty($conf->multicurrency->enabled))
+ {
+ print '| ' . $langs->trans('MulticurrencyTotalHT') . ' | ' . price($objectsrc->multicurrency_total_ht) . ' | ';
+ print '| ' . $langs->trans('MulticurrencyTotalVAT') . ' | ' . price($objectsrc->multicurrency_total_tva) . " | ";
+ print '| ' . $langs->trans('MulticurrencyTotalTTC') . ' | ' . price($objectsrc->multicurrency_total_ttc) . " | ";
+ }
}
print " | \n";
@@ -1491,14 +1508,22 @@ if ($action == 'create')
print '';
print ' | ';
- if ($action == 'editmulticurrencyrate') {
- $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
+ if ($action == 'editmulticurrencyrate' || $action == 'actualizemulticurrencyrate') {
+ if($action == 'actualizemulticurrencyrate') {
+ list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code);
+ }
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'multicurrency_tx', $object->multicurrency_code);
} else {
- $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
+ $form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code);
+ if($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
+ print '';
+ }
}
print ' | ';
}
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index d666f421cdb..85bba0ad6e6 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -355,11 +355,12 @@ class SupplierProposal extends CommonObject
* @param string $label ???
* @param array $array_option extrafields array
* @param string $ref_fourn Supplier price reference
+ * @param int $fk_unit Id of the unit to use.
* @return int >0 if OK, <0 if KO
*
* @see add_product
*/
- function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$array_option=0, $ref_fourn='')
+ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$array_option=0, $ref_fourn='', $fk_unit='')
{
global $mysoc;
@@ -460,6 +461,7 @@ class SupplierProposal extends CommonObject
$this->line->product_type=$type;
$this->line->special_code=$special_code;
$this->line->fk_parent_line=$fk_parent_line;
+ $this->line->fk_unit=$fk_unit;
$this->line->ref_fourn = $this->db->escape($ref_fourn);
@@ -546,9 +548,10 @@ class SupplierProposal extends CommonObject
* @param int $type 0/1=Product/service
* @param array $array_option extrafields array
* @param string $ref_fourn Supplier price reference
+ * @param int $fk_unit Id of the unit to use.
* @return int 0 if OK, <0 if KO
*/
- function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $array_option=0, $ref_fourn='')
+ function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $array_option=0, $ref_fourn='', $fk_unit='')
{
global $conf,$user,$langs, $mysoc;
@@ -634,7 +637,8 @@ class SupplierProposal extends CommonObject
$this->line->special_code = $special_code;
$this->line->fk_parent_line = $fk_parent_line;
$this->line->skip_update_total = $skip_update_total;
- $this->line->ref_fourn = $ref_fourn;
+ $this->line->ref_fourn = $ref_fourn;
+ $this->line->fk_unit = $fk_unit;
// infos marge
if (!empty($fk_product) && empty($fk_fournprice) && empty($pa_ht)) {
@@ -1195,7 +1199,7 @@ class SupplierProposal extends CommonObject
$sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,";
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,';
$sql.= ' d.ref_fourn as ref_produit_fourn,';
- $sql.= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc';
+ $sql.= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc, d.fk_unit';
$sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposaldet as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid";
$sql.= " WHERE d.fk_supplier_proposal = ".$this->id;
@@ -1261,6 +1265,7 @@ class SupplierProposal extends CommonObject
$line->multicurrency_total_ht = $objp->multicurrency_total_ht;
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
+ $line->fk_unit = $objp->fk_unit;
$this->lines[$i] = $line;
@@ -2429,7 +2434,7 @@ class SupplierProposal extends CommonObject
$sql.= ' pt.product_type, pt.rang, pt.fk_parent_line,';
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,';
$sql.= ' p.description as product_desc, pt.ref_fourn as ref_produit_fourn';
- $sql.= ' ,pt.fk_multicurrency, pt.multicurrency_code, pt.multicurrency_subprice, pt.multicurrency_total_ht, pt.multicurrency_total_tva, pt.multicurrency_total_ttc';
+ $sql.= ' ,pt.fk_multicurrency, pt.multicurrency_code, pt.multicurrency_subprice, pt.multicurrency_total_ht, pt.multicurrency_total_tva, pt.multicurrency_total_ttc, pt.fk_unit';
$sql.= ' FROM '.MAIN_DB_PREFIX.'supplier_proposaldet as pt';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid';
$sql.= ' WHERE pt.fk_supplier_proposal = '.$this->id;
@@ -2484,6 +2489,7 @@ class SupplierProposal extends CommonObject
$this->lines[$i]->multicurrency_total_ht = $obj->multicurrency_total_ht;
$this->lines[$i]->multicurrency_total_tva = $obj->multicurrency_total_tva;
$this->lines[$i]->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
+ $this->lines[$i]->fk_unit = $obj->fk_unit;
$i++;
}
@@ -2557,7 +2563,7 @@ class SupplierProposal extends CommonObject
* \class SupplierProposalLine
* \brief Class to manage supplier_proposal lines
*/
-class SupplierProposalLine extends CommonObject
+class SupplierProposalLine extends CommonObjectLine
{
var $db;
var $error;
@@ -2693,7 +2699,7 @@ class SupplierProposalLine extends CommonObject
$sql.= ' pd.localtax1_tx, pd.localtax2_tx, pd.total_localtax1, pd.total_localtax2,';
$sql.= ' p.ref as product_ref, p.label as product_label, p.description as product_desc,';
$sql.= ' pd.product_type, pd.ref_fourn as ref_produit_fourn,';
- $sql.= ' pd.fk_multicurrency, pd.multicurrency_code, pd.multicurrency_subprice, pd.multicurrency_total_ht, pd.multicurrency_total_tva, pd.multicurrency_total_ttc';
+ $sql.= ' pd.fk_multicurrency, pd.multicurrency_code, pd.multicurrency_subprice, pd.multicurrency_total_ht, pd.multicurrency_total_tva, pd.multicurrency_total_ttc, pd.fk_unit';
$sql.= ' FROM '.MAIN_DB_PREFIX.'supplier_proposaldet as pd';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pd.fk_product = p.rowid';
$sql.= ' WHERE pd.rowid = '.$rowid;
@@ -2749,6 +2755,7 @@ class SupplierProposalLine extends CommonObject
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
+ $this->fk_unit = $objp->fk_unit;
$this->db->free($result);
}
@@ -2787,7 +2794,8 @@ class SupplierProposalLine extends CommonObject
if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
-
+ if (empty($this->fk_unit)) $this->fk_unit=0;
+
if (empty($this->pa_ht)) $this->pa_ht=0;
// if buy price not defined, define buyprice as configured in margin admin
@@ -2816,7 +2824,7 @@ class SupplierProposalLine extends CommonObject
$sql.= ' info_bits, ';
$sql.= ' total_ht, total_tva, total_localtax1, total_localtax2, total_ttc, fk_product_fournisseur_price, buy_price_ht, special_code, rang,';
$sql.= ' ref_fourn';
- $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, fk_unit)';
$sql.= " VALUES (".$this->fk_supplier_proposal.",";
$sql.= " ".($this->fk_parent_line>0?"'".$this->fk_parent_line."'":"null").",";
$sql.= " ".(! empty($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
@@ -2849,7 +2857,8 @@ class SupplierProposalLine extends CommonObject
$sql.= ", ".$this->multicurrency_total_ht;
$sql.= ", ".$this->multicurrency_total_tva;
$sql.= ", ".$this->multicurrency_total_ttc;
- $sql.= ')';
+ $sql.= ", ".$this->fk_unit;
+ $sql.= ')';
dol_syslog(get_class($this).'::insert', LOG_DEBUG);
$resql=$this->db->query($sql);
@@ -2969,7 +2978,8 @@ class SupplierProposalLine extends CommonObject
if (empty($this->special_code)) $this->special_code=0;
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
-
+ if (empty($this->fk_unit)) $this->fk_unit=0;
+
if (empty($this->pa_ht)) $this->pa_ht=0;
// if buy price not defined, define buyprice as configured in margin admin
@@ -3023,8 +3033,9 @@ class SupplierProposalLine extends CommonObject
$sql.= " , multicurrency_total_ht=".price2num($this->multicurrency_total_ht)."";
$sql.= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva)."";
$sql.= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc)."";
+ $sql.= " , fk_unit=".$this->fk_unit;
- $sql.= " WHERE rowid = ".$this->rowid;
+ $sql.= " WHERE rowid = ".$this->rowid;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql=$this->db->query($sql);
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 7c699c31e7f..966493861c8 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -2973,8 +2973,15 @@ div.tabBar .noborder {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- width: 110px;
+ width: 115px;
}
+@media only screen and (max-width: 767px)
+{
+ .boxstats {
+ width: 100px;
+ }
+}
+
.boxstats:hover {
box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.20);
}
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 4c5016268a8..c2d76f9d9d0 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -2854,7 +2854,13 @@ div .tdtop {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- width: 110px;
+ width: 115px;
+}
+@media only screen and (max-width: 767px)
+{
+ .boxstats {
+ width: 100px;
+ }
}
.boxstats:hover {
box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.20);