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

View file

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