diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 59225f2dc89..7392ca23905 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -1012,13 +1012,13 @@ if ($id)
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
- if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
- if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
+ if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
+ if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit' || $fieldlist[$field]=='metric') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; }
- if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
- if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
- if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
+ if ($fieldlist[$field]=='accountancy_code') { $valuetoshow=$langs->trans("AccountancyCode"); }
+ if ($fieldlist[$field]=='accountancy_code_sell') { $valuetoshow=$langs->trans("AccountancyCodeSell"); }
+ if ($fieldlist[$field]=='accountancy_code_buy') { $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountparent"); }
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
@@ -1039,7 +1039,7 @@ if ($id)
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
- if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
+ if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("WithCounter"); }
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
@@ -1211,7 +1211,7 @@ if ($id)
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
- if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
+ if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("WithCounter"); }
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
@@ -1772,6 +1772,8 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
print '
';
$size=''; $class='';
if ($fieldlist[$field]=='code') $class='maxwidth100';
+ if ($fieldlist[$field]=='affect') $class='maxwidth50';
+ if ($fieldlist[$field]=='delay') $class='maxwidth50';
if ($fieldlist[$field]=='position') $class='maxwidth50';
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
if ($fieldlist[$field]=='tracking') $class='quatrevingtpercent';
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index d5a492bf7d6..810d6bd1abb 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1321,8 +1321,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);
@@ -1500,7 +1510,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 ' |
';
}
@@ -2038,7 +2047,7 @@ if ($action == 'create')
print '';
print '';
@@ -2049,7 +2058,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 7db6c28e89d..cf14e1cac48 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2188,7 +2188,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '';
print ' | ';
@@ -2199,7 +2199,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/card.php b/htdocs/compta/facture/card.php
index 4cbad38902f..88ce6ca10e0 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -3368,7 +3368,7 @@ else if ($id > 0 || ! empty($ref))
print '';
print ' | ';
@@ -3379,7 +3379,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 10971a3b452..ca89cdd8d18 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -2106,7 +2106,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 6bd2e662b64..14a21d9712d 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 10ec22ce5f5..e606e6570f3 100644
--- a/htdocs/core/boxes/box_produits.php
+++ b/htdocs/core/boxes/box_produits.php
@@ -112,7 +112,7 @@ class box_produits extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => '',
+ '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,
);
diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php
index 1367caed866..0097d3d48e0 100644
--- a/htdocs/core/boxes/box_produits_alerte_stock.php
+++ b/htdocs/core/boxes/box_produits_alerte_stock.php
@@ -119,7 +119,7 @@ class box_produits_alerte_stock extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => '',
+ '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,
);
diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php
index 4277481499f..4c4e8085592 100644
--- a/htdocs/core/boxes/box_project.php
+++ b/htdocs/core/boxes/box_project.php
@@ -139,7 +139,7 @@ class box_project extends ModeleBoxes
'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' => 'class="right"',
'text' => round($objTask->totprogress/$objTask->nb, 0)."%",
diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php
index b33079d2ab0..0151ba24966 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/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/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 6c2c7eb69a5..6a4c44624af 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;
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index c624eaa6c77..b35c1143031 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1893,7 +1893,7 @@ elseif (! empty($object->id))
print '';
print ' | ';
@@ -1904,7 +1904,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 8a73f783642..afc2dda78ea 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1839,17 +1839,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)." |
";
@@ -2208,7 +2205,7 @@ else
print '';
print '';
@@ -2219,7 +2216,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/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 69881d693c6..47f66cd917e 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -85,7 +85,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
@@ -303,6 +303,7 @@ CallUpdatePage=Go to the page that updates the database structure and data: %s.
LastStableVersion=Latest stable version
LastActivationDate=Latest activation date
UpdateServerOffline=Update server offline
+WithCounter=Manage a counter
GenericMaskCodes=You may enter any numbering mask. In this mask, the following tags could be used: {000000} corresponds to a number which will be incremented on each %s. Enter as many zeros as the desired length of the counter. The counter will be completed by zeros from the left in order to have as many zeros as the mask. {000000+000} same as previous but an offset corresponding to the number to the right of the + sign is applied starting on first %s. {000000@x} same as previous but the counter is reset to zero when month x is reached (x between 1 and 12, or 0 to use the early months of fiscal year defined in your configuration, or 99 to reset to zero every month). If this option is used and x is 2 or higher, then sequence {yy}{mm} or {yyyy}{mm} is also required. {dd} day (01 to 31). {mm} month (01 to 12). {yy}, {yyyy} or {y} year over 2, 4 or 1 numbers.
GenericMaskCodes2={cccc} the client code on n characters {cccc000} the client code on n characters is followed by a counter dedicated for customer. This counter dedicated to customer is reset at same time than global counter. {tttt} The code of third party type on n characters (see dictionary-thirdparty types).
GenericMaskCodes3=All other characters in the mask will remain intact. Spaces are not allowed.
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 067734d2d27..a4d6ab8d324 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.
@@ -62,7 +62,7 @@ PaymentsBack=Payments back
paymentInInvoiceCurrency=in invoices currency
PaidBack=Paid back
DeletePayment=Delete payment
-ConfirmDeletePayment=Are you sure you want to delete this payment ?
+ConfirmDeletePayment=Are you sure you want to delete this payment?
ConfirmConvertToReduc=Do you want to convert this %s 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
@@ -198,12 +198,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
@@ -270,11 +270,15 @@ 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
+<<<<<<< HEAD
DiscountFromDeposit=Payments from deposit invoice %s
DiscountFromExcessReceived=Payments from excess received of invoice %s
+=======
+DiscountFromDeposit=Down payments from invoice %s
+>>>>>>> branch '5.0' of git@github.com:Dolibarr/dolibarr.git
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
@@ -433,7 +437,11 @@ ChequeDeposits=Checks deposits
Cheques=Checks
DepositId=Id deposit
NbCheque=Number of checks
+<<<<<<< HEAD
CreditNoteConvertedIntoDiscount=This %s has been converted into %s
+=======
+CreditNoteConvertedIntoDiscount=This credit note or down payment invoice has been converted into %s
+>>>>>>> branch '5.0' of git@github.com:Dolibarr/dolibarr.git
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
@@ -462,9 +470,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 8fc208e9e3f..505d1c0b302 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -258,7 +258,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)
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index aa5f2195a56..c85a2671c21 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -135,8 +135,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
@@ -170,7 +170,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/main.inc.php b/htdocs/main.inc.php
index 45787d5054b..9c0a98cbcfb 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 815e1dd005c..23be6de5111 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
* Copyright (C) 2017 Gustavo Novaro
*
* This program is free software; you can redistribute it and/or modify
@@ -937,7 +937,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 94c49d6d0ef..eeb10281c3a 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
@@ -307,7 +308,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)
@@ -1744,16 +1745,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 e10196b8784..eec48b2a5bd 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -726,7 +726,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.=' ';
}
@@ -1095,7 +1097,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).' | ';
@@ -1103,8 +1105,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/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index d05d3490776..271bd1ef0d6 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1040,6 +1040,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 +1158,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 +1204,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 +1506,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/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index c956f6e7801..c1b0ece5df0 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -2867,8 +2867,15 @@ div.tabBar .noborder {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- width: 105px;
+ 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 7c37c63ff16..3c3e60ca129 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -2783,7 +2783,13 @@ div .tdtop {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
- width: 105px;
+ 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);