Compare commits

...

2 Commits

Author SHA1 Message Date
Luis Eduardo Estevao
f300dc07d1 Merge branch 'main' of https://git.simplifiquehc.com.br/simplifique/Vendaweb-portal
All checks were successful
Build (develop) / Promote (main) / build-and-push-deploy (push) Successful in 6m48s
2026-02-19 10:02:20 -03:00
Luis Eduardo Estevao
1cb849a299 feat: add cart sales component and lookup service for managing sales orders. Add parameter customerId find payment plans. 2026-02-19 10:02:15 -03:00
2 changed files with 8 additions and 5 deletions

View File

@@ -632,7 +632,7 @@ export class CartSalesComponent
if (billing !== null) {
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.paymentPlans = data;
if (
@@ -798,13 +798,16 @@ export class CartSalesComponent
setBilling(billing: any) {
localStorage.setItem('billing', JSON.stringify(billing));
const customer = JSON.parse(localStorage.getItem('customer')) as Customer;
this.idBilling = billing.codcob;
console.log(JSON.stringify(billing));
localStorage.removeItem('paymentPlan');
this.formPayment.patchValue({
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$
.pipe(
tap((data) => (this.paymentPlans = data)),

View File

@@ -60,8 +60,8 @@ export class LookupService {
}
}
getPaymentPlan(billingId: string = '9999'): Observable<PaymentPlan[]> {
const url = environment.url + `lists/paymentplan/${billingId}`;
getPaymentPlan(billingId: string = '9999', customerId: number = 1): Observable<PaymentPlan[]> {
const url = environment.url + `lists/paymentplan/${billingId}/${customerId}`;
try {
const response = this.http.get<PaymentPlan[]>(url);
return response;