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

Conflicts:
	htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php
	htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
This commit is contained in:
Laurent Destailleur 2019-05-08 18:24:50 +02:00
commit 590b1d1e90
8 changed files with 31 additions and 27 deletions

View File

@ -37,11 +37,12 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","accountancy"));
$action = GETPOST('action', 'aZ09');
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@ -186,21 +187,25 @@ if (! $resql) {
exit();
}
$param='';
$param.="&socid=".urlencode($socid);
$num = $db->num_rows($resql);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_customer.php", LOG_DEBUG);
if ($resql) {
$i = 0;
$param="&socid=".$socid;
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
$letteringbutton = '<a class="divButAction"><span class="valignmiddle"><input class="butAction" type="submit" value="lettering" name="lettering" id="lettering"></span></a>';
//$letteringbutton = '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=lettering" value="lettering" name="lettering" id="lettering"><span class="valignmiddle">' . $langs->trans("Lettering") . '</span></a>';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
print "<table class=\"noborder\" width=\"100%\">";
print '<div class="div-table-responsive-no-min">';
print '<table class="liste" width="100%">'."\n";
/*
print '<tr class="liste_titre">';

View File

@ -18,7 +18,6 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
@ -37,11 +36,12 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("compta","accountancy"));
$action = GETPOST('action', 'aZ09');
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$socid = GETPOST('socid','int')?GETPOST('socid','int'):GETPOST('id','int');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@ -176,21 +176,25 @@ while ($obj = $db->fetch_object($resql)) {
$sql.= $db->plimit($limit+1, $offset);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql) {
dol_print_error($db);
exit;
}
$param='';
$param.="&socid=".urlencode($socid);
$num = $db->num_rows($resql);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettering_supplier.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
$param="&socid=".$socid;
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'?socid=' . $object->id . '" method="POST">';
print '<input type="hidden" name="socid" value="' . $object->id . '">';
@ -198,7 +202,8 @@ if ($resql) {
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, $letteringbutton, '', $limit);
print "<table class=\"noborder\" width=\"100%\">";
print '<div class="div-table-responsive-no-min">';
print '<table class="liste" width="100%">'."\n";
/*
print '<tr class="liste_titre">';

View File

@ -1250,7 +1250,7 @@ abstract class CommonObject
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
$sql.= " AND tc.element = '".$element."'";
$sql.= " AND tc.source = '".$source."'";
$sql.= " AND tc.code = '".$code."'";
if ($code) $sql.= " AND tc.code = '".$code."'";
$sql.= " AND tc.active = 1";
if ($status) $sql.= " AND ec.statut = ".$status;

View File

@ -110,7 +110,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/**
* Issuer
* @var Company object that emits
* @var Societe object that emits
*/
public $emetteur;
@ -1310,10 +1310,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
// If BILLING contact defined on order, we use it
// If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER'
$usecontact=false;
$arrayidcontact=$object->getIdContact('external', 'BILLING');
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
if (count($arrayidcontact) > 0)
{
$usecontact=true;

View File

@ -441,7 +441,7 @@ if (empty($reshook))
if ($result < 0)
{
$langs->load("errors");
setEventMessages($langs->trans($object->error), null, 'errors');
setEventMessages($langs->trans($object->error), $object->errors, 'errors');
}
else
{

View File

@ -757,7 +757,7 @@ class Expedition extends CommonObject
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref));
if ($result < 0) {
$error++;
$this->errors[]=$mouvS->error;
$this->error = $mouvS->error;
$this->errors = array_merge($this->errors, $mouvS->errors);
break;
}
@ -771,7 +771,7 @@ class Expedition extends CommonObject
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref), '', $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);
if ($result < 0) {
$error++;
$this->errors[]=$mouvS->error;
$this->error = $mouvS->error;
$this->errors = array_merge($this->errors, $mouvS->errors);
break;
}
@ -851,11 +851,6 @@ class Expedition extends CommonObject
}
else
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::valid ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}

View File

@ -100,7 +100,7 @@ if (empty($conf) || ! is_object($conf)) {
{
print '<td>'.$langs->trans('Project').'</td>';
print '<td>';
$formproject->select_projects(0, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
$formproject->select_projects(-1, '', 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth300');
print '</td>';
}
print '</tr>';

View File

@ -22,7 +22,7 @@
/**
* \file htdocs/societe/consumption.php
* \ingroup societe
* \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty
* \brief Add a tab on thirdparty view to list all products/services bought or sells by thirdparty
*/
require "../main.inc.php";