# Endpoints
URL | Description |
---|---|
/api/account-payable/reports | Get reports |
Json structure:
# Endpoints
URL | Description |
---|---|
/api/account-payable/reports | Get reports |
Json structure:
['1-2020', '2-2020', '3-2020'].map(shortDate => { | |
const transaction = transactions.find(transaction => `${transaction.month}-${transaction.year}` === shortDate); | |
const {total_incomes, total_expenses, utility_before_taxes} = transaction.details; | |
return {date: shortDate, total_incomes, total_expenses, utility_before_taxes}; | |
}); | |
// [ | |
// {date: '1-2020', total_incomes: 0, total_expenses: 0, utility_before_taxes: 0}, | |
// {date: '2-2020', total_incomes: 0, total_expenses: 0, utility_before_taxes: 0}, | |
// {date: '3-2020', total_incomes: 0, total_expenses: 0, utility_before_taxes: 0} |
{ | |
"transactions": [ | |
{ | |
"id": 2, | |
"month": "2", | |
"year": "2020", | |
"user_id": "6", | |
"transaction_date": "2020-07-07 03:24:43", | |
"created_at": "2020-07-07T03:24:43.000000Z", | |
"updated_at": "2020-07-07T03:24:43.000000Z", |
currentMonths.map(currentMonth => { | |
const transaction = results.transactions.find(transaction => { | |
return `${transaction.year}-${transaction.month}` === `${currentMonth.year}-${currentMonth.month}` | |
}); | |
console.log(transaction.details) // Aqui estan los detalles de ese mes | |
}) | |
[ | |
{ | |
"transaction": { | |
"user_id": 6, | |
"month": 5, | |
"year": 2020, | |
"updated_at": "2020-06-18T22:32:58.000000Z", | |
"created_at": "2020-06-18T22:32:58.000000Z", | |
"id": 1 | |
}, |
<?php | |
use App\Models\TaskCatalog; | |
use Carbon\Carbon; | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Str; | |
class AddTaskCatalogs extends Migration | |
{ |
import { ExpenseBudget } from "../models"; | |
import expenseBudget = require("../schemas/expenseBudget"); | |
const filter = require('lodash/filter'); | |
const data = [ | |
{ | |
"index": 1, | |
"year": 2019, | |
"month": 1, |
let number = '1234568,65'; | |
number = number.replace(/,/g, '.'); | |
const parsedNumber = numeral(number); | |
console.log(number); | |
console.log('Format', parsedNumber.format('0,0.00')) | |
console.log('Value', parsedNumber.value()) |