Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX(supplier): order and invoice subtotal lines #432

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.

# [Unreleased]

- FIX(supplier): order and invoice subtotal lines


# Release 3.25 - 24/07/2024
Expand Down
15 changes: 12 additions & 3 deletions class/subtotal.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ static function addSubTotalLine(&$object, $label, $qty, $rang=-1) {
/** @var FactureFournisseur $object */
$object->special_code = TSubtotal::$module_number;
if( (float)DOL_VERSION < 6 ) $rang = $object->line_max() + 1;
$res = $object->addline($label,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang,false,0,null,0,0,'',TSubtotal::$module_number);
if ((int)DOL_VERSION < 17) {
$res = $object->addline($label,0,0,0,0,$qty,0,0,'','',0,0,'HT',9,$rang);
} else {
$res = $object->addline($label,0,0,0,0,$qty, 0,0,'','', 0, '', 'HT', 9, $rang, false, 0, null, 0,0,'',TSubtotal::$module_number, 0,0);
}
}
/**
* @var $object Propal
Expand All @@ -160,8 +164,13 @@ static function addSubTotalLine(&$object, $label, $qty, $rang=-1) {
* @var $object Commande fournisseur
*/
else if($object->element=='order_supplier') {
$object->special_code = TSubtotal::$module_number; // à garder pour la rétrocompatibilité
$res = $object->addline($label, 0,$qty,0,0,0,0,0,'',0,'HT', 0, 9, 0, false, null, null, 0, null, 0, '', 0, -1, TSubtotal::$module_number);
/** @var CommandeFournisseur $object */
$object->special_code = TSubtotal::$module_number;
if ((int)DOL_VERSION < 17) {
$res = $object->addline($label, 0,$qty,0,0,0,0,0,'',0,'HT', 0, 9);
} else {
$res = $object->addline($label, 0, $qty, 0, 0, 0, 0, 0, '', 0, 'HT', 0, 9, 0, false, null, null, 0, null, 0, '', 0 ,$rang, TSubtotal::$module_number);
}
}
/**
* @var $object Facturerec
Expand Down