2017-08-04 16:28:16 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
2017-12-30 14:13:11 +01:00
$module = Modules :: get ( 'Interventi' );
2017-09-21 18:04:57 +02:00
$id_module = $module [ 'id' ];
2017-08-04 16:28:16 +02:00
2019-02-01 17:44:31 +01:00
$total = Util\Query :: readQuery ( $module );
2017-08-04 16:28:16 +02:00
2017-09-21 18:04:57 +02:00
// Lettura parametri modulo
$module_query = $total [ 'query' ];
2017-08-04 16:28:16 +02:00
$search_filters = [];
if ( is_array ( $_SESSION [ 'module_' . $id_module ])) {
2018-07-19 09:58:28 +02:00
foreach ( $_SESSION [ 'module_' . $id_module ] as $field => $value ) {
if ( ! empty ( $value ) && starts_with ( $field , 'search_' )) {
2018-11-26 09:27:50 +01:00
$field_name = str_replace ( 'search_' , '' , $field );
2017-08-04 16:28:16 +02:00
$field_name = str_replace ( '__' , ' ' , $field_name );
2018-06-26 14:30:26 +02:00
$field_name = str_replace ( '-' , ' ' , $field_name );
2019-01-10 18:41:25 +01:00
array_push ( $search_filters , '`' . $field_name . '` LIKE "%' . $value . '%"' );
2017-08-04 16:28:16 +02:00
}
}
}
2017-09-21 18:04:57 +02:00
if ( ! empty ( $search_filters )) {
$module_query = str_replace ( '2=2' , '2=2 AND (' . implode ( ' AND ' , $search_filters ) . ') ' , $module_query );
2017-08-04 16:28:16 +02:00
}
2017-09-21 18:04:57 +02:00
// Filtri derivanti dai permessi (eventuali)
$module_query = Modules :: replaceAdditionals ( $id_module , $module_query );
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
$interventi = $dbo -> fetchArray ( $module_query );
2017-08-04 16:28:16 +02:00
// Se il cliente è uno solo carico la sua intestazione, altrimenti la lascio in bianco
2018-09-27 10:15:04 +02:00
$idcliente = $interventi [ 0 ][ 'idanagrafica' ];
2017-08-04 16:28:16 +02:00
$singolo_cliente = true ;
2018-09-27 10:15:04 +02:00
for ( $i = 0 ; $i < sizeof ( $interventi ) && $singolo_cliente ; ++ $i ) {
if ( $interventi [ $i ][ 'idanagrafica' ] != $idcliente ) {
2017-08-04 16:28:16 +02:00
$singolo_cliente = false ;
}
}
if ( ! $singolo_cliente ) {
$idcliente = '' ;
}
// carica report html
$report = file_get_contents ( $docroot . '/templates/riepilogo_interventi/intervento.html' );
$body = file_get_contents ( $docroot . '/templates/riepilogo_interventi/intervento_body.html' );
if ( ! $singolo_cliente ) {
$body = str_replace ( 'Spett.le' , '' , $body );
}
include_once $docroot . '/templates/pdfgen_variables.php' ;
2018-09-27 10:15:04 +02:00
$totrows = sizeof ( $interventi );
2017-08-04 16:28:16 +02:00
$totale_km = 0.00 ;
$totale = 0.00 ;
$totale_calcolato = 0.00 ;
$info_intervento = [];
$ore = [];
$km = [];
$ntecnici = [];
$tecnici = [];
$costi_orari = [];
$costi_km = [];
$diritto_chiamata = [];
$costo_ore_cons = [];
$costo_km_cons = [];
$diritto_chiamata_cons = [];
$idinterventi = [ '0' ];
2018-12-17 10:48:49 +01:00
$costi_interventi = [];
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
foreach ( $interventi as $intervento ) {
// Lettura dati dei tecnici dell'intervento corrente
$sessioni = $dbo -> fetchArray ( 'SELECT *, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=idtecnico) AS nome_tecnico FROM in_interventi_tecnici WHERE idintervento=' . prepare ( $intervento [ 'id' ]));
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
$riga_tecnici = " <table><tr><td style='border:0px solid transparent;' colspan='2'><div style='width:75mm;'></div></td></tr> \n " ;
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
foreach ( $sessioni as $sessione ) {
$riga_tecnici .= " <tr><td valign='top' style='border:0px solid transparent;' align='left' > \n " . $sessione [ 'nome_tecnico' ] . " \n </td> \n " ;
$riga_tecnici .= " <td valign='bottom' style='border:0px solid transparent;' align='right'> \n " . Translator :: dateToLocale ( $sessione [ 'orario_inizio' ]) . ' - ' . Translator :: timeToLocale ( $sessione [ 'orario_inizio' ]) . '-' . Translator :: timeToLocale ( $sessione [ 'orario_fine' ]) . " \n " ;
$riga_tecnici .= " </td></tr> \n " ;
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
array_push ( $costi_orari , floatval ( $sessione [ 'prezzo_ore_unitario' ]));
array_push ( $costi_km , floatval ( $sessione [ 'prezzo_km_unitario' ]));
array_push ( $diritto_chiamata , floatval ( $sessione [ 'prezzo_dirittochiamata' ]));
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
array_push ( $costo_ore_cons , floatval ( $sessione [ 'prezzo_ore_consuntivo' ]));
array_push ( $costo_km_cons , floatval ( $sessione [ 'prezzo_km_consuntivo' ]));
array_push ( $diritto_chiamata_cons , floatval ( $sessione [ 'prezzo_dirittochiamata_consuntivo' ]));
array_push ( $km , floatval ( $sessione [ 'km' ]));
$totale_km += floatval ( $sessione [ 'km' ]);
}
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
$riga_tecnici .= " </table> \n " ;
2017-08-04 16:28:16 +02:00
2019-05-23 16:27:00 +02:00
$line = '<span>Intervento <b>' . $intervento [ 'Numero' ] . '</b> del <b>' . Translator :: timestampToLocale ( $intervento [ 'Data inizio' ]) . " </b><br/><small style='color:#444;'> " . nl2br ( $intervento [ 'descrizione' ]) . " </small></span><br/> \n " ;
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
// Se l'elenco non è di un singolo cliente stampo anche la sua ragione sociale
if ( ! $singolo_cliente ) {
$line .= '<br/><span><small><b>Cliente:</b> ' . $intervento [ 'Ragione sociale' ] . " </small></span> \n " ;
}
2017-08-04 16:28:16 +02:00
2018-09-27 10:15:04 +02:00
array_push ( $info_intervento , $line );
2018-09-27 09:26:27 +02:00
2018-09-27 10:15:04 +02:00
array_push ( $ntecnici , $n_tecnici );
array_push ( $tecnici , $riga_tecnici );
array_push ( $ore , get_ore_intervento ( $intervento [ 'id' ]));
$totale_dirittochiamata += floatval ( $rs [ $i ][ 'prezzo_dirittochiamata' ]);
array_push ( $idinterventi , " ' " . $intervento [ 'id' ] . " ' " );
2018-12-17 10:48:49 +01:00
2018-12-23 14:01:59 +01:00
array_push ( $costi_interventi , get_costi_intervento ( $intervento [ 'id' ]));
2017-08-04 16:28:16 +02:00
}
2018-09-27 10:15:04 +02:00
$body .= '<big><big><b>RIEPILOGO INTERVENTI DAL ' . Translator :: dateToLocale ( $_SESSION [ 'period_start' ]) . ' al ' . Translator :: dateToLocale ( $_SESSION [ 'period_end' ]) . " </b></big></big><br/><br/> \n " ;
2017-08-04 16:28:16 +02:00
// Sostituisco i valori tra | | con il valore del campo del db
2018-09-27 10:15:04 +02:00
$body .= preg_replace ( '/|(.+?)|/' , $interventi [ 0 ][ '${1}' ], $body );
2017-08-04 16:28:16 +02:00
if ( sizeof ( $info_intervento ) > 0 ) {
// Tabella con riepilogo interventi, km e ore
$body .= " <table class= \" table_values \" style= \" table-layout:fixed; \" border= \" 0 \" > \n " ;
$body .= " <thead> \n " ;
$body .= " <tr><th align= \" left \" style= \" width:75mm; \" > \n " ;
$body .= " <span>Interventi</span> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" style= \" width:15mm; \" > \n " ;
$body .= " <span>km</span> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" style= \" width:15mm; \" > \n " ;
$body .= " <span>Costo unitario al km</span> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" style= \" width:15mm; \" > \n " ;
$body .= " <span>Ore</span> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" style= \" width:15mm; \" > \n " ;
2018-12-17 10:48:49 +01:00
$body .= " <span>Costo medio unitario all’ora</span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </th> \n " ;
$body .= " <th align= \" center \" style= \" width:15mm; \" > \n " ;
$body .= " <span>Diritto chiamata</span> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" style= \" width:15mm; \" > \n " ;
$body .= " <span>Subtotale</span> \n " ;
$body .= " </th></tr> \n " ;
$body .= " </thead> \n " ;
$body .= " <tbody> \n " ;
// Tabella con i dati
for ( $i = 0 ; $i < sizeof ( $info_intervento ); ++ $i ) {
2018-12-23 14:01:59 +01:00
$subtotale_consuntivo = $costi_interventi [ $i ][ 'totale_addebito' ];
$totale_consuntivo += $costi_interventi [ $i ][ 'totale_addebito' ];
2018-12-17 10:48:49 +01:00
//$subtotale_consuntivo = floatval($costo_ore_cons[$i] + $costo_km_cons[$i] + $diritto_chiamata_cons[$i]);
//$totale_consuntivo += $subtotale_consuntivo;
//$subtotale_calcolato = $costi_orari[$i] * $ore[$i] + $costi_km[$i] * $km[$i] + $diritto_chiamata[$i];
//$totale_calcolato += $subtotale_calcolato;
2018-12-23 14:01:59 +01:00
$subtotale_calcolato = $costi_interventi [ $i ][ 'totale_scontato' ];
$totale_calcolato += $costi_interventi [ $i ][ 'totale_scontato' ];
$costi_orari [ $i ] = ( $costi_interventi [ $i ][ 'manodopera_addebito' ] / $ore [ $i ]);
2017-08-04 16:28:16 +02:00
$body .= " <tr><td> \n " ;
$body .= '<div style="width:75mm;"><span>' . $info_intervento [ $i ] . '<br/><span style="font-size:10px; color:#777;"><b>Tecnici:</b></span></span><br/><small>' . $tecnici [ $i ] . " </small></div> \n " ;
$body .= " </td> \n " ;
// Totale km
$body .= '<td align="center" valign="top">' ;
2017-09-21 10:01:07 +02:00
$body .= '<div style="width:15mm;"><span>' . Translator :: numberToLocale ( $km [ $i ]) . " </span></div> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Costo km
$body .= '<td align="center" valign="top">' ;
2017-09-21 10:01:07 +02:00
$body .= '<div style="width:15mm;"><span>' . Translator :: numberToLocale ( $costi_km [ $i ]) . " </span></div> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Totale ore
$body .= '<td align="center" valign="top">' ;
2017-09-21 10:01:07 +02:00
$body .= '<div style="width:15mm;"><span>' . Translator :: numberToLocale ( $ore [ $i ]) . " </span></div> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Costo ore
$body .= '<td align="center" valign="top">' ;
2017-09-21 10:01:07 +02:00
$body .= '<div style="width:15mm;"><span>' . Translator :: numberToLocale ( $costi_orari [ $i ]) . " </span></div> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Diritto chiamata
$body .= '<td align="center" valign="top">' ;
2017-09-21 10:01:07 +02:00
$body .= '<div style="width:15mm;"><span>' . Translator :: numberToLocale ( $diritto_chiamata [ $i ]) . " </span></div> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Subtot
$body .= '<td align="center" valign="top">' ;
2017-09-21 10:01:07 +02:00
$body .= '<div style="width:15mm;"><span>' . Translator :: numberToLocale ( $subtotale_calcolato ) . " </span></div> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n " ;
}
$body .= " <tr><td style='border:0px;' align= \" right \" > \n " ;
$body .= " <b>Totale:</b> \n " ;
$body .= " </td> \n " ;
// Totale costo km
$body .= " <td align= \" center \" > \n " ;
2017-09-21 10:01:07 +02:00
$body .= '<b>' . Translator :: numberToLocale ( $totale_km ) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
$body .= " <td></td> \n " ;
// Totale costo ore
$body .= " <td align= \" center \" > \n " ;
2018-09-27 09:26:27 +02:00
$body .= '<b>' . Translator :: numberToLocale ( sum ( $ore )) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
$body .= " <td></td> \n " ;
// Totale diritto chiamata
$body .= " <td align= \" center \" > \n " ;
2017-09-21 10:01:07 +02:00
$body .= '<b>' . Translator :: numberToLocale ( $totale_dirittochiamata ) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
$body .= " <td align= \" center \" bgcolor= \" #dddddd \" > \n " ;
2019-04-13 02:56:39 +02:00
$body .= '<b>' . moneyFormat ( $totale_calcolato ) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n " ;
// Riga dello sconto
$sconto = $totale_calcolato - $totale_consuntivo ;
if ( $sconto != 0 ) {
/*
$body .= " <tr><td style= \" border:0px; \" align= \" right \" colspan= \" 6 \" > \n " ;
$body .= " <b>Arrotondamenti:</b> \n " ;
$body .= " </td><td align= \" center \" > \n " ;
2019-04-13 02:56:39 +02:00
$body .= " <b> " . moneyFormat ( - $sconto ) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n \n " ;
*/
$body .= " <tr><td style= \" border:0px; \" align= \" right \" colspan= \" 6 \" > \n " ;
$body .= " <b>Totale scontato:</b> \n " ;
$body .= " </td><td align= \" center \" > \n " ;
2019-04-13 02:56:39 +02:00
$body .= '<b>' . moneyFormat ( $totale_calcolato - $sconto ) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n " ;
}
$totale_intervento_scontato = $totale_calcolato - $sconto ;
$body .= " </tbody> \n " ;
$body .= " </table><br/> \n " ;
}
// Conteggio articoli utilizzati
2019-05-23 16:27:00 +02:00
$query = " SELECT *, (SELECT codice FROM in_interventi WHERE in_interventi.id = mg_articoli_interventi.idintervento ) AS codice, (SELECT percentuale FROM co_iva WHERE id=(SELECT idiva_vendita FROM mg_articoli WHERE id=idarticolo)) AS prciva_vendita, (SELECT orario_inizio FROM in_interventi_tecnici WHERE idintervento=mg_articoli_interventi.idintervento GROUP BY idintervento HAVING idintervento=mg_articoli_interventi.idintervento) AS data_intervento, (SELECT prc_guadagno FROM mg_listini WHERE id=(SELECT idlistino_vendite FROM an_anagrafiche WHERE idanagrafica=(SELECT idanagrafica FROM in_interventi WHERE id=mg_articoli_interventi.idintervento) ) ) AS prc_guadagno, (SELECT codice FROM mg_articoli WHERE id=idarticolo) AS codice_art, CONCAT_WS(serial, 'SN: ', ', ') AS codice, SUM(qta) AS sumqta FROM `mg_articoli_interventi` JOIN mg_prodotti ON mg_articoli_interventi.idarticolo = mg_prodotti.id_articolo GROUP BY idarticolo, idintervento, lotto HAVING idintervento IN( " . implode ( ',' , $idinterventi ) . " ) AND NOT idarticolo='0' ORDER BY idarticolo ASC " ;
2017-08-04 16:28:16 +02:00
$rs2 = $dbo -> fetchArray ( $query );
if ( sizeof ( $rs2 ) > 0 ) {
$body .= " <table style= \" width:100%; \" class= \" table_values \" cellspacing= \" 2 \" cellpadding= \" 5 \" style= \" border-color:#aaa; \" > \n " ;
$body .= " <thead> \n " ;
$body .= " <tr><th align='center' colspan='4'><b>Materiale utilizzato per gli interventi</b></th></tr> \n " ;
$body .= " <tr><th style= \" width:130mm; \" > \n " ;
$body .= " <b>Articolo</b> \n " ;
$body .= " </th> \n " ;
$body .= " <th style= \" width:10mm; \" align= \" center \" > \n " ;
$body .= " <b>Q.tà</b> \n " ;
$body .= " </th> \n " ;
$body .= " <th style= \" width:20mm; \" align= \" center \" > \n " ;
$body .= " <b>Prezzo unitario</b> \n " ;
$body .= " </th> \n " ;
$body .= " <th style= \" width:20mm; \" align= \" center \" > \n " ;
$body .= " <b>Subtot</b> \n " ;
$body .= " </th></tr> \n " ;
$body .= " </thead> \n " ;
$totale_articoli = 0.00 ;
for ( $i = 0 ; $i < sizeof ( $rs2 ); ++ $i ) {
// Articolo
$body .= " <tr><td class='first_cell'> \n " ;
$body .= '<span>' . nl2br ( $rs2 [ $i ][ 'descrizione' ]) . " </span> \n " ;
if ( $rs2 [ $i ][ 'codice' ] != '' && $rs2 [ $i ][ 'codice' ] != 'Lotto: , SN: , Altro: ' ) {
$body .= '<br/><small>' . $rs2 [ $i ][ 'codice' ] . " </small> \n " ;
}
2019-05-23 16:27:00 +02:00
$body .= '<br/><span><small style="color:#777;">Intervento ' . $rs2 [ $i ][ 'codice' ] . ' del ' . Translator :: dateToLocale ( $rs2 [ $i ][ 'data_intervento' ]) . " </small></span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Quantità
$qta = $rs2 [ $i ][ 'sumqta' ];
$body .= " <td class='table_cell' align='center'> \n " ;
$body .= '<span>' . $rs2 [ $i ][ 'sumqta' ] . " </span> \n " ;
$body .= " </td> \n " ;
// Prezzo unitario
$body .= " <td class='table_cell' align='center'> \n " ;
$netto = $rs2 [ $i ][ 'prezzo_vendita' ];
$netto = $netto + $netto / 100 * $rs2 [ $i ][ 'prc_guadagno' ];
$iva = $netto / 100 * $rs2 [ $i ][ 'prciva_vendita' ];
2019-04-13 02:56:39 +02:00
$body .= '<span>' . moneyFormat ( $netto ) . " </span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Prezzo di vendita
$body .= " <td class='table_cell' align='center'> \n " ;
2019-04-13 02:56:39 +02:00
$body .= '<span><span>' . moneyFormat ( $netto * $qta ) . " </span></span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n " ;
$totale_articoli += $netto * $qta ;
}
// Totale spesa articoli
$body .= " <tr><td colspan= \" 3 \" align= \" right \" > \n " ;
$body .= " <b>TOTALE MATERIALE UTILIZZATO:</b> \n " ;
$body .= " </td> \n " ;
$body .= " <td align= \" center \" bgcolor= \" #dddddd \" > \n " ;
2019-04-13 02:56:39 +02:00
$body .= '<b>' . moneyFormat ( $totale_articoli ) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n " ;
$body .= " </table><br/> \n " ;
}
// Conteggio spese aggiuntive
2019-05-23 16:27:00 +02:00
$query = 'SELECT *, (SELECT codice FROM in_interventi WHERE in_interventi.id = in_righe_interventi.idintervento ) AS codice, (SELECT orario_inizio FROM in_interventi_tecnici WHERE idintervento=in_righe_interventi.idintervento GROUP BY idintervento HAVING idintervento=in_righe_interventi.idintervento ORDER BY orario_inizio) AS data_intervento FROM in_righe_interventi WHERE idintervento IN(' . implode ( ',' , $idinterventi ) . ') ORDER BY id ASC' ;
2017-08-04 16:28:16 +02:00
$rs2 = $dbo -> fetchArray ( $query );
if ( sizeof ( $rs2 ) > 0 ) {
$body .= " <table style= \" width:100%; \" class= \" table_values \" cellspacing= \" 2 \" cellpadding= \" 5 \" style= \" border-color:#aaa; \" > \n " ;
$body .= " <col width= \" 335 \" ><col width= \" 50 \" ><col width= \" 142 \" ><col width= \" 142 \" > \n " ;
$body .= " <thead> \n " ;
$body .= " <tr><th align='center' colspan='4'><b>Spese aggiuntive</b></th></tr> \n " ;
$body .= " <tr><th> \n " ;
$body .= " <b>Descrizione</b> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" > \n " ;
$body .= " <b>Q.tà</b> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" > \n " ;
$body .= " <b>Prezzo unitario</b> \n " ;
$body .= " </th> \n " ;
$body .= " <th align= \" center \" > \n " ;
$body .= " <b>Subtot</b> \n " ;
$body .= " </th></tr> \n " ;
$body .= " </thead> \n " ;
$totale_spese = 0.00 ;
for ( $i = 0 ; $i < sizeof ( $rs2 ); ++ $i ) {
// Articolo
$body .= " <tr><td class='first_cell'> \n " ;
$body .= '<span>' . $rs2 [ $i ][ 'descrizione' ] . " </span><br/> \n " ;
2019-05-23 16:27:00 +02:00
$body .= '<span><small style="color:#777;">Intervento ' . $rs2 [ $i ][ 'codice' ] . ' del ' . Translator :: dateToLocale ( $rs2 [ $i ][ 'data_intervento' ]) . " </small></span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Quantità
$qta = $rs2 [ $i ][ 'qta' ];
$body .= " <td class='table_cell' align='center'> \n " ;
2017-09-21 10:01:07 +02:00
$body .= '<span>' . Translator :: numberToLocale ( $rs2 [ $i ][ 'qta' ]) . " </span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Prezzo unitario
$body .= " <td class='table_cell' align='center'> \n " ;
2019-02-02 10:52:15 +01:00
$netto = $rs2 [ $i ][ 'prezzo_vendita' ];
2019-04-13 02:56:39 +02:00
$body .= '<span>' . moneyFormat ( $netto ) . " </span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td> \n " ;
// Prezzo di vendita
$body .= " <td class='table_cell' align='center'> \n " ;
2019-04-13 02:56:39 +02:00
$body .= '<span>' . moneyFormat ( $netto * $qta ) . " </span> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n " ;
$totale_spese += $netto * $qta ;
}
// Totale spese aggiuntive
$body .= " <tr><td colspan= \" 3 \" align= \" right \" > \n " ;
$body .= " <b>ALTRE SPESE:</b> \n " ;
$body .= " </td> \n " ;
$body .= " <td align= \" center \" bgcolor= \" #dddddd \" > \n " ;
2019-04-13 02:56:39 +02:00
$body .= '<b>' . moneyFormat ( $totale_spese ) . " </b> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </td></tr> \n " ;
$body .= " </table><br/> \n " ;
}
// Totale complessivo intervento
$body .= " <p align= \" right \" > \n " ;
2019-04-13 02:56:39 +02:00
$body .= '<big><b>TOTALE INTERVENTI: ' . moneyFormat ( $totale_intervento_scontato + $totale_articoli + $totale_spese ) . " </b></big> \n " ;
2017-08-04 16:28:16 +02:00
$body .= " </p> \n " ;
2018-09-27 10:15:04 +02:00
$report_name = 'riepilogo_interventi.pdf' ;