Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Optimize the print style some financial reports #370

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/server/resources/views/modules/financial-sheet.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ block content
each row in table.rows
tr(class=row.classNames)
each cell in row.cells
td(class='cell--' + cell.key)!= cell.value
td(class='cell--' + cell.key)
span!= cell.value
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default abstract class AgingSummaryTable extends R.compose(
node: IAgingSummaryContact | IAgingSummaryTotal
): ITableColumnAccessor[] => {
return node.aging.map((aging, index) => ({
key: 'aging',
key: 'aging_period',
accessor: `aging[${index}].total.formattedAmount`,
}));
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ export enum AgingSummaryRowType {

export const HtmlTableCss = `
table tr.row-type--total td{
font-weight: 500;
font-weight: 600;
border-top: 1px solid #bbb;
border-bottom: 3px double #333;
}
table .column--current,
table .column--aging_period,
table .column--total,
table .cell--current,
table .cell--aging_period,
table .cell--total {
text-align: right;
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ export class CustomerBalanceSummaryTableInjectable {
tenantId: number,
filter: ICustomerBalanceSummaryQuery
): Promise<ICustomerBalanceSummaryTable> {

const i18n = this.tenancy.i18n(tenantId);
const { data, query, meta } =
await this.customerBalanceSummaryService.customerBalanceSummary(
tenantId,
filter
);
const tableRows = new CustomerBalanceSummaryTable(data, filter, i18n);
const table = new CustomerBalanceSummaryTable(data, filter, i18n);

return {
table: {
columns: tableRows.tableColumns(),
rows: tableRows.tableRows(),
columns: table.tableColumns(),
rows: table.tableRows(),
},
query,
meta,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class CustomerBalanceSummaryTable {
*/
private getCustomerColumnsAccessor = (): IColumnMapperMeta[] => {
const columns = [
{ key: 'customerName', accessor: 'customerName' },
{ key: 'name', accessor: 'customerName' },
{ key: 'total', accessor: 'total.formattedAmount' },
];
return R.compose(
Expand Down Expand Up @@ -85,7 +85,7 @@ export class CustomerBalanceSummaryTable {
*/
private getTotalColumnsAccessor = (): IColumnMapperMeta[] => {
const columns = [
{ key: 'total', value: this.i18n.__('Total') },
{ key: 'name', value: this.i18n.__('Total') },
{ key: 'total', accessor: 'total.formattedAmount' },
];
return R.compose(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ table tr.row-type--total td {
font-weight: 600;
border-top: 1px solid #bbb;
border-bottom: 3px double #333;
}`;
}
table .column--name {
width: 65%;
}
table .column--total,
table .cell--total {
text-align: right;
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ table tr.row-type--closing-balance td{
table tr.row-type--closing-balance td {
border-bottom: 1px solid #ececec;
}
`;
table .column--debit,
table .column--credit,
table .column--amount,
table .column--running_balance,
table .cell--debit,
table .cell--credit,
table .cell--amount,
table .cell--running_balance{
text-align: right;
}
table tr.row-type--account .cell--date span,
table tr.row-type--opening-balance .cell--account_name span,
table tr.row-type--closing-balance .cell--account_name span{
white-space: nowrap;
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export enum IROW_TYPE {
export const HtmlTableCustomCss = `
table tr.row-type--total td{
border-top: 1px solid #bbb;
font-weight: 500;
font-weight: 600;
border-bottom: 3px double #000;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class VendorBalanceSummaryTable {
*/
private getVendorColumnsAccessor = (): IColumnMapperMeta[] => {
const columns = [
{ key: 'vendorName', accessor: 'vendorName' },
{ key: 'name', accessor: 'vendorName' },
{ key: 'total', accessor: 'total.formattedAmount' },
];
return R.compose(
Expand Down Expand Up @@ -87,7 +87,7 @@ export class VendorBalanceSummaryTable {
*/
private getTotalColumnsAccessor = (): IColumnMapperMeta[] => {
const columns = [
{ key: 'total', value: this.i18n.__('Total') },
{ key: 'name', value: this.i18n.__('Total') },
{ key: 'total', accessor: 'total.formattedAmount' },
];
return R.compose(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ table tr.row-type--total td {
font-weight: 600;
border-top: 1px solid #bbb;
border-bottom: 3px double #333;
}`;
}
table .column--name {
width: 65%;
}
table .column--total,
table .cell--total {
text-align: right;
}
`;
Loading