diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 1c10930de7b..33e6ab1070b 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -100,7 +100,7 @@ $coldisplay=-1; // We remove first td
}
// Do not allow editing during a situation cycle
- if (empty($this->situation_cycle_ref) || $this->situation_counter == 1)
+ if ($line->fk_prev_id == null )
{
// editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -138,15 +138,15 @@ $coldisplay=-1; // We remove first td
}
$coldisplay++;
- if ($this->situation_counter == 1 || !$this->situation_cycle_ref) {
- print '
' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . ' | ';
+ if ($line->fk_prev_id == null) {
+ print '' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . ' | ';
} else {
print '% | ';
}
$coldisplay++;
- print 'situation_counter > 1) print ' readonly';
+ print ' | fk_prev_id != null) print ' readonly';
print '> | ';
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
@@ -156,8 +156,8 @@ $coldisplay=-1; // We remove first td
if ($inputalsopricewithtax)
{
$coldisplay++;
- print 'situation_counter > 1) print ' readonly';
+ print ' | fk_prev_id != null) print ' readonly';
print '> | ';
}
?>
@@ -168,7 +168,7 @@ $coldisplay=-1; // We remove first td
// must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
print 'situation_counter > 1) print ' readonly';
+ if ($line->fk_prev_id != null ) print ' readonly';
print '>';
} else { ?>
@@ -187,7 +187,7 @@ $coldisplay=-1; // We remove first td
info_bits & 2) != 2) {
print 'situation_counter > 1) print ' readonly';
+ if ($line->fk_prev_id != null ) print ' readonly';
print '>%';
} else { ?>
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index fbcc5439965..4240789caa4 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -283,7 +283,7 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
|
situation_counter == 1 || !$this->situation_cycle_ref) && empty($disableremove)) {
+ if (($line->fk_prev_id == null ) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
print 'id . '&action=ask_deleteline&lineid=' . $line->id . '">';
print img_delete();
print '';
diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
index e203b9aad1e..a157bd1df2e 100644
--- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
+++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
@@ -184,7 +184,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
dol_syslog( "Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id );
// First classify billed the order to allow the proposal classify process
- if (! empty($conf->fournisseur->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER))
+ if (! empty($conf->fournisseur->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER))
{
$object->fetchObjectLinked('','order_supplier',$object->id,$object->element);
if (! empty($object->linkedObjects))
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 427d7223609..4814af72b19 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -680,11 +680,12 @@ class ProductFournisseur extends Product
$sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " WHERE s.entity IN (".getEntity('societe').")";
+ $sql.= " AND pfp.entity = ".$conf->entity; // only current entity
$sql.= " AND pfp.fk_product = ".$prodid;
$sql.= " AND pfp.fk_soc = s.rowid";
$sql.= " AND s.status = 1"; // only enabled society
if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty;
- if ($socid > 0) $sql.= ' AND pfp.fk_soc = '.$socid;
+ if ($socid > 0) $sql.= ' AND pfp.fk_soc = '.$socid;
dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG);
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 8dd6779321f..807c7c46346 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -182,7 +182,7 @@ elseif ($type == '1')
else
{
print $statProducts.$statServices;
- $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2]);
+ $total=round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2])+round($prodser[0][3])+round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[1][3]); //Calcul du Total des Produits et Services
}
print ' | | '.$langs->trans("Total").' | ';
print $total;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index bc368a10b2c..65a18d39679 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1243,7 +1243,7 @@ class Societe extends CommonObject
$sql .= ', s.fk_forme_juridique as forme_juridique_code';
$sql .= ', s.webservices_url, s.webservices_key';
$sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode';
- $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_client, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj';
+ $sql .= ', s.fk_departement, s.fk_pays as country_id, s.fk_stcomm, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj';
$sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo';
$sql .= ', s.fk_shipping_method';
$sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms';
@@ -1256,6 +1256,7 @@ class Societe extends CommonObject
$sql .= ', st.libelle as stcomm';
$sql .= ', te.code as typent_code';
$sql .= ', i.libelle as libelle_incoterms';
+ $sql .= ', sr.remise_client';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
@@ -1264,6 +1265,7 @@ class Societe extends CommonObject
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as te ON s.fk_typent = te.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON s.fk_incoterms = i.rowid';
+ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_remise as sr ON sr.rowid = (SELECT MAX(rowid) FROM '.MAIN_DB_PREFIX.'societe_remise WHERE fk_soc = s.rowid AND entity = '.$conf->entity.')';
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
@@ -1377,7 +1379,7 @@ class Societe extends CommonObject
$this->prefix_comm = $obj->prefix_comm;
- $this->remise_percent = $obj->remise_client;
+ $this->remise_percent = price2num($obj->remise_client); // 0.000000 must be 0
$this->remise_supplier_percent = $obj->remise_supplier;
$this->mode_reglement_id = $obj->mode_reglement;
$this->cond_reglement_id = $obj->cond_reglement;
@@ -3877,6 +3879,7 @@ class Societe extends CommonObject
$sql .= " AND entity IN (".getEntity('invoice').")";
$sql .= " AND paye = 0";
$sql .= " AND fk_statut <> 0"; // Not a draft
+ $sql .= " AND entity IN (".getEntity('invoice').")";
//$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason
$sql .= " AND fk_statut <> 3"; // Not abandonned
$sql .= " AND fk_statut <> 2"; // Not clasified as paid
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index e8dd9cbd210..4e65b1bc5ed 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -1562,7 +1562,7 @@ div#tmenu_tooltip {
}
-div.tmenusep {
+div.topmenuimage {
display: none;
|