⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.220
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software:
Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
erp.dev-unit.com
/
storage
/
framework
/
views
/
View File Name :
fa580c397e58655393f429a34c7e9789.php
<?php $__env->startSection('page-title'); ?> <?php echo e(__('Edit Purchase')); ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('breadcrumb'); ?> <?php echo e(__('Purchase')); ?> <?php $__env->stopSection(); ?> <?php $__env->startPush('scripts'); ?> <script src="<?php echo e(asset('public/js/jquery-ui.min.js')); ?>"></script> <script src="<?php echo e(asset('js/jquery.repeater.min.js')); ?>"></script> <script src="<?php echo e(asset('js/jquery-searchbox.js')); ?>"></script> <script> $(document).on('change', '.product_type', function() { ProductType($(this)); }); function ProductType(data, id = null) { var product_type = data.val(); var selector = data; var itemSelect = selector.parent().parent().find('.product_id.item').attr('name'); $.ajax({ url: '<?php echo e(route('get.item')); ?>', type: 'POST', data: { "product_type": product_type, "_token": "<?php echo e(csrf_token()); ?>", }, success: function(data) { selector.parent().parent().find('.product_id').empty(); var product_select = `<select class="form-control product_id item js-searchBox" name="${itemSelect}" placeholder="Select Item" data-url="<?php echo e(route('purchases.product')); ?>" required = 'required'> </select>`; selector.parent().parent().find('.product_div').html(product_select); selector.parent().parent().find('.product_id').append( '<option value="0"> <?php echo e(__('Select Item')); ?> </option>'); $.each(data, function(key, value) { var selected = (key == id) ? 'selected' : ''; selector.parent().parent().find('.product_id').append('<option value="' + key + '" ' + selected + '>' + value + '</option>'); }); changeItem(selector.parent().parent().find('.product_id')); // Initialize your searchBox here if needed selector.parent().parent().find(".js-searchBox").searchBox({ elementWidth: '250' }); selector.parent().parent().find('.unit.input-group-text').text(""); } }); } </script> <script> var selector = "body"; if ($(selector + " .repeater").length) { var $dragAndDrop = $("body .repeater tbody").sortable({ handle: '.sort-handler' }); var $repeater = $(selector + ' .repeater').repeater({ initEmpty: true, defaultValues: { 'status': 1 }, show: function() { $(this).slideDown(); var file_uploads = $(this).find('input.multi'); if (file_uploads.length) { $(this).find('input.multi').MultiFile({ max: 3, accept: 'png|jpg|jpeg', max_size: 2048 }); } // for item SearchBox ( this function is custom Js ) JsSearchBox(); }, hide: function(deleteElement) { $(this).slideUp(deleteElement); $(this).remove(); var inputs = $(".amount"); var subTotal = 0; for (var i = 0; i < inputs.length; i++) { subTotal = parseFloat(subTotal) + parseFloat($(inputs[i]).html()); } $('.subTotal').html(subTotal.toFixed(2)); $('.totalAmount').html(subTotal.toFixed(2)); }, ready: function(setIndexes) { $dragAndDrop.on('drop', setIndexes); }, isFirstItemUndeletable: true }); var value = $(selector + " .repeater").attr('data-value'); if (typeof value != 'undefined' && value.length != 0) { value = JSON.parse(value); $repeater.setList(value); for (var i = 0; i < value.length; i++) { var tr = $('#sortable-table .id[value="' + value[i].id + '"]').parent(); tr.find('.item').val(value[i].product_id); ProductType(tr.find('.product_type'), value[i].product_id); changeItem(tr.find('.item')); } } } $(document).ready(function() { $("#vender").trigger('change'); }); $(document).on('change', '#vender', function() { $('#vender_detail').removeClass('d-none'); $('#vender_detail').addClass('d-block'); $('#vender-box').removeClass('d-block'); $('#vender-box').addClass('d-none'); var id = $(this).val(); var url = $(this).data('url'); $.ajax({ url: url, type: 'POST', headers: { 'X-CSRF-TOKEN': jQuery('#token').val() }, data: { 'id': id }, cache: false, success: function(data) { if (data != '') { $('#vender_detail').html(data); } else { $('#vender-box').removeClass('d-none'); $('#vender_detail').removeClass('d-block'); $('#vender_detail').addClass('d-none'); } }, }); }); $(document).on('click', '#remove', function() { $('#vender-box').removeClass('d-none'); $('#vender_detail').removeClass('d-block'); $('#vender_detail').addClass('d-none'); }); $(document).on('change', '.item', function() { changeItem($(this)); }); var purchase_id = '<?php echo e($purchase->id); ?>'; function changeItem(element) { var iteams_id = element.val(); var url = element.data('url'); var el = element; $.ajax({ url: url, type: 'POST', headers: { 'X-CSRF-TOKEN': jQuery('#token').val() }, data: { 'product_id': iteams_id }, cache: false, success: function(data) { var item = JSON.parse(data); $.ajax({ url: '<?php echo e(route('purchases.items')); ?>', type: 'post', headers: { 'X-CSRF-TOKEN': jQuery('#token').val() }, data: { 'purchase_id': purchase_id, 'product_id': iteams_id, }, cache: false, success: function(data) { var purchaseItems = JSON.parse(data); if (purchaseItems != null) { var amount = (purchaseItems.price * purchaseItems.quantity); $(el.parent().parent().parent().find('.quantity')).val(purchaseItems .quantity); $(el.parent().parent().parent().find('.price')).val(purchaseItems .price); $(el.parent().parent().parent().find('.discount')).val(purchaseItems .discount); $('.pro_description').text(purchaseItems.description); } else { $(el.parent().parent().parent().find('.quantity')).val(1); $(el.parent().parent().parent().find('.discount')).val(0); if (item.product != null) { $(el.parent().parent().parent().find('.price')).val(item.product .purchase_price); $(el.parent().parent().parent().find('.pro_description')).val( item.product.description); } else { $(el.parent().parent().parent().find('.price')).val(0); $(el.parent().parent().parent().find('.pro_description')).val( ''); } } var taxes = ''; var tax = []; var totalItemTaxRate = 0; for (var i = 0; i < item.taxes.length; i++) { taxes += '<span class="badge bg-primary p-2 px-3 me-1 mr-1">' + item.taxes[i].name + ' ' + '(' + item.taxes[i].rate + '%)' + '</span>'; tax.push(item.taxes[i].id); totalItemTaxRate += parseFloat(item.taxes[i].rate); } var discount = $(el.parent().parent().parent().find('.discount')).val(); var itemTaxPrice = 0; if (purchaseItems != null) { var itemTaxPrice = parseFloat((totalItemTaxRate / 100)) * parseFloat((purchaseItems.price * purchaseItems.quantity) - discount); } else if (item.product != null) { var itemTaxPrice = parseFloat((totalItemTaxRate / 100)) * parseFloat((item.product.purchase_price * 1) - discount); } $(el.parent().parent().parent().find('.itemTaxPrice')).val(itemTaxPrice .toFixed(2)); $(el.parent().parent().parent().find('.itemTaxRate')).val( totalItemTaxRate.toFixed(2)); $(el.parent().parent().parent().find('.taxes')).html(taxes); $(el.parent().parent().parent().find('.tax')).val(tax); $(el.parent().parent().parent().find('.unit')).html(item.unit); var inputs = $(".amount"); var subTotal = 0; for (var i = 0; i < inputs.length; i++) { subTotal = parseFloat(subTotal) + parseFloat($(inputs[i]).html()); } var totalItemPrice = 0; var inputs_quantity = $(".quantity"); var priceInput = $('.price'); for (var j = 0; j < priceInput.length; j++) { totalItemPrice += (parseFloat(priceInput[j].value) * parseFloat( inputs_quantity[j].value)); } var totalItemTaxPrice = 0; var itemTaxPriceInput = $('.itemTaxPrice'); for (var j = 0; j < itemTaxPriceInput.length; j++) { totalItemTaxPrice += parseFloat(itemTaxPriceInput[j].value); if (purchaseItems != null) { $(el.parent().parent().parent().find('.amount')).html( parseFloat(amount) + parseFloat(itemTaxPrice) - parseFloat(discount)); } else { $(el.parent().parent().parent().find('.amount')).html( parseFloat(item.totalAmount) + parseFloat(itemTaxPrice)); } } var totalItemDiscountPrice = 0; var itemDiscountPriceInput = $('.discount'); for (var k = 0; k < itemDiscountPriceInput.length; k++) { totalItemDiscountPrice += parseFloat(itemDiscountPriceInput[k] .value); } $('.subTotal').html(totalItemPrice.toFixed(2)); $('.totalTax').html(totalItemTaxPrice.toFixed(2)); $('.totalAmount').html((parseFloat(totalItemPrice) - parseFloat( totalItemDiscountPrice) + parseFloat(totalItemTaxPrice)) .toFixed(2)); $('.totalDiscount').html(totalItemDiscountPrice.toFixed(2)); } }); }, }); } $(document).on('keyup', '.quantity', function() { var quntityTotalTaxPrice = 0; var el = $(this).parent().parent().parent(); var quantity = $(this).val(); var price = $(el.find('.price')).val(); var discount = $(el.find('.discount')).val(); var totalItemPrice = (quantity * price); var amount = (totalItemPrice); $(el.find('.amount')).html(amount); var totalItemTaxRate = $(el.find('.itemTaxRate')).val(); var itemTaxPrice = parseFloat((totalItemTaxRate / 100) * (totalItemPrice)); $(el.find('.itemTaxPrice')).val(itemTaxPrice.toFixed(2)); var totalItemTaxPrice = 0; var itemTaxPriceInput = $('.itemTaxPrice'); for (var j = 0; j < itemTaxPriceInput.length; j++) { totalItemTaxPrice += parseFloat(itemTaxPriceInput[j].value); } var inputs = $(".amount"); var subTotal = 0; for (var i = 0; i < inputs.length; i++) { subTotal = parseFloat(subTotal) + parseFloat($(inputs[i]).html()); } $('.subTotal').html(subTotal.toFixed(2)); $('.totalTax').html(totalItemTaxPrice.toFixed(2)); $('.totalAmount').html((parseFloat(subTotal) + parseFloat(totalItemTaxPrice)).toFixed(2)); }) $(document).on('keyup change', '.price', function() { var el = $(this).parent().parent().parent().parent(); var price = $(this).val(); var quantity = $(el.find('.quantity')).val(); var discount = $(el.find('.discount')).val(); if (discount.length <= 0) { discount = 0; } var totalItemPrice = (quantity * price) - discount; var amount = (totalItemPrice); var totalItemTaxRate = $(el.find('.itemTaxRate')).val(); var itemTaxPrice = parseFloat((totalItemTaxRate / 100) * (totalItemPrice)); $(el.find('.itemTaxPrice')).val(itemTaxPrice.toFixed(2)); $(el.find('.amount')).html(parseFloat(itemTaxPrice) + parseFloat(amount)); var totalItemTaxPrice = 0; var itemTaxPriceInput = $('.itemTaxPrice'); for (var j = 0; j < itemTaxPriceInput.length; j++) { totalItemTaxPrice += parseFloat(itemTaxPriceInput[j].value); } var totalItemPrice = 0; var inputs_quantity = $(".quantity"); var priceInput = $('.price'); for (var j = 0; j < priceInput.length; j++) { totalItemPrice += (parseFloat(priceInput[j].value) * parseFloat(inputs_quantity[j].value)); } var inputs = $(".amount"); var subTotal = 0; for (var i = 0; i < inputs.length; i++) { subTotal = parseFloat(subTotal) + parseFloat($(inputs[i]).html()); } $('.subTotal').html(totalItemPrice.toFixed(2)); $('.totalTax').html(totalItemTaxPrice.toFixed(2)); $('.totalAmount').html((parseFloat(subTotal)).toFixed(2)); }) $(document).on('keyup change', '.discount', function() { var el = $(this).parent().parent().parent(); var discount = $(this).val(); if (discount.length <= 0) { discount = 0; } var price = $(el.find('.price')).val(); var quantity = $(el.find('.quantity')).val(); var totalItemPrice = (quantity * price) - discount; var amount = (totalItemPrice); var totalItemTaxRate = $(el.find('.itemTaxRate')).val(); var itemTaxPrice = parseFloat((totalItemTaxRate / 100) * (totalItemPrice)); $(el.find('.itemTaxPrice')).val(itemTaxPrice.toFixed(2)); $(el.find('.amount')).html(parseFloat(itemTaxPrice) + parseFloat(amount)); var totalItemTaxPrice = 0; var itemTaxPriceInput = $('.itemTaxPrice'); for (var j = 0; j < itemTaxPriceInput.length; j++) { totalItemTaxPrice += parseFloat(itemTaxPriceInput[j].value); } var totalItemPrice = 0; var inputs_quantity = $(".quantity"); var priceInput = $('.price'); for (var j = 0; j < priceInput.length; j++) { totalItemPrice += (parseFloat(priceInput[j].value) * parseFloat(inputs_quantity[j].value)); } var inputs = $(".amount"); var subTotal = 0; for (var i = 0; i < inputs.length; i++) { subTotal = parseFloat(subTotal) + parseFloat($(inputs[i]).html()); } var totalItemDiscountPrice = 0; var itemDiscountPriceInput = $('.discount'); for (var k = 0; k < itemDiscountPriceInput.length; k++) { if (itemDiscountPriceInput[k].value == '') { itemDiscountPriceInput[k].value = parseFloat(0); } totalItemDiscountPrice += parseFloat(itemDiscountPriceInput[k].value); } $('.subTotal').html(totalItemPrice.toFixed(2)); $('.totalTax').html(totalItemTaxPrice.toFixed(2)); $('.totalAmount').html((parseFloat(subTotal)).toFixed(2)); $('.totalDiscount').html(totalItemDiscountPrice.toFixed(2)); }) $(document).on('click', '[data-repeater-create]', function() { $('.item :selected').each(function() { var id = $(this).val(); $(".item option[value=" + id + "]").addClass("d-none"); }); }) $(document).on('click', '[data-repeater-delete]', function() { if (confirm('Are you sure you want to delete this element?')) { var el = $(this).parent().parent(); var id = $(el.find('.id')).val(); $.ajax({ url: '<?php echo e(route('purchases.product.destroy')); ?>', type: 'POST', headers: { 'X-CSRF-TOKEN': jQuery('#token').val() }, data: { 'id': id }, cache: false, success: function(data) { }, }); } }); </script> <script> $(document).ready(function() { var vendor_name = '<?php echo e($purchase->vender_name); ?>'; if (vendor_name) { $('.account_vendor').addClass("d-none"); } else { $('#vender_remove').addClass("d-none"); } }); $("#remove_vender").click(function() { $('#vender_remove').addClass("d-none"); $('.account_vendor').removeClass("d-none"); }); </script> <script> $(document).on('click', '[data-repeater-delete]', function() { $(".price").change(); $(".discount").change(); }); </script> <script> setTimeout(() => { $('#purchase_date').trigger('click'); }, 1500); </script> <script> $(document).ready(function() { var optionsMap = { 'Accounting': 'Item Wise', 'Projects': 'Project Wise', 'CMMS': 'Parts Wise', }; function mapSelectionToValue(selection) { switch (selection) { case 'Accounting': return 'product'; case 'Projects': return 'project'; case 'CMMS': return 'parts'; default: return null; } } $('#account_type').on('change', function() { var selectedOption = $(this).val(); $('#billing_type').empty(); if (optionsMap.hasOwnProperty(selectedOption)) { var value = mapSelectionToValue(selectedOption); if (value !== null) { $('[name="purchase_type_radio"]').append('<option value="' + value + '" >' + optionsMap[selectedOption] + '</option>').trigger('change'); } } }); }); </script> <script> $(document).ready(function() { var valueToMatch = "<?php echo e($purchase->account_type); ?>"; $('#account_type').val(valueToMatch).trigger('change'); }); </script> <?php $__env->stopPush(); ?> <?php $currancy_symbol = !empty(company_setting('defult_currancy_symbol')) ? company_setting('defult_currancy_symbol') : '$'; ?> <?php $__env->startSection('content'); ?> <div class="row"> <?php echo e(Form::model($purchase, ['route' => ['purchases.update', $purchase->id], 'method' => 'PUT', 'enctype' => 'multipart/form-data', 'class' => 'w-100 needs-validation', 'novalidate'])); ?> <div class="col-12"> <input type="hidden" name="_token" id="token" value="<?php echo e(csrf_token()); ?>"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="row" id="vender-box"> <div class="form-group col-md-6" id="account-box"> <label class="require form-label"><?php echo e(__('Account Type')); ?></label><?php if (isset($component)) { $__componentOriginaleab1765d328ab3f8835fc5d78676a070 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginaleab1765d328ab3f8835fc5d78676a070 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.required','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> <?php $component->withName('required'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?> <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $attributes = $__attributesOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php if (isset($__componentOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $component = $__componentOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__componentOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <select class="form-control account_type <?php echo e(!empty($errors->first('account_type')) ? 'is-invalid' : ''); ?>" name="account_type" id="account_type"> <option value=""><?php echo e(__('Select Account Type')); ?></option> <option value="Accounting" <?php if($purchase->account_type == 'Accounting'): ?> selected <?php endif; ?>> <?php echo e(__('Accounting')); ?></option> <option value="Projects" <?php if($purchase->account_type == 'Projects'): ?> selected <?php endif; ?>> <?php echo e(__('Projects')); ?></option> <?php if(module_is_active('CMMS')): ?> <option value="CMMS" <?php if($purchase->account_type == 'CMMS'): ?> selected <?php endif; ?>> <?php echo e(__('CMMS')); ?></option> <?php endif; ?> </select> </div> <div class="col-md-6"> <?php if(module_is_active('Account')): ?> <div class="form-group col-md-6 " id="vender_remove"> <?php echo e(Form::label('vender_name', __('Vendor'), ['class' => 'form-label'])); ?> <div class="form-group price-input input-group search-form" style="width: 160px"> <?php echo e(Form::text('vender_name', null, ['class' => 'form-control ', 'placeholder' => 'Enter vender name'])); ?> <span class="input-group-text bg-transparent" id="remove_vender"> <i class="ti ti-trash text-black "></i></span> </div> </div> <div class="form-group account_vendor"> <?php echo e(Form::label('vender_id', __('Vendor'), ['class' => 'form-label'])); ?><?php if (isset($component)) { $__componentOriginaleab1765d328ab3f8835fc5d78676a070 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginaleab1765d328ab3f8835fc5d78676a070 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.required','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> <?php $component->withName('required'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?> <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $attributes = $__attributesOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php if (isset($__componentOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $component = $__componentOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__componentOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php echo e(Form::select('vender_id', $venders, null, ['class' => 'form-control select ', 'id' => 'vender', 'data-url' => route('purchases.vender'), 'required' => 'required', 'placeholder' => 'Select vender'])); ?> </div> <?php else: ?> <div class="form-group"> <?php echo e(Form::label('vender_name', __('Vendor'), ['class' => 'form-label'])); ?><?php if (isset($component)) { $__componentOriginaleab1765d328ab3f8835fc5d78676a070 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginaleab1765d328ab3f8835fc5d78676a070 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.required','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> <?php $component->withName('required'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?> <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $attributes = $__attributesOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php if (isset($__componentOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $component = $__componentOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__componentOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php echo e(Form::text('vender_name', null, ['class' => 'form-control ', 'placeholder' => 'Enter vender name', 'required' => 'required'])); ?> </div> <?php endif; ?> </div> </div> <div id="vender_detail" class="d-none"></div> </div> <div class="col-md-6"> <div class="row"> <?php if(module_is_active('Account') && module_is_active('Taskly')): ?> <div class="col-md-12"> <div class="form-group"> <div class="form-group col-md-6"> <label class="require form-label"><?php echo e(__('Billing Type')); ?></label><?php if (isset($component)) { $__componentOriginaleab1765d328ab3f8835fc5d78676a070 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginaleab1765d328ab3f8835fc5d78676a070 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.required','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> <?php $component->withName('required'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?> <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $attributes = $__attributesOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php if (isset($__componentOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $component = $__componentOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__componentOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <select class="form-control <?php echo e(!empty($errors->first('Billing Type')) ? 'is-invalid' : ''); ?>" name="purchase_type_radio" required="" id="billing_type"> </select> <div class="invalid-feedback"> <?php echo e($errors->first('billing_type')); ?> </div> </div> </div> </div> <?php endif; ?> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <?php echo e(Form::label('warehouse_id', __('Warehouse'), ['class' => 'form-label'])); ?><?php if (isset($component)) { $__componentOriginaleab1765d328ab3f8835fc5d78676a070 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginaleab1765d328ab3f8835fc5d78676a070 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.required','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> <?php $component->withName('required'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?> <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $attributes = $__attributesOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php if (isset($__componentOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $component = $__componentOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__componentOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php echo e(Form::select('warehouse_id', $warehouse, null, ['class' => 'form-control select', 'required' => 'required'])); ?> </div> </div> <div class="col-md-6"> <div class="form-group"> <?php echo e(Form::label('category_id', __('Category'), ['class' => 'form-label'])); ?><?php if (isset($component)) { $__componentOriginaleab1765d328ab3f8835fc5d78676a070 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginaleab1765d328ab3f8835fc5d78676a070 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.required','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> <?php $component->withName('required'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?> <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $attributes = $__attributesOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php if (isset($__componentOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $component = $__componentOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__componentOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php echo e(Form::select('category_id', $category, null, ['class' => 'form-control select', 'required' => 'required'])); ?> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <?php echo e(Form::label('purchase_date', __('Purchase Date'), ['class' => 'form-label'])); ?><?php if (isset($component)) { $__componentOriginaleab1765d328ab3f8835fc5d78676a070 = $component; } ?> <?php if (isset($attributes)) { $__attributesOriginaleab1765d328ab3f8835fc5d78676a070 = $attributes; } ?> <?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.required','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?> <?php $component->withName('required'); ?> <?php if ($component->shouldRender()): ?> <?php $__env->startComponent($component->resolveView(), $component->data()); ?> <?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?> <?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?> <?php endif; ?> <?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?> <?php endif; ?> <?php if (isset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $attributes = $__attributesOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__attributesOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php if (isset($__componentOriginaleab1765d328ab3f8835fc5d78676a070)): ?> <?php $component = $__componentOriginaleab1765d328ab3f8835fc5d78676a070; ?> <?php unset($__componentOriginaleab1765d328ab3f8835fc5d78676a070); ?> <?php endif; ?> <?php echo e(Form::date('purchase_date', null, ['class' => 'form-control ', 'required' => 'required'])); ?> </div> </div> <div class="col-md-6"> <div class="form-group"> <?php echo e(Form::label('purchase_number', __('Purchase Number'), ['class' => 'form-label'])); ?> <input type="text" class="form-control" value="<?php echo e($purchase_number); ?>" readonly> </div> </div> </div> <?php if(module_is_active('CustomField') && !$customFields->isEmpty()): ?> <div class="col-md-12 form-group"> <div class="tab-pane fade show form-label" id="tab-2" role="tabpanel"> <?php echo $__env->make('custom-field::formBuilder', [ 'fildedata' => $purchase->customField, ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> </div> </div> <?php endif; ?> </div> </div> </div> </div> </div> <div class="col-12"> <h5 class="d-inline-block mb-4"><?php echo e(__('Items')); ?></h5> <div class="card repeater" data-value='<?php echo json_encode($purchase->items); ?>'> <div class="item-section"> <div class="row justify-content-between align-items-center"> <div class="col-md-12 d-flex align-items-center justify-content-between justify-content-md-end card-body pb-0"> <div class="all-button-box me-2"> <a href="#" data-repeater-create="" class="btn btn-primary" data-bs-toggle="modal" data-target="#add-bank"> <i class="ti ti-plus"></i> <?php echo e(__('Add item')); ?> </a> </div> </div> </div> </div> <div class="card-body table-border-style "> <div class="table-responsive"> <table class="table mb-0" data-repeater-list="items" id="sortable-table"> <thead> <tr> <th><?php echo e(__('Item Type')); ?></th> <th><?php echo e(__('Items')); ?></th> <th><?php echo e(__('Quantity')); ?></th> <th><?php echo e(__('Price')); ?> </th> <th><?php echo e(__('Tax')); ?> (%)</th> <th><?php echo e(__('Discount')); ?></th> <th class="text-end"><?php echo e(__('Amount')); ?> <br><small class="text-danger font-weight-bold"><?php echo e(__('After discount & tax')); ?></small> </th> <th></th> </tr> </thead> <tbody class="ui-sortable" data-repeater-item> <tr> <?php echo e(Form::hidden('id', null, ['class' => 'form-control id'])); ?> <td class="form-group pt-0"> <?php echo e(Form::select('product_type', $product_type, null, ['class' => 'form-control product_type ', 'required' => 'required', 'placeholder' => '--'])); ?> </td> <td width="25%" class="form-group pt-0 product_div"> <select name="item" class="form-control product_id item js-searchBox" data-url="<?php echo e(route('purchases.product')); ?>" required> <?php $__currentLoopData = $product_services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $product_service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($key); ?>"><?php echo e($product_service); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </td> <td> <div class="form-group price-input input-group search-form" style="width: 160px"> <?php echo e(Form::text('quantity', null, ['class' => 'form-control quantity', 'required' => 'required', 'placeholder' => __('Qty'), 'required' => 'required'])); ?> <span class="unit input-group-text bg-transparent"></span> </div> </td> <td> <div class="form-group price-input input-group search-form" style="width: 160px"> <?php echo e(Form::text('price', null, ['class' => 'form-control price', 'required' => 'required', 'placeholder' => __('Price'), 'required' => 'required'])); ?> <span class="input-group-text bg-transparent"><?php echo e($currancy_symbol); ?></span> </div> </td> <td> <div class="form-group"> <div class="input-group"> <div class="taxes"></div> <?php echo e(Form::hidden('tax', '', ['class' => 'form-control tax'])); ?> <?php echo e(Form::hidden('itemTaxPrice', '', ['class' => 'form-control itemTaxPrice'])); ?> <?php echo e(Form::hidden('itemTaxRate', '', ['class' => 'form-control itemTaxRate'])); ?> </div> </div> </td> <td> <div class="form-group price-input input-group search-form" style="width: 160px"> <?php echo e(Form::text('discount', null, ['class' => 'form-control discount', 'required' => 'required', 'placeholder' => __('Discount')])); ?> <span class="input-group-text bg-transparent"><?php echo e($currancy_symbol); ?></span> </div> </td> <td class="text-end amount"> 0.00 </td> <td> <?php if (app('laratrust')->hasPermission('purchase product delete')) : ?> <a href="#" class="action-btn ms-2 float-end mb-3" data-repeater-delete=""> <div class="mx-3 btn btn-sm d-inline-flex align-items-center m-2 p-2 bg-danger" bis_skin_checked="1"> <i class="ti ti-trash text-white" data-bs-toggle="tooltip" data-bs-original-title="Delete"></i> </div> </a> <?php endif; // app('laratrust')->permission ?> </td> </tr> <tr> <td colspan="2"> <div class="form-group"> <?php echo e(Form::textarea('description', null, ['class' => 'form-control pro_description', 'rows' => '2', 'placeholder' => __('Description')])); ?> </div> </td> <td colspan="5"></td> </tr> </tbody> <tfoot> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td></td> <td><strong><?php echo e(__('Sub Total')); ?> (<?php echo e($currancy_symbol); ?>)</strong></td> <td class="text-end subTotal">0.00</td> <td></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td></td> <td><strong><?php echo e(__('Discount')); ?> (<?php echo e($currancy_symbol); ?>)</strong></td> <td class="text-end totalDiscount">0.00</td> <td></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td></td> <td><strong><?php echo e(__('Tax')); ?> (<?php echo e($currancy_symbol); ?>)</strong></td> <td class="text-end totalTax">0.00</td> <td></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td class="blue-text"><strong><?php echo e(__('Total Amount')); ?> (<?php echo e($currancy_symbol); ?>)</strong></td> <td class="blue-text text-end totalAmount">0.00</td> <td></td> </tr> </tfoot> </table> </div> </div> </div> </div> <div class="modal-footer"> <input type="button" value="<?php echo e(__('Cancel')); ?>" onclick="location.href = '<?php echo e(route('purchases.index')); ?>';" class="btn btn-light me-2"> <input type="submit" value="<?php echo e(__('Update')); ?>" class="btn btn-primary"> </div> <?php echo e(Form::close()); ?> </div> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/id/erp.dev-unit.com/resources/views/purchases/edit.blade.php ENDPATH**/ ?>