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

add a hook on vat rate #32657

Merged
merged 2 commits into from
Jan 15, 2025
Merged
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
23 changes: 21 additions & 2 deletions htdocs/core/class/html.form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6906,12 +6906,31 @@
public function load_tva($htmlname = 'tauxtva', $selectedrate = '', $societe_vendeuse = null, $societe_acheteuse = null, $idprod = 0, $info_bits = 0, $type = '', $options_only = false, $mode = 0, $type_vat = 0)
{
// phpcs:enable
global $langs, $mysoc;
global $langs, $mysoc, $hookmanager;

$langs->load('errors');

$return = '';

// Bypass the default method
$hookmanager->initHooks(array('commonobject'));
$info_bits == 1 ? $is_npr = 1 : $is_npr = 0;
$parameters = array(
'seller' => $societe_vendeuse,
'buyer' => $societe_acheteuse,
'idprod' => $idprod,
'is_npr' => $is_npr,
'type' => $type,
'options_only' => $options_only,
'mode' => $mode,
'type_vat' => $type_vat
);
$reshook = $hookmanager->executeHooks('load_tva', $parameters);
if ($reshook > 0) {
return $hookmanager->resPrint;
} elseif ($reshook === 0) {
$return .= $hookmanager->resPrint;
}

Check failure on line 6933 in htdocs/core/class/html.form.class.php

View workflow job for this annotation

GitHub Actions / pre-commit / pre-commit

Whitespace found at end of line
// Define defaultnpr, defaultttx and defaultcode
$defaultnpr = ($info_bits & 0x01);
$defaultnpr = (preg_match('/\*/', $selectedrate) ? 1 : $defaultnpr);
Expand Down
Loading