2017-09-12 17:46:19 +02:00
< ? php
include_once __DIR__ . '/../../core.php' ;
2018-02-09 15:27:43 +01:00
$module_name = 'Ordini' ;
2017-09-12 17:46:19 +02:00
// Lettura info fattura
2017-09-21 15:51:39 +02:00
$records = $dbo -> fetchArray ( 'SELECT *, (SELECT descrizione FROM or_tipiordine WHERE or_tipiordine.id=idtipoordine) AS tipo_doc, (SELECT descrizione FROM co_pagamenti WHERE id=idpagamento) AS tipo_pagamento FROM or_ordini WHERE id=' . prepare ( $id_record ));
2017-09-12 17:46:19 +02:00
$id_cliente = $records [ 0 ][ 'idanagrafica' ];
$id_sede = $records [ 0 ][ 'idsede' ];
$numero_ord = $records [ 0 ][ 'numero' ];
2018-02-18 19:53:23 +01:00
$numero = ! empty ( $records [ 0 ][ 'numero_esterno' ]) ? $records [ 0 ][ 'numero_esterno' ] : $records [ 0 ][ 'numero' ];
2017-09-12 17:46:19 +02:00
// Sostituzioni specifiche
$custom = [
2017-09-18 18:50:37 +02:00
'tipo_doc' => Stringy\Stringy :: create ( $records [ 0 ][ 'tipo_doc' ]) -> toUpperCase (),
2019-07-10 11:53:35 +02:00
'numero' => $numero ,
2017-09-12 17:46:19 +02:00
'data' => Translator :: dateToLocale ( $records [ 0 ][ 'data' ]),
'pagamento' => $records [ 0 ][ 'tipo_pagamento' ],
];