@disruptive-learning/cfdi-to-pdf
Version:
Librería para crear un pdf basado en un XML CFDI o Retenciones
54 lines (53 loc) • 2.25 kB
JavaScript
import { getKeyValueOfCatalog } from '#src/catalogs/catalogs_source';
const genericRetencionPeriodoContent = (periodo, isVersionOne, catalogs, primaryColor, bgGrayColor) => {
return {
table: {
widths: ['*', '*', '*'],
body: [
[
{ text: 'Periodo', style: ['tableSubtitleHeader'], color: primaryColor, colSpan: 3 },
'',
'',
],
[
{
text: [
{ text: 'Mes Inicial: ', color: primaryColor },
{
text: getKeyValueOfCatalog('retenciones20Periodos', periodo.getAttribute('MesIni'), catalogs),
},
],
alignment: 'center',
fillColor: bgGrayColor,
},
{
text: [
{ text: 'Mes Final: ', color: primaryColor },
{
text: getKeyValueOfCatalog('retenciones20Periodos', periodo.getAttribute('MesFin'), catalogs),
},
],
alignment: 'center',
fillColor: bgGrayColor,
},
{
text: [
{ text: 'Ejercicio: ', color: primaryColor },
{ text: periodo.getAttribute(isVersionOne ? 'Ejerc' : 'Ejercicio') },
],
alignment: 'center',
fillColor: bgGrayColor,
},
],
[
{ fillColor: bgGrayColor, text: '', border: [false, false, false, true] },
{ fillColor: bgGrayColor, text: '', border: [false, false, false, true] },
{ fillColor: bgGrayColor, text: '', border: [false, false, false, true] },
],
],
dontBreakRows: true,
},
layout: 'tableLayout',
};
};
export default genericRetencionPeriodoContent;