diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index cf5d3477527..9cb76a2f292 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1349,7 +1349,7 @@ if (empty($reshook)) if (empty($amount)) continue; $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); - $descline = $langs->trans('Deposit'); + $descline = '(DEPOSIT)'; //$descline.= ' - '.$langs->trans($arraylist[$typeamount]); if ($typeamount=='amount') { $descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 6a83d25070b..38e91d92d69 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -40,6 +40,7 @@ $year=GETPOST("year", "int"); if (empty($year)) { $year_current = strftime("%Y", dol_now()); + if ($conf->global->SOCIETE_FISCAL_MONTH_START > date('m')) $year_current--; $year_start = $year_current; } else { $year_current = $year; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 27d087b2fde..59d523b6b44 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -358,6 +358,7 @@ class Notify $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action"; $sql.= " AND n.fk_soc = s.rowid"; + $sql.= " AND c.statut = 1"; if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage else $sql.= " AND a.code = '".$notifcode."'"; // New usage $sql .= " AND s.rowid = ".$object->socid; @@ -372,6 +373,7 @@ class Notify $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql.= " ".MAIN_DB_PREFIX."notify_def as n"; $sql.= " WHERE n.fk_user = c.rowid AND a.rowid = n.fk_action"; + $sql.= " AND c.statut = 1"; if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage else $sql.= " AND a.code = '".$this->db->escape($notifcode)."'"; // New usage diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 192c62bc6b8..3cd302ebdbb 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -52,7 +52,7 @@ function societe_prepare_head(Societe $object) if (empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) { - if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->societe->contact->lire) { //$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); $nbContact = 0; // TODO diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 56ca215e118..ac407bd42a1 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1263,6 +1263,9 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; } } + elseif ($object->type == Facture::TYPE_DEPOSIT && $object->element == 'facture') { + $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); + } // Description short of product line $libelleproduitservice=$label; @@ -1289,9 +1292,9 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $sourceref=!empty($discount->discount_type)?$discount->ref_invoive_supplier_source:$discount->ref_facture_source; $libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec, 'day', '', $outputlangs).')'; + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.= ' ('.dol_print_date($discount->datec, 'day', '', $outputlangs).')'; } - if ($desc == '(EXCESS RECEIVED)' && $object->lines[$i]->fk_remise_except) + elseif ($desc == '(EXCESS RECEIVED)' && $object->lines[$i]->fk_remise_except) { $discount=new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index dbf3ede88f9..5d1d98a491c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -257,11 +257,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled) || ! empty($conf->supplier_invoice->enabled) || - ! empty($conf->loan->enabled) + ! empty($conf->loan->enabled) || + ! empty($conf->margins->enabled) )?1:0, 'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->contact->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) - || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read)), + || ! empty($user->rights->fournisseur->facture->lire) || ! empty($user->rights->loan->read) || ! empty($user->rights->margins->liretous)), 'module'=>'facture|supplier_invoice|don|tax|salaries|loan' ); $menu_arr[] = array( diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 59a3cc46f67..b8cff0f6697 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -155,6 +155,8 @@ class pdf_rouget extends ModelePdfExpedition $this->posxtotalht=$this->page_largeur - $this->marge_droite - 20; } + if(!empty($conf->global->SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME)) $this->posxweightvol = $this->posxqtyordered; + $this->posxpicture=$this->posxweightvol - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images // To work with US executive format diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index d048b6f7c9d..30d84f83d32 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -138,6 +138,8 @@ $domData .= ' data-product_type="'.$line->product_type.'"'; if (! empty($line->label)) { $text.= ' '.$line->label.''; echo $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); + } elseif (strpos($line->description, '(DEPOSIT)') === 0) { + echo $text.' '.str_replace('(DEPOSIT)', $langs->trans("Deposit"), $line->description);; } else { if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); echo $text.' '.dol_htmlentitiesbr($line->description); diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 2ba29aef106..a4e6cd57870 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -561,7 +561,7 @@ if ($id > 0) } else { - print $object->rate . '%'; + print price($object->rate) . '%'; } print ''; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index f262805b3fe..73150e85ea2 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -341,6 +341,7 @@ class Loan extends CommonObject $sql.= " datestart='".$this->db->idate($this->datestart)."',"; $sql.= " dateend='".$this->db->idate($this->dateend)."',"; $sql.= " nbterm=".$this->nbterm.","; + $sql.= " rate=".$this->db->escape($this->rate).","; $sql.= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',"; $sql.= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',"; $sql.= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',"; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index c390f9599c8..22dfd0146b1 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -42,7 +42,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); $fieldtype = (! empty($ref) ? 'ref' : 'rowid'); if (! empty($user->societe_id)) $socid=$user->societe_id; $result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); -$result=restrictedArea($user, 'margins'); +if(empty($user->rights->margins->liretous)) accessforbidden(); $mesg = ''; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 09db1c0362d..afb1dda37a9 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -38,6 +38,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); $fieldtype = (! empty($ref) ? 'ref' : 'rowid'); if (! empty($user->societe_id)) $socid=$user->societe_id; $result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +if(empty($user->rights->margins->liretous)) accessforbidden(); $object = new Product($db); diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index a49500d930b..e8853ebfff8 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -88,6 +88,7 @@ if (! empty($canvas)) // Security check $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas); +if(empty($user->rights->societe->contact->lire)) accessforbidden();