mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 11:30:55 +01:00
Stile del codice
This commit is contained in:
parent
defd5a7358
commit
d8c9670d11
@ -27,7 +27,7 @@ use Modules\Emails\Template;
|
||||
use Notifications\EmailNotification;
|
||||
|
||||
if (empty($structure) || empty($structure['enabled'])) {
|
||||
die(tr('Accesso negato'));
|
||||
exit(tr('Accesso negato'));
|
||||
}
|
||||
|
||||
$upload_dir = base_dir().'/'.Uploads::getDirectory($id_module, $id_plugin);
|
||||
|
@ -75,7 +75,7 @@ if (!empty($options['create_document'])) {
|
||||
$id_segment = $_SESSION['module_'.$final_module['id']]['id_segment'];
|
||||
|
||||
$stato_predefinito = $database->fetchOne("SELECT id FROM co_statidocumento WHERE descrizione = 'Bozza'");
|
||||
|
||||
|
||||
echo '
|
||||
<input type="hidden" name="reversed" value="'.$options['reversed'].'">
|
||||
<div class="col-md-6">
|
||||
|
13
index.php
13
index.php
@ -31,20 +31,19 @@ switch ($op) {
|
||||
if ($dbo->isConnected() && $dbo->isInstalled() && auth()->attempt($username, $password)) {
|
||||
$_SESSION['keep_alive'] = true;
|
||||
|
||||
if (intval(setting('Inizio periodo calendario'))){
|
||||
if (intval(setting('Inizio periodo calendario'))) {
|
||||
$_SESSION['period_start'] = setting('Inizio periodo calendario');
|
||||
}else{
|
||||
} else {
|
||||
$_SESSION['period_start'] = date('Y').'-01-01';
|
||||
}
|
||||
|
||||
if (intval(setting('Fine periodo calendario'))){
|
||||
if (intval(setting('Fine periodo calendario'))) {
|
||||
$_SESSION['period_end'] = setting('Fine periodo calendario');
|
||||
}else{
|
||||
} else {
|
||||
$_SESSION['period_end'] = date('Y').'-12-31';
|
||||
}
|
||||
|
||||
|
||||
// Rimozione log vecchi
|
||||
// Rimozione log vecchi
|
||||
//$dbo->query('DELETE FROM `zz_operations` WHERE DATE_ADD(`created_at`, INTERVAL 30*24*60*60 SECOND) <= NOW()');
|
||||
} else {
|
||||
$status = auth()->getCurrentStatus();
|
||||
@ -157,7 +156,7 @@ echo '
|
||||
if (isset($username)) {
|
||||
echo ' value="'.$username.'"';
|
||||
}
|
||||
echo' required>
|
||||
echo ' required>
|
||||
</div>
|
||||
|
||||
{[ "type": "password", "name": "password", "autocomplete": "current-password", "placeholder": "'.tr('Password').'", "icon-before": "<i class=\"fa fa-lock\"></i>" ]}
|
||||
|
@ -127,10 +127,10 @@ if (!empty($results)) {
|
||||
<tbody>';
|
||||
|
||||
foreach ($errors as $name => $diff) {
|
||||
if(count($diff) == 1 && array_key_exists('type',$diff) && str_contains($diff['type']['expected'] , $diff['type']['current'])){
|
||||
$class="info";
|
||||
}else{
|
||||
$class="warning";
|
||||
if (count($diff) == 1 && array_key_exists('type', $diff) && str_contains($diff['type']['expected'], $diff['type']['current'])) {
|
||||
$class = 'info';
|
||||
} else {
|
||||
$class = 'warning';
|
||||
}
|
||||
echo '
|
||||
<tr class="bg-'.$class.'" >
|
||||
@ -161,11 +161,10 @@ if (!empty($results)) {
|
||||
<tbody>';
|
||||
|
||||
foreach ($foreign_keys as $name => $diff) {
|
||||
|
||||
if(count($diff) == 2 && array_key_exists('current',$diff) && $diff['current'] == null ){
|
||||
$class="info";
|
||||
}else{
|
||||
$class="warning";
|
||||
if (count($diff) == 2 && array_key_exists('current', $diff) && $diff['current'] == null) {
|
||||
$class = 'info';
|
||||
} else {
|
||||
$class = 'warning';
|
||||
}
|
||||
echo '
|
||||
<tr class="bg-'.$class.'" >
|
||||
|
@ -230,16 +230,16 @@ function search(button) {
|
||||
</div>
|
||||
<div class="box-body" id="update-search">';
|
||||
if (extension_loaded('curl')) {
|
||||
echo' <button type="button" class="btn btn-info btn-block" onclick="search(this)">
|
||||
echo ' <button type="button" class="btn btn-info btn-block" onclick="search(this)">
|
||||
<i class="fa fa-search"></i> '.tr('Ricerca').'
|
||||
</button>';
|
||||
} else {
|
||||
echo' <button type="button" class="btn btn-warning btn-block disabled" >
|
||||
echo ' <button type="button" class="btn btn-warning btn-block disabled" >
|
||||
<i class="fa fa-warning"></i> '.tr('Estensione curl non supportata').'.
|
||||
</button>';
|
||||
}
|
||||
|
||||
echo' </div>
|
||||
echo ' </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
@ -37,7 +37,7 @@ function customStructure()
|
||||
$files = glob(base_dir().'/'.$dir.'/*/custom/*.{php,html}', GLOB_BRACE);
|
||||
$recursive_files = glob(base_dir().'/'.$dir.'/*/custom/**/*.{php,html}', GLOB_BRACE);
|
||||
|
||||
$files = array_merge($files, $recursive_files);
|
||||
$files = array_merge($files, $recursive_files);
|
||||
|
||||
foreach ($files as $file) {
|
||||
$file = str_replace(base_dir().'/', '', $file);
|
||||
@ -53,7 +53,7 @@ function customStructure()
|
||||
$files = glob(base_dir().'/include/custom/*.{php,html}', GLOB_BRACE);
|
||||
$recursive_files = glob(base_dir().'/include/custom/**/*.{php,html}', GLOB_BRACE);
|
||||
|
||||
$files = array_merge($files, $recursive_files);
|
||||
$files = array_merge($files, $recursive_files);
|
||||
|
||||
foreach ($files as $file) {
|
||||
$file = str_replace(base_dir().'/', '', $file);
|
||||
|
@ -22,7 +22,7 @@ include_once __DIR__.'/../../core.php';
|
||||
use Util\Zip;
|
||||
|
||||
if (!setting('Attiva aggiornamenti')) {
|
||||
die(tr('Accesso negato'));
|
||||
exit(tr('Accesso negato'));
|
||||
}
|
||||
|
||||
if (!extension_loaded('zip')) {
|
||||
|
@ -343,7 +343,7 @@ switch ($resource) {
|
||||
}
|
||||
|
||||
$where[] = '( '.prepare($superselect['data']).' BETWEEN data_inizio AND data_fine)';
|
||||
|
||||
|
||||
//$where[] = 'data_inizio < NOW()';
|
||||
//$where[] = 'data_fine > NOW()';
|
||||
if (empty($filter)) {
|
||||
|
@ -58,7 +58,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
||||
}
|
||||
|
||||
if (in_array($id_fornitore, $tipi_anagrafica)) {
|
||||
echo '<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine fornitore').'" data-href="add.php?id_module='.Modules::get('Ordini fornitore')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o fa-flip-horizontal"></i>'.tr('Nuovo ordine fornitore').'
|
||||
echo '<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine fornitore').'" data-href="add.php?id_module='.Modules::get('Ordini fornitore')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o fa-flip-horizontal"></i>'.tr('Nuovo ordine fornitore').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ddt entrata').'" data-href="add.php?id_module='.Modules::get('Ddt di acquisto')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-truck fa-flip-horizontal"></i>'.tr('Nuovo ddt in entrata').'
|
||||
|
@ -50,20 +50,19 @@ if (!$is_cliente) {
|
||||
|
||||
$nazione_anagrafica = $anagrafica->sedeLegale->nazione;
|
||||
|
||||
|
||||
// Avvisi problemi scheda anagrafica
|
||||
$problemi_anagrafica = [];
|
||||
if ($is_cliente && empty($record['idconto_cliente'])){
|
||||
if ($is_cliente && empty($record['idconto_cliente'])) {
|
||||
array_push($problemi_anagrafica, ' Piano dei conti mancante per il cliente');
|
||||
}
|
||||
|
||||
if ($is_fornitore && empty($record['idconto_fornitore'])){
|
||||
if ($is_fornitore && empty($record['idconto_fornitore'])) {
|
||||
array_push($problemi_anagrafica, ' Piano dei conti mancante per il fornitore');
|
||||
}
|
||||
|
||||
if (sizeof($problemi_anagrafica) > 0) {
|
||||
echo '<div class="alert alert-warning"><i class="fa fa-warning"></i> '.tr("Attenzione: _CAMPI_" , [
|
||||
'_CAMPI_' => implode(', ', $problemi_anagrafica)
|
||||
echo '<div class="alert alert-warning"><i class="fa fa-warning"></i> '.tr('Attenzione: _CAMPI_', [
|
||||
'_CAMPI_' => implode(', ', $problemi_anagrafica),
|
||||
]).'</div>';
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ switch ($name) {
|
||||
}
|
||||
}
|
||||
|
||||
if($value == $anagrafica->partita_iva){
|
||||
if ($value == $anagrafica->partita_iva) {
|
||||
$partita_iva = !empty($anagrafica) && is_numeric($value) ? $anagrafica->nazione->iso2.$value : $value;
|
||||
$result = $disponibile;
|
||||
$check = Validate::isValidVatNumber($partita_iva);
|
||||
@ -129,7 +129,7 @@ switch ($name) {
|
||||
])->count() == 0;
|
||||
$result = $disponibile;
|
||||
|
||||
$message = $disponibile ? tr("Questa email non è ancora stata utilizzata") : tr("L'email è già utilizzata in un'altra anagrafica");
|
||||
$message = $disponibile ? tr('Questa email non è ancora stata utilizzata') : tr("L'email è già utilizzata in un'altra anagrafica");
|
||||
|
||||
$errors = [];
|
||||
$check = Validate::isValidEmail($value);
|
||||
|
@ -18,12 +18,12 @@
|
||||
*/
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
use Modules\Articoli\Articolo;
|
||||
use Modules\Preventivi\Preventivo;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Preventivi\Components\Articolo as ArticoloPreventivo;
|
||||
use Modules\TipiIntervento\Tipo as TipoSessione;
|
||||
use Modules;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Articoli\Articolo;
|
||||
use Modules\Preventivi\Components\Articolo as ArticoloPreventivo;
|
||||
use Modules\Preventivi\Preventivo;
|
||||
use Modules\TipiIntervento\Tipo as TipoSessione;
|
||||
use Prints;
|
||||
|
||||
switch (post('op')) {
|
||||
@ -59,12 +59,12 @@ switch (post('op')) {
|
||||
flash()->info(tr('Articoli eliminati!'));
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'stampa-etichette':
|
||||
$_SESSION['superselect']['id_articolo_barcode'] = $id_records;
|
||||
$id_print = Prints::getPrints()['Barcode'];
|
||||
|
||||
redirect( base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('barcode', '!=', '' )->first()->id );
|
||||
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('barcode', '!=', '')->first()->id);
|
||||
exit();
|
||||
|
||||
break;
|
||||
@ -74,8 +74,8 @@ switch (post('op')) {
|
||||
$data = post('data');
|
||||
$qta = post('qta');
|
||||
$n_articoli = 0;
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
$articolo = Articolo::find($id);
|
||||
$qta_movimento = $qta - $articolo->qta;
|
||||
$articolo->movimenta($qta_movimento, $descrizione, $data, true);
|
||||
@ -104,8 +104,8 @@ switch (post('op')) {
|
||||
|
||||
$preventivo = Preventivo::build($anagrafica, $tipo, $nome, $data, 0);
|
||||
$id_preventivo = $preventivo->id;
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
$originale = Articolo::find($id);
|
||||
$articolo = ArticoloPreventivo::build($preventivo, $originale);
|
||||
$articolo->qta = 1;
|
||||
@ -129,7 +129,7 @@ switch (post('op')) {
|
||||
}
|
||||
|
||||
$database->commitTransaction();
|
||||
redirect( base_path().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo);
|
||||
redirect(base_path().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo);
|
||||
exit();
|
||||
|
||||
break;
|
||||
|
@ -58,7 +58,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$documenti = $dbo->fetchNum('SELECT id FROM dt_ddt WHERE idaspettobeni='.prepare($id_record).'
|
||||
UNION SELECT id FROM co_documenti WHERE idaspettobeni='.prepare($id_record));
|
||||
|
||||
|
@ -51,17 +51,17 @@ if (!isset($id_original)) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 1, "value": "$nome$" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 1, "value": "$nome$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"7\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"7\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Nota'); ?>", "name": "nota", "value": "$nota$" ]}
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Nota'); ?>", "name": "nota", "value": "$nota$" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -31,17 +31,17 @@ if (isset($id_record)) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 1, "value": "$nome$" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 1, "value": "$nome$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"7\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"7\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Nota'); ?>", "name": "nota", "value": "$nota$" ]}
|
||||
{[ "type": "textarea", "label": "<?php echo tr('Nota'); ?>", "name": "nota", "value": "$nota$" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -79,7 +79,6 @@ switch (filter('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$documenti = $dbo->fetchNum('SELECT id FROM dt_ddt WHERE idcausalet='.prepare($id_record).'
|
||||
UNION SELECT id FROM co_documenti WHERE idcausalet='.prepare($id_record));
|
||||
|
||||
|
@ -108,7 +108,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'update_rinnovo':
|
||||
|
||||
$contratto->rinnovabile = post('rinnovabile');
|
||||
$contratto->rinnovo_automatico = post('rinnovo_automatico');
|
||||
$contratto->giorni_preavviso_rinnovo = post('giorni_preavviso_rinnovo');
|
||||
@ -315,7 +314,6 @@ $riga = $contratto->getRiga($type, $id_riga);
|
||||
|
||||
// eliminazione contratto
|
||||
case 'delete':
|
||||
|
||||
// Fatture o interventi collegati a questo contratto
|
||||
$elementi = $dbo->fetchArray('SELECT 0 AS `codice`, `co_documenti`.`id` AS `id`, `co_documenti`.`numero` AS `numero`, `co_documenti`.`numero_esterno` AS `numero_esterno`, `co_documenti`.`data`, `co_tipidocumento`.`descrizione` AS `tipo_documento`, `co_tipidocumento`.`dir` AS `dir` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_documenti`.`id` IN (SELECT `iddocumento` FROM `co_righe_documenti` WHERE `idcontratto` = '.prepare($id_record).')'.'
|
||||
UNION
|
||||
@ -414,7 +412,6 @@ $riga = $contratto->getRiga($type, $id_riga);
|
||||
break;
|
||||
|
||||
case 'import':
|
||||
|
||||
$rs = $dbo->fetchArray('SELECT * FROM co_contratti_tipiintervento WHERE idcontratto = '.prepare(post('idcontratto')).' AND idtipointervento='.prepare(post('idtipointervento')));
|
||||
|
||||
// Se la riga in_tipiintervento esiste, la aggiorno...
|
||||
|
@ -49,7 +49,7 @@ echo '
|
||||
</div>';
|
||||
|
||||
// Duplica contratto
|
||||
echo'
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary" onclick="if( confirm(\''.tr('Duplicare questo contratto?').'\') ){ $(\'#copia-contratto\').submit(); }">
|
||||
<i class="fa fa-copy"></i> '.tr('Duplica contratto').'
|
||||
</button>';
|
||||
|
@ -207,7 +207,6 @@ class Contratto extends Document
|
||||
$intervallo = CarbonInterval::make($this->validita.' '.$this->tipo_validita);
|
||||
$data = Carbon::make($this->data_accettazione)->add($intervallo);
|
||||
$this->data_conclusione = $data->subDays(1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,6 @@ foreach ($moduli as $module_id => $note) {
|
||||
</tr>';
|
||||
|
||||
foreach ($note as $nota) {
|
||||
|
||||
$class = (strtotime($nota->notification_date) < strtotime(date('Y-m-d')) && !empty($nota->notification_date)) ? 'danger' : '';
|
||||
|
||||
echo '
|
||||
|
@ -63,7 +63,7 @@ switch (post('op')) {
|
||||
$idpagamento = post('idpagamento');
|
||||
$numero_esterno = post('numero_esterno');
|
||||
$id_anagrafica = post('idanagrafica');
|
||||
|
||||
|
||||
if ($dir == 'uscita') {
|
||||
$idrivalsainps = post('id_rivalsa_inps');
|
||||
$idritenutaacconto = post('id_ritenuta_acconto');
|
||||
@ -73,7 +73,7 @@ switch (post('op')) {
|
||||
$idritenutaacconto = 0;
|
||||
$bollo = 0;
|
||||
}
|
||||
|
||||
|
||||
$tipo_sconto = post('tipo_sconto_generico');
|
||||
$sconto = post('sconto_generico');
|
||||
|
||||
|
@ -140,7 +140,7 @@ switch (post('op')) {
|
||||
|
||||
$n_ddt = 0;
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
foreach ($id_records as $id) {
|
||||
$ddt = DDT::find($id);
|
||||
$ddt->idstatoddt = $id_stato;
|
||||
$ddt->save();
|
||||
|
@ -23,6 +23,6 @@ echo '
|
||||
<div class="tip" data-toggle="tooltip" title="'.tr("Il ddt è fatturabile solo se non si trova negli stati _STATE_LIST_ e la relativa causale è abilitata all'importazione in altri documenti", [
|
||||
'_STATE_LIST_' => 'Evaso, Parzialmente evaso, Parzialmente fatturato',
|
||||
]).'">
|
||||
<button class="btn btn-info '.($ddt->isImportabile() ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea ').($ddt->reversed ? 'nota di credito' : ($dir == 'entrata' ? 'fattura di vendita' : 'fattura di acquisto')).'"><i class="fa fa-magic"></i> '.tr('Crea ').($ddt->reversed ? 'nota di credito' : ($dir == 'entrata' ? 'fattura di vendita' : 'fattura di acquisto')).'
|
||||
<button class="btn btn-info '.($ddt->isImportabile() ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea ').($ddt->reversed ? 'nota di credito' : ($dir == 'entrata' ? 'fattura di vendita' : 'fattura di acquisto')).'"><i class="fa fa-magic"></i> '.tr('Crea ').($ddt->reversed ? 'nota di credito' : ($dir == 'entrata' ? 'fattura di vendita' : 'fattura di acquisto')).'
|
||||
</button>
|
||||
</div>';
|
||||
|
@ -20,19 +20,19 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Modules\DDT\DDT;
|
||||
use Modules\Fatture\Fattura;
|
||||
|
||||
$documento = DDT::find($id_record);
|
||||
|
||||
$module = Modules::get($id_module);
|
||||
if($documento->reversed){
|
||||
if($module['name'] == 'Ddt di vendita'){
|
||||
if ($documento->reversed) {
|
||||
if ($module['name'] == 'Ddt di vendita') {
|
||||
$final_module = 'Fatture di acquisto';
|
||||
$dir = 'uscita';
|
||||
} else {
|
||||
$final_module = 'Fatture di vendita';
|
||||
$dir = 'entrata';
|
||||
}
|
||||
} elseif($module['name'] == 'Ddt di vendita'){
|
||||
} elseif ($module['name'] == 'Ddt di vendita') {
|
||||
$final_module = 'Fatture di vendita';
|
||||
$dir = 'entrata';
|
||||
} else {
|
||||
@ -53,4 +53,4 @@ $options = [
|
||||
'reversed' => $documento->reversed,
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
|
@ -322,7 +322,7 @@ if (!$block_edit) {
|
||||
$ordini_query = 'SELECT COUNT(*) AS tot FROM or_ordini WHERE idanagrafica='.prepare($record['idanagrafica']).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Accettato\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).') AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0)';
|
||||
$ordini = $dbo->fetchArray($ordini_query)[0]['tot'];
|
||||
|
||||
if($dir == 'entrata'){
|
||||
if ($dir == 'entrata') {
|
||||
$ddt_query = 'SELECT COUNT(*) AS tot FROM dt_ddt WHERE idstatoddt IN (SELECT id FROM dt_statiddt WHERE descrizione IN(\'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoddt=(SELECT id FROM or_tipiordine WHERE dir="uscita") AND dt_ddt.id IN (SELECT idddt FROM dt_righe_ddt WHERE dt_righe_ddt.idddt = dt_ddt.id AND (qta - qta_evasa) > 0)';
|
||||
$ddt = $dbo->fetchArray($ddt_query)[0]['tot'];
|
||||
echo '
|
||||
@ -330,7 +330,7 @@ if (!$block_edit) {
|
||||
<i class="fa fa-plus"></i> '.tr('Ddt').'
|
||||
</a>';
|
||||
}
|
||||
|
||||
|
||||
echo '
|
||||
<a class="btn btn-sm btn-primary'.(!empty($ordini) ? '' : ' disabled').'" data-href="'.base_path().'/modules/ddt/add_ordine.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="Aggiungi ordine">
|
||||
<i class="fa fa-plus"></i> '.tr('Ordine').'
|
||||
|
@ -64,7 +64,7 @@ if (!$record['predefined']) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<?php $records[0]['icon'] = (empty($records[0]['icon'])) ? 'fa fa-envelope' : $records[0]['icon']; ?>
|
||||
<?php $records[0]['icon'] = (empty($records[0]['icon'])) ? 'fa fa-envelope' : $records[0]['icon']; ?>
|
||||
{[ "type": "text", "label": "<?php echo tr('Icona'); ?>", "name": "icon", "value": "<?php echo $records[0]['icon']; ?>" ,"help":"<?php echo tr('Es. \'fa fa-envelope\''); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -126,7 +126,7 @@ switch (post('op')) {
|
||||
}
|
||||
|
||||
// Operazioni sul bollo
|
||||
if($dir == 'entrata'){
|
||||
if ($dir == 'entrata') {
|
||||
$fattura->addebita_bollo = post('addebita_bollo');
|
||||
$bollo_automatico = post('bollo_automatico');
|
||||
if (empty($bollo_automatico)) {
|
||||
@ -315,7 +315,7 @@ switch (post('op')) {
|
||||
//}
|
||||
|
||||
// In fase di duplicazione di una fattura non deve essere calcolato il numero progressivo ma questo deve
|
||||
// essere generato in fase di emissione della stessa.
|
||||
// essere generato in fase di emissione della stessa.
|
||||
$new->numero_esterno = '';
|
||||
|
||||
$new->codice_stato_fe = null;
|
||||
@ -702,8 +702,8 @@ switch (post('op')) {
|
||||
// Creazione della fattura al volo
|
||||
if (post('create_document') == 'on') {
|
||||
$descrizione = ($documento->direzione == 'entrata') ? 'Fattura immediata di vendita' : 'Fattura immediata di acquisto';
|
||||
|
||||
if($reversed){
|
||||
|
||||
if ($reversed) {
|
||||
$tipo = Tipo::where('descrizione', 'Nota di credito')->where('dir', '!=', $documento->direzione)->first();
|
||||
} else {
|
||||
$tipo = Tipo::where('descrizione', $descrizione)->first();
|
||||
@ -730,7 +730,7 @@ switch (post('op')) {
|
||||
foreach ($righe as $riga) {
|
||||
if (post('evadere')[$riga->id] == 'on') {
|
||||
$qta = post('qta_da_evadere')[$riga->id];
|
||||
if($reversed){
|
||||
if ($reversed) {
|
||||
$qta = -$qta;
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,6 @@ $idtipodocumento = $dbo->selectOne('co_tipidocumento', ['id'], [
|
||||
'dir' => $dir,
|
||||
])['id'];
|
||||
|
||||
|
||||
?>
|
||||
<form action="" method="post" id="add-form">
|
||||
<input type="hidden" name="op" value="add">
|
||||
|
@ -141,5 +141,4 @@ switch ($resource) {
|
||||
$results = array_merge($ordini, $ddt);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
@ -235,9 +235,9 @@ switch (post('op')) {
|
||||
$new->id_segment = $id_segment;
|
||||
$new->numero = Fattura::getNextNumero($data, $dir, $id_segment);
|
||||
//if (!empty($fattura->numero_esterno)) {
|
||||
//$new->numero_esterno = Fattura::getNextNumeroSecondario($data, $dir, $id_segment);
|
||||
//$new->numero_esterno = Fattura::getNextNumeroSecondario($data, $dir, $id_segment);
|
||||
//}
|
||||
|
||||
|
||||
$new->numero_esterno = '';
|
||||
|
||||
$new->codice_stato_fe = null;
|
||||
|
@ -220,7 +220,7 @@ elseif ($record['stato'] == 'Bozza') {
|
||||
</div>';
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Agente di riferimento').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente_fattura$" ]}
|
||||
</div>';
|
||||
@ -316,7 +316,7 @@ elseif ($record['stato'] == 'Bozza') {
|
||||
<strike>';
|
||||
}
|
||||
|
||||
echo(empty($scadenza->da_pagare) ? '<i class="fa fa-exclamation-triangle"></i>' : '').moneyFormat($scadenza->da_pagare);
|
||||
echo (empty($scadenza->da_pagare) ? '<i class="fa fa-exclamation-triangle"></i>' : '').moneyFormat($scadenza->da_pagare);
|
||||
|
||||
if ($pagamento_iniziato) {
|
||||
echo '
|
||||
@ -362,7 +362,7 @@ elseif ($record['stato'] == 'Bozza') {
|
||||
if ($dir == 'uscita') {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
{[ "type": "checkbox", "label": "'.tr("Ritenuta pagata dal fornitore").'", "name": "is_ritenuta_pagata", "value": "$is_ritenuta_pagata$" ]}
|
||||
{[ "type": "checkbox", "label": "'.tr('Ritenuta pagata dal fornitore').'", "name": "is_ritenuta_pagata", "value": "$is_ritenuta_pagata$" ]}
|
||||
</div>';
|
||||
}
|
||||
if ($dir == 'entrata') {
|
||||
|
@ -519,7 +519,7 @@ function verifica_numero(Fattura $fattura)
|
||||
'YEAR(data) = '.prepare(date('Y', strtotime($data))),
|
||||
'id_segment = '.prepare($id_segment),
|
||||
], $data);
|
||||
|
||||
|
||||
do {
|
||||
$numero = Generator::generate($maschera, $ultimo, 1, Generator::dateToPattern($data));
|
||||
|
||||
|
@ -168,7 +168,7 @@ class Fattura extends Document
|
||||
$id_banca_azienda = $azienda->{'idbanca_'.$conto};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$model->id_banca_azienda = $id_banca_azienda;
|
||||
|
||||
// Gestione dello Split Payment sulla base dell'anagrafica Controparte
|
||||
|
@ -134,7 +134,6 @@ switch ($op) {
|
||||
|
||||
// Duplica impianto
|
||||
case 'copy':
|
||||
|
||||
$dbo->query('CREATE TEMPORARY TABLE tmp SELECT * FROM my_impianti WHERE id= '.prepare($id_record));
|
||||
$dbo->query('ALTER TABLE tmp DROP id');
|
||||
$dbo->query('INSERT INTO my_impianti SELECT NULL,tmp. * FROM tmp');
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
echo'
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary" onclick="if( confirm(\'Duplicare questo impianto?\') ){ $(\'#copia-impianto\').submit(); }"> <i class="fa fa-copy"></i> '.tr('Duplica impianto').'</button>';
|
||||
|
||||
// Duplica impianto
|
||||
|
@ -79,36 +79,35 @@ switch (post('op')) {
|
||||
if (!empty($stato['notifica']) && $stato['idstatointervento'] != $record['idstatointervento']) {
|
||||
$template = Template::find($stato['id_email']);
|
||||
|
||||
if(!empty($stato['destinatari'])){
|
||||
if (!empty($stato['destinatari'])) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $id_record);
|
||||
$mail->addReceiver($stato['destinatari']);
|
||||
$mail->save();
|
||||
}
|
||||
|
||||
if(!empty($stato['notifica_cliente'])){
|
||||
if (!empty($stato['notifica_cliente'])) {
|
||||
$mail_cliente = $dbo->selectOne('an_anagrafiche', '*', ['idanagrafica' => post('idanagrafica')]);
|
||||
if(!empty($mail_cliente['email'])){
|
||||
if (!empty($mail_cliente['email'])) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $id_record);
|
||||
$mail->addReceiver($mail_cliente['email']);
|
||||
$mail->save();
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($stato['notifica_tecnici'])){
|
||||
if (!empty($stato['notifica_tecnici'])) {
|
||||
$tecnici_intervento = $dbo->select('in_interventi_tecnici', 'idtecnico', ['idintervento' => $id_record]);
|
||||
$tecnici_assegnati = $dbo->select('in_interventi_tecnici_assegnati', 'id_tecnico AS idtecnico', ['id_intervento' => $id_record]);
|
||||
$tecnici = array_unique(array_merge($tecnici_intervento, $tecnici_assegnati), SORT_REGULAR);
|
||||
|
||||
foreach($tecnici as $tecnico){
|
||||
foreach ($tecnici as $tecnico) {
|
||||
$mail_tecnico = $dbo->selectOne('an_anagrafiche', '*', ['idanagrafica' => $tecnico]);
|
||||
if(!empty($mail_tecnico['email'])){
|
||||
if (!empty($mail_tecnico['email'])) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $id_record);
|
||||
$mail->addReceiver($mail_tecnico['email']);
|
||||
$mail->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
aggiorna_sedi_movimenti('interventi', $id_record);
|
||||
flash()->info(tr('Attività modificata correttamente!'));
|
||||
|
@ -142,7 +142,7 @@ switch (post('op')) {
|
||||
foreach ($id_records as $id) {
|
||||
$intervento = Intervento::find($id);
|
||||
|
||||
if ( !$intervento->stato->is_completato || ($intervento->stato->is_completato==$stato->is_completato) ) {
|
||||
if (!$intervento->stato->is_completato || ($intervento->stato->is_completato == $stato->is_completato)) {
|
||||
$intervento->stato()->associate($stato);
|
||||
$intervento->save();
|
||||
|
||||
|
@ -32,7 +32,7 @@ if (empty($record['firma_file'])) {
|
||||
}
|
||||
|
||||
// Duplica intervento
|
||||
echo'
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary " onclick="duplicaIntervento()">
|
||||
<i class="fa fa-copy"></i> '.tr('Duplica attività').'
|
||||
</button>
|
||||
|
@ -85,7 +85,7 @@ echo '
|
||||
{[ "type": "number", "label": "'.tr('Sconto km').'", "name": "sconto_km", "value": "'.$sessione['scontokm_unitario'].'", "icon-after": "choice|untprc|'.$sessione['tipo_sconto_km'].'"]}
|
||||
</div>';
|
||||
|
||||
echo'
|
||||
echo '
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -101,7 +101,7 @@ echo '
|
||||
{[ "type": "number", "label": "'.tr('Addebito diritto ch.').'", "name": "prezzo_dirittochiamata", "value": "'.$sessione['prezzo_dirittochiamata'].'" ]}
|
||||
</div>';
|
||||
|
||||
echo'
|
||||
echo '
|
||||
</div>';
|
||||
|
||||
echo '
|
||||
|
@ -66,7 +66,6 @@ switch (filter('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$righe = $dbo->fetchNum('SELECT id FROM co_righe_documenti WHERE um='.prepare($record['valore']).'
|
||||
UNION SELECT id FROM dt_righe_ddt WHERE um='.prepare($record['valore']).'
|
||||
UNION SELECT id FROM or_righe_ordini WHERE um='.prepare($record['valore']).'
|
||||
|
@ -31,7 +31,7 @@ switch (post('op')) {
|
||||
$avere = post('avere')[$i];
|
||||
|
||||
if (!empty($idconto)) {
|
||||
if(!empty($dare)){
|
||||
if (!empty($dare)) {
|
||||
$totale = $dare;
|
||||
} else {
|
||||
$totale = -$avere;
|
||||
@ -59,7 +59,7 @@ switch (post('op')) {
|
||||
$avere = post('avere')[$i];
|
||||
|
||||
if (!empty($idconto)) {
|
||||
if(!empty($dare)){
|
||||
if (!empty($dare)) {
|
||||
$totale = $dare;
|
||||
} else {
|
||||
$totale = -$avere;
|
||||
|
@ -59,11 +59,11 @@ include_once __DIR__.'/../../core.php';
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
{[ "type": "number", "name": "dare['.$i.']", "id": "dare'.$id.'", "value": "'.($rs[$i]['totale']>0 ? $rs[$i]['totale'] : '').'"]}
|
||||
{[ "type": "number", "name": "dare['.$i.']", "id": "dare'.$id.'", "value": "'.($rs[$i]['totale'] > 0 ? $rs[$i]['totale'] : '').'"]}
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
{[ "type": "number", "name": "avere['.$i.']", "id": "avere'.$id.'", "value": "'.($rs[$i]['totale']<0 ? abs($rs[$i]['totale']) : '').'"]}
|
||||
{[ "type": "number", "name": "avere['.$i.']", "id": "avere'.$id.'", "value": "'.($rs[$i]['totale'] < 0 ? abs($rs[$i]['totale']) : '').'"]}
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
@ -78,11 +78,11 @@ for ($i = 0; $i < 10; ++$i) {
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
{[ "type": "number", "name": "dare['.$i.']", "id": "dare'.$id.'", "value": "'.($rs[$i]['totale']>0 ? $rs[$i]['totale'] : '').'"]}
|
||||
{[ "type": "number", "name": "dare['.$i.']", "id": "dare'.$id.'", "value": "'.($rs[$i]['totale'] > 0 ? $rs[$i]['totale'] : '').'"]}
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
{[ "type": "number", "name": "avere['.$i.']", "id": "avere'.$id.'", "value": "'.($rs[$i]['totale']<0 ? abs($rs[$i]['totale']) : '').'"]}
|
||||
{[ "type": "number", "name": "avere['.$i.']", "id": "avere'.$id.'", "value": "'.($rs[$i]['totale'] < 0 ? abs($rs[$i]['totale']) : '').'"]}
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
@ -19,14 +19,13 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Modules\Ordini\Ordine;
|
||||
use Modules\Fatture\Fattura;
|
||||
use Modules\Fatture\Stato;
|
||||
use Modules\Fatture\Tipo;
|
||||
use Modules\Ordini\Ordine;
|
||||
|
||||
$module_fatture = 'Fatture di vendita';
|
||||
|
||||
|
||||
// Segmenti
|
||||
$id_fatture = Modules::get($module_fatture)['id'];
|
||||
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
|
||||
@ -118,7 +117,7 @@ switch (post('op')) {
|
||||
|
||||
$n_ordini = 0;
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
foreach ($id_records as $id) {
|
||||
$ordine = Ordine::find($id);
|
||||
$ordine->idstatoordine = $id_stato;
|
||||
$ordine->save();
|
||||
@ -137,7 +136,7 @@ switch (post('op')) {
|
||||
break;
|
||||
}
|
||||
if ($module['name'] == 'Ordini cliente') {
|
||||
$operations['crea_fattura'] = [
|
||||
$operations['crea_fattura'] = [
|
||||
'text' => '<span><i class="fa fa-file-code-o"></i> '.tr('Fattura _TYPE_', ['_TYPE_' => strtolower($module['name'])]),
|
||||
'data' => [
|
||||
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module['name'])]),
|
||||
@ -148,7 +147,7 @@ $operations['crea_fattura'] = [
|
||||
'blank' => false,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$operations['cambia_stato'] = [
|
||||
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Cambia stato'),
|
||||
@ -161,4 +160,5 @@ $operations['cambia_stato'] = [
|
||||
'blank' => false,
|
||||
],
|
||||
];
|
||||
return $operations;
|
||||
|
||||
return $operations;
|
||||
|
@ -36,25 +36,20 @@ echo '
|
||||
</a>
|
||||
</li>';
|
||||
|
||||
|
||||
if ($dir == 'entrata'){
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<li>
|
||||
<a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ordine_fornitore" data-toggle="modal" data-title="'.tr('Crea ordine fornitore').'">
|
||||
<i class="fa fa-file-o"></i> '.tr('Ordine fornitore').'
|
||||
</a>
|
||||
</li>';
|
||||
|
||||
}else{
|
||||
|
||||
} else {
|
||||
/*echo '
|
||||
<li>
|
||||
<a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ordine_cliente" data-toggle="modal" data-title="'.tr('Crea ordine cliente').'">
|
||||
<i class="fa fa-file-o"></i> '.tr('Ordine cliente').'
|
||||
</a>
|
||||
</li>';*/
|
||||
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -202,11 +202,11 @@ echo '
|
||||
if (!$block_edit) {
|
||||
echo '
|
||||
<div class="pull-left">';
|
||||
|
||||
|
||||
$prev_query = 'SELECT COUNT(*) AS tot FROM co_preventivi WHERE idanagrafica='.prepare($record['idanagrafica']).' AND idstato IN(SELECT id FROM co_statipreventivi WHERE is_fatturabile = 1) AND default_revision=1 AND co_preventivi.id IN (SELECT idpreventivo FROM co_righe_preventivi WHERE co_righe_preventivi.idpreventivo = co_preventivi.id AND (qta - qta_evasa) > 0)';
|
||||
$preventivi = $dbo->fetchArray($prev_query)[0]['tot'];
|
||||
if($dir=='entrata'){
|
||||
echo '
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="tip">
|
||||
<a class="btn btn-sm btn-primary '.(!empty($preventivi) ? '' : ' disabled').'" data-href="'.base_path().'/modules/ordini/add_preventivo.php?id_module='.$id_module.'&id_record='.$id_record.'" data-title="'.tr('Aggiungi preventivo').'" data-toggle="tooltip">
|
||||
<i class="fa fa-plus"></i> '.tr('Preventivo').'
|
||||
|
@ -72,12 +72,11 @@ foreach ($righe as $riga) {
|
||||
$numero_riferimenti_collegati = $riga->referenceSources()->count();
|
||||
$riferimenti_presenti = $numero_riferimenti_riga;
|
||||
$testo_aggiuntivo = $riferimenti_presenti ? $numero_riferimenti_riga : '';
|
||||
|
||||
|
||||
echo '
|
||||
<button type="button" class="btn btn-xs btn-'.($riferimenti_presenti ? 'primary' : 'info').' pull-right text-right" onclick="apriRiferimenti(this)">
|
||||
<i class="fa fa-chevron-right"></i> '.tr('Riferimenti').' '.$testo_aggiuntivo.'
|
||||
</button>';
|
||||
|
||||
|
||||
// Aggiunta dei riferimenti ai documenti
|
||||
if ($riga->hasOriginalComponent()) {
|
||||
|
@ -85,11 +85,11 @@ foreach ($primo_livello as $conto_primo) {
|
||||
<tr>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th style="width: 10%" class="text-center">'.tr('Importo').'</th>';
|
||||
if($conto_primo['descrizione']=='Economico'){
|
||||
echo '
|
||||
if ($conto_primo['descrizione'] == 'Economico') {
|
||||
echo '
|
||||
<th style="width: 10%" class="text-center">'.tr('Importo reddito').'</th>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@ -125,7 +125,7 @@ foreach ($primo_livello as $conto_primo) {
|
||||
$totale_conto = -$totale_conto;
|
||||
$totale_reddito = -$totale_reddito;
|
||||
}
|
||||
|
||||
|
||||
$totale_conto2 += $totale_conto;
|
||||
$totale_reddito2 += $totale_reddito;
|
||||
|
||||
@ -178,7 +178,7 @@ foreach ($primo_livello as $conto_primo) {
|
||||
</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</span>';
|
||||
|
||||
// Span con info del conto
|
||||
@ -192,13 +192,13 @@ foreach ($primo_livello as $conto_primo) {
|
||||
<td class="text-right">
|
||||
'.moneyFormat($totale_conto, 2).'
|
||||
</td>';
|
||||
if($conto_primo['descrizione']=='Economico'){
|
||||
echo '
|
||||
if ($conto_primo['descrizione'] == 'Economico') {
|
||||
echo '
|
||||
<td class="text-right">
|
||||
'.moneyFormat($totale_reddito, 2).'
|
||||
</td>';
|
||||
}
|
||||
echo '
|
||||
}
|
||||
echo '
|
||||
</tr>';
|
||||
}
|
||||
|
||||
@ -209,10 +209,10 @@ foreach ($primo_livello as $conto_primo) {
|
||||
<tr>
|
||||
<th class="text-right">'.tr('Totale').'</th>
|
||||
<th class="text-right">'.moneyFormat($totale_conto2).'</th>';
|
||||
if($conto_primo['descrizione']=='Economico'){
|
||||
echo '<th class="text-right">'.moneyFormat($totale_reddito2).'</th>';
|
||||
}
|
||||
echo '
|
||||
if ($conto_primo['descrizione'] == 'Economico') {
|
||||
echo '<th class="text-right">'.moneyFormat($totale_reddito2).'</th>';
|
||||
}
|
||||
echo '
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>';
|
||||
@ -240,8 +240,8 @@ foreach ($primo_livello as $conto_primo) {
|
||||
}
|
||||
}
|
||||
|
||||
$totale_conto2=0;
|
||||
$totale_reddito2=0;
|
||||
$totale_conto2 = 0;
|
||||
$totale_reddito2 = 0;
|
||||
}
|
||||
|
||||
echo '
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
echo'
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary" onclick="if( confirm(\'Duplicare questo preventivo?\') ){ $(\'#copia-preventivo\').submit(); }">
|
||||
<i class="fa fa-copy"></i> '.tr('Duplica preventivo').'
|
||||
</button>';
|
||||
|
@ -68,7 +68,6 @@ switch (filter('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$righe = $dbo->fetchNum('SELECT idanagrafica FROM an_anagrafiche WHERE idrelazione='.prepare($id_record));
|
||||
|
||||
if (isset($id_record) && empty($righe)) {
|
||||
|
@ -46,33 +46,33 @@ switch (post('op')) {
|
||||
|
||||
$pagato = floatval($pagato);
|
||||
$da_pagare = floatval($da_pagare);
|
||||
|
||||
if(!empty($iddocumento)){
|
||||
|
||||
if (!empty($iddocumento)) {
|
||||
$id_tipo = $dbo->selectOne('co_documenti', 'idtipodocumento', ['id' => $iddocumento])['idtipodocumento'];
|
||||
$tipo_documento = $dbo->selectOne('co_tipidocumento', '*', ['id' => $id_tipo]);
|
||||
|
||||
if($tipo_documento['dir'] == 'uscita'){
|
||||
if($pagato > 0){
|
||||
if ($tipo_documento['dir'] == 'uscita') {
|
||||
if ($pagato > 0) {
|
||||
$pagato = -$pagato;
|
||||
}
|
||||
if($da_pagare > 0){
|
||||
if ($da_pagare > 0) {
|
||||
$da_pagare = -$da_pagare;
|
||||
}
|
||||
} else{
|
||||
if($pagato < 0){
|
||||
} else {
|
||||
if ($pagato < 0) {
|
||||
$pagato = -$pagato;
|
||||
}
|
||||
if($da_pagare < 0){
|
||||
if ($da_pagare < 0) {
|
||||
$da_pagare = -$da_pagare;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($tipo_documento['reversed'])){
|
||||
if (!empty($tipo_documento['reversed'])) {
|
||||
$pagato = -$pagato;
|
||||
$da_pagare = -$da_pagare;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$totale_pagato = sum($totale_pagato, $pagato);
|
||||
|
||||
$id_scadenza = post('id_scadenza')[$id];
|
||||
|
@ -205,11 +205,11 @@ if (!empty($documento)) {
|
||||
|
||||
<?php
|
||||
if (empty($documento)) {
|
||||
echo '
|
||||
echo '
|
||||
<a class="btn btn-danger ask" data-backto="record-list">
|
||||
<i class="fa fa-trash"></i> '.tr('Elimina').'
|
||||
</a>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
<table class="hide">
|
||||
|
@ -32,12 +32,12 @@ echo '
|
||||
<div class="row">';
|
||||
|
||||
if ($nome_stampa != 'Liquidazione IVA') {
|
||||
echo'
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_sezionale", "required": "1", "values": "query=SELECT id AS id, name AS descrizione FROM zz_segments WHERE id_module = (SELECT id FROM zz_modules WHERE name = \''.(($dir == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto').'\') AND is_fiscale = 1 UNION SELECT 0 AS id, \'Tutti i sezionali\' AS descrizione" ]}
|
||||
</div>';
|
||||
}
|
||||
echo'
|
||||
echo '
|
||||
<div class="col-md-4">
|
||||
{[ "type": "date", "label": "'.tr('Data inizio').'", "required": "1", "name": "date_start", "value": "'.Translator::dateToLocale($_SESSION['period_start']).'" ]}
|
||||
</div>
|
||||
|
@ -34,7 +34,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
|
||||
$descrizione = post('descrizione');
|
||||
$icona = post('icona');
|
||||
$is_completato = post('is_completato') ?: null;
|
||||
@ -54,7 +53,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
//scelgo se settare come eliminato o cancellare direttamente la riga se non è stato utilizzato nei contratti
|
||||
if (count($dbo->fetchArray('SELECT id FROM co_contratti WHERE idstato='.prepare($id_record))) > 0) {
|
||||
$query = 'UPDATE co_staticontratti SET deleted_at = NOW() WHERE can_delete = 1 AND id='.prepare($id_record);
|
||||
|
@ -58,7 +58,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
//scelgo se settare come eliminato o cancellare direttamente la riga se non è stato utilizzato negli interventi
|
||||
if (count($dbo->fetchArray('SELECT id FROM in_interventi WHERE idstatointervento='.prepare($id_record))) > 0) {
|
||||
$query = 'UPDATE in_statiintervento SET deleted_at = NOW() WHERE idstatointervento='.prepare($id_record).' AND `can_delete`=1';
|
||||
|
@ -35,7 +35,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
|
||||
$descrizione = post('descrizione');
|
||||
$icona = post('icona');
|
||||
$is_completato = post('is_completato') ?: null;
|
||||
@ -55,7 +54,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
//scelgo se settare come eliminato o cancellare direttamente la riga se non è stato utilizzato nei preventivi
|
||||
if (count($dbo->fetchArray('SELECT id FROM co_preventivi WHERE idstato='.prepare($id_record))) > 0) {
|
||||
$query = 'UPDATE co_statipreventivi SET deleted_at = NOW() WHERE can_delete = 1 AND id='.prepare($id_record);
|
||||
|
@ -332,7 +332,6 @@ $(document).ready(function() {
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
// Interventi per tecnico
|
||||
$tecnici = $dbo->fetchArray("SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale, colore FROM an_anagrafiche
|
||||
INNER JOIN
|
||||
@ -346,14 +345,13 @@ ORDER BY ragione_sociale ASC");
|
||||
|
||||
$dataset = '';
|
||||
foreach ($tecnici as $tecnico) {
|
||||
|
||||
$sessioni = $dbo->fetchArray('SELECT SUM(in_interventi_tecnici.ore) AS result, CONCAT(CAST(SUM(in_interventi_tecnici.ore) AS char(20)),\' ore\') AS ore_lavorate, YEAR(in_interventi_tecnici.orario_inizio) AS year, MONTH(in_interventi_tecnici.orario_inizio) AS month FROM in_interventi_tecnici INNER JOIN `in_interventi` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` LEFT JOIN `in_statiintervento` ON `in_interventi`.`idstatointervento`=`in_statiintervento`.`idstatointervento` WHERE in_interventi_tecnici.idtecnico = '.prepare($tecnico['id']).' AND in_interventi_tecnici.orario_inizio BETWEEN '.prepare($start).' AND '.prepare($end).' AND `in_statiintervento`.`is_completato` = 1 GROUP BY YEAR(in_interventi_tecnici.orario_inizio), MONTH(in_interventi_tecnici.orario_inizio) ORDER BY YEAR(in_interventi_tecnici.orario_inizio) ASC, MONTH(in_interventi_tecnici.orario_inizio) ASC');
|
||||
|
||||
|
||||
$sessioni = Stats::monthly($sessioni, $start, $end);
|
||||
|
||||
|
||||
//Colore tecnico
|
||||
$background = $tecnico['colore'];
|
||||
if (empty( $background ) || $background == '#FFFFFF' ){
|
||||
if (empty($background) || $background == '#FFFFFF') {
|
||||
//Random color
|
||||
$background = '#'.dechex(rand(256, 16777215));
|
||||
}
|
||||
@ -366,8 +364,6 @@ foreach ($tecnici as $tecnico) {
|
||||
],
|
||||
|
||||
},';
|
||||
|
||||
|
||||
}
|
||||
|
||||
echo '
|
||||
@ -437,4 +433,4 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
||||
|
@ -22,7 +22,6 @@ use Notifications\EmailNotification;
|
||||
|
||||
switch (post('op')) {
|
||||
case 'send':
|
||||
|
||||
$email = EmailNotification::build($mail);
|
||||
|
||||
// Invio mail
|
||||
|
@ -49,8 +49,7 @@ if (Services::isEnabled()) {
|
||||
// Informazioni su Services
|
||||
$servizi = Cache::pool('Informazioni su Services')->content;
|
||||
|
||||
if (!empty($servizi)){
|
||||
|
||||
if (!empty($servizi)) {
|
||||
// Elaborazione dei servizi in scadenza
|
||||
$limite_scadenze = (new Carbon())->addDays(60);
|
||||
$servizi_in_scadenza = [];
|
||||
@ -126,12 +125,9 @@ if (Services::isEnabled()) {
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
}else{
|
||||
|
||||
} else {
|
||||
echo '
|
||||
<div class="col-md-12 col-lg-6"><div class="alert alert-warning alert-dismissible" role="alert"><button class="close" type="button" data-dismiss="alert" aria-hidden="true"><span aria-hidden="true">×</span><span class="sr-only">'.tr('Chiudi').'</span></button><span><i class="fa fa-warning"></i> '.tr('Nessun servizio abilitato o "OSMCloud Services API Token" non valido').'.</span></div></div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@ switch (filter('op')) {
|
||||
|
||||
if (isset($descrizione) && isset($dir) && isset($codice_tipo_documento_fe)) {
|
||||
if ($dbo->fetchNum('SELECT * FROM `co_tipidocumento` WHERE `dir`='.prepare($dir).' AND `codice_tipo_documento_fe`='.prepare($codice_tipo_documento_fe).' AND `id`!='.prepare($id_record)) == 0) {
|
||||
|
||||
$predefined = post('predefined');
|
||||
if (!empty($predefined)) {
|
||||
$dbo->query('UPDATE co_tipidocumento SET predefined = 0 WHERE dir = '.prepare($dir));
|
||||
@ -87,7 +86,6 @@ switch (filter('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$documenti = $dbo->fetchNum('SELECT id FROM co_documenti WHERE idtipodocumento ='.prepare($id_record));
|
||||
|
||||
if (isset($id_record) && empty($documenti)) {
|
||||
@ -96,7 +94,6 @@ switch (filter('op')) {
|
||||
'_TYPE_' => 'tipo documento',
|
||||
]));
|
||||
} else {
|
||||
|
||||
$dbo->update('co_tipidocumento', [
|
||||
'deleted_at' => date(),
|
||||
'predefined' => 0,
|
||||
@ -107,9 +104,8 @@ switch (filter('op')) {
|
||||
'_TYPE_' => 'tipo documento',
|
||||
]));
|
||||
|
||||
|
||||
//flash()->error(tr('Sono presenti dei documenti collegati a questo tipo documento'));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,6 @@ switch (post('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
// Permetto eliminazione tipo intervento solo se questo non è utilizzado da nessun'altra parte a gestionale
|
||||
// UNION SELECT `in_tariffe`.`idtipointervento` FROM `in_tariffe` WHERE `in_tariffe`.`idtipointervento` = '.prepare($id_record).'
|
||||
// UNION SELECT `co_contratti_tipiintervento`.`idtipointervento` FROM `co_contratti_tipiintervento` WHERE `co_contratti_tipiintervento`.`idtipointervento` = '.prepare($id_record).'
|
||||
|
@ -99,7 +99,6 @@ switch (filter('op')) {
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$documenti = $dbo->fetchNum('SELECT id FROM co_scadenziario WHERE tipo = (SELECT nome FROM co_tipi_scadenze WHERE id = '.prepare($id_record).')');
|
||||
|
||||
if (isset($id_record) && empty($documenti)) {
|
||||
|
@ -118,7 +118,7 @@ $tipo_documento = $database->fetchOne('SELECT CONCAT("(", codice, ") ", descrizi
|
||||
// Gestione per fattura elettroniche senza pagamento definito
|
||||
$pagamenti = [];
|
||||
if (isset($fattura_body['DatiPagamento'])) {
|
||||
$pagamenti = $fattura_body['DatiPagamento'];
|
||||
$pagamenti = $fattura_body['DatiPagamento'];
|
||||
$pagamenti = isset($pagamenti[0]) ? $pagamenti : [$pagamenti];
|
||||
}
|
||||
|
||||
@ -282,11 +282,11 @@ echo '
|
||||
</div>';
|
||||
|
||||
$ritenuta = $dati_generali['DatiRitenuta'];
|
||||
|
||||
if(!empty($ritenuta)){
|
||||
|
||||
if (!empty($ritenuta)) {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
{[ "type": "checkbox", "label": "'.tr('Ritenuta pagata dal fornitore').'", "name": "is_ritenuta_pagata", "value": 0, "help": "'.tr("Attivare se la ritenuta è stata pagata dal fornitore").'" ]}
|
||||
{[ "type": "checkbox", "label": "'.tr('Ritenuta pagata dal fornitore').'", "name": "is_ritenuta_pagata", "value": 0, "help": "'.tr('Attivare se la ritenuta è stata pagata dal fornitore').'" ]}
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
@ -323,7 +323,7 @@ if (!empty($righe)) {
|
||||
$query .= ' AND codice_natura_fe = '.prepare($riga['Natura']);
|
||||
|
||||
// Fallback per natura iva mancante
|
||||
if( empty($dbo->fetchArray($query)) ){
|
||||
if (empty($dbo->fetchArray($query))) {
|
||||
$query = $start_query;
|
||||
}
|
||||
}
|
||||
|
@ -19,13 +19,12 @@
|
||||
|
||||
namespace Plugins\ImportFE;
|
||||
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\Articoli\Categoria;
|
||||
use Modules\Fatture\Components\Articolo;
|
||||
use Modules\Fatture\Components\Riga;
|
||||
use Modules\Fatture\Fattura;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Plugins\DettagliArticolo\DettaglioFornitore;
|
||||
use Plugins\DettagliArticolo\DettaglioPrezzo;
|
||||
use UnexpectedValueException;
|
||||
use Util\XML;
|
||||
|
@ -17,9 +17,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Modules\Contratti\Components\Riga;
|
||||
use Modules\Contratti\Components\Articolo;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\Contratti\Components\Articolo;
|
||||
use Modules\Contratti\Components\Riga;
|
||||
use Modules\Contratti\Contratto;
|
||||
use Modules\Fatture\Fattura;
|
||||
use Modules\Fatture\Tipo;
|
||||
@ -35,22 +35,22 @@ switch ($operazione) {
|
||||
case 'add':
|
||||
$contratto = Contratto::find($id_record);
|
||||
|
||||
if(post('scadenza')=='Mensile'){
|
||||
if (post('scadenza') == 'Mensile') {
|
||||
$timeing = '+1 month';
|
||||
}
|
||||
if(post('scadenza')=='Bimestrale'){
|
||||
if (post('scadenza') == 'Bimestrale') {
|
||||
$timeing = '+2 month';
|
||||
}
|
||||
if(post('scadenza')=='Trimestrale'){
|
||||
if (post('scadenza') == 'Trimestrale') {
|
||||
$timeing = '+3 month';
|
||||
}
|
||||
if(post('scadenza')=='Quadrimestrale'){
|
||||
if (post('scadenza') == 'Quadrimestrale') {
|
||||
$timeing = '+4 month';
|
||||
}
|
||||
if(post('scadenza')=='Semestrale'){
|
||||
if (post('scadenza') == 'Semestrale') {
|
||||
$timeing = '+6 month';
|
||||
}
|
||||
if(post('scadenza')=='Annuale'){
|
||||
if (post('scadenza') == 'Annuale') {
|
||||
$timeing = '+12 month';
|
||||
}
|
||||
|
||||
@ -61,14 +61,14 @@ switch ($operazione) {
|
||||
$date_pianificazioni = [];
|
||||
$pianificazioni = [];
|
||||
foreach ($selezioni as $key => $selezione) {
|
||||
if( $numero_fatture==0 && !empty(post('data_inizio')) ){
|
||||
if ($numero_fatture == 0 && !empty(post('data_inizio'))) {
|
||||
$date = new DateTime(post('data_inizio'));
|
||||
}else{
|
||||
} else {
|
||||
$date = new DateTime($periodi[$key]);
|
||||
|
||||
if(post('cadenza_fatturazione')=='Inizio'){
|
||||
|
||||
if (post('cadenza_fatturazione') == 'Inizio') {
|
||||
$date->modify('first day of this month');
|
||||
}elseif( post('cadenza_fatturazione')=='Giorno' && !empty(post('giorno_fisso')) ){
|
||||
} elseif (post('cadenza_fatturazione') == 'Giorno' && !empty(post('giorno_fisso'))) {
|
||||
$date->modify('last day of this month');
|
||||
$last_day = $date->format('d');
|
||||
$day = post('giorno_fisso') > $last_day ? $last_day : post('giorno_fisso');
|
||||
@ -95,32 +95,32 @@ switch ($operazione) {
|
||||
|
||||
// Creazione nuove righe
|
||||
$qta = post('qta');
|
||||
foreach($righe_contratto as $r){
|
||||
foreach ($righe_contratto as $r) {
|
||||
$qta_evasa = $r->qta_evasa;
|
||||
$data_scadenza = '';
|
||||
$inizio = $date_pianificazioni[0];
|
||||
$fine = date("Y-m-d", strtotime($inizio.' -1 days'));
|
||||
$fine = date("Y-m-d", strtotime($fine." ".$timeing));
|
||||
$fine = date('Y-m-d', strtotime($inizio.' -1 days'));
|
||||
$fine = date('Y-m-d', strtotime($fine.' '.$timeing));
|
||||
for ($rata = 1; $rata <= $numero_fatture; ++$rata) {
|
||||
if( $qta_evasa<$r->qta ){
|
||||
$qta_riga = ($qta[$r->id]<=($r->qta-$qta_evasa) ? $qta[$r->id] : ($r->qta-$qta_evasa) );
|
||||
if ($qta_evasa < $r->qta) {
|
||||
$qta_riga = ($qta[$r->id] <= ($r->qta - $qta_evasa) ? $qta[$r->id] : ($r->qta - $qta_evasa));
|
||||
$descrizione = post('descrizione')[$r->id];
|
||||
|
||||
$descrizione = variables($descrizione, $inizio, $fine)['descrizione'];
|
||||
|
||||
$inizio = $fine;
|
||||
$fine = date("Y-m-d", strtotime($timeing, strtotime($inizio)));
|
||||
$inizio = date("Y-m-d", strtotime($inizio.' +1 days'));
|
||||
$fine = date('Y-m-d', strtotime($timeing, strtotime($inizio)));
|
||||
$inizio = date('Y-m-d', strtotime($inizio.' +1 days'));
|
||||
|
||||
$prezzo_unitario = ($r->subtotale / $r->qta);
|
||||
|
||||
if( !empty($r->idarticolo) ){
|
||||
if (!empty($r->idarticolo)) {
|
||||
$articolo = ArticoloOriginale::find($r->idarticolo);
|
||||
$riga = Articolo::build($contratto, $articolo);
|
||||
}else{
|
||||
} else {
|
||||
$riga = Riga::build($contratto);
|
||||
}
|
||||
|
||||
|
||||
$riga->descrizione = $descrizione;
|
||||
$riga->setPrezzoUnitario($prezzo_unitario, $r->idiva);
|
||||
$riga->qta = $qta_riga;
|
||||
|
@ -106,7 +106,7 @@ $righe = $contratto->getRighe();
|
||||
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<p>'.tr("Puoi utilizzare le seguenti variabili nella descrizione delle righe").':</p>'.variables()['list'].'
|
||||
<p>'.tr('Puoi utilizzare le seguenti variabili nella descrizione delle righe').':</p>'.variables()['list'].'
|
||||
</div>';
|
||||
|
||||
foreach ($righe as $riga) {
|
||||
@ -131,9 +131,9 @@ foreach ($righe as $riga) {
|
||||
<div class="col-md-9">
|
||||
{[ "type": "textarea", "label": "'.tr('Descrizione').'", "name": "descrizione['.$riga->id.']", "value": "'.$descrizione.'" ]}
|
||||
|
||||
{[ "type": "number", "label": "'.tr('Q.tà per fattura').'", "class":"qta_fattura", "name": "qta['.$riga->id.']", "required": 1, "value": "1", "decimals": "qta", "min-value": "1", "icon-after":"'.tr('Su _TOT_',[
|
||||
'_TOT_' => Translator::numberToLocale( ($riga->qta-$riga->qta_evasa) ),
|
||||
]).'", "options":"'.str_replace('"','\"',$options).'" ]}
|
||||
{[ "type": "number", "label": "'.tr('Q.tà per fattura').'", "class":"qta_fattura", "name": "qta['.$riga->id.']", "required": 1, "value": "1", "decimals": "qta", "min-value": "1", "icon-after":"'.tr('Su _TOT_', [
|
||||
'_TOT_' => Translator::numberToLocale(($riga->qta - $riga->qta_evasa)),
|
||||
]).'", "options":"'.str_replace('"', '\"', $options).'" ]}
|
||||
</div>
|
||||
<div class="col-md-3" id="totali_'.$riga->id.'">
|
||||
</div>
|
||||
|
@ -24,22 +24,22 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
$contratto = Contratto::find($id_record);
|
||||
|
||||
if(get('scadenza')=='Mensile'){
|
||||
if (get('scadenza') == 'Mensile') {
|
||||
$timeing = '+1 month';
|
||||
}
|
||||
if(get('scadenza')=='Bimestrale'){
|
||||
if (get('scadenza') == 'Bimestrale') {
|
||||
$timeing = '+2 month';
|
||||
}
|
||||
if(get('scadenza')=='Trimestrale'){
|
||||
if (get('scadenza') == 'Trimestrale') {
|
||||
$timeing = '+3 month';
|
||||
}
|
||||
if(get('scadenza')=='Quadrimestrale'){
|
||||
if (get('scadenza') == 'Quadrimestrale') {
|
||||
$timeing = '+4 month';
|
||||
}
|
||||
if(get('scadenza')=='Semestrale'){
|
||||
if (get('scadenza') == 'Semestrale') {
|
||||
$timeing = '+6 month';
|
||||
}
|
||||
if(get('scadenza')=='Annuale'){
|
||||
if (get('scadenza') == 'Annuale') {
|
||||
$timeing = '+12 month';
|
||||
}
|
||||
|
||||
@ -54,13 +54,13 @@ echo '
|
||||
|
||||
while ($data_corrente->lessThanOrEqualTo($data_conclusione)) {
|
||||
$data = $data_corrente->endOfMonth()->format('Y-m-d');
|
||||
$data_fatturazione = ($data_fatturazione ?: date("Y-m", strtotime($data)) );
|
||||
$data_fatturazione = ($data_fatturazione ?: date('Y-m', strtotime($data)));
|
||||
unset($checked);
|
||||
|
||||
if( $id_module==Modules::get('Contratti')['id'] ){
|
||||
if( $data==date("Y-m-t", strtotime($timeing, strtotime($data_fatturazione)) ) ){
|
||||
if ($id_module == Modules::get('Contratti')['id']) {
|
||||
if ($data == date('Y-m-t', strtotime($timeing, strtotime($data_fatturazione)))) {
|
||||
$checked = 'checked';
|
||||
$data_fatturazione = date("Y-m", strtotime($data));
|
||||
$data_fatturazione = date('Y-m', strtotime($data));
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,4 +90,4 @@ echo '
|
||||
});
|
||||
$("#total_check").html("Rate: " + check).trigger("change");
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
||||
|
@ -33,7 +33,7 @@ $numero_rata = $contratto->pianificazioni->search(function ($item) use ($id_pian
|
||||
$module_fattura = Modules::get('Fatture di vendita');
|
||||
|
||||
$id_conto = setting('Conto predefinito fatture di vendita');
|
||||
$data = date("Y-m",strtotime($pianificazione->data_scadenza))."-".date("d",strtotime($contratto->data_accettazione));
|
||||
$data = date('Y-m', strtotime($pianificazione->data_scadenza)).'-'.date('d', strtotime($contratto->data_accettazione));
|
||||
|
||||
echo '
|
||||
<form action="" method="post">
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
function variables($descrizione='', $inizio=null, $fine=null)
|
||||
function variables($descrizione = '', $inizio = null, $fine = null)
|
||||
{
|
||||
$mese = [
|
||||
'01' => 'Gennaio',
|
||||
@ -19,19 +19,19 @@
|
||||
'12' => 'Dicembre',
|
||||
];
|
||||
|
||||
$result['list'] = "<ul>
|
||||
$result['list'] = '<ul>
|
||||
<li><code>{periodo}</code></li>
|
||||
<li><code>{data_inizio}</code></li>
|
||||
<li><code>{data_fine}</code></li>
|
||||
<li><code>{mese_fatturazione}</code></li>
|
||||
</ul>";
|
||||
</ul>';
|
||||
|
||||
if( !empty($descrizione) ){
|
||||
$result['descrizione'] = str_replace("{periodo}","durata dal ".Translator::dateToLocale($inizio)." al ".Translator::dateToLocale($fine),$descrizione);
|
||||
$result['descrizione'] = str_replace("{data_inizio}",Translator::dateToLocale($inizio), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace("{data_fine}",Translator::dateToLocale($fine), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace("{mese_fatturazione}", $mese[date('m',strtotime($inizio))], $result['descrizione']);
|
||||
}
|
||||
if (!empty($descrizione)) {
|
||||
$result['descrizione'] = str_replace('{periodo}', 'durata dal '.Translator::dateToLocale($inizio).' al '.Translator::dateToLocale($fine), $descrizione);
|
||||
$result['descrizione'] = str_replace('{data_inizio}', Translator::dateToLocale($inizio), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{data_fine}', Translator::dateToLocale($fine), $result['descrizione']);
|
||||
$result['descrizione'] = str_replace('{mese_fatturazione}', $mese[date('m', strtotime($inizio))], $result['descrizione']);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$pianificazioni = Pianificazione::doesntHave('fattura')
|
||||
->orderBy('data_scadenza', 'asc')
|
||||
->whereHas('contratto', function($q){
|
||||
$q->whereHas('stato', function($q){
|
||||
->whereHas('contratto', function ($q) {
|
||||
$q->whereHas('stato', function ($q) {
|
||||
$q->where('is_fatturabile', 1);
|
||||
});
|
||||
})
|
||||
|
@ -23,7 +23,6 @@ $operazione = filter('op');
|
||||
|
||||
switch ($operazione) {
|
||||
case 'edit_revision':
|
||||
|
||||
$master_revision = post('master_revision');
|
||||
$id_record = post('idrevisione');
|
||||
//Tolgo il flag default_revision da tutte le revisioni e dal record_principale
|
||||
@ -34,7 +33,6 @@ switch ($operazione) {
|
||||
break;
|
||||
|
||||
case 'delete_revision':
|
||||
|
||||
$idrevisione = post('idrevisione');
|
||||
$dbo->query('DELETE FROM co_preventivi WHERE id='.prepare($idrevisione));
|
||||
|
||||
|
@ -57,7 +57,7 @@ if ($statistiche != null) {
|
||||
<script src="'.$statistiche->fileurl('js/stats/widget.js').'"></script>';
|
||||
}
|
||||
|
||||
echo'
|
||||
echo '
|
||||
<script>
|
||||
var local_url = "'.str_replace('edit.php', '', $structure->fileurl('edit.php')).'";
|
||||
|
||||
|
@ -104,7 +104,7 @@ if ($statistiche != null) {
|
||||
<script src="'.$statistiche->fileurl('js/stats/table.js').'"></script>';
|
||||
}
|
||||
|
||||
echo'
|
||||
echo '
|
||||
|
||||
<script src="'.$structure->fileurl('js/prezzo.js').'"></script>
|
||||
|
||||
|
@ -109,7 +109,6 @@ class Clienti extends AppResource
|
||||
|
||||
public function createRecord($data)
|
||||
{
|
||||
|
||||
$ragione_sociale = $data['ragione_sociale'];
|
||||
$id_tipo = [1];
|
||||
|
||||
@ -133,7 +132,6 @@ class Clienti extends AppResource
|
||||
return [
|
||||
'id' => $id_record,
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
public function updateRecord($data)
|
||||
@ -163,5 +161,4 @@ class Clienti extends AppResource
|
||||
$record->cellulare = $data['cellulare'];
|
||||
$record->email = $data['email'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -216,14 +216,13 @@ class RigheInterventi extends AppResource
|
||||
$record->descrizione = $data['descrizione'];
|
||||
$record->um = $data['um'] ?: null;
|
||||
|
||||
if(empty($data['id_iva'])){
|
||||
if (empty($data['id_iva'])) {
|
||||
$data['id_iva'] = settings('Iva predefinita');
|
||||
}
|
||||
|
||||
//$record->costo_unitario = $data['costo_unitario'] ?: 0;
|
||||
$record->setPrezzoUnitario($data['prezzo_unitario'], $data['id_iva']);
|
||||
$record->setSconto($data['sconto_percentuale'] ?: $data['sconto_unitario'], $data['tipo_sconto']);
|
||||
|
||||
|
||||
try {
|
||||
$record->qta = $data['qta'];
|
||||
|
@ -127,9 +127,9 @@ abstract class Article extends Accounting
|
||||
|
||||
if ($document instanceof \Modules\Fatture\Fattura) {
|
||||
if ($document->isNota()) {
|
||||
if($this->getDirection()=='uscita'){
|
||||
if ($this->getDirection() == 'uscita') {
|
||||
$dir = 'entrata';
|
||||
} else{
|
||||
} else {
|
||||
$dir = 'uscita';
|
||||
}
|
||||
}
|
||||
|
@ -668,7 +668,7 @@ class Database extends Util\Singleton
|
||||
*/
|
||||
public function raw($value)
|
||||
{
|
||||
return$this->getCapsule()->getConnection()->raw($value);
|
||||
return $this->getCapsule()->getConnection()->raw($value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,7 +98,7 @@ class Permissions
|
||||
}
|
||||
|
||||
if (!$result && $die) {
|
||||
die(tr('Accesso negato'));
|
||||
exit(tr('Accesso negato'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,12 +39,13 @@ trait RecordTrait
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function customField($name) {
|
||||
public function customField($name)
|
||||
{
|
||||
$field = database()->table('zz_fields')
|
||||
->leftJoin('zz_field_record', 'zz_fields.id', '=', 'zz_field_record.id_field')
|
||||
->where('zz_fields.name','=', $name)
|
||||
->where('zz_fields.id_module','=', $this->getModule()->id)
|
||||
->where('zz_field_record.id_record','=', $this->id)
|
||||
->where('zz_fields.name', '=', $name)
|
||||
->where('zz_fields.id_module', '=', $this->getModule()->id)
|
||||
->where('zz_field_record.id_record', '=', $this->id)
|
||||
->first();
|
||||
|
||||
return $field->value;
|
||||
|
@ -488,8 +488,6 @@ class Update
|
||||
}
|
||||
}
|
||||
|
||||
$results;
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
@ -532,7 +530,7 @@ class Update
|
||||
return 'modules/'.$module.'/update/'.$version;
|
||||
}
|
||||
|
||||
return $update['directory'].'/update/'.$version;
|
||||
return $update['directory'].'/update/'.$version;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,10 +33,9 @@ echo '<style>
|
||||
}
|
||||
</style>';
|
||||
|
||||
|
||||
if (!empty($_SESSION['superselect']['id_articolo_barcode']) ){
|
||||
if (!empty($_SESSION['superselect']['id_articolo_barcode'])) {
|
||||
$articoli = Articolo::whereIn('id', $_SESSION['superselect']['id_articolo_barcode'])->get();
|
||||
unset( $_SESSION['superselect']['id_articolo_barcode'] );
|
||||
unset($_SESSION['superselect']['id_articolo_barcode']);
|
||||
} else {
|
||||
$articoli = Articolo::where('id', '=', $id_record)->get();
|
||||
}
|
||||
@ -44,17 +43,16 @@ if (!empty($_SESSION['superselect']['id_articolo_barcode']) ){
|
||||
$pages = count($articoli);
|
||||
$page = 0;
|
||||
|
||||
foreach( $articoli as $articolo ){
|
||||
foreach ($articoli as $articolo) {
|
||||
echo '
|
||||
<div class="barcode-cell">
|
||||
<barcode code="'.$articolo->barcode.'" type="C39" height="2" size="0.65" class="barcode" />
|
||||
<p><b>'.$articolo->barcode.'</b></p>
|
||||
</div>';
|
||||
|
||||
$page++;
|
||||
|
||||
if ( $page < $pages ) {
|
||||
++$page;
|
||||
|
||||
if ($page < $pages) {
|
||||
echo '<pagebreak>';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ echo '
|
||||
</thead>
|
||||
<tbody>';
|
||||
// Mostra le righe delle attività
|
||||
foreach($liv2_patrimoniale as $liv2_p){
|
||||
if($liv2_p['totale']>0){
|
||||
foreach ($liv2_patrimoniale as $liv2_p) {
|
||||
if ($liv2_p['totale'] > 0) {
|
||||
$totale_attivita += $liv2_p['totale'];
|
||||
echo '
|
||||
<tr>
|
||||
@ -48,27 +48,26 @@ echo '
|
||||
<td><b>'.$liv2_p['descrizione'].'</b></td>
|
||||
<td class="text-right"><b>'.numberFormat($liv2_p['totale']).'</b></td>
|
||||
</tr>';
|
||||
|
||||
foreach($liv3_patrimoniale as $liv3_p){
|
||||
|
||||
foreach ($liv3_patrimoniale as $liv3_p) {
|
||||
// Visualizzo solo i conti di livello 3 relativi al conto di livello 2
|
||||
if($liv2_p['id'] == $liv3_p['idpianodeiconti2']){
|
||||
if ($liv2_p['id'] == $liv3_p['idpianodeiconti2']) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$liv3_p['numero'].'</td>
|
||||
<td>'.$liv3_p['descrizione'].'</td>
|
||||
<td class="text-right">'.numberFormat($liv3_p['totale']).'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
}
|
||||
if($liv2_p['descrizione']=="Crediti clienti e crediti diversi"){
|
||||
}
|
||||
}
|
||||
if ($liv2_p['descrizione'] == 'Crediti clienti e crediti diversi') {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Clienti</td>
|
||||
<td class="text-right">'.numberFormat($crediti_clienti).'</td>
|
||||
</tr>';
|
||||
} elseif($liv2_p['descrizione']=="Debiti fornitori e debiti diversi") {
|
||||
} elseif ($liv2_p['descrizione'] == 'Debiti fornitori e debiti diversi') {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
@ -76,14 +75,14 @@ echo '
|
||||
<td class="text-right">'.numberFormat($debiti_fornitori).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale Attività</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_attivita)).'</b></h6></td>
|
||||
</tr>';
|
||||
if($utile_perdita>0){
|
||||
if ($utile_perdita > 0) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Perdita</b></h6></td>
|
||||
@ -91,7 +90,7 @@ echo '
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale a pareggio</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_attivita)+abs($utile_perdita)).'</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_attivita) + abs($utile_perdita)).'</b></h6></td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
@ -114,10 +113,10 @@ echo '
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
$i=0;
|
||||
$i = 0;
|
||||
// Mostra le righe delle passività
|
||||
foreach($liv2_patrimoniale as $liv2_p){
|
||||
if($liv2_p['totale']<0){
|
||||
foreach ($liv2_patrimoniale as $liv2_p) {
|
||||
if ($liv2_p['totale'] < 0) {
|
||||
$totale_passivita += $liv2_p['totale'];
|
||||
echo '
|
||||
<tr>
|
||||
@ -125,9 +124,9 @@ echo '
|
||||
<td><b>'.$liv2_p['descrizione'].'</b></td>
|
||||
<td class="text-right"><b>'.numberFormat(abs($liv2_p['totale'])).'</b></td>
|
||||
</tr>';
|
||||
|
||||
foreach($liv3_patrimoniale as $liv3_p){
|
||||
if($liv2_p['id'] == $liv3_p['idpianodeiconti2']){
|
||||
|
||||
foreach ($liv3_patrimoniale as $liv3_p) {
|
||||
if ($liv2_p['id'] == $liv3_p['idpianodeiconti2']) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$liv3_p['numero'].'</td>
|
||||
@ -136,14 +135,14 @@ echo '
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
if($liv2_p['descrizione']=="Crediti clienti e crediti diversi"){
|
||||
if ($liv2_p['descrizione'] == 'Crediti clienti e crediti diversi') {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Clienti</td>
|
||||
<td class="text-right">'.numberFormat(abs($crediti_clienti)).'</td>
|
||||
</tr>';
|
||||
} elseif($liv2_p['descrizione']=="Debiti fornitori e debiti diversi") {
|
||||
} elseif ($liv2_p['descrizione'] == 'Debiti fornitori e debiti diversi') {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
@ -151,14 +150,14 @@ echo '
|
||||
<td class="text-right">'.numberFormat(abs($debiti_fornitori)).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale Passività</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_passivita)).'</b></h6></td>
|
||||
</tr>';
|
||||
if($utile_perdita<0){
|
||||
if ($utile_perdita < 0) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Utile</b></h6></td>
|
||||
@ -166,7 +165,7 @@ echo '
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale a pareggio</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_passivita)+abs($utile_perdita)).'</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_passivita) + abs($utile_perdita)).'</b></h6></td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
@ -199,8 +198,8 @@ echo '
|
||||
</thead>
|
||||
<tbody>';
|
||||
// Mostra le righe dei costi
|
||||
foreach($liv2_economico as $liv2_e){
|
||||
if($liv2_e['totale']>0){
|
||||
foreach ($liv2_economico as $liv2_e) {
|
||||
if ($liv2_e['totale'] > 0) {
|
||||
$totale_costi += $liv2_e['totale'];
|
||||
echo '
|
||||
<tr>
|
||||
@ -208,25 +207,25 @@ echo '
|
||||
<td><b>'.$liv2_e['descrizione'].'</b></td>
|
||||
<td class="text-right"><b>'.numberFormat($liv2_e['totale']).'</b></td>
|
||||
</tr>';
|
||||
|
||||
foreach($liv3_economico as $liv3_e){
|
||||
if($liv2_e['id'] == $liv3_e['idpianodeiconti2']){
|
||||
|
||||
foreach ($liv3_economico as $liv3_e) {
|
||||
if ($liv2_e['id'] == $liv3_e['idpianodeiconti2']) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$liv3_e['numero'].'</td>
|
||||
<td>'.$liv3_e['descrizione'].'</td>
|
||||
<td class="text-right">'.numberFormat($liv3_e['totale']).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale costi</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_costi)).'</b></h6></td>
|
||||
</tr>';
|
||||
if($utile_perdita<0){
|
||||
if ($utile_perdita < 0) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Utile</b></h6></td>
|
||||
@ -234,7 +233,7 @@ echo '
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale a pareggio</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_costi)+abs($utile_perdita)).'</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_costi) + abs($utile_perdita)).'</b></h6></td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
@ -259,8 +258,8 @@ echo '
|
||||
</thead>
|
||||
<tbody>';
|
||||
// Mostra le righe dei ricavi
|
||||
foreach($liv2_economico as $liv2_e){
|
||||
if($liv2_e['totale']<0){
|
||||
foreach ($liv2_economico as $liv2_e) {
|
||||
if ($liv2_e['totale'] < 0) {
|
||||
$totale_ricavi += $liv2_e['totale'];
|
||||
echo '
|
||||
<tr>
|
||||
@ -268,25 +267,25 @@ echo '
|
||||
<td><b>'.$liv2_e['descrizione'].'</b></td>
|
||||
<td class="text-right"><b>'.numberFormat(abs($liv2_e['totale'])).'</b></td>
|
||||
</tr>';
|
||||
|
||||
foreach($liv3_economico as $liv3_e){
|
||||
if($liv2_e['id'] == $liv3_e['idpianodeiconti2']){
|
||||
|
||||
foreach ($liv3_economico as $liv3_e) {
|
||||
if ($liv2_e['id'] == $liv3_e['idpianodeiconti2']) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$liv3_e['numero'].'</td>
|
||||
<td>'.$liv3_e['descrizione'].'</td>
|
||||
<td class="text-right">'.numberFormat(abs($liv3_e['totale'])).'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale ricavi</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_ricavi)).'</b></h6></td>
|
||||
</tr>';
|
||||
if($utile_perdita>0){
|
||||
if ($utile_perdita > 0) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Perdita</b></h6></td>
|
||||
@ -294,7 +293,7 @@ echo '
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><h6><b>Totale a pareggio</b></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_ricavi)+abs($utile_perdita)).'</b></h6></td>
|
||||
<td class="text-right"><h6><b>'.numberFormat(abs($totale_ricavi) + abs($utile_perdita)).'</b></h6></td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
@ -302,4 +301,4 @@ echo '
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>';
|
||||
</div>';
|
||||
|
@ -17,10 +17,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
echo '
|
||||
<h5 style="border-bottom:1px solid #777; display:block;">
|
||||
<div class="col-xs-5">STAMPA BILANCIO <small>'.dateFormat($date_start).' - '.dateFormat($date_end).'</small></div>
|
||||
<div class="col-xs-7 text-right">'.$azienda['ragione_sociale'].'</div>
|
||||
</h5><br>
|
||||
<h4 class="text-center">ESERCIZIO '.$esercizio.'</h4><br>';
|
||||
<h4 class="text-center">ESERCIZIO '.$esercizio.'</h4><br>';
|
||||
|
@ -79,4 +79,4 @@ GROUP BY
|
||||
ORDER BY
|
||||
co_pianodeiconti2.numero');
|
||||
|
||||
$crediti_clienti = sum(array_column($crediti_clienti, 'totale'));
|
||||
$crediti_clienti = sum(array_column($crediti_clienti, 'totale'));
|
||||
|
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'format' => 'A4',
|
||||
'orientation' => 'P',
|
||||
'font-size' => '9px',
|
||||
|
||||
];
|
||||
|
@ -259,7 +259,7 @@ if ($options['pricing']) {
|
||||
</th>
|
||||
</tr>';
|
||||
}
|
||||
echo'
|
||||
echo '
|
||||
</table>';
|
||||
|
||||
// CONDIZIONI GENERALI DI FORNITURA
|
||||
|
@ -74,7 +74,7 @@ foreach ($righe as $riga) {
|
||||
echo '-';
|
||||
}
|
||||
|
||||
echo'
|
||||
echo '
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
@ -93,5 +93,5 @@ $custom = [
|
||||
// - utente qualsiasi con permessi almeno in lettura sul modulo
|
||||
// - admin
|
||||
if ((Auth::user()['gruppo'] == 'Clienti' && $id_cliente != Auth::user()['idanagrafica'] && !Auth::admin()) || Modules::getPermission($documento->module) == '-') {
|
||||
die(tr('Non hai i permessi per questa stampa!'));
|
||||
exit(tr('Non hai i permessi per questa stampa!'));
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ if (!empty($record['ritenutaacconto']) || !empty($documento->totale_ritenuta_con
|
||||
echo '
|
||||
</th>';
|
||||
|
||||
echo'
|
||||
echo '
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -118,7 +118,7 @@ $custom = [
|
||||
// - utente qualsiasi con permessi almeno in lettura sul modulo
|
||||
// - admin
|
||||
if ((Auth::user()['gruppo'] == 'Clienti' && $id_cliente != Auth::user()['idanagrafica'] && !Auth::admin()) || Modules::getPermission($module_name) == '-') {
|
||||
die(tr('Non hai i permessi per questa stampa!'));
|
||||
exit(tr('Non hai i permessi per questa stampa!'));
|
||||
}
|
||||
|
||||
if ($fattura_accompagnatoria) {
|
||||
|
@ -94,7 +94,7 @@ echo '
|
||||
<td colspan="4">
|
||||
'.tr('Telefono').': <b>'.$c_telefono.'</b>';
|
||||
if (!empty($c_cellulare)) {
|
||||
echo' - '.tr('Cellulare').': <b>'.$c_cellulare.'</b>';
|
||||
echo ' - '.tr('Cellulare').': <b>'.$c_cellulare.'</b>';
|
||||
}
|
||||
echo '
|
||||
</td>
|
||||
@ -352,7 +352,7 @@ if (empty($documento['firma_file'])) {
|
||||
echo ' <i>'.$documento['firma_nome'].'</i>';
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
|
@ -49,7 +49,7 @@ if ($periodo == 'Trimestrale' && $totale_iva > 0) {
|
||||
$totale_iva_maggiorata = $totale_iva + $maggiorazione;
|
||||
}
|
||||
|
||||
echo'
|
||||
echo '
|
||||
<h5 class="text-center">VENDITE</h5>
|
||||
<table class="table table-condensed table-striped table-bordered">
|
||||
<thead>
|
||||
@ -65,7 +65,7 @@ echo'
|
||||
<tr>
|
||||
<th class="text-center" colspan="5">IVA ESIGIBILE DEL PERIODO</th>
|
||||
</tr>';
|
||||
|
||||
|
||||
foreach ($iva_vendite_esigibile as $record) {
|
||||
echo '
|
||||
<tr>
|
||||
@ -76,7 +76,7 @@ foreach ($iva_vendite_esigibile as $record) {
|
||||
<td class=text-right>'.moneyFormat($record['iva']).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"></td>
|
||||
<td>TOTALI</td>
|
||||
@ -89,7 +89,7 @@ echo'
|
||||
</tr>';
|
||||
|
||||
foreach ($iva_vendite_nonesigibile as $record) {
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.round($record['aliquota']).'%</td>
|
||||
<td>'.$record['cod_iva'].'</td>
|
||||
@ -98,7 +98,7 @@ foreach ($iva_vendite_nonesigibile as $record) {
|
||||
<td class=text-right>'.moneyFormat($record['iva']).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"></td>
|
||||
<td>TOTALI</td>
|
||||
@ -110,7 +110,7 @@ echo'
|
||||
<th class="text-center" colspan="5">RIEPILOGO GENERALE IVA VENDITE</th>
|
||||
</tr>';
|
||||
foreach ($iva_vendite as $record) {
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.round($record['aliquota']).'%</td>
|
||||
<td>'.$record['cod_iva'].'</td>
|
||||
@ -119,7 +119,7 @@ foreach ($iva_vendite as $record) {
|
||||
<td class=text-right>'.moneyFormat($record['iva']).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th>TOTALE</th>
|
||||
@ -156,7 +156,7 @@ foreach ($iva_acquisti_detraibile as $record) {
|
||||
<td class=text-right>'.moneyFormat($record['iva']).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"></td>
|
||||
<td>TOTALI</td>
|
||||
@ -170,7 +170,7 @@ echo'
|
||||
</tr>';
|
||||
|
||||
foreach ($iva_acquisti_nondetraibile as $record) {
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.round($record['aliquota']).'%</td>
|
||||
<td>'.$record['cod_iva'].'</td>
|
||||
@ -179,7 +179,7 @@ foreach ($iva_acquisti_nondetraibile as $record) {
|
||||
<td class=text-right>'.moneyFormat($record['iva']).'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2"></td>
|
||||
<td>TOTALI</td>
|
||||
@ -192,7 +192,7 @@ echo'
|
||||
<th class="text-center" colspan="5">RIEPILOGO GENERALE IVA ACQUISTI</th>
|
||||
</tr>';
|
||||
foreach ($iva_acquisti as $record) {
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.round($record['aliquota']).'%</td>
|
||||
<td>'.$record['cod_iva'].'</td>
|
||||
@ -202,7 +202,7 @@ foreach ($iva_acquisti as $record) {
|
||||
</tr>';
|
||||
}
|
||||
|
||||
echo'
|
||||
echo '
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th>TOTALE</th>
|
||||
@ -226,19 +226,19 @@ echo'
|
||||
<tbody>
|
||||
<tr>';
|
||||
if ($totale_iva_anno_precedente >= 0) {
|
||||
echo' <td>DEBITO ANNO PRECEDENTE</td>';
|
||||
echo ' <td>DEBITO ANNO PRECEDENTE</td>';
|
||||
} else {
|
||||
echo' <td>CREDITO ANNO PRECEDENTE</td>';
|
||||
echo ' <td>CREDITO ANNO PRECEDENTE</td>';
|
||||
}
|
||||
echo'<td class=text-right>'.moneyFormat(abs($totale_iva_anno_precedente)).'</td>
|
||||
echo '<td class=text-right>'.moneyFormat(abs($totale_iva_anno_precedente)).'</td>
|
||||
</tr>
|
||||
<tr>';
|
||||
if ($totale_iva_periodo_precedente >= 0) {
|
||||
echo' <td>DEBITO PERIODO PRECEDENTE</td>';
|
||||
echo ' <td>DEBITO PERIODO PRECEDENTE</td>';
|
||||
} else {
|
||||
echo' <td>CREDITO PERIODO PRECEDENTE</td>';
|
||||
echo ' <td>CREDITO PERIODO PRECEDENTE</td>';
|
||||
}
|
||||
echo' <td class=text-right>'.moneyFormat(abs($totale_iva_periodo_precedente)).'</td>
|
||||
echo ' <td class=text-right>'.moneyFormat(abs($totale_iva_periodo_precedente)).'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>TOTALE IVA SU VENDITE ESIGIBILE</td>
|
||||
@ -278,11 +278,11 @@ echo'
|
||||
</tr>
|
||||
<tr>';
|
||||
if ($totale_iva >= 0) {
|
||||
echo' <td>IVA A DEBITO</td>';
|
||||
echo ' <td>IVA A DEBITO</td>';
|
||||
} else {
|
||||
echo' <td>IVA A CREDITO</td>';
|
||||
echo ' <td>IVA A CREDITO</td>';
|
||||
}
|
||||
echo' <td class=text-right>'.moneyFormat(abs($totale_iva)).'</td>
|
||||
echo ' <td class=text-right>'.moneyFormat(abs($totale_iva)).'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CREDITO SPECIALE DI IMPOSTA</td>
|
||||
|
@ -25,23 +25,20 @@ $righe = $documento->getRighe();
|
||||
$columns = 6;
|
||||
|
||||
//Immagine solo per documenti di vendita
|
||||
if ($documento->direzione == 'entrata'){
|
||||
if ($documento->direzione == 'entrata') {
|
||||
$has_image = $righe->search(function ($item) {
|
||||
return !empty($item->articolo->immagine);
|
||||
}) !== false;
|
||||
|
||||
if ($has_image) {
|
||||
$columns++;
|
||||
++$columns;
|
||||
$char_number = $options['pricing'] ? 26 : 63;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($documento->direzione == 'uscita'){
|
||||
$columns++;
|
||||
if ($documento->direzione == 'uscita') {
|
||||
++$columns;
|
||||
$char_number = $options['pricing'] ? 26 : 63;
|
||||
|
||||
} else {
|
||||
$char_number = $options['pricing'] ? 45 : 82;
|
||||
}
|
||||
@ -58,7 +55,7 @@ echo "
|
||||
<tr>
|
||||
<th class='text-center' style='width:5%'>".tr('#', [], ['upper' => true]).'</th>';
|
||||
|
||||
if ($documento->direzione == 'uscita'){
|
||||
if ($documento->direzione == 'uscita') {
|
||||
echo "
|
||||
<th class='text-center' style='width:10%'>".tr('Codice', [], ['upper' => true]).'</th>';
|
||||
}
|
||||
@ -98,17 +95,13 @@ foreach ($righe as $riga) {
|
||||
'.$num.'
|
||||
</td>';
|
||||
|
||||
|
||||
if ($documento->direzione == 'uscita'){
|
||||
|
||||
echo'
|
||||
if ($documento->direzione == 'uscita') {
|
||||
echo '
|
||||
<td class="text-center" style="vertical-align: middle">
|
||||
'.$riga->articolo->codice.'
|
||||
</td>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($has_image) {
|
||||
if ($riga->isArticolo() && !empty($riga->articolo->image)) {
|
||||
echo '
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
|
||||
|
||||
if (get('lev') == '2' || get('lev') == '3') {
|
||||
$dare = 0;
|
||||
$avere = 0;
|
||||
|
@ -25,7 +25,7 @@
|
||||
*
|
||||
* La personalizzazione specifica dell'header deve comunque seguire lo standard della cartella custom: anche se il file header.php non esiste nella stampa originaria, se si vuole personalizzare l'header bisogna crearlo all'interno della cartella custom.
|
||||
*/
|
||||
echo'
|
||||
echo '
|
||||
<h5 style="border-bottom:1px solid #777; display:block;">
|
||||
<div class="col-xs-5">STAMPA MASTRINO <small>'.Translator::dateToLocale($date_start).' - '.Translator::dateTolocale($date_end).'</small></div>
|
||||
<div class="col-xs-7 text-right">'.$azienda['ragione_sociale'].'</div>
|
||||
@ -36,6 +36,6 @@ if (get('lev') == '3') {
|
||||
'.$conto2['numero'].' '.$conto2['descrizione'].'<br>
|
||||
'.$conto3['numero'].' '.$conto3['descrizione'].'<br>';
|
||||
} elseif (get('lev') == '2') {
|
||||
echo'
|
||||
echo '
|
||||
'.$conto2['numero'].' '.$conto2['descrizione'].'<br>';
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ if (($options['pricing'] && !isset($options['hide_total'])) || $options['show_on
|
||||
</tr>';
|
||||
}
|
||||
|
||||
echo'
|
||||
echo '
|
||||
</table>';
|
||||
|
||||
// CONDIZIONI GENERALI DI FORNITURA
|
||||
@ -402,6 +402,6 @@ echo '
|
||||
echo '
|
||||
<p class="text-center">'.tr("In attesa di un Vostro Cortese riscontro, colgo l'occasione per porgere Cordiali Saluti").'</p>';
|
||||
|
||||
if(!empty($documento->condizioni_fornitura)){
|
||||
if (!empty($documento->condizioni_fornitura)) {
|
||||
echo '<pagebreak>'.$documento->condizioni_fornitura;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
class AnagraficheCest
|
||||
{
|
||||
public function _before(\AcceptanceTester $t)
|
||||
public function _before(AcceptanceTester $t)
|
||||
{
|
||||
// Effettua l'accesso con le credenziali fornite
|
||||
$t->login('admin', 'admin');
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
class BackupCest
|
||||
{
|
||||
public function _before(\AcceptanceTester $t)
|
||||
public function _before(AcceptanceTester $t)
|
||||
{
|
||||
// Effettua l'accesso con le credenziali fornite
|
||||
$t->login('admin', 'admin');
|
||||
|
@ -9,7 +9,7 @@ class ContrattiCest
|
||||
*/
|
||||
protected $rowHelper;
|
||||
|
||||
public function _before(\AcceptanceTester $t)
|
||||
public function _before(AcceptanceTester $t)
|
||||
{
|
||||
// Effettua l'accesso con le credenziali fornite
|
||||
$t->login('admin', 'admin');
|
||||
|
@ -9,7 +9,7 @@ class DDTCest
|
||||
*/
|
||||
protected $rowHelper;
|
||||
|
||||
public function _before(\AcceptanceTester $t)
|
||||
public function _before(AcceptanceTester $t)
|
||||
{
|
||||
// Effettua l'accesso con le credenziali fornite
|
||||
$t->login('admin', 'admin');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user