2020-07-06 13:32:43 +02:00
< ? php
2020-09-07 15:04:06 +02:00
/*
* OpenSTAManager : il software gestionale open source per l ' assistenza tecnica e la fatturazione
2021-01-20 15:08:51 +01:00
* Copyright ( C ) DevCode s . r . l .
2020-09-07 15:04:06 +02:00
*
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < https :// www . gnu . org / licenses />.
*/
2020-07-06 13:32:43 +02:00
use Modules\Anagrafiche\Anagrafica ;
use Modules\Articoli\Articolo ;
2021-07-27 18:11:54 +02:00
use Plugins\ListinoFornitori\DettaglioFornitore ;
2020-07-06 13:32:43 +02:00
include_once __DIR__ . '/../../core.php' ;
$id_articolo = get ( 'id_articolo' );
$articolo = Articolo :: find ( $id_articolo );
$id_anagrafica = get ( 'id_anagrafica' );
$anagrafica = Anagrafica :: find ( $id_anagrafica );
$id_riga = get ( 'id_riga' );
$fornitore = [];
if ( ! empty ( $id_riga )) {
2020-08-25 17:38:10 +02:00
$fornitore = DettaglioFornitore :: find ( $id_riga );
2020-07-06 13:32:43 +02:00
} else {
$fornitore = $articolo -> dettaglioFornitore ( $id_anagrafica );
}
echo '
2021-10-26 10:18:32 +02:00
< p > '.tr(' Informazioni relative al fornitore : _NAME_ ' , [
'_NAME_' => '<b>' . $anagrafica -> ragione_sociale . '</b>' ,
]) . ' </ p >
2020-07-06 13:32:43 +02:00
< form action = " " method = " post " >
< input type = " hidden " name = " backto " value = " record-edit " >
< input type = " hidden " name = " op " value = " update_fornitore " >
< input type = " hidden " name = " id_plugin " value = " '. $id_plugin .' " >
< input type = " hidden " name = " id_riga " value = " '. $id_riga .' " >
< input type = " hidden " name = " id_anagrafica " value = " '. $id_anagrafica .' " >
< input type = " hidden " name = " id_articolo " value = " '. $id_articolo .' " >
< div class = " row " >
2022-02-16 16:29:13 +01:00
< div class = " col-md-6 " >
2020-07-06 13:32:43 +02:00
{[ " type " : " text " , " label " : " '.tr('Codice fornitore').' " , " name " : " codice_fornitore " , " required " : 1 , " value " : " '. $fornitore['codice_fornitore'] .' " ]}
</ div >
2022-02-16 16:29:13 +01:00
< div class = " col-md-6 " >
{[ " type " : " text " , " label " : " '.tr('Barcode').' " , " name " : " barcode_fornitore " , " value " : " '. $fornitore['barcode_fornitore'] .' " ]}
</ div >
2020-07-06 13:32:43 +02:00
</ div >
< div class = " row " >
< div class = " col-md-12 " >
2021-08-31 14:15:03 +02:00
{[ " type " : " textarea " , " label " : " '.tr('Descrizione').' " , " name " : " descrizione " , " required " : 1 , " value " : '.json_encode($fornitore[' descrizione ']).' ]}
2020-07-06 13:32:43 +02:00
</ div >
</ div >
< div class = " row " >
2020-09-16 15:57:49 +02:00
< div class = " col-md-6 " >
2020-07-06 13:32:43 +02:00
{[ " type " : " number " , " label " : " '.tr('Qta minima ordinabile').' " , " name " : " qta_minima " , " required " : 0 , " value " : " '. $fornitore['qta_minima'] .' " , " icon-after " : " '. $articolo->um .' " ]}
</ div >
2020-09-16 15:57:49 +02:00
< div class = " col-md-6 " >
2020-07-06 13:32:43 +02:00
{[ " type " : " text " , " label " : " '.tr('Tempi di consegna').' " , " name " : " giorni_consegna " , " class " : " text-right " , " required " : 0 , " value " : " '. $fornitore['giorni_consegna'] .' " , " icon-after " : " '.tr('gg').' " ]}
</ div >
</ div >
< div class = " clearfix " ></ div >
< div class = " row " >
< div class = " col-md-12 " >
< button class = " btn btn-primary pull-right " >
< i class = " fa fa-edit " ></ i > '.tr(' Modifica ').'
</ button >
</ div >
</ div >
</ form >
2021-07-30 16:33:23 +02:00
< script >
$ ( document ) . ready ( init );
content_was_modified = false ;
</ script > ' ;