From 2c7a78867847d532c5c5ad0c701f872389e5ad69 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Fri, 27 Aug 2021 11:09:10 +0800 Subject: [PATCH 01/42] Update shipment.php --- htdocs/expedition/shipment.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 42b8630bd3c..f9714039016 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -617,15 +617,17 @@ if ($id > 0 || !empty($ref)) { $sql = "SELECT cd.rowid, cd.fk_product, cd.product_type as type, cd.label, cd.description,"; $sql .= " cd.price, cd.tva_tx, cd.subprice,"; - $sql .= " cd.qty,"; + $sql .= " cd.qty, cd.fk_unit,"; $sql .= ' cd.date_start,'; $sql .= ' cd.date_end,'; $sql .= ' cd.special_code,'; $sql .= ' p.rowid as prodid, p.label as product_label, p.entity, p.ref, p.fk_product_type as product_type, p.description as product_desc,'; $sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,'; $sql .= ' p.surface, p.surface_units, p.volume, p.volume_units'; + $sql .= ', u.short_label as unit_order'; $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units as u ON cd.fk_unit = u.rowid"; $sql .= " WHERE cd.fk_commande = ".((int) $object->id); $sql .= " ORDER BY cd.rang, cd.rowid"; @@ -761,7 +763,7 @@ if ($id > 0 || !empty($ref)) { } // Qty ordered - print ''.$objp->qty.''; + print ''.$objp->qty.' '.$objp->unit_order.''; // Qty already shipped $qtyProdCom = $objp->qty; @@ -769,7 +771,7 @@ if ($id > 0 || !empty($ref)) { // Nb of sending products for this line of order $qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0); print $qtyAlreadyShipped; - print ''; + print ' '.$objp->unit_order.''; // Qty remains to ship print ''; @@ -780,7 +782,7 @@ if ($id > 0 || !empty($ref)) { } else { print '0 ('.$langs->trans("Service").')'; } - print ''; + print ' '.$objp->unit_order.''; if ($objp->fk_product > 0) { $product = new Product($db); From c219b8f576bd69db74be6020afa58c0a859adc20 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Sat, 28 Aug 2021 15:19:45 +0800 Subject: [PATCH 02/42] Update card.php --- htdocs/expedition/card.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 676a5cae22c..6c3e3748892 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1133,11 +1133,17 @@ if ($action == 'create') { print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); print "\n"; } + + // unit of order + $unit_order = '' + if ($conf->global->PRODUCT_USE_UNITS) { + $unit_order = measuringUnitString($line->fk_unit); + } // Qty print ''.$line->qty; print ''; - print ''; + print ''.$unit_order.''; $qtyProdCom = $line->qty; // Qty already shipped @@ -1145,7 +1151,7 @@ if ($action == 'create') { $quantityDelivered = $object->expeditions[$line->id]; print $quantityDelivered; print ''; - print ''; + print ''.$unit_order.''; // Qty to ship $quantityAsked = $line->qty; @@ -2030,7 +2036,7 @@ if ($action == 'create') { // Get list of products already sent for same source object into $alreadysent $alreadysent = array(); if ($origin && $origin_id > 0) { - $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; + $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.fk_unit, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot"; $sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition"; //if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; @@ -2149,9 +2155,14 @@ if ($action == 'create') { print_date_range($lines[$i]->date_start, $lines[$i]->date_end); print "\n"; } + + $unit_order = '' + if ($conf->global->PRODUCT_USE_UNITS) { + $unit_order = measuringUnitString($lines[$i]->fk_unit); + } // Qty ordered - print ''.$lines[$i]->qty_asked.''; + print ''.$lines[$i]->qty_asked.' '.$unit_order.''; // Qty in other shipments (with shipment and warehouse used) if ($origin && $origin_id > 0) { @@ -2215,7 +2226,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2226,7 +2237,7 @@ if ($action == 'create') { foreach ($lines[$i]->details_entrepot as $detail_entrepot) { print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).''; // Batch number managment @@ -2241,7 +2252,7 @@ if ($action == 'create') { print ''; print ''; // Qty to ship or shipped - print ''; + print ''.$unit_order.''; // Warehouse source print ''; // Batch number managment @@ -2253,7 +2264,7 @@ if ($action == 'create') { print ''; } else { // Qty to ship or shipped - print ''.$lines[$i]->qty_shipped.''; + print ''.$lines[$i]->qty_shipped.' '.$unit_order.''; // Warehouse source if (!empty($conf->stock->enabled)) { From 74ed754fcc3a08cba815470ba01f9d33655c0019 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 28 Aug 2021 07:22:25 +0000 Subject: [PATCH 03/42] Fixing style errors. --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6c3e3748892..7c30789ecb0 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1133,7 +1133,7 @@ if ($action == 'create') { print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); print "\n"; } - + // unit of order $unit_order = '' if ($conf->global->PRODUCT_USE_UNITS) { @@ -2155,7 +2155,7 @@ if ($action == 'create') { print_date_range($lines[$i]->date_start, $lines[$i]->date_end); print "\n"; } - + $unit_order = '' if ($conf->global->PRODUCT_USE_UNITS) { $unit_order = measuringUnitString($lines[$i]->fk_unit); From 4ae29c53aa7678f031863828c35a8d4ba7ee69e5 Mon Sep 17 00:00:00 2001 From: henrynopo Date: Sat, 28 Aug 2021 15:30:05 +0800 Subject: [PATCH 04/42] Update pdf_espadon.modules.php --- .../expedition/doc/pdf_espadon.modules.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 28d797acffc..1d449dcccbd 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -650,6 +650,11 @@ class pdf_espadon extends ModelePdfExpedition $this->printStdColumnContent($pdf, $curY, 'qty_asked', $object->lines[$i]->qty_asked); $nexY = max($pdf->GetY(), $nexY); } + + if ($this->getColumnStatus('unit_order')) { + $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); + $nexY = max($pdf->GetY(), $nexY); + } if ($this->getColumnStatus('qty_shipped')) { $this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped); @@ -1311,6 +1316,20 @@ class pdf_espadon extends ModelePdfExpedition 'align' => 'C', ), ); + + $rank = $rank + 10; + $this->cols['unit_order'] = array( + 'rank' => $rank, + 'width' => 15, // in mm + 'status' => empty($conf->global->PRODUCT_USE_UNITS) ? 0 : 1, + 'title' => array( + 'textkey' => 'Unit' + ), + 'border-left' => true, // add left line separator + 'content' => array( + 'align' => 'C', + ), + ); $rank = $rank + 10; $this->cols['qty_shipped'] = array( From 3598e0a2464666d78fcb5497d17dbc8e8681ef38 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 28 Aug 2021 07:32:07 +0000 Subject: [PATCH 05/42] Fixing style errors. --- .../modules/expedition/doc/pdf_espadon.modules.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 1d449dcccbd..55180a33eb4 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -650,11 +650,11 @@ class pdf_espadon extends ModelePdfExpedition $this->printStdColumnContent($pdf, $curY, 'qty_asked', $object->lines[$i]->qty_asked); $nexY = max($pdf->GetY(), $nexY); } - + if ($this->getColumnStatus('unit_order')) { - $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); - $nexY = max($pdf->GetY(), $nexY); - } + $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit)); + $nexY = max($pdf->GetY(), $nexY); + } if ($this->getColumnStatus('qty_shipped')) { $this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped); @@ -1316,7 +1316,7 @@ class pdf_espadon extends ModelePdfExpedition 'align' => 'C', ), ); - + $rank = $rank + 10; $this->cols['unit_order'] = array( 'rank' => $rank, From d0508d557b92468b694f89fa1dec88bda9c8f9b6 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 30 Sep 2021 14:56:02 +0200 Subject: [PATCH 06/42] fix: checkbox for line selection between supplier order and supplier invoice was infective --- htdocs/fourn/facture/card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c063e636a91..690c232cb64 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -668,6 +668,7 @@ if (empty($reshook)) elseif ($action == 'add' && $usercancreate) { if ($socid > 0) $object->socid = GETPOST('socid', 'int'); + $selectedLines = GETPOST('toselect', 'array'); $db->begin(); @@ -980,6 +981,8 @@ if (empty($reshook)) $num = count($lines); for ($i = 0; $i < $num; $i++) // TODO handle subprice < 0 { + if (!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines + $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); @@ -2239,9 +2242,6 @@ if ($action == 'create') print ''; print ''; - print "\n"; - - // Show origin lines if (is_object($objectsrc)) { @@ -2256,6 +2256,8 @@ if ($action == 'create') print ''; } + + print "\n"; } else { From 6d00097c896ac40360dd0186949184f2ea8ed095 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 30 Sep 2021 16:37:52 +0200 Subject: [PATCH 07/42] fix --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 690c232cb64..778c1db1aaf 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2252,7 +2252,7 @@ if ($action == 'create') print ''; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList('', $selectedLines); print '
'; } From 157112758b297ace525aa1d056efd23797dd47ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Sep 2021 20:14:59 +0200 Subject: [PATCH 08/42] Fix phpcs --- htdocs/comm/action/class/actioncomm.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ff30f16b8dd..e5b8ff0f49c 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -788,9 +788,7 @@ class ActionComm extends CommonObject } $this->db->free($resql); - } - else - { + } else { $this->error = $this->db->lasterror(); return -1; } From 1c56f65c27c293ab9551cc23d63f8550adce97c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Oct 2021 11:49:49 +0200 Subject: [PATCH 09/42] Fix missing migration instruction --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index cb466f94b10..cf4b5747684 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -37,6 +37,7 @@ ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-orde ALTER TABLE llx_prelevement_facture CHANGE COLUMN fk_facture_foun fk_facture_fourn integer NULL; +ALTER TABLE llx_prelevement_facture_demande ADD COLUMN fk_facture_fourn INTEGER NULL; ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture); ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn); From 6a20fcc5c075e300246bd97e7df77cf942484275 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Wed, 6 Oct 2021 11:24:42 +0200 Subject: [PATCH 10/42] FIX #18910 --- htdocs/mrp/mo_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index cfff1fb6181..75398b7749b 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -207,7 +207,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.' ' : ''); } } // Add fields from hooks From 93b4853f8e8c25ec093e91efe6392c3ff92e092f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 11:52:12 +0200 Subject: [PATCH 11/42] Fix var_dump --- htdocs/core/actions_addupdatedelete.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 44a0f159143..f871ed73de8 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -117,7 +117,6 @@ if ($action == 'add' && !empty($permissiontoadd)) { if (!$error) { $result = $object->create($user); - var_dump($object);exit; if ($result > 0) { // Creation OK $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; From 3709c6ff4775ac13c8d226cdb03c485fb434b6e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 11:53:27 +0200 Subject: [PATCH 12/42] Fix phpcs --- htdocs/fourn/facture/list.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 292faedf7ec..a752c0d1545 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1601,7 +1601,6 @@ if ($resql) { // Author if (!empty($arrayfields['u.login']['checked'])) { - print ''; if ($userstatic->id) { print $userstatic->getLoginUrl(-1); From ff29ac93ad3b90a2016d1946d5c4279327ce1127 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 12:43:40 +0200 Subject: [PATCH 13/42] Debug eventorganization modules --- .../class/conferenceorbooth.class.php | 1 - .../class/conferenceorboothattendee.class.php | 6 +++--- .../conferenceorboothattendee_card.php | 16 ++++++++++------ .../conferenceorboothattendee_list.php | 3 ++- htdocs/langs/en_US/eventorganization.lang | 3 ++- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 8d12fcd4da5..6d21fb911b2 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -271,7 +271,6 @@ class ConferenceOrBooth extends ActionComm */ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { - //TODO set percent according status global $conf; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 4d44bc13287..0ee05489347 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -105,9 +105,9 @@ class ConferenceOrBoothAttendee extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), - 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1,), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), - 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), + 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), + 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',), 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'), 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,), diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index e6c03b0a74a..994729ce101 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -57,9 +57,10 @@ $projectstatic = new Project($db); $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array + if ($conf_or_booth_id > 0) { $confOrBooth = new ConferenceOrBooth($db); - $result = $confOrBooth->fetch($conf_or_booth_id); + $result = $confOrBooth->fetch($id > 0 ? $id : $conf_or_booth_id); if ($result < 0) { setEventMessages(null, $confOrBooth->errors, 'errors'); } else { @@ -102,6 +103,10 @@ if (empty($action) && empty($id) && empty($ref)) { // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. +// Now we have loaded the attendee, we can force the project (in case value provided as parameter is wrong or value not provided) +if ($object->fk_project > 0) { + $fk_project = $object->fk_project; +} $permissiontoread = $user->rights->eventorganization->read; $permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php @@ -657,16 +662,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd); // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd); - + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); + print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); } print ''."\n"; } diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 849513710f7..4b107021a09 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -699,7 +699,8 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd); +$params = array('morecss'=>'reposition'); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 52b00c7e592..e6f3432589c 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -136,6 +136,7 @@ OrganizationEventPaymentOfBoothWasReceived=Your payment for your booth has been OrganizationEventPaymentOfRegistrationWasReceived=Your payment for your event registration has been recorded OrganizationEventBulkMailToAttendees=This is a remind about your participation in the event as an attendee OrganizationEventBulkMailToSpeakers=This is a reminder on your participation in the event as a speaker +OrganizationEventLinkToThirdParty=Link to third party (customer, supplier or partner) # # Vote page @@ -153,7 +154,7 @@ ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an e Attendee = Attendee PaymentConferenceAttendee = Conference attendee payment PaymentBoothLocation = Booth location payment - +DeleteConferenceOrBoothAttendee=Remove attendee RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s EmailAttendee=Attendee email EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) From ea3e3b133dfaf16b665167f9abaefbcba82e1fbd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 12:55:07 +0200 Subject: [PATCH 14/42] Debug eventorganization modules --- htdocs/core/actions_addupdatedelete.inc.php | 1 + htdocs/eventorganization/conferenceorboothattendee_card.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index f871ed73de8..86c5fe4175a 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -261,6 +261,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) { } $result = $object->delete($user); + if ($result > 0) { // Delete OK setEventMessages("RecordDeleted", null, 'mesgs'); diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 994729ce101..6c27aa71705 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -130,7 +130,7 @@ if (empty($reshook)) { $error = 0; if (!empty($withproject)) { - $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1'; + $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1&fk_project='.((int) $fk_project); } else { $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php'; } @@ -156,7 +156,6 @@ if (empty($reshook)) { $action = ''; } - $triggermodname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_MODIFY'; // Name of trigger action code to execute when we modify record // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen From b630b1599166106242b8f54621325fbe823d410e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 13:33:13 +0200 Subject: [PATCH 15/42] Add missing line to remove a tab in modulebuilder --- htdocs/modulebuilder/template/lib/mymodule.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php index 2cfc428b7ce..32ae980e946 100644 --- a/htdocs/modulebuilder/template/lib/mymodule.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php @@ -60,7 +60,9 @@ function mymoduleAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'mymodule'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'mymodule@mymodule'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mymodule@mymodule', 'remove'); return $head; } From d963aa8832c0a79c80f1e132c53119fa6b40082e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Hahn?= Date: Mon, 4 Oct 2021 19:19:12 +0200 Subject: [PATCH 16/42] Allow removal of tabs For being able to remove or replace tabs, it is also necessary to call this function with 'remove' mode. --- htdocs/bom/lib/bom.lib.php | 4 +++- htdocs/mrp/lib/mrp_mo.lib.php | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php index 8f3cadeedc2..edd9bd69ef4 100644 --- a/htdocs/bom/lib/bom.lib.php +++ b/htdocs/bom/lib/bom.lib.php @@ -54,7 +54,9 @@ function bomAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'bom'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove'); return $head; } diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 8fe07df89c1..fd268c8f6f8 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -103,6 +103,8 @@ function moPrepareHead($object) // 'entity:-tabname:Title:@mrp:/mrp/mypage.php?id=__ID__' //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp', 'remove'); return $head; } From dceb2b5341fd8b5cf91769ec39115b2d64f7beb8 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Mon, 4 Oct 2021 22:12:50 +0200 Subject: [PATCH 17/42] Fix fatal error --- htdocs/core/modules/expedition/doc/pdf_espadon.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 97e24f44e94..430398d28d1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; /** * Class to build sending documents with model espadon From 4be2d1414e77d0aa0d725d629c4fa9b398b5c2fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 14:01:48 +0200 Subject: [PATCH 18/42] Fix regression --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.formfile.class.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ab258d736ff..1013da7c430 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5297,7 +5297,7 @@ abstract class CommonObject $ecmfile->gen_or_uploaded = 'generated'; $ecmfile->description = ''; // indexed content $ecmfile->keywords = ''; // keyword content - $ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module); + $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'. $ecmfile->src_object_id = $this->id; $result = $ecmfile->create($user); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 71a23cac044..b5d96a7f1e2 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1545,7 +1545,7 @@ class FormFile * * @param string $upload_dir Directory that was scanned. This directory will contains files into subdirs REF/files * @param array $filearray Array of files loaded by dol_dir_list function before calling this function - * @param string $modulepart Value for modulepart used by download wrapper + * @param string $modulepart Value for modulepart used by download wrapper. Value can be $object->table_name (that is 'myobject' or 'mymodule_myobject') or $object->element.'-'.$module (for compatibility purpose) * @param string $param Parameters on sort links * @param int $forcedownload Force to open dialog box "Save As" when clicking on file * @param string $relativepath Relative path of docs (autodefined if not provided) @@ -1709,7 +1709,8 @@ class FormFile $id = 0; $ref = ''; - // To show ref or specific information according to view to show (defined by $module) + // To show ref or specific information according to view to show (defined by $modulepart) + // $modulepart can be $object->table_name (that is 'mymodule_myobject') or $object->element.'-'.$module (for compatibility purpose) $reg = array(); if ($modulepart == 'company' || $modulepart == 'tax') { preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); @@ -1815,10 +1816,9 @@ class FormFile // File // Check if document source has external module part, if it the case use it for module part on document.php - preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix); print ''; //print "XX".$file['name']; //$file['name'] must be utf8 - print 'getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); - print $this->showPreview($file, (empty($modulesuffix) ? $modulepart : $modulesuffix[1]), $file['relativename']); + print $this->showPreview($file, $modulepart, $file['relativename']); print "\n"; From 92ae3c9d5216f9e5f81b928f55e21c41c2a7ab90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 14:26:48 +0200 Subject: [PATCH 19/42] Fix label in graph --- htdocs/langs/en_US/main.lang | 1 + htdocs/projet/card.php | 8 ++++---- htdocs/projet/graph_opportunities.inc.php | 3 +++ htdocs/projet/index.php | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 9fba774e7a5..44e8e7b167e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1140,3 +1140,4 @@ EmailMsgID=Email MsgID Forthcoming=Forthcoming Currently=Currently ClientTZ=Client Time Zone (user) +NotClosedYet=Not yet closed \ No newline at end of file diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 941f7ce0613..50d6235dc7d 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -918,8 +918,8 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 0, 1); print ''; print ''; print ''; @@ -940,11 +940,11 @@ if ($action == 'create' && $user->rights->projet->creer) { // Date start print ''.$langs->trans("DateStart").''; print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0); - print '     '.$langs->trans("ProjectReportDate"); + print '/>'; print ''; // Date end diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index b6b4470dd15..56649af9a45 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -83,6 +83,9 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code'); if ($code) { $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code); + if ($code == 'WON' || $code == 'LOST') { + $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code).' ('.$langs->transnoentitiesnoconv("NotClosedYet").")"; + } } if (empty($labelStatus)) { $labelStatus = $listofopplabel[$status]; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 6f670af2bb6..213691f4e25 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -152,7 +152,7 @@ if ($resql) { while ($i < $num) { $objp = $db->fetch_object($resql); $listofoppstatus[$objp->rowid] = $objp->percent; - $listofopplabel[$objp->rowid] = $objp->label; + $listofopplabel[$objp->rowid] = $objp->label; // default label if translation from "OppStatus".code not found. $listofoppcode[$objp->rowid] = $objp->code; switch ($objp->code) { case 'PROSP': From 10f0434116ee3898a8e6b41cdb8f8f4c0958ae37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 15:30:19 +0200 Subject: [PATCH 20/42] Update card.php --- htdocs/fourn/facture/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 778c1db1aaf..e4aeae07581 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -981,8 +981,10 @@ if (empty($reshook)) $num = count($lines); for ($i = 0; $i < $num; $i++) // TODO handle subprice < 0 { - if (!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines - + if (!in_array($lines[$i]->id, $selectedLines)) { + continue; // Skip unselected lines + } + $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); From cb84eef6dc837785944772f71c5ff1fa340589cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 16:13:02 +0200 Subject: [PATCH 21/42] Update shipment.php --- htdocs/expedition/shipment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index ad14c11ace3..b8814450030 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -768,7 +768,7 @@ if ($id > 0 || !empty($ref)) { } // Qty ordered - print ''.$objp->qty.' '.$objp->unit_order.''; + print ''.$objp->qty.($objp->unit_order ? ' '.$objp->unit_order : '').''; // Qty already shipped $qtyProdCom = $objp->qty; @@ -776,7 +776,7 @@ if ($id > 0 || !empty($ref)) { // Nb of sending products for this line of order $qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0); print $qtyAlreadyShipped; - print ' '.$objp->unit_order.''; + print ($objp->unit_order ? ' '.$objp->unit_order : '').''; // Qty remains to ship print ''; @@ -787,7 +787,7 @@ if ($id > 0 || !empty($ref)) { } else { print '0 ('.$langs->trans("Service").')'; } - print ' '.$objp->unit_order.''; + print ($objp->unit_order ? ' '.$objp->unit_order : '').''; if ($objp->fk_product > 0) { $product = new Product($db); From 1c53035e383b51058cadb881caecc5920238fe1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 16:19:36 +0200 Subject: [PATCH 22/42] Doc --- htdocs/api/class/api_documents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 00fd1a91a8a..3b6e89c6643 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -504,7 +504,7 @@ class Documents extends DolibarrApi * Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }. * * @param string $filename Name of file to create ('FA1705-0123.txt') - * @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...) + * @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...) * @param string $ref Reference of object (This will define subdir automatically and store submited file into it) * @param string $subdir Subdirectory (Only if ref not provided) * @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided) From 144de734ceb8c91bd0b71264299aa2a9f36f0889 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 18:39:16 +0200 Subject: [PATCH 23/42] Fix phpcs --- htdocs/mrp/lib/mrp_mo.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index fd268c8f6f8..08bc07f298a 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -103,7 +103,7 @@ function moPrepareHead($object) // 'entity:-tabname:Title:@mrp:/mrp/mypage.php?id=__ID__' //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp'); - + complete_head_from_modules($conf, $langs, $object, $head, $h, 'mo@mrp', 'remove'); return $head; From 88a482c615a35f04c1c2ba89a5adad0ef00b4835 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 18:40:32 +0200 Subject: [PATCH 24/42] Fix phpcs --- .../doc/doc_generic_reception_odt.modules.php | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 5b69a6d7839..383ab491346 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -63,7 +63,7 @@ class doc_generic_reception_odt extends ModelePdfReception global $conf, $langs, $mysoc; $langs->loadLangs(array("main", "companies")); - + $this->db = $db; $this->name = "ODT templates"; $this->description = $langs->trans("DocumentModelOdt"); @@ -177,7 +177,7 @@ class doc_generic_reception_odt extends ModelePdfReception $texte .= ''; $texte .= ''; $texte .= ''; - + $texte .= ''; $texte .= ''; @@ -228,7 +228,7 @@ class doc_generic_reception_odt extends ModelePdfReception $outputlangs->charset_output = 'UTF-8'; $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); - + if ($conf->reception->dir_output."/reception") { // If $object is id instead of object if (!is_object($object)) { @@ -413,26 +413,26 @@ class doc_generic_reception_odt extends ModelePdfReception dol_syslog($e->getMessage(), LOG_INFO); } if ($foundtagforlines) { - $linenumber = 0; - foreach ($object->lines as $line) { - $linenumber++; - $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs); - complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); - // Call the ODTSubstitutionLine hook - $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); - $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - foreach ($tmparray as $key => $val) { - try { - $listlines->setVars($key, $val, true, 'UTF-8'); - } catch (OdfException $e) { - dol_syslog($e->getMessage(), LOG_INFO); - } catch (SegmentException $e) { - dol_syslog($e->getMessage(), LOG_INFO); + $linenumber = 0; + foreach ($object->lines as $line) { + $linenumber++; + $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs); + complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); + // Call the ODTSubstitutionLine hook + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); + $reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + foreach ($tmparray as $key => $val) { + try { + $listlines->setVars($key, $val, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } } + $listlines->merge(); } - $listlines->merge(); - } - $odfHandler->mergeSegment($listlines); + $odfHandler->mergeSegment($listlines); } } catch (OdfException $e) { $this->error = $e->getMessage(); @@ -482,7 +482,7 @@ class doc_generic_reception_odt extends ModelePdfReception $odfHandler = null; // Destroy object $this->result = array('fullpath'=>$file); - + return 1; // Success } else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); From ab78930476942333c126516a16ea25472fa24b0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 18:50:29 +0200 Subject: [PATCH 25/42] Add api to post supplier proposal and supplier order documents --- htdocs/api/class/api_documents.class.php | 34 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 3b6e89c6643..f10c7b10b48 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -120,7 +120,7 @@ class Documents extends DolibarrApi * * Test sample 1: { "modulepart": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }. * - * @param string $modulepart Name of module or area concerned by file download ('invoice', 'order', ...). + * @param string $modulepart Name of module or area concerned by file download ('thirdparty', 'member', 'proposal', 'supplier_proposal', 'order', 'supplier_order', 'invoice', 'supplier_invoice', 'shipment', 'project', ...) * @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf). * @param string $doctemplate Set here the doc template to use for document generation (If not set, use the default template). * @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language). @@ -325,6 +325,20 @@ class Documents extends DolibarrApi throw new RestException(404, 'Proposal not found'); } + $upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal'); + } elseif ($modulepart == 'supplier_proposal') { + require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; + + if (!DolibarrApiAccess::$user->rights->supplier_proposal->read) { + throw new RestException(401); + } + + $object = new Propal($this->db); + $result = $object->fetch($id, $ref); + if (!$result) { + throw new RestException(404, 'Supplier proposal not found'); + } + $upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal'); } elseif ($modulepart == 'commande' || $modulepart == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; @@ -340,6 +354,22 @@ class Documents extends DolibarrApi } $upload_dir = $conf->commande->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'commande'); + } elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') { + $modulepart = 'supplier_order'; + + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + + if (empty(DolibarrApiAccess::$user->rights->fournisseur->commande->lire) && empty(DolibarrApiAccess::$user->rights->supplier_order->lire)) { + throw new RestException(401); + } + + $object = new CommandeFournisseur($this->db); + $result = $object->fetch($id, $ref); + if (!$result) { + throw new RestException(404, 'Purchase order not found'); + } + + $upload_dir = $conf->fournisseur->dir_output."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref); } elseif ($modulepart == 'shipment' || $modulepart == 'expedition') { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; @@ -373,7 +403,7 @@ class Documents extends DolibarrApi require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; - if (!DolibarrApiAccess::$user->rights->fournisseur->facture->lire) { + if (empty(DolibarrApiAccess::$user->rights->fournisseur->facture->lire) && empty(DolibarrApiAccess::$user->rights->supplier_invoice->lire)) { throw new RestException(401); } From e004d39ed49552596fe3636e529de9c1fbceb889 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 19:30:37 +0200 Subject: [PATCH 26/42] Fix status of supplier invoice --- htdocs/compta/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index b0109d69fe5..7f3865906c8 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -363,7 +363,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU } print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->tms), 'day').''; - print ''.$facstatic->getLibStatut(3).''; + $alreadypaid = $facstatic->getSommePaiement(); + print ''.$facstatic->getLibStatut(3, $alreadypaid).''; print ''; $total_ht += $obj->total_ht; $total_ttc += $obj->total_ttc; From e1f5a39f483436118ec9ffc9aaccd7c6e12fd94a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 19:40:18 +0200 Subject: [PATCH 27/42] Fix phpcs --- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 99946ff54ce..59a3a1e72b0 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -266,7 +266,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 54eab2c2234..7c5c91c0511 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -207,7 +207,7 @@ $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.' ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ""); } } // Add fields from hooks @@ -276,7 +276,7 @@ foreach($object->fields as $key => $val) { // Add fields from extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.", " : ""); } } // Add where from hooks From 34187d53f6f9a333259110633515294e05e172e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 20:10:36 +0200 Subject: [PATCH 28/42] Fix missing invoice in stats when due date is unknown/null --- htdocs/core/lib/invoice.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index e18ec3e3678..ee8e9deed5e 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -484,7 +484,7 @@ function getNumberInvoicesPieChart($mode) $sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", 1, 0).") as nblate30"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."'", 1, 0).") as nblate15"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."'", 1, 0).") as nblatenow"; - $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."'", 1, 0).") as nbnotlatenow"; + $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."' OR f.date_lim_reglement IS NULL", 1, 0).") as nbnotlatenow"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd15, 'Y-m-d')."'", 1, 0).") as nbnotlate15"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30"; if ($mode == 'customers') { From 9cf46eaf253cf087bd2b9a85f207f2423b003534 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 20:29:48 +0200 Subject: [PATCH 29/42] Fix stats graphs --- htdocs/core/lib/invoice.lib.php | 15 +++++++++++---- htdocs/langs/en_US/compta.lang | 15 +++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index ee8e9deed5e..193c4c3acb7 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -515,13 +515,20 @@ function getNumberInvoicesPieChart($mode) ,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15) ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30));*/ - $dataseries[0]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30); + $dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30); $i++; } - foreach ($dataseries as $key=>$value) { - $total += $value[1]; + foreach ($dataseries[0] as $key=>$value) { + $total += $value; } - $legend = array($langs->trans('InvoiceLate30Days'), $langs->trans('InvoiceLate15Days'), $langs->trans('InvoiceLateMinus15Days'), $langs->trans('InvoiceNotLate'), $langs->trans('InvoiceNotLate15Days'), $langs->trans('InvoiceNotLate30Days')); + $legend = array( + $langs->trans('InvoiceLate30Days'), + $langs->trans('InvoiceLate15Days'), + $langs->trans('InvoiceLateMinus15Days'), + $mode == 'customers' ? $langs->trans('InvoiceNotLate') : $langs->trans("InvoiceToPay"), + $mode == 'customers' ? $langs->trans('InvoiceNotLate15Days') : $langs->trans("InvoiceToPay15Days"), + $mode == 'customers' ? $langs->trans('InvoiceNotLate30Days') : $langs->trans("InvoiceToPay30Days"), + ); $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11); diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 753f83ba6ad..ace3e518003 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -286,9 +286,12 @@ ReportPurchaseTurnover=Purchase turnover invoiced ReportPurchaseTurnoverCollected=Purchase turnover collected IncludeVarpaysInResults = Include various payments in reports IncludeLoansInResults = Include loans in reports -InvoiceLate30Days = Invoices late > 30 days -InvoiceLate15Days = Invoices late > 15 days -InvoiceLateMinus15Days = Invoices late -InvoiceNotLate = To be collected < 15 days -InvoiceNotLate15Days = To be collected in 15 days -InvoiceNotLate30Days = To be collected in 30 days +InvoiceLate30Days = Invoices late (> 30 days) +InvoiceLate15Days = Invoices late (15 to 30 days) +InvoiceLateMinus15Days = Invoices late (< 15 days) +InvoiceNotLate = To be collected (< 15 days) +InvoiceNotLate15Days = To be collected (15 to 30 days) +InvoiceNotLate30Days = To be collected (> 30 days) +InvoiceToPay=To pay (< 15 days) +InvoiceToPay15Days=To pay (15 to 30 days) +InvoiceToPay30Days=To pay (> 30 days) \ No newline at end of file From f95b0c3033f0e7fd9e1b3383baea365d52b3d7c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 21:43:30 +0200 Subject: [PATCH 30/42] Debug --- htdocs/public/project/index.php | 17 ++++------------- htdocs/public/project/suggestbooth.php | 4 ++-- htdocs/public/project/suggestconference.php | 4 ++-- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 5620e44a3f2..7beae2ee971 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -13,21 +13,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * For Paypal test: https://developer.paypal.com/ - * For Paybox test: ??? - * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing - * - * Variants: - * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API - * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API - * - If no option set, we use old APIS (charge) */ /** - * \file htdocs/public/payment/newpayment.php + * \file htdocs/public/project/index.php * \ingroup core - * \brief File to offer a way to make a payment for a particular Dolibarr object + * \brief File to offer a way to suggest a conference or a booth for an event */ if (!defined('NOLOGIN')) { @@ -74,8 +65,8 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); -$securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); +$securekeyreceived = GETPOST("securekey", 'alpha'); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index c695ea9cec1..57817fb5200 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/public/members/new.php + * \file htdocs/public/project/suggestbooth.php * \ingroup member - * \brief Example of form to add a new member + * \brief Example of form to suggest a booth * * Note that you can add following constant to change behaviour of page * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 399969bc80d..bfaf8a31b08 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -16,9 +16,9 @@ */ /** - * \file htdocs/public/members/new.php + * \file htdocs/public/project/suggestconference.php * \ingroup member - * \brief Example of form to add a new member + * \brief Example of form to suggest a conference * * Note that you can add following constant to change behaviour of page * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form From b34279da897c2146fd1ebe4a3d72d27f52f10185 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 21:46:01 +0200 Subject: [PATCH 31/42] Debug v14 --- htdocs/public/project/suggestbooth.php | 4 ++-- htdocs/public/project/suggestconference.php | 2 +- htdocs/public/project/viewandvote.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 57817fb5200..410ba698ae1 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -94,7 +94,7 @@ if ($resultproject < 0) { // Security check $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -112,7 +112,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index bfaf8a31b08..c8e784ab3c6 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -113,7 +113,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index e78176a5f56..157a0053ac5 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -67,7 +67,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); From 2a5e654544b5e444b86004712ffc9d18ab1bed44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 21:46:01 +0200 Subject: [PATCH 32/42] Debug v14 --- htdocs/public/project/suggestbooth.php | 4 ++-- htdocs/public/project/suggestconference.php | 4 ++-- htdocs/public/project/viewandvote.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 57817fb5200..410ba698ae1 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -94,7 +94,7 @@ if ($resultproject < 0) { // Security check $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -112,7 +112,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index bfaf8a31b08..43d004fb90a 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -95,7 +95,7 @@ if ($resultproject < 0) { // Security check $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); @@ -113,7 +113,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'"); // Security check if (empty($conf->eventorganization->enabled)) { diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index e78176a5f56..157a0053ac5 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -67,7 +67,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", $action = GETPOST('action', 'aZ09'); $id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); -$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5'); if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); From 8fe37b20c03020f19a4d14694ae595b4e7d977e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 21:54:04 +0200 Subject: [PATCH 33/42] Debug v14 --- htdocs/public/project/suggestbooth.php | 34 +-------------------- htdocs/public/project/suggestconference.php | 17 +---------- 2 files changed, 2 insertions(+), 49 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 410ba698ae1..8dd91a54a4c 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -224,20 +224,6 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; } - if (empty($datestart)) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; - } elseif ($datestart < $project->date_start) { - $error++; - $errmsg .= $langs->trans("DateMustBeAfterThan", $langs->transnoentitiesnoconv("DateStart"), dol_print_date($project->date_start))."
\n"; - } - if (empty($dateend)) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; - } elseif ($dateend > dol_mktime(23, 59, 59, dol_print_date($project->date_end, '%m'), dol_print_date($project->date_end, '%d'), dol_print_date($project->date_end, '%Y'))) { - $error++; - $errmsg .= $langs->trans("DateMustBeBeforeThan", $langs->transnoentitiesnoconv("DateEnd"), dol_print_date($project->date_end))."
\n"; - } if (!GETPOST("email")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; @@ -541,7 +527,7 @@ print '
'; // Welcome message $text = ''.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'
'; -$text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$project->label.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; print '
'; @@ -636,24 +622,6 @@ print '*'."\n"; print ''."\n"; -// Start Date -print ''.$langs->trans("DateStart").'*'; -if (!empty($project->date_start)) { - print '('.$langs->trans('Min'). ' '.dol_print_date($project->date_start).')'; -} -print ''."\n"; -print ''; -print $form->selectDate((empty($datestart)?$project->date_start:$datestart), 'datestart'); -print ''."\n"; -// End Date -print ''.$langs->trans("DateEnd").'*'; -if (!empty($project->date_end)) { - print '('.$langs->trans('Max'). ' '.dol_print_date($project->date_end).')'; -} -print ''."\n"; -print ''; -print $form->selectDate(empty($dateend)?$project->date_end:$dateend, 'dateend'); -print ''."\n"; print "\n"; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 43d004fb90a..6b534198140 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -225,14 +225,6 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; } - if (!GETPOST("datestart")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; - } - if (!GETPOST("dateend")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; - } if (!GETPOST("email")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; @@ -472,7 +464,7 @@ print '
'; // Welcome message $text = ''.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'
'; -$text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$project->label.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; print '
'; @@ -568,13 +560,6 @@ print '*'."\n"; print ''."\n"; -// Start Date -print ''.$langs->trans("DateStart").''."\n"; -print ''."\n"; -// End Date -print ''.$langs->trans("DateEnd").''."\n"; -print ''."\n"; - print "\n"; From 6cb690e6780b8c2232265bde6759676581953450 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 21:56:48 +0200 Subject: [PATCH 34/42] Debug v14 --- htdocs/langs/en_US/eventorganization.lang | 3 +++ htdocs/public/project/suggestbooth.php | 4 ++-- htdocs/public/project/suggestconference.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index e6f3432589c..55ef2652d80 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -138,6 +138,9 @@ OrganizationEventBulkMailToAttendees=This is a remind about your participation i OrganizationEventBulkMailToSpeakers=This is a reminder on your participation in the event as a speaker OrganizationEventLinkToThirdParty=Link to third party (customer, supplier or partner) +NewSuggestionOfBooth=Application for a booth +NewSuggestionOfConference=Application for a conference + # # Vote page # diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 8dd91a54a4c..f87fcf6f041 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -515,10 +515,10 @@ if (empty($reshook) && $action == 'add') { $form = new Form($db); $formcompany = new FormCompany($db); -llxHeaderVierge($langs->trans("NewSuggestion")); +llxHeaderVierge($langs->trans("NewSuggestionOfBooth")); -print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); +print load_fiche_titre($langs->trans("NewSuggestionOfBooth"), '', '', 0, 0, 'center'); print '
'; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 6b534198140..525dc5a60ba 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -452,10 +452,10 @@ if (empty($reshook) && $action == 'add') { $form = new Form($db); $formcompany = new FormCompany($db); -llxHeaderVierge($langs->trans("NewSuggestion")); +llxHeaderVierge($langs->trans("NewSuggestionOfConference")); -print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); +print load_fiche_titre($langs->trans("NewSuggestionOfConference"), '', '', 0, 0, 'center'); print '
'; From 5463a0288745a49bee8f9c5937b2b383d507783c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Oct 2021 21:59:10 +0200 Subject: [PATCH 35/42] Debug v14 --- htdocs/public/project/suggestconference.php | 28 +++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 525dc5a60ba..1e365a51f57 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -213,10 +213,22 @@ if (empty($reshook) && $action == 'add') { $db->begin(); + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; + } + if (!GETPOST("firstname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; + } if (!GETPOST("email")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } if (!GETPOST("label")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; @@ -225,22 +237,6 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; } - if (!GETPOST("email")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; - } - if (!GETPOST("lastname")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; - } - if (!GETPOST("firstname")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; - } - if (!GETPOST("societe")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; - } if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { $error++; $langs->load("errors"); From ec545f89676f402fc0bb1bff292beb0abb59a003 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 02:58:51 +0200 Subject: [PATCH 36/42] Fix data --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index db0e40790dc..d6e21f17aeb 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -76,6 +76,7 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1); INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); +UPDATE llx_accounting_system SET fk_country = 1 WHERE fk_country IS NULL; UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'auguria'; UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'bureau2crea'; From ed6fefc4937672799f3b50602714c418e003e45a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 04:10:39 +0200 Subject: [PATCH 37/42] Trans --- htdocs/langs/en_US/eventorganization.lang | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 55ef2652d80..1fd767f556c 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -75,10 +75,10 @@ EventOrganizationMassEmailSpeakers = Communication to speakers # # Event # -AllowUnknownPeopleSuggestConf=Allow unknown people to suggest conferences -AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest conferences -AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth -AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth +AllowUnknownPeopleSuggestConf=Allow people to suggest conferences +AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest a conference they want to do +AllowUnknownPeopleSuggestBooth=Allow people to apply for a booth +AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to apply for a booth PriceOfRegistration=Price of registration PriceOfRegistrationHelp=Price to pay to register or participate in the event PriceOfBooth=Subscription price to stand a booth @@ -106,9 +106,9 @@ EvntOrgCancelled = Cancelled # SuggestForm = Suggestion page SuggestOrVoteForConfOrBooth = Page for suggestion or vote -EvntOrgRegistrationHelpMessage = Here, you can vote for a conference or booth or suggest a new one for the event -EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project -EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project +EvntOrgRegistrationHelpMessage = Here, you can vote for a conference or suggest a new one for the event. You can also apply to have a booth during the event. +EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference to animate during the event. +EvntOrgRegistrationBoothHelpMessage = Here, you can apply to have a booth during the event. ListOfSuggestedConferences = List of suggested conferences ListOfSuggestedBooths = List of suggested booths ListOfConferencesOrBooths=List of conferences or booths of event project From f8d4e2bbf99244912b4d7988661227e9c8ac9de1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 04:14:38 +0200 Subject: [PATCH 38/42] Fix phpcs --- htdocs/admin/expensereport.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index e33c811c161..5b73d995b5c 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -145,9 +145,9 @@ if ($action == 'updateMask') { $draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha'); $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); - $res3 = 0; - if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided - $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); + $res3 = 0; + if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided + $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); } $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int'); @@ -156,7 +156,7 @@ if ($action == 'updateMask') { $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int'); $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity); - if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0) || !($res4 >0) || !($res5 >0)) { + if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) { $error++; } From 162d5d8a399d49a0cb562d5a6c21b60ada39289b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 10:38:10 +0200 Subject: [PATCH 39/42] Fix protection of double party accounting when using situation invoices --- htdocs/accountancy/index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 1842c23f418..cff986c4729 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -81,7 +81,12 @@ $help_url = ''; llxHeader('', $langs->trans("AccountancyArea"), $help_url); -if ($conf->accounting->enabled) { +if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { + print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); + + print ''.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")."\n"; + print "
"; +} elseif ($conf->accounting->enabled) { $step = 0; $resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) @@ -258,7 +263,8 @@ if ($conf->accounting->enabled) { } else { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); - print ''.$langs->trans("Module10Desc")."
\n"; + print ''.$langs->trans("Module10Desc")."\n"; + print "
"; } // End of page From 5910d100217c88ab6ac854c0ff17094bfbed67bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 10:43:50 +0200 Subject: [PATCH 40/42] Add hidden option to allow to fix corrupted situations --- htdocs/compta/paiement/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index bc62064dc82..a90a52c4e20 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -443,11 +443,13 @@ if ($resql) print ''.$invoice->getLibStatut(5, $alreadypayed).''; print "\n"; - if ($objp->paye == 1) // If at least one invoice is paid, disable delete - { + + // If at least one invoice is paid, disable delete. INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED Can be use for maintenance purpose. Never use this in production + if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) { $disable_delete = 1; $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid")); } + $total = $total + $objp->amount; $i++; } From d245abe9087b6f2c53e76eeef66ec8dec94e3202 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 11:34:21 +0200 Subject: [PATCH 41/42] Fix rounding --- htdocs/accountancy/bookkeeping/balance.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index b84fe255760..1d210e74d8a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -429,7 +429,7 @@ if ($action != 'export_csv') { print ''; print ''.$accounting_account.''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($opening_balance).''; + print ''.price(price2num($opening_balance, 'MT')).''; } $urlzoom = ''; @@ -443,9 +443,9 @@ if ($action != 'export_csv') { } } // Debit - print '
'.price($line->debit).''; + print ''.price(price2num($line->debit, 'MT')).''; // Credit - print ''.price($line->credit).''; + print ''.price(price2num($line->credit, 'MT')).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print ''.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).''; @@ -466,10 +466,10 @@ if ($action != 'export_csv') { if (!empty($show_subgroup)) { print ''.$langs->trans("SubTotal").':'; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($sous_total_opening_balance).''; + print ''.price(price2num($sous_total_opening_balance, 'MT')).''; } - print ''.price($sous_total_debit).''; - print ''.price($sous_total_credit).''; + print ''.price(price2num($sous_total_debit, 'MT')).''; + print ''.price(price2num($sous_total_credit, 'MT')).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print '' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . ''; } else { @@ -481,10 +481,10 @@ if ($action != 'export_csv') { print ''.$langs->trans("AccountBalance").':'; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($total_opening_balance).''; + print ''.price(price2num($total_opening_balance, 'MT')).''; } - print ''.price($total_debit).''; - print ''.price($total_credit).''; + print ''.price(price2num($total_debit, 'MT')).''; + print ''.price(price2num($total_credit, 'MT')).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print '' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . ''; } else { From b905b1b4bc5d0bde06edc9ca96ff42e8c4c4caa9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Oct 2021 16:09:32 +0200 Subject: [PATCH 42/42] FIX missing filter status=1 on rss feeds --- htdocs/website/class/websitepage.class.php | 6 +++--- htdocs/website/samples/wrapper.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 16053069d30..1d0e0afdf12 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -416,9 +416,9 @@ class WebsitePage extends CommonObject $sqlwhere = array(); if (count($filter) > 0) { foreach ($filter as $key => $value) { - if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') { + if ($key == 't.rowid' || $key == 'rowid' || $key == 't.fk_website' || $key == 'fk_website' || $key == 'status' || $key == 't.status') { $sqlwhere[] = $key.' = '.((int) $value); - } elseif ($key == 'type_container') { + } elseif ($key == 'type_container' || $key == 't.type_container') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; } elseif ($key == 'lang' || $key == 't.lang') { $listoflang = array(); @@ -436,7 +436,7 @@ class WebsitePage extends CommonObject } $sqlwhere[] = $stringtouse; } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + $sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'"; } } } diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index 34f6db8d044..26adb3ef220 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -104,7 +104,7 @@ if ($rss) { $website->fetch('', $websitekey); - $filters = array('type_container'=>'blogpost'); + $filters = array('type_container'=>'blogpost', 'status'=>1); if ($l) { $filters['lang'] = $l; }