fix(medical): resolve dynamic container target for Edit Invoice and master edit navigation
This commit is contained in:
parent
deea6529f7
commit
9acc580fb7
|
|
@ -7697,9 +7697,15 @@ class Medical extends BaseController
|
||||||
->getResult();
|
->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$linkedGrn = null;
|
||||||
|
if ($this->db->tableExists('mst_grns')) {
|
||||||
|
$linkedGrn = $this->db->table('mst_grns')->where('purchase_id', $invId)->get()->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
return view('medical/purchase_invoice_edit', [
|
return view('medical/purchase_invoice_edit', [
|
||||||
'purchase_invoice' => [$invoice],
|
'purchase_invoice' => [$invoice],
|
||||||
'med_gst_per' => $medGstPer,
|
'med_gst_per' => $medGstPer,
|
||||||
|
'linked_grn' => $linkedGrn,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7739,10 +7745,16 @@ class Medical extends BaseController
|
||||||
->getResult();
|
->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$linkedGrn = null;
|
||||||
|
if ($this->db->tableExists('mst_grns')) {
|
||||||
|
$linkedGrn = $this->db->table('mst_grns')->where('purchase_id', $invId)->get()->getRowArray();
|
||||||
|
}
|
||||||
|
|
||||||
return view('medical/purchase_invoice_master_edit', [
|
return view('medical/purchase_invoice_master_edit', [
|
||||||
'supplier_data' => $supplierData,
|
'supplier_data' => $supplierData,
|
||||||
'inv_master_data' => [$invMasterRow],
|
'inv_master_data' => [$invMasterRow],
|
||||||
'purchase_item' => $purchaseItems,
|
'purchase_item' => $purchaseItems,
|
||||||
|
'linked_grn' => $linkedGrn,
|
||||||
'can_update_purchase_status' => $this->canPharmacyPermission('pharmacy.purchase.status-update'),
|
'can_update_purchase_status' => $this->canPharmacyPermission('pharmacy.purchase.status-update'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
@ -7840,7 +7852,7 @@ class Medical extends BaseController
|
||||||
$update['inv_status'] = $invStatus;
|
$update['inv_status'] = $invStatus;
|
||||||
}
|
}
|
||||||
if (in_array('inv_status_update_by', $fields, true)) {
|
if (in_array('inv_status_update_by', $fields, true)) {
|
||||||
$update['inv_status_update_by'] = $userInfo;
|
$update['inv_status_update_by'] = $userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($update !== []) {
|
if ($update !== []) {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,8 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
notify('success', 'Please Attention', 'Invoice Added : ID->' + data.insertid);
|
notify('success', 'Please Attention', 'Invoice Added : ID->' + data.insertid);
|
||||||
load_form_div('<?= base_url('Medical/PurchaseInvoiceEdit') ?>/' + data.insertid, 'searchresult', 'Purchase Invoice Edit');
|
var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main';
|
||||||
|
load_form_div('<?= base_url('Medical/PurchaseInvoiceEdit') ?>/' + data.insertid, t, 'Purchase Invoice Edit');
|
||||||
}, 'json').fail(function () {
|
}, 'json').fail(function () {
|
||||||
notify('error', 'Please Attention', 'Unable to create purchase invoice');
|
notify('error', 'Please Attention', 'Unable to create purchase invoice');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,29 @@
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="mb-0">Purchase Invoice Information</h5>
|
<div class="d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||||
<small>
|
<div>
|
||||||
<i>Supplier</i>: <?= esc($invoice->name_supplier ?? '-') ?> |
|
<h5 class="mb-0">Purchase Invoice Information</h5>
|
||||||
<?= ((int) ($invoice->ischallan ?? 0) === 1) ? '<i>Challan No.</i>' : '<i>Invoice No.</i>' ?>: <?= esc((string) ($invoice->Invoice_no ?? '')) ?> |
|
<small class="text-muted">
|
||||||
<i>Invoice Date</i>: <?= esc((string) ($invoice->str_date_of_invoice ?? '')) ?>
|
<strong>Supplier:</strong> <?= esc($invoice->name_supplier ?? '-') ?> |
|
||||||
<button onclick="load_form_div('<?= base_url('Medical/PurchaseMasterEdit/' . (int) ($invoice->id ?? 0)) ?>','searchresult','Purchase Master Edit');" type="button" class="btn btn-warning btn-sm ms-2">Edit Invoice</button>
|
<strong><?= ((int) ($invoice->ischallan ?? 0) === 1) ? 'Challan No.' : 'Invoice No.' ?>:</strong> <?= esc((string) ($invoice->Invoice_no ?? '')) ?> |
|
||||||
<button onclick="load_form_div('<?= base_url('Medical/Purchase') ?>','medical-main','Purchase :Pharmacy');" type="button" class="btn btn-secondary btn-sm ms-1">Back to Purchase</button>
|
<strong>Invoice Date:</strong> <?= esc((string) ($invoice->str_date_of_invoice ?? '')) ?>
|
||||||
</small>
|
</small>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button onclick="var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main'; load_form_div('<?= base_url('Medical/PurchaseMasterEdit/' . (int) ($invoice->id ?? 0)) ?>', t, 'Purchase Master Edit');" type="button" class="btn btn-warning btn-sm ms-2">
|
||||||
|
<i class="bi bi-pencil-square"></i> Edit Invoice
|
||||||
|
</button>
|
||||||
|
<?php if (!empty($linked_grn)): ?>
|
||||||
|
<button onclick="load_form_div('<?= base_url('Medical/grn_edit/' . (int) $linked_grn['grn_id']) ?>','medical-main','GRN Detail');" type="button" class="btn btn-outline-info btn-sm ms-1">
|
||||||
|
<i class="bi bi-box-arrow-left"></i> Back to GRN #<?= esc($linked_grn['grn_number'] ?? $linked_grn['grn_id']) ?>
|
||||||
|
</button>
|
||||||
|
<?php endif; ?>
|
||||||
|
<button onclick="load_form_div('<?= base_url('Medical/Purchase') ?>','medical-main','Purchase :Pharmacy');" type="button" class="btn btn-secondary btn-sm ms-1">
|
||||||
|
<i class="bi bi-list"></i> Back to Purchase
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form id="purchase-form" class="form1" method="post" action="javascript:void(0)">
|
<form id="purchase-form" class="form1" method="post" action="javascript:void(0)">
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,39 @@ if (! $inv) {
|
||||||
|
|
||||||
$invStatus = (int) ($inv->inv_status ?? 0);
|
$invStatus = (int) ($inv->inv_status ?? 0);
|
||||||
$canUpdatePurchaseStatus = (bool) ($can_update_purchase_status ?? false);
|
$canUpdatePurchaseStatus = (bool) ($can_update_purchase_status ?? false);
|
||||||
|
$invDate = '';
|
||||||
|
if (!empty($inv->date_of_invoice) && $inv->date_of_invoice !== '0000-00-00') {
|
||||||
|
$time = strtotime((string) $inv->date_of_invoice);
|
||||||
|
if ($time !== false && $time > 0) {
|
||||||
|
$invDate = date('d/m/Y', $time);
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">Purchase Master Edit</div>
|
<div class="card-header d-flex justify-content-between align-items-center flex-wrap gap-2">
|
||||||
|
<div>
|
||||||
|
<h5 class="mb-0">Purchase Master Edit</h5>
|
||||||
|
<small class="text-muted">
|
||||||
|
Invoice No: <strong><?= esc((string) ($inv->Invoice_no ?? '')) ?></strong> |
|
||||||
|
Supplier: <strong><?= esc($inv->name_supplier ?? '-') ?></strong> |
|
||||||
|
Status: <strong><?= $invStatus === 1 ? '<span class="badge bg-success">Final and Checked</span>' : '<span class="badge bg-warning text-dark">Pending Entry</span>' ?></strong>
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button onclick="var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main'; load_form_div('<?= base_url('Medical/PurchaseInvoiceEdit/' . (int) ($inv->id ?? 0)) ?>', t, 'Purchase Invoice');" type="button" class="btn btn-outline-primary btn-sm">
|
||||||
|
<i class="bi bi-card-checklist"></i> View Invoice Items
|
||||||
|
</button>
|
||||||
|
<?php if (!empty($linked_grn)): ?>
|
||||||
|
<button onclick="load_form_div('<?= base_url('Medical/grn_edit/' . (int) $linked_grn['grn_id']) ?>','medical-main','GRN Detail');" type="button" class="btn btn-outline-info btn-sm ms-1">
|
||||||
|
<i class="bi bi-box-arrow-left"></i> Back to GRN #<?= esc($linked_grn['grn_number'] ?? $linked_grn['grn_id']) ?>
|
||||||
|
</button>
|
||||||
|
<?php endif; ?>
|
||||||
|
<button onclick="load_form_div('<?= base_url('Medical/Purchase') ?>','medical-main','Purchase :Pharmacy');" type="button" class="btn btn-secondary btn-sm ms-1">
|
||||||
|
<i class="bi bi-list"></i> Purchase List
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="card-body pt-3">
|
<div class="card-body pt-3">
|
||||||
<form id="purchase-master-form" class="form1 row g-2" method="post" action="javascript:void(0)">
|
<form id="purchase-master-form" class="form1 row g-2" method="post" action="javascript:void(0)">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
|
|
@ -38,7 +67,7 @@ $canUpdatePurchaseStatus = (bool) ($can_update_purchase_status ?? false);
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<label class="form-label">Date of Invoice</label>
|
<label class="form-label">Date of Invoice</label>
|
||||||
<input class="form-control form-control-sm" name="datepicker_invoice" id="datepicker_invoice" type="text" value="<?= !empty($inv->date_of_invoice) ? date('d/m/Y', strtotime((string) $inv->date_of_invoice)) : date('d/m/Y') ?>">
|
<input class="form-control form-control-sm" name="datepicker_invoice" id="datepicker_invoice" type="text" value="<?= $invDate !== '' ? esc($invDate) : date('d/m/Y') ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 d-flex align-items-end">
|
<div class="col-md-2 d-flex align-items-end">
|
||||||
<button type="button" class="btn btn-primary btn-sm" id="btn_update" accesskey="U"><u>U</u>pdate</button>
|
<button type="button" class="btn btn-primary btn-sm" id="btn_update" accesskey="U"><u>U</u>pdate</button>
|
||||||
|
|
@ -46,22 +75,25 @@ $canUpdatePurchaseStatus = (bool) ($can_update_purchase_status ?? false);
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label class="form-label">Supplier</label>
|
<label class="form-label">Supplier</label>
|
||||||
<div class="form-control form-control-sm"><?= esc($inv->name_supplier ?? '-') ?></div>
|
<div class="form-control form-control-sm bg-light"><?= esc($inv->name_supplier ?? '-') ?></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label class="form-label">Invoice ID</label>
|
<label class="form-label">Invoice ID</label>
|
||||||
<div class="form-control form-control-sm"><?= esc((string) ($inv->Invoice_no ?? '')) ?></div>
|
<div class="form-control form-control-sm bg-light"><?= esc((string) ($inv->Invoice_no ?? '')) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label class="form-label">Date of Invoice</label>
|
<label class="form-label">Date of Invoice</label>
|
||||||
<div class="form-control form-control-sm"><?= !empty($inv->date_of_invoice) ? esc(date('d/m/Y', strtotime((string) $inv->date_of_invoice))) : '' ?></div>
|
<div class="form-control form-control-sm bg-light"><?= esc($invDate) ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2 d-flex align-items-end">
|
||||||
|
<span class="badge bg-success py-2 w-100"><i class="bi bi-lock-fill"></i> Locked (Final)</span>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="table-responsive mt-3">
|
<div class="table-responsive mt-3">
|
||||||
<table class="table table-striped table-sm align-middle">
|
<table class="table table-striped table-sm align-middle">
|
||||||
<thead>
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Item Name</th>
|
<th>Item Name</th>
|
||||||
|
|
@ -80,53 +112,63 @@ $canUpdatePurchaseStatus = (bool) ($can_update_purchase_status ?? false);
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $sr = 0; foreach (($purchase_item ?? []) as $row): $sr++; ?>
|
<?php $sr = 0; foreach (($purchase_item ?? []) as $row): $sr++; ?>
|
||||||
|
<?php
|
||||||
|
$expStr = (string) ($row->expiry_date ?? '');
|
||||||
|
if (!empty($row->exp_date_str)) {
|
||||||
|
$expStr = (string) $row->exp_date_str;
|
||||||
|
} elseif (preg_match('/^\d{4}-\d{2}-\d{2}$/', $expStr)) {
|
||||||
|
$expStr = date('m/y', strtotime($expStr));
|
||||||
|
}
|
||||||
|
?>
|
||||||
<tr <?= ((int) ($row->item_return ?? 0) === 1) ? 'style="color:red;"' : '' ?>>
|
<tr <?= ((int) ($row->item_return ?? 0) === 1) ? 'style="color:red;"' : '' ?>>
|
||||||
<td><?= $sr ?></td>
|
<td><?= $sr ?></td>
|
||||||
<td><?= esc($row->Item_name ?? '') ?></td>
|
<td><?= esc($row->Item_name ?? '') ?></td>
|
||||||
<td><?= esc($row->batch_no ?? '') ?></td>
|
<td><?= esc($row->batch_no ?? '') ?></td>
|
||||||
<td><?= esc((string) ($row->expiry_date ?? '')) ?></td>
|
<td><?= esc($expStr) ?></td>
|
||||||
<td><?= esc((string) ($row->mrp ?? 0)) ?></td>
|
<td><?= number_format((float) ($row->mrp ?? 0), 2) ?></td>
|
||||||
<td><?= esc((string) ($row->qty ?? 0)) ?>+<?= esc((string) ($row->qty_free ?? 0)) ?></td>
|
<td><?= esc((string) ($row->qty ?? 0)) ?> + <?= esc((string) ($row->qty_free ?? 0)) ?></td>
|
||||||
<td><?= esc((string) ($row->purchase_price ?? 0)) ?></td>
|
<td><?= number_format((float) ($row->purchase_price ?? 0), 2) ?></td>
|
||||||
<td><?= esc((string) ($row->amount ?? 0)) ?></td>
|
<td><?= number_format((float) ($row->amount ?? 0), 2) ?></td>
|
||||||
<td><?= esc((string) ($row->discount ?? 0)) ?></td>
|
<td><?= number_format((float) ($row->discount ?? 0), 2) ?></td>
|
||||||
<td><?= esc((string) ($row->taxable_amount ?? 0)) ?></td>
|
<td><?= number_format((float) ($row->taxable_amount ?? 0), 2) ?></td>
|
||||||
<td><?= esc((string) ($row->CGST_per ?? 0)) ?></td>
|
<td><?= esc((string) ($row->CGST_per ?? 0)) ?>%</td>
|
||||||
<td><?= esc((string) ($row->SGST_per ?? 0)) ?></td>
|
<td><?= esc((string) ($row->SGST_per ?? 0)) ?>%</td>
|
||||||
<td><?= esc((string) ($row->net_amount ?? 0)) ?></td>
|
<td class="fw-bold"><?= number_format((float) ($row->net_amount ?? 0), 2) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr class="table-secondary fw-bold">
|
||||||
<th colspan="9" class="text-end">Total</th>
|
<td colspan="9" class="text-end">Total</td>
|
||||||
<th><?= esc((string) ($inv->Taxable_Amt ?? 0)) ?></th>
|
<td><?= number_format((float) ($inv->Taxable_Amt ?? 0), 2) ?></td>
|
||||||
<th><?= esc((string) ($inv->CGST_Amt ?? 0)) ?></th>
|
<td><?= number_format((float) ($inv->CGST_Amt ?? 0), 2) ?></td>
|
||||||
<th><?= esc((string) ($inv->SGST_Amt ?? 0)) ?></th>
|
<td><?= number_format((float) ($inv->SGST_Amt ?? 0), 2) ?></td>
|
||||||
<th><?= esc((string) ($inv->T_Net_Amount ?? 0)) ?></th>
|
<td><?= number_format((float) ($inv->T_Net_Amount ?? 0), 2) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="purchase-status-form" class="form2 row g-2" method="post" action="javascript:void(0)">
|
<form id="purchase-status-form" class="form2 row g-2 mt-2 align-items-center" method="post" action="javascript:void(0)">
|
||||||
<?php if ($invStatus === 0): ?>
|
<div class="col-auto">
|
||||||
<div class="col-md-2">
|
<button onclick="var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main'; load_form_div('<?= base_url('Medical/PurchaseInvoiceEdit/' . (int) ($inv->id ?? 0)) ?>', t, 'Purchase Invoice Edit');" type="button" class="btn btn-warning btn-sm">
|
||||||
<button onclick="load_form_div('<?= base_url('Medical/PurchaseInvoiceEdit/' . (int) ($inv->id ?? 0)) ?>','searchresult','Purchase Invoice Edit');" type="button" class="btn btn-warning btn-sm">Edit Items</button>
|
<i class="bi bi-pencil"></i> <?= $invStatus === 0 ? 'Edit Items' : 'View Invoice Items' ?>
|
||||||
</div>
|
</button>
|
||||||
<?php endif; ?>
|
</div>
|
||||||
<?php if ($canUpdatePurchaseStatus): ?>
|
<?php if ($canUpdatePurchaseStatus): ?>
|
||||||
<div class="col-md-2">
|
<div class="col-md-3">
|
||||||
<select class="form-select form-select-sm" id="cbo_invoice_status" name="cbo_invoice_status">
|
<div class="input-group input-group-sm">
|
||||||
<option value="0" <?= $invStatus === 0 ? 'selected' : '' ?>>Pending Entry</option>
|
<select class="form-select" id="cbo_invoice_status" name="cbo_invoice_status">
|
||||||
<option value="1" <?= $invStatus === 1 ? 'selected' : '' ?>>Final and Checked</option>
|
<option value="0" <?= $invStatus === 0 ? 'selected' : '' ?>>Pending Entry</option>
|
||||||
</select>
|
<option value="1" <?= $invStatus === 1 ? 'selected' : '' ?>>Final and Checked</option>
|
||||||
</div>
|
</select>
|
||||||
<div class="col-md-2">
|
<button type="button" class="btn btn-primary" onclick="update_invoice_status()">Update Status</button>
|
||||||
<button type="button" class="btn btn-primary btn-sm" onclick="update_invoice_status()">Update Status</button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label class="form-label">Invoice Status</label>
|
<div class="input-group input-group-sm">
|
||||||
<div class="form-control form-control-sm"><?= $invStatus === 1 ? 'Final and Checked' : 'Pending Entry' ?></div>
|
<span class="input-group-text">Status</span>
|
||||||
|
<div class="form-control form-control-sm"><?= $invStatus === 1 ? 'Final and Checked' : 'Pending Entry' ?></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -137,7 +179,8 @@ $canUpdatePurchaseStatus = (bool) ($can_update_purchase_status ?? false);
|
||||||
function update_invoice_status() {
|
function update_invoice_status() {
|
||||||
var invoiceStatus = $('#cbo_invoice_status').val();
|
var invoiceStatus = $('#cbo_invoice_status').val();
|
||||||
if (confirm('Are you sure to update Status?')) {
|
if (confirm('Are you sure to update Status?')) {
|
||||||
load_form_div('<?= base_url('Medical/UpdatePurchaseInvoiceStatus/' . (int) ($inv->id ?? 0)) ?>/' + invoiceStatus, 'searchresult', 'Purchase Master Edit');
|
var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main';
|
||||||
|
load_form_div('<?= base_url('Medical/UpdatePurchaseInvoiceStatus/' . (int) ($inv->id ?? 0)) ?>/' + invoiceStatus, t, 'Purchase Master Edit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,7 +192,8 @@ $(document).ready(function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
notify('success', 'Update Success', data.show_text || 'Data Update');
|
notify('success', 'Update Success', data.show_text || 'Data Update');
|
||||||
load_form_div('<?= base_url('Medical/PurchaseMasterEdit/' . (int) ($inv->id ?? 0)) ?>', 'searchresult', 'Purchase Master Edit');
|
var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main';
|
||||||
|
load_form_div('<?= base_url('Medical/PurchaseMasterEdit/' . (int) ($inv->id ?? 0)) ?>', t, 'Purchase Master Edit');
|
||||||
}, 'json');
|
}, 'json');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<small>
|
<small>
|
||||||
<i>Invoice No.</i>: <?= esc((string) ($invoice->Invoice_no ?? '')) ?> |
|
<i>Invoice No.</i>: <?= esc((string) ($invoice->Invoice_no ?? '')) ?> |
|
||||||
<i>Invoice Date</i>: <?= esc((string) ($invoice->str_date_of_invoice ?? '')) ?>
|
<i>Invoice Date</i>: <?= esc((string) ($invoice->str_date_of_invoice ?? '')) ?>
|
||||||
<button onclick="load_form_div('<?= base_url('Medical_backpanel/PurchaseReturnInvoiceEdit/' . (int) ($invoice->id ?? 0)) ?>','searchresult','Purchase Return Invoice Edit');" type="button" class="btn btn-warning btn-sm ms-2">Reload Invoice</button>
|
<button onclick="var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main'; load_form_div('<?= base_url('Medical_backpanel/PurchaseReturnInvoiceEdit/' . (int) ($invoice->id ?? 0)) ?>', t, 'Purchase Return Invoice Edit');" type="button" class="btn btn-warning btn-sm ms-2">Reload Invoice</button>
|
||||||
<a href="<?= base_url('Medical_Print/print_purchase_return/' . (int) ($invoice->id ?? 0)) ?>" target="_blank" class="btn btn-secondary btn-sm ms-1"><i class="fa fa-print"></i> Print</a>
|
<a href="<?= base_url('Medical_Print/print_purchase_return/' . (int) ($invoice->id ?? 0)) ?>" target="_blank" class="btn btn-secondary btn-sm ms-1"><i class="fa fa-print"></i> Print</a>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<td><?= esc((string) ($row->name_supplier ?? '')) ?></td>
|
<td><?= esc((string) ($row->name_supplier ?? '')) ?></td>
|
||||||
<td><?= esc((string) ($row->str_date_of_invoice ?? $row->date_of_invoice ?? '')) ?></td>
|
<td><?= esc((string) ($row->str_date_of_invoice ?? $row->date_of_invoice ?? '')) ?></td>
|
||||||
<td>
|
<td>
|
||||||
<button onclick="load_form_div('<?= base_url('Medical_backpanel/PurchaseReturnInvoiceEdit/' . (int) ($row->id ?? 0)) ?>','searchresult','Purchase Return Invoice Edit');" type="button" class="btn btn-warning btn-sm">View & Edit</button>
|
<button onclick="var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main'; load_form_div('<?= base_url('Medical_backpanel/PurchaseReturnInvoiceEdit/' . (int) ($row->id ?? 0)) ?>', t, 'Purchase Return Invoice Edit');" type="button" class="btn btn-warning btn-sm">View & Edit</button>
|
||||||
<a href="<?= base_url('Medical_Print/print_purchase_return/' . (int) ($row->id ?? 0)) ?>" target="_blank" class="btn btn-secondary btn-sm"><i class="fa fa-print"></i> Print</a>
|
<a href="<?= base_url('Medical_Print/print_purchase_return/' . (int) ($row->id ?? 0)) ?>" target="_blank" class="btn btn-secondary btn-sm"><i class="fa fa-print"></i> Print</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<td><?= esc((string) ($row->str_date_of_invoice ?? $row->date_of_invoice ?? '')) ?></td>
|
<td><?= esc((string) ($row->str_date_of_invoice ?? $row->date_of_invoice ?? '')) ?></td>
|
||||||
<td><?= esc((string) ($row->tamount ?? 0)) ?></td>
|
<td><?= esc((string) ($row->tamount ?? 0)) ?></td>
|
||||||
<td>
|
<td>
|
||||||
<button onclick="load_form_div('<?= base_url('Medical/PurchaseMasterEdit/' . (int) ($row->id ?? 0)) ?>','searchresult','Purchase Master Edit');" type="button" class="btn btn-warning btn-sm">View & Edit</button>
|
<button onclick="var t = document.getElementById('searchresult') ? 'searchresult' : 'medical-main'; load_form_div('<?= base_url('Medical/PurchaseMasterEdit/' . (int) ($row->id ?? 0)) ?>', t, 'Purchase Master Edit');" type="button" class="btn btn-warning btn-sm">View & Edit</button>
|
||||||
<?php if ((float) ($row->tamount ?? 0) == 0.0): ?>
|
<?php if ((float) ($row->tamount ?? 0) == 0.0): ?>
|
||||||
<button onclick="delete_invoice(<?= (int) ($row->id ?? 0) ?>)" type="button" class="btn btn-danger btn-sm">Delete</button>
|
<button onclick="delete_invoice(<?= (int) ($row->id ?? 0) ?>)" type="button" class="btn btn-danger btn-sm">Delete</button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
||||||
|
|
@ -482,10 +482,13 @@
|
||||||
})
|
})
|
||||||
.done(function(html) {
|
.done(function(html) {
|
||||||
var targetEl = document.getElementById(String(xdiv));
|
var targetEl = document.getElementById(String(xdiv));
|
||||||
|
if (!targetEl && (xdiv === 'searchresult' || xdiv === 'test_div')) {
|
||||||
|
targetEl = document.getElementById('medical-main') || document.getElementById('main');
|
||||||
|
}
|
||||||
if (targetEl) {
|
if (targetEl) {
|
||||||
targetEl.innerHTML = html;
|
targetEl.innerHTML = html;
|
||||||
}
|
}
|
||||||
executeInjectedScripts(xdiv);
|
executeInjectedScripts(targetEl ? targetEl.id : xdiv);
|
||||||
if (typeof window.showPageNotifications === 'function') {
|
if (typeof window.showPageNotifications === 'function') {
|
||||||
window.showPageNotifications(targetEl);
|
window.showPageNotifications(targetEl);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user