mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 11:30:55 +01:00
Correzione totale imponibile
This commit is contained in:
parent
3f3d16e0f2
commit
93b2565b14
@ -39,7 +39,7 @@ echo '
|
||||
var sconto_percentuale = form.find("#sconto_percentuale");
|
||||
var sconto_unitario = form.find("#sconto_unitario");
|
||||
|
||||
var totale = '.($options['imponibile_scontato'] ?: 0).';
|
||||
var totale = '.($options['totale_imponibile'] ?: 0).';
|
||||
|
||||
function aggiorna_sconto_percentuale() {
|
||||
var sconto = sconto_percentuale.val().toEnglish();
|
||||
|
@ -33,11 +33,11 @@ abstract class Row extends Description
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'imponibile scontato dell'elemento.
|
||||
* Restituisce il totale imponibile dell'elemento.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getImponibileScontatoAttribute()
|
||||
public function getTotaleImponibileAttribute()
|
||||
{
|
||||
$result = $this->prezzo_unitario_vendita >= 0 ? $this->imponibile : -$this->imponibile;
|
||||
|
||||
@ -53,7 +53,7 @@ abstract class Row extends Description
|
||||
*/
|
||||
public function getTotaleAttribute()
|
||||
{
|
||||
return $this->imponibile_scontato + $this->iva;
|
||||
return $this->totale_imponibile + $this->iva;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,13 +67,13 @@ abstract class Row extends Description
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il gaudagno totale (imponibile_scontato - spesa) relativo all'elemento.
|
||||
* Restituisce il gaudagno totale (totale_imponibile - spesa) relativo all'elemento.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getGuadagnoAttribute()
|
||||
{
|
||||
return $this->imponibile_scontato - $this->spesa;
|
||||
return $this->totale_imponibile - $this->spesa;
|
||||
}
|
||||
|
||||
// Attributi della componente
|
||||
@ -85,7 +85,7 @@ abstract class Row extends Description
|
||||
|
||||
public function getIvaAttribute()
|
||||
{
|
||||
return ($this->imponibile_scontato) * $this->aliquota->percentuale / 100;
|
||||
return ($this->totale_imponibile) * $this->aliquota->percentuale / 100;
|
||||
}
|
||||
|
||||
public function getIvaDetraibileAttribute()
|
||||
|
@ -48,13 +48,13 @@ abstract class Document extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcola l'imponibile scontato del documento.
|
||||
* Calcola il totale imponibile del documento.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getImponibileScontatoAttribute()
|
||||
public function getTotaleImponibileAttribute()
|
||||
{
|
||||
return $this->calcola('imponibile_scontato');
|
||||
return $this->calcola('totale_imponibile');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4101,7 +4101,7 @@ msgstr ""
|
||||
#: templates/fatture/footer.php:119 templates/interventi/body.php:477
|
||||
#: templates/ordini/body.php:236 templates/preventivi/body.php:226
|
||||
#: templates/preventivi_cons/body.php:497
|
||||
msgid "Imponibile scontato"
|
||||
msgid "Totale imponibile"
|
||||
msgstr ""
|
||||
|
||||
#: modules/contratti/widgets/contratti.pianificazionedashboard.interventi.php:91
|
||||
|
@ -4282,7 +4282,7 @@ msgstr "discount _TOT_ _TYPE_"
|
||||
#: templates/fatture/footer.php:119 templates/interventi/body.php:477
|
||||
#: templates/ordini/body.php:236 templates/preventivi/body.php:226
|
||||
#: templates/preventivi_cons/body.php:497
|
||||
msgid "Imponibile scontato"
|
||||
msgid "Totale imponibile"
|
||||
msgstr "Taxable discounted"
|
||||
|
||||
#: modules/contratti/widgets/contratti.pianificazionedashboard.interventi.php:91
|
||||
|
@ -13,7 +13,7 @@ $options = [
|
||||
'action' => 'add',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati di default
|
||||
|
@ -13,7 +13,7 @@ $options = [
|
||||
'action' => 'edit',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati della riga
|
||||
|
@ -65,9 +65,11 @@ foreach ($rs as $r) {
|
||||
'.moneyFormat($r['subtotale'] / $r['qta']);
|
||||
|
||||
if (abs($r['sconto_unitario']) > 0) {
|
||||
$text = $r['sconto_unitario'] > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_');
|
||||
|
||||
echo '
|
||||
<br><small class="label label-danger">'.tr('sconto _TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($r['sconto_unitario']),
|
||||
<br><small class="label label-danger">'.replace($text, [
|
||||
'_TOT_' => Translator::numberToLocale(abs($r['sconto_unitario'])),
|
||||
'_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : currency()),
|
||||
]).'</small>';
|
||||
}
|
||||
@ -135,10 +137,10 @@ $imponibile = sum(array_column($rs, 'subtotale'));
|
||||
$sconto = sum(array_column($rs, 'sconto'));
|
||||
$iva = sum(array_column($rs, 'iva'));
|
||||
|
||||
$imponibile_scontato = sum($imponibile, -$sconto);
|
||||
$totale_imponibile = sum($imponibile, -$sconto);
|
||||
|
||||
$totale = sum([
|
||||
$imponibile_scontato,
|
||||
$totale_imponibile,
|
||||
$iva,
|
||||
]);
|
||||
|
||||
@ -147,7 +149,7 @@ echo '
|
||||
|
||||
// SCONTO
|
||||
if (abs($sconto) > 0) {
|
||||
// Totale imponibile scontato
|
||||
// Totale totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="5"" class="text-right">
|
||||
@ -170,14 +172,14 @@ if (abs($sconto) > 0) {
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
||||
// Totale imponibile scontato
|
||||
// Totale totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="5"" class="text-right">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
'.moneyFormat($imponibile_scontato, 2).'
|
||||
'.moneyFormat($totale_imponibile, 2).'
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
@ -14,7 +14,7 @@ $options = [
|
||||
'action' => 'add',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati di default
|
||||
|
@ -13,7 +13,7 @@ $options = [
|
||||
'action' => 'edit',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati della riga
|
||||
|
@ -102,9 +102,11 @@ if (!empty($rs)) {
|
||||
'.moneyFormat($r['subtotale'] / $r['qta']);
|
||||
|
||||
if (abs($r['sconto_unitario']) > 0) {
|
||||
$text = $r['sconto_unitario'] > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_');
|
||||
|
||||
echo '
|
||||
<br><small class="label label-danger">'.tr('sconto _TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($r['sconto_unitario']),
|
||||
<br><small class="label label-danger">'.replace($text, [
|
||||
'_TOT_' => Translator::numberToLocale(abs($r['sconto_unitario'])),
|
||||
'_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : currency()),
|
||||
]).'</small>';
|
||||
}
|
||||
@ -194,12 +196,12 @@ $imponibile = sum(array_column($rs, 'subtotale'));
|
||||
$sconto = sum(array_column($rs, 'sconto'));
|
||||
$iva = sum(array_column($rs, 'iva'));
|
||||
|
||||
$imponibile_scontato = sum($imponibile, -$sconto);
|
||||
$totale_imponibile = sum($imponibile, -$sconto);
|
||||
|
||||
$totale_iva = sum($iva, $record['iva_rivalsainps']);
|
||||
|
||||
$totale = sum([
|
||||
$imponibile_scontato,
|
||||
$totale_imponibile,
|
||||
$record['rivalsainps'],
|
||||
$totale_iva,
|
||||
]);
|
||||
@ -239,15 +241,15 @@ if (abs($sconto) > 0) {
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
||||
// IMPONIBILE SCONTATO
|
||||
// TOTALE IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<td align="right">
|
||||
'.moneyFormat($imponibile_scontato, 2).'
|
||||
'.moneyFormat($totale_imponibile, 2).'
|
||||
</td>
|
||||
|
||||
<td></td>
|
||||
|
@ -15,7 +15,7 @@ $options = [
|
||||
'conti' => $documento->direzione == 'entrata' ? 'conti-vendite' : 'conti-acquisti',
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'show-ritenuta-contributi' => !empty($documento['id_ritenuta_contributi']),
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Conto dalle impostazioni
|
||||
|
@ -14,7 +14,7 @@ $options = [
|
||||
'conti' => $documento->direzione == 'entrata' ? 'conti-vendite' : 'conti-acquisti',
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'show-ritenuta-contributi' => !empty($documento['id_ritenuta_contributi']),
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati della riga
|
||||
|
@ -28,7 +28,7 @@ foreach ($righe as $row) {
|
||||
// Valori assoluti
|
||||
$riga['qta'] = abs($riga['qta']);
|
||||
$riga['prezzo_unitario_acquisto'] = abs($riga['prezzo_unitario_acquisto']);
|
||||
$riga['imponibile_scontato'] = ($fattura->isNotaDiAccredito() ? -$row->imponibile_scontato : $row->imponibile_scontato);
|
||||
$riga['totale_imponibile'] = ($fattura->isNotaDiAccredito() ? -$row->totale_imponibile : $row->totale_imponibile);
|
||||
$riga['sconto_unitario'] = abs($riga['sconto_unitario']);
|
||||
$riga['sconto'] = abs($riga['sconto']);
|
||||
$riga['iva'] = abs($riga['iva']);
|
||||
@ -196,9 +196,11 @@ foreach ($righe as $row) {
|
||||
}
|
||||
|
||||
if (abs($row->sconto_unitario) > 0) {
|
||||
$text = $row->sconto_unitario > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_');
|
||||
|
||||
echo '
|
||||
<br><small class="label label-danger">'.tr('sconto _TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($row->sconto_unitario),
|
||||
<br><small class="label label-danger">'.replace($text, [
|
||||
'_TOT_' => Translator::numberToLocale(abs($row->sconto_unitario)),
|
||||
'_TYPE_' => ($row->tipo_sconto == 'PRC' ? '%' : currency()),
|
||||
]).'</small>';
|
||||
}
|
||||
@ -225,7 +227,7 @@ foreach ($righe as $row) {
|
||||
<td class="text-right">';
|
||||
if (!$row->isDescrizione()) {
|
||||
echo '
|
||||
'.moneyFormat($riga['imponibile_scontato']);
|
||||
'.moneyFormat($riga['totale_imponibile']);
|
||||
/*
|
||||
<br><small class="text-'.($row->guadagno > 0 ? 'success' : 'danger').'">
|
||||
'.tr('Guadagno').': '.moneyFormat($row->guadagno).'
|
||||
@ -283,7 +285,7 @@ echo '
|
||||
|
||||
$imponibile = abs($fattura->imponibile);
|
||||
$sconto = abs($fattura->sconto);
|
||||
$imponibile_scontato = abs($fattura->imponibile_scontato);
|
||||
$totale_imponibile = abs($fattura->totale_imponibile);
|
||||
$iva = abs($fattura->iva);
|
||||
$totale = abs($fattura->totale);
|
||||
$netto_a_pagare = abs($fattura->netto);
|
||||
@ -314,14 +316,14 @@ if (!empty($sconto)) {
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
||||
// IMPONIBILE SCONTATO
|
||||
// TOTALE IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
'.moneyFormat($imponibile_scontato, 2).'
|
||||
'.moneyFormat($totale_imponibile, 2).'
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
@ -41,12 +41,12 @@ trait RelationTrait
|
||||
*/
|
||||
public function getTotaleAttribute()
|
||||
{
|
||||
return $this->imponibile_scontato + $this->iva + $this->rivalsa_inps + $this->iva_rivalsa_inps;
|
||||
return $this->totale_imponibile + $this->iva + $this->rivalsa_inps + $this->iva_rivalsa_inps;
|
||||
}
|
||||
|
||||
public function getRivalsaINPSAttribute()
|
||||
{
|
||||
return $this->imponibile_scontato / 100 * $this->rivalsa->percentuale;
|
||||
return $this->totale_imponibile / 100 * $this->rivalsa->percentuale;
|
||||
}
|
||||
|
||||
public function getIvaRivalsaINPSAttribute()
|
||||
@ -56,7 +56,7 @@ trait RelationTrait
|
||||
|
||||
public function getRitenutaAccontoAttribute()
|
||||
{
|
||||
$result = $this->imponibile_scontato;
|
||||
$result = $this->totale_imponibile;
|
||||
|
||||
if ($this->calcolo_ritenuta_acconto == 'IMP+RIV') {
|
||||
$result += $this->rivalsainps;
|
||||
@ -71,7 +71,7 @@ trait RelationTrait
|
||||
public function getRitenutaContributiAttribute()
|
||||
{
|
||||
if ($this->attributes['ritenuta_contributi']) {
|
||||
$result = $this->imponibile_scontato;
|
||||
$result = $this->totale_imponibile;
|
||||
$ritenuta = $this->parent->ritenutaContributi;
|
||||
|
||||
$result = $result * $ritenuta->percentuale_imponibile / 100;
|
||||
|
@ -62,13 +62,13 @@ if (count($rs2) > 0) {
|
||||
'.moneyFormat($r['prezzo_vendita']);
|
||||
|
||||
if (abs($r['sconto_unitario']) > 0) {
|
||||
$text = $r['sconto_unitario'] > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_');
|
||||
|
||||
echo '
|
||||
<br><span class="label label-danger">
|
||||
- '.tr('sconto _TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($r['sconto_unitario']),
|
||||
<br><small class="label label-danger">'.replace($text, [
|
||||
'_TOT_' => Translator::numberToLocale(abs($r['sconto_unitario'])),
|
||||
'_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : currency()),
|
||||
]).'
|
||||
</span>';
|
||||
]).'</small>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -12,7 +12,7 @@ $options = [
|
||||
'action' => 'add',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati di default
|
||||
|
@ -12,7 +12,7 @@ $options = [
|
||||
'action' => 'edit',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati della riga
|
||||
|
@ -14,7 +14,7 @@ $options = [
|
||||
'action' => 'add',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati di default
|
||||
|
@ -13,7 +13,7 @@ $options = [
|
||||
'action' => 'edit',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati della riga
|
||||
|
@ -104,9 +104,11 @@ if (!empty($rs)) {
|
||||
'.moneyFormat($r['subtotale'] / $r['qta']);
|
||||
|
||||
if (abs($r['sconto_unitario']) > 0) {
|
||||
$text = $r['sconto_unitario'] > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_');
|
||||
|
||||
echo '
|
||||
<br><small class="label label-danger">'.tr('sconto _TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($r['sconto_unitario']),
|
||||
<br><small class="label label-danger">'.replace($text, [
|
||||
'_TOT_' => Translator::numberToLocale(abs($r['sconto_unitario'])),
|
||||
'_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : currency()),
|
||||
]).'</small>';
|
||||
}
|
||||
@ -189,12 +191,12 @@ $imponibile = sum(array_column($rs, 'subtotale'));
|
||||
$sconto = sum(array_column($rs, 'sconto'));
|
||||
$iva = sum(array_column($rs, 'iva'));
|
||||
|
||||
$imponibile_scontato = sum($imponibile, -$sconto);
|
||||
$totale_imponibile = sum($imponibile, -$sconto);
|
||||
|
||||
$totale_iva = sum($iva, $record['iva_rivalsainps']);
|
||||
|
||||
$totale = sum([
|
||||
$imponibile_scontato,
|
||||
$totale_imponibile,
|
||||
$record['rivalsainps'],
|
||||
$totale_iva,
|
||||
]);
|
||||
@ -230,14 +232,14 @@ if (abs($sconto) > 0) {
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
||||
// IMPONIBILE SCONTATO
|
||||
// TOTALE IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
'.moneyFormat($imponibile_scontato, 2).'
|
||||
'.moneyFormat($totale_imponibile, 2).'
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
@ -29,7 +29,7 @@ function get_imponibile_preventivo($idpreventivo)
|
||||
{
|
||||
$preventivo = Preventivo::find($idpreventivo);
|
||||
|
||||
return $preventivo->imponibile_scontato;
|
||||
return $preventivo->totale_imponibile;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ $options = [
|
||||
'action' => 'add',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati di default
|
||||
|
@ -13,7 +13,7 @@ $options = [
|
||||
'action' => 'edit',
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
];
|
||||
|
||||
// Dati della riga
|
||||
|
@ -66,9 +66,11 @@ foreach ($rs as $r) {
|
||||
'.moneyFormat($r['subtotale'] / $r['qta']);
|
||||
|
||||
if (abs($r['sconto_unitario']) > 0) {
|
||||
$text = $r['sconto_unitario'] > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_');
|
||||
|
||||
echo '
|
||||
<br><small class="label label-danger">'.tr('sconto _TOT_ _TYPE_', [
|
||||
'_TOT_' => Translator::numberToLocale($r['sconto_unitario']),
|
||||
<br><small class="label label-danger">'.replace($text, [
|
||||
'_TOT_' => Translator::numberToLocale(abs($r['sconto_unitario'])),
|
||||
'_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : currency()),
|
||||
]).'</small>';
|
||||
}
|
||||
@ -135,14 +137,14 @@ $imponibile = sum(array_column($rs, 'subtotale'));
|
||||
$sconto = sum(array_column($rs, 'sconto'));
|
||||
$iva = sum(array_column($rs, 'iva'));
|
||||
|
||||
$imponibile_scontato = sum($imponibile, -$sconto);
|
||||
$totale_imponibile = sum($imponibile, -$sconto);
|
||||
|
||||
$totale = sum([
|
||||
$imponibile_scontato,
|
||||
$totale_imponibile,
|
||||
$iva,
|
||||
]);
|
||||
$totale_guadagno = sum([
|
||||
$imponibile_scontato
|
||||
$totale_imponibile
|
||||
- $totale_acquisto,
|
||||
]);
|
||||
|
||||
@ -177,10 +179,10 @@ if (abs($sconto) > 0) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
'.moneyFormat($imponibile_scontato, 2).'
|
||||
'.moneyFormat($totale_imponibile, 2).'
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
@ -993,9 +993,9 @@ class FatturaElettronica
|
||||
$percentuale = floatval($aliquota->percentuale);
|
||||
|
||||
if ($documento->isNotaDiAccredito()) {
|
||||
$dettaglio['PrezzoTotale'] = -$riga->imponibile_scontato ?: 0;
|
||||
$dettaglio['PrezzoTotale'] = -$riga->totale_imponibile ?: 0;
|
||||
} else {
|
||||
$dettaglio['PrezzoTotale'] = $riga->imponibile_scontato ?: 0;
|
||||
$dettaglio['PrezzoTotale'] = $riga->totale_imponibile ?: 0;
|
||||
}
|
||||
$dettaglio['AliquotaIVA'] = $percentuale;
|
||||
|
||||
|
@ -172,7 +172,7 @@ class FatturaOrdinaria extends FatturaElettronica
|
||||
$dati_generali = $this->getBody()['DatiGenerali']['DatiGeneraliDocumento'];
|
||||
$totale_documento = $dati_generali['ImportoTotaleDocumento'];
|
||||
|
||||
$diff = $totale_documento ? floatval($totale_documento) - $fattura->totale : $totale_righe - $fattura->imponibile_scontato;
|
||||
$diff = $totale_documento ? floatval($totale_documento) - $fattura->totale : $totale_righe - $fattura->totale_imponibile;
|
||||
if (!empty($diff)) {
|
||||
// Rimozione dell'IVA calcolata automaticamente dal gestionale
|
||||
$iva_arrotondamento = database()->fetchOne('SELECT * FROM co_iva WHERE id='.prepare($iva[0]));
|
||||
|
@ -20,19 +20,19 @@ $preventivi = Preventivo::whereBetween('data_accettazione', [$start, $end])
|
||||
->where('idanagrafica', $id_record)
|
||||
->where('default_revision', 1)
|
||||
->get();
|
||||
$totale_preventivi = $preventivi->sum('imponibile_scontato');
|
||||
$totale_preventivi = $preventivi->sum('totale_imponibile');
|
||||
|
||||
// Contratti
|
||||
$contratti = Contratto::whereBetween('data_accettazione', [$start, $end])
|
||||
->where('idanagrafica', $id_record)
|
||||
->get();
|
||||
$totale_contratti = $contratti->sum('imponibile_scontato');
|
||||
$totale_contratti = $contratti->sum('totale_imponibile');
|
||||
|
||||
// Ordini cliente
|
||||
$ordini_cliente = Ordine::whereBetween('data', [$start, $end])
|
||||
->where('idanagrafica', $id_record)
|
||||
->get();
|
||||
$totale_ordini_cliente = $ordini_cliente->sum('imponibile_scontato');
|
||||
$totale_ordini_cliente = $ordini_cliente->sum('totale_imponibile');
|
||||
|
||||
// Interventi
|
||||
|
||||
@ -58,7 +58,7 @@ $ddt_uscita = DDT::whereBetween('data', [$start, $end])
|
||||
$query->where('dt_tipiddt.dir', '=', 'entrata');
|
||||
})
|
||||
->get();
|
||||
$totale_ddt_uscita = $ddt_uscita->sum('imponibile_scontato');
|
||||
$totale_ddt_uscita = $ddt_uscita->sum('totale_imponibile');
|
||||
|
||||
// Fatture di vendita
|
||||
$fatture_vendita = Fattura::whereBetween('data', [$start, $end])
|
||||
@ -67,7 +67,7 @@ $fatture_vendita = Fattura::whereBetween('data', [$start, $end])
|
||||
$query->where('co_tipidocumento.dir', '=', 'entrata');
|
||||
})
|
||||
->get();
|
||||
$totale_fatture_vendita = $fatture_vendita->sum('imponibile_scontato');
|
||||
$totale_fatture_vendita = $fatture_vendita->sum('totale_imponibile');
|
||||
|
||||
echo '
|
||||
<div class="box box-info" id="row-'.$calendar_id.'">
|
||||
|
@ -556,11 +556,11 @@ if ($options['pricing']) {
|
||||
</th>
|
||||
</tr>';
|
||||
|
||||
// Imponibile scontato
|
||||
// Totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="3" class="text-right border-top">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="2" class="text-center">
|
||||
|
@ -256,12 +256,12 @@ $imponibile = sum(array_column($righe, 'subtotale'));
|
||||
$sconto = sum(array_column($righe, 'sconto'));
|
||||
$iva = sum(array_column($righe, 'iva'));
|
||||
|
||||
$imponibile_scontato = sum($imponibile, -$sconto);
|
||||
$totale_imponibile = sum($imponibile, -$sconto);
|
||||
|
||||
$totale_iva = sum($iva, $record['iva_rivalsainps']);
|
||||
|
||||
$totale = sum([
|
||||
$imponibile_scontato,
|
||||
$totale_imponibile,
|
||||
$record['rivalsainps'],
|
||||
$totale_iva,
|
||||
]);
|
||||
@ -274,7 +274,7 @@ $netto_a_pagare = sum([
|
||||
$imponibile = abs($imponibile);
|
||||
$sconto = abs($sconto);
|
||||
$iva = abs($iva);
|
||||
$imponibile_scontato = abs($imponibile_scontato);
|
||||
$totale_imponibile = abs($totale_imponibile);
|
||||
$totale_iva = abs($totale_iva);
|
||||
$totale = abs($totale);
|
||||
$netto_a_pagare = abs($netto_a_pagare);
|
||||
|
@ -116,7 +116,7 @@ if (!empty($sconto)) {
|
||||
</th>
|
||||
|
||||
<th class='text-center small' style='width:".$width."'>
|
||||
".tr('Imponibile scontato', [], ['upper' => true]).'
|
||||
".tr('Totale imponibile', [], ['upper' => true]).'
|
||||
</th>';
|
||||
}
|
||||
|
||||
|
@ -470,11 +470,11 @@ if ($options['pricing']) {
|
||||
</th>
|
||||
</tr>';
|
||||
|
||||
// Imponibile scontato
|
||||
// Totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th class="text-center">
|
||||
|
@ -229,11 +229,11 @@ if ($options['pricing']) {
|
||||
</th>
|
||||
</tr>';
|
||||
|
||||
// Imponibile scontato
|
||||
// Totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="'.(($has_image) ? 4 : 3).'" class="text-right border-top">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="2" class="text-right">
|
||||
|
@ -219,11 +219,11 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
|
||||
</th>
|
||||
</tr>';
|
||||
|
||||
// Imponibile scontato
|
||||
// Totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="3" class="text-right border-top">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="2" class="text-right">
|
||||
|
@ -490,11 +490,11 @@ if ($show) {
|
||||
</th>
|
||||
</tr>';
|
||||
|
||||
// Imponibile scontato
|
||||
// Totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="3" class="text-right border-top">
|
||||
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="2" class="text-center">
|
||||
|
@ -126,7 +126,7 @@ class RowHelper extends \Codeception\Module
|
||||
|
||||
$t->see('542,34', $this->getFinalValue('Imponibile'));
|
||||
$t->see('60,00', $this->getFinalValue('Sconto'));
|
||||
$t->see('482,34', $this->getFinalValue('Imponibile scontato'));
|
||||
$t->see('482,34', $this->getFinalValue('Totale imponibile'));
|
||||
$t->see('106,11', $this->getFinalValue('IVA'));
|
||||
$t->see('588,45', $this->getFinalValue('Totale'));
|
||||
|
||||
@ -135,7 +135,7 @@ class RowHelper extends \Codeception\Module
|
||||
|
||||
$t->see('542,34', $this->getFinalValue('Imponibile'));
|
||||
$t->see('160,00', $this->getFinalValue('Sconto'));
|
||||
$t->see('382,34', $this->getFinalValue('Imponibile scontato'));
|
||||
$t->see('382,34', $this->getFinalValue('Totale imponibile'));
|
||||
$t->see('84,11', $this->getFinalValue('IVA'));
|
||||
$t->see('466,45', $this->getFinalValue('Totale'));
|
||||
|
||||
@ -146,7 +146,7 @@ class RowHelper extends \Codeception\Module
|
||||
|
||||
$t->see('542,34', $this->getFinalValue('Imponibile'));
|
||||
$t->see('98,23', $this->getFinalValue('Sconto'));
|
||||
$t->see('444,11', $this->getFinalValue('Imponibile scontato'));
|
||||
$t->see('444,11', $this->getFinalValue('Totale imponibile'));
|
||||
$t->see('97,70', $this->getFinalValue('IVA'));
|
||||
$t->see('541,81', $this->getFinalValue('Totale'));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user