|
@@ -234,13 +234,13 @@ class kataoPeriodActions extends wpActions {
|
|
|
|
|
|
$discount = $katao_supplier_invoice->getTaux0DiscountHt() + $katao_supplier_invoice->getTaux1DiscountHt() + $katao_supplier_invoice->getTaux2DiscountHt();
|
|
|
|
|
|
- $tva_rates = array('0.196' => 1, '0.055' => 2, '0' => 0);
|
|
|
+ $tva_rates = array('0.2' => 1, '0.055' => 2, '0' => 0);
|
|
|
$tva_5_5 = $katao_supplier_invoice->getTaux2Amount();
|
|
|
- $tva_19_6 = $katao_supplier_invoice->getTaux1Amount();
|
|
|
+ $tva_20 = $katao_supplier_invoice->getTaux1Amount();
|
|
|
if ($katao_supplier_invoice->getFeesBillingTva() && !empty($tva_rates[(string)$katao_supplier_invoice->getFeesBillingRate()])) {
|
|
|
switch ($tva_rates[(string)$katao_supplier_invoice->getFeesBillingRate()]) {
|
|
|
case 1:
|
|
|
- $tva_19_6 += $katao_supplier_invoice->getFeesBillingTva();
|
|
|
+ $tva_20 += $katao_supplier_invoice->getFeesBillingTva();
|
|
|
break;
|
|
|
case 2:
|
|
|
$tva_5_5 += $katao_supplier_invoice->getFeesBillingTva();
|
|
@@ -250,7 +250,7 @@ class kataoPeriodActions extends wpActions {
|
|
|
if ($katao_supplier_invoice->getFeesShippingTva() && !empty($tva_rates[(string)$katao_supplier_invoice->getFeesShippingRate()])) {
|
|
|
switch ($tva_rates[(string)$katao_supplier_invoice->getFeesShippingRate()]) {
|
|
|
case 1:
|
|
|
- $tva_19_6 += $katao_supplier_invoice->getFeesShippingTva();
|
|
|
+ $tva_20 += $katao_supplier_invoice->getFeesShippingTva();
|
|
|
break;
|
|
|
case 2:
|
|
|
$tva_5_5 += $katao_supplier_invoice->getFeesShippingTva();
|
|
@@ -258,9 +258,9 @@ class kataoPeriodActions extends wpActions {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if ($tva_19_6) {
|
|
|
- $total_debit += $tva_19_6;
|
|
|
- $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445664', $libelle_ecriture, $tva_19_6, 'D', $num_pointage, $code_analytique_budgetaire, 'TVA 19.6%');
|
|
|
+ if ($tva_20) {
|
|
|
+ $total_debit += $tva_20;
|
|
|
+ $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445664', $libelle_ecriture, $tva_20, 'D', $num_pointage, $code_analytique_budgetaire, 'TVA 20%');
|
|
|
}
|
|
|
if ($tva_5_5) {
|
|
|
$total_debit += $tva_5_5;
|
|
@@ -342,7 +342,7 @@ class kataoPeriodActions extends wpActions {
|
|
|
$code_analytique_budgetaire = '';
|
|
|
$libelle_compte = '';
|
|
|
|
|
|
- $total_by_tva_rate = array('0.196' => 0, '0.055' => 0, '0' => 0);
|
|
|
+ $total_by_tva_rate = array('0.2' => 0, '0.055' => 0, '0' => 0);
|
|
|
|
|
|
$total_debit = $katao_invoice->sumProducts();
|
|
|
$total_debit_sol = $katao_invoice->getSolAmount() / CONST_EURO_TO_SOL;
|
|
@@ -406,9 +406,9 @@ class kataoPeriodActions extends wpActions {
|
|
|
$this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, $accounting_code, $libelle_ecriture, $data['amount'], 'C', $num_pointage, $code_analytique_budgetaire, $data['category']);
|
|
|
}
|
|
|
|
|
|
- if (!empty($total_by_tva_rate['0.196'])) {
|
|
|
- $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445714', $libelle_ecriture, $total_by_tva_rate['0.196'], 'C', $num_pointage, $code_analytique_budgetaire, 'TVA 19.6%');
|
|
|
- $total_credit += round($total_by_tva_rate['0.196'], 2);
|
|
|
+ if (!empty($total_by_tva_rate['0.2'])) {
|
|
|
+ $this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445714', $libelle_ecriture, $total_by_tva_rate['0.2'], 'C', $num_pointage, $code_analytique_budgetaire, 'TVA 20%');
|
|
|
+ $total_credit += round($total_by_tva_rate['0.2'], 2);
|
|
|
}
|
|
|
if (!empty($total_by_tva_rate['0.055'])) {
|
|
|
$this->addAccountingLine($num_mouvement, $journal, $date_ecriture, $date_echeance, $num_piece, '445712', $libelle_ecriture, $total_by_tva_rate['0.055'], 'C', $num_pointage, $code_analytique_budgetaire, 'TVA 5.5%');
|
|
@@ -461,4 +461,4 @@ class kataoPeriodActions extends wpActions {
|
|
|
wpFlashMessages::addError('Impossible de copier la période "' . $katao_period->getName() . '".');
|
|
|
$this->redirect('kataoPeriod/index');
|
|
|
}
|
|
|
-}
|
|
|
+}
|