diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index 1431df9f8a2..ad28dd1af97 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -1260,7 +1260,7 @@ class BookKeeping extends CommonObject
global $user;
$error = 0;
- $object = new Accountingbookkeeping($this->db);
+ $object = new BookKeeping($this->db);
$this->db->begin();
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index d5746eb63e5..587d36d227a 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -401,7 +401,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->numero_compte = $k;
$bookkeeping->label_operation = $val["label"];
$bookkeeping->label_compte = $langs->trans("Bank");
- $bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
+ $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
@@ -462,7 +462,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_bank"];
$bookkeeping->label_operation = $tabcompany[$key]['name'];
- $bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
+ $bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php
index 1907cfe7dae..d253fb2820a 100644
--- a/htdocs/accountancy/journal/expensereportsjournal.php
+++ b/htdocs/accountancy/journal/expensereportsjournal.php
@@ -203,7 +203,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->label_operation = $tabuser[$key]['name'];
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
- $bookkeeping->debit = ($mt <= 0) ? $mt : 0;
+ $bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index b1d8aa03022..b603d1e6a17 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1750,6 +1750,7 @@ if ($action == 'create')
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->propal->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' ('.$langs->trans("OtherProposals").')';
// Project
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index a4888b44861..ddb44153e49 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1924,6 +1924,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
+ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' ('.$langs->trans("OtherOrders").')';
// Project
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php
index 869b86238ff..c6fd3f72def 100644
--- a/htdocs/compta/bank/class/api_bankaccounts.class.php
+++ b/htdocs/compta/bank/class/api_bankaccounts.class.php
@@ -72,7 +72,7 @@ class BankAccounts extends DolibarrApi
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."bank_account as t";
$sql.= ' WHERE t.entity IN ('.getEntity('bank_account').')';
// Add sql filters
- if ($sqlfilters)
+ if ($sqlfilters)
{
if (! DolibarrApi::_checkFilters($sqlfilters))
{
@@ -81,7 +81,7 @@ class BankAccounts extends DolibarrApi
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
-
+
$sql.= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0)
@@ -89,10 +89,10 @@ class BankAccounts extends DolibarrApi
$page = 0;
}
$offset = $limit * $page;
-
+
$sql.= $this->db->plimit($limit + 1, $offset);
}
-
+
dol_syslog("API Rest request");
$result = $this->db->query($sql);
@@ -236,7 +236,7 @@ class BankAccounts extends DolibarrApi
function _validate($data)
{
$account = array();
- foreach (Accounts::$FIELDS as $field) {
+ foreach (BankAccounts::$FIELDS as $field) {
if (! isset($data[$field]))
throw new RestException(400, "$field field missing");
$account[$field] = $data[$field];
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index d77f83cbb2e..c8fb3804e60 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -3075,6 +3075,7 @@ else if ($id > 0 || ! empty($ref))
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
+ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' ('.$langs->trans("OtherBills").')';
// Project
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index d38ea012c3c..3a072f946be 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -1311,7 +1311,7 @@ else
print '
| ';
print $langs->trans('RIB');
print ' | ';
- if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon))
+ if (($action != 'editbankaccount') && $user->rights->facture->creer && ! empty($object->brouillon))
print ' | id.'">'.img_edit($langs->trans('SetBankAccount'),1).' | ';
print '
';
print '';
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index 2fdec21f735..6534ef1e362 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -332,7 +332,7 @@ if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights-
$moreforfilter.=' ';
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
- $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
+ $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter.=' ';
}
@@ -523,7 +523,6 @@ while ($i < min($num,$limit))
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
-
print ' | ';
// Ref
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7a83c09b734..8f618e2fbf0 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -334,23 +334,23 @@ abstract class CommonObject
// No constructor as it is an abstract class
- /**
- * Check an object id/ref exists
- * If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch
- *
+ /**
+ * Check an object id/ref exists
+ * If you don't need/want to instantiate object and just need to know if object exists, use this method instead of fetch
+ *
* @param string $element String of element ('product', 'facture', ...)
* @param int $id Id of object
* @param string $ref Ref of object to check
* @param string $ref_ext Ref ext of object to check
* @return int <0 if KO, 0 if OK but not found, >0 if OK and exists
- */
- static function isExistingObject($element, $id, $ref='', $ref_ext='')
- {
- global $db,$conf;
+ */
+ static function isExistingObject($element, $id, $ref='', $ref_ext='')
+ {
+ global $db,$conf;
$sql = "SELECT rowid, ref, ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
- $sql.= " WHERE entity IN (".getEntity($element, true).")" ;
+ $sql.= " WHERE entity IN (".getEntity($element).")" ;
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
@@ -371,17 +371,17 @@ abstract class CommonObject
else return 0;
}
return -1;
- }
+ }
- /**
- * Method to output saved errors
- *
- * @return string String with errors
- */
- function errorsToString()
- {
- return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):'');
- }
+ /**
+ * Method to output saved errors
+ *
+ * @return string String with errors
+ */
+ function errorsToString()
+ {
+ return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):'');
+ }
/**
* Return full name (civility+' '+name+' '+lastname)
@@ -3947,7 +3947,7 @@ abstract class CommonObject
// Now we add first model found in directories scanned
$listofdir=explode(',',$dirtoscan);
- foreach($listofdir as $key=>$tmpdir)
+ foreach($listofdir as $key => $tmpdir)
{
$tmpdir=trim($tmpdir);
$tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir);
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 98bd412abc2..a3f8676fb65 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -1447,55 +1447,55 @@ class DolibarrModules // Can not be abstract, because we need to insta
*
* @return int Error count (0 if ok)
*/
- function insert_tabs()
- {
- global $conf;
+ function insert_tabs()
+ {
+ global $conf;
- $err=0;
+ $err=0;
- if (! empty($this->tabs))
- {
- $i=0;
- foreach ($this->tabs as $key => $value)
- {
- if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
+ if (! empty($this->tabs))
+ {
+ $i=0;
+ foreach ($this->tabs as $key => $value)
+ {
+ if (is_array($value) && count($value) == 0) continue; // Discard empty arrays
- $entity=$conf->entity;
- $newvalue = $value;
+ $entity=$conf->entity;
+ $newvalue = $value;
- if (is_array($value))
- {
- $newvalue = $value['data'];
- if (isset($value['entity'])) $entity = $value['entity'];
- }
+ if (is_array($value))
+ {
+ $newvalue = $value['data'];
+ if (isset($value['entity'])) $entity = $value['entity'];
+ }
- if ($newvalue)
- {
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
- $sql.= "name";
- $sql.= ", type";
- $sql.= ", value";
- $sql.= ", note";
- $sql.= ", visible";
- $sql.= ", entity";
- $sql.= ")";
- $sql.= " VALUES (";
- $sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
- $sql.= ", 'chaine'";
- $sql.= ", ".$this->db->encrypt($value,1);
- $sql.= ", null";
- $sql.= ", '0'";
- $sql.= ", ".$conf->entity;
- $sql.= ")";
+ if ($newvalue)
+ {
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (";
+ $sql.= "name";
+ $sql.= ", type";
+ $sql.= ", value";
+ $sql.= ", note";
+ $sql.= ", visible";
+ $sql.= ", entity";
+ $sql.= ")";
+ $sql.= " VALUES (";
+ $sql.= $this->db->encrypt($this->const_name."_TABS_".$i,1);
+ $sql.= ", 'chaine'";
+ $sql.= ", ".$this->db->encrypt($newvalue,1);
+ $sql.= ", null";
+ $sql.= ", '0'";
+ $sql.= ", ".$entity;
+ $sql.= ")";
- dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
- $this->db->query($sql);
- }
- $i++;
- }
- }
- return $err;
- }
+ dol_syslog(get_class($this)."::insert_tabs", LOG_DEBUG);
+ $this->db->query($sql);
+ }
+ $i++;
+ }
+ }
+ return $err;
+ }
/**
* Adds constants
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index 64d0da9b5fd..f9dac51389f 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -211,7 +211,7 @@ class doc_generic_contract_odt extends ModelePDFContract
if (! is_object($object))
{
$id = $object;
- $object = new Contract($this->db);
+ $object = new Contrat($this->db);
$result=$object->fetch($id);
if ($result < 0)
{
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 0de3a8df3d7..c421ec6124c 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1,13 +1,13 @@
* Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2008 Raphael Bertrand
+ * Copyright (C) 2008 Raphael Bertrand
* Copyright (C) 2010-2014 Juanjo Menent
- * Copyright (C) 2012 Christophe Battarel
- * Copyright (C) 2012 Cédric Salvador
- * Copyright (C) 2012-2014 Raphaël Doursenaud
- * Copyright (C) 2015 Marcos García
- * Copyright (C) 2017 Ferran Marcet
+ * Copyright (C) 2012 Christophe Battarel
+ * Copyright (C) 2012 Cédric Salvador
+ * Copyright (C) 2012-2014 Raphaël Doursenaud
+ * Copyright (C) 2015 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
@@ -255,16 +255,16 @@ class pdf_crabe extends ModelePDFFactures
// Set nblignes with the new facture lines content after hook
$nblignes = count($object->lines);
$nbpayments = count($object->getListOfPayments());
-
+
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$pdf->SetAutoPageBreak(1,0);
-
+
$heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
-
+
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
@@ -509,7 +509,7 @@ class pdf_crabe extends ModelePDFFactures
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->posxqty, $curY);
// Enough for 6 chars
-
+
if ($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
@@ -769,7 +769,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','', $default_font_size - 4);
-
+
// Loop on each deposits and credit notes included
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
$sql.= " re.description, re.fk_facture_source,";
@@ -822,7 +822,7 @@ class pdf_crabe extends ModelePDFFactures
$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = ".$object->id;
//$sql.= " WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = 1";
$sql.= " ORDER BY p.datep";
-
+
$resql=$this->db->query($sql);
if ($resql)
{
@@ -1052,7 +1052,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFillColor(255,255,255);
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
-
+
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
@@ -1071,7 +1071,7 @@ class pdf_crabe extends ModelePDFFactures
else
{
// FIXME amount of vat not supported with multicurrency
-
+
//Local tax 1 before VAT
//if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
//{
@@ -1141,26 +1141,26 @@ class pdf_crabe extends ModelePDFFactures
}
//}
-
+
// VAT
// Situations totals migth be wrong on huge amounts
if ($object->situation_cycle_ref && $object->situation_counter > 1) {
-
+
$sum_pdf_tva = 0;
foreach($this->tva as $tvakey => $tvaval){
$sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object
}
-
+
if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one)
$coef_fix_tva = $object->total_tva / $sum_pdf_tva;
-
+
foreach($this->tva as $tvakey => $tvaval) {
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
}
}
-
+
}
-
+
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey != 0) // On affiche pas taux 0
@@ -1416,7 +1416,7 @@ class pdf_crabe extends ModelePDFFactures
if (empty($hidetop))
{
$pdf->SetXY($this->posxqty-1, $tab_top+1);
-
+
if($this->situationinvoice)
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
@@ -1430,14 +1430,14 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
}
-
+
if ($this->situationinvoice) {
$pdf->line($this->posxprogress - 1, $tab_top, $this->posxprogress - 1, $tab_top + $tab_height);
-
+
if (empty($hidetop)) {
-
+
$pdf->SetXY($this->posxprogress, $tab_top+1);
-
+
if($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
@@ -1450,9 +1450,9 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
-
+
}
-
+
}
if($conf->global->PRODUCT_USE_UNITS) {
@@ -1573,10 +1573,10 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$textref=$outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref);
- if ($object->statut == Facture::STATUS_DRAFT)
+ if ($object->statut == Facture::STATUS_DRAFT)
{
$pdf->SetTextColor(128,0,0);
- $textref.=' - '.$outputlangs->trans("NotValidated");
+ $textref.=' - '.$outputlangs->transnoentities("NotValidated");
}
$pdf->MultiCell($w, 4, $textref, '', 'R');
@@ -1635,7 +1635,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("DatePointOfTax")." : " . dol_print_date($object->date_pointoftax,"day",false,$outputlangs), '', 'R');
}
-
+
if ($object->type != 2)
{
$posy+=3;
@@ -1663,10 +1663,10 @@ class pdf_crabe extends ModelePDFFactures
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
- $pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
+ $pdf->MultiCell($w, 3, $langs->transnoentities("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
-
+
$posy+=1;
// Show list of linked objects
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index 0339f2ea255..130aa90ecfd 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -167,7 +167,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte.=$file['name'].'
';
}
$texte.='';
-
+
if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0)
{
// Model for creation
@@ -252,7 +252,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
if (! is_object($object))
{
$id = $object;
- $object = new Propale($this->db);
+ $object = new Propal($this->db);
$result=$object->fetch($id);
if ($result < 0)
{
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 87483dca12f..909fa1dadfd 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -492,7 +492,7 @@ if ($resql)
if (! GETPOST('cancel'))
{
- $objecttmp=new FactureFourn($db);
+ $objecttmp=new FactureFournisseur($db);
$listofselectedid=array();
$listofselectedthirdparties=array();
$listofselectedref=array();
diff --git a/htdocs/index.php b/htdocs/index.php
index 187273ef2b4..9b190ac1e2b 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -448,7 +448,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
}
// Number of supplier invoices (has paid)
-if (! empty($conf->supplier_invoice->enabled) && ! empty($conf->facture->enabled) && $user->rights->facture->lire)
+if (! empty($conf->supplier_invoice->enabled) && ! empty($user->rights->fournisseur->facture->lire))
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$board=new FactureFournisseur($db);
diff --git a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
index 03ff8c76d93..48a6b191ebf 100644
--- a/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
+++ b/htdocs/install/mysql/migration/3.8.0-3.9.0.sql
@@ -611,3 +611,7 @@ INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (14
-- VMYSQL4.1 ALTER TABLE llx_c_type_resource CHANGE COLUMN rowid rowid integer NOT NULL AUTO_INCREMENT;
ALTER TABLE llx_import_model MODIFY COLUMN type varchar(50);
+
+-- Negative buying prices
+
+UPDATE llx_facturedet SET buy_price_ht = ABS(buy_price_ht)
diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang
index 363fb504a5b..cf714b4ea74 100644
--- a/htdocs/langs/en_US/orders.lang
+++ b/htdocs/langs/en_US/orders.lang
@@ -117,6 +117,7 @@ SecondApprovalAlreadyDone=Second approval already done
SupplierOrderReceivedInDolibarr=Supplier order %s received %s
SupplierOrderSubmitedInDolibarr=Supplier order %s submited
SupplierOrderClassifiedBilled=Supplier order %s set billed
+OtherOrders=Other orders
##### Types de contacts #####
TypeContact_commande_internal_SALESREPFOLL=Representative following-up customer order
TypeContact_commande_internal_SHIPPING=Representative following-up shipping
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index aefe8e89cd2..e03ad999a85 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -63,6 +63,7 @@ ProposalLine=Proposal line
AvailabilityPeriod=Availability delay
SetAvailability=Set availability delay
AfterOrder=after order
+OtherProposals=Other proposals
##### Availability #####
AvailabilityTypeAV_NOW=Immediate
AvailabilityTypeAV_1W=1 week
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 460665255b1..11c013cb768 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -69,6 +69,7 @@ NoPredefinedProductToDispatch=No predefined products for this object. So no disp
DispatchVerb=Dispatch
StockLimitShort=Limit for alert
StockLimit=Stock limit for alert
+StockLimitDesc="" (empty) default value means no alert.
"0" can be used with 'Stock can be negative' configuration.
PhysicalStock=Physical stock
RealStock=Real Stock
RealStockDesc=Physical or real stock is the stock you currently have into your internal warehouses/emplacements.
@@ -192,4 +193,4 @@ InventoryFlushed=Inventory flushed
ExitEditMode=Exit edition
inventoryDeleteLine=Delete line
RegulateStock=Regulate Stock
-ListInventory=List
+ListInventory=List
\ No newline at end of file
diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index 3943e1b9314..6d9054af60b 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -129,6 +129,8 @@ class modMyModule extends DolibarrModules
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
// 'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
+ // Can also be: $this->tabs = array('data'=>'...', 'entity'=>0);
+ //
// where objecttype can be
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
// 'contact' to add a tab in contact view