|
|
@@ -227,28 +227,32 @@ export class GeneralIncomeFormComponent implements OnInit {
|
|
|
"",
|
|
|
[
|
|
|
Validators.required,
|
|
|
- Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ //Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ Validators.pattern("^[0-9,.]+$")
|
|
|
]
|
|
|
],
|
|
|
ingreso_bruto: [
|
|
|
"",
|
|
|
[
|
|
|
Validators.required,
|
|
|
- Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ //Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ Validators.pattern("^[0-9,.]+$")
|
|
|
]
|
|
|
],
|
|
|
renta: [
|
|
|
"",
|
|
|
[
|
|
|
Validators.required,
|
|
|
- Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ //Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ Validators.pattern("^[0-9,.]+$")
|
|
|
]
|
|
|
],
|
|
|
ingreso_neto: [
|
|
|
"",
|
|
|
[
|
|
|
Validators.required,
|
|
|
- Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ //Validators.pattern(/^[+]?([0-9]+(?:[\.][0-9]*)?|\.[0-9]+)$/)
|
|
|
+ Validators.pattern("^[0-9,.]+$")
|
|
|
]
|
|
|
],
|
|
|
tipo_pago: ["", Validators.required],
|
|
|
@@ -274,7 +278,12 @@ export class GeneralIncomeFormComponent implements OnInit {
|
|
|
|
|
|
submitIncome(form: any) {
|
|
|
this.submitted = true;
|
|
|
+ let inversionCapital = this.clearValor(form.value.capital,"decimal")
|
|
|
+ let inversionBruto = this.clearValor(form.value.ingreso_bruto,"decimal")
|
|
|
+ let inversionNeto = this.clearValor(form.value.ingreso_neto,"decimal")
|
|
|
console.log(form);
|
|
|
+ console.log(form.value.ingreso_bruto)
|
|
|
+ console.log(inversionBruto)
|
|
|
if (!form.valid) {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -284,10 +293,10 @@ export class GeneralIncomeFormComponent implements OnInit {
|
|
|
id_proyeccion_ingreso_instrumento: this.idInstrumentIncome,
|
|
|
fecha_proyeccion_pago: this.projectionDate,
|
|
|
|
|
|
- capital: form.value.capital,
|
|
|
- ingreso_bruto: form.value.ingreso_bruto,
|
|
|
+ capital: inversionCapital,
|
|
|
+ ingreso_bruto: inversionBruto,
|
|
|
renta: form.value.renta,
|
|
|
- ingreso_neto: form.value.ingreso_neto,
|
|
|
+ ingreso_neto: inversionNeto,
|
|
|
id_cuenta_bancaria: form.value.cuenta_bancaria,
|
|
|
id_tipo_pago: form.value.tipo_pago,
|
|
|
comentario: form.value.comentario
|
|
|
@@ -335,7 +344,25 @@ export class GeneralIncomeFormComponent implements OnInit {
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+clearValor(value,tipoDato){
|
|
|
+ value = parseFloat(value.toString().replace(",",""))
|
|
|
+return value;
|
|
|
+}
|
|
|
+
|
|
|
+public inputValidator(event: any) {
|
|
|
+ //console.log(event.target.value);
|
|
|
+ const pattern = /^[0-9]*$/;
|
|
|
+ //let inputChar = String.fromCharCode(event.charCode)
|
|
|
+
|
|
|
+ if (!pattern.test(event.target.value)) {
|
|
|
+
|
|
|
+ event.target.value = event.target.value.replace(/[^\d,.]+/g, '');
|
|
|
+ // invalid character, prevent input
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
conciliateIncome() {
|
|
|
this.conciliateObject = {
|
|
|
id_inversion_instrumento: this.projectionRes.id_inversion_instrumento,
|