fix_record_price_pdf (#587)

Reviewed-on: daoyoucloud/tachycode#587
Co-authored-by: hello@lv <2256334253@qq.com>
Co-committed-by: hello@lv <2256334253@qq.com>
This commit is contained in:
hello@lv 2024-04-03 13:03:56 +08:00 committed by sealday
parent f9ec74fc6e
commit ff9ae1a2f5
7 changed files with 21 additions and 5 deletions

View File

@ -98,6 +98,7 @@
"hot-mugs-double",
"long-dolphins-sit",
"pretty-wolves-allow",
"rare-lies-applaud",
"selfish-lies-enjoy",
"six-dolphins-mix",
"slimy-sloths-repeat",

View File

@ -0,0 +1,5 @@
---
"@hera/plugin-rental": patch
---
购销单线上报错处理增加log

View File

@ -22,6 +22,8 @@
"release:force": "lerna publish from-package --yes",
"run:example": "tsx -r dotenv/config -r tsconfig-paths/register ./examples/index.ts",
"start": "nocobase start",
"tag:p": "changeset",
"tag:v": "changeset version",
"tar": "nocobase tar",
"tc": "nocobase test:client",
"test": "nocobase test",

View File

@ -1,7 +1,7 @@
{
"name": "@hera/plugin-rental",
"displayName": "professional construction materials rental system - customized based on hera",
"version": "1.7.6-alpha.7",
"version": "1.7.6-alpha.8",
"description": "Offering a standardized leasing management system, encompassing comprehensive administration from materials to contracts to labor personnel, while providing a robust financial management mechanism, and real-time monitoring of the operational capacity of the leasing system.",
"keywords": [
"System management"

View File

@ -158,7 +158,8 @@ export class RecordPreviewController {
// 拉标题
const systemSetting = await this.systemSetting.get();
record.systemTitle = systemSetting?.title || '异常数据,请联系相关负责人!';
const user = await ctx.db.getRepository('users').findOne({ filter: { id: record.createdById } });
const userID = record.createdById || record.updatedById;
const user = await ctx.db.getRepository('users').findOne({ filter: { id: userID } });
record.nickname = user?.nickname || '';
record.userPhone = user?.phone || '';
record.pdfExplain = pdfExplain[0]?.out_of_storage_explain;

View File

@ -362,13 +362,16 @@ const PreviewDocument = ({
<React.Fragment key={columnIndex}>
<Text style={styles.tableCell2}>{item[column + 'name']}</Text>
<Text style={styles.tableCell}>
{formatQuantity(item[column + 'unit_price'], 2) + '元/' + item[column + 'unit']}
{item[column + 'unit_price'] &&
formatQuantity(item[column + 'unit_price'], 2) + '元/' + item[column + 'unit']}
</Text>
<Text style={styles.tableCell}>
{formatQuantity(item[column + 'count'], 2)}
{item[column + 'count'] && formatQuantity(item[column + 'count'], 2)}
{item[column + 'unit']}
</Text>
<Text style={styles.tableCell}>{formatCurrency(item[column + 'all_price'], 2)}</Text>
<Text style={styles.tableCell}>
{item[column + 'all_price'] && formatCurrency(item[column + 'all_price'], 2)}
</Text>
<Text style={!isDouble || column === 'right_' ? styles.tableCellLast : styles.tableCell}>
{item[column + 'comment'] || ''}
</Text>

View File

@ -70,6 +70,10 @@ export class RecordPdfService {
const setData = Object.values(
price_rule.reduce((acc, item) => {
if (!item) {
console.error('报价计算出错', price_rule);
return acc;
}
if (!acc[item.name]) {
acc[item.name] = { ...item };
} else {