mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
d0b73c2a0d
@ -111,14 +111,6 @@ switch ($resource) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$prezzo_vendita = $r['prezzo_vendita'];
|
$prezzo_vendita = $r['prezzo_vendita'];
|
||||||
if (!empty($listino)) {
|
|
||||||
$prezzo_vendita = sum($prezzo_vendita, -calcola_sconto([
|
|
||||||
'sconto' => $listino['percentuale'],
|
|
||||||
'prezzo' => $prezzo_vendita,
|
|
||||||
'tipo' => 'PRC',
|
|
||||||
'qta' => 1,
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
|
|
||||||
$results[count($results) - 1]['children'][] = [
|
$results[count($results) - 1]['children'][] = [
|
||||||
'id' => $r['id'],
|
'id' => $r['id'],
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<a class="btn btn-info '.(in_array($record['stato'], ['Bozza', 'Parzialmente fatturato']) ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'">
|
<a class="btn btn-info '.(!in_array($record['stato'], ['Bozza', 'Fatturato']) ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'">
|
||||||
<i class="fa fa-magic"></i> '.tr('Crea fattura').'
|
<i class="fa fa-magic"></i> '.tr('Crea fattura').'
|
||||||
</a>';
|
</a>';
|
||||||
|
@ -79,7 +79,7 @@ switch (post('op')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Selezione delle fatture da stampare
|
// Selezione delle fatture da stampare
|
||||||
$fatture = $dbo->fetchArray('SELECT co_documenti.id, numero_esterno, data, ragione_sociale, co_tipidocumento.descrizione FROM co_documenti INNER JOIN an_anagrafiche ON co_documenti.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE co_documenti.id IN('.implode(',', $id_records).')');
|
$fatture = $dbo->fetchArray('SELECT co_documenti.id, numero_esterno, data, ragione_sociale, co_tipidocumento.descrizione, co_tipidocumento.dir FROM co_documenti INNER JOIN an_anagrafiche ON co_documenti.idanagrafica=an_anagrafiche.idanagrafica INNER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE co_documenti.id IN('.implode(',', $id_records).')');
|
||||||
|
|
||||||
$failed = [];
|
$failed = [];
|
||||||
if (!empty($fatture)) {
|
if (!empty($fatture)) {
|
||||||
@ -88,9 +88,13 @@ switch (post('op')) {
|
|||||||
$include = true;
|
$include = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$fe = new \Plugins\ExportFE\FatturaElettronica($fattura->id);
|
if ($r['dir'] == 'entrata') {
|
||||||
|
$fe = new \Plugins\ExportFE\FatturaElettronica($fattura->id);
|
||||||
|
$include = $fe->isGenerated();
|
||||||
|
} else {
|
||||||
|
$include = $fattura->isFE();
|
||||||
|
}
|
||||||
|
|
||||||
$include = $fe->isGenerated();
|
|
||||||
} catch (UnexpectedValueException $e) {
|
} catch (UnexpectedValueException $e) {
|
||||||
$include = false;
|
$include = false;
|
||||||
}
|
}
|
||||||
@ -98,10 +102,16 @@ switch (post('op')) {
|
|||||||
if (!$include) {
|
if (!$include) {
|
||||||
$failed[] = $fattura->numero_esterno;
|
$failed[] = $fattura->numero_esterno;
|
||||||
} else {
|
} else {
|
||||||
$filename = $fe->getFilename();
|
if ($r['dir'] == 'entrata') {
|
||||||
|
$src = $fe->getFilename();
|
||||||
|
$dst = $src;
|
||||||
|
} else {
|
||||||
|
$src = basename( $fattura->uploads()->where('name', 'Fattura Elettronica')->first()->filepath );
|
||||||
|
$dst = basename( $fattura->uploads()->where('name', 'Fattura Elettronica')->first()->original );
|
||||||
|
}
|
||||||
|
|
||||||
$file = slashes($module->upload_directory.'/'.$filename);
|
$file = slashes($module->upload_directory.'/'.$src);
|
||||||
$dest = slashes($dir.'/tmp/'.$filename);
|
$dest = slashes($dir.'/tmp/'.$dst);
|
||||||
|
|
||||||
$result = copy($file, $dest);
|
$result = copy($file, $dest);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -146,16 +156,17 @@ if ($module->name == 'Fatture di vendita') {
|
|||||||
'blank' => true,
|
'blank' => true,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$bulk['export-xml-bulk'] = [
|
|
||||||
'text' => tr('Esporta XML'),
|
|
||||||
'data' => [
|
|
||||||
'msg' => tr('Vuoi davvero esportare tutte le fatture elettroniche in un archivio?'),
|
|
||||||
'button' => tr('Procedi'),
|
|
||||||
'class' => 'btn btn-lg btn-warning',
|
|
||||||
'blank' => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$bulk['export-xml-bulk'] = [
|
||||||
|
'text' => tr('Esporta XML'),
|
||||||
|
'data' => [
|
||||||
|
'msg' => tr('Vuoi davvero esportare tutte le fatture elettroniche in un archivio?'),
|
||||||
|
'button' => tr('Procedi'),
|
||||||
|
'class' => 'btn btn-lg btn-warning',
|
||||||
|
'blank' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
return $bulk;
|
return $bulk;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user