Compare commits
2 Commits
f1f76a8a9a
...
f300dc07d1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f300dc07d1 | ||
|
|
1cb849a299 |
@@ -632,7 +632,7 @@ export class CartSalesComponent
|
|||||||
|
|
||||||
if (billing !== null) {
|
if (billing !== null) {
|
||||||
const savePayment = localStorage.getItem('paymentPlan');
|
const savePayment = localStorage.getItem('paymentPlan');
|
||||||
this.paymentPlan$ = this.lookupService.getPaymentPlan(billing.codcob);
|
this.paymentPlan$ = this.lookupService.getPaymentPlan(billing.codcob, customer !== null ? customer.customerId : 1);
|
||||||
this.subscritpionPaymentPlan = this.paymentPlan$.subscribe((data) => {
|
this.subscritpionPaymentPlan = this.paymentPlan$.subscribe((data) => {
|
||||||
this.paymentPlans = data;
|
this.paymentPlans = data;
|
||||||
if (
|
if (
|
||||||
@@ -798,13 +798,16 @@ export class CartSalesComponent
|
|||||||
|
|
||||||
setBilling(billing: any) {
|
setBilling(billing: any) {
|
||||||
localStorage.setItem('billing', JSON.stringify(billing));
|
localStorage.setItem('billing', JSON.stringify(billing));
|
||||||
|
const customer = JSON.parse(localStorage.getItem('customer')) as Customer;
|
||||||
this.idBilling = billing.codcob;
|
this.idBilling = billing.codcob;
|
||||||
console.log(JSON.stringify(billing));
|
console.log(JSON.stringify(billing));
|
||||||
localStorage.removeItem('paymentPlan');
|
localStorage.removeItem('paymentPlan');
|
||||||
this.formPayment.patchValue({
|
this.formPayment.patchValue({
|
||||||
paymentPlan: null,
|
paymentPlan: null,
|
||||||
});
|
});
|
||||||
this.paymentPlan$ = this.lookupService.getPaymentPlan(billing.codcob);
|
this.paymentPlan$ = this.lookupService.getPaymentPlan(billing.codcob,
|
||||||
|
customer !== null ? customer.customerId : 1
|
||||||
|
);
|
||||||
this.subscritpionPaymentPlan = this.paymentPlan$
|
this.subscritpionPaymentPlan = this.paymentPlan$
|
||||||
.pipe(
|
.pipe(
|
||||||
tap((data) => (this.paymentPlans = data)),
|
tap((data) => (this.paymentPlans = data)),
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export class LookupService {
|
|||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
getStore(): Observable<StoreERP[]> {
|
getStore(): Observable<StoreERP[]> {
|
||||||
const url = environment.url + `lists/store/user/${this.authService.getUser()}`;
|
const url = environment.url + `lists/store/user/${this.authService.getUser()}`;
|
||||||
@@ -60,8 +60,8 @@ export class LookupService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getPaymentPlan(billingId: string = '9999'): Observable<PaymentPlan[]> {
|
getPaymentPlan(billingId: string = '9999', customerId: number = 1): Observable<PaymentPlan[]> {
|
||||||
const url = environment.url + `lists/paymentplan/${billingId}`;
|
const url = environment.url + `lists/paymentplan/${billingId}/${customerId}`;
|
||||||
try {
|
try {
|
||||||
const response = this.http.get<PaymentPlan[]>(url);
|
const response = this.http.get<PaymentPlan[]>(url);
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
Reference in New Issue
Block a user