Conflicts:
	htdocs/compta/tva/index.php
	htdocs/core/lib/pdf.lib.php
	htdocs/core/menus/standard/eldy.lib.php
	htdocs/core/tpl/objectline_view.tpl.php
	htdocs/margin/productMargins.php
	htdocs/margin/tabs/productMargins.php
This commit is contained in:
Laurent Destailleur 2019-12-01 10:30:22 +01:00
commit 6bf3af5d83
13 changed files with 22 additions and 8 deletions

View File

@ -1349,7 +1349,7 @@ if (empty($reshook))
if (empty($amount)) continue; if (empty($amount)) continue;
$arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount'); $arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount');
$descline = $langs->trans('Deposit'); $descline = '(DEPOSIT)';
//$descline.= ' - '.$langs->trans($arraylist[$typeamount]); //$descline.= ' - '.$langs->trans($arraylist[$typeamount]);
if ($typeamount=='amount') { if ($typeamount=='amount') {
$descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')'; $descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')';

View File

@ -40,6 +40,7 @@ $year=GETPOST("year", "int");
if (empty($year)) if (empty($year))
{ {
$year_current = strftime("%Y", dol_now()); $year_current = strftime("%Y", dol_now());
if ($conf->global->SOCIETE_FISCAL_MONTH_START > date('m')) $year_current--;
$year_start = $year_current; $year_start = $year_current;
} else { } else {
$year_current = $year; $year_current = $year;

View File

@ -358,6 +358,7 @@ class Notify
$sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action"; $sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
$sql.= " AND n.fk_soc = s.rowid"; $sql.= " AND n.fk_soc = s.rowid";
$sql.= " AND c.statut = 1";
if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
else $sql.= " AND a.code = '".$notifcode."'"; // New usage else $sql.= " AND a.code = '".$notifcode."'"; // New usage
$sql .= " AND s.rowid = ".$object->socid; $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."c_action_trigger as a,";
$sql.= " ".MAIN_DB_PREFIX."notify_def as n"; $sql.= " ".MAIN_DB_PREFIX."notify_def as n";
$sql.= " WHERE n.fk_user = c.rowid AND a.rowid = n.fk_action"; $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 if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
else $sql.= " AND a.code = '".$this->db->escape($notifcode)."'"; // New usage else $sql.= " AND a.code = '".$this->db->escape($notifcode)."'"; // New usage

View File

@ -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_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 = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$nbContact = 0; // TODO $nbContact = 0; // TODO

View File

@ -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"]; 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 // Description short of product line
$libelleproduitservice=$label; $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; $sourceref=!empty($discount->discount_type)?$discount->ref_invoive_supplier_source:$discount->ref_facture_source;
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); $libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref);
// Add date of deposit // 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=new DiscountAbsolute($db);
$discount->fetch($object->lines[$i]->fk_remise_except); $discount->fetch($object->lines[$i]->fk_remise_except);

View File

@ -257,11 +257,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
! empty($conf->tax->enabled) || ! empty($conf->tax->enabled) ||
! empty($conf->salaries->enabled) || ! empty($conf->salaries->enabled) ||
! empty($conf->supplier_invoice->enabled) || ! empty($conf->supplier_invoice->enabled) ||
! empty($conf->loan->enabled) ! empty($conf->loan->enabled) ||
! empty($conf->margins->enabled)
)?1:0, )?1:0,
'perms'=>(! empty($user->rights->facture->lire) || ! empty($user->rights->don->contact->lire) '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->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' 'module'=>'facture|supplier_invoice|don|tax|salaries|loan'
); );
$menu_arr[] = array( $menu_arr[] = array(

View File

@ -155,6 +155,8 @@ class pdf_rouget extends ModelePdfExpedition
$this->posxtotalht=$this->page_largeur - $this->marge_droite - 20; $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 $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 // To work with US executive format

View File

@ -138,6 +138,8 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
if (! empty($line->label)) { if (! empty($line->label)) {
$text.= ' <strong>'.$line->label.'</strong>'; $text.= ' <strong>'.$line->label.'</strong>';
echo $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); 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 { } else {
if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
echo $text.' '.dol_htmlentitiesbr($line->description); echo $text.' '.dol_htmlentitiesbr($line->description);

View File

@ -561,7 +561,7 @@ if ($id > 0)
} }
else else
{ {
print $object->rate . '%'; print price($object->rate) . '%';
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -341,6 +341,7 @@ class Loan extends CommonObject
$sql.= " datestart='".$this->db->idate($this->datestart)."',"; $sql.= " datestart='".$this->db->idate($this->datestart)."',";
$sql.= " dateend='".$this->db->idate($this->dateend)."',"; $sql.= " dateend='".$this->db->idate($this->dateend)."',";
$sql.= " nbterm=".$this->nbterm.","; $sql.= " nbterm=".$this->nbterm.",";
$sql.= " rate=".$this->db->escape($this->rate).",";
$sql.= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',"; $sql.= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',";
$sql.= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',"; $sql.= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',";
$sql.= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',"; $sql.= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',";

View File

@ -42,7 +42,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid'); $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
if (! empty($user->societe_id)) $socid=$user->societe_id; if (! empty($user->societe_id)) $socid=$user->societe_id;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); $result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$result=restrictedArea($user, 'margins'); if(empty($user->rights->margins->liretous)) accessforbidden();
$mesg = ''; $mesg = '';

View File

@ -38,6 +38,7 @@ $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid'); $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
if (! empty($user->societe_id)) $socid=$user->societe_id; if (! empty($user->societe_id)) $socid=$user->societe_id;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); $result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
if(empty($user->rights->margins->liretous)) accessforbidden();
$object = new Product($db); $object = new Product($db);

View File

@ -88,6 +88,7 @@ if (! empty($canvas))
// Security check // Security check
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas); $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas);
if(empty($user->rights->societe->contact->lire)) accessforbidden();