openstamanager/modules/tecnici_tariffe/edit.php

117 lines
4.7 KiB
PHP
Raw Normal View History

<?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/>.
*/
include_once __DIR__.'/../../core.php';
2024-03-08 13:10:32 +01:00
use Modules\TipiIntervento\Tipo;
2019-07-08 12:24:59 +02:00
echo '
<form action="" method="post" id="edit-form">
<input type="hidden" name="op" value="update">
2019-07-08 12:24:59 +02:00
<input type="hidden" name="backto" value="record-edit">
2020-09-07 15:04:06 +02:00
2019-07-08 12:24:59 +02:00
<div class="box box-info collapsable" style="'.((strtolower($record['colore']) == '#ffffff' or empty($record['colore'])) ? '' : 'border-color: '.$record['colore']).'">
<div class="box-header with-border">
2019-07-08 12:24:59 +02:00
<h3 class="box-title"><i class="fa fa-user"></i> '.$record['ragione_sociale'].'</h3>
<div class="box-tools pull-right">
2019-07-08 12:24:59 +02:00
'.Modules::link('Anagrafiche', $record['idanagrafica']).'
</div>
</div>
<div class="box-body">
2020-09-07 15:04:06 +02:00
<table class="table table-striped table-condensed">
<tr>
<th>'.tr('Attività').'</th>
2020-09-07 15:04:06 +02:00
2019-07-08 12:24:59 +02:00
<th>
'.tr('Addebito orario').'
<span class="tip" title="'.tr('Addebito al cliente').'"><i class="fa fa-question-circle-o"></i></span>
</th>
<th>
'.tr('Addebito km').'
<span class="tip" title="'.tr('Addebito al cliente').'"><i class="fa fa-question-circle-o"></i></span>
</th>
<th>
'.tr('Addebito diritto ch.').'
<span class="tip" title="'.tr('Addebito al cliente').'"><i class="fa fa-question-circle-o"></i></span>
</th>
<th>
'.tr('Costo orario').'
<span class="tip" title="'.tr('Costo interno').'"><i class="fa fa-question-circle-o"></i></span>
</th>
<th>
'.tr('Costo km').'
<span class="tip" title="'.tr('Costo interno').'"><i class="fa fa-question-circle-o"></i></span>
</th>
<th>
'.tr('Costo diritto ch.').'
<span class="tip" title="'.tr('Costo interno').'"><i class="fa fa-question-circle-o"></i></span>
</th>
2020-09-07 15:04:06 +02:00
<th width="40"></th>
</tr>';
2024-01-15 15:30:45 +01:00
// Tipi di interventi
foreach ($tipi_interventi as $tipo_intervento) {
2024-03-08 13:10:32 +01:00
$tipo = Tipo::find($tipo_intervento['id']);
2024-01-15 15:30:45 +01:00
echo '
<tr>
2020-09-07 15:04:06 +02:00
2024-03-08 13:10:32 +01:00
<td>'.$tipo->name.'</td>
<td>
2024-03-08 13:10:32 +01:00
{[ "type": "number", "name": "costo_ore['.$tipo->id.']", "required": 1, "value": "'.$tipo->costo_ore.'", "icon-after": "<i class=\'fa fa-euro\'></i>" ]}
</td>
<td>
2024-03-08 13:10:32 +01:00
{[ "type": "number", "name": "costo_km['.$tipo->id.']", "required": 1, "value": "'.$tipo->costo_km.'", "icon-after": "<i class=\'fa fa-euro\'></i>" ]}
</td>
<td>
2024-03-08 13:10:32 +01:00
{[ "type": "number", "name": "costo_dirittochiamata['.$tipo->id.']", "required": 1, "value": "'.$tipo->costo_dirittochiamata.'", "icon-after": "<i class=\'fa fa-euro\'></i>" ]}
</td>
<td>
2024-03-08 13:10:32 +01:00
{[ "type": "number", "name": "costo_ore_tecnico['.$tipo->id.']", "required": 1, "value": "'.$tipo->costo_ore_tecnico.'", "icon-after": "<i class=\'fa fa-euro\'></i>" ]}
</td>
<td>
2024-03-08 13:10:32 +01:00
{[ "type": "number", "name": "costo_km_tecnico['.$tipo->id.']", "required": 1, "value": "'.$tipo->costo_km_tecnico.'", "icon-after": "<i class=\'fa fa-euro\'></i>" ]}
</td>
<td>
2024-03-08 13:10:32 +01:00
{[ "type": "number", "name": "costo_dirittochiamata_tecnico['.$tipo->id.']", "required": 1, "value": "'.$tipo->costo_dirittochiamata_tecnico.'", "icon-after": "<i class=\'fa fa-euro\'></i>" ]}
</td>
2020-09-07 15:04:06 +02:00
<td>
2024-03-08 13:10:32 +01:00
<a class="btn btn-warning ask" data-backto="record-edit" data-method="post" data-op="import" data-idtipointervento="'.$tipo->id.'" data-msg="'.tr('Vuoi importare la tariffa standard?').'" data-button="'.tr('Importa').'" data-class="btn btn-lg btn-info">
<i class="fa fa-download"></i>
2019-07-08 12:24:59 +02:00
</a>
</td>
</tr>';
2024-01-15 15:30:45 +01:00
}
2019-07-08 12:24:59 +02:00
echo '
</table>
</div>
2019-07-08 12:24:59 +02:00
</div>';