Bugfix tests

This commit is contained in:
Thomas Zilio 2019-02-12 17:41:14 +01:00
parent 2c2bd8091a
commit 5f35030da0
4 changed files with 6 additions and 10 deletions

View File

@ -45,9 +45,7 @@ abstract class Discount extends Model
*/ */
public function getImponibileAttribute() public function getImponibileAttribute()
{ {
$result = $this->subtotale; return $this->subtotale;
return $this->parent->tipo->reversed ? -$result : $result;
} }
/** /**
@ -63,9 +61,7 @@ abstract class Discount extends Model
*/ */
public function getIvaAttribute() public function getIvaAttribute()
{ {
$result = $this->attributes['iva']; return $this->attributes['iva'];
return $this->parent->tipo->reversed ? -$result : $result;
} }
protected static function boot() protected static function boot()

View File

@ -1289,7 +1289,7 @@ switch (post('op')) {
// Aggiornamento sconto // Aggiornamento sconto
if (post('evadere')[$fattura->scontoGlobale->id] == 'on') { if (post('evadere')[$fattura->scontoGlobale->id] == 'on') {
$nota->tipo_sconto_globale = $fattura->tipo_sconto_globale; $nota->tipo_sconto_globale = $fattura->tipo_sconto_globale;
$nota->sconto_globale = $fattura->sconto_globale; $nota->sconto_globale = $fattura->tipo_sconto_globale == 'PRC' ? $fattura->sconto_globale : -$fattura->sconto_globale;
$nota->save(); $nota->save();
$nota->updateSconto(); $nota->updateSconto();

View File

@ -369,7 +369,7 @@ switch (post('op')) {
flash()->info(tr('Aggiunta nuova revisione!')); flash()->info(tr('Aggiunta nuova revisione!'));
break; break;
// Creazione fattura da contratto // Creazione fattura da preventivo
case 'fattura_da_preventivo': case 'fattura_da_preventivo':
$preventivo = Preventivo::find($id_record); $preventivo = Preventivo::find($id_record);

View File

@ -72,7 +72,7 @@ class AnagraficheCest
$t->clickAndWaitModal('.btn-primary', '#tabs'); $t->clickAndWaitModal('.btn-primary', '#tabs');
// Completa i campi per il nuovo elemento // Completa i campi per il nuovo elemento
$t->fillField('Ragione sociale', $name); $t->fillField('Denominazione', $name);
$t->select2('#idtipoanagrafica', $tipo); $t->select2('#idtipoanagrafica', $tipo);
$t->click('.btn-box-tool'); $t->click('.btn-box-tool');
$t->waitForElementVisible('#piva', 3); $t->waitForElementVisible('#piva', 3);
@ -82,7 +82,7 @@ class AnagraficheCest
$t->clickAndWait('Aggiungi', '#add-form'); $t->clickAndWait('Aggiungi', '#add-form');
// Controlla il salvataggio finale // Controlla il salvataggio finale
$t->seeInField('Ragione sociale', $name); $t->seeInField('Denominazione', $name);
} }
/** /**