Skip to content

Instantly share code, notes, and snippets.

['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",

Endpoints

Method URL Description
GET /api/ppes/summary/{year}/{month} Get ppes sumary [YYYY-MM]
GET /api/ppes/details/{year}/{month} Get ppes details for depreciation table
GET /api/ppes/{year}/month Get ppes for editing records
POST /api/ppes/reports Get ppes report
POST /api/ppes/ Create ppes
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
},

Laravel boilerplate

Version: 6.2.*

Requisites

  • Docker
  • Docker-compose

Project configuration

<?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())