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

Conflicts:
	htdocs/core/modules/facture/mod_facture_mars.php
	htdocs/core/modules/facture/mod_facture_terre.php
This commit is contained in:
Laurent Destailleur 2019-02-01 16:07:18 +01:00
commit 6de732d7f8
6 changed files with 63 additions and 51 deletions

View File

@ -189,6 +189,7 @@ class mod_facture_mars extends ModeleNumRefFactures
$sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " FROM ".MAIN_DB_PREFIX."facture";
$sql.= " WHERE ref LIKE '".$prefix."____-".$num."'"; $sql.= " WHERE ref LIKE '".$prefix."____-".$num."'";
$sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")"; $sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")";
$sql.= " ORDER BY ref DESC";
dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@ -204,6 +204,7 @@ class mod_facture_terre extends ModeleNumRefFactures
$sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " FROM ".MAIN_DB_PREFIX."facture";
$sql.= " WHERE ref LIKE '".$prefix."____-".$num."'"; $sql.= " WHERE ref LIKE '".$prefix."____-".$num."'";
$sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")"; $sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")";
$sql.= " ORDER BY ref DESC";
dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@ -3293,6 +3293,8 @@ class CommandeFournisseurLigne extends CommonOrderLine
{ {
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
if (!empty($objp))
{
$this->rowid = $objp->rowid; $this->rowid = $objp->rowid;
$this->id = $objp->rowid; $this->id = $objp->rowid;
$this->fk_commande = $objp->fk_commande; $this->fk_commande = $objp->fk_commande;
@ -3338,6 +3340,13 @@ class CommandeFournisseurLigne extends CommonOrderLine
return 1; return 1;
} }
else else
{
$this->error='Supplier order line with id='.$rowid.' not found';
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
return 0;
}
}
else
{ {
dol_print_error($this->db); dol_print_error($this->db);
return -1; return -1;

View File

@ -60,18 +60,18 @@ $search_deliveryday=GETPOST("search_deliveryday","int");
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml')); $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$search_product_category=GETPOST('search_product_category','int'); $search_product_category=GETPOST('search_product_category','int');
$search_ref=GETPOST('search_ref'); $search_ref=GETPOST('search_ref','alpha');
$search_refsupp=GETPOST('search_refsupp'); $search_refsupp=GETPOST('search_refsupp','alpha');
$search_company=GETPOST('search_company','alpha'); $search_company=GETPOST('search_company','alpha');
$search_town=GETPOST('search_town','alpha'); $search_town=GETPOST('search_town','alpha');
$search_zip=GETPOST('search_zip','alpha'); $search_zip=GETPOST('search_zip','alpha');
$search_state=trim(GETPOST("search_state")); $search_state=trim(GETPOST("search_state",'alpha'));
$search_country=GETPOST("search_country",'int'); $search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_user=GETPOST('search_user','int'); $search_user=GETPOST('search_user','int');
$search_request_author=GETPOST('search_request_author','alpha'); $search_request_author=GETPOST('search_request_author','alpha');
$search_ht=GETPOST('search_ht'); $search_ht=GETPOST('search_ht','alpha');
$search_ttc=GETPOST('search_ttc'); $search_ttc=GETPOST('search_ttc','alpha');
$search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7' $search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7'
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014-2016 Charlie BENKE <charlie@patas-monkey.com> * Copyright (C) 2014-2016 Charlie BENKE <charlie@patas-monkey.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Pierre Ardoin <mapiolca@me.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -172,12 +173,12 @@ $total=0;
if ($type == '0') if ($type == '0')
{ {
print $statProducts; print $statProducts;
$total=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]);
} }
elseif ($type == '1') elseif ($type == '1')
{ {
print $statServices; print $statServices;
$total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2]); $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[1][3]);
} }
else else
{ {

View File

@ -1800,7 +1800,7 @@ if ($action == 'create')
} }
// Create an order // Create an order
if (! empty($conf->commande->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { if (! empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) {
if ($user->rights->fournisseur->commande->creer) { if ($user->rights->fournisseur->commande->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/commande/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddOrder") . '</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/commande/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans("AddOrder") . '</a></div>';
} }