diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 1026fd092bb..fc5c9324121 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2018-2024 Alexandre Spangaro * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 MDW + * Copyright (C) 2024 Jose MARTINEZ * * 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 @@ -256,7 +257,7 @@ class Asset extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs; + global $langs; $this->db = $db; @@ -343,13 +344,7 @@ class Asset extends CommonObject // // // Load source object // $result = $object->fetchCommon($fromid); - // if ($result > 0 && !empty($object->table_element_line)) { - // $object->fetchLines(); - // } // - // // get lines so they will be clone - // //foreach($this->lines as $line) - // // $line->fetch_optionals(); // // // Reset some properties // unset($object->id); @@ -420,6 +415,7 @@ class Asset extends CommonObject // $this->db->rollback(); // return -1; // } + return -1; } @@ -434,10 +430,6 @@ class Asset extends CommonObject { $result = $this->fetchCommon($id, $ref); if ($result > 0) { - if (!empty($this->table_element_line)) { - $this->fetchLines(); - } - $res = $this->hasDepreciationLinesInBookkeeping(); if ($res < 0) { return -1; @@ -454,18 +446,6 @@ class Asset extends CommonObject return $result; } - /** - * Load object lines in memory from the database - * - * @return int Return integer <0 if KO, 0 if not found, >0 if OK - */ - public function fetchLines() - { - $this->lines = array(); - - return 1; - } - /** * Load list of objects in memory from the database. @@ -1028,7 +1008,7 @@ class Asset extends CommonObject // Get depreciation period $depreciation_date_start = $this->date_start > $this->date_acquisition ? $this->date_start : $this->date_acquisition; - $depreciation_date_end = dol_time_plus_duree((int) $depreciation_date_start, $fields['duration'], $fields['duration_type'] == 1 ? 'm' : ($fields['duration_type'] == 2 ? 'd' : 'y')); + $depreciation_date_end = dol_time_plus_duree(dol_time_plus_duree((int) $depreciation_date_start, $fields['duration'], $fields['duration_type'] == 1 ? 'm' : ($fields['duration_type'] == 2 ? 'd' : 'y')), -1, 'd'); $depreciation_amount = $fields['amount_base_depreciation_ht']; if ($fields['duration_type'] == 2) { // Daily $fiscal_period_start = $depreciation_date_start; @@ -1041,7 +1021,7 @@ class Asset extends CommonObject $fiscal_period_start = $init_fiscal_period_start; $fiscal_period_end = $init_fiscal_period_end; } - $cumulative_depreciation_ht = $last_cumulative_depreciation_ht; + $cumulative_depreciation_ht = (float) $last_cumulative_depreciation_ht; $depreciation_period_amount = $depreciation_amount - (float) $this->reversal_amount_ht; $start_date = $depreciation_date_start; $disposal_date = isset($this->disposal_date) && $this->disposal_date !== "" ? $this->disposal_date : ""; @@ -1591,18 +1571,6 @@ class Asset extends CommonObject return $this->initAsSpecimenCommon(); } - /** - * Create an array of lines - * - * @return array|int array of lines if OK, <0 if KO - */ - public function getLinesArray() - { - $this->lines = array(); - - return $this->lines; - } - /** * Returns the reference to the following non used object depending on the active numbering module. * diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index ac9dc8c778c..c39d6eb47f5 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -1,8 +1,8 @@ - * Copyright (C) 2021 Open-Dsi - * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2021 Open-Dsi + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW * * 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 @@ -263,13 +263,6 @@ class AssetModel extends CommonObject // Load source object $result = $object->fetchCommon($fromid); - if ($result > 0 && !empty($object->table_element_line)) { - $object->fetchLines(); - } - - // get lines so they will be clone - //foreach($this->lines as $line) - // $line->fetch_optionals(); // Reset some properties unset($object->id); @@ -354,25 +347,10 @@ class AssetModel extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); - } + return $result; } - /** - * Load object lines in memory from the database - * - * @return int Return integer <0 if KO, 0 if not found, >0 if OK - */ - public function fetchLines() - { - $this->lines = array(); - - return 1; - } - - /** * Load list of objects in memory from the database. * @@ -810,46 +788,4 @@ class AssetModel extends CommonObject return $this->initAsSpecimenCommon(); } - - /** - * Create an array of lines - * - * @return array|int array of lines if OK, <0 if KO - */ - public function getLinesArray() - { - $this->lines = array(); - - return $this->lines; - } - - /** - * Action executed by scheduler - * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters' - * Use public function doScheduledJob($param1, $param2, ...) to get parameters - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - //global $conf, $langs; - - //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; - - $error = 0; - $this->output = ''; - $this->error = ''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - $now = dol_now(); - - $this->db->begin(); - - // ... - - $this->db->commit(); - - return $error; - } } diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index 1318447ee35..6538c1fe2ee 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -60,7 +60,7 @@ if (empty($action)) { exit; } -if ($element === 'facture') { +if ($element === 'facture') { // Test on permission done in top of page require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index db5378949d1..ef5939be02f 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1,9 +1,9 @@ - * Copyright (C) 2020 Thibault FOUCART - * Copyright (C) 2023 Joachim Kueter +/* Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Thibault FOUCART + * Copyright (C) 2023 Joachim Kueter * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * 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 @@ -47,7 +47,7 @@ class Invoices extends DolibarrApi private $invoice; /** - * @var FactureRec $templte_invoice {@type FactureRec} + * @var FactureRec $template_invoice {@type FactureRec} */ private $template_invoice; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 9e926c1c054..0d3e7184e6b 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -1,9 +1,10 @@ - * Copyright (C) 2003 Xavier Dutoit - * Copyright (C) 2004-2020 Laurent Destailleur - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2006 Jean Heimburger +/* Copyright (C) 2003-2007 Rodolphe Quiedeville + * Copyright (C) 2003 Xavier Dutoit + * Copyright (C) 2004-2020 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2006 Jean Heimburger + * Copyright (C) 2024 Frédéric France * * 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 @@ -141,10 +142,20 @@ class Conf extends stdClass public $format_date_hour_text_short; public $format_date_hour_text; + /** + * @var int limit for list + */ public $liste_limit; + + /** + * @var int checkboxes are on left column if 1 + */ public $main_checkbox_left_column; - public $tzuserinputkey = 'tzserver'; // Use 'tzuserrel' to always store date in GMT and show date in time zone of user. + /** + * @var string Use 'tzuserrel' to always store date in GMT and show date in time zone of user. + */ + public $tzuserinputkey = 'tzserver'; // TODO Remove this part. diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 5bc16898203..aff94de25f9 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -1,6 +1,7 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Frédéric France * * 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 @@ -44,7 +45,14 @@ class Link extends CommonObject */ public $entity; + /** + * @var int|'' date add + */ public $datea; + + /** + * @var string Object url + */ public $url; /** @@ -52,7 +60,14 @@ class Link extends CommonObject */ public $label; + /** + * @var string Object type + */ public $objecttype; + + /** + * @var int Object ID + */ public $objectid; @@ -167,11 +182,11 @@ class Link extends CommonObject } // Clean parameters - $this->url = clean_url($this->url, 1); + $this->url = clean_url($this->url, 1); if (empty($this->label)) { $this->label = basename($this->url); } - $this->label = trim($this->label); + $this->label = trim($this->label); $this->db->begin(); diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index 8c421b7c26f..20f8b91125f 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2014 Laurent Destailleur * Copyright (C) 2022-2024 Frédéric France * Copyright (C) 2024 MDW * diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 0befd9431f7..c301d46211f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -3929,7 +3929,7 @@ if (!function_exists("llxFooter")) { print ''."\n"; } - // Wrapper to add log when clicking on download or preview + // JS wrapper to add log when clicking on download or preview if (isModEnabled('blockedlog') && is_object($object) && !empty($object->id) && $object->id > 0) { if (in_array($object->element, array('facture')) && $object->statut > 0) { // Restrict for the moment to element 'facture' print "\n\n"; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index f8ad4f06ce3..ebad79a6d09 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -86,6 +86,10 @@ while ($tmpobj = $db->fetch_object($resWar)) { if ($count == 1 && (empty($fk_entrepot) || $fk_entrepot <= 0) && getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { $fk_entrepot = $lastWarehouseID; } +//If the warehouse is set to the default selected user +if (!GETPOSTISSET('fk_warehouse') && (empty($fk_entrepot) || $fk_entrepot <= 0) && getDolGlobalString('MAIN_DEFAULT_WAREHOUSE_USER')) { + $fk_entrepot = $user->fk_warehouse; +} $texte = ''; diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index e667a8b2215..cbce49031ab 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -68,7 +68,7 @@ if (!$user->hasRight('takepos', 'run')) { * View */ -top_httphead('text/html', 1); +top_htmlhead('', '', 1); if ($place > 0) { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$db->escape($_SESSION["takeposterminal"]."-".$place).")'"; @@ -81,6 +81,25 @@ if ($place > 0) { $object = new Facture($db); $object->fetch($facid); + +// Record entry in blocked logs +// DOL_DOCUMENT_ROOT.'/blockedlog/ajax/block-add.php?id='.$object->id.'&element='.$object->element.'&action=DOC_PREVIEW&token='.newToken(); +print " +"; + + // Call to external receipt modules if exist $parameters = array(); $hookmanager->initHooks(array('takeposfrontend')); @@ -103,6 +122,16 @@ if (!empty($hookmanager->resPrint)) { .left { text-align: left; } +.centpercent { + width: 100%; +} +@media only screen and (min-width: 1024px) +{ + body { + margin-left: 50px; + margin-right: 50px; + } +}
@@ -132,7 +161,7 @@ print $langs->trans('Date')." ".dol_print_date($object->date, 'day').'
'; if (getDolGlobalString('TAKEPOS_RECEIPT_NAME')) { print getDolGlobalString('TAKEPOS_RECEIPT_NAME') . " "; } -if ($object->statut == Facture::STATUS_DRAFT) { +if ($object->status == Facture::STATUS_DRAFT) { print str_replace(")", "", str_replace("-", " ".$langs->trans('Place')." ", str_replace("(PROV-POS", $langs->trans("Terminal")." ", $object->ref))); } else { print $object->ref; @@ -155,7 +184,7 @@ if (getDolGlobalString('TAKEPOS_SHOW_DATE_OF_PRINING')) {


