fecr
Version:
Modulo de comprobantes electrónicos para el API del Ministerio de Hacienda de Costa Rica versión 4.3
26 lines (22 loc) • 685 B
JavaScript
"use strict";
class OtherCharges {
constructor(otherCharges) {
this.docType = otherCharges.docType;
this.docNumber = otherCharges.docNumber;
this.name = otherCharges.name;
this.detail = otherCharges.detail;
this.percentage = otherCharges.percentage;
this.amount = otherCharges.amount;
}
generate() {
var obj = {};
obj.TipoDocumento = this.docType;
if (this.docNumber) obj.NumeroIdentidadTercero = this.docNumber;
if (this.name) obj.NombreTercero = this.name;
obj.Detalle = this.detail;
if (this.percentage) obj.Porcentaje = this.percentage;
obj.MontoCargo = this.amount;
return obj;
}
}
module.exports = OtherCharges;