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

Conflicts:
	htdocs/core/modules/facture/mod_facture_mars.php
	htdocs/core/modules/facture/mod_facture_terre.php
	htdocs/fourn/commande/list.php
This commit is contained in:
Laurent Destailleur 2019-02-01 16:05:43 +01:00
commit 35f65a571c
6 changed files with 59 additions and 47 deletions

View File

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

View File

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

View File

@ -3245,49 +3245,58 @@ class CommandeFournisseurLigne extends CommonOrderLine
{
$objp = $this->db->fetch_object($result);
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_commande = $objp->fk_commande;
$this->desc = $objp->description;
$this->qty = $objp->qty;
$this->ref_fourn = $objp->ref;
$this->ref_supplier = $objp->ref;
$this->subprice = $objp->subprice;
$this->tva_tx = $objp->tva_tx;
$this->localtax1_tx = $objp->localtax1_tx;
$this->localtax2_tx = $objp->localtax2_tx;
$this->localtax1_type = $objp->localtax1_type;
$this->localtax2_type = $objp->localtax2_type;
$this->remise = $objp->remise;
$this->remise_percent = $objp->remise_percent;
$this->fk_product = $objp->fk_product;
$this->info_bits = $objp->info_bits;
$this->total_ht = $objp->total_ht;
$this->total_tva = $objp->total_tva;
$this->total_localtax1 = $objp->total_localtax1;
$this->total_localtax2 = $objp->total_localtax2;
$this->total_ttc = $objp->total_ttc;
$this->product_type = $objp->product_type;
$this->special_code = $objp->special_code;
if (!empty($objp))
{
$this->rowid = $objp->rowid;
$this->id = $objp->rowid;
$this->fk_commande = $objp->fk_commande;
$this->desc = $objp->description;
$this->qty = $objp->qty;
$this->ref_fourn = $objp->ref;
$this->ref_supplier = $objp->ref;
$this->subprice = $objp->subprice;
$this->tva_tx = $objp->tva_tx;
$this->localtax1_tx = $objp->localtax1_tx;
$this->localtax2_tx = $objp->localtax2_tx;
$this->localtax1_type = $objp->localtax1_type;
$this->localtax2_type = $objp->localtax2_type;
$this->remise = $objp->remise;
$this->remise_percent = $objp->remise_percent;
$this->fk_product = $objp->fk_product;
$this->info_bits = $objp->info_bits;
$this->total_ht = $objp->total_ht;
$this->total_tva = $objp->total_tva;
$this->total_localtax1 = $objp->total_localtax1;
$this->total_localtax2 = $objp->total_localtax2;
$this->total_ttc = $objp->total_ttc;
$this->product_type = $objp->product_type;
$this->special_code = $objp->special_code;
$this->ref = $objp->product_ref;
$this->product_ref = $objp->product_ref;
$this->product_libelle = $objp->product_libelle;
$this->product_desc = $objp->product_desc;
$this->ref = $objp->product_ref;
$this->product_ref = $objp->product_ref;
$this->product_libelle = $objp->product_libelle;
$this->product_desc = $objp->product_desc;
$this->date_start = $this->db->jdate($objp->date_start);
$this->date_end = $this->db->jdate($objp->date_end);
$this->fk_unit = $objp->fk_unit;
$this->date_start = $this->db->jdate($objp->date_start);
$this->date_end = $this->db->jdate($objp->date_end);
$this->fk_unit = $objp->fk_unit;
$this->multicurrency_subprice = $objp->multicurrency_subprice;
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
$this->multicurrency_subprice = $objp->multicurrency_subprice;
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
$this->fetch_optionals();
$this->fetch_optionals();
$this->db->free($result);
return 1;
$this->db->free($result);
return 1;
}
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
{

View File

@ -59,18 +59,18 @@ $search_deliveryday=GETPOST("search_deliveryday","int");
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$search_product_category=GETPOST('search_product_category','int');
$search_ref=GETPOST('search_ref');
$search_refsupp=GETPOST('search_refsupp');
$search_ref=GETPOST('search_ref','alpha');
$search_refsupp=GETPOST('search_refsupp','alpha');
$search_company=GETPOST('search_company','alpha');
$search_town=GETPOST('search_town','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_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_user=GETPOST('search_user','int');
$search_request_author=GETPOST('search_request_author','alpha');
$search_ht=GETPOST('search_ht');
$search_ttc=GETPOST('search_ttc');
$search_ht=GETPOST('search_ht','alpha');
$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'
$optioncss = GETPOST('optioncss','alpha');
$socid = GETPOST('socid','int');

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014-2016 Charlie BENKE <charlie@patas-monkey.com>
* 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
* it under the terms of the GNU General Public License as published by
@ -172,12 +173,12 @@ $total=0;
if ($type == '0')
{
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]);
}
else if ($type == '1')
{
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
{

View File

@ -1801,7 +1801,7 @@ if ($action == 'create')
}
// 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) {
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>';
}