trabajando en el pdf

This commit is contained in:
2025-10-12 23:28:33 +02:00
parent 99d27cd3ed
commit c15fff73ee
8 changed files with 243 additions and 373 deletions

View File

@ -1,4 +1,3 @@
// com.imprimelibros.erp.pdf.TemplateRegistry.java
package com.imprimelibros.erp.pdf;
import org.springframework.stereotype.Service;
@ -9,10 +8,15 @@ public class TemplateRegistry {
public TemplateRegistry(PdfModuleConfig config) {
this.config = config;
System.out.println("PDF templates registrados => " + config.getTemplates());
}
public String resolve(DocumentType type, String templateId) {
String key = type.name() + ":" + templateId;
String keyAlt = type.name() + "_" + templateId; // compatibilidad con properties
if (config.getTemplates() == null) return null;
return config.getTemplates().get(type.name() + ":" + templateId);
String value = config.getTemplates().get(key);
if (value == null) value = config.getTemplates().get(keyAlt);
return value;
}
}