Compare commits
2 Commits
3471dba3aa
...
806ac42eae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
806ac42eae | ||
|
|
461b3b01f7 |
File diff suppressed because it is too large
Load Diff
@@ -79,8 +79,7 @@ export interface JsonModel {
|
||||
],
|
||||
})
|
||||
export class CartSalesComponent
|
||||
implements OnInit, AfterViewInit, OnDestroy, OnChanges
|
||||
{
|
||||
implements OnInit, AfterViewInit, OnDestroy, OnChanges {
|
||||
public containerRef: ViewContainerRef;
|
||||
public resultQuestion;
|
||||
|
||||
@@ -275,13 +274,13 @@ export class CartSalesComponent
|
||||
private readonly messageService: MessageService,
|
||||
private readonly productService: ProductService,
|
||||
private readonly customerService: CustomerService
|
||||
) {}
|
||||
) { }
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.loadShopping();
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {}
|
||||
ngAfterViewInit(): void { }
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.shoppingSubscription) {
|
||||
@@ -1579,6 +1578,40 @@ export class CartSalesComponent
|
||||
}
|
||||
}
|
||||
|
||||
public updateCart(
|
||||
cartId: string,
|
||||
customerId: number,
|
||||
addressId: number,
|
||||
saleStoreId: string,
|
||||
paymentPlanId: number,
|
||||
billingId: string
|
||||
) {
|
||||
this.shoppingService.getShopping(cartId).subscribe((shopping) => {
|
||||
if (shopping) {
|
||||
shopping.codcli = customerId;
|
||||
shopping.codendentcli = addressId;
|
||||
shopping.saleStore = saleStoreId;
|
||||
shopping.codplpag = paymentPlanId;
|
||||
shopping.codcob = billingId;
|
||||
|
||||
this.shoppingService.updateShopping(shopping).subscribe(
|
||||
(response) => {
|
||||
console.log('Cart updated successfully:', response);
|
||||
this.store.dispatch(
|
||||
new LoadShoppingAction(this.shoppingService.getCart())
|
||||
);
|
||||
this.loadFormOrder();
|
||||
},
|
||||
(error) => {
|
||||
console.error('Error updating cart:', error);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
console.error('Shopping cart not found for ID:', cartId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
showDialogSelectAddress() {
|
||||
if (this.customer == null) {
|
||||
this.titleInformation = 'Selecionar endereço de entrega';
|
||||
@@ -1654,8 +1687,7 @@ export class CartSalesComponent
|
||||
|
||||
this.informationDelivery = `Pedido com data de entrega para o dia
|
||||
${dataTexto}
|
||||
- Tipo de entrega: ${
|
||||
dataDelivery.scheduleDelivery ? 'PROGRAMADA' : 'NORMAL'
|
||||
- Tipo de entrega: ${dataDelivery.scheduleDelivery ? 'PROGRAMADA' : 'NORMAL'
|
||||
}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,5 +16,6 @@ export class Shopping {
|
||||
public totpeso: number;
|
||||
public codfornecfrete: number;
|
||||
public codtabelafrete: number;
|
||||
public saleStore: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user