- +
@@ -194,7 +223,7 @@ if (getDolGlobalString('TAKEPOS_SHOW_DATE_OF_PRINING')) { product_label)) { echo $line->product_label; } else { - echo $line->description; + echo $line->desc; } ?> @@ -219,7 +248,7 @@ if (getDolGlobalString('TAKEPOS_SHOW_DATE_OF_PRINING')) {
trans("Label"); ?> qty; ?>

- +
trans("TotalHT"); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 2f2b735e97b..8164157664b 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -372,7 +372,7 @@ print 'fontsizesmaller='.$fontsizesmaller."\n"; print 'topMenuFontSize='.$topMenuFontSize."\n"; print 'toolTipBgColor='.$toolTipBgColor."\n"; print 'toolTipFontColor='.$toolTipFontColor."\n"; -print 'conf->global->THEME_SATURATE_RATIO='.(!getDolGlobalString('THEME_SATURATE_RATIO') ? '' : $conf->global->THEME_SATURATE_RATIO)." (must be between 0 and 1)\n"; +print 'conf->global->THEME_SATURATE_RATIO='.getDolGlobalString('THEME_SATURATE_RATIO')." (must be between 0 and 1)\n"; print '*/'."\n"; diff --git a/htdocs/webportal/class/context.class.php b/htdocs/webportal/class/context.class.php index 82503fb5530..0bd07a2ffed 100644 --- a/htdocs/webportal/class/context.class.php +++ b/htdocs/webportal/class/context.class.php @@ -125,6 +125,9 @@ class Context */ public $rootUrl; + /** + * @var string[] + */ public $menu_active = array(); /**