mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 02:58:11 +00:00
feat(freight): add company logo setting applied to every generated document
New logo-settings module (mirrors stamp-settings): single uploaded logo, stored via FilesService/MinIO, injected as a data URL into invoice/receipt, contract, warehouse, train-scheduling, and payment-receipt PDFs. Adds a matching backoffice settings page and settings:logo:view/manage permissions. >
This commit is contained in:
@@ -49,6 +49,7 @@ describe("PaymentService.confirmOtp", () => {
|
||||
repo as never,
|
||||
client as never,
|
||||
billing as never,
|
||||
{} as never,
|
||||
);
|
||||
return { service, repo, billing };
|
||||
};
|
||||
@@ -197,6 +198,7 @@ describe("PaymentService.markIntentSucceeded", () => {
|
||||
repo as never,
|
||||
{} as never,
|
||||
billing as never,
|
||||
{} as never,
|
||||
);
|
||||
return { service, repo, billing };
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import { PaymentEntity } from "./entities/payment.entity";
|
||||
import { PaymentRepository } from "./payment.repository";
|
||||
import { PaymentClientService } from "./payment-client.service";
|
||||
import { BillingService } from "../billing/billing.service";
|
||||
import { LogoSettingsService } from "../logo-settings/logo-settings.service";
|
||||
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
@@ -104,6 +105,7 @@ export class PaymentService {
|
||||
private readonly paymentClient: PaymentClientService,
|
||||
@Inject(forwardRef(() => BillingService))
|
||||
private readonly billing: BillingService,
|
||||
private readonly logoSettings: LogoSettingsService,
|
||||
) { }
|
||||
|
||||
async getAll(filters: {
|
||||
@@ -657,6 +659,7 @@ export class PaymentService {
|
||||
total: payment.amount.toString(),
|
||||
currency: payment.currency,
|
||||
reason: payment.reason,
|
||||
logoImageUrl: await this.logoSettings.getLogoImageUrl(),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,14 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.header .doc-logo {
|
||||
display: block;
|
||||
margin: 0 auto 10px;
|
||||
max-height: 48px;
|
||||
max-width: 180px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.details-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
@@ -126,6 +134,7 @@
|
||||
<body>
|
||||
<div class="receipt-box">
|
||||
<div class="header">
|
||||
{{#if logoImageUrl}}<img class="doc-logo" src="{{logoImageUrl}}" alt="Company logo" />{{/if}}
|
||||
<h1>{{vendorName}}</h1>
|
||||
<p>{{vendorAddress}}</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user