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

develop
This commit is contained in:
Laurent Destailleur 2022-11-22 23:55:45 +01:00
commit 8f196c1214
7 changed files with 28 additions and 15 deletions

View File

@ -2079,7 +2079,7 @@ class ActionComm extends CommonObject
}
if ($exportholiday == 1) {
$langs->load("holidays");
$langs->load("holiday");
$title = $langs->trans("Holidays");
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.email, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";

View File

@ -70,9 +70,10 @@ function contact_prepare_head(Contact $object)
$sql = 'SELECT COUNT(n.rowid) as nb';
$sql .= ' FROM '.MAIN_DB_PREFIX.'projet as n';
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (n.rowid = cc.element_id)';
$sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id);
$sql .= ' AND cc.fk_c_type_contact IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE element="project" AND source="external")';
$sql .= ' AND n.entity IN ('.getEntity('project').')';
$sql .= " WHERE cc.fk_socpeople = ".((int) $object->id);
$sql .= " AND cc.fk_c_type_contact IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE element='project' AND source='external')";
$sql .= " AND n.entity IN (".getEntity('project').")";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
@ -191,10 +192,10 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_lead_status as cls on p.fk_opp_status = cls.rowid';
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact as cc ON (p.rowid = cc.element_id)';
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_type_contact as ctc ON (ctc.rowid = cc.fk_c_type_contact)';
$sql .= ' WHERE cc.fk_socpeople = '.((int) $object->id);
$sql .= ' AND ctc.element="project" AND ctc.source="external"';
$sql .= ' AND p.entity IN ('.getEntity('project').')';
$sql .= ' ORDER BY p.dateo DESC';
$sql .= " WHERE cc.fk_socpeople = ".((int) $object->id);
$sql .= " AND ctc.element='project' AND ctc.source='external'";
$sql .= " AND p.entity IN (".getEntity('project').")";
$sql .= " ORDER BY p.dateo DESC";
$result = $db->query($sql);
if ($result) {

View File

@ -91,7 +91,7 @@ if ($module == 'propal') {
} elseif ($module == 'shipping') {
$permission = $user->hasRight("expedition", "creer");
} elseif ($module == 'product') {
$permission = $user->hasRight("produit", "creer");
$permission = $user->hasRight("product", "creer");
} elseif ($module == 'service') {
$permission = $user->hasRight("service", "creer");
} elseif ($module == 'ecmfiles') {

View File

@ -95,7 +95,7 @@ if ($action == 'add_payment') {
// Create a line of payments
$payment = new PaymentDonation($db);
$payment->chid = $chid;
$payment->datepaid = $datepaid;
$payment->datep = $datepaid;
$payment->amounts = $amounts; // Tableau de montant
$payment->paymenttype = GETPOST("paymenttype", 'int');
$payment->num_payment = GETPOST("num_payment", 'alphanohtml');
@ -192,14 +192,14 @@ if ($action == 'create') {
print '</tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td colspan="2">';
$form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->paymenttype, "paymenttype");
$form->select_types_paiements(GETPOSTISSET("paymenttype") ? GETPOST("paymenttype") : $object->fk_typepayment, "paymenttype");
print "</td>\n";
print '</tr>';
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans('AccountToCredit').'</td>';
print '<td colspan="2">';
$form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $object->accountid, "accountid", 0, '', 2); // Show open bank account list
$form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : "0", "accountid", 0, '', 2); // Show open bank account list
print '</td></tr>';
// Number

View File

@ -54,13 +54,13 @@ $permissionnote = $user->rights->produit->creer; // Used by the include of actio
if ($object->id > 0) {
if ($object->type == $object::TYPE_PRODUCT) {
restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
restrictedArea($user, 'product', $object->id, 'product&product', '', '');
}
if ($object->type == $object::TYPE_SERVICE) {
restrictedArea($user, 'service', $object->id, 'product&product', '', '');
}
} else {
restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
restrictedArea($user, 'product|service', $fieldvalue, 'product&product', '', '', $fieldtype);
}

View File

@ -419,7 +419,7 @@ if (!empty($conf->categorie->enabled))
// If the user can view user other than himself
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<div class="inline-block hideonsmartphone"></div>';
$includeonly = 'hierachyme';
$includeonly = 'hierarchyme';
if (empty($user->rights->user->user->lire)) {
$includeonly = array($user->id);
}

View File

@ -118,6 +118,10 @@ class Reception extends CommonObject
public $lines = array();
// detail of lot and qty = array(id in llx_commande_fournisseur_dispatch, batch, qty)
// We can use this to know warehouse planned to be used for each lot.
public $detail_batch;
const STATUS_DRAFT = 0;
const STATUS_VALIDATED = 1;
const STATUS_CLOSED = 2;
@ -1209,6 +1213,14 @@ class Reception extends CommonObject
$this->total_ttc += $pu_ht + $tva;
if (isModEnabled('productbatch') && !empty($line->batch)) {
$detail_batch = new stdClass();
$detail_batch->eatby = $line->eatby;
$detail_batch->sellby = $line->sellby;
$detail_batch->batch = $line->batch;
$detail_batch->qty = $line->qty;
$line->detail_batch[] = $detail_batch;
}
$this->lines[] = $line;
}