2014-10-12 08:23:36 +02:00
|
|
|
app.service( 'API',
|
|
|
|
[ '$http',
|
|
|
|
function( $http ) {
|
|
|
|
this.balance = function( params ) {
|
|
|
|
return $http.get( '/api/ledger/balance', {
|
|
|
|
params: {
|
|
|
|
period: params.period,
|
2015-05-24 13:10:29 +02:00
|
|
|
categories: params.categories,
|
|
|
|
depth: params.depth
|
2014-10-12 08:23:36 +02:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
|
|
|
this.register = function( params ) {
|
|
|
|
return $http.get( '/api/ledger/register', {
|
|
|
|
params: {
|
|
|
|
period: params.period,
|
|
|
|
categories: params.categories
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
2015-08-30 19:54:06 +02:00
|
|
|
this.graph_values = function( params ) {
|
|
|
|
return $http.get( '/api/ledger/graph_values', {
|
|
|
|
params: {
|
|
|
|
period: params.period,
|
|
|
|
categories: params.categories
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
2014-11-08 17:40:48 +01:00
|
|
|
this.budget = function( params ) {
|
|
|
|
return $http.get( '/api/ledger/budget', {
|
|
|
|
params: {
|
|
|
|
period: params.period,
|
|
|
|
categories: params.categories
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
2014-10-12 08:23:36 +02:00
|
|
|
this.dates_salaries = function( ) {
|
|
|
|
return $http.get( '/api/ledger/dates_salaries' );
|
|
|
|
};
|
|
|
|
|
|
|
|
this.accounts = function( ) {
|
|
|
|
return $http.get( '/api/ledger/accounts' );
|
|
|
|
};
|
2014-10-20 12:52:49 +02:00
|
|
|
|
|
|
|
this.cleared = function( ) {
|
|
|
|
return $http.get( '/api/ledger/cleared' );
|
|
|
|
};
|
2014-10-12 08:23:36 +02:00
|
|
|
} ] );
|