Effettuato modifiche al report annuale e alla lista movimenti per problema ISSUE#3
This commit is contained in:
parent
9320ce76a1
commit
637763fafe
@ -34,13 +34,15 @@ class MovimentiController extends Controller
|
|||||||
public static function listMovimenti(){
|
public static function listMovimenti(){
|
||||||
$categorie=Categorie::list();
|
$categorie=Categorie::list();
|
||||||
$tags=tag::getList();
|
$tags=tag::getList();
|
||||||
|
$contos=Conto::all();
|
||||||
/* Query per visualizzare anche il totale dei documenti presenti per il record */
|
/* Query per visualizzare anche il totale dei documenti presenti per il record */
|
||||||
$movimenti=Movimenti::getList();
|
$movimenti=Movimenti::getList();
|
||||||
|
|
||||||
|
//dd($movimenti);
|
||||||
return view('conti.movimenti.list',[
|
return view('conti.movimenti.list',[
|
||||||
'categorie'=>$categorie,
|
'categorie'=>$categorie,
|
||||||
'movimenti'=>$movimenti,
|
'movimenti'=>$movimenti,
|
||||||
|
'contos'=>$contos,
|
||||||
'tags'=>$tags
|
'tags'=>$tags
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -227,14 +229,32 @@ class MovimentiController extends Controller
|
|||||||
$ncategoria=$categoria->cat_name;
|
$ncategoria=$categoria->cat_name;
|
||||||
for ($i=1;$i<=12;$i++)
|
for ($i=1;$i<=12;$i++)
|
||||||
{
|
{
|
||||||
$movrow=DB::table('movimentis')
|
$importo_dare = DB::table('movimentis')
|
||||||
->whereMonth('mov_data','=',$i)
|
->whereMonth('mov_data', '=', $i)
|
||||||
->whereYear('mov_data','=',$anno)
|
->whereYear('mov_data', '=', $anno)
|
||||||
->where('mov_fk_categoria','=',$id)
|
->where('mov_fk_categoria', '=', $id)
|
||||||
->sum('mov_importo');
|
->sum('mov_importo_dare');
|
||||||
|
|
||||||
|
$importo_avere = DB::table('movimentis')
|
||||||
|
->whereMonth('mov_data', '=', $i)
|
||||||
|
->whereYear('mov_data', '=', $anno)
|
||||||
|
->where('mov_fk_categoria', '=', $id)
|
||||||
|
->sum('mov_importo_avere');
|
||||||
|
|
||||||
|
// $movrow=DB::table('movimentis')
|
||||||
|
// ->whereMonth('mov_data','=',$i)
|
||||||
|
// ->whereYear('mov_data','=',$anno)
|
||||||
|
// ->where('mov_fk_categoria','=',$id)
|
||||||
|
// ->sum('mov_importo_dare')
|
||||||
|
// ->sum('mov_importo_avere');
|
||||||
|
$movrow = $importo_avere - $importo_dare;
|
||||||
|
|
||||||
$coll[]=$movrow;
|
$coll[]=$movrow;
|
||||||
$collx[]=$movrow;
|
$collx[]=$movrow;
|
||||||
}
|
}
|
||||||
|
//TEST
|
||||||
|
// dd($movrow);
|
||||||
|
// /TEST
|
||||||
$totale[]=array_sum($collx);
|
$totale[]=array_sum($collx);
|
||||||
unset($collx);
|
unset($collx);
|
||||||
}
|
}
|
||||||
|
@ -44,10 +44,15 @@ FROM movimentis as a
|
|||||||
JOIN tags as t ON a.mov_fk_tags=t.id
|
JOIN tags as t ON a.mov_fk_tags=t.id
|
||||||
JOIN categories as c ON a.mov_fk_categoria=c.id';
|
JOIN categories as c ON a.mov_fk_categoria=c.id';
|
||||||
|
|
||||||
public function Conto()
|
public function ContoDa()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Conto::class);
|
return $this->belongsTo(Conto::class, 'conto_id_da');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function ContoA()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Conto::class, 'conto_id_a');
|
||||||
|
}
|
||||||
|
|
||||||
public function User()
|
public function User()
|
||||||
{
|
{
|
||||||
@ -56,7 +61,7 @@ JOIN categories as c ON a.mov_fk_categoria=c.id';
|
|||||||
|
|
||||||
public function Categorie()
|
public function Categorie()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Categorie::class);
|
return $this->belongsTo(Categorie::class, 'mov_fk_categoria');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Tags()
|
public function Tags()
|
||||||
@ -66,26 +71,10 @@ JOIN categories as c ON a.mov_fk_categoria=c.id';
|
|||||||
|
|
||||||
public static function getList() {
|
public static function getList() {
|
||||||
|
|
||||||
|
// ISSUE #3 - Aggiunta visualizzazione conto da e conto a nella lista dei movimenti
|
||||||
|
// e risoluzione duplicazione movimenti.
|
||||||
|
|
||||||
$expression=DB::raw(
|
return self::with(['Tags', 'Categorie', 'ContoDa', 'ContoA'])->orderBy('mov_data','desc')->get();
|
||||||
'SELECT
|
|
||||||
a.id,
|
|
||||||
a.mov_data,
|
|
||||||
a.mov_importo_dare,
|
|
||||||
a.mov_importo_avere,
|
|
||||||
a.mov_descrizione,
|
|
||||||
c.cat_name,
|
|
||||||
t.tag_name,
|
|
||||||
co.nomeConto,
|
|
||||||
(SELECT Count(entity_id) as quanti FROM gen_docs WHERE entity=0 AND entity_id = a.id) as quanti
|
|
||||||
FROM movimentis as a
|
|
||||||
JOIN tags as t ON a.mov_fk_tags=t.id
|
|
||||||
JOIN categories as c ON a.mov_fk_categoria=c.id
|
|
||||||
JOIN contos as co ON a.conto_id_da=co.id'
|
|
||||||
);
|
|
||||||
|
|
||||||
$query = $expression->getValue(DB::connection()->getQueryGrammar());
|
|
||||||
return DB::select($query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSaldo($date) {
|
public static function getSaldo($date) {
|
||||||
@ -182,17 +171,17 @@ JOIN categories as c ON a.mov_fk_categoria=c.id';
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function updateMovimenti($request) {
|
public static function updateMovimenti($request) {
|
||||||
DB::table('movimentis')
|
$updateData = [];
|
||||||
->where('id','=', $request['id'])
|
if (isset($request['mov_data'])) $updateData['mov_data'] = $request['mov_data'];
|
||||||
->update([
|
if (isset($request['mov_fk_categoria'])) $updateData['mov_fk_categoria'] = $request['mov_fk_categoria'];
|
||||||
'mov_data' => $request['mov_data'],
|
if (isset($request['mov_descrizione'])) $updateData['mov_descrizione'] = $request['mov_descrizione'];
|
||||||
'mov_fk_categoria'=>$request['mov_fk_categoria'],
|
if (isset($request['mov_importo_dare'])) $updateData['mov_importo_dare'] = $request['mov_importo_dare'];
|
||||||
'mov_descrizione'=>$request['mov_descrizione'],
|
if (isset($request['mov_importo_avere'])) $updateData['mov_importo_avere'] = $request['mov_importo_avere'];
|
||||||
'mov_importo_dare' => $request['mov_importo_dare'],
|
if (isset($request['mov_fk_tags'])) $updateData['mov_fk_tags'] = $request['mov_fk_tags'];
|
||||||
'mov_importo_avere' => $request['mov_importo_avere'],
|
if (isset($request['userid'])) $updateData['mov_inserito_da'] = $request['userid'];
|
||||||
'mov_fk_tags'=>$request['mov_fk_tags'],
|
|
||||||
'mov_inserito_da'=>$request['userid'],
|
self::where('id', $request['id'])->update($updateData);
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function deleteMovimento($id) {
|
public static function deleteMovimento($id) {
|
||||||
@ -203,23 +192,27 @@ JOIN categories as c ON a.mov_fk_categoria=c.id';
|
|||||||
|
|
||||||
public static function listByCatMonth($month,$cat,$year) {
|
public static function listByCatMonth($month,$cat,$year) {
|
||||||
|
|
||||||
$expression= DB::raw('SELECT
|
// $expression= DB::raw('SELECT
|
||||||
a.id,
|
// a.id,
|
||||||
a.mov_data,
|
// a.mov_data,
|
||||||
a.mov_importo_dare,
|
// a.mov_importo_dare,
|
||||||
a.mov_importo_avere,
|
// a.mov_importo_avere,
|
||||||
a.mov_descrizione,
|
// a.mov_descrizione,
|
||||||
c.cat_name,
|
// c.cat_name,
|
||||||
t.tag_name,
|
// t.tag_name,
|
||||||
(SELECT Count(entity_id) as quanti FROM gen_docs WHERE entity=0 AND entity_id = a.id) as quanti
|
// (SELECT Count(entity_id) as quanti FROM gen_docs WHERE entity=0 AND entity_id = a.id) as quanti
|
||||||
FROM movimentis as a
|
// FROM movimentis as a
|
||||||
JOIN tags as t ON a.mov_fk_tags=t.id
|
// JOIN tags as t ON a.mov_fk_tags=t.id
|
||||||
JOIN categories as c ON a.mov_fk_categoria=c.id
|
// JOIN categories as c ON a.mov_fk_categoria=c.id
|
||||||
WHERE Month(a.mov_data)='.$month.' AND Year(a.mov_data)='.$year.' AND a.mov_fk_categoria='.$cat
|
// WHERE Month(a.mov_data)='.$month.' AND Year(a.mov_data)='.$year.' AND a.mov_fk_categoria='.$cat
|
||||||
);
|
// );
|
||||||
$query = $expression->getValue(DB::connection()->getQueryGrammar());
|
// $query = $expression->getValue(DB::connection()->getQueryGrammar());
|
||||||
return DB::select($query);
|
// return DB::select($query);
|
||||||
|
return self::with(['Tags', 'Categorie'])
|
||||||
|
->whereMonth('mov_data', $month)
|
||||||
|
->whereYear('mov_data', $year)
|
||||||
|
->where('mov_fk_categoria', $cat)
|
||||||
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function listByCategory($cat) {
|
public static function listByCategory($cat) {
|
||||||
@ -393,10 +386,17 @@ JOIN categories as c ON a.mov_fk_categoria=c.id';
|
|||||||
// Ritorna gli anni presenti nei movimenti
|
// Ritorna gli anni presenti nei movimenti
|
||||||
public static function getYearsFromMovimenti()
|
public static function getYearsFromMovimenti()
|
||||||
{
|
{
|
||||||
return self::selectRaw('YEAR(mov_data) as anno')
|
if (env('DB_CONNECTION')=='mysql') {
|
||||||
|
return self::selectRaw('DISTINCT YEAR(mov_data) as anno')
|
||||||
|
->orderBy('anno', 'desc')
|
||||||
|
->get();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return self::selectRaw("strftime('%Y', mov_data) as anno")
|
||||||
->distinct()
|
->distinct()
|
||||||
->orderBy('anno', 'desc')
|
->orderBy('anno', 'desc')
|
||||||
->get();
|
->get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,162 +1,87 @@
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#listamovimenti').DataTable({
|
$('#listamovimenti').DataTable({
|
||||||
"responsive": true,
|
responsive: true,
|
||||||
columnDefs: [
|
columnDefs: [{
|
||||||
{
|
target: 0,
|
||||||
target: 0,
|
render: DataTable.render.date(),
|
||||||
render: DataTable.render.date(),
|
}],
|
||||||
}
|
order: [[0, "desc"]]
|
||||||
],
|
|
||||||
"order": [[0, "desc"]]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// $('.select2').select2();
|
// $('.select2').select2();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(".draggable").draggable();
|
$(".draggable").draggable();
|
||||||
|
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var month = d.getMonth()+1;
|
var month = d.getMonth() + 1;
|
||||||
var day = d.getDate();
|
var day = d.getDate();
|
||||||
var strDate = d.getFullYear() + '-' +
|
var strDate = d.getFullYear() + '-' + (month < 10 ? '0' : '') + month + '-' + (day < 10 ? '0' : '') + day;
|
||||||
(month<10 ? '0' : '') + month + '-' +
|
|
||||||
(day<10 ? '0' : '') + day;
|
function fillSelect(url, selectName, selectedValue) {
|
||||||
|
$(selectName).empty();
|
||||||
|
$.getJSON(url, {}, function(items) {
|
||||||
|
$.each(items, function(i, item) {
|
||||||
|
var label = item.cat_name || item.tag_name || item.nomeConto;
|
||||||
|
$(selectName).append(new Option(label, item.id));
|
||||||
|
});
|
||||||
|
if (selectedValue) {
|
||||||
|
$(selectName).val(selectedValue).trigger('change');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetForm(formSelector, dateValue) {
|
||||||
|
$(formSelector).find('input[type="text"], textarea, input[type="number"], input[type="date"], option').val('');
|
||||||
|
$(formSelector).find('input[type="date"]').val(dateValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openModal(tipo, actionUrl, catUrl, tagUrl, contoUrl, modalTitle) {
|
||||||
|
resetForm('#form', strDate);
|
||||||
|
$('#myModal').modal('show');
|
||||||
|
$('.modal-title').text(modalTitle);
|
||||||
|
$('#form').attr('action', actionUrl);
|
||||||
|
fillSelect(catUrl, "select[name='mov_fk_categoria']");
|
||||||
|
fillSelect(tagUrl, "select[name='mov_fk_tags']");
|
||||||
|
fillSelect(contoUrl, "select[name='conto_id']");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '.open_modal_spesa', function() {
|
$(document).on('click', '.open_modal_spesa', function() {
|
||||||
console.log(strDate);
|
openModal('spesa', '/admin/movimenti/spesa', '/admin/service/catlistSpesa', '/admin/service/taglist', '/admin/service/contolist', 'Nuovo movimento in uscita');
|
||||||
$("#categoria").empty();
|
$('#importo').attr('name', 'mov_importo_dare');
|
||||||
$("#tags").empty();
|
|
||||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"],option').val("");
|
|
||||||
$('#form').find('input[type="date"]').val(strDate);
|
|
||||||
$('#myModal').modal('show');
|
|
||||||
$('.modal-title').text(' Nuovo movimento in uscita');
|
|
||||||
$('#form').attr('action', '/admin/movimenti/spesa');
|
|
||||||
$.getJSON("/admin/service/catlistSpesa", {}, function(cats) {
|
|
||||||
$.each(cats, function(i, cat) {
|
|
||||||
$("select[name='mov_fk_categoria']").append(
|
|
||||||
new Option(cat.cat_name, cat.id)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
$.getJSON("/admin/service/taglist", {}, function(tags) {
|
|
||||||
$.each(tags, function(i, tag) {
|
|
||||||
$("select[name='mov_fk_tags']").append(
|
|
||||||
new Option(tag.tag_name, tag.id)
|
|
||||||
)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
$.getJSON("/admin/service/contolist", {}, function(contis) {
|
|
||||||
$.each(contis, function(i, conto) {
|
|
||||||
$("select[name='conto_id']").append(
|
|
||||||
new Option(conto.nomeConto, conto.id)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.open_modal_entrata', function() {
|
$(document).on('click', '.open_modal_entrata', function() {
|
||||||
console.log(strDate);
|
openModal('entrata', '/admin/movimenti/entrata', '/admin/service/catlistEntrata', '/admin/service/taglist', '/admin/service/contolist', 'Nuovo movimento in entrata');
|
||||||
$("#categoria").empty();
|
$('#importo').attr('name', 'mov_importo_avere');
|
||||||
$("#tags").empty();
|
|
||||||
$('#form').find('input[type="text"], textarea, input[type="number"],option').val("");
|
|
||||||
$('#form').find('input[type="date"]').val(strDate);
|
|
||||||
$('#myModal').modal('show');
|
|
||||||
$('.modal-title').text('Nuovo movimento in entrata');
|
|
||||||
$('#form').attr('action', '/admin/movimenti/entrata');
|
|
||||||
$.getJSON("/admin/service/catlistEntrata", {}, function(data) {
|
|
||||||
$.each(data, function(i, item) {
|
|
||||||
$("select[name='mov_fk_categoria']").append(
|
|
||||||
new Option(item.cat_name, item.id)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
$.getJSON("/admin/service/taglist", {}, function(data) {
|
|
||||||
$.each(data, function(i, item) {
|
|
||||||
$("select[name='mov_fk_tags']").append(
|
|
||||||
new Option(item.tag_name, item.id)
|
|
||||||
)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
$.getJSON("/admin/service/contolist", {}, function(contis) {
|
|
||||||
$.each(contis, function(i, conto) {
|
|
||||||
$("select[name='conto_id']").append(
|
|
||||||
new Option(conto.nomeConto, conto.id)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Modifica movimento
|
|
||||||
$(document).on('click', '.open_modal_modifica', function() {
|
$(document).on('click', '.open_modal_modifica', function() {
|
||||||
var url = "/admin/movimenti/modify";
|
|
||||||
var riga_id = $(this).val();
|
var riga_id = $(this).val();
|
||||||
$("#categoria").empty();
|
$.getJSON('/admin/movimenti/modify/' + riga_id, function(data) {
|
||||||
$("#tags").empty();
|
resetForm('#form', data[0].mov_data.substring(0, 10));
|
||||||
$.getJSON(url + '/' + riga_id, function(data) {
|
fillSelect('/admin/service/catlist', "select[name='mov_fk_categoria']", data[0].cat_name);
|
||||||
// success data
|
fillSelect('/admin/service/taglist', "select[name='mov_fk_tags']", data[0].tag_name);
|
||||||
console.log(data[0]);
|
fillSelect('/admin/service/contolist', "select[name='conto_id']", data[0].nomeConto);
|
||||||
$.getJSON("/admin/service/taglist", {}, function(tags) {
|
|
||||||
$.each(tags, function(i, tag) {
|
|
||||||
$("select[name='mov_fk_tags']").append(
|
|
||||||
new Option(tag.tag_name, tag.id)
|
|
||||||
)
|
|
||||||
$('#tags')
|
|
||||||
.find('option:contains(' + data[0].tag_name + ')')
|
|
||||||
.prop('selected', true)
|
|
||||||
.trigger('change');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
$.getJSON("/admin/service/catlist", {}, function(cats) {
|
|
||||||
$.each(cats, function(i, cat) {
|
|
||||||
$("select[name='mov_fk_categoria']").append(
|
|
||||||
new Option(cat.cat_name, cat.id)
|
|
||||||
)
|
|
||||||
$('#categoria')
|
|
||||||
.find('option:contains(' + data[0].cat_name + ')')
|
|
||||||
.prop('selected', true)
|
|
||||||
.trigger('change');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
$.getJSON("/admin/service/contolist", {}, function(contis) {
|
|
||||||
$.each(contis, function(i, conto) {
|
|
||||||
$("select[name='conto_id']").append(
|
|
||||||
new Option(conto.nomeConto, conto.id)
|
|
||||||
)
|
|
||||||
$('#conto_id')
|
|
||||||
.find('option:contains(' + data[0].nomeConto + ')')
|
|
||||||
.prop('selected', true)
|
|
||||||
.trigger('change');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
$('.modal-title').text('Modifica movimento');
|
|
||||||
$('#data').val(data[0].mov_data.substring(0,10));
|
|
||||||
$('#descrizione').val(data[0].mov_descrizione);
|
$('#descrizione').val(data[0].mov_descrizione);
|
||||||
$('#importo').val(data[0].mov_importo_dare);
|
|
||||||
|
|
||||||
$('#myModal').modal('show');
|
// Imposta importo e name in base a DARE/AVERE
|
||||||
// $('.panel-heading').text('Modifica movimento');
|
if (data[0].mov_importo_dare && parseFloat(data[0].mov_importo_dare) !== 0) {
|
||||||
|
$('#importo').val(data[0].mov_importo_dare);
|
||||||
|
$('#importo').attr('name', 'mov_importo_dare');
|
||||||
|
} else if (data[0].mov_importo_avere && parseFloat(data[0].mov_importo_avere) !== 0) {
|
||||||
|
$('#importo').val(data[0].mov_importo_avere);
|
||||||
|
$('#importo').attr('name', 'mov_importo_avere');
|
||||||
|
} else {
|
||||||
|
$('#importo').val('');
|
||||||
|
$('#importo').attr('name', 'mov_importo');
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.modal-title').text('Modifica movimento');
|
||||||
$('#form').attr('action', '/admin/movimenti/modify');
|
$('#form').attr('action', '/admin/movimenti/modify');
|
||||||
$('#form').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
$('#form').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
||||||
|
$('#myModal').modal('show');
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
$.getJSON("/admin/service/taglist", {}, function(data) {
|
|
||||||
$.each(data, function(i, item) {
|
|
||||||
$("select[name='mov_fk_tags']").append(
|
|
||||||
new Option(item.tag_name, item.id)
|
|
||||||
)
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
*/
|
|
||||||
|
@ -44,12 +44,14 @@
|
|||||||
@foreach( $movimenti as $movimento )
|
@foreach( $movimenti as $movimento )
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $movimento->mov_data}}</td>
|
<td>{{ $movimento->mov_data}}</td>
|
||||||
<td>{{ $movimento->cat_name }}</td>
|
<td>{{ $movimento->Categorie->cat_name ?? ''}}</td>
|
||||||
<td>{{ $movimento->nomeContoDare ?? '' }}</td>
|
<!-- Uso l'operatore di coalescenza nulla per evitare errori se il conto non esiste -->
|
||||||
<td>{{ $movimento->nomeContoAvere ?? '' }}</td>
|
<td>{{ $movimento->ContoDa->nomeConto ?? '' }}</td>
|
||||||
|
<td>{{ $movimento->ContoA->nomeConto ?? '' }}</td>
|
||||||
|
<!-- Uso l'operatore di coalescenza nulla per evitare errori se il tag non esiste -->
|
||||||
<td>{{ $movimento->mov_descrizione }}</td>
|
<td>{{ $movimento->mov_descrizione }}</td>
|
||||||
<td>{{ $movimento->mov_importo_dare ." €"}}</td>
|
<td>{{ $movimento->mov_importo_dare ." €"}}</td>
|
||||||
<td>{{ $movimento->mov_importo_avere." €" }}</td>
|
<td>{{ $movimento->mov_importo_avere." €"}}</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-warning btn-detail open_modal_modifica" value="{{ $movimento->id }}"><i class="fa-solid fa-pencil"></i></button>
|
<button class="btn btn-warning btn-detail open_modal_modifica" value="{{ $movimento->id }}"><i class="fa-solid fa-pencil"></i></button>
|
||||||
<a class="btn btn-danger" href="/admin/movimenti/delete?id={{ $movimento->id }}"><i class="fa-solid fa-trash-can"></i></a>
|
<a class="btn btn-danger" href="/admin/movimenti/delete?id={{ $movimento->id }}"><i class="fa-solid fa-trash-can"></i></a>
|
||||||
|
@ -13,12 +13,14 @@
|
|||||||
<h3 class="card-title">Regole di Importazione</h3>
|
<h3 class="card-title">Regole di Importazione</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered" id="importRulesTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Pattern</th>
|
<th>Pattern</th>
|
||||||
<th>Descrizione</th>
|
<th>Descrizione</th>
|
||||||
|
<th>Categoria</th>
|
||||||
|
|
||||||
<th>Azioni</th>
|
<th>Azioni</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -28,6 +30,7 @@
|
|||||||
<td>{{ $rule->id }}</td>
|
<td>{{ $rule->id }}</td>
|
||||||
<td>{{ $rule->pattern }}</td>
|
<td>{{ $rule->pattern }}</td>
|
||||||
<td>{{ $rule->description }}</td>
|
<td>{{ $rule->description }}</td>
|
||||||
|
<td>{{ \App\Models\Categorie::find($rule->category_id)->cat_name ?? 'N/A' }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ route('import_rules.edit', $rule->id) }}" class="btn btn-primary btn-sm">Modifica</a>
|
<a href="{{ route('import_rules.edit', $rule->id) }}" class="btn btn-primary btn-sm">Modifica</a>
|
||||||
<form action="{{ route('import_rules.destroy', $rule->id) }}" method="POST" style="display:inline;">
|
<form action="{{ route('import_rules.destroy', $rule->id) }}" method="POST" style="display:inline;">
|
||||||
@ -47,3 +50,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@section('js')
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#importRulesTable').DataTable({
|
||||||
|
responsive: true,
|
||||||
|
|
||||||
|
order: [[0, "desc"]]
|
||||||
|
});
|
||||||
|
// $('.select2').select2();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user