Пени на дату { moment(penalties_date, "YYYY.MM.DD").format("DD.MM.YYYY") }
{ moment(bill.dateBillout, "YYYY-MM-DD").format("MMMM") } { numeral(bill.sumBill).format(' ., ') } ₽
)) }К сожалению на указанную дату расчет пени невозможен.
) } > )}import React from "react"; import Head from "next/head"; import Image from "next/image"; import { connect } from "react-redux"; import { withRouter } from "next/router"; import moment from "moment"; import 'moment/locale/ru'; import numeral from "numeral"; import { SpinnerCircular } from "spinners-react"; import pluralize from "pluralize-ru"; import { reduxWrapper } from "../../store"; import Header from "../components/Header"; import Footer from "../components/Footer"; import InnerMenu from "./components/InnerMenu"; import Company from "../components/Company"; import DateInput from "../components/DatePicker"; import DownloadPrintFormPdfButton from "../components/DownloadPrintFormPdfButton"; import DownloadFinesPdfButton from "../components/DownloadFinesPdfButton"; import PenaltiesCalculatorForm from "./components/PenaltiesCalculatorForm"; import { getContractInfo, getContractDocuments, getReconciliationFile, getContractPenalties, } from "../../actions"; import AccountLayout from "../components/Layout/Account"; import ContractHeader from "./components/ContractHeader"; import ReconciliationForm from "./components/ReconciliationForm"; const TYPES = { upd: "УПД по очередным платежам", upd_avans: "УПД по авансовым платежам", billfines: "Счета-уведомления на пени", billgibdd: "BillGIBDD", fines: "Штрафы ГИБДД", }; class ContractDocumentsPage extends React.Component { constructor(props) { super(props); this.state = { loading: false, contracts_info: {}, opened: [], date: null, car: null, contract_date: null, documents: null, valid_date_start: null, valid_date_end: null, period_date_start: null, period_date_end: null, reconciliation_requested: false, reconciliation_disabled: false, penalties: false, penalties_date: moment().format("YYYY.MM.DD"), penalties_result: undefined, }; this.penalties_form_ref = React.createRef(); } static getDerivedStateFromProps(nextProps, prevState) { return { contracts_info: nextProps.contracts_info, documents: nextProps.documents, }; } componentDidMount() { const { dispatch, number} = this.props; if(!this.state.loading && number !== undefined) { if(this.state.contracts_info[ number ] === undefined) { getContractInfo({ dispatch, number }); } this.setState({ loading: true }, () => { getContractDocuments({ dispatch, number, }) .then(() => { this.setState({ loading: false }); }) .catch(() => {}); }); } } componentDidUpdate(prevProps, prevState) { if (prevState.loading && this.state.loading) { if(document.location.hash.indexOf("penalties") > -1) { setTimeout(() => { if(this.penalties_form_ref.current !== undefined && this.penalties_form_ref.current !== null) { console.log("this.penalties_form_ref.current", this.penalties_form_ref.current); this.penalties_form_ref.current.scrollIntoView({ behavior: 'smooth', block: 'center', }); } }, 100); } } } _handle_onGroup = (group) => { const opened = [...this.state.opened]; if (opened.indexOf(group) < 0) { opened.push(group); } else { opened.splice(opened.indexOf(group), 1); } this.setState({ opened: opened }); }; _renderDocuments = (documents, type) => { const { number } = this.props; const { opened } = this.state; if (documents !== undefined && documents !== null) { if (documents.length > 0) { return ( <>
{TYPES[type]}
{doc.num} от {moment(doc.date).format("DD.MM.YYYY")}
Еще {documents.length - 3}{" "} { pluralize( documents.length - 3, "документов", "документ", "документа", "документов" ) }
{ TYPES[ type ] }
Документов пока еще нет.
Пени на дату { moment(penalties_date, "YYYY.MM.DD").format("DD.MM.YYYY") }
{ moment(bill.dateBillout, "YYYY-MM-DD").format("MMMM") } { numeral(bill.sumBill).format(' ., ') } ₽
)) }К сожалению на указанную дату расчет пени невозможен.
) } > )}