mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 17:07:01 +01:00
Aggiornamento plugin Articoli di Dettagli clienti e fornitori
Aggiunto plugin separato per la visualizzazione dei piani di sconto/maggiorazione, correzione sconto/rincaro in sconto/maggiorazione.
This commit is contained in:
parent
bd6889be4a
commit
87d309fe22
@ -107,7 +107,8 @@
|
||||
"Plugins\\PianificazioneInterventi\\": ["plugins/pianificazione_interventi/custom/src/", "plugins/pianificazione_interventi/src/"],
|
||||
"Plugins\\PianificazioneFatturazione\\": ["plugins/pianificazione_fatturazione/custom/src/", "plugins/pianificazione_fatturazione/src/"],
|
||||
"Plugins\\StatisticheArticoli\\": ["plugins/statistiche_articoli/custom/src/", "plugins/statistiche_articoli/src/"],
|
||||
"Plugins\\DettagliArticolo\\": ["plugins/dettagli_articolo/custom/src/", "plugins/dettagli_articolo/src/"]
|
||||
"Plugins\\ListinoClienti\\": ["plugins/listino_clienti/custom/src/", "plugins/listino_clienti/src/"],
|
||||
"Plugins\\ListinoFornitori\\": ["plugins/listino_fornitori/custom/src/", "plugins/listino_fornitori/src/"]
|
||||
},
|
||||
"files": [
|
||||
"lib/functions.php",
|
||||
|
@ -59,7 +59,7 @@ if (Auth::check()) {
|
||||
</script>';
|
||||
}
|
||||
|
||||
$custom_css = html_entity_decode( setting('CSS Personalizzato') );
|
||||
$custom_css = html_entity_decode(setting('CSS Personalizzato'));
|
||||
if (!empty($custom_css)) {
|
||||
echo '
|
||||
<style>'.$custom_css.'</style>';
|
||||
|
@ -2628,7 +2628,7 @@ msgid "Ritenuta d'acconto predefinita"
|
||||
msgstr ""
|
||||
|
||||
#: modules/anagrafiche/edit.php:474 modules/anagrafiche/edit.php:536
|
||||
msgid "Piano di sconto/rincaro su articoli"
|
||||
msgid "Piano di sconto/magg. su articoli"
|
||||
msgstr ""
|
||||
|
||||
#: modules/anagrafiche/edit.php:478
|
||||
@ -2981,7 +2981,7 @@ msgid "Aggiornare il prezzo di acquisto per gli articoli selezionati?"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/bulk.php:74
|
||||
msgid "Percentuale sconto/rincaro"
|
||||
msgid "Percentuale sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/buttons.php:24 modules/articoli/buttons.php:29
|
||||
@ -3107,11 +3107,11 @@ msgid "Seleziona un componente"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:283
|
||||
msgid "Prezzo articolo secondo i piani di sconto/rincaro"
|
||||
msgid "Prezzo articolo secondo i piani di sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:294
|
||||
msgid "Piano di sconto/rincaro"
|
||||
msgid "Piano di sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:295
|
||||
@ -3123,7 +3123,7 @@ msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:319
|
||||
msgid "Non ci sono piani di sconto/rincaro caricati"
|
||||
msgid "Non ci sono piani di sconto/magg. caricati"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:387 modules/articoli/plugins/articoli.lotti.php:201 modules/contratti/edit.php:471
|
||||
@ -6067,7 +6067,7 @@ msgid "Listino eliminato!"
|
||||
msgstr ""
|
||||
|
||||
#: modules/listini/add.php:32 modules/listini/edit.php:32
|
||||
msgid "Sconto/rincaro combinato"
|
||||
msgid "Sconto/magg. combinato"
|
||||
msgstr ""
|
||||
|
||||
#: modules/listini/add.php:32 modules/listini/edit.php:32
|
||||
@ -6081,7 +6081,7 @@ msgid "Sono ammessi i segni + e -"
|
||||
msgstr ""
|
||||
|
||||
#: modules/listini/add.php:36 modules/listini/edit.php:36
|
||||
msgid "Sconto/rincaro"
|
||||
msgid "Sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/misure/actions.php:31 modules/misure/actions.php:58
|
||||
|
@ -2952,7 +2952,7 @@ msgid "Ritenuta d'acconto predefinita"
|
||||
msgstr ""
|
||||
|
||||
#: modules/anagrafiche/edit.php:474 modules/anagrafiche/edit.php:536
|
||||
msgid "Piano di sconto/rincaro su articoli"
|
||||
msgid "Piano di sconto/magg. su articoli"
|
||||
msgstr ""
|
||||
|
||||
#: modules/anagrafiche/edit.php:478
|
||||
@ -3338,7 +3338,7 @@ msgid "Aggiornare il prezzo di acquisto per gli articoli selezionati?"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/bulk.php:74
|
||||
msgid "Percentuale sconto/rincaro"
|
||||
msgid "Percentuale sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/buttons.php:24 modules/articoli/buttons.php:29
|
||||
@ -3474,11 +3474,11 @@ msgid "Seleziona un componente"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:283
|
||||
msgid "Prezzo articolo secondo i piani di sconto/rincaro"
|
||||
msgid "Prezzo articolo secondo i piani di sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:294
|
||||
msgid "Piano di sconto/rincaro"
|
||||
msgid "Piano di sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:295
|
||||
@ -3490,7 +3490,7 @@ msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:319
|
||||
msgid "Non ci sono piani di sconto/rincaro caricati"
|
||||
msgid "Non ci sono piani di sconto/magg. caricati"
|
||||
msgstr ""
|
||||
|
||||
#: modules/articoli/edit.php:387
|
||||
@ -6737,7 +6737,7 @@ msgid "Listino eliminato!"
|
||||
msgstr ""
|
||||
|
||||
#: modules/listini/add.php:32 modules/listini/edit.php:32
|
||||
msgid "Sconto/rincaro combinato"
|
||||
msgid "Sconto/magg. combinato"
|
||||
msgstr ""
|
||||
|
||||
#: modules/listini/add.php:32 modules/listini/edit.php:32
|
||||
@ -6752,7 +6752,7 @@ msgid "Sono ammessi i segni + e -"
|
||||
msgstr ""
|
||||
|
||||
#: modules/listini/add.php:36 modules/listini/edit.php:36
|
||||
msgid "Sconto/rincaro"
|
||||
msgid "Sconto/magg."
|
||||
msgstr ""
|
||||
|
||||
#: modules/misure/actions.php:31 modules/misure/actions.php:58
|
||||
|
@ -3184,7 +3184,7 @@ msgid "Ritenuta d'acconto predefinita"
|
||||
msgstr "Default withholding tax"
|
||||
|
||||
#: modules/anagrafiche/edit.php:492 modules/anagrafiche/edit.php:554
|
||||
msgid "Piano di sconto/rincaro su articoli"
|
||||
msgid "Piano di sconto/magg. su articoli"
|
||||
msgstr "Customer accounts plan"
|
||||
|
||||
#: modules/anagrafiche/edit.php:496
|
||||
@ -3605,7 +3605,7 @@ msgid "Aggiornare il prezzo di acquisto per gli articoli selezionati?"
|
||||
msgstr "Update the purchase price for the selected items?"
|
||||
|
||||
#: modules/articoli/bulk.php:83
|
||||
msgid "Percentuale sconto/rincaro"
|
||||
msgid "Percentuale sconto/magg."
|
||||
msgstr "Taxable percentage "
|
||||
|
||||
#: modules/articoli/bulk.php:91
|
||||
@ -3819,11 +3819,11 @@ msgid "Seleziona un componente"
|
||||
msgstr "Select a component"
|
||||
|
||||
#: modules/articoli/edit.php:317
|
||||
msgid "Prezzo articolo secondo i piani di sconto/rincaro"
|
||||
msgid "Prezzo articolo secondo i piani di sconto/magg."
|
||||
msgstr "Item price per list"
|
||||
|
||||
#: modules/articoli/edit.php:328
|
||||
msgid "Piano di sconto/rincaro"
|
||||
msgid "Piano di sconto/magg."
|
||||
msgstr "Supplier chart of accounts"
|
||||
|
||||
#: modules/articoli/edit.php:329
|
||||
@ -3835,7 +3835,7 @@ msgid "Base"
|
||||
msgstr "Base"
|
||||
|
||||
#: modules/articoli/edit.php:353
|
||||
msgid "Non ci sono piani di sconto/rincaro caricati"
|
||||
msgid "Non ci sono piani di sconto/magg. caricati"
|
||||
msgstr "There are no price list loaded"
|
||||
|
||||
#: modules/articoli/edit.php:421 modules/articoli/plugins/articoli.lotti.php:201
|
||||
@ -7912,7 +7912,7 @@ msgid "Listino eliminato!"
|
||||
msgstr "List eliminated!"
|
||||
|
||||
#: modules/piano_sconto/add.php:32 modules/piano_sconto/edit.php:32
|
||||
msgid "Sconto/rincaro combinato"
|
||||
msgid "Sconto/magg. combinato"
|
||||
msgstr "Inflation/discount"
|
||||
|
||||
#: modules/piano_sconto/add.php:32 modules/piano_sconto/edit.php:32
|
||||
@ -7928,7 +7928,7 @@ msgid "Sono ammessi i segni + e -"
|
||||
msgstr "+ And - signs are allowed"
|
||||
|
||||
#: modules/piano_sconto/add.php:36 modules/piano_sconto/edit.php:36
|
||||
msgid "Sconto/rincaro"
|
||||
msgid "Sconto/magg."
|
||||
msgstr "Inflation/discount"
|
||||
|
||||
#: modules/porti/actions.php:77 modules/spedizioni/actions.php:76
|
||||
|
@ -392,7 +392,7 @@ echo '
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>';
|
||||
@ -512,7 +512,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Piano di sconto/rincaro su articoli').'", "name": "idlistino_vendite", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_vendite$" ]}
|
||||
{[ "type": "select", "label": "'.tr('Piano di sconto/magg. su articoli').'", "name": "idlistino_vendite", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_vendite$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
@ -574,7 +574,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Piano di sconto/rincaro su articoli').'", "name": "idlistino_acquisti", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_acquisti$" ]}
|
||||
{[ "type": "select", "label": "'.tr('Piano di sconto/magg. su articoli').'", "name": "idlistino_acquisti", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_acquisti$" ]}
|
||||
</div>';
|
||||
|
||||
// Collegamento con il conto
|
||||
|
@ -171,7 +171,7 @@ $operations['change-acquisto'] = [
|
||||
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Aggiorna prezzo di acquisto').'</span>',
|
||||
'data' => [
|
||||
'title' => tr('Aggiornare il prezzo di acquisto per gli articoli selezionati?'),
|
||||
'msg' => 'Per indicare uno sconto inserire la percentuale con il segno meno, al contrario per un rincaro inserire la percentuale senza segno.<br><br>{[ "type": "number", "label": "'.tr('Percentuale sconto/rincaro').'", "name": "percentuale", "required": 1, "icon-after": "%" ]}',
|
||||
'msg' => 'Per indicare uno sconto inserire la percentuale con il segno meno, al contrario per un rincaro inserire la percentuale senza segno.<br><br>{[ "type": "number", "label": "'.tr('Percentuale sconto/magg.').'", "name": "percentuale", "required": 1, "icon-after": "%" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
@ -182,7 +182,7 @@ $operations['change-vendita'] = [
|
||||
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Aggiorna prezzo di vendita').'</span>',
|
||||
'data' => [
|
||||
'title' => tr('Aggiornare il prezzo di vendita per gli articoli selezionati?'),
|
||||
'msg' => 'Per indicare uno sconto inserire la percentuale con il segno meno, al contrario per un rincaro inserire la percentuale senza segno.<br><br>{[ "type": "number", "label": "'.tr('Percentuale sconto/rincaro').'", "name": "percentuale", "required": 1, "icon-after": "%" ]}',
|
||||
'msg' => 'Per indicare uno sconto inserire la percentuale con il segno meno, al contrario per un rincaro inserire la percentuale senza segno.<br><br>{[ "type": "number", "label": "'.tr('Percentuale sconto/magg.').'", "name": "percentuale", "required": 1, "icon-after": "%" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
|
@ -311,53 +311,9 @@ echo '
|
||||
echo '
|
||||
</div>
|
||||
</div>
|
||||
</form>';
|
||||
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">'.tr('Prezzo articolo secondo i piani di sconto/rincaro').'</h3>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">';
|
||||
|
||||
$listini = $dbo->fetchArray('SELECT * FROM mg_listini ORDER BY id ASC');
|
||||
|
||||
if (!empty($listini)) {
|
||||
echo '
|
||||
<table class="table table-striped table-condensed table-bordered">
|
||||
<tr>
|
||||
<th>'.tr('Piano di sconto/rincaro').'</th>
|
||||
<th>'.tr('Prezzo di vendita finale').'</th>
|
||||
</tr>';
|
||||
|
||||
// listino base
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Base').'</td>
|
||||
<td>'.moneyFormat($articolo->prezzo_vendita).'</td>
|
||||
</tr>';
|
||||
|
||||
foreach ($listini as $listino) {
|
||||
$prezzo_vendita = $articolo->prezzo_vendita - $articolo->prezzo_vendita * $listino['prc_guadagno'] / 100;
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$listino['nome'].'</td>
|
||||
<td>'.moneyFormat($prezzo_vendita).'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</table>';
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
'.tr('Non ci sono piani di sconto/rincaro caricati').'... '.Modules::link('Piani di sconto/rincaro', null, tr('Crea')).'
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
</div>';
|
||||
?>
|
||||
</form>
|
||||
|
||||
{( "name": "filelist_and_upload", "id_module": "$id_module$", "id_record": "$id_record$" )}
|
||||
|
||||
|
@ -25,7 +25,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Modules;
|
||||
use Modules\Interventi\Components\Articolo as ArticoloIntervento;
|
||||
use Modules\Iva\Aliquota;
|
||||
use Plugins\DettagliArticolo\DettaglioFornitore;
|
||||
use Plugins\ListinoFornitori\DettaglioFornitore;
|
||||
use Traits\RecordTrait;
|
||||
use Uploads;
|
||||
|
||||
|
@ -29,11 +29,11 @@ include_once __DIR__.'/../../core.php';
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Sconto/rincaro combinato'); ?>", "name": "prc_combinato", "value": "$prc_combinato$", "icon-after": "%", "class": "math-mask text-right", "help": "<?php echo tr('Esempio: 50+10-20 viene convertito in 50% di sconto con 10% aggiuntivo sul totale scontato e 20% di maggiorazione sul totale finale (54% di sconto finale)').'. '.tr('Sono ammessi i segni + e -').'.'; ?>" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Sconto/magg. combinato'); ?>", "name": "prc_combinato", "value": "$prc_combinato$", "icon-after": "%", "class": "math-mask text-right", "help": "<?php echo tr('Esempio: 50+10-20 viene convertito in 50% di sconto con 10% aggiuntivo sul totale scontato e 20% di maggiorazione sul totale finale (54% di sconto finale)').'. '.tr('Sono ammessi i segni + e -').'.'; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "number", "label": "<?php echo tr('Sconto/rincaro'); ?>", "name": "prc_guadagno", "required": 1, "value": "0", "icon-after": "%", "help": "<?php echo tr('Il valore positivo indica uno sconto: per applicare una maggiorazione inserire un valore negativo'); ?>" ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Sconto/magg.'); ?>", "name": "prc_guadagno", "required": 1, "value": "0", "icon-after": "%", "help": "<?php echo tr('Il valore positivo indica uno sconto: per applicare una maggiorazione inserire un valore negativo'); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -29,11 +29,11 @@ include_once __DIR__.'/../../core.php';
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Sconto/rincaro combinato'); ?>", "name": "prc_combinato", "value": "$prc_combinato$", "icon-after": "%", "class": "math-mask text-right", "help": "<?php echo tr('Esempio: 50+10-20 viene convertito in 50% di sconto con 10% aggiuntivo sul totale scontato e 20% di maggiorazione sul totale finale (54% di sconto finale)').'. '.tr('Sono ammessi i segni + e -').'.'; ?>", "disabled": "<?php echo intval(empty($record['prc_combinato']) && !empty($record['prc_guadagno'])); ?>" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Sconto/magg. combinato'); ?>", "name": "prc_combinato", "value": "$prc_combinato$", "icon-after": "%", "class": "math-mask text-right", "help": "<?php echo tr('Esempio: 50+10-20 viene convertito in 50% di sconto con 10% aggiuntivo sul totale scontato e 20% di maggiorazione sul totale finale (54% di sconto finale)').'. '.tr('Sono ammessi i segni + e -').'.'; ?>", "disabled": "<?php echo intval(empty($record['prc_combinato']) && !empty($record['prc_guadagno'])); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "number", "label": "<?php echo tr('Sconto/rincaro'); ?>", "name": "prc_guadagno", "required": 1, "value": "$prc_guadagno$", "icon-after": "%", "help": "<?php echo tr('Il valore positivo indica uno sconto: per applicare una maggiorazione inserire un valore negativo').'.'; ?>", "disabled": "<?php echo intval(!empty($record['prc_combinato'])); ?>" ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Sconto/magg.'); ?>", "name": "prc_guadagno", "required": 1, "value": "$prc_guadagno$", "icon-after": "%", "help": "<?php echo tr('Il valore positivo indica uno sconto: per applicare una maggiorazione inserire un valore negativo').'.'; ?>", "disabled": "<?php echo intval(!empty($record['prc_combinato'])); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1,374 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Plugins\DettagliArticolo\DettaglioFornitore;
|
||||
use Plugins\DettagliArticolo\DettaglioPrezzo;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$id_articolo = $id_record;
|
||||
echo '
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav-tabs-li nav nav-tabs nav-justified">
|
||||
<li class="active"><a href="#tab_'.$id_plugin.'" onclick="apriTab(this)" data-tab="fornitori" id="fornitori-tab">'.tr('Fornitori').'</a></li>
|
||||
|
||||
<li><a href="#tab_'.$id_plugin.'" onclick="apriTab(this)" data-tab="clienti" id="clienti-tab">'.tr('Clienti').'</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane" id="clienti">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">'.tr('Informazioni specifiche per cliente').'</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{[ "type": "select", "label": "'.tr('Cliente').'", "name": "id_cliente_informazioni", "required":"1", "ajax-source": "clienti" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<button type="button" class="btn btn-info btn-block" style="margin-top:25px;" onclick="aggiungiPrezzi(this)">
|
||||
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>'.tr('Elenco clienti').'</h4>';
|
||||
|
||||
$clienti = DettaglioPrezzo::where('id_articolo', $id_articolo)
|
||||
->where('dir', 'entrata')
|
||||
->get()
|
||||
->groupBy('id_anagrafica');
|
||||
if (!$clienti->isEmpty()) {
|
||||
echo '
|
||||
<table class="table table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Cliente').'</th>
|
||||
<th class="text-center" width="210">'.tr('Q.tà minima').'</th>
|
||||
<th class="text-center" width="210">'.tr('Q.tà massima').'</th>
|
||||
<th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
|
||||
<th class="text-center" width="150">'.tr('Sconto').'</th>
|
||||
<th class="text-center" width="150">#</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
|
||||
foreach ($clienti as $id_cliente => $prezzi) {
|
||||
$anagrafica = $prezzi->first()->anagrafica;
|
||||
|
||||
echo '
|
||||
<tr data-id_anagrafica="'.$id_cliente.'" data-direzione="entrata">
|
||||
<td colspan="5">
|
||||
'.Modules::link('Anagrafiche', $anagrafica->id, $anagrafica->ragione_sociale).'
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-xs btn-warning" onclick="modificaPrezzi(this)">
|
||||
<i class="fa fa-money"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
foreach ($prezzi as $key => $dettaglio) {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->minimo ? numberFormat($dettaglio->minimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->massimo ? numberFormat($dettaglio->massimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.moneyFormat($dettaglio->prezzo_unitario).'
|
||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($dettaglio['updated_at'])->diffForHumans().'</small></p>
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.numberFormat($dettaglio->sconto_percentuale).'%
|
||||
</td>
|
||||
|
||||
<td>';
|
||||
|
||||
if (!isset($dettaglio->minimo) && !isset($dettaglio->massimo)) {
|
||||
echo '
|
||||
<span class="badge badge-primary">'.tr('Prezzo predefinito').'</span>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle"></i> '.tr('Nessuna informazione disponibile').'...
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>
|
||||
|
||||
<div class="tab-pane active" id="fornitori">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">'.tr('Informazioni specifiche per fornitore').'</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{[ "type": "select", "label": "'.tr('Fornitore').'", "name": "id_fornitore_informazioni", "required":"1", "ajax-source": "fornitori" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="btn-group btn-group-flex">
|
||||
<button type="button" class="btn btn-info" style="margin-top:25px;" onclick="aggiungiPrezzi(this)">
|
||||
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-primary" style="margin-top:25px;" onclick="aggiungiFornitore()">
|
||||
<i class="fa fa-inbox"></i> '.tr('Dettagli').'
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>'.tr('Elenco fornitori').'</h4>';
|
||||
|
||||
$dettagli_fornitori = DettaglioFornitore::where('id_articolo', $id_record)->get()
|
||||
->mapToGroups(function ($item, $key) {
|
||||
return [$item->id_fornitore => $item];
|
||||
});
|
||||
$prezzi_fornitori = DettaglioPrezzo::where('id_articolo', $id_articolo)
|
||||
->where('dir', 'uscita')
|
||||
->get()
|
||||
->groupBy('id_anagrafica');
|
||||
|
||||
$fornitori_disponibili = $dettagli_fornitori->keys()
|
||||
->merge($prezzi_fornitori->keys())
|
||||
->unique();
|
||||
|
||||
if (!$fornitori_disponibili->isEmpty()) {
|
||||
echo '
|
||||
<table class="table table-striped table-condensed table-bordered">
|
||||
<tbody>';
|
||||
|
||||
foreach ($fornitori_disponibili as $id_fornitore) {
|
||||
$dettaglio = $dettagli_fornitori[$id_fornitore] ? $dettagli_fornitori[$id_fornitore]->first() : null;
|
||||
$prezzi = $prezzi_fornitori[$id_fornitore];
|
||||
|
||||
$anagrafica = $dettaglio ? $dettaglio->anagrafica : $prezzi->first()->anagrafica;
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<th>'.tr('Fornitore').'</th>
|
||||
<th width="150">'.tr('Codice').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center" width="210">'.tr('Q.tà minima ordinabile').'</th>
|
||||
<th class="text-center" width="150">'.tr('Tempi di consegna').'</th>
|
||||
<th class="text-center" width="150">#</th>
|
||||
</tr>
|
||||
|
||||
<tr data-id_anagrafica="'.$anagrafica->id.'" data-direzione="uscita" '.(($anagrafica->id == $articolo->id_fornitore) ? 'class="success"' : '').'>
|
||||
<td>
|
||||
'.Modules::link('Anagrafiche', $anagrafica->id, $anagrafica->ragione_sociale).'
|
||||
</td>';
|
||||
|
||||
if (!empty($dettaglio)) {
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.$dettaglio['codice_fornitore'].'
|
||||
</td>
|
||||
|
||||
<td>
|
||||
'.$dettaglio['descrizione'].'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.numberFormat($dettaglio['qta_minima']).' '.$articolo->um.'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.tr('_NUM_ gg', [
|
||||
'_NUM_' => numberFormat($dettaglio['giorni_consegna'], 0),
|
||||
]).'
|
||||
</td>';
|
||||
} else {
|
||||
echo '
|
||||
<td class="text-center">-</td>
|
||||
<td>-</td>
|
||||
<td class="text-right">-</td>
|
||||
<td class="text-right">-</td>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-xs btn-warning" onclick="modificaPrezzi(this)">
|
||||
<i class="fa fa-money"></i>
|
||||
</button>';
|
||||
|
||||
if (!empty($dettaglio)) {
|
||||
echo '
|
||||
|
||||
<a class="btn btn-secondary btn-xs btn-warning" onclick="modificaFornitore('.$dettaglio['id'].', '.$anagrafica->id.')">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-secondary btn-xs btn-danger ask" data-op="delete_fornitore" data-id_riga="'.$dettaglio['id'].'" data-id_plugin="'.$id_plugin.'" data-backto="record-edit">
|
||||
<i class="fa fa-trash-o"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
/*
|
||||
$dettaglio_predefinito = $prezzi->whereStrict('minimo', null)
|
||||
->whereStrict('massimo', null)
|
||||
->first();
|
||||
|
||||
$prezzi = $prezzi->reject(function ($item, $key) use ($dettaglio_predefinito) {
|
||||
return $item->id == $dettaglio_predefinito->id;
|
||||
});
|
||||
*/
|
||||
if (!empty($prezzi) && !$prezzi->isEmpty()) {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
<th class="text-center">'.tr('Q.tà minima').'</th>
|
||||
<th class="text-center">'.tr('Q.tà massima').'</th>
|
||||
<th class="text-center">'.tr('Prezzo unitario').'</th>
|
||||
<th class="text-center">'.tr('Sconto').'</th>
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
||||
foreach ($prezzi as $key => $dettaglio) {
|
||||
echo '
|
||||
<tr '.(($anagrafica->id == $articolo->id_fornitore) ? 'class="success"' : '').'>
|
||||
<td></td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->minimo ? numberFormat($dettaglio->minimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->massimo ? numberFormat($dettaglio->massimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.moneyFormat($dettaglio->prezzo_unitario).'
|
||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($dettaglio['updated_at'])->diffForHumans().'</small></p>
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.numberFormat($dettaglio->sconto_percentuale).'%
|
||||
</td>
|
||||
|
||||
<td>';
|
||||
|
||||
if (!isset($dettaglio->minimo) && !isset($dettaglio->massimo)) {
|
||||
echo '
|
||||
<span class="badge badge-primary">'.tr('Prezzo predefinito').'</span>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle"></i> '.tr('Nessuna informazione disponibile').'...
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
apriTab($("#fornitori-tab")[0]);
|
||||
});
|
||||
|
||||
function modificaPrezzi(button) {
|
||||
let tr = $(button).closest("tr");
|
||||
let id_anagrafica = tr.data("id_anagrafica");
|
||||
let direzione = tr.data("direzione");
|
||||
|
||||
gestionePrezzi(id_anagrafica, direzione);
|
||||
}
|
||||
|
||||
function gestionePrezzi(id_anagrafica, direzione) {
|
||||
openModal("Gestisci prezzi specifici", "'.$structure->fileurl('dettaglio_prezzi.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_anagrafica=" + id_anagrafica + "&direzione=" + direzione);
|
||||
}
|
||||
|
||||
function aggiungiPrezzi(button) {
|
||||
let panel = $(button).closest(".box");
|
||||
let tab = panel.closest(".tab-pane");
|
||||
|
||||
let direzione = tab.attr("id") === "fornitori" ? "uscita" : "entrata";
|
||||
let id_anagrafica = panel.find("select").val();
|
||||
|
||||
if (id_anagrafica) {
|
||||
gestionePrezzi(id_anagrafica, direzione);
|
||||
} else {
|
||||
swal("'.tr('Attenzione').'", "'.tr('Inserire un\'anagrafica').'", "warning");
|
||||
}
|
||||
}
|
||||
|
||||
function modificaFornitore(id_riga, id_anagrafica) {
|
||||
openModal("Modifica dati fornitore", "'.$structure->fileurl('dettaglio_fornitore.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_riga=" + id_riga + "&id_anagrafica=" + id_anagrafica);
|
||||
}
|
||||
|
||||
function aggiungiFornitore() {
|
||||
let id_fornitore = $("#id_fornitore_informazioni").val();
|
||||
if (id_fornitore) {
|
||||
modificaFornitore("", id_fornitore);
|
||||
} else {
|
||||
swal("'.tr('Attenzione').'", "'.tr('Inserire un\'anagrafica').'", "warning");
|
||||
}
|
||||
}
|
||||
</script>';
|
40
plugins/dettagli_articolo/actions.php → plugins/listino_clienti/actions.php
Executable file → Normal file
40
plugins/dettagli_articolo/actions.php → plugins/listino_clienti/actions.php
Executable file → Normal file
@ -19,40 +19,11 @@
|
||||
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Articoli\Articolo;
|
||||
use Plugins\DettagliArticolo\DettaglioFornitore;
|
||||
use Plugins\DettagliArticolo\DettaglioPrezzo;
|
||||
use Plugins\ListinoClienti\DettaglioPrezzo;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
switch (filter('op')) {
|
||||
case 'update_fornitore':
|
||||
$id_articolo = filter('id_articolo');
|
||||
$articolo = Articolo::find($id_articolo);
|
||||
|
||||
$id_anagrafica = filter('id_anagrafica');
|
||||
$precedente = DettaglioFornitore::where('id_articolo', $id_record)
|
||||
->where('id_fornitore', $id_anagrafica)
|
||||
->first();
|
||||
|
||||
if (empty($precedente)) {
|
||||
$anagrafica = Anagrafica::find($id_anagrafica);
|
||||
|
||||
$fornitore = DettaglioFornitore::build($anagrafica, $articolo);
|
||||
} else {
|
||||
$fornitore = $precedente->replicate();
|
||||
$precedente->delete();
|
||||
}
|
||||
|
||||
$fornitore->codice_fornitore = post('codice_fornitore');
|
||||
$fornitore->descrizione = post('descrizione');
|
||||
$fornitore->qta_minima = post('qta_minima');
|
||||
$fornitore->giorni_consegna = post('giorni_consegna');
|
||||
|
||||
$fornitore->save();
|
||||
|
||||
flash()->info(tr('Informazioni salvate correttamente!'));
|
||||
break;
|
||||
|
||||
case 'update_prezzi':
|
||||
// Informazioni di base
|
||||
$id_articolo = filter('id_articolo');
|
||||
@ -116,13 +87,4 @@ switch (filter('op')) {
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'delete_fornitore':
|
||||
$id_riga = post('id_riga');
|
||||
|
||||
$fornitore = DettaglioFornitore::find($id_riga);
|
||||
$fornitore->delete();
|
||||
|
||||
flash()->info(tr('Relazione articolo-fornitore rimossa correttamente!'));
|
||||
break;
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Articoli\Articolo;
|
||||
use Plugins\DettagliArticolo\DettaglioPrezzo;
|
||||
use Plugins\ListinoClienti\DettaglioPrezzo;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
@ -64,7 +64,7 @@ echo '
|
||||
} else {
|
||||
echo '<th class="text-center col-md-4"></th>';
|
||||
}
|
||||
echo '
|
||||
echo '
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center">'.$anagrafica->ragione_sociale.'</td>
|
||||
@ -74,7 +74,7 @@ echo '
|
||||
} else {
|
||||
echo '<td></td>';
|
||||
}
|
||||
echo '
|
||||
echo '
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -244,7 +244,7 @@ function cambioImpostazioni() {
|
||||
|
||||
let prezzi_variabili = $("#prezzi");
|
||||
|
||||
if (!modifica_prezzi.get()){
|
||||
if (!modifica_prezzi.get()){
|
||||
$(".info_prezzi").hide();
|
||||
} else {
|
||||
$(".info_prezzi").show();
|
157
plugins/listino_clienti/edit.php
Normal file
157
plugins/listino_clienti/edit.php
Normal file
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Plugins\ListinoClienti\DettaglioPrezzo;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$id_articolo = $id_record;
|
||||
echo '
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">'.tr('Informazioni specifiche per cliente').'</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{[ "type": "select", "label": "'.tr('Cliente').'", "name": "id_cliente_informazioni", "required":"1", "ajax-source": "clienti" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<button type="button" class="btn btn-info btn-block" style="margin-top:25px;" onclick="aggiungiPrezzi(this)">
|
||||
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>'.tr('Elenco clienti').'</h4>';
|
||||
|
||||
$clienti = DettaglioPrezzo::where('id_articolo', $id_articolo)
|
||||
->where('dir', 'entrata')
|
||||
->get()
|
||||
->groupBy('id_anagrafica');
|
||||
if (!$clienti->isEmpty()) {
|
||||
echo '
|
||||
<table class="table table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Cliente').'</th>
|
||||
<th class="text-center" width="210">'.tr('Q.tà minima').'</th>
|
||||
<th class="text-center" width="210">'.tr('Q.tà massima').'</th>
|
||||
<th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
|
||||
<th class="text-center" width="150">'.tr('Sconto').'</th>
|
||||
<th class="text-center" width="150">#</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
|
||||
foreach ($clienti as $id_cliente => $prezzi) {
|
||||
$anagrafica = $prezzi->first()->anagrafica;
|
||||
|
||||
echo '
|
||||
<tr data-id_anagrafica="'.$id_cliente.'" data-direzione="entrata">
|
||||
<td colspan="5">
|
||||
'.Modules::link('Anagrafiche', $anagrafica->id, $anagrafica->ragione_sociale).'
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-xs btn-warning" onclick="modificaPrezzi(this)">
|
||||
<i class="fa fa-money"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
foreach ($prezzi as $key => $dettaglio) {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->minimo ? numberFormat($dettaglio->minimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->massimo ? numberFormat($dettaglio->massimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.moneyFormat($dettaglio->prezzo_unitario).'
|
||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($dettaglio['updated_at'])->diffForHumans().'</small></p>
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.numberFormat($dettaglio->sconto_percentuale).'%
|
||||
</td>
|
||||
|
||||
<td>';
|
||||
|
||||
if (!isset($dettaglio->minimo) && !isset($dettaglio->massimo)) {
|
||||
echo '
|
||||
<span class="badge badge-primary">'.tr('Prezzo predefinito').'</span>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle"></i> '.tr('Nessuna informazione disponibile').'...
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<script>
|
||||
function modificaPrezzi(button) {
|
||||
let tr = $(button).closest("tr");
|
||||
let id_anagrafica = tr.data("id_anagrafica");
|
||||
let direzione = tr.data("direzione");
|
||||
|
||||
gestionePrezzi(id_anagrafica, direzione);
|
||||
}
|
||||
|
||||
function gestionePrezzi(id_anagrafica, direzione) {
|
||||
openModal("'.tr('Gestisci prezzi specifici').'", "'.$structure->fileurl('dettaglio_prezzi.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_anagrafica=" + id_anagrafica + "&direzione=" + direzione);
|
||||
}
|
||||
|
||||
function aggiungiPrezzi(button) {
|
||||
let panel = $(button).closest(".box");
|
||||
let tab = panel.closest(".tab-pane");
|
||||
|
||||
let direzione = tab.attr("id") === "fornitori" ? "uscita" : "entrata";
|
||||
let id_anagrafica = panel.find("select").val();
|
||||
|
||||
if (id_anagrafica) {
|
||||
gestionePrezzi(id_anagrafica, direzione);
|
||||
} else {
|
||||
swal("'.tr('Attenzione').'", "'.tr('Inserire un\'anagrafica').'", "warning");
|
||||
}
|
||||
}
|
||||
</script>';
|
@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Plugins\DettagliArticolo;
|
||||
namespace Plugins\ListinoClienti;
|
||||
|
||||
use Common\SimpleModelTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
67
plugins/listino_fornitori/actions.php
Normal file
67
plugins/listino_fornitori/actions.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Articoli\Articolo;
|
||||
use Plugins\ListinoFornitori\DettaglioFornitore;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
switch (filter('op')) {
|
||||
case 'update_fornitore':
|
||||
$id_articolo = filter('id_articolo');
|
||||
$articolo = Articolo::find($id_articolo);
|
||||
|
||||
$id_anagrafica = filter('id_anagrafica');
|
||||
$precedente = DettaglioFornitore::where('id_articolo', $id_record)
|
||||
->where('id_fornitore', $id_anagrafica)
|
||||
->first();
|
||||
|
||||
if (empty($precedente)) {
|
||||
$anagrafica = Anagrafica::find($id_anagrafica);
|
||||
|
||||
$fornitore = DettaglioFornitore::build($anagrafica, $articolo);
|
||||
} else {
|
||||
$fornitore = $precedente->replicate();
|
||||
$precedente->delete();
|
||||
}
|
||||
|
||||
$fornitore->codice_fornitore = post('codice_fornitore');
|
||||
$fornitore->descrizione = post('descrizione');
|
||||
$fornitore->qta_minima = post('qta_minima');
|
||||
$fornitore->giorni_consegna = post('giorni_consegna');
|
||||
|
||||
$fornitore->save();
|
||||
|
||||
flash()->info(tr('Informazioni salvate correttamente!'));
|
||||
break;
|
||||
|
||||
case 'delete_fornitore':
|
||||
$id_riga = post('id_riga');
|
||||
|
||||
$fornitore = DettaglioFornitore::find($id_riga);
|
||||
$fornitore->delete();
|
||||
|
||||
flash()->info(tr('Relazione articolo-fornitore rimossa correttamente!'));
|
||||
break;
|
||||
|
||||
case 'update_prezzi':
|
||||
require base_dir().'/plugins/listino_clienti/actions.php';
|
||||
break;
|
||||
}
|
@ -19,7 +19,7 @@
|
||||
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Articoli\Articolo;
|
||||
use Plugins\DettagliArticolo\DettaglioFornitore;
|
||||
use Plugins\ListinoFornitori\DettaglioFornitore;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
251
plugins/listino_fornitori/edit.php
Normal file
251
plugins/listino_fornitori/edit.php
Normal file
@ -0,0 +1,251 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Models\Plugin;
|
||||
use Plugins\ListinoClienti\DettaglioPrezzo;
|
||||
use Plugins\ListinoFornitori\DettaglioFornitore;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$id_articolo = $id_record;
|
||||
echo '
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">'.tr('Informazioni specifiche per fornitore').'</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{[ "type": "select", "label": "'.tr('Fornitore').'", "name": "id_fornitore_informazioni", "required":"1", "ajax-source": "fornitori" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="btn-group btn-group-flex">
|
||||
<button type="button" class="btn btn-info" style="margin-top:25px;" onclick="aggiungiPrezzi(this)">
|
||||
<i class="fa fa-money"></i> '.tr('Prezzi').'
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-primary" style="margin-top:25px;" onclick="aggiungiFornitore()">
|
||||
<i class="fa fa-inbox"></i> '.tr('Dettagli').'
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>'.tr('Elenco fornitori').'</h4>';
|
||||
|
||||
$dettagli_fornitori = DettaglioFornitore::where('id_articolo', $id_record)->get()
|
||||
->mapToGroups(function ($item, $key) {
|
||||
return [$item->id_fornitore => $item];
|
||||
});
|
||||
$prezzi_fornitori = DettaglioPrezzo::where('id_articolo', $id_articolo)
|
||||
->where('dir', 'uscita')
|
||||
->get()
|
||||
->groupBy('id_anagrafica');
|
||||
|
||||
$fornitori_disponibili = $dettagli_fornitori->keys()
|
||||
->merge($prezzi_fornitori->keys())
|
||||
->unique();
|
||||
|
||||
if (!$fornitori_disponibili->isEmpty()) {
|
||||
echo '
|
||||
<table class="table table-striped table-condensed table-bordered">
|
||||
<tbody>';
|
||||
|
||||
foreach ($fornitori_disponibili as $id_fornitore) {
|
||||
$dettaglio = $dettagli_fornitori[$id_fornitore] ? $dettagli_fornitori[$id_fornitore]->first() : null;
|
||||
$prezzi = $prezzi_fornitori[$id_fornitore];
|
||||
|
||||
$anagrafica = $dettaglio ? $dettaglio->anagrafica : $prezzi->first()->anagrafica;
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<th>'.tr('Fornitore').'</th>
|
||||
<th width="150">'.tr('Codice').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center" width="210">'.tr('Q.tà minima ordinabile').'</th>
|
||||
<th class="text-center" width="150">'.tr('Tempi di consegna').'</th>
|
||||
<th class="text-center" width="150">#</th>
|
||||
</tr>
|
||||
|
||||
<tr data-id_anagrafica="'.$anagrafica->id.'" data-direzione="uscita" '.(($anagrafica->id == $articolo->id_fornitore) ? 'class="success"' : '').'>
|
||||
<td>
|
||||
'.Modules::link('Anagrafiche', $anagrafica->id, $anagrafica->ragione_sociale).'
|
||||
</td>';
|
||||
|
||||
if (!empty($dettaglio)) {
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.$dettaglio['codice_fornitore'].'
|
||||
</td>
|
||||
|
||||
<td>
|
||||
'.$dettaglio['descrizione'].'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.numberFormat($dettaglio['qta_minima']).' '.$articolo->um.'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.tr('_NUM_ gg', [
|
||||
'_NUM_' => numberFormat($dettaglio['giorni_consegna'], 0),
|
||||
]).'
|
||||
</td>';
|
||||
} else {
|
||||
echo '
|
||||
<td class="text-center">-</td>
|
||||
<td>-</td>
|
||||
<td class="text-right">-</td>
|
||||
<td class="text-right">-</td>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-xs btn-warning" onclick="modificaPrezzi(this)">
|
||||
<i class="fa fa-money"></i>
|
||||
</button>';
|
||||
|
||||
if (!empty($dettaglio)) {
|
||||
echo '
|
||||
|
||||
<a class="btn btn-secondary btn-xs btn-warning" onclick="modificaFornitore('.$dettaglio['id'].', '.$anagrafica->id.')">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-secondary btn-xs btn-danger ask" data-op="delete_fornitore" data-id_riga="'.$dettaglio['id'].'" data-id_plugin="'.$id_plugin.'" data-backto="record-edit">
|
||||
<i class="fa fa-trash-o"></i>
|
||||
</a>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
/*
|
||||
$dettaglio_predefinito = $prezzi->whereStrict('minimo', null)
|
||||
->whereStrict('massimo', null)
|
||||
->first();
|
||||
|
||||
$prezzi = $prezzi->reject(function ($item, $key) use ($dettaglio_predefinito) {
|
||||
return $item->id == $dettaglio_predefinito->id;
|
||||
});
|
||||
*/
|
||||
if (!empty($prezzi) && !$prezzi->isEmpty()) {
|
||||
echo '
|
||||
<tr>
|
||||
<td></td>
|
||||
<th class="text-center">'.tr('Q.tà minima').'</th>
|
||||
<th class="text-center">'.tr('Q.tà massima').'</th>
|
||||
<th class="text-center">'.tr('Prezzo unitario').'</th>
|
||||
<th class="text-center">'.tr('Sconto').'</th>
|
||||
<td></td>
|
||||
</tr>';
|
||||
|
||||
foreach ($prezzi as $key => $dettaglio) {
|
||||
echo '
|
||||
<tr '.(($anagrafica->id == $articolo->id_fornitore) ? 'class="success"' : '').'>
|
||||
<td></td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->minimo ? numberFormat($dettaglio->minimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.($dettaglio->massimo ? numberFormat($dettaglio->massimo) : '-').'
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.moneyFormat($dettaglio->prezzo_unitario).'
|
||||
<p><small class="label label-default tip" title="'.Translator::timestampToLocale($dettaglio['updated_at']).'"><i class="fa fa-clock-o"></i> '.Carbon::parse($dettaglio['updated_at'])->diffForHumans().'</small></p>
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
'.numberFormat($dettaglio->sconto_percentuale).'%
|
||||
</td>
|
||||
|
||||
<td>';
|
||||
|
||||
if (!isset($dettaglio->minimo) && !isset($dettaglio->massimo)) {
|
||||
echo '
|
||||
<span class="badge badge-primary">'.tr('Prezzo predefinito').'</span>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle"></i> '.tr('Nessuna informazione disponibile').'...
|
||||
</div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<script>
|
||||
function modificaPrezzi(button) {
|
||||
let tr = $(button).closest("tr");
|
||||
let id_anagrafica = tr.data("id_anagrafica");
|
||||
let direzione = tr.data("direzione");
|
||||
|
||||
gestionePrezzi(id_anagrafica, direzione);
|
||||
}
|
||||
|
||||
function gestionePrezzi(id_anagrafica, direzione) {
|
||||
openModal("'.tr('Gestisci prezzi specifici').'", "'.Plugin::pool('Listino Clienti')->fileurl('dettaglio_prezzi.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_anagrafica=" + id_anagrafica + "&direzione=" + direzione);
|
||||
}
|
||||
|
||||
function aggiungiPrezzi(button) {
|
||||
let panel = $(button).closest(".box");
|
||||
let tab = panel.closest(".tab-pane");
|
||||
|
||||
let direzione = tab.attr("id") === "fornitori" ? "uscita" : "entrata";
|
||||
let id_anagrafica = panel.find("select").val();
|
||||
|
||||
if (id_anagrafica) {
|
||||
gestionePrezzi(id_anagrafica, direzione);
|
||||
} else {
|
||||
swal("'.tr('Attenzione').'", "'.tr('Inserire un\'anagrafica').'", "warning");
|
||||
}
|
||||
}
|
||||
|
||||
function modificaFornitore(id_riga, id_anagrafica) {
|
||||
openModal("Modifica dati fornitore", "'.$structure->fileurl('dettaglio_fornitore.php').'?id_plugin='.$id_plugin.'&id_module='.$id_module.'&id_parent='.$id_record.'&id_articolo='.$id_record.'&id_riga=" + id_riga + "&id_anagrafica=" + id_anagrafica);
|
||||
}
|
||||
|
||||
function aggiungiFornitore() {
|
||||
let id_fornitore = $("#id_fornitore_informazioni").val();
|
||||
if (id_fornitore) {
|
||||
modificaFornitore("", id_fornitore);
|
||||
} else {
|
||||
swal("'.tr('Attenzione').'", "'.tr('Inserire un\'anagrafica').'", "warning");
|
||||
}
|
||||
}
|
||||
</script>';
|
@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Plugins\DettagliArticolo;
|
||||
namespace Plugins\ListinoFornitori;
|
||||
|
||||
use Common\SimpleModelTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
@ -17,7 +17,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Plugins\DettagliArticolo;
|
||||
namespace Plugins\ListinoFornitori;
|
||||
|
||||
/**
|
||||
* Formato: https://www.metel.it/wp-content/uploads/2020/04/536_L001_1r18_listino_021.pdf.
|
||||
@ -26,7 +26,7 @@ namespace Plugins\DettagliArticolo;
|
||||
*/
|
||||
class METEL
|
||||
{
|
||||
public const HEADER = [
|
||||
const HEADER = [
|
||||
1 => 'Identificazione tracciato',
|
||||
21 => 'Sigla Azienda',
|
||||
24 => 'Partita IVA',
|
66
plugins/piani_sconto_maggiorazione/edit.php
Normal file
66
plugins/piani_sconto_maggiorazione/edit.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.r.l.
|
||||
*
|
||||
* 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';
|
||||
|
||||
echo '
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">'.tr('Prezzo articolo secondo i piani di sconto/magg.').'</h3>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">';
|
||||
|
||||
$listini = $dbo->fetchArray('SELECT * FROM mg_listini ORDER BY id ASC');
|
||||
|
||||
if (!empty($listini)) {
|
||||
echo '
|
||||
<table class="table table-striped table-condensed table-bordered">
|
||||
<tr>
|
||||
<th>'.tr('Piano di sconto/magg.').'</th>
|
||||
<th>'.tr('Prezzo di vendita finale').'</th>
|
||||
</tr>';
|
||||
|
||||
// listino base
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.tr('Base').'</td>
|
||||
<td>'.moneyFormat($articolo->prezzo_vendita).'</td>
|
||||
</tr>';
|
||||
|
||||
foreach ($listini as $listino) {
|
||||
$prezzo_vendita = $articolo->prezzo_vendita - $articolo->prezzo_vendita * $listino['prc_guadagno'] / 100;
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$listino['nome'].'</td>
|
||||
<td>'.moneyFormat($prezzo_vendita).'</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</table>';
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
'.tr('Non ci sono piani di sconto/magg. caricati').'... '.Modules::link('Piani di sconto/maggiorazione', null, tr('Crea')).'
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
</div>
|
||||
</div>';
|
@ -22,8 +22,8 @@ namespace Notifications;
|
||||
use Modules\Emails\Account;
|
||||
use Modules\Emails\Mail;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\OAuth;
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\SMTP;
|
||||
use Prints;
|
||||
use Uploads;
|
||||
|
@ -1009,7 +1009,7 @@ UPDATE `or_righe_ordini` SET `abilita_serial` = 1 WHERE `idarticolo` IN (SELECT
|
||||
-- Rimozione del campo descrizione_articolo (inutilizzato) da mg_movimenti
|
||||
ALTER TABLE `mg_movimenti` DROP `descrizione_articolo`;
|
||||
|
||||
-- Rimozione sconto/rincaro per i preventivi
|
||||
-- Rimozione sconto/magg. per i preventivi
|
||||
UPDATE `co_righe_preventivi` SET `sconto_unitario` = `prc_guadagno`, `tipo_sconto` = 'PRC', `sconto` = `prc_guadagno` * `qta` WHERE `prc_guadagno` != 0;
|
||||
ALTER TABLE `co_righe_preventivi` DROP `prc_guadagno`;
|
||||
|
||||
|
@ -31,8 +31,8 @@ INSERT INTO `zz_tasks` (`id`, `name`, `class`, `expression`, `last_executed_at`)
|
||||
|
||||
DELETE FROM `zz_hooks` WHERE `class` = 'Modules\\Backups\\BackupHook';
|
||||
|
||||
-- Modifica dei Listini in Piani di sconto/rincaro
|
||||
UPDATE `zz_modules` SET `title` = 'Piani di sconto/rincaro' WHERE `name` = 'Listini';
|
||||
-- Modifica dei Listini in Piani di sconto/magg.
|
||||
UPDATE `zz_modules` SET `title` = 'Piani di sconto/magg.' WHERE `name` = 'Listini';
|
||||
|
||||
-- Aggiunto supporto ai prezzi per Articoli specifici per Anagrafica e range di quantità
|
||||
CREATE TABLE IF NOT EXISTS `mg_prezzi_articoli` (
|
||||
@ -327,4 +327,4 @@ DELETE FROM `zz_tokens` WHERE `zz_tokens`.`enabled` = 0;
|
||||
ALTER TABLE `mg_prezzi_articoli` ADD `sconto_percentuale` DECIMAL(15,6) NOT NULL AFTER `massimo`;
|
||||
|
||||
-- Aggiunta impostazione per mostrare o nascondere barra plugin
|
||||
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Nascondere la barra dei plugin di default', '0', 'boolean', '1', 'Generali', '2', NULL);
|
||||
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Nascondere la barra dei plugin di default', '0', 'boolean', '1', 'Generali', '2', NULL);
|
||||
|
@ -1,4 +1,4 @@
|
||||
UPDATE `zz_modules` SET `name` = 'Piani di sconto/rincaro' WHERE `name` = 'Listini';
|
||||
UPDATE `zz_modules` SET `name` = 'Piani di sconto/magg.' WHERE `name` = 'Listini';
|
||||
|
||||
-- Creazione modulo Listini
|
||||
INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`) VALUES (NULL, 'Listini', 'Listini', 'listini', 'SELECT |select|
|
||||
@ -117,8 +117,8 @@ INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `format
|
||||
|
||||
UPDATE `zz_views` SET `default` = 1 WHERE `zz_views`.`id_module` = (SELECT `zz_modules`.`id` FROM `zz_modules` WHERE `zz_modules`.`name` = 'Interventi') AND (`zz_views`.`name` = 'Tecnici' OR `zz_views`.`name` = 'Rif. fattura');
|
||||
|
||||
-- Modifica directory Piani di sconto/rincaro
|
||||
UPDATE `zz_modules` SET `directory` = 'piano_sconto' WHERE `zz_modules`.`name` = 'Piani di sconto/rincaro';
|
||||
-- Modifica directory Piani di sconto/magg.
|
||||
UPDATE `zz_modules` SET `directory` = 'piano_sconto' WHERE `zz_modules`.`name` = 'Piani di sconto/magg.';
|
||||
|
||||
-- Aggiunto flag rinnovo automatico in contratti
|
||||
ALTER TABLE `co_contratti` ADD `rinnovo_automatico` TINYINT(1) NOT NULL DEFAULT '0' AFTER `rinnovabile`;
|
||||
@ -171,7 +171,7 @@ UPDATE `co_iva` SET `codice_natura_fe` = 'N6.9' WHERE `codice_natura_fe` = 'N6';
|
||||
-- Aumento testo descrizione per righe attività (da 255 caratteri)
|
||||
ALTER TABLE `in_righe_interventi` CHANGE `descrizione` `descrizione` TEXT NULL;
|
||||
|
||||
ALTER TABLE `co_tipidocumento` CHANGE `descrizione` `descrizione` VARCHAR(125) NOT NULL;
|
||||
ALTER TABLE `co_tipidocumento` CHANGE `descrizione` `descrizione` VARCHAR(125) NOT NULL;
|
||||
|
||||
-- Aggiunta tipologia documento TD 25
|
||||
INSERT INTO `co_tipidocumento` (`id`, `descrizione`, `dir`, `reversed`, `codice_tipo_documento_fe`) VALUES
|
||||
@ -198,16 +198,16 @@ UPDATE `em_emails` SET `attempt` = '10', `em_emails`.`failed_at` = NOW() WHERE `
|
||||
-- Aggiunto deleted_at per tipi di documento
|
||||
ALTER TABLE `co_tipidocumento` ADD `deleted_at` DATETIME NULL DEFAULT NULL AFTER `codice_tipo_documento_fe`;
|
||||
-- Aggiunti campi predefined, enabled, help per tipi di documento
|
||||
ALTER TABLE `co_tipidocumento` ADD `predefined` TINYINT NOT NULL DEFAULT '0' AFTER `codice_tipo_documento_fe`;
|
||||
ALTER TABLE `co_tipidocumento` ADD `predefined` TINYINT NOT NULL DEFAULT '0' AFTER `codice_tipo_documento_fe`;
|
||||
ALTER TABLE `co_tipidocumento` ADD `enabled` TINYINT NOT NULL DEFAULT '1' AFTER `predefined`;
|
||||
ALTER TABLE `co_tipidocumento` ADD `help` VARCHAR(255) NULL AFTER `enabled`;
|
||||
UPDATE `co_tipidocumento` SET `predefined` = '1' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di vendita';
|
||||
UPDATE `co_tipidocumento` SET `predefined` = '1' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di acquisto';
|
||||
ALTER TABLE `co_tipidocumento` ADD `help` VARCHAR(255) NULL AFTER `enabled`;
|
||||
UPDATE `co_tipidocumento` SET `predefined` = '1' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di vendita';
|
||||
UPDATE `co_tipidocumento` SET `predefined` = '1' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di acquisto';
|
||||
|
||||
UPDATE `co_tipidocumento` SET `help` = 'Fattura emessa entro le ore 24 del giorno di effettuazione dell’operazione.' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di acquisto';
|
||||
UPDATE `co_tipidocumento` SET `help` = 'Fattura emessa entro le ore 24 del giorno di effettuazione dell’operazione.' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di vendita';
|
||||
UPDATE `co_tipidocumento` SET `help` = "Fattura emessa entro il giorno 15 del mese successivo a quello di effettuazione dell'operazione (art. 21 comma 4 lett. a) del D.P.R. 633/1972)." WHERE `co_tipidocumento`.`descrizione` = 'Fattura differita di acquisto';
|
||||
UPDATE `co_tipidocumento` SET `help` = "Fattura emessa entro il giorno 15 del mese successivo a quello di effettuazione dell'operazione (art. 21 comma 4 lett. a) del D.P.R. 633/1972)." WHERE `co_tipidocumento`.`descrizione` = 'Fattura differita di vendita';
|
||||
UPDATE `co_tipidocumento` SET `help` = "Fattura emessa entro il giorno 15 del mese successivo a quello di effettuazione dell'operazione (art. 21 comma 4 lett. a) del D.P.R. 633/1972)." WHERE `co_tipidocumento`.`descrizione` = 'Fattura differita di acquisto';
|
||||
UPDATE `co_tipidocumento` SET `help` = "Fattura emessa entro il giorno 15 del mese successivo a quello di effettuazione dell'operazione (art. 21 comma 4 lett. a) del D.P.R. 633/1972)." WHERE `co_tipidocumento`.`descrizione` = 'Fattura differita di vendita';
|
||||
|
||||
-- Innesto nuovo modulo Tipi documento
|
||||
INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES (NULL, 'Tipi documento', 'Tipi documento', 'tipi_documento', 'SELECT |select| FROM `co_tipidocumento` WHERE 1=1 AND deleted_at IS NULL HAVING 2=2', '', 'fa fa-angle-right', '2.4.20', '2.4.20', '1', (SELECT `id` FROM `zz_modules` t WHERE t.`name` = 'Tabelle'), '1', '1', '0', '0');
|
||||
|
@ -140,7 +140,7 @@ INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `e
|
||||
ALTER TABLE `dt_ddt` ADD `id_ddt_trasporto_interno` INT(11) NULL, ADD FOREIGN KEY (`id_ddt_trasporto_interno`) REFERENCES `dt_ddt`(`id`) ON DELETE CASCADE;
|
||||
|
||||
-- Aggiunto ragruppamento referenti per sede
|
||||
UPDATE `zz_plugins` SET `options` = ' { \"main_query\": [ { \"type\": \"table\", \"fields\": \"Nome, Indirizzo, Città, CAP, Provincia, Referente\", \"query\": \"SELECT an_sedi.id, an_sedi.nomesede AS Nome, an_sedi.indirizzo AS Indirizzo, an_sedi.citta AS Città, an_sedi.cap AS CAP, an_sedi.provincia AS Provincia, GROUP_CONCAT(an_referenti.nome SEPARATOR \\\", \\\") AS Referente FROM an_sedi LEFT OUTER JOIN an_referenti ON idsede = an_sedi.id WHERE 1=1 AND an_sedi.idanagrafica=|id_parent| GROUP BY an_sedi.id HAVING 2=2 ORDER BY an_sedi.id DESC\"} ]}' WHERE `zz_plugins`.`name` = 'Sedi';
|
||||
UPDATE `zz_plugins` SET `options` = ' { \"main_query\": [ { \"type\": \"table\", \"fields\": \"Nome, Indirizzo, Città, CAP, Provincia, Referente\", \"query\": \"SELECT an_sedi.id, an_sedi.nomesede AS Nome, an_sedi.indirizzo AS Indirizzo, an_sedi.citta AS Città, an_sedi.cap AS CAP, an_sedi.provincia AS Provincia, GROUP_CONCAT(an_referenti.nome SEPARATOR \\\", \\\") AS Referente FROM an_sedi LEFT OUTER JOIN an_referenti ON idsede = an_sedi.id WHERE 1=1 AND an_sedi.idanagrafica=|id_parent| GROUP BY an_sedi.id HAVING 2=2 ORDER BY an_sedi.id DESC\"} ]}' WHERE `zz_plugins`.`name` = 'Sedi';
|
||||
UPDATE `zz_group_module` SET `clause` = 'in_interventi.id IN (SELECT idintervento FROM in_interventi_tecnici WHERE idintervento=in_interventi.id AND idtecnico=|id_anagrafica| UNION SELECT id_intervento FROM in_interventi_tecnici_assegnati WHERE id_intervento=in_interventi.id AND id_tecnico=|id_anagrafica|)' WHERE `zz_group_module`.`name` = 'Mostra interventi ai tecnici coinvolti';
|
||||
|
||||
-- Aggiunto supporto autenticazione OAuth 2
|
||||
@ -150,3 +150,11 @@ ALTER TABLE `em_accounts` ADD `provider` varchar(255),
|
||||
ADD `oauth2_state` TEXT,
|
||||
ADD `access_token` TEXT,
|
||||
ADD `refresh_token` TEXT;
|
||||
|
||||
-- Aggiornamento plugin Listini per Articoli
|
||||
UPDATE `zz_plugins` SET `name` = 'Listino Clienti', `title` = 'Listino clienti', `directory` = 'listino_clienti' WHERE `zz_plugins`.`name` = 'Prezzi specifici articolo';
|
||||
INSERT INTO `zz_plugins` (`id`, `name`, `title`, `idmodule_from`, `idmodule_to`, `position`, `directory`, `options`) VALUES
|
||||
(NULL, 'Listino Fornitori', 'Listino fornitori', (SELECT `id` FROM `zz_modules` WHERE `name`='Articoli'), (SELECT `id` FROM `zz_modules` WHERE `name`='Articoli'), 'tab', 'listino_fornitori', 'custom'),
|
||||
(NULL, 'Piani di sconto/maggiorazione', 'Piani di sconto/magg.', (SELECT `id` FROM `zz_modules` WHERE `name`='Articoli'), (SELECT `id` FROM `zz_modules` WHERE `name`='Articoli'), 'tab', 'piani_sconto_maggiorazione', 'custom');
|
||||
|
||||
UPDATE `zz_modules` SET `name` = 'Piani di sconto/maggiorazione' WHERE `name` = 'Piani di sconto/magg.';
|
||||
|
Loading…
x
Reference in New Issue
Block a user