fix groupe client in facture
This commit is contained in:
parent
07dcd6d91d
commit
9d29beecfb
@ -5344,7 +5344,12 @@ COMMENTAIRES: ".$comment;
|
|||||||
$clientId = $facture['fk_client_id'];
|
$clientId = $facture['fk_client_id'];
|
||||||
if ($clientId != null && $clientId != 0) {
|
if ($clientId != null && $clientId != 0) {
|
||||||
$client = $this->getClientById($clientId);
|
$client = $this->getClientById($clientId);
|
||||||
|
if (isset($client['tva']) && $client['tva'] == 0) {
|
||||||
|
$isTvaApplicable = false;
|
||||||
|
$tvaValue = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$clientId = $devis['id_client'];
|
||||||
$client = $this->getClientById($clientId);
|
$client = $this->getClientById($clientId);
|
||||||
if (isset($client['tva']) && $client['tva'] == 0) {
|
if (isset($client['tva']) && $client['tva'] == 0) {
|
||||||
$isTvaApplicable = false;
|
$isTvaApplicable = false;
|
||||||
@ -5449,12 +5454,6 @@ COMMENTAIRES: ".$comment;
|
|||||||
$factureData = $this->getFactureByFactureId($factureId);
|
$factureData = $this->getFactureByFactureId($factureId);
|
||||||
$isFactureForSingleClient = $factureData['fk_client_id'] != null && $factureData['fk_client_id'] != 0;
|
$isFactureForSingleClient = $factureData['fk_client_id'] != null && $factureData['fk_client_id'] != 0;
|
||||||
|
|
||||||
$hasTva = true; // Valeur par défaut
|
|
||||||
if($isFactureForSingleClient) {
|
|
||||||
$client = $this->getClientById($factureData['fk_client_id']);
|
|
||||||
$hasTva = ($client && isset($client['tva'])) ? ($client['tva'] == 1) : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$devisMentionFilters = [
|
$devisMentionFilters = [
|
||||||
DevisMentionConstant::FACTURED_FORMATTED,
|
DevisMentionConstant::FACTURED_FORMATTED,
|
||||||
DevisMentionConstant::FACTURED
|
DevisMentionConstant::FACTURED
|
||||||
@ -5462,6 +5461,15 @@ COMMENTAIRES: ".$comment;
|
|||||||
$devis = $this->getDevisByFkFactureId($factureId);
|
$devis = $this->getDevisByFkFactureId($factureId);
|
||||||
$factureGroupIsRelatedToAnyDevis = $devis != null;
|
$factureGroupIsRelatedToAnyDevis = $devis != null;
|
||||||
|
|
||||||
|
$hasTva = true; // Valeur par défaut
|
||||||
|
if($isFactureForSingleClient) {
|
||||||
|
$client = $this->getClientById($factureData['fk_client_id']);
|
||||||
|
$hasTva = ($client && isset($client['tva'])) ? ($client['tva'] == 1) : true;
|
||||||
|
} else {
|
||||||
|
$client = $this->getClientById($devis['id_client']);
|
||||||
|
$hasTva = ($client && isset($client['tva'])) ? ($client['tva'] == 1) : true;
|
||||||
|
}
|
||||||
|
|
||||||
// Déterminer le taux de TVA global pour l'affichage
|
// Déterminer le taux de TVA global pour l'affichage
|
||||||
$globalTvaValue = $defaultTvaValue;
|
$globalTvaValue = $defaultTvaValue;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user