The API has been modified as per the instructions provided on 14-08-2025
This commit is contained in:
parent
c670266256
commit
a61623b0aa
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -32,6 +32,13 @@ export class CARNETSTATUS_DTO {
|
|||||||
P_CARNETSTATUS: string;
|
P_CARNETSTATUS: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class CARNETNO_DTO {
|
||||||
|
@ApiProperty({ required: true })
|
||||||
|
@IsString()
|
||||||
|
@IsDefined({ message: 'Property P_CARNETNO is required' })
|
||||||
|
P_CARNETNO: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class HEADERID_DTO {
|
export class HEADERID_DTO {
|
||||||
@ApiProperty({ required: true })
|
@ApiProperty({ required: true })
|
||||||
@Max(999999999, {
|
@Max(999999999, {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { IntersectionType, PartialType } from "@nestjs/swagger";
|
import { IntersectionType, PartialType } from "@nestjs/swagger";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
APPLICATIONNAME_DTO, AUTHREP_DTO, AUTO_FLAG_DTO, COMMERCIAL_SAMPLE_FLAG_DTO,
|
APPLICATIONNAME_DTO, AUTHREP_DTO, AUTO_FLAG_DTO, CARNETNO_DTO, COMMERCIAL_SAMPLE_FLAG_DTO,
|
||||||
COUNTRYTABLE_DTO, CUSTCOURIERNO_DTO, DELIVERYMETHOD_DTO, DELIVERYTYPE_DTO,
|
COUNTRYTABLE_DTO, CUSTCOURIERNO_DTO, DELIVERYMETHOD_DTO, DELIVERYTYPE_DTO,
|
||||||
EXIBITIONS_FAIR_FLAG_DTO, EXTENSION_PERIOD_DTO, FORMOFSECURITY_DTO, GLTABLE_DTO, GLTABLE_ITEMNO_OPTIONAL_DTO, GOODS_COUNTRY_DTO, GOODS_PORT_DTO, HEADERID_DTO,
|
EXIBITIONS_FAIR_FLAG_DTO, EXTENSION_PERIOD_DTO, FORMOFSECURITY_DTO, GLTABLE_DTO, GLTABLE_ITEMNO_OPTIONAL_DTO, GOODS_COUNTRY_DTO, GOODS_PORT_DTO, HEADERID_DTO,
|
||||||
HORSE_FLAG_DTO, INSPROTECTION_DTO, ITEMNO_DTO, LDIPROTECTION_DTO, ORDERTYPE_DTO, PAYMENTMETHOD_DTO,
|
HORSE_FLAG_DTO, INSPROTECTION_DTO, ITEMNO_DTO, LDIPROTECTION_DTO, ORDERTYPE_DTO, PAYMENTMETHOD_DTO,
|
||||||
@ -54,8 +54,9 @@ export class TransmitApplicationtoProcessDTO extends IntersectionType(
|
|||||||
// processing [ PROCESSINGCENTER_PKG ]
|
// processing [ PROCESSINGCENTER_PKG ]
|
||||||
export class CopyCarnetDTO extends (IntersectionType(USERID_DTO, HEADERID_DTO, APPLICATIONNAME_DTO)) { }
|
export class CopyCarnetDTO extends (IntersectionType(USERID_DTO, HEADERID_DTO, APPLICATIONNAME_DTO)) { }
|
||||||
export class CarnetProcessingCenterDTO extends (IntersectionType(USERID_DTO, HEADERID_DTO)) { }
|
export class CarnetProcessingCenterDTO extends (IntersectionType(USERID_DTO, HEADERID_DTO)) { }
|
||||||
export class GetExtendedSectionDTO extends (IntersectionType(SPID_DTO, HEADERID_DTO)){}
|
export class CarnetProcessingCenterDTO2 extends (IntersectionType(USERID_DTO, CARNETNO_DTO)) { }
|
||||||
export class SaveExtensionApplicationDTO extends(IntersectionType(
|
export class GetExtendedSectionDTO extends (IntersectionType(SPID_DTO, HEADERID_DTO)) { }
|
||||||
|
export class SaveExtensionApplicationDTO extends (IntersectionType(
|
||||||
USERID_DTO,
|
USERID_DTO,
|
||||||
SPID_DTO,
|
SPID_DTO,
|
||||||
HEADERID_DTO,
|
HEADERID_DTO,
|
||||||
@ -63,7 +64,7 @@ export class SaveExtensionApplicationDTO extends(IntersectionType(
|
|||||||
GOODS_COUNTRY_DTO,
|
GOODS_COUNTRY_DTO,
|
||||||
REASON_CODE_DTO,
|
REASON_CODE_DTO,
|
||||||
EXTENSION_PERIOD_DTO
|
EXTENSION_PERIOD_DTO
|
||||||
)){}
|
)) { }
|
||||||
|
|
||||||
export class PrintCarnetDTO extends (IntersectionType(SPID_DTO, HEADERID_DTO, PRINTGL_DTO)) { }
|
export class PrintCarnetDTO extends (IntersectionType(SPID_DTO, HEADERID_DTO, PRINTGL_DTO)) { }
|
||||||
export class PrintGLDTO extends (IntersectionType(SPID_DTO, HEADERID_DTO)) { }
|
export class PrintGLDTO extends (IntersectionType(SPID_DTO, HEADERID_DTO)) { }
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
AddCountriesDTO,
|
AddCountriesDTO,
|
||||||
AddGenerallistItemsDTO,
|
AddGenerallistItemsDTO,
|
||||||
CA_UpdateHolderDTO,
|
CA_UpdateHolderDTO,
|
||||||
CarnetProcessingCenterDTO, CopyCarnetDTO, CreateApplicationDTO, DeleteGenerallistItemsDTO, EditGenerallistItemsDTO, GetCarnetControlCenterDTO, GetExtendedSectionDTO, PrintCarnetDTO, PrintGLDTO, SaveCarnetApplicationDTO, SaveExtensionApplicationDTO, TransmitApplicationtoProcessDTO,
|
CarnetProcessingCenterDTO, CarnetProcessingCenterDTO2, CopyCarnetDTO, CreateApplicationDTO, DeleteGenerallistItemsDTO, EditGenerallistItemsDTO, GetCarnetControlCenterDTO, GetExtendedSectionDTO, PrintCarnetDTO, PrintGLDTO, SaveCarnetApplicationDTO, SaveExtensionApplicationDTO, TransmitApplicationtoProcessDTO,
|
||||||
UpdateExpGoodsAuthRepDTO,
|
UpdateExpGoodsAuthRepDTO,
|
||||||
UpdateShippingDetailsDTO
|
UpdateShippingDetailsDTO
|
||||||
} from 'src/dto/property.dto';
|
} from 'src/dto/property.dto';
|
||||||
@ -114,17 +114,17 @@ export class CarnetApplicationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Patch('DuplicateCarnet')
|
@Patch('DuplicateCarnet')
|
||||||
DuplicateCarnet(@Body() body: CarnetProcessingCenterDTO) {
|
DuplicateCarnet(@Body() body: CarnetProcessingCenterDTO2) {
|
||||||
return this.carnetApplicationService.DuplicateCarnet(body);
|
return this.carnetApplicationService.DuplicateCarnet(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Patch('AddlSets')
|
@Patch('AddlSets')
|
||||||
AddlSets(@Body() body: CarnetProcessingCenterDTO) {
|
AddlSets(@Body() body: CarnetProcessingCenterDTO2) {
|
||||||
return this.carnetApplicationService.AddlSets(body);
|
return this.carnetApplicationService.AddlSets(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Patch('ExtendCarnet')
|
@Patch('ExtendCarnet')
|
||||||
ExtendCarnet(@Body() body: CarnetProcessingCenterDTO) {
|
ExtendCarnet(@Body() body: CarnetProcessingCenterDTO2) {
|
||||||
return this.carnetApplicationService.ExtendCarnet(body);
|
return this.carnetApplicationService.ExtendCarnet(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,8 @@ import {
|
|||||||
YON,
|
YON,
|
||||||
CopyCarnetDTO,
|
CopyCarnetDTO,
|
||||||
GetExtendedSectionDTO,
|
GetExtendedSectionDTO,
|
||||||
SaveExtensionApplicationDTO
|
SaveExtensionApplicationDTO,
|
||||||
|
CarnetProcessingCenterDTO2
|
||||||
} from 'src/dto/property.dto';
|
} from 'src/dto/property.dto';
|
||||||
import { OracleService } from '../oracle.service';
|
import { OracleService } from '../oracle.service';
|
||||||
import { BadRequestException } from 'src/exceptions/badRequest.exception';
|
import { BadRequestException } from 'src/exceptions/badRequest.exception';
|
||||||
@ -797,7 +798,7 @@ export class CarnetApplicationService {
|
|||||||
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async DuplicateCarnet(body: CarnetProcessingCenterDTO) {
|
async DuplicateCarnet(body: CarnetProcessingCenterDTO2) {
|
||||||
let connection;
|
let connection;
|
||||||
try {
|
try {
|
||||||
connection = await this.oracleDBService.getConnection();
|
connection = await this.oracleDBService.getConnection();
|
||||||
@ -805,12 +806,12 @@ export class CarnetApplicationService {
|
|||||||
const result = await connection.execute(
|
const result = await connection.execute(
|
||||||
`BEGIN
|
`BEGIN
|
||||||
PROCESSINGCENTER_PKG.DuplicateCarnet(
|
PROCESSINGCENTER_PKG.DuplicateCarnet(
|
||||||
:P_USERID, :P_HEADERID, :P_CURSOR
|
:P_USERID, :P_CARNETNO, :P_CURSOR
|
||||||
);
|
);
|
||||||
END;`,
|
END;`,
|
||||||
{
|
{
|
||||||
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
|
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_HEADERID: { val: body.P_HEADERID, type: oracledb.DB_TYPE_NUMBER },
|
P_CARNETNO: { val: body.P_CARNETNO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_CURSOR: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR },
|
P_CURSOR: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR },
|
||||||
// P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
// P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
||||||
},
|
},
|
||||||
@ -839,7 +840,7 @@ export class CarnetApplicationService {
|
|||||||
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async AddlSets(body: CarnetProcessingCenterDTO) {
|
async AddlSets(body: CarnetProcessingCenterDTO2) {
|
||||||
let connection;
|
let connection;
|
||||||
try {
|
try {
|
||||||
connection = await this.oracleDBService.getConnection();
|
connection = await this.oracleDBService.getConnection();
|
||||||
@ -847,12 +848,12 @@ export class CarnetApplicationService {
|
|||||||
const result = await connection.execute(
|
const result = await connection.execute(
|
||||||
`BEGIN
|
`BEGIN
|
||||||
PROCESSINGCENTER_PKG.AddlSets(
|
PROCESSINGCENTER_PKG.AddlSets(
|
||||||
:P_USERID, :P_HEADERID, :P_CURSOR
|
:P_USERID, :P_CARNETNO, :P_CURSOR
|
||||||
);
|
);
|
||||||
END;`,
|
END;`,
|
||||||
{
|
{
|
||||||
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
|
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_HEADERID: { val: body.P_HEADERID, type: oracledb.DB_TYPE_NUMBER },
|
P_CARNETNO: { val: body.P_CARNETNO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_CURSOR: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR },
|
P_CURSOR: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR },
|
||||||
// P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
// P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
||||||
},
|
},
|
||||||
@ -881,7 +882,7 @@ export class CarnetApplicationService {
|
|||||||
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
await closeOracleDbConnection(connection, CarnetApplicationService.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async ExtendCarnet(body: CarnetProcessingCenterDTO) {
|
async ExtendCarnet(body: CarnetProcessingCenterDTO2) {
|
||||||
let connection;
|
let connection;
|
||||||
try {
|
try {
|
||||||
connection = await this.oracleDBService.getConnection();
|
connection = await this.oracleDBService.getConnection();
|
||||||
@ -889,12 +890,12 @@ export class CarnetApplicationService {
|
|||||||
const result = await connection.execute(
|
const result = await connection.execute(
|
||||||
`BEGIN
|
`BEGIN
|
||||||
PROCESSINGCENTER_PKG.ExtendCarnet(
|
PROCESSINGCENTER_PKG.ExtendCarnet(
|
||||||
:P_USERID, :P_HEADERID, :P_CURSOR
|
:P_USERID, :P_CARNETNO, :P_CURSOR
|
||||||
);
|
);
|
||||||
END;`,
|
END;`,
|
||||||
{
|
{
|
||||||
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
|
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_HEADERID: { val: body.P_HEADERID, type: oracledb.DB_TYPE_NUMBER },
|
P_CARNETNO: { val: body.P_CARNETNO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_CURSOR: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR },
|
P_CURSOR: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR },
|
||||||
// P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
// P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
||||||
},
|
},
|
||||||
|
|||||||
@ -150,45 +150,45 @@ export const generateGreenCoverPDF = (carnetData: pdfCarnetData) => {
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'CarnetNo') {
|
if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'AuthBy') {
|
else if (x.type === "text" && x.name === 'AuthBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.AUTHREP);
|
nameField.setText(carnetData.AUTHREP);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'ContnSheetNo') {
|
else if (x.type === "text" && x.name === 'ContnSheetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.CONTINUATIONSHEETS + "");
|
nameField.setText(carnetData.CONTINUATIONSHEETS + "");
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'GoodstobeExportedas') {
|
else if (x.type === "text" && x.name === 'GoodstobeExportedas') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'IssuedOn') {
|
else if (x.type === "text" && x.name === 'IssuedOn') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'IssuedBy') {
|
else if (x.type === "text" && x.name === 'IssuedBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.ISSUEDBY);
|
nameField.setText(carnetData.ISSUEDBY);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'ValidUntil') {
|
else if (x.type === "text" && x.name === 'ValidUntil') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'HolderNameAddress') {
|
else if (x.type === "text" && x.name === 'HolderNameAddress') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.enableMultiline();
|
nameField.enableMultiline();
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const multilineAddress = carnetData.HOLDERDATATOPRINT.replace(/~/g, "\n");
|
const multilineAddress = carnetData.HOLDERDATATOPRINT.replace(/~/g, "\n");
|
||||||
nameField.setText(multilineAddress);
|
nameField.setText(multilineAddress);
|
||||||
}
|
}
|
||||||
@ -246,7 +246,7 @@ export const generateUSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'Document No1') {
|
if (x.type === "text" && x.name === 'Document No1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VALUE") {
|
if (t1 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -257,12 +257,12 @@ export const generateUSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'Document No2') {
|
else if (x.type === "text" && x.name === 'Document No2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VALUE") {
|
if (t2 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -273,7 +273,7 @@ export const generateUSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VOID") {
|
if (t1 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t1);
|
nameField.setText(t1);
|
||||||
@ -281,7 +281,7 @@ export const generateUSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VOID") {
|
if (t2 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t2);
|
nameField.setText(t2);
|
||||||
@ -340,7 +340,7 @@ export const generateUSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'Document No1') {
|
if (x.type === "text" && x.name === 'Document No1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VALUE") {
|
if (t1 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -351,12 +351,12 @@ export const generateUSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'Document No2') {
|
else if (x.type === "text" && x.name === 'Document No2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VALUE") {
|
if (t2 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -367,7 +367,7 @@ export const generateUSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VOID") {
|
if (t1 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t1);
|
nameField.setText(t1);
|
||||||
@ -375,7 +375,7 @@ export const generateUSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VOID") {
|
if (t2 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t2);
|
nameField.setText(t2);
|
||||||
@ -436,7 +436,7 @@ export const generateFNCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'DocumentNo1') {
|
if (x.type === "text" && x.name === 'DocumentNo1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VALUE") {
|
if (t1 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -447,12 +447,12 @@ export const generateFNCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VALUE") {
|
if (t2 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -463,7 +463,7 @@ export const generateFNCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VOID") {
|
if (t1 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t1);
|
nameField.setText(t1);
|
||||||
@ -471,7 +471,7 @@ export const generateFNCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VOID") {
|
if (t2 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t2);
|
nameField.setText(t2);
|
||||||
@ -530,7 +530,7 @@ export const generateFNCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'DocumentNo1') {
|
if (x.type === "text" && x.name === 'DocumentNo1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VALUE") {
|
if (t1 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -541,12 +541,12 @@ export const generateFNCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VALUE") {
|
if (t2 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -557,7 +557,7 @@ export const generateFNCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VOID") {
|
if (t1 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t1);
|
nameField.setText(t1);
|
||||||
@ -565,7 +565,7 @@ export const generateFNCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VOID") {
|
if (t2 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t2);
|
nameField.setText(t2);
|
||||||
@ -626,7 +626,7 @@ export const generateTSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'DocumentNo1') {
|
if (x.type === "text" && x.name === 'DocumentNo1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VALUE") {
|
if (t1 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -637,12 +637,12 @@ export const generateTSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VALUE") {
|
if (t2 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -653,7 +653,7 @@ export const generateTSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VOID") {
|
if (t1 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t1);
|
nameField.setText(t1);
|
||||||
@ -661,7 +661,7 @@ export const generateTSCounterFoilFront = (carnetData: pdfCarnetData, t1: string
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VOID") {
|
if (t2 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t2);
|
nameField.setText(t2);
|
||||||
@ -720,7 +720,7 @@ export const generateTSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'DocumentNo1') {
|
if (x.type === "text" && x.name === 'DocumentNo1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VALUE") {
|
if (t1 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -731,12 +731,12 @@ export const generateTSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
else if (x.type === "text" && x.name === 'DocumentNo2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t2 === "VALUE") {
|
if (t2 === "VALUE") {
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
@ -747,7 +747,7 @@ export const generateTSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
else if (x.type === "text" && x.name === 'PrintVoidText1') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VOID") {
|
if (t1 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t1);
|
nameField.setText(t1);
|
||||||
@ -755,7 +755,7 @@ export const generateTSCounterFoilBack = (carnetData: pdfCarnetData, t1: string,
|
|||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
else if (x.type === "text" && x.name === 'PrintVoidText2') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
if (t1 === "VOID") {
|
if (t1 === "VOID") {
|
||||||
nameField.setAlignment(TextAlignment.Center);
|
nameField.setAlignment(TextAlignment.Center);
|
||||||
nameField.setText(t1);
|
nameField.setText(t1);
|
||||||
@ -816,39 +816,45 @@ export const generateFNImportV = (carnetData: pdfCarnetData, dn: number, pn: num
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'Valid Until') {
|
if (x.type === "text" && x.name === 'Valid Until') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
|
else if (x.type === "text" && x.name === 'HolderNameAddress') {
|
||||||
|
const nameField = form.getTextField(x.name);
|
||||||
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
|
const multilineAddress = carnetData.HOLDERDATATOPRINT.replace(/~/g, "\n");
|
||||||
|
nameField.setText(multilineAddress);
|
||||||
|
}
|
||||||
else if (x.type === "text" && x.name === 'VoucherNo') {
|
else if (x.type === "text" && x.name === 'VoucherNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'AuthorizedBy') {
|
else if (x.type === "text" && x.name === 'AuthorizedBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.AUTHREP);
|
nameField.setText(carnetData.AUTHREP);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'GoodsDescription') {
|
else if (x.type === "text" && x.name === 'GoodsDescription') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'IssuedBy') {
|
else if (x.type === "text" && x.name === 'IssuedBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.ISSUEDBY);
|
nameField.setText(carnetData.ISSUEDBY);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'Issued') {
|
else if (x.type === "text" && x.name === 'Issued') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
@ -908,39 +914,45 @@ export const generateFNExportV = (carnetData: pdfCarnetData, dn: number, pn: num
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'Valid Until') {
|
if (x.type === "text" && x.name === 'Valid Until') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
|
else if (x.type === "text" && x.name === 'HolderNameAddress') {
|
||||||
|
const nameField = form.getTextField(x.name);
|
||||||
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
|
const multilineAddress = carnetData.HOLDERDATATOPRINT.replace(/~/g, "\n");
|
||||||
|
nameField.setText(multilineAddress);
|
||||||
|
}
|
||||||
else if (x.type === "text" && x.name === 'VoucherNo') {
|
else if (x.type === "text" && x.name === 'VoucherNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'AuthorizedBy') {
|
else if (x.type === "text" && x.name === 'AuthorizedBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.AUTHREP);
|
nameField.setText(carnetData.AUTHREP);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'GoodsDescription') {
|
else if (x.type === "text" && x.name === 'GoodsDescription') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'IssuedBy') {
|
else if (x.type === "text" && x.name === 'IssuedBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.ISSUEDBY);
|
nameField.setText(carnetData.ISSUEDBY);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'Issued') {
|
else if (x.type === "text" && x.name === 'Issued') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
@ -1000,39 +1012,45 @@ export const generateTNV = (carnetData: pdfCarnetData, dn: number, pn: number):
|
|||||||
fieldInfo.forEach(x => {
|
fieldInfo.forEach(x => {
|
||||||
if (x.type === "text" && x.name === 'Valid Until') {
|
if (x.type === "text" && x.name === 'Valid Until') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
const formattedDate = toUSDateTime(carnetData.EXPDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'CarnetNo') {
|
else if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.carnetNo);
|
nameField.setText(carnetData.carnetNo);
|
||||||
}
|
}
|
||||||
|
else if (x.type === "text" && x.name === 'HolderNameAddress') {
|
||||||
|
const nameField = form.getTextField(x.name);
|
||||||
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
|
const multilineAddress = carnetData.HOLDERDATATOPRINT.replace(/~/g, "\n");
|
||||||
|
nameField.setText(multilineAddress);
|
||||||
|
}
|
||||||
else if (x.type === "text" && x.name === 'VoucherNo') {
|
else if (x.type === "text" && x.name === 'VoucherNo') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(dn + "");
|
nameField.setText(dn + "");
|
||||||
dn++;
|
dn++;
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'AuthorizedBy') {
|
else if (x.type === "text" && x.name === 'AuthorizedBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.AUTHREP);
|
nameField.setText(carnetData.AUTHREP);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'GoodsDescription') {
|
else if (x.type === "text" && x.name === 'GoodsDescription') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
nameField.setText(carnetData.PRINTGOODSTOBEEXPORTED);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'IssuedBy') {
|
else if (x.type === "text" && x.name === 'IssuedBy') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(carnetData.ISSUEDBY);
|
nameField.setText(carnetData.ISSUEDBY);
|
||||||
}
|
}
|
||||||
else if (x.type === "text" && x.name === 'Issued') {
|
else if (x.type === "text" && x.name === 'Issued') {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
const formattedDate = toUSDateTime(carnetData.ISSUEDATE)
|
||||||
nameField.setText(formattedDate);
|
nameField.setText(formattedDate);
|
||||||
}
|
}
|
||||||
@ -1223,20 +1241,20 @@ export async function processGlDataInBatches(
|
|||||||
fdata.forEach(x => {
|
fdata.forEach(x => {
|
||||||
// if (x.type === "text" && x.name === 'CarnetNo') {
|
// if (x.type === "text" && x.name === 'CarnetNo') {
|
||||||
// const nameField = form.getTextField(x.name);
|
// const nameField = form.getTextField(x.name);
|
||||||
// nameField.setFontSize(CURRENT_FONT);
|
// // nameField.setFontSize(CURRENT_FONT);
|
||||||
// nameField.setText(carnetData.carnetNo);
|
// nameField.setText(carnetData.carnetNo);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (/^Item ValueRow\d+$/.test(x.name)) {
|
if (/^Item ValueRow\d+$/.test(x.name)) {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
let ThousandSeparatorValue = formatNumber(x.value);
|
let ThousandSeparatorValue = formatNumber(x.value);
|
||||||
nameField.setAlignment(TextAlignment.Right);
|
nameField.setAlignment(TextAlignment.Right);
|
||||||
nameField.setText(ThousandSeparatorValue + "");
|
nameField.setText(ThousandSeparatorValue + "");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const nameField = form.getTextField(x.name);
|
const nameField = form.getTextField(x.name);
|
||||||
nameField.setFontSize(CURRENT_FONT);
|
// nameField.setFontSize(CURRENT_FONT);
|
||||||
nameField.setText(x.value + "");
|
nameField.setText(x.value + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1250,16 +1268,16 @@ export async function processGlDataInBatches(
|
|||||||
|
|
||||||
const carnetNoField = form.getTextField('Carnet No');
|
const carnetNoField = form.getTextField('Carnet No');
|
||||||
carnetNoField.setFontSize(CURRENT_FONT);
|
carnetNoField.setFontSize(CURRENT_FONT);
|
||||||
carnetNoField.setText(carnetData.carnetNo);
|
carnetNoField.setText(data.carnetNo + "");
|
||||||
|
|
||||||
const contnSheetNoField = form.getTextField('ContnSheet No');
|
const contnSheetNoField = form.getTextField('ContnSheet No');
|
||||||
contnSheetNoField.setFontSize(CURRENT_FONT);
|
contnSheetNoField.setFontSize(CURRENT_FONT);
|
||||||
contnSheetNoField.setText((batchNumber - 1) + "");
|
contnSheetNoField.setText((currentBatchNumber - 1) + "");
|
||||||
|
|
||||||
form.flatten();
|
form.flatten();
|
||||||
const filledPdfBytes = await pdfDoc.save();
|
const filledPdfBytes = await pdfDoc.save();
|
||||||
|
|
||||||
const outputPath = path.join(__dirname, PDF_URL, `${body.P_HEADERID}p2gl${batchNumber}.pdf`);
|
const outputPath = path.join(__dirname, PDF_URL, `${body.P_HEADERID}p2gl${currentBatchNumber}.pdf`);
|
||||||
const writeStream = fs.createWriteStream(outputPath);
|
const writeStream = fs.createWriteStream(outputPath);
|
||||||
|
|
||||||
writeStream.write(filledPdfBytes);
|
writeStream.write(filledPdfBytes);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user