Browse Source

Quitar campo de ingreso fecha vencimiento en deposito a plazo

Oscar José Nuñez Chávez 5 years ago
parent
commit
869f83a973

+ 4 - 36
src/app/components/instruments/dap/dap.component.html

@@ -158,42 +158,6 @@
         </div>
         </div>
       </div>
       </div>
 
 
-      <!-- Fecha vencimiento -->
-      <div class="col-lg-6 col-sm-12 pr-xl-3">
-        <div class="form-group">
-          <label for="fecha_vencimiento">Fecha vencimiento: </label>
-
-          <div class="input-box-container">
-            <div>
-              <p>
-                <i class="far fa-calendar" aria-hidden="true"></i>
-              </p>
-              <input
-                class="input-box form-control"
-                placeholder="Seleccione una fecha"
-                angular-mydatepicker
-                formControlName="fecha_vencimiento"
-                (click)="dp2.toggleCalendar()"
-                [options]="myDpOptions"
-                #dp2="angular-mydatepicker"
-                [ngClass]="{
-                  'is-invalid': submitted && f.fecha_vencimiento.errors
-                }"
-              />
-            </div>
-          </div>
-
-          <div
-            *ngIf="submitted && f.fecha_vencimiento.errors"
-            class="invalid-feedback"
-          >
-            <div *ngIf="f.fecha_vencimiento.errors.required">
-              Campo requerido
-            </div>
-          </div>
-        </div>
-      </div>
-
       <!-- # de certificado -->
       <!-- # de certificado -->
       <div class="col-lg-6 col-sm-12 pr-xl-3">
       <div class="col-lg-6 col-sm-12 pr-xl-3">
         <div class="form-group">
         <div class="form-group">
@@ -266,6 +230,10 @@
           <h4>Renta:</h4>
           <h4>Renta:</h4>
           <div class="field">$USD {{ renta | number: "1.2-4" }}</div>
           <div class="field">$USD {{ renta | number: "1.2-4" }}</div>
         </div>
         </div>
+        <div class="col-sm-6">
+          <h4>Fecha de vencimiento:</h4>
+          <div class="field">{{ fecha_vencimiento }}</div>
+        </div>
         <div class="col-sm-6">
         <div class="col-sm-6">
           <h4>Fecha inicio de vigencia:</h4>
           <h4>Fecha inicio de vigencia:</h4>
           <div class="field">{{ fecha_inicio_vigencia }}</div>
           <div class="field">{{ fecha_inicio_vigencia }}</div>

+ 5 - 8
src/app/components/instruments/dap/dap.component.ts

@@ -92,6 +92,7 @@ export class DAP implements InstrumentComponent {
   renta: any;
   renta: any;
   hasProjections: boolean;
   hasProjections: boolean;
   numero_certificado: any;
   numero_certificado: any;
+  fecha_vencimiento: any;
 
 
   constructor(
   constructor(
     private formBuilder: FormBuilder,
     private formBuilder: FormBuilder,
@@ -221,8 +222,7 @@ export class DAP implements InstrumentComponent {
           renta_porcentaje: +this.f.renta_porcentaje.value,
           renta_porcentaje: +this.f.renta_porcentaje.value,
           plazo: +this.f.plazo.value,
           plazo: +this.f.plazo.value,
           //id_formato_ingreso: this.f.formato_ingreso.value,
           //id_formato_ingreso: this.f.formato_ingreso.value,
-          fecha_operacion: this.f.fecha_operacion.value.singleDate.formatted,
-          fecha_vencimiento: this.f.fecha_vencimiento.value.singleDate.formatted
+          fecha_operacion: this.f.fecha_operacion.value.singleDate.formatted
         }
         }
       )
       )
       .subscribe(
       .subscribe(
@@ -237,6 +237,8 @@ export class DAP implements InstrumentComponent {
           this.renta = ans["result"]["renta"];
           this.renta = ans["result"]["renta"];
           this.proyecciones = ans["result"]["proyecciones"];
           this.proyecciones = ans["result"]["proyecciones"];
           this.numero_certificado = ans["result"]["numero_certificado"];
           this.numero_certificado = ans["result"]["numero_certificado"];
+          this.fecha_vencimiento = ans["result"]["fecha_vencimiento"];
+
           this.dataSource.data = this.proyecciones;
           this.dataSource.data = this.proyecciones;
           this.dataSource.paginator = this.paginator;
           this.dataSource.paginator = this.paginator;
           this.dataSource.sort = this.sort;
           this.dataSource.sort = this.sort;
@@ -258,12 +260,7 @@ export class DAP implements InstrumentComponent {
             proyecciones: this.proyecciones,
             proyecciones: this.proyecciones,
 
 
             fecha_operacion: this.investmentProposalForm.value.fecha_operacion
             fecha_operacion: this.investmentProposalForm.value.fecha_operacion
-              .singleDate.formatted,
-            fecha_vencimiento:
-              this.investmentProposalForm.value.fecha_vencimiento != undefined
-                ? this.investmentProposalForm.value.fecha_vencimiento.singleDate
-                    .formatted
-                : ""
+              .singleDate.formatted
           };
           };
           this.formDataService.setWork(this.dapObject);
           this.formDataService.setWork(this.dapObject);
           Swal.close();
           Swal.close();

+ 1 - 1
src/app/services/instrument-calculations.service.ts

@@ -124,7 +124,7 @@ export class InstrumentCalculations {
       renta_porcentaje: number;
       renta_porcentaje: number;
       plazo: number;
       plazo: number;
       fecha_operacion: string;
       fecha_operacion: string;
-      fecha_vencimiento: string;
+      //fecha_vencimiento: string;
     }
     }
   ): Observable<boolean> {
   ): Observable<boolean> {
     return this.http
     return this.http