Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2020-02-13 11:58:23 +01:00
commit 9e165a782f
5 changed files with 30 additions and 18 deletions

View File

@ -229,7 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
// Payment informations // Payment informations
$accountid = $_POST["accountid"]; $accountid = $_POST["accountid"];
$operation = $_POST["operation"]; // Payment mode $operation = $_POST["operation"]; // Payment mode
$num_chq = $_POST["num_chq"]; $num_chq = GETPOST("num_chq", "alphanohtml");
$emetteur_nom = $_POST["chqemetteur"]; $emetteur_nom = $_POST["chqemetteur"];
$emetteur_banque = $_POST["chqbank"]; $emetteur_banque = $_POST["chqbank"];
$option = $_POST["paymentsave"]; $option = $_POST["paymentsave"];

View File

@ -588,11 +588,12 @@ class Paiement extends CommonObject
* @param string $emetteur_nom Name of transmitter * @param string $emetteur_nom Name of transmitter
* @param string $emetteur_banque Name of bank * @param string $emetteur_banque Name of bank
* @param int $notrigger No trigger * @param int $notrigger No trigger
* @param string $num_chq Numero of cheque
* @return int <0 if KO, bank_line_id if OK * @return int <0 if KO, bank_line_id if OK
*/ */
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0)
{ {
global $conf,$langs,$user; global $conf, $langs, $user;
$error=0; $error=0;
$bank_line_id=0; $bank_line_id=0;
@ -612,7 +613,7 @@ class Paiement extends CommonObject
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
dol_syslog("$user->id,$mode,$label,$this->fk_account,$emetteur_nom,$emetteur_banque"); dol_syslog("$user->id, $mode, $label, $this->fk_account, $emetteur_nom, $emetteur_banque");
$acc = new Account($this->db); $acc = new Account($this->db);
$result=$acc->fetch($this->fk_account); $result=$acc->fetch($this->fk_account);
@ -631,7 +632,7 @@ class Paiement extends CommonObject
$this->paiementid, // Payment mode id or code ("CHQ or VIR for example") $this->paiementid, // Payment mode id or code ("CHQ or VIR for example")
$label, $label,
$totalamount, // Sign must be positive when we receive money (customer payment), negative when you give money (supplier invoice or credit note) $totalamount, // Sign must be positive when we receive money (customer payment), negative when you give money (supplier invoice or credit note)
$this->num_paiement, $this->num_payment,
'', '',
$user, $user,
$emetteur_nom, $emetteur_nom,

View File

@ -2113,7 +2113,7 @@ class Form
} }
} }
$selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; $selectFields = " p.rowid, p.ref, p.label, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
if (count($warehouseStatusArray)) if (count($warehouseStatusArray))
{ {
$selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock $selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock
@ -2740,13 +2740,15 @@ class Form
$out = ''; $out = '';
$outarray = array(); $outarray = array();
$maxlengtharticle = (empty($conf->global->PRODUCT_MAX_LENGTH_COMBO) ? 48 : $conf->global->PRODUCT_MAX_LENGTH_COMBO);
$langs->load('stocks'); $langs->load('stocks');
// Units // Units
if ($conf->global->PRODUCT_USE_UNITS) { if ($conf->global->PRODUCT_USE_UNITS) {
$langs->load('other'); $langs->load('other');
} }
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, p.fk_product_type,"; $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, p.fk_product_type,";
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,";
$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,"; $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,";
$sql .= " pfp.supplier_reputation"; $sql .= " pfp.supplier_reputation";
@ -2754,7 +2756,7 @@ class Form
if ($conf->global->PRODUCT_USE_UNITS) { if ($conf->global->PRODUCT_USE_UNITS) {
$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units"; $sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
} }
if (!empty($conf->barcode->enabled)) $sql .= " ,pfp.barcode"; if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
if ($socid) $sql .= " AND pfp.fk_soc = ".$socid; if ($socid) $sql .= " AND pfp.fk_soc = ".$socid;
@ -2817,6 +2819,7 @@ class Form
$outref = $objp->ref; $outref = $objp->ref;
$outval = ''; $outval = '';
$outbarcode = $objp->barcode;
$outqty = 1; $outqty = 1;
$outdiscount = 0; $outdiscount = 0;
$outtype = $objp->fk_product_type; $outtype = $objp->fk_product_type;
@ -2867,12 +2870,22 @@ class Form
if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $label, 1); if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $label, 1);
$optlabel = $objp->ref; $optlabel = $objp->ref;
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
$optlabel .= ' <span class=\'opacitymedium\'>('.$objp->ref_fourn.')</span>'; $optlabel .= ' <span class=\'opacitymedium\'>('.$objp->ref_fourn.')</span>';
}
if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) {
$optlabel .= ' ('.$outbarcode.')';
}
$optlabel .= ' - '.dol_trunc($label, $maxlengtharticle);
$outvallabel = $objRef; $outvallabel = $objRef;
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {
$outvallabel .= ' ('.$objRefFourn.')'; $outvallabel .= ' ('.$objRefFourn.')';
}
if (!empty($conf->barcode->enabled) && !empty($objp->barcode)) {
$outvallabel .= ' ('.$outbarcode.')';
}
$outvallabel .= ' - '.dol_trunc($label, $maxlengtharticle);
// Units // Units
$optlabel .= $outvalUnits; $optlabel .= $outvalUnits;
@ -2934,12 +2947,6 @@ class Form
$optlabel .= " - ".dol_trunc($objp->name, 8); $optlabel .= " - ".dol_trunc($objp->name, 8);
$outvallabel .= " - ".dol_trunc($objp->name, 8); $outvallabel .= " - ".dol_trunc($objp->name, 8);
} }
if (!empty($conf->barcode->enabled) && !empty($objp->barcode))
{
//$optlabel .= " - <span class='fa fa-barcode'></span>".$objp->barcode;
$optlabel .= " - ".$objp->barcode;
$outvallabel .= " - ".$objp->barcode;
}
if ($objp->supplier_reputation) if ($objp->supplier_reputation)
{ {
//TODO dictionary //TODO dictionary
@ -3027,7 +3034,7 @@ class Form
$langs->load('stocks'); $langs->load('stocks');
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration, pfp.fk_soc,"; $sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, pfp.fk_soc,";
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,"; $sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice,";
$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name"; $sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, s.nom as name";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p";

View File

@ -4309,6 +4309,9 @@ class Product extends CommonObject
if (!empty($this->label)) { if (!empty($this->label)) {
$label .= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label; $label .= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
} }
if (!empty($conf->barcode->enabled)) {
$label .= '<br><b>'.$langs->trans('BarCode').':</b> '.$this->barcode;
}
if ($this->type == Product::TYPE_PRODUCT) if ($this->type == Product::TYPE_PRODUCT)
{ {

View File

@ -118,14 +118,15 @@ if ($socid)
dol_fiche_end(); dol_fiche_end();
$params = '';
$addbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&amp;backtopage='.urlencode($backtopage).'"><span class="text-plus-circle">'.$langs->trans("AddProject").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>'; $newcardbutton .= dolGetButtonTitle($langs->trans("NewProject"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&amp;backtopage='.urlencode($backtopage), '', 1, $params);
print '<br>'; print '<br>';
// Projects list // Projects list
$result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1, $addbutton); $result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1, $newcardbutton);
} }
// End of page // End of page