Fixed last places custom currency not showing

This commit is contained in:
Pinga 2025-02-11 16:27:12 +02:00
parent dd5aef123d
commit c806bdc73f
3 changed files with 22 additions and 17 deletions

View file

@ -431,7 +431,8 @@ class DapiController extends Controller
'registrar_id' => 'ph.registrar_id',
'description' => 'ph.description',
'amount' => 'ph.amount',
'registrar_name' => 'r.name'
'registrar_name' => 'r.name',
'currency' => 'r.currency'
];
// --- SORTING ---
@ -554,7 +555,8 @@ class DapiController extends Controller
ph.date,
ph.description,
ph.amount,
r.name AS registrar_name
r.name AS registrar_name,
r.currency
";
$dataSql = "
@ -597,7 +599,8 @@ class DapiController extends Controller
'fromS' => 'st.fromS',
'toS' => 'st.toS',
'amount' => 'st.amount',
'registrar_name' => 'r.name'
'registrar_name' => 'r.name',
'currency' => 'r.currency'
];
// --- SORTING ---
@ -724,7 +727,8 @@ class DapiController extends Controller
st.fromS,
st.toS,
st.amount,
r.name AS registrar_name
r.name AS registrar_name,
r.currency
";
$dataSql = "

View file

@ -6,8 +6,6 @@
<script>
var table;
document.addEventListener("DOMContentLoaded", function(){
currency = "{{ currency }} ";
var searchTerm = ""; // global variable to hold the search term
@ -73,11 +71,13 @@
{title:"{{ __('Registrar') }}", field:"registrar_name", resizable:false, headerSort:true, responsive:0},
{title:"{{ __('Date') }}", field:"date", resizable:false, headerSort:true, responsive:2},
{title:"{{ __('Description') }}", field:"description", resizable:false, headerSort:true, responsive:2, formatter:cell => (cell.getElement().setAttribute("title", cell.getValue() || ""), cell.getValue()?.length > 80 ? cell.getValue().substring(0, 80) + "..." : cell.getValue())},
{title:"{{ __('Amount') }}", field:"amount", resizable:false, headerSort:true, width:200, minWidth:100, responsive:0, formatter:"money", formatterParams:{
decimal:".",
thousand:" ",
symbol:currency,
negativeSign:true,
{title:"{{ __('Amount') }}", field:"amount", resizable:false, headerSort:true, width:200, minWidth:100, responsive:0, formatter:"money", formatterParams:function(cell){
return {
decimal: ".",
thousand: " ",
symbol: (cell.getRow().getData().currency || "$") + " ", // Ensures space after currency symbol
negativeSign: true
};
}},
]
});

View file

@ -5,7 +5,6 @@
<script src="/assets/js/jspdf.plugin.autotable.min.js" defer></script>
<script>
var table;
currency = "{{ currency }} ";
document.addEventListener("DOMContentLoaded", function(){
var searchTerm = ""; // global variable to hold the search term
@ -80,11 +79,13 @@
{title:"{{ __('Length') }}", field:"length_in_months", resizable:false, download:false, headerSort:true, responsive:2},
{title:"{{ __('From') }}", field:"fromS", resizable:false, headerSort:true, download:false, responsive:2},
{title:"{{ __('To') }}", field:"toS", resizable:false, headerSort:true, download:false, responsive:2},
{title:"{{ __('Amount') }}", field:"amount", resizable:false, headerSort:true, responsive:0, formatter:"money", formatterParams:{
decimal:".",
thousand:" ",
symbol:currency,
negativeSign:true,
{title:"{{ __('Amount') }}", field:"amount", resizable:false, headerSort:true, responsive:0, formatter:"money", formatterParams:function(cell){
return {
decimal: ".",
thousand: " ",
symbol: (cell.getRow().getData().currency || "$") + " ", // Ensures space after currency symbol
negativeSign: true
};
}},
]
});