Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0

Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
This commit is contained in:
Laurent Destailleur 2019-02-01 16:01:18 +01:00
commit dee2a373c1
4 changed files with 51 additions and 40 deletions

View File

@ -178,6 +178,7 @@ class mod_facture_mars extends ModeleNumRefFactures
$sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " FROM ".MAIN_DB_PREFIX."facture";
$sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'";
$sql.= " AND entity IN (".getEntity('invoicenumber').")"; $sql.= " AND entity IN (".getEntity('invoicenumber').")";
$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

@ -194,6 +194,7 @@ class mod_facture_terre extends ModeleNumRefFactures
$sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " FROM ".MAIN_DB_PREFIX."facture";
$sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'"; $sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'";
$sql.= " AND entity IN (".getEntity('invoicenumber').")"; $sql.= " AND entity IN (".getEntity('invoicenumber').")";
$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

@ -3165,6 +3165,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;
@ -3210,6 +3212,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

@ -1798,7 +1798,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>';
} }