Skip to content

Commit

Permalink
management: Merge pull request #173 from udistrital/feature/controlad…
Browse files Browse the repository at this point in the history
…or_retencion

Feature/controlador retencion
  • Loading branch information
AlexFBP authored May 18, 2022
2 parents 768313b + 548eacb commit 3693a20
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 7 deletions.
15 changes: 15 additions & 0 deletions src/app/@core/helpers/arbol/arbolHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,19 @@ export class ArbolHelper {
);
}

public getTipoRetencion() {
this.rqManager.setPath('CUENTAS_CONTABLES_SERVICE');
return this.rqManager.get(`tipo_retencion`).pipe(
map(
(res) => {
if (res && res['Type'] === 'error') {
this.pUpManager.showErrorAlert('No se pudo consultar la información de tipo cuenta');
return undefined;
}
return res;
},
),
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,24 @@
</mat-form-field>
</mat-grid-tile>

<mat-grid-tile colspan="6"
<mat-grid-tile colspan="3"
*ngIf="detalleCondicionales.iva"
rowspan="1">
<mat-form-field class="form-group"
appearance="legacy">
<mat-label>{{ 'CUENTAS_CONTABLES.iva' | translate }}*</mat-label>
<mat-select [formControl]="form.controls['TipoRetencionID']">
<mat-option *ngFor="let iva of tipoIvas"
[value]="iva.Id">
{{ iva.Label }}
</mat-option>
</mat-select>
<mat-error *ngIf="form.controls['TipoRetencionID'].errors">
{{ form.controls["TipoRetencionID"].errors.msg || ("CUENTAS_CONTABLES.form_error" | translate) }}
</mat-error>
</mat-form-field>
</mat-grid-tile>
<mat-grid-tile colspan="3"
rowspan="1">
<mat-form-field class="form-group"
appearance="legacy">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ export class CuentaContableComponent implements OnInit {
tipoMonedas = [];
centroCostos = [];
tipoCuentas = [];
tipoIvas = [];
bancos = [];
cuentasBancarias = [];
bancosFilter: Observable<any[]>;
code: string;
detalleCondicionales = {
bancos: false
bancos: false,
iva: false,
};


Expand All @@ -63,15 +65,27 @@ export class CuentaContableComponent implements OnInit {
switch (value) {
case 'bancos':
this.detalleCondicionales = {
bancos: true
bancos: true,
iva: false,
};
this.form.get('CuentaBancariaID').enable();
this.form.get('TipoRetencionID').disable();
break;
case 'iva':
this.detalleCondicionales = {
bancos: false,
iva: true,
};
this.form.get('TipoRetencionID').enable();
this.form.get('CuentaBancariaID').disable();
break;
default:
this.detalleCondicionales = {
bancos: false
bancos: false,
iva: false,
};
this.form.get('CuentaBancariaID').disable();
this.form.get('TipoRetencionID').disable();
break;
}
});
Expand Down Expand Up @@ -109,14 +123,16 @@ export class CuentaContableComponent implements OnInit {
this.acountService.getTipoMoneda(),
this.acountService.getCentroCostos(),
this.acountService.getTipoCuenta(),
this.bancosService.getCuentasBancarias()
this.acountService.getTipoRetencion(),
this.bancosService.getCuentasBancarias(),
]).subscribe(results => {
this.naturalezas = results[0];
this.detalleCuentas = results[1];
this.tipoMonedas = results[2];
this.centroCostos = results[3];
this.tipoCuentas = results[4];
this.cuentasBancarias = results[5] ? results[5].Data : [];
this.tipoIvas = results[5];
this.cuentasBancarias = results[6] ? results[6].Data : [];
this.bancos = groupBy(this.cuentasBancarias, 'NombreBanco');
if (this.cuenta) {
this.loadAccount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class FormCuentaContable {
Ajustable: [false],
Nmnc: [false],
MonedaID: ['', Validators.required],
TipoRetencionID: ['', Validators.required],
});

constructor(private builder: FormBuilder,
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@
"form_confirmar": "Confirmar",
"movimientos": "Movimientos",
"movimientos_cuenta_contable": "Movimientos cuenta contable",
"detalle_transaccion": "Detalle transacción"
"detalle_transaccion": "Detalle transacción",
"iva": "Iva"
},
"CONCEPTOS":{
"crear-concepto":"Crear concepto",
Expand Down

0 comments on commit 3693a20

Please sign in to comment.