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/production_orders/production_ordersSlice'
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";


const Production_ordersView = () => {
    const router = useRouter()
    const dispatch = useAppDispatch()
    const { production_orders } = useAppSelector((state) => state.production_orders)
    

    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 production_orders')}</title>
          </Head>
          <SectionMain>
            <SectionTitleLineWithButton icon={mdiChartTimelineVariant} title={removeLastCharacter('View production_orders')} main>
                <BaseButton
                  color='info'
                  label='Edit'
                  href={`/production_orders/production_orders-edit/?id=${id}`}
                />
            </SectionTitleLineWithButton>
            <CardBox>
            

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>OrderNumber</p>
                    <p>{production_orders?.order_number}</p>
                </div>
              

              

              

              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Plant</p>
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{production_orders?.plant?.name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Item</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{production_orders?.item?.name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>BOM</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{production_orders?.bom?.name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Routing</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                        <p>{production_orders?.routing?.name ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              

              

              
                <div className={'mb-4'}>
                  <p className={'block font-bold mb-2'}>PlannedQuantity</p>
                  <p>{production_orders?.planned_quantity || 'No data'}</p>
                </div>
              

              

              

              

              

              

              

              

              

              
              

              

              

              

              
                <div className={'mb-4'}>
                  <p className={'block font-bold mb-2'}>CompletedQuantity</p>
                  <p>{production_orders?.completed_quantity || 'No data'}</p>
                </div>
              

              

              

              

              

              

              

              

              

              
              

              

              

              

              
                <div className={'mb-4'}>
                  <p className={'block font-bold mb-2'}>ScrappedQuantity</p>
                  <p>{production_orders?.scrapped_quantity || 'No data'}</p>
                </div>
              

              

              

              

              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='PlannedStartAt'>
                    {production_orders.planned_start_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={production_orders.planned_start_at ?
                        new Date(
                          dayjs(production_orders.planned_start_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No PlannedStartAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='PlannedEndAt'>
                    {production_orders.planned_end_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={production_orders.planned_end_at ?
                        new Date(
                          dayjs(production_orders.planned_end_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No PlannedEndAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='ReleasedAt'>
                    {production_orders.released_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={production_orders.released_at ?
                        new Date(
                          dayjs(production_orders.released_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No ReleasedAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              
                <FormField label='ClosedAt'>
                    {production_orders.closed_at ? <DatePicker
                      dateFormat="yyyy-MM-dd hh:mm"
                      showTimeSelect
                      selected={production_orders.closed_at ?
                        new Date(
                          dayjs(production_orders.closed_at).format('YYYY-MM-DD hh:mm'),
                        ) : null
                      }
                      disabled
                    /> : <p>No ClosedAt</p>}
                </FormField>
              

              

              

              

              

              

              

              
              

              

              

              

              

              

              

              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Status</p>
                    <p>{production_orders?.status ?? 'No data'}</p>
                </div>
              

              

              

              

              

              
              

              

              

              

              

              

              

              

              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Priority</p>
                    <p>{production_orders?.priority ?? 'No data'}</p>
                </div>
              

              

              

              

              

              
              

              

              

              

              

              

              

              

              

              

              
              
                <div className={'mb-4'}>
                    <p className={'block font-bold mb-2'}>Planner</p>
                    
                    
                        <p>{production_orders?.planner?.firstName ?? 'No data'}</p>
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                </div>
                 
              

              

              

              
              

              

              
                <FormField label='Multi Text' hasTextareaHeight>
                  <textarea className={'w-full'} disabled value={production_orders?.notes} />
                </FormField>
              

              

              

              

              

              

              

              

              

              

              

              
              

                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Production_operations ProductionOrder</p>
                    <CardBox
                      className='mb-6 border border-gray-300 rounded overflow-hidden'
                      hasTable
                    >
                        <div className='overflow-x-auto'>
                            <table>
                            <thead>
                            <tr>
                                
                                
                                
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>ScheduledStartAt</th>
                                
                                
                                
                                <th>ScheduledEndAt</th>
                                
                                
                                
                                <th>ActualStartAt</th>
                                
                                
                                
                                <th>ActualEndAt</th>
                                
                                
                                
                                
                                
                                <th>GoodQuantity</th>
                                
                                
                                
                                <th>ScrapQuantity</th>
                                
                                
                                
                                <th>OperatorNotes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {production_orders.production_operations_production_order && Array.isArray(production_orders.production_operations_production_order) &&
                              production_orders.production_operations_production_order.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/production_operations/production_operations-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_start_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_start_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scheduled_end_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_end_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="actual_start_at">
                                        { dataFormatter.dateTimeFormatter(item.actual_start_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="actual_end_at">
                                        { dataFormatter.dateTimeFormatter(item.actual_end_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="good_quantity">
                                        { item.good_quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="scrap_quantity">
                                        { item.scrap_quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="operator_notes">
                                        { item.operator_notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!production_orders?.production_operations_production_order?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Material_requirements ProductionOrder</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>IssueMethod</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {production_orders.material_requirements_production_order && Array.isArray(production_orders.material_requirements_production_order) &&
                              production_orders.material_requirements_production_order.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/material_requirements/material_requirements-view/?id=${item.id}`)}>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="required_quantity">
                                        { item.required_quantity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="issued_quantity">
                                        { item.issued_quantity }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="issue_method">
                                        { item.issue_method }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!production_orders?.material_requirements_production_order?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Lots ProductionOrder</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>ManufacturedAt</th>
                                
                                
                                
                                <th>ReceivedAt</th>
                                
                                
                                
                                <th>ExpirationAt</th>
                                
                                
                                
                                <th>QualityStatus</th>
                                
                                
                                
                                <th>QuantityOnHand</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {production_orders.lots_production_order && Array.isArray(production_orders.lots_production_order) &&
                              production_orders.lots_production_order.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="manufactured_at">
                                        { dataFormatter.dateTimeFormatter(item.manufactured_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="received_at">
                                        { dataFormatter.dateTimeFormatter(item.received_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="expiration_at">
                                        { dataFormatter.dateTimeFormatter(item.expiration_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="quality_status">
                                        { item.quality_status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="quantity_on_hand">
                                        { item.quantity_on_hand }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!production_orders?.lots_production_order?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Serial_numbers ProductionOrder</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>
                            {production_orders.serial_numbers_production_order && Array.isArray(production_orders.serial_numbers_production_order) &&
                              production_orders.serial_numbers_production_order.map((item: any) => (
                                <tr key={item.id} onClick={() => router.push(`/serial_numbers/serial_numbers-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>
                        {!production_orders?.serial_numbers_production_order?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inventory_transactions ReferenceProductionOrder</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>TransactionType</th>
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                <th>Quantity</th>
                                
                                
                                
                                
                                
                                <th>TransactionAt</th>
                                
                                
                                
                                
                                
                                
                                
                                <th>Reference</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {production_orders.inventory_transactions_reference_production_order && Array.isArray(production_orders.inventory_transactions_reference_production_order) &&
                              production_orders.inventory_transactions_reference_production_order.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_type">
                                        { item.transaction_type }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="quantity">
                                        { item.quantity }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="transaction_at">
                                        { dataFormatter.dateTimeFormatter(item.transaction_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="reference">
                                        { item.reference }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!production_orders?.inventory_transactions_reference_production_order?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                <>
                    <p className={'block font-bold mb-2'}>Inspections ProductionOrder</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>ScheduledAt</th>
                                
                                
                                
                                <th>PerformedAt</th>
                                
                                
                                
                                
                                
                                <th>Result</th>
                                
                                
                                
                                <th>Notes</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {production_orders.inspections_production_order && Array.isArray(production_orders.inspections_production_order) &&
                              production_orders.inspections_production_order.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="scheduled_at">
                                        { dataFormatter.dateTimeFormatter(item.scheduled_at) }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="performed_at">
                                        { dataFormatter.dateTimeFormatter(item.performed_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="result">
                                        { item.result }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="notes">
                                        { item.notes }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!production_orders?.inspections_production_order?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                <>
                    <p className={'block font-bold mb-2'}>Nonconformances ProductionOrder</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>Severity</th>
                                
                                
                                
                                <th>Status</th>
                                
                                
                                
                                <th>Disposition</th>
                                
                                
                                
                                <th>ReportedAt</th>
                                
                                
                                
                                
                                
                                <th>Description</th>
                                
                                
                                
                                <th>RootCause</th>
                                
                                
                                
                                <th>CorrectiveAction</th>
                                
                                
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            {production_orders.nonconformances_production_order && Array.isArray(production_orders.nonconformances_production_order) &&
                              production_orders.nonconformances_production_order.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="severity">
                                        { item.severity }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="status">
                                        { item.status }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="disposition">
                                        { item.disposition }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="reported_at">
                                        { dataFormatter.dateTimeFormatter(item.reported_at) }
                                    </td>
                                    
                                    
                                    
                                    
                                    
                                    <td data-label="description">
                                        { item.description }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="root_cause">
                                        { item.root_cause }
                                    </td>
                                    
                                    
                                    
                                    <td data-label="corrective_action">
                                        { item.corrective_action }
                                    </td>
                                    
                                    
                                    
                                    
                                </tr>
                              ))}
                            </tbody>
                        </table>
                        </div>
                        {!production_orders?.nonconformances_production_order?.length && <div className={'text-center py-4'}>No data</div>}
                    </CardBox>
                </>
                
                
                
                
                

                <BaseDivider />

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

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

export default Production_ordersView;