2017-08-04 16:28:16 +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 />.
*/
2019-12-27 10:28:53 +01:00
2017-08-04 16:28:16 +02:00
include_once __DIR__ . '/../../core.php' ;
2024-03-06 10:56:09 +01:00
use Models\Module ;
2017-08-04 16:28:16 +02:00
$idconto = get ( 'id' );
2019-12-27 10:28:53 +01:00
$lvl = get ( 'lvl' );
// Info conto
2020-01-03 17:11:15 +01:00
if ( $lvl == 2 ) {
2019-12-27 10:28:53 +01:00
$query = 'SELECT *, idpianodeiconti1 AS idpianodeiconti FROM co_pianodeiconti2 WHERE id=' . prepare ( $idconto );
} else {
2020-08-11 17:41:16 +02:00
$query = 'SELECT *, idpianodeiconti2 AS idpianodeiconti, (SELECT dir FROM co_pianodeiconti2 WHERE co_pianodeiconti2.id=co_pianodeiconti3.idpianodeiconti2) AS dir FROM co_pianodeiconti3 WHERE id=' . prepare ( $idconto );
2019-12-27 10:28:53 +01:00
}
2017-08-04 16:28:16 +02:00
2019-12-27 10:28:53 +01:00
$info = $dbo -> fetchOne ( $query );
2024-03-06 10:56:09 +01:00
?>
2024-06-11 16:58:27 +02:00
< form action = " <?php echo base_path(); ?>/editor.php?id_module=<?php echo Module::where('name', 'Piano dei conti')->first()->id; ?> " method = " post " >
2017-08-04 16:28:16 +02:00
< input type = " hidden " name = " op " value = " edit " >
< input type = " hidden " name = " backto " value = " record-list " >
2019-12-27 10:28:53 +01:00
< input type = " hidden " name = " lvl " value = " <?php echo $lvl ; ?> " >
< input type = " hidden " name = " idpianodeiconti " value = " <?php echo $info['idpianodeiconti'] ; ?> " >
< input type = " hidden " name = " idconto " value = " <?php echo $info['id'] ; ?> " >
2017-08-04 16:28:16 +02:00
< div class = " row " >
2020-08-11 17:41:16 +02:00
< div class = " col-md-4 " >
2019-12-27 10:28:53 +01:00
{[ " type " : " text " , " label " : " <?php echo tr('Numero'); ?> " , " name " : " numero " , " required " : 1 , " class " : " text-center " , " value " : " <?php echo $info['numero'] ; ?> " , " extra " : " maxlength= \" 6 \" " ]}
2017-08-04 16:28:16 +02:00
</ div >
2020-08-11 17:41:16 +02:00
< div class = " col-md-8 " >
{[ " type " : " text " , " label " : " <?php echo tr('Descrizione'); ?> " , " name " : " descrizione " , " required " : 1 , " value " : < ? php echo json_encode ( $info [ 'descrizione' ]); ?> ]}
2020-08-05 17:58:54 +02:00
</ div >
</ div >
< div class = " row " >
2021-07-29 11:29:35 +02:00
< div class = " col-md-4 <?php echo intval( $lvl != 3) ? 'hidden' : ''; ?> " >
2024-03-06 10:56:09 +01:00
{[ " type " : " number " , " decimals " : 0 , " label " : " <?php echo tr('Percentuale deducibile'); ?> " , " name " : " percentuale_deducibile " , " value " : " <?php echo $info['percentuale_deducibile'] ; ?> " , " icon-after " : " <i class= " fa fa - percent " ></i> " , " max-value " : " 100 " , " min-value " : " 0 " ]}
2020-08-11 17:41:16 +02:00
</ div >
2020-08-12 13:30:34 +02:00
< div class = " col-md-4 <?php echo intval( $lvl != 2) ? 'hidden' : ''; ?> " >
2021-07-14 17:22:25 +02:00
{[ " type " : " select " , " label " : " <?php echo tr('Utilizza come'); ?> " , " name " : " dir " , " value " : " <?php echo $info['dir'] ; ?> " , " values " : " list= \" entrata \" : \" Ricavo \" , \" uscita \" : \" Costo \" , \" entrata/uscita \" : \" Ricavo e Costo \" , \" \" : \" Non usare \" " ]}
2017-08-04 16:28:16 +02:00
</ div >
</ div >
< br >
2024-05-16 18:02:50 +02:00
< div class = " float-right d-none d-sm-inline " >
2019-12-27 10:28:53 +01:00
< button type = " submit " class = " btn btn-primary " >
< i class = " fa fa-edit " ></ i > < ? php echo tr ( 'Modifica' ); ?>
</ button >
2017-08-04 16:28:16 +02:00
</ div >
< div class = " clearfix " ></ div >
</ form >
2020-08-05 17:58:54 +02:00
< script > $ ( document ) . ready ( init ) </ script >