![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ledger.corals.io/storage/framework/views/ |
<?php echo CoralsForm::openForm($record,['data-table' => '.dataTable']); ?> <div class="row"> <div class="col-md-4"> <?php echo CoralsForm::select('account_id','Ledger::attributes.record.account_id',Corals\Modules\Ledger\Classes\Ledger::getAccounts(), true, null, [], 'select2'); ?> <?php echo CoralsForm::date('record_date','Ledger::attributes.record.record_date',true,$record->exists?$record->record_date:today()); ?> <div id="amount-wrapper"> <?php echo CoralsForm::number('amount','Ledger::attributes.record.amount',true,$record->amount); ?> </div> </div> <div class="col-md-4"> <?php echo CoralsForm::radio('type','Ledger::attributes.record.type',true,trans('Ledger::attributes.record.record_type_options')); ?> <?php echo CoralsForm::radio('payment_method','Ledger::attributes.record.payment_method',true,trans('Ledger::attributes.record.payment_method_options')); ?> <?php echo CoralsForm::radio('currency','Ledger::attributes.record.currency',true,config('ledger.supported_currencies')); ?> </div> <div class="col-md-4 cheque_details"> <?php echo CoralsForm::text('properties[cheque_number]','Ledger::labels.cheque.cheque_number',true); ?> <?php echo CoralsForm::text('properties[cheque_name]','Ledger::labels.cheque.cheque_name',true); ?> <?php echo CoralsForm::date('properties[cheque_date]','Ledger::labels.cheque.cheque_date', true); ?> </div> </div> <div class="row"> <div class="col-md-6"> <?php echo CoralsForm::select('item_id','Ledger::attributes.record.item',\Ledger::getItems(), false, null, ['wrapper_class'=>'m-0'], 'select2'); ?> </div> <div class="col-md-4"> <label style="display: block"> </label> <button type="button" onclick="addItem()" class="btn btn-info">Add Item</button> </div> </div> <div class="row d-md-flex mt-3 justify-content-around align-items-center d-none" id="items-header"> <div class="col-md-3 text-center p-4 p-md-0"> <?php echo app('translator')->get('Ledger::attributes.item.name'); ?> </div> <div class="col-md-5 d-flex justify-content-around"> <span style="width: 90px;"><?php echo app('translator')->get('Ledger::attributes.item.price'); ?></span> <span style="width: 90px;"><?php echo app('translator')->get('Ledger::attributes.item.quantity'); ?></span> <span style="width: 90px;"><?php echo app('translator')->get('Ledger::attributes.item.amount'); ?></span> </div> <div class="col-md-3"> <?php echo app('translator')->get('Ledger::attributes.item.notes'); ?> </div> <div class="col-md-1"> </div> </div> <div id="record_items_list" class="mt-3 mt-md-0"> <?php $__currentLoopData = $record->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $recordItem): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php echo $__env->make('Ledger::partials.record_item_row', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <hr/> <?php echo CoralsForm::textarea('notes','Ledger::attributes.record.notes',false); ?> <?php echo CoralsForm::formButtons('',[],['show_cancel'=>false],array_merge( $record->exists?[]:[[ 'label'=> 'Ledger::labels.record.save_and_clone', 'type'=> 'submit', 'attributes'=>['name'=>'save-clone','value'=>'1', 'class'=>'btn btn-warning mr-md-3'], ]], [[ 'label'=> $record->exists?'Ledger::labels.record.update_and_confirm':'Ledger::labels.record.create_and_confirm', 'type'=>'submit', 'attributes'=>['name'=>'submit-btn','value'=>'confirmed', 'class'=>'btn btn-danger mr-md-3'], ], ])); ?> <?php echo CoralsForm::closeForm($record); ?> <script> function hideShowAmount() { if ($('#record_items_list').find('.item-row').length) { $('#amount-wrapper').hide(); $("#items-header").addClass('d-md-flex'); } else { $("#items-header").removeClass('d-md-flex'); $('#amount-wrapper').fadeIn(); } } function addItem() { let item_id = $('#item_id').val(); if (!item_id) { return; } let itemRow = $('#record_items_list').find(`#item_${item_id}`); if (itemRow.length) { let quantityForItem = itemRow.find('.quantity') let priceForItem = itemRow.find('.price') quantityForItem.val(parseFloat(quantityForItem.val()) + 1); quantityForItem.trigger('change'); $('#item_id').val(null).trigger('change'); } else { $.get('<?php echo e(url('ledger/item-data/')); ?>/?item_id=' + item_id).then(function (response) { $('#record_items_list').append(response.item_details) $('#item_id').val(null).trigger('change'); hideShowAmount(); }); } } function checkRecordType() { let val = $('input[name=payment_method]:checked').val(); if (val === 'cheque') { $('.cheque_details').show(); } else { $('.cheque_details').hide(); } } $('input[name=payment_method]').change(function () { checkRecordType(); }); $(document).on('click', '.remove-btn', function () { $(this).closest('.item-row').remove(); hideShowAmount() }); $(document).on('keyup change', '.quantity,.price', function () { let row = $(this).closest('.item-row'); let quantityForItem = row.find('.quantity').val() let priceForItem = row.find('.price').val() row.find('.amount').val((parseFloat(quantityForItem) * parseFloat(priceForItem)).toFixed(2)); }); function initForm() { hideShowAmount(); checkRecordType(); } initForm(); </script> <?php /**PATH /home/corals/ledger.corals.io/Corals/modules/Ledger/resources/views/records/create_edit.blade.php ENDPATH**/ ?>