1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-22 21:28:08 +01:00

Fix minori

This commit is contained in:
Thomas Zilio 2019-07-16 10:32:54 +02:00
parent 5aac1836f5
commit cc0fa01e75
6 changed files with 44 additions and 19 deletions

View File

@ -5,6 +5,7 @@ use Modules\Interventi\Intervento;
include_once __DIR__.'/../../core.php';
$documento = Intervento::find($id_record);
$costi = get_costi_intervento($id_record);
// Impostazioni per la gestione
$options = [
@ -12,7 +13,7 @@ $options = [
'action' => 'add',
'dir' => $documento->direzione,
'idanagrafica' => $documento['idanagrafica'],
'imponibile_scontato' => $documento->imponibile_scontato,
'imponibile_scontato' => $costi['totale'],
];
// Dati di default

View File

@ -5,6 +5,7 @@ use Modules\Interventi\Intervento;
include_once __DIR__.'/../../core.php';
$documento = Intervento::find($id_record);
$costi = get_costi_intervento($id_record);
// Impostazioni per la gestione
$options = [
@ -12,7 +13,7 @@ $options = [
'action' => 'edit',
'dir' => $documento->direzione,
'idanagrafica' => $documento['idanagrafica'],
'imponibile_scontato' => $documento->imponibile_scontato,
'imponibile_scontato' => $costi['totale'],
];
// Dati della riga

View File

@ -125,11 +125,11 @@ echo '
<tr>
<td class="cell-padded">
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo) : '').'&nbsp;KG
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo).'&nbsp;KG' : '').'
</td>
<td class="cell-padded">
'.(!empty($volume) ? Translator::numberToLocale($volume) : '').'&nbsp;M<sup>3</sup>
'.(!empty($volume) ? Translator::numberToLocale($volume).'&nbsp;M<sup>3</sup>' : '').'
</td>
<td class="cell-padded">

View File

@ -46,7 +46,9 @@ echo "
$righe = $dbo->fetchArray("SELECT *,
IFNULL((SELECT `codice` FROM `mg_articoli` WHERE `id` = `co_righe_documenti`.`idarticolo`), '') AS codice_articolo,
(SELECT GROUP_CONCAT(`serial` SEPARATOR ', ') FROM `mg_prodotti` WHERE `id_riga_documento` = `co_righe_documenti`.`id`) AS seriali,
(SELECT `percentuale` FROM `co_iva` WHERE `id` = `co_righe_documenti`.`idiva`) AS perc_iva
(SELECT `percentuale` FROM `co_iva` WHERE `id` = `co_righe_documenti`.`idiva`) AS perc_iva,
IFNULL((SELECT peso_lordo FROM mg_articoli WHERE id=idarticolo),0) * qta AS peso_lordo,
IFNULL((SELECT volume FROM mg_articoli WHERE id=idarticolo),0) * qta AS volume
FROM `co_righe_documenti` WHERE `iddocumento` = ".prepare($id_record).' ORDER BY `order`');
foreach ($righe as $r) {
$count = 0;

View File

@ -1,5 +1,8 @@
<?php
$volume = sum(array_column($righe, 'volume'));
$peso_lordo = sum(array_column($righe, 'peso_lordo'));
// SCADENZE | TOTALI
// TABELLA PRINCIPALE
echo "
@ -289,24 +292,40 @@ if ($fattura_accompagnatoria) {
echo '
<table class="table-bordered">
<tr>
<th class="small" class style="width:25%">
<th class="small" class style="width:15%">
'.tr('Peso lordo', [], ['upper' => true]).'
</th>
<th class="small" class style="width:15%">
'.tr('Volume', [], ['upper' => true]).'
</th>
<th class="small" class style="width:15%">
'.tr('Aspetto beni', [], ['upper' => true]).'
</th>
<th class="small" class style="width:20%">
'.tr('Num. colli', [], ['upper' => true]).'
<th class="small" class style="width:10%">
'.tr('Colli', [], ['upper' => true]).'
</th>
<th class="small" style="width:30%">
'.tr('Causale trasporto', [], ['upper' => true]).'
</th>
<th class="small" style="width:25%">
<th class="small" style="width:15%">
'.tr('Porto', [], ['upper' => true]).'
</th>
</tr>
<tr>
<td class="cell-padded">
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo).'&nbsp;KG' : '').'
</td>
<td class="cell-padded">
'.(!empty($volume) ? Translator::numberToLocale($volume).'&nbsp;M<sup>3</sup>' : '').'
</td>
<td class="cell-padded">
$aspettobeni$ &nbsp;
</td>

View File

@ -2,19 +2,21 @@
include_once __DIR__.'/../../core.php';
function findKey($array, $keySearch)
{
foreach ($array as $key => $item) {
if ($key == $keySearch) {
return true;
} elseif (is_array($item) && findKey($item, $keySearch)) {
echo $key;
if (!function_exists('findKey')) {
function findKey($array, $keySearch)
{
foreach ($array as $key => $item) {
if ($key == $keySearch) {
return true;
} elseif (is_array($item) && findKey($item, $keySearch)) {
echo $key;
return true;
return true;
}
}
}
return false;
return false;
}
}
$has_image = false;