display recent sellings of current festival

This commit is contained in:
Tykayn 2025-02-26 18:53:23 +01:00 committed by tykayn
parent 20611e96c2
commit 66ca3bdf31
5 changed files with 46 additions and 20 deletions

View file

@ -56,7 +56,7 @@ angular
*/
$scope.setRightAmountPaid = function () {
// debugger;
$scope.paidAmount += $scope.sumOfList($scope.activeSelling);
$scope.paidAmount = $scope.sumOfList($scope.activeSelling);
}
/**
* deduplicate the active selling items in the view,
@ -290,11 +290,15 @@ angular
$scope.countProductsSoldForActiveFestival = rep.data.activeFestival.sold;
$scope.showTemporaryMessage();
$scope.clearCurrentSelling();
console.log(rep);
$scope.sellingComment = '';
// Focus sur le champ de commentaire pour la prochaine vente
document.querySelector('#sellingComment').focus();
if (!rep.success) {
// if not successful, bind errors to error variables
$scope.errors = rep.errors;
}
}, function (rep) {
console.log('nope! ', rep.data);
$scope.showTemporaryErrorMessage();
@ -304,12 +308,16 @@ angular
$scope.sellingOk = false;
$scope.sellingError = false;
$scope.tempMessage = {};
$scope.tempMessage;
$scope.showTemporaryMessage = function () {
$scope.sellingOk = true;
$timeout.cancel($scope.tempMessage);
$scope.tempMessage = $timeout(function () {
if ($scope.tempMessage) {
$timeout.cancel($scope.tempMessage);
}
// $scope.tempMessage =
$timeout(function () {
console.log('hide message');
$scope.sellingOk = false;
}, 2000)
@ -326,8 +334,11 @@ angular
return;
}
$scope.sellingError = true;
$timeout.cancel($scope.tempMessage);
$scope.tempMessage = $timeout(function () {
if ($scope.tempMessage) {
$timeout.cancel($scope.tempMessage);
}
// $scope.tempMessage =
$timeout(function () {
console.log('hide message');
$scope.sellingError = false;
}, 2000)