update pdf templates with attched docs

This commit is contained in:
2023-09-26 13:39:23 +01:00
parent b56f73d854
commit 2ce248fba8
10 changed files with 367 additions and 185 deletions
+42 -46
View File
@@ -10,6 +10,7 @@ import ReactPDF, {
} from "@react-pdf/renderer";
import { createElement } from "react";
import Html from "react-pdf-html";
import { getFormCollectionByID } from "../../components/utils";
import renderers, { renderBlock } from "react-pdf-html/dist/renderers";
@@ -87,11 +88,6 @@ const styles = StyleSheet.create({
flexDirection: "column",
},
});
// const renderer_1 = require("@react-pdf/renderer");
// const renderPara = {
// "p": ({ style, element, children }) =>
// createElement(renderer_1.View, { style: style }, children),
// };
export const statement_pdf = ({ docProps }) => {
//console.log("----", docProps);
@@ -104,6 +100,11 @@ export const statement_pdf = ({ docProps }) => {
return dd + "/" + mm + "/" + yyyy;
}
let values = docProps;
let datestr = values.pinswg_name.split("-");
let signedDate = datestr[2] + "/" + datestr[1] + "/" + datestr[0];
let appealTypeValue = getFormCollectionByID(values.appealType);
return (
<Document>
<Page size="A4" style={styles.page} wrap>
@@ -170,15 +171,7 @@ export const statement_pdf = ({ docProps }) => {
flexDirection: "row",
marginBottom: 10,
}}
>
<Text style={styles.questionBullet}>2.</Text>
<Text style={styles.questionText}>
LPA reference:
</Text>
<Text style={styles.questionAnswer}>
{values.lpaRef}
</Text>
</View>
></View>
<View
wrap={false}
style={{
@@ -191,8 +184,7 @@ export const statement_pdf = ({ docProps }) => {
Site address/grid ref:
</Text>
<Text style={styles.questionAnswer}>
123 Big Street, Small Town, Little County,
XD23 54X
{values.siteAddress}
</Text>
</View>
<View
@@ -207,7 +199,7 @@ export const statement_pdf = ({ docProps }) => {
Case Type:
</Text>
<Text style={styles.questionAnswer}>
Planning applicaiton (s78)
{appealTypeValue.value}
</Text>
</View>
</View>
@@ -239,12 +231,14 @@ export const statement_pdf = ({ docProps }) => {
5.
</Text>
<Text style={styles.questionTextMid}>
Stament
</Text>
<Text style={styles.questionAnswerMid}>
{values.representationComment}
Statement
</Text>
</View>
<View style={styles.questionAnswerWide}>
<Html style={styles.richArea}>
{values.representationComments}
</Html>
</View>
</View>
</View>
</View>
@@ -271,10 +265,30 @@ export const statement_pdf = ({ docProps }) => {
<Text style={styles.questionText}>
List of attached files
</Text>
<View style={styles.questionAnswer}>
<Html style={styles.richArea}>
{values.LPAcaseFileAndReps}
</Html>
<View
style={[
styles.questionAnswer,
{ flexDirection: "column" },
]}
>
{values.filesList.map(function (p) {
return (
<View
style={{
flexDirection: "row",
marginBottom: 4,
}}
>
<Text
styles={
styles.questionTextMid
}
>
{p.name} - {p.size}
</Text>
</View>
);
})}
</View>
</View>
</View>
@@ -309,7 +323,7 @@ export const statement_pdf = ({ docProps }) => {
Signed:
</Text>
<Text style={styles.questionAnswer}>
{values.caseOfficer}
{values.firstname} {values.lastname}
</Text>
</View>
<View
@@ -323,7 +337,7 @@ export const statement_pdf = ({ docProps }) => {
Date:
</Text>
<Text style={styles.questionAnswer}>
{formatDates(values.signedDate)}
{signedDate}
</Text>
</View>
</View>
@@ -338,28 +352,10 @@ export const statement_pdf = ({ docProps }) => {
On behalf of:
</Text>
<Text style={styles.questionAnswerWide}>
{values.onBehalfOfLPA}
{values.representationCapacity}
</Text>
</View>
</View>
<View style={{ marginTop: 50, fontSize: 12 }}>
<Text>
* Article 11 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Regulation 7 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) (Wales) Regulations 2012
</Text>
<Text style={{ marginTop: 20 }}>
** Article 12 of The Town and Country Planning
(Development Management Procedure) (Wales) Order
2012; Section 67/73 of The Town and Country
Planning (Listed Buildings and Conservation
Areas) Act 1990; Regulation 10 of The Town and
Country Planning (Listed Buildings and
Conservation Areas) (Wales) Regulations 2012
</Text>
</View>
</View>
</View>
<Text