config of logged routes
This commit is contained in:
parent
8e3ba4ed5f
commit
97717179cf
|
@ -1,4 +1,3 @@
|
|||
|
||||
fos_user_profile:
|
||||
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
|
||||
prefix: /profile
|
||||
|
@ -39,19 +38,19 @@ app_sell_record:
|
|||
type: annotation
|
||||
|
||||
|
||||
|
||||
# async calls
|
||||
get_my_products:
|
||||
path: /get-my-products
|
||||
path: /logged/get-my-products
|
||||
defaults: { _controller: AppBundle:Default:getMyProducts }
|
||||
get_my_expenses:
|
||||
path: /get-my-expenses
|
||||
path: /logged/get-my-expenses
|
||||
defaults: { _controller: AppBundle:Default:getMyExpenses }
|
||||
save_my_expenses:
|
||||
path: /save-my-expenses
|
||||
path: /logged/save-my-expenses
|
||||
defaults: { _controller: AppBundle:Default:saveMyExpenses }
|
||||
|
||||
add_selling:
|
||||
path: /add-selling
|
||||
path: /logged/add-selling
|
||||
defaults: { _controller: AppBundle:Default:addSelling }
|
||||
|
||||
fos_user:
|
||||
|
|
|
@ -34,6 +34,7 @@ security:
|
|||
access_control:
|
||||
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/dashboard$, role: IS_AUTHENTICATED_REMEMBERED }
|
||||
- { path: ^/logged$, role: IS_AUTHENTICATED_REMEMBERED }
|
||||
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/admin/, role: ROLE_ADMIN }
|
||||
|
|
|
@ -30,17 +30,17 @@ angular
|
|||
$scope.pausedSelling = [];
|
||||
$scope.show_config = {
|
||||
stock_count: false,
|
||||
sold: true,
|
||||
sold : true,
|
||||
};
|
||||
$scope.activeItemsSold = []; // list of products ID to sell
|
||||
$scope.activeSelling = []; // list of products to sell
|
||||
$scope.activeFestival = { // an event where selling take place
|
||||
id: null,
|
||||
name: "le festival",
|
||||
dateCreation: new Date(),
|
||||
id : null,
|
||||
name : "le festival",
|
||||
dateCreation : new Date(),
|
||||
chiffreAffaire: 0,
|
||||
clientsCount: 0,
|
||||
commentaire: ""
|
||||
clientsCount : 0,
|
||||
commentaire : ""
|
||||
};
|
||||
/**
|
||||
* get the sum of products prices
|
||||
|
@ -119,7 +119,7 @@ angular
|
|||
// http related calls
|
||||
$scope.fetchProductsFromDB = function () {
|
||||
console.log('fetch products...');
|
||||
$http.get('get-my-products').then((rep) => {
|
||||
$http.get('logged/get-my-products').then((rep) => {
|
||||
|
||||
console.log('ok', rep);
|
||||
customCategories = [];
|
||||
|
@ -166,28 +166,28 @@ angular
|
|||
$scope.sendForm = function () {
|
||||
console.log('$scope.sellingComment', this.sellingComment);
|
||||
let lesParams = {
|
||||
paidByClient: this.paidAmount,
|
||||
paidByClient : this.paidAmount,
|
||||
sellingComment: this.sellingComment,
|
||||
activeSelling: this.activeSelling,
|
||||
activeSelling : this.activeSelling,
|
||||
activeFestival: this.activeFestival
|
||||
};
|
||||
$scope.recentSellings.push({
|
||||
id: this.recentId++,
|
||||
amount: this.CurrentSellingTotal(),
|
||||
id : this.recentId++,
|
||||
amount : this.CurrentSellingTotal(),
|
||||
paidAmount: this.paidAmount,
|
||||
products:
|
||||
products :
|
||||
angular
|
||||
.copy(this.activeSelling)
|
||||
});
|
||||
console.log('$scope.recentSellings', this.recentSellings);
|
||||
$scope.lesParams = lesParams;
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: 'add-selling',
|
||||
method : 'POST',
|
||||
url : 'add-selling',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: lesParams // pass in data as strings
|
||||
data : lesParams // pass in data as strings
|
||||
}).then(function (rep) {
|
||||
$scope.clearCurrentSelling();
|
||||
// if successful, bind success message to message
|
||||
|
@ -226,19 +226,19 @@ angular
|
|||
.controller('previsionnelCtrl', ['$scope', '$http', '$timeout', function ($scope, $http, $timeout) {
|
||||
|
||||
$scope.config = {
|
||||
initialLoadingDone: false,
|
||||
loading: false,
|
||||
lines: 24,
|
||||
debounceTime: 300, // miliseconds to wait before updating model and saving changes
|
||||
initialLoadingDone : false,
|
||||
loading : false,
|
||||
lines : 24,
|
||||
debounceTime : 300, // miliseconds to wait before updating model and saving changes
|
||||
/**
|
||||
* expenses kind of the user
|
||||
*/
|
||||
disponibility: 5000,
|
||||
disponibility : 5000,
|
||||
averageMonthlyEarnings: 600,
|
||||
warningThershold: 2000,
|
||||
showDelays: false,
|
||||
showRepeats: false,
|
||||
monthsBeforeNoMoney: null,
|
||||
warningThershold : 2000,
|
||||
showDelays : false,
|
||||
showRepeats : false,
|
||||
monthsBeforeNoMoney : null,
|
||||
};
|
||||
|
||||
let exampleExpenses = [
|
||||
|
@ -278,7 +278,7 @@ angular
|
|||
// TODO take in account delays in expenses
|
||||
available = available - monthly + $scope.config.averageMonthlyEarnings;
|
||||
let newLine = {
|
||||
expense: monthly,
|
||||
expense : monthly,
|
||||
available: available,
|
||||
};
|
||||
|
||||
|
@ -299,8 +299,8 @@ angular
|
|||
for (let i = 0; i < previsionTable.length; i++) {
|
||||
$scope.graphPointsPrevision.push({
|
||||
label: previsionTable[i].available + " euros restants dans " + i + " mois",
|
||||
y: previsionTable[i].available,
|
||||
x: i,
|
||||
y : previsionTable[i].available,
|
||||
x : i,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ angular
|
|||
$scope.config.loading = true;
|
||||
$http.post('save-my-expenses', {
|
||||
expenses: $scope.expenses,
|
||||
config: $scope.config
|
||||
config : $scope.config
|
||||
})
|
||||
.then((rep) => {
|
||||
console.log('save-my-expenses', rep);
|
||||
|
@ -355,9 +355,9 @@ angular
|
|||
};
|
||||
$scope.addExpense = () => {
|
||||
$scope.expenses.push({
|
||||
name: "",
|
||||
name : "",
|
||||
repeat: 0,
|
||||
delay: 0,
|
||||
delay : 0,
|
||||
amount: 0,
|
||||
})
|
||||
};
|
||||
|
@ -376,10 +376,10 @@ angular
|
|||
text: "Euros disponibles dans le temps"
|
||||
},
|
||||
// animationEnabled: true,
|
||||
data: [
|
||||
data : [
|
||||
{
|
||||
// Change type to "doughnut", "line", "splineArea", etc.
|
||||
type: "splineArea",
|
||||
type : "splineArea",
|
||||
dataPoints: dataPoints
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue