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 {saveFile} from "../../helpers/fileSaver";
import dataFormatter from '../../helpers/dataFormatter';
import ImageField from "../../components/ImageField";
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";

import {hasPermission} from "../../helpers/userPermissions";


const OrganizationsView = () => {
    const router = useRouter()
    const dispatch = useAppDispatch()
    const { organizations } = useAppSelector((state) => state.organizations)
    
    const { currentUser } = useAppSelector((state) => state.auth);
    

    const { id } = router.query;
    
    function removeLastCharacter(str) {
      console.log(str,`str`)
      return str.slice(0, -1);
    }

    useEffect(() => {
        dispatch(fetch({ id }));
    }, [dispatch, id]);


    return (
      <>
          <Head>
              <title>{getPageTitle('View organizations')}</title>
          </Head>
          <SectionMain>
            <SectionTitleLineWithButton icon={mdiChartTimelineVariant} title={removeLastCharacter('View organizations')} main>
                <BaseButton
                  color='info'
                  label='Edit'
                  href={`/organizations/organizations-edit/?id=${id}`}
                />
            </SectionTitleLineWithButton>
            <CardBox>
            

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Name</p>
                    <p>{organizations?.name}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

                
                <>
                    <p className={'block font-bold mb-2'}>Users Organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>First Name</th>
                                
                                
                                
                                <th>Last Name</th>
                                
                                
                                
                                <th>Phone Number</th>
                                
                                
                                
                                <th>E-Mail</th>
                                
                                
                                
                                <th>Disabled</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.users_organizations && Array.isArray(organizations.users_organizations) &&
                              organizations.users_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/users/users-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="firstName">
                                        { item.firstName }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lastName">
                                        { item.lastName }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phoneNumber">
                                        { item.phoneNumber }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="email">
                                        { item.email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="disabled">
                                        { dataFormatter.booleanFormatter(item.disabled) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.users_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Plants organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>PlantName</th>
                                
                                
                                
                                <th>PlantCode</th>
                                
                                
                                
                                <th>Address</th>
                                
                                
                                
                                <th>Timezone</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.plants_organizations && Array.isArray(organizations.plants_organizations) &&
                              organizations.plants_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/plants/plants-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="code">
                                        { item.code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="address">
                                        { item.address }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="timezone">
                                        { item.timezone }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.plants_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Work_centers organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>WorkCenterName</th>
                                
                                
                                
                                <th>WorkCenterCode</th>
                                
                                
                                
                                <th>Type</th>
                                
                                
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.work_centers_organizations && Array.isArray(organizations.work_centers_organizations) &&
                              organizations.work_centers_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/work_centers/work_centers-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="code">
                                        { item.code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="type">
                                        { item.type }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.work_centers_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Machines organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>MachineName</th>
                                
                                
                                
                                <th>AssetTag</th>
                                
                                
                                
                                <th>Manufacturer</th>
                                
                                
                                
                                <th>Model</th>
                                
                                
                                
                                <th>SerialNumber</th>
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>CommissionedOn</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.machines_organizations && Array.isArray(organizations.machines_organizations) &&
                              organizations.machines_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/machines/machines-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="asset_tag">
                                        { item.asset_tag }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="manufacturer">
                                        { item.manufacturer }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="model">
                                        { item.model }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="serial_number">
                                        { item.serial_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="commissioned_on">
                                        { dataFormatter.dateTimeFormatter(item.commissioned_on) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.machines_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Materials organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>MaterialName</th>
                                
                                
                                
                                <th>MaterialNumber</th>
                                
                                
                                
                                <th>MaterialType</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                <th>Revision</th>
                                
                                
                                
                                <th>LotTracked</th>
                                
                                
                                
                                <th>SerialTracked</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.materials_organizations && Array.isArray(organizations.materials_organizations) &&
                              organizations.materials_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/materials/materials-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="material_number">
                                        { item.material_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="material_type">
                                        { item.material_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="revision">
                                        { item.revision }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lot_tracked">
                                        { dataFormatter.booleanFormatter(item.lot_tracked) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="serial_tracked">
                                        { dataFormatter.booleanFormatter(item.serial_tracked) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.materials_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Bom_headers organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>BOMName</th>
                                
                                
                                
                                <th>BOMNumber</th>
                                
                                
                                
                                
                                
                                <th>Revision</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>EffectiveFrom</th>
                                
                                
                                
                                <th>EffectiveTo</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.bom_headers_organizations && Array.isArray(organizations.bom_headers_organizations) &&
                              organizations.bom_headers_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/bom_headers/bom_headers-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="bom_number">
                                        { item.bom_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="revision">
                                        { item.revision }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_from">
                                        { dataFormatter.dateTimeFormatter(item.effective_from) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_to">
                                        { dataFormatter.dateTimeFormatter(item.effective_to) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.bom_headers_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Bom_lines organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>QuantityPer</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                <th>ScrapFactor</th>
                                
                                
                                
                                <th>LineNumber</th>
                                
                                
                                
                                <th>ReferenceDesignator</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.bom_lines_organizations && Array.isArray(organizations.bom_lines_organizations) &&
                              organizations.bom_lines_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/bom_lines/bom_lines-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="quantity_per">
                                        { item.quantity_per }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scrap_factor">
                                        { item.scrap_factor }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="line_number">
                                        { item.line_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reference_designator">
                                        { item.reference_designator }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.bom_lines_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Routings organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>RoutingName</th>
                                
                                
                                
                                <th>RoutingNumber</th>
                                
                                
                                
                                
                                
                                <th>Revision</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>EffectiveFrom</th>
                                
                                
                                
                                <th>EffectiveTo</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.routings_organizations && Array.isArray(organizations.routings_organizations) &&
                              organizations.routings_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/routings/routings-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="routing_number">
                                        { item.routing_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="revision">
                                        { item.revision }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_from">
                                        { dataFormatter.dateTimeFormatter(item.effective_from) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_to">
                                        { dataFormatter.dateTimeFormatter(item.effective_to) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.routings_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Routing_steps organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>StepNumber</th>
                                
                                
                                
                                <th>StepName</th>
                                
                                
                                
                                
                                
                                <th>SetupTimeMinutes</th>
                                
                                
                                
                                <th>RunTimeMinutes</th>
                                
                                
                                
                                <th>LaborMinutes</th>
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.routing_steps_organizations && Array.isArray(organizations.routing_steps_organizations) &&
                              organizations.routing_steps_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/routing_steps/routing_steps-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="step_number">
                                        { item.step_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="setup_time_minutes">
                                        { item.setup_time_minutes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="run_time_minutes">
                                        { item.run_time_minutes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="labor_minutes">
                                        { item.labor_minutes }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.routing_steps_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Suppliers organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>SupplierName</th>
                                
                                
                                
                                <th>SupplierCode</th>
                                
                                
                                
                                <th>ContactName</th>
                                
                                
                                
                                <th>Email</th>
                                
                                
                                
                                <th>Phone</th>
                                
                                
                                
                                <th>Address</th>
                                
                                
                                
                                <th>Approved</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.suppliers_organizations && Array.isArray(organizations.suppliers_organizations) &&
                              organizations.suppliers_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/suppliers/suppliers-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="supplier_code">
                                        { item.supplier_code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="contact_name">
                                        { item.contact_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="email">
                                        { item.email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phone">
                                        { item.phone }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="address">
                                        { item.address }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="approved">
                                        { dataFormatter.booleanFormatter(item.approved) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.suppliers_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Customers organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>CustomerName</th>
                                
                                
                                
                                <th>CustomerCode</th>
                                
                                
                                
                                <th>ContactName</th>
                                
                                
                                
                                <th>Email</th>
                                
                                
                                
                                <th>Phone</th>
                                
                                
                                
                                <th>Address</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.customers_organizations && Array.isArray(organizations.customers_organizations) &&
                              organizations.customers_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/customers/customers-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="customer_code">
                                        { item.customer_code }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="contact_name">
                                        { item.contact_name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="email">
                                        { item.email }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="phone">
                                        { item.phone }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="address">
                                        { item.address }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.customers_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Warehouses organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>WarehouseName</th>
                                
                                
                                
                                <th>WarehouseCode</th>
                                
                                
                                
                                
                                
                                <th>Active</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.warehouses_organizations && Array.isArray(organizations.warehouses_organizations) &&
                              organizations.warehouses_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/warehouses/warehouses-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="code">
                                        { item.code }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.warehouses_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Locations organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>LocationName</th>
                                
                                
                                
                                <th>LocationCode</th>
                                
                                
                                
                                
                                
                                <th>LocationType</th>
                                
                                
                                
                                <th>Active</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.locations_organizations && Array.isArray(organizations.locations_organizations) &&
                              organizations.locations_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/locations/locations-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="code">
                                        { item.code }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="location_type">
                                        { item.location_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="active">
                                        { dataFormatter.booleanFormatter(item.active) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.locations_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Lots organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>LotNumber</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ReceivedAt</th>
                                
                                
                                
                                <th>ExpiresAt</th>
                                
                                
                                
                                
                                
                                <th>SupplierLot</th>
                                
                                
                                
                                <th>QuantityReceived</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.lots_organizations && Array.isArray(organizations.lots_organizations) &&
                              organizations.lots_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/lots/lots-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="lot_number">
                                        { item.lot_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="received_at">
                                        { dataFormatter.dateTimeFormatter(item.received_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="expires_at">
                                        { dataFormatter.dateTimeFormatter(item.expires_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="supplier_lot">
                                        { item.supplier_lot }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="quantity_received">
                                        { item.quantity_received }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.lots_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Serials organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>SerialNumber</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>CreatedOn</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.serials_organizations && Array.isArray(organizations.serials_organizations) &&
                              organizations.serials_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/serials/serials-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="serial_number">
                                        { item.serial_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="created_on">
                                        { dataFormatter.dateTimeFormatter(item.created_on) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.serials_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inventory_balances organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>OnHandQuantity</th>
                                
                                
                                
                                <th>AllocatedQuantity</th>
                                
                                
                                
                                <th>AvailableQuantity</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                <th>AsOf</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.inventory_balances_organizations && Array.isArray(organizations.inventory_balances_organizations) &&
                              organizations.inventory_balances_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inventory_balances/inventory_balances-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="on_hand_qty">
                                        { item.on_hand_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="allocated_qty">
                                        { item.allocated_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="available_qty">
                                        { item.available_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="as_of">
                                        { dataFormatter.dateTimeFormatter(item.as_of) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.inventory_balances_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inventory_transactions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>TransactionNumber</th>
                                
                                
                                
                                <th>TransactionAt</th>
                                
                                
                                
                                <th>TransactionType</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Quantity</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                <th>Reference</th>
                                
                                
                                
                                <th>Reason</th>
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.inventory_transactions_organizations && Array.isArray(organizations.inventory_transactions_organizations) &&
                              organizations.inventory_transactions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inventory_transactions/inventory_transactions-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="transaction_number">
                                        { item.transaction_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="transaction_at">
                                        { dataFormatter.dateTimeFormatter(item.transaction_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="transaction_type">
                                        { item.transaction_type }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="quantity">
                                        { item.quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reference">
                                        { item.reference }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reason">
                                        { item.reason }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.inventory_transactions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Cycle_counts organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>CountNumber</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ScheduledAt</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.cycle_counts_organizations && Array.isArray(organizations.cycle_counts_organizations) &&
                              organizations.cycle_counts_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/cycle_counts/cycle_counts-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="count_number">
                                        { item.count_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.cycle_counts_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Cycle_count_lines organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>SystemQuantity</th>
                                
                                
                                
                                <th>CountedQuantity</th>
                                
                                
                                
                                <th>VarianceQuantity</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.cycle_count_lines_organizations && Array.isArray(organizations.cycle_count_lines_organizations) &&
                              organizations.cycle_count_lines_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/cycle_count_lines/cycle_count_lines-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="system_qty">
                                        { item.system_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="counted_qty">
                                        { item.counted_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="variance_qty">
                                        { item.variance_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.cycle_count_lines_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Production_orders organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>ProductionOrderNumber</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ScheduledStart</th>
                                
                                
                                
                                <th>ScheduledEnd</th>
                                
                                
                                
                                <th>ActualStart</th>
                                
                                
                                
                                <th>ActualEnd</th>
                                
                                
                                
                                <th>PlannedQuantity</th>
                                
                                
                                
                                <th>CompletedQuantity</th>
                                
                                
                                
                                <th>ScrappedQuantity</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                
                                
                                <th>Priority</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.production_orders_organizations && Array.isArray(organizations.production_orders_organizations) &&
                              organizations.production_orders_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/production_orders/production_orders-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="order_number">
                                        { item.order_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_start">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_start) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_end">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_end) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="actual_start">
                                        { dataFormatter.dateTimeFormatter(item.actual_start) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="actual_end">
                                        { dataFormatter.dateTimeFormatter(item.actual_end) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="planned_qty">
                                        { item.planned_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_qty">
                                        { item.completed_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scrapped_qty">
                                        { item.scrapped_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="priority">
                                        { item.priority }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.production_orders_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Production_operations organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>OperationNumber</th>
                                
                                
                                
                                <th>OperationName</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>PlannedStart</th>
                                
                                
                                
                                <th>PlannedEnd</th>
                                
                                
                                
                                <th>ActualStart</th>
                                
                                
                                
                                <th>ActualEnd</th>
                                
                                
                                
                                <th>GoodQuantity</th>
                                
                                
                                
                                <th>ScrapQuantity</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.production_operations_organizations && Array.isArray(organizations.production_operations_organizations) &&
                              organizations.production_operations_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/production_operations/production_operations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="operation_number">
                                        { item.operation_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="planned_start">
                                        { dataFormatter.dateTimeFormatter(item.planned_start) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="planned_end">
                                        { dataFormatter.dateTimeFormatter(item.planned_end) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="actual_start">
                                        { dataFormatter.dateTimeFormatter(item.actual_start) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="actual_end">
                                        { dataFormatter.dateTimeFormatter(item.actual_end) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="good_qty">
                                        { item.good_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scrap_qty">
                                        { item.scrap_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.production_operations_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Material_allocations organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>RequiredQuantity</th>
                                
                                
                                
                                <th>IssuedQuantity</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                <th>IssueStatus</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.material_allocations_organizations && Array.isArray(organizations.material_allocations_organizations) &&
                              organizations.material_allocations_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/material_allocations/material_allocations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="required_qty">
                                        { item.required_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="issued_qty">
                                        { item.issued_qty }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="issue_status">
                                        { item.issue_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.material_allocations_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Production_lots organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>ProducedLotNumber</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ProducedAt</th>
                                
                                
                                
                                <th>QuantityProduced</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.production_lots_organizations && Array.isArray(organizations.production_lots_organizations) &&
                              organizations.production_lots_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/production_lots/production_lots-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="lot_number">
                                        { item.lot_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="produced_at">
                                        { dataFormatter.dateTimeFormatter(item.produced_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="quantity_produced">
                                        { item.quantity_produced }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.production_lots_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inspection_plans organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>InspectionPlanName</th>
                                
                                
                                
                                <th>PlanNumber</th>
                                
                                
                                
                                
                                
                                <th>InspectionType</th>
                                
                                
                                
                                <th>Revision</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.inspection_plans_organizations && Array.isArray(organizations.inspection_plans_organizations) &&
                              organizations.inspection_plans_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inspection_plans/inspection_plans-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="plan_number">
                                        { item.plan_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="inspection_type">
                                        { item.inspection_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="revision">
                                        { item.revision }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.inspection_plans_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inspection_characteristics organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>Sequence</th>
                                
                                
                                
                                <th>CharacteristicName</th>
                                
                                
                                
                                <th>DataType</th>
                                
                                
                                
                                <th>TargetValue</th>
                                
                                
                                
                                <th>LowerSpecLimit</th>
                                
                                
                                
                                <th>UpperSpecLimit</th>
                                
                                
                                
                                <th>Unit</th>
                                
                                
                                
                                <th>Sampling</th>
                                
                                
                                
                                <th>Required</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.inspection_characteristics_organizations && Array.isArray(organizations.inspection_characteristics_organizations) &&
                              organizations.inspection_characteristics_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inspection_characteristics/inspection_characteristics-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="sequence">
                                        { item.sequence }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="name">
                                        { item.name }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="data_type">
                                        { item.data_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="target_value">
                                        { item.target_value }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="lower_spec_limit">
                                        { item.lower_spec_limit }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="upper_spec_limit">
                                        { item.upper_spec_limit }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="unit">
                                        { item.unit }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="sampling">
                                        { item.sampling }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="required">
                                        { dataFormatter.booleanFormatter(item.required) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.inspection_characteristics_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inspections organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>InspectionNumber</th>
                                
                                
                                
                                <th>InspectionType</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                
                                
                                <th>Summary</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.inspections_organizations && Array.isArray(organizations.inspections_organizations) &&
                              organizations.inspections_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inspections/inspections-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="inspection_number">
                                        { item.inspection_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="inspection_type">
                                        { item.inspection_type }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="summary">
                                        { item.summary }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.inspections_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inspection_results organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Result</th>
                                
                                
                                
                                <th>MeasuredValue</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                                
                                <th>MeasuredAt</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.inspection_results_organizations && Array.isArray(organizations.inspection_results_organizations) &&
                              organizations.inspection_results_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/inspection_results/inspection_results-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="result">
                                        { item.result }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="measured_value">
                                        { item.measured_value }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="measured_at">
                                        { dataFormatter.dateTimeFormatter(item.measured_at) }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.inspection_results_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Nonconformances organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>NCRNumber</th>
                                
                                
                                
                                <th>Source</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Severity</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ReportedAt</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.nonconformances_organizations && Array.isArray(organizations.nonconformances_organizations) &&
                              organizations.nonconformances_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/nonconformances/nonconformances-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="ncr_number">
                                        { item.ncr_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="source">
                                        { item.source }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="severity">
                                        { item.severity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reported_at">
                                        { dataFormatter.dateTimeFormatter(item.reported_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.nonconformances_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Dispositions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>DispositionType</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                
                                
                                <th>DueAt</th>
                                
                                
                                
                                <th>ClosedAt</th>
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.dispositions_organizations && Array.isArray(organizations.dispositions_organizations) &&
                              organizations.dispositions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/dispositions/dispositions-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="disposition_type">
                                        { item.disposition_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="due_at">
                                        { dataFormatter.dateTimeFormatter(item.due_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="closed_at">
                                        { dataFormatter.dateTimeFormatter(item.closed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.dispositions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Corrective_actions organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>CAPANumber</th>
                                
                                
                                
                                
                                
                                <th>Type</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>Priority</th>
                                
                                
                                
                                
                                
                                <th>OpenedAt</th>
                                
                                
                                
                                <th>DueAt</th>
                                
                                
                                
                                <th>ClosedAt</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.corrective_actions_organizations && Array.isArray(organizations.corrective_actions_organizations) &&
                              organizations.corrective_actions_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/corrective_actions/corrective_actions-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="capa_number">
                                        { item.capa_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="type">
                                        { item.type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="priority">
                                        { item.priority }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="opened_at">
                                        { dataFormatter.dateTimeFormatter(item.opened_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="due_at">
                                        { dataFormatter.dateTimeFormatter(item.due_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="closed_at">
                                        { dataFormatter.dateTimeFormatter(item.closed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.corrective_actions_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Downtime_events organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>EventNumber</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>ReasonCategory</th>
                                
                                
                                
                                <th>ReasonDetail</th>
                                
                                
                                
                                <th>StartedAt</th>
                                
                                
                                
                                <th>EndedAt</th>
                                
                                
                                
                                <th>Planned</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.downtime_events_organizations && Array.isArray(organizations.downtime_events_organizations) &&
                              organizations.downtime_events_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/downtime_events/downtime_events-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="event_number">
                                        { item.event_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="reason_category">
                                        { item.reason_category }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reason_detail">
                                        { item.reason_detail }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="started_at">
                                        { dataFormatter.dateTimeFormatter(item.started_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="ended_at">
                                        { dataFormatter.dateTimeFormatter(item.ended_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="planned">
                                        { dataFormatter.booleanFormatter(item.planned) }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.downtime_events_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Machine_readings organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                <th>RecordedAt</th>
                                
                                
                                
                                <th>RunMinutes</th>
                                
                                
                                
                                <th>DownMinutes</th>
                                
                                
                                
                                <th>GoodCount</th>
                                
                                
                                
                                <th>ScrapCount</th>
                                
                                
                                
                                <th>CycleTimeSeconds</th>
                                
                                
                                
                                <th>EnergykWh</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.machine_readings_organizations && Array.isArray(organizations.machine_readings_organizations) &&
                              organizations.machine_readings_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/machine_readings/machine_readings-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    <td data-label="recorded_at">
                                        { dataFormatter.dateTimeFormatter(item.recorded_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="run_minutes">
                                        { item.run_minutes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="down_minutes">
                                        { item.down_minutes }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="good_count">
                                        { item.good_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scrap_count">
                                        { item.scrap_count }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="cycle_time_seconds">
                                        { item.cycle_time_seconds }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="energy_kwh">
                                        { item.energy_kwh }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.machine_readings_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Maintenance_work_orders organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>WorkOrderNumber</th>
                                
                                
                                
                                
                                
                                <th>WorkType</th>
                                
                                
                                
                                <th>Priority</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>RequestedAt</th>
                                
                                
                                
                                <th>ScheduledStart</th>
                                
                                
                                
                                <th>ScheduledEnd</th>
                                
                                
                                
                                <th>CompletedAt</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.maintenance_work_orders_organizations && Array.isArray(organizations.maintenance_work_orders_organizations) &&
                              organizations.maintenance_work_orders_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/maintenance_work_orders/maintenance_work_orders-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="work_order_number">
                                        { item.work_order_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="work_type">
                                        { item.work_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="priority">
                                        { item.priority }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="requested_at">
                                        { dataFormatter.dateTimeFormatter(item.requested_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_start">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_start) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_end">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_end) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="completed_at">
                                        { dataFormatter.dateTimeFormatter(item.completed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.maintenance_work_orders_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Documents organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>Title</th>
                                
                                
                                
                                <th>DocumentType</th>
                                
                                
                                
                                <th>DocumentNumber</th>
                                
                                
                                
                                <th>Revision</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>EffectiveFrom</th>
                                
                                
                                
                                <th>EffectiveTo</th>
                                
                                
                                
                                
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.documents_organizations && Array.isArray(organizations.documents_organizations) &&
                              organizations.documents_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/documents/documents-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="title">
                                        { item.title }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="document_type">
                                        { item.document_type }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="document_number">
                                        { item.document_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="revision">
                                        { item.revision }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_from">
                                        { dataFormatter.dateTimeFormatter(item.effective_from) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="effective_to">
                                        { dataFormatter.dateTimeFormatter(item.effective_to) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.documents_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Shipments organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                <th>ShipmentNumber</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ScheduledShipAt</th>
                                
                                
                                
                                <th>ShippedAt</th>
                                
                                
                                
                                <th>Carrier</th>
                                
                                
                                
                                <th>TrackingNumber</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.shipments_organizations && Array.isArray(organizations.shipments_organizations) &&
                              organizations.shipments_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/shipments/shipments-view/?id=${item.id}`)}>
                                    
                                    
                                    <td data-label="shipment_number">
                                        { item.shipment_number }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_ship_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_ship_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="shipped_at">
                                        { dataFormatter.dateTimeFormatter(item.shipped_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="carrier">
                                        { item.carrier }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="tracking_number">
                                        { item.tracking_number }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.shipments_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Shipment_lines organizations</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Quantity</th>
                                
                                
                                
                                <th>UnitofMeasure</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {organizations.shipment_lines_organizations && Array.isArray(organizations.shipment_lines_organizations) &&
                              organizations.shipment_lines_organizations.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/shipment_lines/shipment_lines-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="quantity">
                                        { item.quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="uom">
                                        { item.uom }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!organizations?.shipment_lines_organizations?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                

                <BaseDivider />

                <BaseButton
                    color='info'
                    label='Back'
                    onClick={() => router.push('/organizations/organizations-list')}
                />
              </CardBox>
          </SectionMain>
      </>
    );
};

OrganizationsView.getLayout = function getLayout(page: ReactElement) {
    return (
      <LayoutAuthenticated
        
        permission={'READ_ORGANIZATIONS'}
        
      >
          {page}
      </LayoutAuthenticated>
    )
}

export default OrganizationsView;