Merge remote-tracking branch 'Dolibarr/11.0' into 11

This commit is contained in:
Francis Appels 2020-01-18 17:01:46 +01:00
commit d61569a876
10 changed files with 25 additions and 25 deletions

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/comm/multiprix.php * \file htdocs/comm/multiprix.php
* \ingroup societe * \ingroup societe
* \brief Onglet choix du niveau de prix * \brief Tab to set the price level of a thirdparty
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -64,20 +64,11 @@ $userstatic = new User($db);
if ($_socid > 0) if ($_socid > 0)
{ {
// On recupere les donnees societes par l'objet // We load data of thirdparty
$objsoc = new Societe($db); $objsoc = new Societe($db);
$objsoc->id = $_socid; $objsoc->id = $_socid;
$objsoc->fetch($_socid, $to); $objsoc->fetch($_socid, $to);
if ($errmesg)
{
print '<div class="error">'.$errmesg.'</div><br>';
}
/*
* Affichage onglets
*/
$head = societe_prepare_head($objsoc); $head = societe_prepare_head($objsoc);
@ -91,7 +82,7 @@ if ($_socid > 0)
dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company'); dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company');
print '<table class="border centpercent">'; print '<table class="border centpercent tableforfield">';
print '<tr><td class="titlefieldcreate">'; print '<tr><td class="titlefieldcreate">';
print $langs->trans("PriceLevel").'</td><td>'.$objsoc->price_level."</td></tr>"; print $langs->trans("PriceLevel").'</td><td>'.$objsoc->price_level."</td></tr>";

View File

@ -3968,7 +3968,7 @@ elseif ($id > 0 || !empty($ref))
if ($result > 0) { if ($result > 0) {
print '. <span class="opacitymediumbycolor">'.$langs->trans( print '. <span class="opacitymediumbycolor">'.$langs->trans(
"GeneratedFromTemplate", "GeneratedFromTemplate",
'<a href="'.DOL_MAIN_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$tmptemplate->id.'">'.$tmptemplate->ref.'</a>' '<a href="'.DOL_MAIN_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.$tmptemplate->ref.'</a>'
).'</span>'; ).'</span>';
} }
} }

View File

