mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 20.0
This commit is contained in:
commit
401c9898bb
|
|
@ -68,9 +68,10 @@ $socid = '';
|
|||
if (!empty($user->socid)) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'propal', $object->id);
|
||||
$hookmanager->initHooks(array('proposalcontactcard', 'globalcard'));
|
||||
|
||||
restrictedArea($user, 'propal', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ $socid = '';
|
|||
if (!empty($user->socid)) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$hookmanager->initHooks(array('propaldocument', 'globalcard'));
|
||||
restrictedArea($user, 'propal', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
|
|
|
|||
|
|
@ -746,6 +746,11 @@ class Account extends CommonObject
|
|||
$this->status = $this->clos;
|
||||
}
|
||||
|
||||
if (empty($this->address && !empty($this->domiciliation))) {
|
||||
dol_syslog(get_class($this)."::create domiciliation is deprecated use address", LOG_NOTICE);
|
||||
$this->address = $this->domiciliation;
|
||||
}
|
||||
|
||||
// Load the library to validate/check a BAN account
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -57,11 +57,11 @@ if ($id > 0 || !empty($ref)) {
|
|||
$ret = $object->fetch($id, $ref, '', '', (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0));
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'facture', $object->id);
|
||||
$hookmanager->initHooks(array('invoicecontactcard', 'globalcard'));
|
||||
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
$result = restrictedArea($user, 'facture', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ $permissiontoadd = $user->hasRight('facture', 'creer');
|
|||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$hookmanager->initHooks(array('invoicedocument', 'globalcard'));
|
||||
$result = restrictedArea($user, 'facture', $object->id, '');
|
||||
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
|
|
|
|||
|
|
@ -3667,9 +3667,7 @@ class Form
|
|||
|
||||
$sql = "SELECT p.rowid, p.ref, p.label, p.price, p.duration, p.fk_product_type, p.stock, p.tva_tx as tva_tx_sale, p.default_vat_code as default_vat_code_sale,";
|
||||
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice, pfp.barcode";
|
||||
if (isModEnabled('multicurrency')) {
|
||||
$sql .= ", pfp.multicurrency_code, pfp.multicurrency_unitprice";
|
||||
}
|
||||
$sql .= ", pfp.multicurrency_code, pfp.multicurrency_unitprice";
|
||||
$sql .= ", pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.default_vat_code, pfp.fk_soc, s.nom as name";
|
||||
$sql .= ", pfp.supplier_reputation";
|
||||
// if we use supplier description of the products
|
||||
|
|
@ -4049,7 +4047,7 @@ class Form
|
|||
'type' => $outtype,
|
||||
'duration_value' => $outdurationvalue,
|
||||
'duration_unit' => $outdurationunit,
|
||||
'disabled' => empty($objp->idprodfournprice),
|
||||
'disabled' => (empty($objp->idprodfournprice) ? true : false),
|
||||
'description' => $objp->description
|
||||
);
|
||||
if (isModEnabled('multicurrency')) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 Nick Fragoulis
|
||||
*
|
||||
* 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
|
||||
|
|
@ -67,7 +68,7 @@ if (!$sortorder) {
|
|||
}
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new PaymentSalary($db);
|
||||
$object = new Salary($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('salarieslist')); // Note that conf->hooks_modules contains array
|
||||
|
|
@ -339,6 +340,9 @@ $sql = preg_replace('/,\s*$/', '', $sql);
|
|||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (s.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON (ps.fk_salary = s.rowid) ";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON (s.fk_typepayment = pst.id) ";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account ba ON (ba.rowid = s.fk_account), ";
|
||||
|
|
@ -386,6 +390,8 @@ if ($search_status != '' && $search_status >= 0) {
|
|||
if ($search_type_id) {
|
||||
$sql .= " AND s.fk_typepayment=".((int) $search_type_id);
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
$sql .= " GROUP BY u.rowid, u.lastname, u.firstname, u.login, u.email, u.admin, u.photo, u.salary, u.fk_soc, u.statut,";
|
||||
$sql .= " s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp, s.dateep, s.fk_typepayment, s.fk_bank,";
|
||||
$sql .= " ba.rowid, ba.ref, ba.number, ba.account_number, ba.fk_accountancy_journal, ba.label, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos,";
|
||||
|
|
@ -431,7 +437,7 @@ $num = $db->num_rows($resql);
|
|||
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);
|
||||
header("Location: ".DOL_URL_ROOT.'/salaries/card.php?id='.$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
@ -627,6 +633,9 @@ if (isModEnabled("bank")) {
|
|||
print '</td>';
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Amount
|
||||
print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).'"></td>';
|
||||
|
||||
|
|
@ -637,9 +646,6 @@ $liststatus = array('0' => $langs->trans("Unpaid"), '1' => $langs->trans("Paid")
|
|||
print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', 'search_status width100 onrightofpage');
|
||||
print '</td>';
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields' => $arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
@ -680,12 +686,15 @@ if (isModEnabled("bank")) {
|
|||
print_liste_field_titre("DefaultBankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "s.amount", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "s.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
print_liste_field_titre('Status', $_SERVER["PHP_SELF"], "s.paye", '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
$totalarray['nbfield']++;
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
@ -863,6 +872,9 @@ while ($i < $imaxinloop) {
|
|||
|
||||
// if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
// Amount
|
||||
print '<td class="nowraponall right"><span class="amount">'.price($obj->amount).'</span></td>';
|
||||
if (!$i) {
|
||||
|
|
@ -879,8 +891,6 @@ while ($i < $imaxinloop) {
|
|||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user