add extension to insurance docs

This commit is contained in:
merelendor 2022-09-06 09:20:20 +03:00
parent 7fb9ba59d7
commit f794b55f7d
2 changed files with 22 additions and 15 deletions

View File

@ -41,8 +41,9 @@ export default async function handler(req, res)
})
.then((crm_response) =>
{
console.log("crm_response");
//console.log(crm_response);
console.log("API", "contract", "crm_response.data");
//console.log("API", "contract", crm_response.data);
res.status(200).json(crm_response.data);
})
.catch((error) =>

View File

@ -167,6 +167,8 @@ class ContractServicesPage extends React.Component
let { date, car, status } = contracts_info[ number ] !== undefined ? contracts_info[ number ] : {};
console.log("insurance", insurance);
return (
<React.Fragment>
<Head>
@ -250,9 +252,10 @@ class ContractServicesPage extends React.Component
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
<li>Номер полиса: { entry.url !== null ? (<DownloadFileById id={ entry.url } filename={ `${ entry.number }.${ entry.extension}` }>
<b style={{ color: "#1C01A9", cursor: "pointer", }}>{ entry.number }</b>
</DownloadFileById>
) : (<b>{ entry.number }</b>) }
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
@ -260,7 +263,7 @@ class ContractServicesPage extends React.Component
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.${ entry.invoice_extension}` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>
@ -276,9 +279,10 @@ class ContractServicesPage extends React.Component
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
<li>Номер полиса: { entry.url !== null ? (<DownloadFileById id={ entry.url } filename={ `${ entry.number }.${ entry.extension}` }>
<b style={{ color: "#1C01A9", cursor: "pointer", }}>{ entry.number }</b>
</DownloadFileById>
) : (<b>{ entry.number }</b>) }
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
@ -289,7 +293,7 @@ class ContractServicesPage extends React.Component
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.${ entry.invoice_extension}` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>
@ -305,17 +309,18 @@ class ContractServicesPage extends React.Component
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.pdf` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} } onClick={ () => { entry.url !== null ? this._handle_onContract(entry.url) : {} } }>{ entry.number }</b>
<li>Номер полиса: { entry.url !== null ? (<DownloadFileById id={ entry.url } filename={ `${ entry.number }.${ entry.extension}` }>
<b style={{ color: "#1C01A9", cursor: "pointer", }}>{ entry.number }</b>
</DownloadFileById>
</li>
) : (<b>{ entry.number }</b>) }
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
{ entry.amount && (<li>Страховая сумма: <b style={{ whiteSpace: "nowrap" }}>{ numeral(entry.amount).format(' ., ') }&nbsp;</b></li>) }
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.${ entry.invoice_extension}` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>
@ -331,9 +336,10 @@ class ContractServicesPage extends React.Component
{ entry.site && (<li>Сайт: <b>{ entry.site }</b></li>) }
{ entry.phone && (<li>Телефон: <b>{ entry.phone }</b></li>) }
{ entry.number && (
<li>Номер полиса: <DownloadFileById id={ entry.url } filename={ `${ entry.number }.docx` }>
<b style={ entry.url !== null ? { color: "#1C01A9", cursor: "pointer", } : {} }>{ entry.number }</b>
<li>Номер полиса: { entry.url !== null ? (<DownloadFileById id={ entry.url } filename={ `${ entry.number }.${ entry.extension}` }>
<b style={{ color: "#1C01A9", cursor: "pointer", }}>{ entry.number }</b>
</DownloadFileById>
) : (<b>{ entry.number }</b>) }
</li>
) }
{ entry.period && (<li>Период действия: <b>{ entry.period }</b></li>) }
@ -341,7 +347,7 @@ class ContractServicesPage extends React.Component
</ul>
{ entry.period_type === "prolong" && entry.invoice_url !== null && (
<div className="action">
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.pdf` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
<DownloadPdfButton id={ entry.invoice_url } filename={ `${ entry.number }.${ entry.invoice_extension}` } title="Скачать счет на оплату" class={ "services_invoice_button" }/>
</div>
) }
</div>