import React, { ReactElement, useEffect } from 'react'; import Head from 'next/head' import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import dayjs from "dayjs"; import {useAppDispatch, useAppSelector} from "../../stores/hooks"; import {useRouter} from "next/router"; import { fetch } from '../../stores/organizations/organizationsSlice' import dataFormatter from '../../helpers/dataFormatter'; import LayoutAuthenticated from "../../layouts/Authenticated"; import {getPageTitle} from "../../config"; import SectionTitleLineWithButton from "../../components/SectionTitleLineWithButton"; import SectionMain from "../../components/SectionMain"; import CardBox from "../../components/CardBox"; import BaseButton from "../../components/BaseButton"; import BaseDivider from "../../components/BaseDivider"; import {mdiChartTimelineVariant} from "@mdi/js"; import {SwitchField} from "../../components/SwitchField"; import FormField from "../../components/FormField"; const OrganizationsView = () => { const router = useRouter() const dispatch = useAppDispatch() const { organizations } = useAppSelector((state) => state.organizations) const { id } = router.query; function removeLastCharacter(str) { console.log(str,`str`) return str.slice(0, -1); } useEffect(() => { dispatch(fetch({ id })); }, [dispatch, id]); return ( <>
Name
{organizations?.name}
Users Organizations
| First Name | Last Name | Phone Number | Disabled | |
|---|---|---|---|---|
| { item.firstName } | { item.lastName } | { item.phoneNumber } | { item.email } | { dataFormatter.booleanFormatter(item.disabled) } |
Human_resources organizations
| EmployeeName | Shift | Payroll |
|---|---|---|
| { item.employee_name } | { item.shift } | { item.payroll } |
Inventory organizations
| ProductName | QuantityAvailable | QuantityReserved | QuantityReturned |
|---|---|---|---|
| { item.product_name } | { item.quantity_available } | { item.quantity_reserved } | { item.quantity_returned } |
Machinery organizations
| MachineName | Model | MaintenanceSchedule | IsOperational |
|---|---|---|---|
| { item.machine_name } | { item.model } | { dataFormatter.dateTimeFormatter(item.maintenance_schedule) } | { dataFormatter.booleanFormatter(item.is_operational) } |
Quality_control organizations
| CheckName | CheckDate | Passed |
|---|---|---|
| { item.check_name } | { dataFormatter.dateTimeFormatter(item.check_date) } | { dataFormatter.booleanFormatter(item.passed) } |
Raw_materials organizations
| Name | Quantity | ReorderLevel |
|---|---|---|
| { item.name } | { item.quantity } | { item.reorder_level } |
Suppliers organizations
| SupplierName | ContractTerms | DeliverySchedule | PaymentDue |
|---|---|---|---|
| { item.supplier_name } | { item.contract_terms } | { dataFormatter.dateTimeFormatter(item.delivery_schedule) } | { item.payment_due } |
Work_orders organizations
| OrderNumber | StartDate | EndDate |
|---|---|---|
| { item.order_number } | { dataFormatter.dateTimeFormatter(item.start_date) } | { dataFormatter.dateTimeFormatter(item.end_date) } |
Invoices organizations
| Amountoriginal | Currency | Incomecost | Amountpln | Invoicedate | Period | Description |
|---|---|---|---|---|---|---|
| { item.amountoriginal } | { item.currency } | { item.incomecost } | { item.amountpln } | { dataFormatter.dateFormatter(item.invoicedate) } | { item.period } | { item.description } |