Replace native with primary where possible

This commit is contained in:
Sander Dorigo
2025-08-01 12:31:01 +02:00
parent 65dcad6898
commit 6278662014
59 changed files with 430 additions and 430 deletions

View File

@@ -121,9 +121,9 @@ export default {
this.administration = {
id: current.id,
title: current.attributes.title,
currency_id: parseInt(current.attributes.native_currency_id),
currency_code: current.attributes.native_currency_code,
currency_name: current.attributes.native_currency_name,
currency_id: parseInt(current.attributes.primary_currency_id),
currency_code: current.attributes.primary_currency_code,
currency_name: current.attributes.primary_currency_name,
};
this.pageTitle = this.administration.title;
});
@@ -143,7 +143,7 @@ export default {
// collect data
let data = {
title: this.administration.title,
native_currency_id: parseInt(this.administration.currency_id),
primary_currency_id: parseInt(this.administration.currency_id),
};
// post!
@@ -154,7 +154,7 @@ export default {
this.error_message = error.response.data.message;
this.errors.title = error.response.data.errors.title;
this.errors.native_currency_id = error.response.data.errors.native_currency_id;
this.errors.primary_currency_id = error.response.data.errors.primary_currency_id;
// enable button again
$('#submitButton').prop("disabled", false);

View File

@@ -48,7 +48,7 @@
<thead>
<tr>
<th>{{ $t('list.title') }}</th>
<th>{{ $t('list.native_currency') }}</th>
<th>{{ $t('list.primary_currency') }}</th>
<th class="hidden-sm hidden-xs">&nbsp;</th>
</tr>
</thead>
@@ -106,8 +106,8 @@ export default {
let administration = {
id: current.id,
title: current.attributes.title,
currency_code: current.attributes.native_currency_code,
currency_name: current.attributes.native_currency_name,
currency_code: current.attributes.primary_currency_code,
currency_name: current.attributes.primary_currency_name,
};
this.administrations.push(administration);
}

View File

@@ -407,7 +407,7 @@ let index = function () {
interest: current.attributes.interest,
interest_period: current.attributes.interest_period,
balance: current.attributes.balance,
native_balance: current.attributes.native_balance,
pc_balance: current.attributes.pc_balance,
balances: current.attributes.balances,
};
// get group info:

View File

@@ -39,7 +39,7 @@ export default () => ({
loading: false,
loadingAccounts: false,
accountList: [],
convertToNative: false,
convertToPrimary: false,
chartOptions: null,
localCacheKey(type) {
return 'ds_accounts_' + type;
@@ -48,7 +48,7 @@ export default () => ({
eventListeners: {
['@convert-to-native.window'](event){
console.log('I heard that! (dashboard/accounts)');
this.convertToNative = event.detail;
this.convertToPrimary = event.detail;
this.accountList = [];
chartData = null;
this.loadChart();
@@ -60,7 +60,7 @@ export default () => ({
getFreshData() {
const start = new Date(window.store.get('start'));
const end = new Date(window.store.get('end'));
const chartCacheKey = getCacheKey(this.localCacheKey('chart'), {convertToNative: this.convertToNative, start: start, end: end})
const chartCacheKey = getCacheKey(this.localCacheKey('chart'), {convertToPrimary: this.convertToPrimary, start: start, end: end})
const cacheValid = window.store.get('cacheValid');
let cachedData = window.store.get(chartCacheKey);
@@ -100,18 +100,18 @@ export default () => ({
dataset.label = current.label;
// use the "native" currency code and use the "native_entries" as array
if (this.convertToNative) {
if (this.convertToPrimary) {
currencies.push(current.native_currency_code);
dataset.currency_code = current.native_currency_code;
if(!current.hasOwnProperty('native_entries')) {
console.error('No native entries ('+this.convertToNative+') found for account: ', current);
console.error('No native entries ('+this.convertToPrimary+') found for account: ', current);
}
if(current.hasOwnProperty('native_entries')) {
collection = Object.values(current.native_entries);
}
yAxis = 'y' + current.native_currency_code;
}
if (!this.convertToNative) {
if (!this.convertToPrimary) {
yAxis = 'y' + current.currency_code;
dataset.currency_code = current.currency_code;
currencies.push(current.currency_code);
@@ -295,9 +295,9 @@ export default () => ({
getConfiguration('cer.enabled', false) // 3
]).then((values) => {
//console.log('accounts after promises');
this.convertToNative = values[1] && values[3];
this.convertToPrimary = values[1] && values[3];
afterPromises = true;
//console.log('convertToNative in accounts.js: ', values);
//console.log('convertToPrimary in accounts.js: ', values);
// main dashboard chart:
this.loadChart();
@@ -318,7 +318,7 @@ export default () => ({
if (!afterPromises) {
return;
}
// console.log('accounts observe convertToNative');
// console.log('accounts observe convertToPrimary');
this.loadChart();
this.loadAccounts();
});

View File

@@ -31,13 +31,13 @@ export default () => ({
billBox: {paid: [], unpaid: []},
leftBox: {left: [], perDay: []},
netBox: {net: []},
convertToNative: false,
convertToPrimary: false,
loading: false,
boxData: null,
boxOptions: null,
eventListeners: {
['@convert-to-native.window'](event){
this.convertToNative = event.detail;
this.convertToPrimary = event.detail;
this.accountList = [];
console.log('I heard that! (dashboard/boxes)');
this.boxData = null;
@@ -49,7 +49,7 @@ export default () => ({
const start = new Date(window.store.get('start'));
const end = new Date(window.store.get('end'));
// TODO cache key is hard coded, problem?
const boxesCacheKey = getCacheKey('ds_boxes_data', {convertToNative: this.convertToNative, start: start, end: end});
const boxesCacheKey = getCacheKey('ds_boxes_data', {convertToPrimary: this.convertToPrimary, start: start, end: end});
cleanupCache();
//const cacheValid = window.store.get('cacheValid');
@@ -166,7 +166,7 @@ export default () => ({
Promise.all([getVariable('viewRange'), getVariable('convert_to_native', false)]).then((values) => {
// console.log('boxes after promises');
afterPromises = true;
this.convertToNative = values[1];
this.convertToPrimary = values[1];
this.loadBoxes();
});
window.store.observe('end', () => {
@@ -181,8 +181,8 @@ export default () => ({
if (!afterPromises) {
return;
}
// console.log('boxes observe convertToNative');
this.convertToNative = newValue;
// console.log('boxes observe convertToPrimary');
this.convertToPrimary = newValue;
this.loadBoxes();
});
},

View File

@@ -34,7 +34,7 @@ let afterPromises = false;
export default () => ({
loading: false,
convertToNative: false,
convertToPrimary: false,
loadChart() {
if (true === this.loading) {
return;
@@ -52,7 +52,7 @@ export default () => ({
eventListeners: {
['@convert-to-native.window'](event){
console.log('I heard that! (dashboard/budgets)');
this.convertToNative = event.detail;
this.convertToPrimary = event.detail;
chartData = null;
this.loadChart();
}
@@ -69,7 +69,7 @@ export default () => ({
getFreshData() {
const start = new Date(window.store.get('start'));
const end = new Date(window.store.get('end'));
const cacheKey = getCacheKey('ds_bdg_chart', {convertToNative: this.convertToNative, start: start, end: end});
const cacheKey = getCacheKey('ds_bdg_chart', {convertToPrimary: this.convertToPrimary, start: start, end: end});
//const cacheValid = window.store.get('cacheValid');
const cacheValid = false;
let cachedData = window.store.get(cacheKey);
@@ -168,7 +168,7 @@ export default () => ({
init() {
Promise.all([getVariable('convert_to_native', false)]).then((values) => {
this.convertToNative = values[0];
this.convertToPrimary = values[0];
afterPromises = true;
if (false === this.loading) {
this.loadChart();
@@ -188,8 +188,8 @@ export default () => ({
if (!afterPromises) {
return;
}
// console.log('boxes observe convertToNative');
this.convertToNative = newValue;
// console.log('boxes observe convertToPrimary');
this.convertToPrimary = newValue;
if (false === this.loading) {
this.loadChart();
}

View File

@@ -32,12 +32,12 @@ let afterPromises = false;
export default () => ({
loading: false,
convertToNative: false,
convertToPrimary: false,
eventListeners: {
['@convert-to-native.window'](event){
console.log('I heard that! (dashboard/categories)');
this.convertToNative = event.detail;
this.convertToPrimary = event.detail;
chartData = null;
this.loadChart();
}
@@ -146,7 +146,7 @@ export default () => ({
getFreshData() {
const start = new Date(window.store.get('start'));
const end = new Date(window.store.get('end'));
const cacheKey = getCacheKey('ds_ct_chart', {convertToNative: this.convertToNative, start: start, end: end});
const cacheKey = getCacheKey('ds_ct_chart', {convertToPrimary: this.convertToPrimary, start: start, end: end});
const cacheValid = window.store.get('cacheValid');
let cachedData = window.store.get(cacheKey);
@@ -183,7 +183,7 @@ export default () => ({
init() {
// console.log('categories init');
Promise.all([getVariable('convert_to_native', false),]).then((values) => {
this.convertToNative = values[0];
this.convertToPrimary = values[0];
afterPromises = true;
this.loadChart();
});
@@ -198,7 +198,7 @@ export default () => ({
if (!afterPromises) {
return;
}
this.convertToNative = newValue;
this.convertToPrimary = newValue;
this.loadChart();
});
},

View File

@@ -69,7 +69,7 @@ Chart.register({
let index = function () {
return {
convertToNative: false,
convertToPrimary: false,
saveNativeSettings(event) {
let target = event.currentTarget || event.target;
setVariable('convert_to_native',target.checked).then(() => {
@@ -79,7 +79,7 @@ let index = function () {
},
init() {
Promise.all([getVariable('convert_to_native', false)]).then((values) => {
this.convertToNative = values[0];
this.convertToPrimary = values[0];
});
}
}

View File

@@ -29,14 +29,14 @@ const PIGGY_CACHE_KEY = 'ds_pg_data';
export default () => ({
loading: false,
convertToNative: false,
convertToPrimary: false,
sankeyGrouping: 'account',
piggies: [],
getFreshData() {
const start = new Date(window.store.get('start'));
const end = new Date(window.store.get('end'));
// needs user data.
const cacheKey = getCacheKey(PIGGY_CACHE_KEY, {convertToNative: this.convertToNative, start: start, end: end});
const cacheKey = getCacheKey(PIGGY_CACHE_KEY, {convertToPrimary: this.convertToPrimary, start: start, end: end});
const cacheValid = window.store.get('cacheValid');
let cachedData = window.store.get(cacheKey);
@@ -96,14 +96,14 @@ export default () => ({
id: current.id,
name: current.attributes.name,
percentage: parseInt(current.attributes.percentage),
amount: this.convertToNative ? current.attributes.native_current_amount : current.attributes.current_amount,
amount: this.convertToPrimary ? current.attributes.native_current_amount : current.attributes.current_amount,
// left to save
left_to_save: this.convertToNative ? current.attributes.native_left_to_save : current.attributes.left_to_save,
left_to_save: this.convertToPrimary ? current.attributes.native_left_to_save : current.attributes.left_to_save,
// target amount
target_amount: this.convertToNative ? current.attributes.native_target_amount : current.attributes.target_amount,
target_amount: this.convertToPrimary ? current.attributes.native_target_amount : current.attributes.target_amount,
// save per month
save_per_month: this.convertToNative ? current.attributes.native_save_per_month : current.attributes.save_per_month,
currency_code: this.convertToNative ? current.attributes.native_currency_code : current.attributes.currency_code,
save_per_month: this.convertToPrimary ? current.attributes.native_save_per_month : current.attributes.save_per_month,
currency_code: this.convertToPrimary ? current.attributes.native_currency_code : current.attributes.currency_code,
};
dataSet[groupName].piggies.push(piggy);
@@ -132,7 +132,7 @@ export default () => ({
Promise.all([getVariable('convert_to_native', false)]).then((values) => {
afterPromises = true;
this.convertToNative = values[0];
this.convertToPrimary = values[0];
this.loadPiggyBanks();
});
@@ -148,8 +148,8 @@ export default () => ({
if (!afterPromises) {
return;
}
// console.log('piggies observe convertToNative');
this.convertToNative = newValue;
// console.log('piggies observe convertToPrimary');
this.convertToPrimary = newValue;
this.loadPiggyBanks();
});
},

View File

@@ -33,7 +33,7 @@ let currencies = [];
let afterPromises = false;
let chart = null;
let transactions = [];
let convertToNative = false;
let convertToPrimary = false;
let translations = {
category: null,
unknown_category: null,
@@ -79,7 +79,7 @@ const getColor = function (key) {
// little helper
function getObjectName(type, name, direction, code) {
if(convertToNative) {
if(convertToPrimary) {
return getObjectNameWithoutCurrency(type, name, direction);
}
return getObjectNameWithCurrency(type, name, direction, code);
@@ -123,7 +123,7 @@ function getObjectNameWithCurrency(type, name, direction, code) {
function getLabel(type, name, code) {
if(convertToNative) {
if(convertToPrimary) {
return getLabelWithoutCurrency(type, name);
}
return getLabelWithCurrency(type, name, code);
@@ -157,13 +157,13 @@ function getLabelWithCurrency(type, name, code) {
export default () => ({
loading: false,
convertToNative: false,
convertToPrimary: false,
processedData: null,
eventListeners: {
['@convert-to-native.window'](event){
console.log('I heard that! (dashboard/sankey)');
this.convertToNative = event.detail;
convertToNative = event.detail;
this.convertToPrimary = event.detail;
convertToPrimary = event.detail;
this.processedData = null;
this.loadChart();
}
@@ -226,7 +226,7 @@ export default () => ({
let currencyCode = transaction.currency_code;
let amount = parseFloat(transaction.amount);
let flowKey;
if (this.convertToNative) {
if (this.convertToPrimary) {
currencyCode = transaction.native_currency_code;
amount = parseFloat(transaction.native_amount);
}
@@ -254,7 +254,7 @@ export default () => ({
if (!this.processedData.amounts.hasOwnProperty(flowKey)) {
this.processedData.amounts[flowKey] = {
from: translations.all_money + (this.convertToNative ? ' (' + currencyCode + ')' : ''),
from: translations.all_money + (this.convertToPrimary ? ' (' + currencyCode + ')' : ''),
to: budget,
amount: 0
};
@@ -319,7 +319,7 @@ export default () => ({
if (!this.processedData.amounts.hasOwnProperty(flowKey)) {
this.processedData.amounts[flowKey] = {
from: category,
to: translations.all_money + (this.convertToNative ? ' (' + currencyCode + ')' : ''),
to: translations.all_money + (this.convertToPrimary ? ' (' + currencyCode + ')' : ''),
amount: 0
};
}
@@ -363,7 +363,7 @@ export default () => ({
downloadTransactions(params) {
const start = new Date(window.store.get('start'));
const end = new Date(window.store.get('end'));
const cacheKey = getCacheKey(SANKEY_CACHE_KEY, {convertToNative: this.convertToNative, start: start, end: end});
const cacheKey = getCacheKey(SANKEY_CACHE_KEY, {convertToPrimary: this.convertToPrimary, start: start, end: end});
//console.log('Downloading page ' + params.page + '...');
const getter = new Get();
@@ -400,8 +400,8 @@ export default () => ({
// console.log('sankey init');
transactions = [];
Promise.all([getVariable('convert_to_native', false)]).then((values) => {
this.convertToNative = values[0];
convertToNative = values[0];
this.convertToPrimary = values[0];
convertToPrimary = values[0];
// some translations:
translations.all_money = i18next.t('firefly.all_money');
@@ -434,8 +434,8 @@ export default () => ({
if (!afterPromises) {
return;
}
// console.log('sankey observe convertToNative');
this.convertToNative = newValue;
// console.log('sankey observe convertToPrimary');
this.convertToPrimary = newValue;
this.loadChart();
});
},

View File

@@ -30,7 +30,7 @@ import i18next from "i18next";
let afterPromises = false;
let apiData = [];
let subscriptionData = {};
let convertToNative = false;
let convertToPrimary = false;
function addObjectGroupInfo(data) {
let objectGroupId = parseInt(data.object_group_id);
@@ -71,7 +71,7 @@ function parseBillInfo(data) {
pay_dates: parsePayDates(data.attributes.pay_dates),
paid: data.attributes.paid_dates.length > 0,
};
if(convertToNative) {
if(convertToPrimary) {
result.currency_code = data.attributes.native_currency_code;
}
@@ -211,7 +211,7 @@ function downloadSubscriptions(params) {
export default () => ({
loading: false,
convertToNative: false,
convertToPrimary: false,
subscriptions: [],
formatMoney(amount, currencyCode) {
return formatMoney(amount, currencyCode);
@@ -219,8 +219,8 @@ export default () => ({
eventListeners: {
['@convert-to-native.window'](event){
console.log('I heard that! (dashboard/subscriptions)');
this.convertToNative = event.detail;
convertToNative = event.detail;
this.convertToPrimary = event.detail;
convertToPrimary = event.detail;
this.startSubscriptions();
}
},
@@ -243,7 +243,7 @@ export default () => ({
let params = {
start: format(start, 'y-MM-dd'),
end: format(end, 'y-MM-dd'),
// convertToNative: this.convertToNative,
// convertToPrimary: this.convertToPrimary,
page: 1
};
downloadSubscriptions(params).then(() => {
@@ -314,8 +314,8 @@ export default () => ({
init() {
Promise.all([getVariable('convert_to_native', false)]).then((values) => {
this.convertToNative = values[0];
convertToNative = values[0];
this.convertToPrimary = values[0];
convertToPrimary = values[0];
afterPromises = true;
if (false === this.loading) {
@@ -336,7 +336,7 @@ export default () => ({
if (!afterPromises) {
return;
}
this.convertToNative = newValue;
this.convertToPrimary = newValue;
if (false === this.loading) {
this.startSubscriptions();
}

View File

@@ -194,7 +194,7 @@ return [
'journals_in_period_for_category' => 'All transactions for category :name between :start and :end',
'journals_in_period_for_tag' => 'All transactions for tag :tag between :start and :end',
'not_available_demo_user' => 'The feature you try to access is not available to demo users.',
'exchange_rate_instructions' => 'Asset account "@name" only accepts transactions in @native_currency. If you wish to use @foreign_currency instead, make sure that the amount in @native_currency is known as well:',
'exchange_rate_instructions' => 'Asset account "@name" only accepts transactions in @primary_currency. If you wish to use @foreign_currency instead, make sure that the amount in @primary_currency is known as well:',
'transfer_exchange_rate_instructions' => 'Source asset account "@source_name" only accepts transactions in @source_currency. Destination asset account "@dest_name" only accepts transactions in @dest_currency. You must provide the transferred amount correctly in both currencies.',
'transaction_data' => 'Transaction data',
'invalid_server_configuration' => 'Invalid server configuration',
@@ -1388,9 +1388,9 @@ return [
'pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?',
'pref_locale_help' => 'Firefly III allows you to set other local settings, like how currencies, numbers and dates are formatted. Entries in this list may not be supported by your system. Firefly III doesn\'t have the correct date settings for every locale; contact me for improvements.',
'pref_locale_no_demo' => 'This feature won\'t work for the demo user.',
'pref_convert_to_native' => 'Display amounts in your native currency',
'pref_convert_to_native_help' => 'This option will make Firefly III try to display and show your native currency in as many places as possible, converting amounts where necessary. This sacrifices accuracy for ease of use, because conversion is not always exact. Please verify that Firefly III has the necessary conversion rates on the "exchange rates"-page.',
'pref_convert_native_help' => 'Display native amounts',
'pref_convert_to_primary' => 'Display amounts in your primary currency',
'pref_convert_to_primary_help' => 'This option will make Firefly III try to display and show your primary currency in as many places as possible, converting amounts where necessary. This sacrifices accuracy for ease of use, because conversion is not always exact. Please verify that Firefly III has the necessary conversion rates on the "exchange rates"-page.',
'pref_convert_primary_help' => 'Display primary amounts',
'pref_custom_fiscal_year' => 'Fiscal year settings',
'pref_custom_fiscal_year_label' => 'Enabled',
'pref_custom_fiscal_year_help' => 'In countries that use a financial year other than January 1 to December 31, you can switch this on and specify start / end days of the fiscal year',
@@ -1496,9 +1496,9 @@ return [
'edit_administration_breadcrumb' => 'Edit financial administration ":title"',
'administrations_page_edit_sub_title' => 'Edit financial administration ":title"',
'administrations_page_edit_sub_title_js' => 'Edit financial administration "{title}"',
'temp_administrations_introduction' => 'Firefly III will soon get the ability to manage multiple financial administrations. Right now, you only have the one. You can set the title of this administration and its native currency. This replaces the previous setting where you would set your "default currency". This setting is now tied to the financial administration and can be different per administration.',
'temp_administrations_introduction_edit' => 'Currently, you can only set the "native currency" of the default financial administration. This replaces the "default currency" setting. This setting is now tied to the financial administration and can be different per administration.',
'administration_currency_form_help' => 'It may take a long time for the page to load if you change the native currency because transaction may need to be converted to your (new) native currency.',
'temp_administrations_introduction' => 'Firefly III will soon get the ability to manage multiple financial administrations. Right now, you only have the one. You can set the title of this administration and its primary currency. This replaces the previous setting where you would set your "default currency". This setting is now tied to the financial administration and can be different per administration.',
'temp_administrations_introduction_edit' => 'Currently, you can only set the "primary currency" of the default financial administration. This replaces the "default currency" setting. This setting is now tied to the financial administration and can be different per administration.',
'administration_currency_form_help' => 'It may take a long time for the page to load if you change the primary currency because transaction may need to be converted to your (new) primary currency.',
'flash_administration_updated' => 'Administration ":title" has been updated',
'flash_administration_created' => 'Administration ":title" has been created',
'flash_administration_deleted' => 'Administration ":title" has been deleted',
@@ -1648,7 +1648,7 @@ return [
'profile_personal_access_tokens' => 'Personal Access Tokens',
'profile_personal_access_token' => 'Personal Access Token',
'profile_oauth_confidential' => 'Confidential',
'profile_oauth_confidential_help' => 'Require the client to authenticate with a secret. Confidential clients can hold credentials in a secure way without exposing them to unauthorized parties. Public applications, such as native desktop or JavaScript SPA applications, are unable to hold secrets securely.',
'profile_oauth_confidential_help' => 'Require the client to authenticate with a secret. Confidential clients can hold credentials in a secure way without exposing them to unauthorized parties. Public applications, such as primary desktop or JavaScript SPA applications, are unable to hold secrets securely.',
'profile_personal_access_token_explanation' => 'Here is your new personal access token. This is the only time it will be shown so don\'t lose it! You may now use this token to make API requests.',
'profile_no_personal_access_token' => 'You have not created any personal access tokens.',
'profile_create_new_token' => 'Create new token',
@@ -1779,10 +1779,10 @@ return [
'updated_currency' => 'Currency :name updated',
'ask_site_owner' => 'Please ask :owner to add, remove or edit currencies.',
'currencies_intro' => 'Firefly III supports various currencies which you can set and enable here.',
'currencies_switch_default' => 'You can switch the native currency for your current administration on the "Financial administrations"-page.',
'currencies_switch_default' => 'You can switch the primary currency for your current administration on the "Financial administrations"-page.',
'make_default_currency' => 'Make default',
'default_currency' => 'default',
'native_currency_button' => 'native',
'primary_currency_button' => 'primary',
'currency_is_disabled' => 'Disabled',
'enable_currency' => 'Enable',
'disable_currency' => 'Disable',

View File

@@ -26,7 +26,7 @@ declare(strict_types=1);
return [
// new user:
'administration_currency' => 'Native currency',
'administration_currency' => 'Primary currency',
'bank_name' => 'Bank name',
'bank_balance' => 'Balance',
'current_balance' => 'Current balance',

View File

@@ -29,7 +29,7 @@ return [
'icon' => 'Icon',
'id' => 'ID',
'create_date' => 'Created at',
'native_currency' => 'Native currency',
'primary_currency' => 'Primary currency',
'update_date' => 'Updated at',
'updated_at' => 'Updated at',
'balance_before' => 'Balance before',

View File

@@ -141,7 +141,7 @@ return [
'not_in' => 'The selected :attribute is invalid.',
'numeric' => 'The :attribute must be a number.',
'scientific_notation' => 'The :attribute cannot use the scientific notation.',
'numeric_native' => 'The native amount must be a number.',
'numeric_primary' => 'The primary currency amount must be a number.',
'numeric_destination' => 'The destination amount must be a number.',
'numeric_source' => 'The source amount must be a number.',
'generic_invalid' => 'This value is invalid.',

View File

@@ -15,9 +15,9 @@
{{ trans('firefly.chart_account_in_period', {
balance: formatAmountBySymbol(balances.balance, currency.symbol, currency.decimal_places, true),
name: account.name|escape, start: start.isoFormat(monthAndDayFormat), end: end.isoFormat(monthAndDayFormat) })|raw }}
{% elseif balances.native_balance %}
{% elseif balances.pc_balance %}
{{ trans('firefly.chart_account_in_period', {
balance: formatAmountBySymbol(balances.native_balance, defaultCurrency.symbol, defaultCurrency.decimal_places, true),
balance: formatAmountBySymbol(balances.pc_balance, primaryCurrency.symbol, primaryCurrency.decimal_places, true),
name: account.name|escape, start: start.isoFormat(monthAndDayFormat), end: end.isoFormat(monthAndDayFormat) })|raw }}
{% endif %}
</h3>
@@ -148,8 +148,8 @@
<h3 class="box-title">{{ 'transactions'|_ }}
{% if balances.balance %}
({{ formatAmountBySymbol(balances.balance, currency.symbol, currency.decimal_places, true)|raw }})
{% elseif balances.native_balance %}
({{ formatAmountBySymbol(balances.native_balance, defaultCurrency.symbol, defaultCurrency.decimal_places, true)|raw }})
{% elseif balances.pc_balance %}
({{ formatAmountBySymbol(balances.pc_balance, primaryCurrency.symbol, primaryCurrency.decimal_places, true)|raw }})
{% endif %}
</h3>
</div>

View File

@@ -17,7 +17,7 @@
</div>
<div class="box-body">
{{ ExpandedForm.text('name') }}
{{ CurrencyForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
{{ CurrencyForm.currencyList('transaction_currency_id', primaryCurrency.id) }}
{{ ExpandedForm.amountNoCurrency('amount_min') }}
{{ ExpandedForm.amountNoCurrency('amount_max') }}
{{ ExpandedForm.date('date',phpdate('Y-m-d')) }}

View File

@@ -29,11 +29,11 @@
<td colspan="2">
{% set lowAmount = formatAmountByCurrency(object.data.currency,object.data.amount_min) %}
{% set highAmount = formatAmountByCurrency(object.data.currency,object.data.amount_max) %}
{% if(0 != object.data.native_amount_min) %}
{% set lowAmount = lowAmount ~ ' (' ~ formatAmountByCode(object.data.native_amount_min, defaultCurrency.code) ~ ')' %}
{% if(0 != object.data.pc_amount_min) %}
{% set lowAmount = lowAmount ~ ' (' ~ formatAmountByCode(object.data.pc_amount_min, primaryCurrency.code) ~ ')' %}
{% endif %}
{% if(0 != object.data.native_amount_max) %}
{% set highAmount = highAmount ~ ' (' ~ formatAmountByCode(object.data.native_amount_max, defaultCurrency.code) ~ ')' %}
{% if(0 != object.data.pc_amount_max) %}
{% set highAmount = highAmount ~ ' (' ~ formatAmountByCode(object.data.pc_amount_max, primaryCurrency.code) ~ ')' %}
{% endif %}
{{ trans('firefly.match_between_amounts', {low: lowAmount, high: highAmount })|raw }}
{{ 'repeats'|_ }}
@@ -67,9 +67,9 @@
<td>
{% for avg in yearAverage %}
{{ formatAmountBySymbol(avg.avg, avg.currency_symbol, avg.currency_decimal_places, true) }}
{% if convertToNative and 0 != avg.native_avg %}
({{ formatAmountBySymbol(avg.native_avg,
defaultCurrency.symbol, defaultCurrency.decimal_places, true) }})
{% if convertToPrimary and 0 != avg.pc_avg %}
({{ formatAmountBySymbol(avg.pc_avg,
primaryCurrency.symbol, primaryCurrency.decimal_places, true) }})
{% endif %}
<br>
@@ -81,9 +81,9 @@
<td>
{% for avg in overallAverage %}
{{ formatAmountBySymbol(avg.avg, avg.currency_symbol, avg.currency_decimal_places, true) }}
{% if convertToNative and 0 != avg.native_avg %}
({{ formatAmountBySymbol(avg.native_avg,
defaultCurrency.symbol, defaultCurrency.decimal_places, true) }})
{% if convertToPrimary and 0 != avg.pc_avg %}
({{ formatAmountBySymbol(avg.pc_avg,
primaryCurrency.symbol, primaryCurrency.decimal_places, true) }})
{% endif %}
<br>
{% endfor %}
@@ -185,7 +185,7 @@
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var billCurrencySymbol = "{{ convertToNative ? defaultCurrency.symbol : object.data.currency.symbol }}";
var billCurrencySymbol = "{{ convertToPrimary ? primaryCurrency.symbol : object.data.currency.symbol }}";
var billUrl = '{{ route('chart.bill.single', [object.data.id]) }}';
</script>
<script type="text/javascript" src="v1/js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>

View File

@@ -55,7 +55,7 @@
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">
{{ trans('firefly.total_available_budget_in_currency', {currency: defaultCurrency.name}) }}
{{ trans('firefly.total_available_budget_in_currency', {currency: primaryCurrency.name}) }}
<br>
<small>{{ trans('firefly.between_dates_breadcrumb', {start: start.isoFormat(monthAndDayFormat), end: end.isoFormat(monthAndDayFormat)}) }}</small>
</h3>
@@ -65,8 +65,8 @@
{# info about the amount budgeted #}
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<small>{{ 'budgeted'|_ }} ({{ 'see_below'|_ }}):
<span class="budgeted_amount" data-value="{{ budgeted }}" data-id="0" data-currency="{{ defaultCurrency.id }}">
{{ formatAmountBySymbol(budgeted, defaultCurrency.symbol, defaultCurrency.decimal_places) }}
<span class="budgeted_amount" data-value="{{ budgeted }}" data-id="0" data-currency="{{ primaryCurrency.id }}">
{{ formatAmountBySymbol(budgeted, primaryCurrency.symbol, primaryCurrency.decimal_places) }}
</span>
</small>
</div>
@@ -75,8 +75,8 @@
<small class="available_bar"
data-id="0">{{ trans('firefly.available_between', {start: start.isoFormat(monthAndDayFormat), end: end.isoFormat(monthAndDayFormat) }) }}
:
<span class="available_amount" data-id="0" data-value="0" data-currency="{{ defaultCurrency.id }}"
data-value="0">{{ formatAmountBySymbol(0, defaultCurrency.symbol, defaultCurrency.decimal_places, true) }}</span>
<span class="available_amount" data-id="0" data-value="0" data-currency="{{ primaryCurrency.id }}"
data-value="0">{{ formatAmountBySymbol(0, primaryCurrency.symbol, primaryCurrency.decimal_places, true) }}</span>
</small>
</div>
</div>
@@ -84,7 +84,7 @@
<div class="row spentInfo" data-id="0" data-value="{{ spent }}">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<small>{{ trans('firefly.spent_between', {start: start.isoFormat(monthAndDayFormat), end: end.isoFormat(monthAndDayFormat)}) }}
: {{ formatAmountBySymbol(spent, defaultCurrency.symbol, defaultCurrency.decimal_places) }} </small>
: {{ formatAmountBySymbol(spent, primaryCurrency.symbol, primaryCurrency.decimal_places) }} </small>
</div>
</div>
</div>
@@ -116,8 +116,8 @@
<small>{{ 'budgeted'|_ }}:
<span class="text-success money-positive budgeted_amount" data-id="{{ budget.id }}" data-currency="{{ budget.transaction_currency.id }}">
{{ formatAmountBySymbol(budget.budgeted, budget.transaction_currency.symbol, budget.transaction_currency.decimal_places, false) }}
{% if null != budget.native_budgeted %}
({{ formatAmountBySymbol(budget.native_budgeted, defaultCurrency.symbol, defaultCurrency.decimal_places, false) }})
{% if null != budget.pc_budgeted %}
({{ formatAmountBySymbol(budget.pc_budgeted, primaryCurrency.symbol, primaryCurrency.decimal_places, false) }})
{% endif %}
</span>
</small>
@@ -130,8 +130,8 @@
<span class="available_amount" data-id="{{ budget.id }}" data-currency="{{ budget.transaction_currency.id }}"
data-value="{{ budget.amount }}">
{{ formatAmountBySymbol(budget.amount, budget.transaction_currency.symbol, budget.transaction_currency.decimal_places, true) }}
{% if(convertToNative and 0 != budget.native_amount) %}
({{ formatAmountBySymbol(budget.native_amount, defaultCurrency.symbol, defaultCurrency.decimal_places, true) }})
{% if(convertToPrimary and 0 != budget.pc_amount) %}
({{ formatAmountBySymbol(budget.pc_amount, primaryCurrency.symbol, primaryCurrency.decimal_places, true) }})
{% endif %}
</span>
@@ -265,10 +265,10 @@
<td>
{% if 0==budget.budgeted|length %}
<div class="input-group">
<div class="input-group-addon">{{ defaultCurrency.symbol }}</div>
<input type="hidden" name="balance_currency_id" value="{{ defaultCurrency.id }}"/>
<div class="input-group-addon">{{ primaryCurrency.symbol }}</div>
<input type="hidden" name="balance_currency_id" value="{{ primaryCurrency.id }}"/>
<input class="form-control budget_amount" data-original="0" data-id="{{ budget.id }}"
data-currency="{{ defaultCurrency.id }}" data-limit="0" value="0" autocomplete="off" min="0" name="amount"
data-currency="{{ primaryCurrency.id }}" data-limit="0" value="0" autocomplete="off" min="0" name="amount"
type="number">
</div>
<span class="text-danger budget_warning" data-id="{{ budget.id }}" data-budgetLimit="{{ budgetLimit.id }}"

View File

@@ -158,18 +158,18 @@
<td style="width:33%;">{{ 'amount'|_ }}</td>
<td>
{{ formatAmountBySymbol(limit.amount, limit.transactionCurrency.symbol, limit.transactionCurrency.decimal_places) }}
{% if convertToNative and 0 != limit.native_amount %}
({{ formatAmountBySymbol(limit.native_amount, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != limit.pc_amount %}
({{ formatAmountBySymbol(limit.pc_amount, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
</td>
</tr>
<tr>
<td style="width:33%;">{{ 'spent'|_ }}</td>
<td>
{% if convertToNative %}
{% if convertToPrimary %}
{{ formatAmountBySymbol(limit.spent, limit.transactionCurrency.symbol, limit.transactionCurrency.decimal_places) }}
{% if limit.native_spent %}
({{ formatAmountBySymbol(limit.native_spent, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if limit.pc_spent %}
({{ formatAmountBySymbol(limit.pc_spent, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% else %}
{{ formatAmountBySymbol(limit.spent, limit.transactionCurrency.symbol, limit.transactionCurrency.decimal_places) }}

View File

@@ -63,8 +63,8 @@
<span class="text-muted">
{% endif %}
{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }})
{% if currency.id == defaultCurrency.id %}
<span class="label label-success" id="default-currency">{{ 'native_currency_button'|_ }}</span>
{% if currency.id == primaryCurrency.id %}
<span class="label label-success" id="default-currency">{{ 'primary_currency_button'|_ }}</span>
{% endif %}
{% if currency.userGroupEnabled == false %}

View File

@@ -8,7 +8,7 @@
class="btn btn-default dropdown-toggle currency-dropdown" id="currency_dropdown_{{ name }}"
data-toggle="dropdown"
aria-expanded="false">
<span id="currency_select_symbol_{{ name }}">{{ defaultCurrency.symbol|raw }}</span> <span
<span id="currency_select_symbol_{{ name }}">{{ primaryCurrency.symbol|raw }}</span> <span
class="caret"></span>
</button>
<ul class="dropdown-menu currency-dropdown-menu" role="menu">
@@ -30,5 +30,5 @@
{% include 'form.feedback' %}
</div>
<input type="hidden" name="amount_currency_id_{{ name }}" value="{{ defaultCurrency.id }}"/>
<input type="hidden" name="amount_currency_id_{{ name }}" value="{{ primaryCurrency.id }}"/>
</div>

View File

@@ -10,8 +10,8 @@
<div class="progress-bar" role="progressbar" aria-valuenow="{{ entry.percentage }}" aria-valuemin="0" aria-valuemax="100"
style="width: {{ entry.percentage }}%;">
{% if entry.percentage >=20 %}
{% if convertToNative and 0 != avg.native_amount %}
{{ formatAmountBySymbol(entry.native_amount, entry.native_currency_symbol, entry.native_currency_decimal_places, false) }}
{% if convertToPrimary and 0 != avg.pc_amount %}
{{ formatAmountBySymbol(entry.pc_amount, entry.primary_currency_symbol, entry.primary_currency_decimal_places, false) }}
({{ formatAmountBySymbol(entry.amount, entry.currency_symbol, entry.currency_decimal_places, false) }})
{% else %}
{{ formatAmountBySymbol(entry.amount, entry.currency_symbol, entry.currency_decimal_places, false) }}
@@ -20,8 +20,8 @@
</div>
{% if entry.percentage < 20 %}
&nbsp;
{% if convertToNative and 0 != avg.native_amount %}
{{ formatAmountBySymbol(entry.native_amount, entry.native_currency_symbol, entry.native_currency_decimal_places, false) }}
{% if convertToPrimary and 0 != avg.pc_amount %}
{{ formatAmountBySymbol(entry.pc_amount, entry.primary_currency_symbol, entry.primary_currency_decimal_places, false) }}
({{ formatAmountBySymbol(entry.amount, entry.currency_symbol, entry.currency_decimal_places, false) }})
{% else %}
{{ formatAmountBySymbol(entry.amount, entry.currency_symbol, entry.currency_decimal_places, false) }}

View File

@@ -69,12 +69,12 @@
{% for key, balance in account.endBalances %}
<span title="{{ key }}">
{% if 'balance' == key %}
{% if not convertToNative %}
{% if not convertToPrimary %}
{{ formatAmountBySymbol(balance, account.currency.symbol, account.currency.decimal_places) }}
{% endif %}
{% elseif 'native_balance' == key %}
{% if convertToNative %}
{{ formatAmountBySymbol(balance, defaultCurrency.symbol, defaultCurrency.decimal_places) }}
{% elseif 'pc_balance' == key %}
{% if convertToPrimary %}
{{ formatAmountBySymbol(balance, primaryCurrency.symbol, primaryCurrency.decimal_places) }}
{% endif %}
{% else %}
({{ formatAmountByCode(balance, key) }})
@@ -117,7 +117,7 @@
<span style="margin-right:5px;">
{% for key, balance in account.differences %}
<span title="{{ key }}">
{% if 'balance' == key or 'native_balance' == key %}
{% if 'balance' == key or 'pc_balance' == key %}
{{ formatAmountBySymbol(balance, account.currency.symbol, account.currency.currency.decimal_places) }}
{% else %}

View File

@@ -68,8 +68,8 @@
>
~ {{ formatAmountBySymbol((entry.amount_max + entry.amount_min)/2, entry.currency_symbol, entry.currency_decimal_places) }}
{% if '0' != entry.native_amount_max %}
(~ {{ formatAmountBySymbol((entry.native_amount_max + entry.native_amount_min)/2, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if '0' != entry.pc_amount_max %}
(~ {{ formatAmountBySymbol((entry.pc_amount_max + entry.pc_amount_min)/2, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
</span>
</td>

View File

@@ -12,8 +12,8 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% elseif transaction.transaction_type_type == 'Transfer' %}
@@ -24,16 +24,16 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% else %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% endif %}
{# transfer to #}
@@ -44,16 +44,16 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% endif %}
{% elseif transaction.transaction_type_type == 'Reconciliation' %}
@@ -62,16 +62,16 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% endif %}
{% else %}
@@ -79,8 +79,8 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and null != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, foreign_currency_.decimal_places) }})
{% if convertToPrimary and null != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount, primaryCurrency.symbol, foreign_currency_.decimal_places) }})
{% endif %}
{% endif %}
</span>

View File

@@ -63,23 +63,23 @@
{% for sum in group.sums %}
{% if group.transaction_type == 'Deposit' %}
{{ formatAmountBySymbol(sum.amount*-1, sum.currency_symbol, sum.currency_decimal_places) }}
{% if convertToNative and 0 != sum.native_amount %}
({{ formatAmountBySymbol(sum.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != sum.pc_amount %}
({{ formatAmountBySymbol(sum.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% if loop.index != group.sums|length %},{% endif %}
{% elseif group.transaction_type == 'Transfer' %}
<span class="text-info money-transfer">
{{ formatAmountBySymbol(sum.amount*-1, sum.currency_symbol, sum.currency_decimal_places, false) }}
{% if convertToNative and 0 != sum.native_amount %}
({{ formatAmountBySymbol(sum.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != sum.pc_amount %}
({{ formatAmountBySymbol(sum.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% if loop.index != group.sums|length %},{% endif %}
</span>
{% else %}
{{ formatAmountBySymbol(sum.amount, sum.currency_symbol, sum.currency_decimal_places) }}
{% if convertToNative and 0 != sum.native_amount %}
({{ formatAmountBySymbol(sum.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != sum.pc_amount %}
({{ formatAmountBySymbol(sum.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% if loop.index != group.sums|length %},{% endif %}
{% endif %}
@@ -172,9 +172,9 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{# native amount of deposit #}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{# primary currency amount of deposit #}
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{# transfer #}
{% elseif transaction.transaction_type_type == 'Transfer' %}
@@ -187,9 +187,9 @@
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %}
{# native amount of transfer #}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{# primary currency amount of transfer #}
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
</span>
{# opening balance #}
@@ -199,16 +199,16 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% endif %}
{# reconciliation #}
@@ -218,16 +218,16 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% endif %}
{# liability credit #}
@@ -237,16 +237,16 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% else %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount*-1, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount*-1, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% endif %}
@@ -260,9 +260,9 @@
{% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{# native amount of withdrawal #}
{% if convertToNative and 0 != transaction.native_amount %}
({{ formatAmountBySymbol(transaction.native_amount, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{# primary currency amount of withdrawal #}
{% if convertToPrimary and 0 != transaction.pc_amount %}
({{ formatAmountBySymbol(transaction.pc_amount, primaryCurrency.symbol, primaryCurrency.decimal_places) }})
{% endif %}
{% endif %}
</td>

View File

@@ -145,12 +145,12 @@
<td>{{ user.user_flags | raw }}</td>
</tr>
<tr>
<td>Native currency</td>
<td>{{ user.native.code }}</td>
<td>Primary currency</td>
<td>{{ user.primary.code }}</td>
</tr>
<tr>
<td>Convert to native currency?</td>
<td>{% if user.convert_to_native %}Enabled{% else %}Disabled{% endif %}</td>
<td>Convert to primary currency?</td>
<td>{% if user.convert_to_primary %}Enabled{% else %}Disabled{% endif %}</td>
</tr>
<tr>
<td>Session start</td>

View File

@@ -100,14 +100,14 @@
{{ ExpandedForm.date('fiscalYearStart',fiscalYearStart,{ 'label' : 'pref_fiscal_year_start_label'|_ }) }}
</div>
{# conversion back to native #}
{# conversion back to primary currency #}
{% if config('cer.enabled') %}
<div class="preferences-box">
<h3>{{ 'pref_convert_to_native'|_ }}</h3>
<h3>{{ 'pref_convert_to_primary'|_ }}</h3>
<p class="text-info">
{{ 'pref_convert_to_native_help'|_ }}
{{ 'pref_convert_to_primary_help'|_ }}
</p>
{{ ExpandedForm.checkbox('convertToNative','1',convertToNative,{ 'label' : 'pref_convert_native_help'|_ }) }}
{{ ExpandedForm.checkbox('convertToPrimary','1',convertToPrimary,{ 'label' : 'pref_convert_primary_help'|_ }) }}
</div>
{% endif %}
</div>

View File

@@ -91,7 +91,7 @@
{{ ExpandedForm.text('transaction_description') }}
{# transaction information (mandatory) #}
{{ CurrencyForm.currencyList('transaction_currency_id', defaultCurrency.id) }}
{{ CurrencyForm.currencyList('transaction_currency_id', primaryCurrency.id) }}
{{ ExpandedForm.amountNoCurrency('amount') }}
{# source account if withdrawal, or if transfer: #}

View File

@@ -11,7 +11,7 @@
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var allowedOpposingTypes = {{ allowedOpposingTypes|json_encode|raw }};
var accountToTypes = {{ accountToTypes|json_encode|raw }};
var defaultCurrency = {{ defaultCurrency.toArray()|json_encode|raw }};
var primaryCurrency = {{ primaryCurrency.toArray()|json_encode|raw }};
var cashAccountId = {{ cash.id }};
var previousUrl = '{{ previousUrl }}';
window.sourceId = {{ sourceId }};

View File

@@ -13,7 +13,7 @@
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var allowedOpposingTypes = {{ allowedOpposingTypes|json_encode|raw }};
var accountToTypes = {{ accountToTypes|json_encode|raw }};
var defaultCurrency = {{ defaultCurrency.toArray()|json_encode|raw }};
var primaryCurrency = {{ primaryCurrency.toArray()|json_encode|raw }};
var allowedSourceDests = {{ allowedSourceDests|json_encode|raw }};
var expectedSourceTypes = {{ expectedSourceTypes|json_encode|raw }};
var cashAccountId = {{ cash.id }};

View File

@@ -59,11 +59,11 @@
</div>
<div class="modal-body">
<div class="row mb-3">
<label class="col-sm-4 col-form-label">Convert to native</label>
<label class="col-sm-4 col-form-label">Convert to primary</label>
<div class="col-sm-8">
<div class="form-check form-switch form-check-inline">
<label>
<input class="form-check-input" x-model="convertToNative" type="checkbox" @change="saveNativeSettings"> <span
<input class="form-check-input" x-model="convertToPrimary" type="checkbox" @change="savePrimarySettings"> <span
>Yes no</span>
</label>
</div>

View File

@@ -75,7 +75,7 @@
<ul class="list-unstyled list-no-margin">
<template x-for="transaction in group.transactions">
<li>
@include('partials.elements.amount', ['convertToNative' => true,'type' => 'transaction.type','amount' => 'transaction.amount','native' => 'transaction.amount'])
@include('partials.elements.amount', ['convertToPrimary' => true,'type' => 'transaction.type','amount' => 'transaction.amount','primary' => 'transaction.amount'])
</li>
</template>
</ul>

View File

@@ -1,38 +1,38 @@
@if($convertToNative)
<template x-if="convertToNative">
@if($convertToPrimary)
<template x-if="convertToPrimary">
<span>
<template x-if="{{ $native }}_raw < 0">
<template x-if="{{ $primary }}_raw < 0">
<span class="text-danger">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="{{ $native }}_raw >= 0">
<template x-if="{{ $primary }}_raw >= 0">
<template x-if="'transfer' === {{ $type }}">
<span class="text-primary">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="'transfer' !== {{ $type }}">
<span class="text-success">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
</template>
</span>
</template>
<template x-if="!convertToNative">
<template x-if="!convertToPrimary">
<span>
<template x-if="{{ $amount }}_raw < 0">
<span>
<template x-if="'transfer' === {{ $type }}">
<span class="text-primary">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="'transfer' !== {{ $type }}">
<span class="text-danger">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
</span>
@@ -43,12 +43,12 @@
<span>
<template x-if="'transfer' === {{ $type }}">
<span class="text-primary">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
<template x-if="'transfer' !== {{ $type }}">
<span class="text-success">
<span x-text="{{ $native }}"></span>
<span x-text="{{ $primary }}"></span>
</span>
</template>
</span>

View File

@@ -8,8 +8,8 @@
<!-- is no longer loading currencies -->
<template x-if="!formStates.loadingCurrencies">
<select class="form-control" :id="'currency_code_' + index" x-model="transaction.currency_code">
<template x-for="currency in formData.nativeCurrencies">
<option :selected="currency.id == formData.defaultCurrency.id"
<template x-for="currency in formData.primaryCurrencies">
<option :selected="currency.id == formData.primaryCurrency.id"
:label="currency.name" :value="currency.code"
x-text="currency.name"></option>
</template>