|
@@ -74,6 +74,8 @@ export class PaymentRequirementComponent implements OnInit {
|
|
|
generated_inputs_previous: string;
|
|
generated_inputs_previous: string;
|
|
|
userListNext: any;
|
|
userListNext: any;
|
|
|
generated_inputs_next: string;
|
|
generated_inputs_next: string;
|
|
|
|
|
+ cuenta_bancaria_destino: any;
|
|
|
|
|
+ emitir_nombre: any;
|
|
|
|
|
|
|
|
constructor(
|
|
constructor(
|
|
|
private http: HttpClient,
|
|
private http: HttpClient,
|
|
@@ -130,6 +132,15 @@ export class PaymentRequirementComponent implements OnInit {
|
|
|
this.codigo = resp["result"]["codigo"];
|
|
this.codigo = resp["result"]["codigo"];
|
|
|
this.tipo_pago = resp["result"]["id_tipo_pago"]["nombre"];
|
|
this.tipo_pago = resp["result"]["id_tipo_pago"]["nombre"];
|
|
|
this.cuenta_bancaria = resp["result"]["id_cuenta_bancaria"]["nombre"];
|
|
this.cuenta_bancaria = resp["result"]["id_cuenta_bancaria"]["nombre"];
|
|
|
|
|
+
|
|
|
|
|
+ if (resp["result"]["id_cuenta_bancaria"] != undefined) {
|
|
|
|
|
+ this.cuenta_bancaria_destino =
|
|
|
|
|
+ resp["result"]["id_cuenta_bancaria_destino"]["nombre"];
|
|
|
|
|
+ }
|
|
|
|
|
+ if (resp["result"]["emitir_nombre"] != undefined) {
|
|
|
|
|
+ this.emitir_nombre = resp["result"]["emitir_nombre"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.fecha_vencimiento = resp["result"]["fecha_vencimiento"];
|
|
this.fecha_vencimiento = resp["result"]["fecha_vencimiento"];
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -168,6 +179,94 @@ export class PaymentRequirementComponent implements OnInit {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ (async () => {
|
|
|
|
|
+ Swal.fire({
|
|
|
|
|
+ title: `<h3>Enviar información de pago</h3>`,
|
|
|
|
|
+ icon: "info",
|
|
|
|
|
+
|
|
|
|
|
+ html: `${this.generated_inputs_next}`,
|
|
|
|
|
+ confirmButtonText: "Enviar requisición",
|
|
|
|
|
+ showCancelButton: true,
|
|
|
|
|
+ cancelButtonText: "Cancelar",
|
|
|
|
|
+ showLoaderOnConfirm: true,
|
|
|
|
|
+
|
|
|
|
|
+ preConfirm: () => {
|
|
|
|
|
+ let array = [];
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < this.userListNext.length; i++) {
|
|
|
|
|
+ let html_input: HTMLInputElement = document.getElementById(
|
|
|
|
|
+ "next-" + this.userListNext[i]
|
|
|
|
|
+ ) as HTMLInputElement;
|
|
|
|
|
+ let html_value: string = html_input.value;
|
|
|
|
|
+ if (html_input.checked == true) {
|
|
|
|
|
+ array.push(html_value);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const formData = new FormData();
|
|
|
|
|
+ formData.append("id_inversion", this.investmentProposalID);
|
|
|
|
|
+ formData.append("evidencia", this.fileData);
|
|
|
|
|
+ formData.append("step", "next");
|
|
|
|
|
+ formData.append("comentario", form.value.comentario);
|
|
|
|
|
+ formData.append("notificar", array.toString());
|
|
|
|
|
+
|
|
|
|
|
+ this.paymentObject = {
|
|
|
|
|
+ fecha_pago: form.value.fecha_pago.singleDate.formatted,
|
|
|
|
|
+ id_inversion: this.investmentProposalID
|
|
|
|
|
+ //comentario:
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.investmentsService
|
|
|
|
|
+ .updatePaymentInfoProposalInvestment(
|
|
|
|
|
+ this.investmentProposalID,
|
|
|
|
|
+ this.paymentObject
|
|
|
|
|
+ )
|
|
|
|
|
+ .subscribe(
|
|
|
|
|
+ success => {
|
|
|
|
|
+ this.investmentService
|
|
|
|
|
+ .sendProposalInvestmentToNextStep(formData)
|
|
|
|
|
+ .subscribe(
|
|
|
|
|
+ success => {
|
|
|
|
|
+ if (success) {
|
|
|
|
|
+ Swal.fire({
|
|
|
|
|
+ allowOutsideClick: false,
|
|
|
|
|
+ icon: "success",
|
|
|
|
|
+ showCancelButton: false,
|
|
|
|
|
+ title: "Exito",
|
|
|
|
|
+ confirmButtonText: "La propuesta ha sido liquidada"
|
|
|
|
|
+ }).then(result => {
|
|
|
|
|
+ Swal.close();
|
|
|
|
|
+ window.location.href = "#/investment-proposals";
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ err => {
|
|
|
|
|
+ Swal.fire({
|
|
|
|
|
+ icon: "error",
|
|
|
|
|
+ title: "Error en el servidor",
|
|
|
|
|
+ text: err.message
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ },
|
|
|
|
|
+ err => {
|
|
|
|
|
+ Swal.fire({
|
|
|
|
|
+ icon: "error",
|
|
|
|
|
+ title: "Error en el servidor",
|
|
|
|
|
+ text: err.message
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ })();
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ this.submitted = true;
|
|
|
|
|
+ if (!form.valid) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.paymentObject = {
|
|
this.paymentObject = {
|
|
|
fecha_pago: form.value.fecha_pago.singleDate.formatted,
|
|
fecha_pago: form.value.fecha_pago.singleDate.formatted,
|
|
|
id_inversion: this.investmentProposalID
|
|
id_inversion: this.investmentProposalID
|
|
@@ -227,6 +326,8 @@ export class PaymentRequirementComponent implements OnInit {
|
|
|
text: err.message
|
|
text: err.message
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- );
|
|
|
|
|
|
|
+ );*/
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ sendPaymentInfo(form: any) {}
|
|
|
}
|
|
}
|