("obtenerContenidoHtmlDespacho");
var fullHtml = $@"
@@ -299,17 +299,15 @@
";
- var fileName = $"factura_{DateTime.Now:yyyyMMddHHmmss}.pdf";
- var filePath = Path.Combine("wwwroot", fileName);
var browserFetcher = new BrowserFetcher();
await browserFetcher.DownloadAsync();
using var browser = await Puppeteer.LaunchAsync(new LaunchOptions
- {
- Headless = true,
- Args = new[] { "--ignore-certificate-errors" }
- });
+ {
+ Headless = true,
+ Args = new[] { "--ignore-certificate-errors" }
+ });
using var page = await browser.NewPageAsync();
@@ -317,20 +315,18 @@
await page.SetContentAsync(fullHtml);
- await page.PdfAsync(filePath, new PdfOptions
+ var pdfBytes = await page.PdfDataAsync(new PdfOptions
+ {
+ PrintBackground = true,
+ Format = PuppeteerSharp.Media.PaperFormat.A4,
+ MarginOptions = new PuppeteerSharp.Media.MarginOptions
{
- PrintBackground = true,
- Format = PuppeteerSharp.Media.PaperFormat.A4,
- MarginOptions = new PuppeteerSharp.Media.MarginOptions
- {
- Top = "20mm",
- Bottom = "20mm"
- }
- });
+ Top = "20mm",
+ Bottom = "20mm"
+ }
+ });
- pdfUrl = "/" + fileName;
-
- Navigation.NavigateTo(pdfUrl, true);
+ await JSA.InvokeVoidAsync("mostrarPdf", Convert.ToBase64String(pdfBytes));
}
}
@@ -338,16 +334,24 @@
\ No newline at end of file
diff --git a/HerramientaCASA/Components/Pages/Imprimir/HerramientaCASAImprimir.razor b/HerramientaCASA/Components/Pages/Imprimir/HerramientaCASAImprimir.razor
index 48676d9..8546789 100644
--- a/HerramientaCASA/Components/Pages/Imprimir/HerramientaCASAImprimir.razor
+++ b/HerramientaCASA/Components/Pages/Imprimir/HerramientaCASAImprimir.razor
@@ -64,8 +64,8 @@
| Incremento por externalización |
- @objetoCASA.CostesProduccion.CoeficienteCostesExternalizacion
-
+ @objetoCASA.CostesProduccion.CoeficienteCostesExternalizacion %
+
|
@@ -138,7 +138,7 @@
| Plazo de presentación de la documentación: |
- @objetoCASA.CostesProduccion.PlazoPresentacionDocumentos
+ @objetoCASA.CostesProduccion.PlazoPresentacionDocumentos meses
|
@@ -160,14 +160,14 @@
- | Trabajos |
- Horas |
+ Trabajos |
+ Horas |
| Horas elaboración documentación |
- @objetoCASA.TrabajoProfesional.HorasTPEDocumentacion.MilesYDecimales() h |
+ @objetoCASA.TrabajoProfesional.HorasTPEDocumentacion.MilesYDecimales() h |
@@ -185,12 +185,16 @@
| @objetoCASA.TrabajoProfesional.HorasTPEDireccion.MilesYDecimales() h |
-
- | HORAS TRABAJO PROFESIONAL |
- @objetoCASA.TrabajoProfesional.HorasTPE.MilesYDecimales() h |
-
+
+
+
+
+ | Horas trabajo profesional @objetoCASA.TrabajoProfesional.TotalHorasTPE.MilesYDecimales() h |
+
+
+
@@ -201,42 +205,36 @@
-
+
Costes Asociados a los Servicios de Arquitectura
-
+
+
+ | COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL: |
-
-
- | Concepto |
- |
-
-
-
-
- | COSTES DE PRODUCCIÓN DEL TRABAJO PROFESIONAL |
- @objetoCASA.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() € |
-
-
-
- | Beneficio (antes de impuestos) |
-
- @objetoCASA.CostesProduccion.Beneficio
- |
-
-
-
-
- |
- Precio del trabajo profesional: @objetoCASA.CostesProduccion.PrecioTrabProf.MilesYDecimales() €
- |
-
-
+
+ @objetoCASA.CostesProduccion.CostesProduccionTrabProf.MilesYDecimales() €
+ |
+
+
+ | Beneficio (antes de impuestos) |
+
+
+ @objetoCASA.CostesProduccion.Beneficio %
+
+ |
+
+
+ |
+ Precio del trabajo profesional: @objetoCASA.CostesProduccion.PrecioTrabProf.MilesYDecimales() €
+ |
+
+
@if (objetoCASA.CostesProduccion.OtrosTrabajos.Count != 0)
@@ -261,7 +259,7 @@
{
| @otroTrabajo.Denominacion |
- @otroTrabajo.Coste.MilesYDecimales() |
+ @otroTrabajo.Coste.MilesYDecimales() € |
}
@@ -279,7 +277,7 @@
- |
+ |
Precio del encargo: @objetoCASA.CostesProduccion.PrecioDelEncargo.MilesYDecimales() €
|
diff --git a/HerramientaCASA/Components/Pages/Licitaciones.razor b/HerramientaCASA/Components/Pages/Licitaciones.razor
index 43cb591..0b59d0e 100644
--- a/HerramientaCASA/Components/Pages/Licitaciones.razor
+++ b/HerramientaCASA/Components/Pages/Licitaciones.razor
@@ -400,7 +400,7 @@
var cssPath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css");
var cssContent = await File.ReadAllTextAsync(cssPath);
- var contenidoHtml = await JS.InvokeAsync("obtenerContenidoHtml");
+ var contenidoHtml = await JS.InvokeAsync("obtenerContenidoHtmlLicitaciones");
var fullHtml = $@"
@@ -413,9 +413,6 @@
";
- var fileName = $"factura_{DateTime.Now:yyyyMMddHHmmss}.pdf";
- var filePath = Path.Combine("wwwroot", fileName);
-
var browserFetcher = new BrowserFetcher();
await browserFetcher.DownloadAsync();
@@ -431,20 +428,18 @@
await page.SetContentAsync(fullHtml);
- await page.PdfAsync(filePath, new PdfOptions
+ var pdfBytes = await page.PdfDataAsync(new PdfOptions
+ {
+ PrintBackground = true,
+ Format = PuppeteerSharp.Media.PaperFormat.A4,
+ MarginOptions = new PuppeteerSharp.Media.MarginOptions
{
- PrintBackground = true,
- Format = PuppeteerSharp.Media.PaperFormat.A4,
- MarginOptions = new PuppeteerSharp.Media.MarginOptions
- {
- Top = "20mm",
- Bottom = "20mm"
- }
- });
+ Top = "20mm",
+ Bottom = "20mm"
+ }
+ });
- pdfUrl = "/" + fileName;
-
- Navigation.NavigateTo(pdfUrl, true);
+ await JS.InvokeVoidAsync("mostrarPdf", Convert.ToBase64String(pdfBytes));
}
@@ -487,11 +482,18 @@
\ No newline at end of file
diff --git a/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor b/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor
index 83718c6..51b5b96 100644
--- a/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor
+++ b/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor
@@ -470,7 +470,7 @@
var cssPath = Path.Combine(Environment.CurrentDirectory, "wwwroot", "Content", "Site.css");
var cssContent = await File.ReadAllTextAsync(cssPath);
- var contenidoHtml = await JS.InvokeAsync("obtenerContenidoHtml");
+ var contenidoHtml = await JS.InvokeAsync("obtenerContenidoHtmlLiciUrban");
var fullHtml = $@"
@@ -500,7 +500,7 @@
await page.SetContentAsync(fullHtml);
- await page.PdfAsync(filePath, new PdfOptions
+ var pdfBytes = await page.PdfDataAsync(new PdfOptions
{
PrintBackground = true,
Format = PuppeteerSharp.Media.PaperFormat.A4,
@@ -511,9 +511,7 @@
}
});
- pdfUrl = "/" + fileName;
-
- Navigation.NavigateTo(pdfUrl, true);
+ await JS.InvokeVoidAsync("mostrarPdf", Convert.ToBase64String(pdfBytes));
}
}
@@ -521,11 +519,18 @@
\ No newline at end of file
diff --git a/HerramientaCASA/wwwroot/factura_20250729144732.pdf b/HerramientaCASA/wwwroot/factura_20250729144732.pdf
deleted file mode 100644
index bd4952a..0000000
Binary files a/HerramientaCASA/wwwroot/factura_20250729144732.pdf and /dev/null differ
diff --git a/HerramientaCASA/wwwroot/factura_20250730092236.pdf b/HerramientaCASA/wwwroot/factura_20250730092236.pdf
deleted file mode 100644
index e2f317b..0000000
Binary files a/HerramientaCASA/wwwroot/factura_20250730092236.pdf and /dev/null differ