Created
November 22, 2024 17:41
-
-
Save diegoolipa/bb7f925727357ec296465da3df0e5d4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public onPrintReceiptPdf(doc: any, item: any) { | |
doc.loading = true; | |
const idsDArray = item?.ids_deposito?item?.ids_deposito.split('|').map(Number):[]; | |
const idsODArray = item?.ids_odeposito?item?.ids_odeposito.split('|').map(Number):[]; | |
if (idsDArray.length==0 && idsODArray.length==0){ | |
doc.loading = false; | |
return; | |
} | |
const params = { | |
'ids_deposito': idsDArray || [], | |
'ids_odeposito': idsODArray || [], | |
} | |
return this.depositsService.multipleDepositAndODepositPrintAgainPdf$(params) | |
.pipe( | |
takeUntil(this.destroy$), | |
finalize(() => { | |
doc.loading = false; | |
}), | |
) | |
.subscribe({ | |
next: response => { | |
doc.loading = false; | |
this.viewPDFNewWindow(response); | |
}, | |
error: err => { | |
doc.loading = false; | |
}, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment