mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-04-05 03:54:10 +00:00
Compare commits
6 Commits
develop-20
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf6e1cb0e1 | ||
|
|
6a53f5031c | ||
|
|
ae15ec01e8 | ||
|
|
fe3c7c47c4 | ||
|
|
68b934010c | ||
|
|
22852bd238 |
@@ -116,14 +116,14 @@ class AccountTransformer extends AbstractTransformer
|
||||
$balances = [];
|
||||
$balances[]
|
||||
= [
|
||||
'type' => 'current',
|
||||
'amount' => $currentBalance,
|
||||
'currency_id' => $account->meta['currency_id'] ?? null,
|
||||
'currency_code' => $account->meta['currency']?->code,
|
||||
'currency_symbol' => $account->meta['currency']?->symbol,
|
||||
'currency_decimal_places' => $account->meta['currency']?->decimal_places,
|
||||
'date' => $date->toAtomString(),
|
||||
];
|
||||
'type' => 'current',
|
||||
'amount' => $currentBalance,
|
||||
'currency_id' => $account->meta['currency_id'] ?? null,
|
||||
'currency_code' => $account->meta['currency']?->code,
|
||||
'currency_symbol' => $account->meta['currency']?->symbol,
|
||||
'currency_decimal_places' => $account->meta['currency']?->decimal_places,
|
||||
'date' => $date->toAtomString(),
|
||||
];
|
||||
if (null !== $nativeCurrentBalance) {
|
||||
$balances[] = [
|
||||
'type' => 'native_current',
|
||||
|
||||
@@ -78,8 +78,8 @@ return [
|
||||
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => 'develop/2025-07-23',
|
||||
'build_time' => 1753247028,
|
||||
'version' => 'develop/2025-07-24',
|
||||
'build_time' => 1753333121,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 26,
|
||||
|
||||
|
||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -3931,14 +3931,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz",
|
||||
"integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==",
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz",
|
||||
"integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"form-data": "^4.0.4",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
@@ -12502,7 +12502,7 @@
|
||||
"devDependencies": {
|
||||
"@johmun/vue-tags-input": "^2",
|
||||
"@vue/compiler-sfc": "^3.5.11",
|
||||
"axios": "^1.8",
|
||||
"axios": "^1.11",
|
||||
"bootstrap-sass": "^3",
|
||||
"cross-env": "^7.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"devDependencies": {
|
||||
"@johmun/vue-tags-input": "^2",
|
||||
"@vue/compiler-sfc": "^3.5.11",
|
||||
"axios": "^1.8",
|
||||
"axios": "^1.11",
|
||||
"bootstrap-sass": "^3",
|
||||
"cross-env": "^7.0",
|
||||
"font-awesome": "^4.7.0",
|
||||
|
||||
@@ -315,7 +315,7 @@ let index = function () {
|
||||
// need to find the input thing
|
||||
console.log('Clicked edit button for account on index #' + index + ' and field ' + fieldName);
|
||||
const querySelector = 'input[data-field="' + fieldName + '"][data-index="' + index + '"]';
|
||||
console.log(querySelector);
|
||||
// console.log(querySelector);
|
||||
const newValue = document.querySelectorAll(querySelector)[0].value ?? '';
|
||||
if ('' === newValue) {
|
||||
return;
|
||||
|
||||
@@ -201,7 +201,7 @@ export default () => ({
|
||||
balance.amount_formatted = formatMoney(balance.amount, balance.currency_code);
|
||||
return balance;
|
||||
});
|
||||
console.log(parent);
|
||||
// console.log(parent);
|
||||
|
||||
|
||||
// get groups for account:
|
||||
|
||||
@@ -76,7 +76,7 @@ export default () => ({
|
||||
continue;
|
||||
}
|
||||
let key = current.key;
|
||||
console.log('NOT NATIVE');
|
||||
// console.log('NOT NATIVE');
|
||||
if (key.startsWith('balance-in-')) {
|
||||
this.balanceBox.amounts.push(formatMoney(current.monetary_value, current.currency_code));
|
||||
continue;
|
||||
|
||||
@@ -44,6 +44,18 @@ function addObjectGroupInfo(data) {
|
||||
}
|
||||
}
|
||||
|
||||
function parsePayDates(list) {
|
||||
let newList = [];
|
||||
for(let i in list) {
|
||||
if (list.hasOwnProperty(i)) {
|
||||
let current = list[i];
|
||||
// convert to date object:
|
||||
newList.push(new Date(current));
|
||||
}
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
function parseBillInfo(data) {
|
||||
let result = {
|
||||
id: data.id,
|
||||
@@ -55,7 +67,7 @@ function parseBillInfo(data) {
|
||||
// paid transactions:
|
||||
transactions: [],
|
||||
// unpaid moments
|
||||
pay_dates: data.attributes.pay_dates,
|
||||
pay_dates: parsePayDates(data.attributes.pay_dates),
|
||||
paid: data.attributes.paid_dates.length > 0,
|
||||
};
|
||||
// set variables
|
||||
@@ -64,6 +76,7 @@ function parseBillInfo(data) {
|
||||
times: data.attributes.pay_dates.length,
|
||||
amount: result.expected_amount
|
||||
});
|
||||
// console.log(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -96,6 +109,21 @@ function parsePaidTransactions(paid_dates, bill) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function isInRange(bill) {
|
||||
let start = new Date(window.store.get('start'));
|
||||
let end = new Date(window.store.get('end'));
|
||||
for(let i in bill.pay_dates) {
|
||||
if (bill.pay_dates.hasOwnProperty(i)) {
|
||||
let currentDate = bill.pay_dates[i];
|
||||
//console.log(currentDate);
|
||||
if (currentDate >= start && currentDate <= end) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function downloadSubscriptions(params) {
|
||||
const getter = new Get();
|
||||
return getter.list(params)
|
||||
@@ -113,10 +141,18 @@ function downloadSubscriptions(params) {
|
||||
|
||||
// create and update the bill.
|
||||
let bill = parseBillInfo(current);
|
||||
|
||||
// if not yet paid, and pay_dates is not in current rage, ignore it.
|
||||
if (false === bill.paid && !isInRange(bill)) {
|
||||
console.warn('Bill "'+bill.name+'" is not paid and not in range, ignoring: ');
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
bill.transactions = parsePaidTransactions(current.attributes.paid_dates, bill);
|
||||
|
||||
subscriptionData[objectGroupId].bills.push(bill);
|
||||
if (0 === current.attributes.paid_dates.length) {
|
||||
if (false === bill.paid) {
|
||||
// bill is unpaid, count the "pay_dates" and multiply with the "amount".
|
||||
// since bill is unpaid, this can only be in currency amount and native currency amount.
|
||||
const totalAmount = current.attributes.pay_dates.length * bill.amount;
|
||||
@@ -132,6 +168,7 @@ function downloadSubscriptions(params) {
|
||||
//native_unpaid: 0,
|
||||
};
|
||||
}
|
||||
|
||||
subscriptionData[objectGroupId].payment_info[bill.currency_code].unpaid += totalAmount;
|
||||
//subscriptionData[objectGroupId].payment_info[bill.currency_code].native_unpaid += totalNativeAmount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user