This commit is contained in:
MatteoPistorello 2024-09-18 09:14:18 +02:00
commit ba157f40ac
4 changed files with 18 additions and 14 deletions

View File

@ -66,7 +66,7 @@ if (sizeof($rs_doc) > 0) {
<?php
for ($i = 0; $i < sizeof($rs_doc); ++$i) {
$rs = $dbo->fetchArray('SELECT `dir` FROM `co_tipidocumento` INNER JOIN `co_documenti` ON `co_tipidocumento`.`id`=`co_documenti`.`idtipodocumento` WHERE `co_documenti`.`id`='.prepare($rs_doc[$i]['iddocumento']));
$id_modulo = ($rs[0]['dir'] == 'entrata') ? Module::where('name', 'Fatture di vendita')->first()->id->id_record : Module::where('name', 'Fatture di acquisto')->first()->id; ?>
$id_modulo = ($rs[0]['dir'] == 'entrata') ? Module::where('name', 'Fatture di vendita')->first()->id : Module::where('name', 'Fatture di acquisto')->first()->id; ?>
<a href="<?php echo base_path(); ?>/editor.php?id_module=<?php echo $id_modulo; ?>&id_record=<?php echo $rs_doc[$i]['iddocumento']; ?>" class="dropdown-item">
<i class="fa fa-chevron-left"></i> <?php echo tr('Vai alla fattura n. '.$rs_doc[$i]['numero']); ?>
</a>

View File

@ -198,7 +198,7 @@ switch (filter('op')) {
$id = filter('id');
$widget = $database->table('zz_widgets_lang')
->where('id', '=', $id)
->where('id_record', '=', $id)
->first();
// Abilitazione del widget indicato

View File

@ -1621,7 +1621,7 @@ class FatturaElettronica implements \Stringable
}
// Se sono presenti solo righe descrittive uso l'iva da impostazioni e creo un riepilogo con gli importi a 0
if (empty($iva)) {
if (empty($iva) && $righe->count() > 0) {
$iva = [
'AliquotaIVA' => $aliquota->percentuale,
'ImponibileImporto' => 0,

View File

@ -62,17 +62,21 @@ class Ricevuta
delete($extraction_dir);
}
$this->file = $file;
$this->xml = XML::readFile($this->file);
$filename = explode('.', (string) $name)[0];
$pieces = explode('_', $filename);
$progressivo_invio = $pieces[1];
$this->fattura = Fattura::where([
'progressivo_invio' => $progressivo_invio,
])->first();
if (!file_exists($file)) {
throw new \UnexpectedValueException();
} else {
$this->file = $file;
$this->xml = XML::readFile($this->file);
$filename = explode('.', (string) $name)[0];
$pieces = explode('_', $filename);
$progressivo_invio = $pieces[1];
$this->fattura = Fattura::where([
'progressivo_invio' => $progressivo_invio,
])->first();
}
if (empty($this->fattura)) {
throw new \UnexpectedValueException();