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 develop
Conflicts: htdocs/margin/tabs/productMargins.php htdocs/margin/tabs/thirdpartyMargins.php
This commit is contained in:
commit
675e761297
|
|
@ -996,7 +996,7 @@ if (!empty($arrayfields['t.tms']['checked'])) {
|
|||
print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrapfordate">';
|
||||
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2572,7 +2572,10 @@ class Propal extends CommonObject
|
|||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($date_signature)."', fk_user_signature=".$fk_user_signature;
|
||||
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."'";
|
||||
if ($status == self::STATUS_SIGNED) {
|
||||
$sql .= ", date_signature='".$this->db->idate($now)."', fk_user_signature = ".($fk_user_signature);
|
||||
}
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
|
|
|||
|
|
@ -1640,7 +1640,8 @@ class Contrat extends CommonObject
|
|||
$contractline->id = $contractlineid;
|
||||
$result = $contractline->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
$this->errors[] = $contractline->error;
|
||||
$this->errors = array_merge($this->errors, $contractline->errors);
|
||||
$this->error = $contractline->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -859,8 +859,9 @@ class FormMail extends Form
|
|||
foreach ($listofpaths as $key => $val) {
|
||||
$relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val)));
|
||||
|
||||
if ($conf->entity > 1) {
|
||||
$relativepathtofile = str_replace('/'.$conf->entity.'/', '/', $relativepathtofile);
|
||||
$entity = (isset($this->param['object_entity']) ? $this->param['object_entity'] : $conf->entity);
|
||||
if ($entity > 1) {
|
||||
$relativepathtofile = str_replace('/'.$entity.'/', '/', $relativepathtofile);
|
||||
}
|
||||
// Try to extract data from full path
|
||||
$formfile_params = array();
|
||||
|
|
@ -870,7 +871,7 @@ class FormMail extends Form
|
|||
// Preview of attachment
|
||||
$out .= img_mime($listofnames[$key]).$listofnames[$key];
|
||||
|
||||
$out .= ' '.$formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]);
|
||||
$out .= ' '.$formfile->showPreview(array(), $formfile_params[2], $formfile_params[4], 0, ($entity == 1 ? '' : 'entity='.((int) $entity));
|
||||
if (!$this->withfilereadonly) {
|
||||
$out .= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key + 1).'" class="removedfile input-nobottom" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />';
|
||||
//$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).'&id=removedfile_'.$key.'">'.img_delete($langs->trans("Remove"), 'id="removedfile_'.$key.'" name="removedfile_'.$key.'"', 'removedfile input-nobottom').'</a>';
|
||||
|
|
|
|||
|
|
@ -1531,7 +1531,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
|
|||
if (isModEnabled('order')) {
|
||||
$langs->load("orders");
|
||||
if (isModEnabled('invoice')) {
|
||||
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
|
||||
$newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&search_billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"'));
|
||||
}
|
||||
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire'));
|
||||
}
|
||||
|
|
@ -1540,7 +1540,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
|
|||
if (isModEnabled('supplier_invoice')) {
|
||||
if (getDolGlobalString('SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE')) {
|
||||
$langs->load("supplier");
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5&search_billed=0", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"'));
|
||||
//if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -392,6 +392,8 @@ if ($action == 'presend') {
|
|||
$formmail->param['id'] = $object->id;
|
||||
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
$formmail->param['fileinit'] = array($file);
|
||||
$formmail->param['object_entity'] = $object->entity;
|
||||
|
||||
// Show form
|
||||
print $formmail->get_form();
|
||||
|
||||
|
|
|
|||
|
|
@ -423,9 +423,8 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$old_date_echeance = $object->date_echeance;
|
||||
$new_date_echeance = $object->calculate_date_lim_reglement();
|
||||
if ($new_date_echeance > $old_date_echeance) {
|
||||
if ($new_date_echeance) {
|
||||
$object->date_echeance = $new_date_echeance;
|
||||
}
|
||||
if ($object->date_echeance < $object->date) {
|
||||
|
|
@ -489,7 +488,7 @@ if (empty($reshook)) {
|
|||
|
||||
$object->date = $newdate;
|
||||
$date_echence_calc = $object->calculate_date_lim_reglement();
|
||||
if (!empty($object->date_echeance) && $object->date_echeance < $date_echence_calc) {
|
||||
if (!empty($object->date_echeance)) {
|
||||
$object->date_echeance = $date_echence_calc;
|
||||
}
|
||||
if ($object->date_echeance && $object->date_echeance < $object->date) {
|
||||
|
|
|
|||
|
|
@ -226,7 +226,9 @@ if (!empty($enddateyear)) {
|
|||
$param .= "&enddateyear=".urlencode((string) ($enddateyear));
|
||||
}
|
||||
|
||||
|
||||
$totalMargin = 0;
|
||||
$marginRate = '';
|
||||
$markRate = '';
|
||||
dol_syslog('margin::agentMargins.php', LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
|
|
|||
|
|
@ -297,6 +297,9 @@ if (is_array($listofcateg)) {
|
|||
}
|
||||
}
|
||||
|
||||
$totalMargin = 0;
|
||||
$marginRate = '';
|
||||
$markRate = '';
|
||||
dol_syslog('margin::customerMargins.php', LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
|
|
|||
|
|
@ -247,6 +247,9 @@ if (is_array($listofcateg)) {
|
|||
}
|
||||
}
|
||||
|
||||
$totalMargin = 0;
|
||||
$marginRate = '';
|
||||
$markRate = '';
|
||||
dol_syslog('margin::productMargins.php', LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ $invoicestatic = new Facture($db);
|
|||
|
||||
$form = new Form($db);
|
||||
$totalMargin = 0;
|
||||
$marginRate = 0;
|
||||
$markRate = 0;
|
||||
$marginRate = '';
|
||||
$markRate = '';
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
||||
|
|
|
|||
|
|
@ -146,6 +146,10 @@ if ($search_invoice_date_end) {
|
|||
$param .= '&search_invoice_date_end_day='.dol_print_date($search_invoice_date_end, '%d').'&search_invoice_date_end_month='.dol_print_date($search_invoice_date_end, '%m').'&search_invoice_date_end_year='.dol_print_date($search_invoice_date_end, '%Y');
|
||||
}
|
||||
|
||||
$totalMargin = 0;
|
||||
$marginRate = '';
|
||||
$markRate = '';
|
||||
|
||||
if ($socid > 0) {
|
||||
$object = new Societe($db);
|
||||
$object->fetch($socid);
|
||||
|
|
|
|||
|
|
@ -526,7 +526,9 @@ if (empty($reshook)) {
|
|||
if ($action == 'activate_price_by_qty') {
|
||||
// Activating product price by quantity add a new price line with price_by_qty set to 1
|
||||
$level = GETPOSTINT('level');
|
||||
$ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 1);
|
||||
$basePrice = ($object->price_base_type == 'HT') ? $object->price : $object->price_ttc;
|
||||
$basePriceMin = ($object->price_base_type == 'HT') ? $object->price_min : $object->price_min_ttc;
|
||||
$ret = $object->updatePrice($basePrice, $object->price_base_type, $user, $object->tva_tx, $basePriceMin, $level, $object->tva_npr, 1);
|
||||
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
@ -536,7 +538,9 @@ if (empty($reshook)) {
|
|||
if ($action == 'disable_price_by_qty') {
|
||||
// Disabling product price by quantity add a new price line with price_by_qty set to 0
|
||||
$level = GETPOSTINT('level');
|
||||
$ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 0);
|
||||
$basePrice = ($object->price_base_type == 'HT') ? $object->price : $object->price_ttc;
|
||||
$basePriceMin = ($object->price_base_type == 'HT') ? $object->price_min : $object->price_min_ttc;
|
||||
$ret = $object->updatePrice($basePrice, $object->price_base_type, $user, $object->tva_tx, $basePriceMin, $level, $object->tva_npr, 0);
|
||||
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
|
|
|
|||
|
|
@ -53,9 +53,30 @@ class StockTransfer extends CommonObject
|
|||
public $table_element_line = 'stocktransfer_stocktransferline';
|
||||
|
||||
/**
|
||||
* @var string[] List of child tables. To know object to delete on cascade.
|
||||
* If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
||||
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
||||
* @var int Does this object support multicompany module ?
|
||||
* 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table
|
||||
*/
|
||||
public $ismultientitymanaged = 0;
|
||||
|
||||
/**
|
||||
* @var int Does object support extrafields ? 0=No, 1=Yes
|
||||
*/
|
||||
public $isextrafieldmanaged = 1;
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'stocktransfer_stocktransferline';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this object has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_stocktransfer';
|
||||
|
||||
/**
|
||||
* @var string[] List of child tables. To know object to delete on cascade.
|
||||
* If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
||||
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
||||
*/
|
||||
protected $childtablesoncascade = array('stocktransfer_stocktransferline');
|
||||
|
||||
|
|
|
|||
|
|
@ -496,8 +496,9 @@ if ($action == 'confirm_generateinvoice') {
|
|||
if (getDolGlobalInt('PROJECT_USE_REAL_COST_FOR_TIME_INVOICING')) {
|
||||
// We set unit price to 0 to force the use of the rate saved during recording
|
||||
$pu_ht = 0;
|
||||
} else {
|
||||
} elseif ($idprod <= 0) {
|
||||
// We want to sell all the time spent with the last hourly rate of user
|
||||
// -> but what about choice user selected ? add idprod test
|
||||
$pu_ht = $fuser->thm;
|
||||
}
|
||||
|
||||
|
|
@ -517,7 +518,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||
$localtax2line = $localtax2;
|
||||
|
||||
// If a particular product/service was defined for the task
|
||||
if (!empty($fk_product) && $fk_product !== $idprod) {
|
||||
if (!empty($fk_product) && ($fk_product > 0) && ($fk_product !== $idprod)) {
|
||||
if (!array_key_exists($fk_product, $product_data_cache)) {
|
||||
$result = $tmpproduct->fetch($fk_product);
|
||||
if ($result < 0) {
|
||||
|
|
|
|||
|
|
@ -169,6 +169,9 @@ $morecss = array();
|
|||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions";
|
||||
|
||||
$sqlfields = $sql;
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid";
|
||||
|
|
@ -185,11 +188,29 @@ if ($search_all) {
|
|||
}
|
||||
$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec, g.tms";
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than paging size (filtering), goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
// Complete request and execute it with limit
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
|
|
@ -199,9 +220,6 @@ if (!$resql) {
|
|||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
$nbtotalofrecords = $num;
|
||||
|
||||
$i = 0;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2024 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
|
|
@ -137,9 +137,9 @@ $arrayfields = array(
|
|||
'u.email' => array('label' => "EMail", 'checked' => 1, 'position' => 35),
|
||||
'u.api_key' => array('label' => "ApiKey", 'checked' => 0, 'position' => 40, "enabled" => (isModEnabled('api') && $user->admin)),
|
||||
'u.fk_soc' => array('label' => "Company", 'checked' => ($contextpage == 'employeelist' ? 0 : 1), 'position' => 45),
|
||||
'u.ref_employee' => array('label' => "RefEmployee", 'checked' => -1, 'position' => 60, 'enabled' => (isModEnabled('hrm') && $permissiontoreadhr)),
|
||||
'u.national_registration_number' => array('label' => "NationalRegistrationNumber", 'checked' => -1, 'position' => 61, 'enabled' => (isModEnabled('hrm') && $permissiontoreadhr)),
|
||||
'u.job' => array('label' => "PostOrFunction", 'checked' => -1, 'position' => 50),
|
||||
'u.ref_employee' => array('label' => "RefEmployee", 'checked' => -1, 'position' => 50, 'enabled' => (isModEnabled('hrm') && $permissiontoreadhr)),
|
||||
'u.national_registration_number' => array('label' => "NationalRegistrationNumber", 'checked' => -1, 'position' => 51, 'enabled' => (isModEnabled('hrm') && $permissiontoreadhr)),
|
||||
'u.job' => array('label' => "PostOrFunction", 'checked' => -1, 'position' => 60),
|
||||
'u.salary' => array('label' => "Salary", 'checked' => -1, 'position' => 80, 'enabled' => (isModEnabled('salaries') && $user->hasRight("salaries", "readall")), 'isameasure' => 1),
|
||||
'u.datelastlogin' => array('label' => "LastConnexion", 'checked' => 1, 'position' => 100),
|
||||
'u.datepreviouslogin' => array('label' => "PreviousConnexion", 'checked' => 0, 'position' => 110),
|
||||
|
|
@ -915,10 +915,6 @@ if (!empty($arrayfields['u.entity']['checked'])) {
|
|||
print_liste_field_titre($arrayfields['u.entity']['label'], $_SERVER['PHP_SELF'], "u.entity", $param, "", "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['u.job']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['u.job']['label'], $_SERVER['PHP_SELF'], "u.job", $param, "", "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['u.ref_employee']['checked'])) {
|
||||
print_liste_field_titre("RefEmployee", $_SERVER['PHP_SELF'], "u.ref_employee", $param, "", "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -927,6 +923,10 @@ if (!empty($arrayfields['u.national_registration_number']['checked'])) {
|
|||
print_liste_field_titre("NationalRegistrationNumber", $_SERVER['PHP_SELF'], "u.national_registration_number", $param, "", "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['u.job']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['u.job']['label'], $_SERVER['PHP_SELF'], "u.job", $param, "", "", $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['u.salary']['checked'])) {
|
||||
print_liste_field_titre("Salary", $_SERVER['PHP_SELF'], "u.salary", $param, "", "", $sortfield, $sortorder, 'right ');
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user