diff --git a/components/DealsStatus/DealContractsSignPaper.js b/components/DealsStatus/DealContractsSignPaper.js
index dfc124c..39407e1 100644
--- a/components/DealsStatus/DealContractsSignPaper.js
+++ b/components/DealsStatus/DealContractsSignPaper.js
@@ -6,7 +6,7 @@ import { concatSeries } from "async";
import { eachSeries } from 'async';
import Select from 'react-select';
-import { createEDOProject, docEDOCancel, signCheckEDOCreatePrintForm, signCheckPowerAttorneyClient, signDownloadFile, signGetGUIDEntity, signGetPowerAttorneyClient, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect } from "../../actions";
+import { createEDOProject, docEDOCancel, signCheckEDOCreatePrintForm, signDownloadFile, signGetGUIDEntity, signGetWMDoc, docEDOSign, docEDOStatus, docEDOConnect } from "../../actions";
export default class DealContractsSignPaper extends React.Component
{
@@ -29,8 +29,9 @@ export default class DealContractsSignPaper extends React.Component
const docs = [];
for(let i in this.props.documents)
{
- docs.push({ ...this.props.documents[i], ...{ index: i, loading: true, ready: false, attorney: false } });
+ docs.push({ ...this.props.documents[i], ...{ index: i, loading: true, ready: false, upload: false, } });
}
+
this.setState({ documents: docs, loading: true });
}
@@ -116,129 +117,51 @@ export default class DealContractsSignPaper extends React.Component
else
{
console.log({ document })
- await this._updateDocs(document.index, { loading: true });
+// await this._updateDocs(document.index, { loading: true });
- if(document.attorney && document.attorney_selected !== undefined)
+ const create_print_form_result = await signCheckEDOCreatePrintForm({ contract_number: document.id, sign_type: "Paper" });
+ console.log({ create_print_form_result });
+
+ const docs = { status: create_print_form_result.status };
+
+ if(create_print_form_result.status !== "success")
{
- const create_edo_project_result = await createEDOProject({
- contract_number: document.id,
- power_attorney: document.attorney_selected.value,
- power_attorney_number: document.attorney_selected.label,
- edo_box: operator_selected.edo_box,
- });
+ docs.loading = false;
+ docs.error = true;
+ docs.ready = true;
+ docs.message = create_print_form_result.message;
+ }
- console.log("\n\nIMPORTANT !!!!!!!!!!\n\n");
- console.log({ create_edo_project_result });
+ await this._updateDocs(document.index, docs);
+ if(create_print_form_result.status === "success")
+ {
const get_guid_entity_result = await signGetGUIDEntity({
contract_number: document.id,
});
- console.log("\n\nENTITY !!!!!!!!!!\n\n");
- console.log({ get_guid_entity_result });
+ const wmdoc_result = await signGetWMDoc({
+ entity_name: "evo_contract",
+ entity_id: get_guid_entity_result.entityid,
+ sign_type: "Paper",
+ evo_id: "60",
+ });
+ console.log({ wmdoc_result });
+
+ const connect_result = await docEDOConnect({ contract_number: document.id });
await this._updateDocs(document.index, {
entity_id: get_guid_entity_result.entityid,
ready: true,
loading: false,
- attorney: false,
});
callback();
}
else
{
- const create_print_form_result = await signCheckEDOCreatePrintForm({ contract_number: document.id, sign_type: "EDO" });
- console.log({ create_print_form_result });
-
- const docs = { status: create_print_form_result.status };
-
- if(create_print_form_result.status !== "success")
- {
- docs.loading = false;
- docs.error = true;
- docs.ready = true;
- docs.message = create_print_form_result.message;
- }
-
- await this._updateDocs(document.index, docs);
-
- if(create_print_form_result.status === "success")
- {
- const check_attorney_client_result = await signCheckPowerAttorneyClient({ contract_number: document.id })
- console.log({ check_attorney_client_result });
-
- await this._updateDocs(document.index, { attorney: check_attorney_client_result.power_attorney_required, });
-
- if(check_attorney_client_result.power_attorney_required)
- {
- const get_attorney_client_result = await signGetPowerAttorneyClient({ contract_number: document.id });
- console.log({ get_attorney_client_result });
-
- if(get_attorney_client_result === null)
- {
- await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Возникла ошибка при создании документа для подписания." });
- callback();
- }
- else
- {
- if(get_attorney_client_result.length === null)
- {
- await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Не обнаружена доверенность на подписанта. Для продолжения подписания обратитесь к своему персональному менеджеру" });
- callback();
- }
- else
- {
- const attorneys = [];
- for(let i in get_attorney_client_result)
- {
- attorneys.push({
- value: get_attorney_client_result[i].power_attorney,
- label: get_attorney_client_result[i].power_attorney_number,
- });
- }
-
- await this._updateDocs(document.index, { loading: false, error: false, attorneys, attorney_selected: undefined });
-
- callback();
- }
- }
- }
- else
- {
- const create_edo_project_result = await createEDOProject({
- contract_number: document.id,
- edo_box: operator_selected.edo_box,
- });
-
- const get_guid_entity_result = await signGetGUIDEntity({
- contract_number: document.id,
- });
-
- const wmdoc_result = await signGetWMDoc({
- entity_name: "evo_contract",
- entity_id: get_guid_entity_result.entityid,
- sign_type: "EDO",
- evo_id: "144",
- });
- console.log({ wmdoc_result });
-
- const connect_result = await docEDOConnect({ contract_number: document.id });
-
- await this._updateDocs(document.index, {
- entity_id: get_guid_entity_result.entityid,
- ready: true,
- loading: false,
- attorney: false,
- });
-
- callback();
- }
- }
- else
- {
- callback();
- }
+ await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Возникла ошибка при создании документа для подписания." });
+ callback();
}
}
}, () =>
@@ -276,12 +199,6 @@ export default class DealContractsSignPaper extends React.Component
}
}
- _handle_onAttorneyChange = (index, attorney) =>
- {
- console.log("_handle_onAttorneyChange", { index, attorney });
- this._updateDocs(index, { attorney_selected: attorney });
- }
-
_handle_onDownloadFile = (index, entity_id, name) =>
{
console.log("_handle_onDownloadFile", { index, entity_id });
@@ -401,23 +318,11 @@ export default class DealContractsSignPaper extends React.Component
>
) : (
<>
- { document.attorney && (
+ { document.upload && (
<>
-
>
) }
diff --git a/components/DealsStatus/SingleDeal.js b/components/DealsStatus/SingleDeal.js
index 3d75bf9..83273c0 100644
--- a/components/DealsStatus/SingleDeal.js
+++ b/components/DealsStatus/SingleDeal.js
@@ -853,6 +853,7 @@ class SignPlannedContract extends React.Component
disabled: false,
status: undefined,
contract_entity_id: undefined,
+ url: undefined,
};
}
@@ -865,7 +866,7 @@ class SignPlannedContract extends React.Component
{
const status_result = await docEDOStatus({ contract_number: contract.name });
console.log("SignPlannedContract", "CDM", { status_result });
- this.setState({ contract_entity_id: status_result.edoid, status: status_result.status, loading: false });
+ this.setState({ contract_entity_id: status_result.edoid, status: status_result.status, loading: false, url: status_result.edo_url });
}
else
{
@@ -920,9 +921,14 @@ class SignPlannedContract extends React.Component
console.log("_handle_sendToEDO");
}
- _handle_goToEDO = () =>
+ _handle_onGoToEDO = () =>
{
- console.log("_handle_goToEDO");
+ const { url } = this.state;
+
+ if(url !== undefined && url !== null)
+ {
+ window.open(url, "_blank");
+ }
}
render()
@@ -970,7 +976,7 @@ class SignPlannedContract extends React.Component
) }
{ status >= 2 && (
-
+
) }
) }
diff --git a/components/EDOSign/index.js b/components/EDOSign/index.js
index b5f7a4b..6bece40 100644
--- a/components/EDOSign/index.js
+++ b/components/EDOSign/index.js
@@ -152,6 +152,16 @@ class EDOSign extends React.Component
console.log("\n\nENTITY !!!!!!!!!!\n\n");
console.log({ get_guid_entity_result });
+ const wmdoc_result = await signGetWMDoc({
+ entity_name: "evo_contract",
+ entity_id: get_guid_entity_result.entityid,
+ sign_type: "EDO",
+ evo_id: "144",
+ });
+ console.log({ wmdoc_result });
+
+ const connect_result = await docEDOConnect({ contract_number: document.id });
+
await this._updateDocs(document.index, {
entity_id: get_guid_entity_result.entityid,
ready: true,
@@ -252,6 +262,7 @@ class EDOSign extends React.Component
}
else
{
+ await this._updateDocs(document.index, { loading: false, error: true, ready: true, message: "Возникла ошибка при создании документа для подписания." });
callback();
}
}
@@ -260,11 +271,11 @@ class EDOSign extends React.Component
{
if(this._checkDocumentsCompleted())
{
- this.setState({ loading: false, finished: true, });
+ this.setState({ loading: false, disabled: false, finished: true, });
}
else
{
- this.setState({ loading: false });
+ this.setState({ loading: false, disabled: false, finished: false, });
}
});
});
@@ -331,6 +342,7 @@ class EDOSign extends React.Component
});
await this._updateDocs(index, { loading: false, disabled: false, });
+ this.setState({ loading: false, disabled: false, });
});
}
@@ -375,27 +387,43 @@ class EDOSign extends React.Component
_handle_onCheckEDOStatus = async (index) =>
{
+ const { documents } = this.state;
+
await this._updateDocs(index, { loading: true });
this.setState({ loading: true, disabled: true }, async () =>
{
- const status_result = await docEDOStatus({ contract_number: document.id });
+ const status_result = await docEDOStatus({ contract_number: documents[index].id });
console.log({ status_result });
- if(status_result.status === 3)
+ if(status_result.status >= 2)
{
- await this._updateDocs(index, { loading: false, disabled: false, signing: false, completed: true, });
+ await this._updateDocs(index, { loading: false, disabled: false, signing: false, completed: true, url: status_result.url_edo, });
}
else
{
- await this._updateDocs(index, { loading: false, disabled: false, signing: true, completed: false, });
+ await this._updateDocs(index, { loading: false, disabled: false, signing: true, completed: false, url: status_result.url_edo, });
+ }
+
+ if(this._checkDocumentsCompleted())
+ {
+ this.setState({ loading: false, disabled: false, finished: true, });
+ }
+ else
+ {
+ this.setState({ loading: false, disabled: false, finished: false, });
}
});
}
_handle_onGoToEDO = () =>
{
-
+ const { documents } = this.state;
+
+ if(documents[index].url !== undefined && documents[index].url !== null)
+ {
+ window.open(documents[index].url, "_blank");
+ }
}
render()
diff --git a/pages/api/contract/sign/attorney/check.js b/pages/api/contract/sign/attorney/check.js
index b91d39f..fc137c0 100644
--- a/pages/api/contract/sign/attorney/check.js
+++ b/pages/api/contract/sign/attorney/check.js
@@ -2,12 +2,16 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/attorney/check");
+ console.log("\n\n", "API", "SIGN", "/attorney/check");
const { contract_number } = req.body;
const payload = {
contract_number,
};
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckPowerAttorneyClient`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckPowerAttorneyClient`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/attorney/get.js b/pages/api/contract/sign/attorney/get.js
index 8ef8abc..bb699e2 100644
--- a/pages/api/contract/sign/attorney/get.js
+++ b/pages/api/contract/sign/attorney/get.js
@@ -2,12 +2,16 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/attorney/get");
+ console.log("\n\n", "API", "SIGN", "/attorney/get");
const { contract_number } = req.body;
const payload = {
contract_number,
};
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/GetPowerAttorneyClient`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/GetPowerAttorneyClient`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/cancel/check.js b/pages/api/contract/sign/cancel/check.js
index 7a4e134..b8cdf04 100644
--- a/pages/api/contract/sign/cancel/check.js
+++ b/pages/api/contract/sign/cancel/check.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/cancel/check");
+ console.log("\n\n", "API", "SIGN", "/cancel/check");
const { contract_number, sign_type } = req.body;
const payload = {
@@ -18,5 +18,9 @@ export default async function handler(req, res)
payload.doc_type_id = 60;
}
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCancelDocument`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCancelDocument`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/cancel/index.js b/pages/api/contract/sign/cancel/index.js
index 67eea92..ae7d6d6 100644
--- a/pages/api/contract/sign/cancel/index.js
+++ b/pages/api/contract/sign/cancel/index.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/cancel");
+ console.log("\n\n", "API", "SIGN", "/cancel");
const { contract_number, sign_type } = req.body;
const payload = {
@@ -18,5 +18,9 @@ export default async function handler(req, res)
payload.doc_type_id = 60;
}
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/check.js b/pages/api/contract/sign/check.js
index 3e778e1..738e3e0 100644
--- a/pages/api/contract/sign/check.js
+++ b/pages/api/contract/sign/check.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/check");
+ console.log("\n\n", "API", "SIGN", "/check");
const { contract_number, sign_type } = req.body;
const payload = {
@@ -10,5 +10,9 @@ export default async function handler(req, res)
sign_type
};
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCreatePrintForm`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/CheckCreatePrintForm`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/document/connect.js b/pages/api/contract/sign/document/connect.js
index 604e26d..178e477 100644
--- a/pages/api/contract/sign/document/connect.js
+++ b/pages/api/contract/sign/document/connect.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/document/connect");
+ console.log("\n\n", "API", "SIGN", "/document/connect");
const { contract_number } = req.body;
const payload = {
@@ -14,5 +14,6 @@ export default async function handler(req, res)
await CRMRequestGet({ req, res,
path: `${ process.env.CRM_API_HOST }/lk/Contract/DocEdoConnect`,
params: payload,
+ log: true,
});
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/document/create.js b/pages/api/contract/sign/document/create.js
index 52ae32e..14d7055 100644
--- a/pages/api/contract/sign/document/create.js
+++ b/pages/api/contract/sign/document/create.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/document/create");
+ console.log("\n\n", "API", "SIGN", "/document/create");
const { entity_name, entity_id, sign_type, evo_id } = req.body;
const payload = {
@@ -21,5 +21,6 @@ export default async function handler(req, res)
path: `${ process.env.CRM_API_HOST }/File/GetWMDoc`,
data: JSON.stringify(payload),
headers: { "Content-Type": "application/json" },
+ log: true,
});
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/document/download.js b/pages/api/contract/sign/document/download.js
index d55b113..5f37b68 100644
--- a/pages/api/contract/sign/document/download.js
+++ b/pages/api/contract/sign/document/download.js
@@ -10,7 +10,7 @@ import { cors } from '../../../../../lib/cors';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/document/download");
+ console.log("\n\n", "API", "SIGN", "/document/download");
await cors(req, res);
diff --git a/pages/api/contract/sign/document/link.js b/pages/api/contract/sign/document/link.js
index fa9775f..c63da55 100644
--- a/pages/api/contract/sign/document/link.js
+++ b/pages/api/contract/sign/document/link.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/document/link");
+ console.log("\n\n", "API", "SIGN", "/document/link");
const { contract_number } = req.body;
const payload = {
@@ -14,5 +14,6 @@ export default async function handler(req, res)
await CRMRequestGet({ req, res,
path: `${ process.env.CRM_API_HOST }/lk/Contract/GetFileContractProject`,
params: payload,
+ log: true,
});
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/document/status.js b/pages/api/contract/sign/document/status.js
index 573253b..be1f12d 100644
--- a/pages/api/contract/sign/document/status.js
+++ b/pages/api/contract/sign/document/status.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/document/status");
+ console.log("\n\n", "API", "SIGN", "/document/status");
const { contract_number } = req.body;
const payload = {
@@ -14,5 +14,6 @@ export default async function handler(req, res)
await CRMRequestGet({ req, res,
path: `${ process.env.CRM_API_HOST }/lk/Contract/GetEdoProjectID`,
params: payload,
+ log: true,
});
}
\ No newline at end of file
diff --git a/pages/api/contract/sign/entity.js b/pages/api/contract/sign/entity.js
index 340efaa..b30c84f 100644
--- a/pages/api/contract/sign/entity.js
+++ b/pages/api/contract/sign/entity.js
@@ -2,12 +2,16 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "SIGN", "/entity");
+ console.log("\n\n", "API", "SIGN", "/entity");
const { contract_number } = req.body;
const payload = {
contract_number
};
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/GetGUIDEntity`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/GetGUIDEntity`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/deals/accept.js b/pages/api/deals/accept.js
index 16a1922..548310b 100644
--- a/pages/api/deals/accept.js
+++ b/pages/api/deals/accept.js
@@ -7,7 +7,7 @@ import CRMRequestPost from '../../../lib/CRMRequestPost';
export default async function handler(req, res)
{
- console.log("API", "DEALS", "quote");
+ console.log("\n\n", "API", "DEALS", "quote");
console.log(req.body);
console.log("-".repeat(50));
diff --git a/pages/api/deals/contracts.js b/pages/api/deals/contracts.js
index 38f1c72..211904f 100644
--- a/pages/api/deals/contracts.js
+++ b/pages/api/deals/contracts.js
@@ -7,7 +7,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "DEALS", "contracts");
+ console.log("\n\n", "API", "DEALS", "contracts");
console.log(req.body);
console.log("-".repeat(50));
diff --git a/pages/api/deals/documents.js b/pages/api/deals/documents.js
index 5587f0b..55be00e 100644
--- a/pages/api/deals/documents.js
+++ b/pages/api/deals/documents.js
@@ -13,6 +13,8 @@ import RedisClient from '../../../lib/RedisClient';
export default async function handler(req, res)
{
+ console.log("\n\n", "API", "DEALS", "documents");
+
await cors(req, res);
const { deal_id } = req.body;
diff --git a/pages/api/deals/file/attach.js b/pages/api/deals/file/attach.js
index ba53a59..068a8e4 100644
--- a/pages/api/deals/file/attach.js
+++ b/pages/api/deals/file/attach.js
@@ -18,7 +18,7 @@ const upload = multer({ storage: storage, limits: { fileSize: 1024 * 1024 * 300
export default async function handler(req, res)
{
- console.log("API", "DEALS", "FILE", "upload");
+ console.log("\n\n", "API", "DEALS", "FILE", "upload");
await cors(req, res);
return new Promise(async (resolve) =>
diff --git a/pages/api/deals/file/remove.js b/pages/api/deals/file/remove.js
index e910004..c366023 100644
--- a/pages/api/deals/file/remove.js
+++ b/pages/api/deals/file/remove.js
@@ -18,7 +18,7 @@ const upload = multer({ storage: storage });
export default async function handler(req, res)
{
- console.log("API", "DEALS", "FILE", "remove");
+ console.log("\n\n", "API", "DEALS", "FILE", "remove");
await cors(req, res);
return new Promise(async (resolve) =>
diff --git a/pages/api/deals/index.js b/pages/api/deals/index.js
index 031af88..18a0734 100644
--- a/pages/api/deals/index.js
+++ b/pages/api/deals/index.js
@@ -7,5 +7,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
+ console.log("\n\n", "API", "DEALS", "index");
+
await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/ConsiderationOpportunity/`, params: {} });
}
\ No newline at end of file
diff --git a/pages/api/deals/offer/download.js b/pages/api/deals/offer/download.js
index bea39f5..37a8ff5 100644
--- a/pages/api/deals/offer/download.js
+++ b/pages/api/deals/offer/download.js
@@ -10,7 +10,7 @@ import { cors } from '../../../../lib/cors';
export default async function handler(req, res)
{
- console.log("API", "DEALS", "/offer/download");
+ console.log("\n\n", "API", "DEALS", "/offer/download");
await cors(req, res);
diff --git a/pages/api/deals/offer/list.js b/pages/api/deals/offer/list.js
index 77868fc..6bc497d 100644
--- a/pages/api/deals/offer/list.js
+++ b/pages/api/deals/offer/list.js
@@ -7,7 +7,7 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "DEALS", "offers");
+ console.log("\n\n", "API", "DEALS", "offers");
console.log(req.body);
console.log("-".repeat(50));
diff --git a/pages/api/deals/offers.js b/pages/api/deals/offers.js
index 5108d1f..c66c96b 100644
--- a/pages/api/deals/offers.js
+++ b/pages/api/deals/offers.js
@@ -7,7 +7,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "DEALS", "offers");
+ console.log("\n\n", "API", "DEALS", "offers");
console.log(req.body);
console.log("-".repeat(50));
diff --git a/pages/api/deals/upload.js b/pages/api/deals/upload.js
index 1c3d338..9fbcc35 100644
--- a/pages/api/deals/upload.js
+++ b/pages/api/deals/upload.js
@@ -120,6 +120,8 @@ function uploadFile({ deal_id, filename, name, group, crm_jwt })
export default async function handler(req, res)
{
+ console.log("\n\n", "API", "DEALS", "upload");
+
await cors(req, res);
// const { number, entity, id, filename } = req.query;
diff --git a/pages/api/edo/cancel.js b/pages/api/edo/cancel.js
index 415f28b..6455387 100644
--- a/pages/api/edo/cancel.js
+++ b/pages/api/edo/cancel.js
@@ -5,7 +5,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "EDO", "/cancel");
+ console.log("\n\n", "API", "EDO", "/cancel");
const { contract_number, doc_type_id, } = req.body;
const payload = {
@@ -13,5 +13,9 @@ export default async function handler(req, res)
doc_type_id,
};
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/CancelDocument`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/edo/invite/send.js b/pages/api/edo/invite/send.js
index 147c538..6e8b4da 100644
--- a/pages/api/edo/invite/send.js
+++ b/pages/api/edo/invite/send.js
@@ -6,7 +6,11 @@ import CRMRequestGet from '../../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "EDO", "/invite/send");
+ console.log("\n\n", "API", "EDO", "/invite/send");
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Account/InviteEdoBox`, params: {} });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Account/InviteEdoBox`,
+ params: {},
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/edo/invites.js b/pages/api/edo/invites.js
index a51acf3..c00f4f2 100644
--- a/pages/api/edo/invites.js
+++ b/pages/api/edo/invites.js
@@ -5,7 +5,11 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "EDO", "/invites");
+ console.log("\n\n", "API", "EDO", "/invites");
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Account/GetInviteEdoBox`, params: {} });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Account/GetInviteEdoBox`,
+ params: {},
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/edo/operators.js b/pages/api/edo/operators.js
index f5909df..2d41819 100644
--- a/pages/api/edo/operators.js
+++ b/pages/api/edo/operators.js
@@ -5,7 +5,11 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "EDO", "/operators");
+ console.log("\n\n", "API", "EDO", "/operators");
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Account/GetEdoBox`, params: {} });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Account/GetEdoBox`,
+ params: {},
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/edo/project.js b/pages/api/edo/project.js
index 204b834..92dfd38 100644
--- a/pages/api/edo/project.js
+++ b/pages/api/edo/project.js
@@ -2,7 +2,7 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "EDO", "/project");
+ console.log("\n\n", "API", "EDO", "/project");
const { contract_number, power_attorney, power_attorney_number, edo_box, } = req.body;
const payload = {
@@ -12,5 +12,9 @@ export default async function handler(req, res)
edo_box,
};
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/CreateEDOProject`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/CreateEDOProject`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/api/edo/sign.js b/pages/api/edo/sign.js
index 5578b64..4e6b88c 100644
--- a/pages/api/edo/sign.js
+++ b/pages/api/edo/sign.js
@@ -2,12 +2,16 @@ import CRMRequestGet from '../../../lib/CRMRequestGet';
export default async function handler(req, res)
{
- console.log("API", "EDO", "/sign");
+ console.log("\n\n", "API", "EDO", "/sign");
const { edoid } = req.body;
const payload = {
edoid,
};
- await CRMRequestGet({ req, res, path: `${ process.env.CRM_API_HOST }/lk/Contract/SignEDODocument`, params: payload });
+ await CRMRequestGet({ req, res,
+ path: `${ process.env.CRM_API_HOST }/lk/Contract/SignEDODocument`,
+ params: payload,
+ log: true,
+ });
}
\ No newline at end of file
diff --git a/pages/contract/change/components/Options/index.js b/pages/contract/change/components/Options/index.js
index 042f1df..858a3d9 100644
--- a/pages/contract/change/components/Options/index.js
+++ b/pages/contract/change/components/Options/index.js
@@ -653,14 +653,13 @@ export default class Options extends React.Component
{
//console.log("_handle_onCalculate ?");
-
const selected = {
number_planpayment: options.number_planpayment.value,
};
if(number_paydate !== null) { selected.number_paydate = moment(number_paydate).format(); }
if(period_new !== null) { selected.period_new = period_new; }
-if(fix_last_payment_available !== null) { selected.fix_last_payment_available = fix_last_payment_available; }
+ if(fix_last_payment_available !== null) { selected.fix_last_payment_available = fix_last_payment_available; }
if(date_offset_type !== null) { selected.date_offset_type = date_offset_type; }
if(sum !== null) { selected.sum = sum; }
if(insurance_price_result !== null) { selected.insurance_price_result = insurance_price_result; }