task-h.5.3
This commit is contained in:
@@ -384,72 +384,79 @@ const DOCUMENT_TEMPLATE_MAPPINGS: TemplateMappingSeed[] = [
|
||||
dataType: 'scalar',
|
||||
sortOrder: 9
|
||||
},
|
||||
{
|
||||
placeholderKey: 'quotation_price_data',
|
||||
sourcePath: 'pdfme.quotation_price_data',
|
||||
dataType: 'table',
|
||||
defaultValue: JSON.stringify([['Price (Exclude VAT)', '-', ' ', 'THB']]),
|
||||
sortOrder: 10
|
||||
},
|
||||
{
|
||||
placeholderKey: 'quotation_price',
|
||||
sourcePath: 'pdfme.quotation_price',
|
||||
dataType: 'scalar',
|
||||
formatMask: null,
|
||||
sortOrder: 10
|
||||
sortOrder: 11
|
||||
},
|
||||
{
|
||||
placeholderKey: 'currency',
|
||||
sourcePath: 'quotation.currency',
|
||||
dataType: 'scalar',
|
||||
sortOrder: 11
|
||||
sortOrder: 12
|
||||
},
|
||||
{
|
||||
placeholderKey: 'exclusion_data',
|
||||
sourcePath: 'pdfme.exclusion_data',
|
||||
dataType: 'table',
|
||||
sortOrder: 12
|
||||
sortOrder: 13
|
||||
},
|
||||
{
|
||||
placeholderKey: 'app1',
|
||||
sourcePath: 'signatures.preparedBy.name',
|
||||
dataType: 'scalar',
|
||||
defaultValue: '-',
|
||||
sortOrder: 13
|
||||
sortOrder: 14
|
||||
},
|
||||
{
|
||||
placeholderKey: 'app1_position',
|
||||
sourcePath: 'signatures.preparedBy.position',
|
||||
dataType: 'scalar',
|
||||
defaultValue: '-',
|
||||
sortOrder: 14
|
||||
sortOrder: 15
|
||||
},
|
||||
{
|
||||
placeholderKey: 'app2',
|
||||
sourcePath: 'signatures.approvedBy.name',
|
||||
dataType: 'scalar',
|
||||
defaultValue: '-',
|
||||
sortOrder: 15
|
||||
sortOrder: 16
|
||||
},
|
||||
{
|
||||
placeholderKey: 'app2_position',
|
||||
sourcePath: 'signatures.approvedBy.position',
|
||||
dataType: 'scalar',
|
||||
defaultValue: '-',
|
||||
sortOrder: 16
|
||||
sortOrder: 17
|
||||
},
|
||||
{
|
||||
placeholderKey: 'app3',
|
||||
sourcePath: 'signatures.authorizedBy.name',
|
||||
dataType: 'scalar',
|
||||
defaultValue: '-',
|
||||
sortOrder: 17
|
||||
sortOrder: 18
|
||||
},
|
||||
{
|
||||
placeholderKey: 'app3_position',
|
||||
sourcePath: 'signatures.authorizedBy.position',
|
||||
dataType: 'scalar',
|
||||
defaultValue: '-',
|
||||
sortOrder: 18
|
||||
sortOrder: 19
|
||||
},
|
||||
{
|
||||
placeholderKey: 'items_table',
|
||||
sourcePath: 'items',
|
||||
dataType: 'table',
|
||||
sortOrder: 19,
|
||||
sortOrder: 20,
|
||||
columns: [
|
||||
{ columnName: 'Item', sourceField: 'itemNumber', columnLetter: 'A', sortOrder: 1 },
|
||||
{ columnName: 'Description', sourceField: 'description', columnLetter: 'B', sortOrder: 2 },
|
||||
@@ -922,6 +929,17 @@ async function upsertDocumentTemplatesForOrganization(
|
||||
)
|
||||
and deleted_at is null
|
||||
`;
|
||||
|
||||
await sql`
|
||||
update crm_document_template_mappings
|
||||
set
|
||||
deleted_at = now(),
|
||||
updated_at = now()
|
||||
where organization_id = ${organization.id}
|
||||
and template_version_id = ${resolvedVersionId}
|
||||
and placeholder_key in (${'exclusion_data_'})
|
||||
and deleted_at is null
|
||||
`;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
|
||||
Reference in New Issue
Block a user