65 lines
3.5 KiB
PHP
65 lines
3.5 KiB
PHP
@extends('layouts.app')
|
|
@section('title', $bom->bom_code)
|
|
@section('content')
|
|
@include('industrialengineering::layouts.nav')
|
|
<section class="content-header">
|
|
<h1>
|
|
{{ $bom->bom_code }} — {{ $bom->name }}
|
|
<small class="label label-default">{{ strtoupper($bom->bom_type) }}</small>
|
|
@if($bom->auto_code)<small class="text-muted">@lang('industrialengineering::lang.system_code'): {{ $bom->auto_code }}</small>@endif
|
|
@if($bom->bom_type === 'mbom')
|
|
<form method="POST" action="{{ action([\Modules\IndustrialEngineering\Http\Controllers\BomController::class,'deriveSbom'],$bom->id) }}" class="pull-right">@csrf
|
|
<button class="btn btn-warning btn-sm"><i class="fa fa-copy"></i> @lang('industrialengineering::lang.derive_sbom')</button>
|
|
</form>
|
|
@endif
|
|
</h1>
|
|
</section>
|
|
<section class="content">
|
|
@can('ie.bom.create')
|
|
<div class="box box-success">
|
|
<div class="box-header"><h3 class="box-title">@lang('industrialengineering::lang.add_bom_line')</h3></div>
|
|
<div class="box-body">
|
|
{!! Form::open(['url'=>action([\Modules\IndustrialEngineering\Http\Controllers\BomController::class,'storeLine'],$bom->id)]) !!}
|
|
<div class="row">
|
|
<div class="col-md-3">{!! Form::select('item_master_id', \Modules\IndustrialEngineering\Models\ItemMaster::forBusiness(session('user.business_id'))->pluck('name','id'), null, ['class'=>'form-control select2','required','placeholder'=>__('industrialengineering::lang.item_masters')]) !!}</div>
|
|
<div class="col-md-2">{!! Form::number('quantity',1,['class'=>'form-control','step'=>'0.01','required']) !!}</div>
|
|
<div class="col-md-2">{!! Form::text('position_code',null,['class'=>'form-control','placeholder'=>__('industrialengineering::lang.position')]) !!}</div>
|
|
<div class="col-md-2">{!! Form::text('alternate_group',null,['class'=>'form-control','placeholder'=>'گروه جایگزین']) !!}</div>
|
|
<div class="col-md-2"><button class="btn btn-primary">@lang('industrialengineering::lang.add')</button></div>
|
|
</div>
|
|
{!! Form::close() !!}
|
|
</div>
|
|
</div>
|
|
@endcan
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="box box-primary">
|
|
<div class="box-header"><h3 class="box-title">@lang('industrialengineering::lang.bom_tree')</h3></div>
|
|
<div class="box-body">
|
|
@include('industrialengineering::partials.bom_tree', ['nodes' => $tree])
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="box box-info">
|
|
<div class="box-header"><h3 class="box-title">@lang('industrialengineering::lang.bom_flat')</h3></div>
|
|
<div class="box-body">
|
|
<table class="table table-condensed table-striped">
|
|
<thead><tr><th>@lang('industrialengineering::lang.code')</th><th>@lang('industrialengineering::lang.quantity')</th><th>@lang('industrialengineering::lang.total_cost')</th></tr></thead>
|
|
<tbody>
|
|
@foreach($flat as $line)
|
|
<tr>
|
|
<td>{{ $line['item_name'] ?? '' }} <code>{{ $line['item_code'] ?? '' }}</code></td>
|
|
<td>{{ $line['quantity'] }}</td>
|
|
<td>{{ number_format($line['extended_cost'], 0) }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endsection
|