|
|
|
@ -70,15 +70,6 @@ export class OpCommercialService {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getFilleuls(): FirebaseListObservable<any> {
|
|
|
|
|
return this.afDb.list('/Filleul/', {
|
|
|
|
|
query: {
|
|
|
|
|
orderByChild: 'uid'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateOpCommStatus() {
|
|
|
|
|
const opComAll = this.getOpComs();
|
|
|
|
|
opComAll.subscribe(tabOpComs => {
|
|
|
|
@ -89,9 +80,6 @@ export class OpCommercialService {
|
|
|
|
|
let monOpCom = tabOpComs[i];
|
|
|
|
|
console.log('tabOpComs[i].name not vide' + tabOpComs[i].name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (monOpCom !== undefined){
|
|
|
|
|
console.log(monOpCom);
|
|
|
|
|
var todayTemp = new Date(Date.now());
|
|
|
|
@ -134,11 +122,12 @@ export class OpCommercialService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateCarteEtOpCom(){
|
|
|
|
|
updateCarteEtOpCom() {
|
|
|
|
|
this.updateOpCommStatus();
|
|
|
|
|
this.updateCarteStatus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateCarteStatus(){
|
|
|
|
|
const carteAll = this.getCartes();
|
|
|
|
|
|
|
|
|
@ -189,12 +178,14 @@ export class OpCommercialService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saveOpComm(user: firebase.User, infoOpCom: OperationCommerciale) {
|
|
|
|
|
if (infoOpCom.name !== '' && infoOpCom.avantageParrain !== '' && infoOpCom.avantageFilleul !== '') {
|
|
|
|
|
infoOpCom.uid = firebase.database().ref().child('OperationCommercial').push().key;
|
|
|
|
|
let updates = {};
|
|
|
|
|
updates['/OperationCommercial/' + infoOpCom.uid] = infoOpCom;
|
|
|
|
|
firebase.database().ref().update(updates);
|
|
|
|
|
this.upload(infoOpCom);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
infoOpCom.uid = firebase.database().ref().child('OperationCommercial').push().key;
|
|
|
|
|
let updates = {};
|
|
|
|
|
updates['/OperationCommercial/' + infoOpCom.uid] = infoOpCom;
|
|
|
|
|
firebase.database().ref().update(updates);
|
|
|
|
|
this.upload(infoOpCom);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|