@ -604,7 +604,7 @@ if ($id > 0)
*/ */
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,"; $sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
$sql .= " c.code as type_code,c.libelle as paiement_type,"; $sql .= " c.code as type_code,c.libelle as paiement_type,";
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal'; $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.currency_code as bacurrency_code, ba.fk_accountancy_journal';
$sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid';
@ -653,6 +653,7 @@ if ($id > 0)
$bankaccountstatic->ref = $objp->baref; $bankaccountstatic->ref = $objp->baref;
$bankaccountstatic->label = $objp->baref; $bankaccountstatic->label = $objp->baref;
$bankaccountstatic->number = $objp->banumber; $bankaccountstatic->number = $objp->banumber;
$bankaccountstatic->currency_code = $objp->bacurrency_code;
if (!empty($conf->accounting->enabled)) { if (!empty($conf->accounting->enabled)) {
$bankaccountstatic->account_number = $objp->account_number; $bankaccountstatic->account_number = $objp->account_number;

View File

@ -620,7 +620,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
/* When changing predefined product, we reload list of supplier prices required for margin combo */ /* When changing predefined product, we reload list of supplier prices required for margin combo */
$("#idprod, #idprodfournprice").change(function() $("#idprod, #idprodfournprice").change(function()
{ {
console.log("#idprod, #idprodfournprice change triggered this.val = "+$(this).val()); console.log("Call method change() after change on #idprod or #idprodfournprice. this.val = "+$(this).val());
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
@ -631,6 +631,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
{ {
?> ?>
// Get the HT price for the product and display it // Get the HT price for the product and display it
console.log("Load price without tax and set it into #price_ht");
$.post('<?php echo DOL_URL_ROOT; ?>/product/ajax/products.php?action=fetch', $.post('<?php echo DOL_URL_ROOT; ?>/product/ajax/products.php?action=fetch',
{ 'id': $(this).val(), 'socid' : <?php print $object->socid; ?> }, { 'id': $(this).val(), 'socid' : <?php print $object->socid; ?> },
function(data) { jQuery("#price_ht").val(data.price_ht); }, function(data) { jQuery("#price_ht").val(data.price_ht); },

View File

@ -705,7 +705,7 @@ class CommandeFournisseur extends CommonOrder
*/ */
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{ {
global $langs, $conf; global $langs, $conf, $user;
$result = ''; $result = '';
$label = '<u>'.$langs->trans("ShowOrder").'</u>'; $label = '<u>'.$langs->trans("ShowOrder").'</u>';

View File

@ -2253,7 +2253,7 @@ class FactureFournisseur extends CommonInvoice
*/ */
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{ {
global $langs, $conf; global $langs, $conf, $user;
$result = ''; $result = '';

View File

@ -267,7 +267,7 @@ WEBSITE_PAGEURL=URL of page
WEBSITE_TITLE=Title WEBSITE_TITLE=Title
WEBSITE_DESCRIPTION=Description WEBSITE_DESCRIPTION=Description
WEBSITE_IMAGE=Image WEBSITE_IMAGE=Image
WEBSITE_IMAGEDesc=Relative path of the image media. You can keep this empty as this is rarely used (it can be used by dynamic content to show a preview of a list of blog posts). WEBSITE_IMAGEDesc=Relative path of the image media. You can keep this empty as this is rarely used (it can be used by dynamic content to show a thumbnail in a list of blog posts). Use __WEBSITEKEY__ in the path if path depends on website name.
WEBSITE_KEYWORDS=Keywords WEBSITE_KEYWORDS=Keywords
LinesToImport=Lines to import LinesToImport=Lines to import

View File

@ -59,8 +59,9 @@ dol_syslog(join(',', $_GET));
if (!empty($action) && $action == 'fetch' && !empty($id)) if (!empty($action) && $action == 'fetch' && !empty($id))
{ {
// When action='fetch', id must be the product id. // action='fetch' is used to get product information on a product. So when action='fetch', id must be the product id.
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$outjson = array(); $outjson = array();
@ -77,6 +78,13 @@ if (!empty($action) && $action == 'fetch' && !empty($id))
$found = false; $found = false;
$price_level = 1;
if ($socid > 0 && !empty($conf->global->PRODUIT_MULTIPRICES)) {
$thirdpartytemp = new Societe($db);
$thirdpartytemp->fetch($socid);
$price_level = $thirdpartytemp->price_level;
}
// Price by qty // Price by qty
if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))) // If we need a particular price related to qty if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))) // If we need a particular price related to qty
{ {
@ -100,14 +108,13 @@ if (!empty($action) && $action == 'fetch' && !empty($id))
} }
// Multiprice // Multiprice
if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES))) // If we need a particular price if (!$found && isset($price_level) && $price_level >= 1 && (!empty($conf->global->PRODUIT_MULTIPRICES))) // If we need a particular price level (from 1 to 6)
// level (from 1 to 6)
{ {
$sql = "SELECT price, price_ttc, price_base_type, tva_tx"; $sql = "SELECT price, price_ttc, price_base_type, tva_tx";
$sql .= " FROM ".MAIN_DB_PREFIX."product_price "; $sql .= " FROM ".MAIN_DB_PREFIX."product_price ";
$sql .= " WHERE fk_product = '".$id."'"; $sql .= " WHERE fk_product = '".$id."'";
$sql .= " AND entity IN (".getEntity('productprice').")"; $sql .= " AND entity IN (".getEntity('productprice').")";
$sql .= " AND price_level=".$price_level; $sql .= " AND price_level = ".((int) $price_level);
$sql .= " ORDER BY date_price"; $sql .= " ORDER BY date_price";
$sql .= " DESC LIMIT 1"; $sql .= " DESC LIMIT 1";
@ -160,8 +167,7 @@ else
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$langs->load("products"); $langs->loadLangs(array("main", "products"));
$langs->load("main");
top_httphead(); top_httphead();
@ -186,6 +192,7 @@ else
$searchkey = (($idprod && GETPOST($idprod, 'alpha')) ? GETPOST($idprod, 'alpha') : (GETPOST($htmlname, 'alpha') ? GETPOST($htmlname, 'alpha') : '')); $searchkey = (($idprod && GETPOST($idprod, 'alpha')) ? GETPOST($idprod, 'alpha') : (GETPOST($htmlname, 'alpha') ? GETPOST($htmlname, 'alpha') : ''));
$form = new Form($db); $form = new Form($db);
if (empty($mode) || $mode == 1) { // mode=1: customer if (empty($mode) || $mode == 1) { // mode=1: customer
$arrayresult = $form->select_produits_list("", $htmlname, $type, 0, $price_level, $searchkey, $status, $finished, $outjson, $socid, '1', 0, '', $hidepriceinlabel, $warehouseStatus); $arrayresult = $form->select_produits_list("", $htmlname, $type, 0, $price_level, $searchkey, $status, $finished, $outjson, $socid, '1', 0, '', $hidepriceinlabel, $warehouseStatus);
} elseif ($mode == 2) { // mode=2: supplier } elseif ($mode == 2) { // mode=2: supplier