Compare commits

...

6 Commits

Author SHA1 Message Date
Laurent Destailleur
526da8e5a7 Merge pull request #36505 from otcesar/22.0
Fix translation for import error
2025-12-04 16:37:31 +01:00
Laurent Destailleur
23db225ec3 Merge pull request #36523 from FHenry/22_fix_subtotal_feature
FIX: subtotal feature button availablity according setup
2025-12-04 14:30:43 +01:00
Laurent Destailleur
d647a95de8 Merge pull request #36525 from BenjaminFlr/issue36514
FIX(propal): Incorrect HT/TTC recalculation when editing proposal lines #36514
2025-12-04 14:24:08 +01:00
Benjamin Falière
68004a4009 FIX(propal): Incorrect HT/TTC recalculation when editing proposal lines 2025-12-04 10:35:42 +01:00
Florian HENRY
a38ffa02ac fix: subtotal feature button availablity according setup 2025-12-04 10:18:01 +01:00
tcesar
6545957cbd Fix traduction for import error 2025-12-02 16:37:30 +01:00
6 changed files with 26 additions and 14 deletions

View File

@@ -19,6 +19,7 @@
* Copyright (C) 2023 William Mead <william.mead@manchenumerique.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2025 Benjamin Falière <benjamin@faliere.com>
*
* 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
@@ -1932,6 +1933,12 @@ if (empty($reshook)) {
$type = $product->type;
$price_base_type = $product->price_base_type;
// If base type TTc, we change pu value to define the TTC one
if ($price_base_type == 'TTC') {
$pu = $pu_ttc;
}
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
$price_min = $product->price_min;
@@ -3456,14 +3463,15 @@ if ($action == 'create') {
if (empty($reshook)) {
if ($action != 'editline') {
// Subtotal
if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals')
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
$langs->load('subtotals');
$url_button = array();
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddTitleLine'),
'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
@@ -3471,7 +3479,7 @@ if ($action == 'create') {
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddSubtotalLine'),
'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()

View File

@@ -3445,14 +3445,15 @@ if ($action == 'create' && $usercancreate) {
}
// Subtotal
if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals')
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
$langs->load('subtotals');
$url_button = array();
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddTitleLine'),
'url' => '/commande/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
@@ -3460,7 +3461,7 @@ if ($action == 'create' && $usercancreate) {
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddSubtotalLine'),
'url' => '/commande/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()

View File

@@ -2076,14 +2076,15 @@ if ($action == 'create') {
);
// Subtotal
if (empty($object->suspended) && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
if (empty($object->suspended) && isModEnabled('subtotals')
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
$langs->load("subtotals");
$url_button = array();
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddTitleLine'),
'url' => '/compta/facture/card-rec.php?id='.$object->id.'&action=add_title_line&token='.newToken()
@@ -2091,7 +2092,7 @@ if ($action == 'create') {
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddSubtotalLine'),
'url' => '/compta/facture/card-rec.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()

View File

@@ -6390,14 +6390,15 @@ if ($action == 'create') {
}
// Subtotal
if ($object->status == Facture::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
if ($object->status == Facture::STATUS_DRAFT && isModEnabled('subtotals')
&& (getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element)) || getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element)))) {
$langs->load("subtotals");
$url_button = array();
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_TITLE_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddTitleLine'),
'url' => '/compta/facture/card.php?facid='.$object->id.'&action=add_title_line&token='.newToken()
@@ -6405,7 +6406,7 @@ if ($action == 'create') {
$url_button[] = array(
'lang' => 'subtotals',
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT),
'enabled' => (isModEnabled('invoice') && $object->status == Facture::STATUS_DRAFT && getDolGlobalInt('SUBTOTAL_'.strtoupper($object->element))),
'perm' => (bool) $usercancreate,
'label' => $langs->trans('AddSubtotalLine'),
'url' => '/compta/facture/card.php?facid='.$object->id.'&action=add_subtotal_line&token='.newToken()

View File

@@ -1898,7 +1898,7 @@ if ($step == 5 && $datatoimport) {
//dol_syslog("line ".$sourcelinenb.' - '.$nboflines.' - '.$excludefirstline.' - '.$endatlinenb);
$arrayrecord = $obj->import_read_record();
if ($arrayrecord === false) {
$arrayofwarnings[$sourcelinenb][0] = array('lib' => 'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type' => 'EOF_RECORD_ON_SEVERAL_LINES');
$arrayofwarnings[$sourcelinenb][0] = array('lib' => $langs->trans('ErrorFileLinesReachEOF', $nboflines, $sourcelinenb), 'type' => 'EOF_RECORD_ON_SEVERAL_LINES');
$endoffile++;
continue;
}
@@ -2321,7 +2321,7 @@ if ($step == 6 && $datatoimport) {
$sourcelinenb++;
$arrayrecord = $obj->import_read_record();
if ($arrayrecord === false) {
$arrayofwarnings[$sourcelinenb][0] = array('lib' => 'File has '.$nboflines.' lines. However we reach the end of file or an empty line at record '.$sourcelinenb.'. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.', 'type' => 'EOF_RECORD_ON_SEVERAL_LINES');
$arrayofwarnings[$sourcelinenb][0] = array('lib' => $langs->trans('ErrorFileLinesReachEOF', $nboflines, $sourcelinenb), 'type' => 'EOF_RECORD_ON_SEVERAL_LINES');
$endoffile++;
continue;
}

View File

@@ -152,3 +152,4 @@ MandatoryTargetFieldsNotMapped=Some mandatory target fields are not mapped
AllTargetMandatoryFieldsAreMapped=All target fields that need a mandatory value are mapped
ResultOfSimulationNoError=Result of simulation: No error
NumberOfLinesLimited=Number of lines limited
ErrorFileLinesReachEOF=File has %s lines. However we reach the end of file or an empty line at record %s. This may occurs when some records are split onto several lines and not correctly delimited by the "Char delimiter", or if there is line with no data on all fields.