CHANGE_RETURN_ORDER : AADHAVAN
This commit is contained in:
parent
6f5fb19328
commit
aeff0b8367
@ -151,6 +151,7 @@ $routes->get("download_purchase_invoice/(:any)", "Purchase::download_purchase_in
|
||||
// Reorder Level//
|
||||
$routes->get('reorder_level_index', 'Reorderlevel::reorder_level_index');
|
||||
$routes->get('rise_order/(:any)', 'Reorderlevel::rise_order/$1');
|
||||
|
||||
// Return Order//
|
||||
$routes->get('return_order_index', 'ReturnOrder::return_order_index');
|
||||
$routes->get('return_order', 'ReturnOrder::return_order');
|
||||
@ -158,3 +159,4 @@ $routes->get("new_return/(:any)", "ReturnOrder::new_return/$1");
|
||||
$routes->post("add_return_purchase", "ReturnOrder::add_return_purchase");
|
||||
$routes->get('get_vendor/(:any)', 'Purchase::get_vendor/$1');
|
||||
|
||||
$routes->get('edit_return_order/(:any)', 'ReturnOrder::edit_return_order/$1');
|
||||
|
||||
@ -9,6 +9,7 @@ use App\Models\PurchaseOrderModel;
|
||||
use App\Models\BusinessModel;
|
||||
use App\Models\PurchaseOrderChildModel;
|
||||
use App\Models\ReturnModel;
|
||||
use App\Models\ReturnOrderChildModel;
|
||||
use Mpdf\Mpdf;
|
||||
|
||||
|
||||
@ -41,9 +42,9 @@ class ReturnOrder extends BaseController
|
||||
|
||||
public function return_order()
|
||||
{
|
||||
$PurchaseOrderModel = new PurchaseOrderModel();
|
||||
$ReturnModel = new ReturnModel();
|
||||
|
||||
$purchase = $PurchaseOrderModel->getPurchaseOrdersWithProducts($this->session->get('logged_user_branch_id'));
|
||||
$purchase = $ReturnModel->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
|
||||
// echo "<pre>";
|
||||
// print_r($product);die;
|
||||
$data['purchase']=$purchase;
|
||||
@ -91,6 +92,7 @@ class ReturnOrder extends BaseController
|
||||
|
||||
public function add_return_purchase()
|
||||
{
|
||||
|
||||
|
||||
$ProductModel = new ProductModel();
|
||||
$data = [
|
||||
@ -112,74 +114,112 @@ class ReturnOrder extends BaseController
|
||||
'terms_condition' => $this->request->getPost('terms_condition'),
|
||||
'branch_id'=> $this->session->get('logged_user_branch_id'),
|
||||
];
|
||||
echo '<pre>';
|
||||
print_r($this->request->getPost());
|
||||
echo '</pre>';
|
||||
die;
|
||||
// $return_order_id = $this->request->getPost('return_order_id');
|
||||
|
||||
// if (!empty($return_order_id)) {
|
||||
|
||||
// $this->returnModel->update($return_order_id, $data);
|
||||
// } else {
|
||||
|
||||
// $this->returnModel->insert($data);
|
||||
// $return_order_id = $this->returnModel->getInsertID();
|
||||
// }
|
||||
// $orderNumber = 'RO' . str_pad($return_order_id, 8, '0', STR_PAD_LEFT);
|
||||
|
||||
// $this->returnModel->update($return_order_id, ['order_number' => $orderNumber]);
|
||||
|
||||
$product_ids = $this->request->getPost('item_details');
|
||||
$quantities = $this->request->getPost('quantity');
|
||||
$amounts = $this->request->getPost('amount');
|
||||
$itemtax=$this->request->getPost('item-tax');
|
||||
$unitprice=$this->request->getPost('unit-price');
|
||||
$selected_items=$this->request->getPost('return_selected_items');
|
||||
$purchase_order_child_id = $this->request->getPost('purchase_order_child_id');
|
||||
print_r($selected_items);die;
|
||||
|
||||
// print_r($status);die;
|
||||
$status = $this->request->getPost('purchase_status');
|
||||
foreach ($product_ids as $key => $product_id) {
|
||||
$qty = isset($quantities[$key]) ? $quantities[$key] : 0;
|
||||
$selected_item= isset($selected_items[$key]) ? $selected_items[$key] : 0;
|
||||
// print_r($selected_item);die;
|
||||
if ($status == 'Released' && $selected_item == 1) {
|
||||
$this->addBackProductQuantity($ProductModel, $product_id, $qty);
|
||||
}
|
||||
|
||||
|
||||
$tax=isset($itemtax[$key]) ? $itemtax[$key] : 0;
|
||||
$rate=isset($unitprice[$key]) ? $unitprice[$key] : 0;
|
||||
$amount = isset($amounts[$key]) ? $amounts[$key] : 0;
|
||||
|
||||
// $new_qty = $this->calculateUpdatedQuantity($ProductModel, $product_id, $qty);
|
||||
// print_r($discount_type);die;
|
||||
$child_data = [
|
||||
'return_order_id' => $return_order_id,
|
||||
'product_id' => $product_id,
|
||||
'qty' => $qty,
|
||||
'net_price'=>$rate,
|
||||
'tax'=>$tax,
|
||||
'amount' => $amount,
|
||||
'is_selected'=>$selected_item,
|
||||
'isactive'=>1,
|
||||
];
|
||||
// print_r($child_data);die;
|
||||
if (!empty($purchase_order_child_id[$key])) {
|
||||
|
||||
// print_r($purchase_order_child_id[$key]);die;
|
||||
$PurchaseOrderChildModel->update($purchase_order_child_id[$key], $child_data);
|
||||
|
||||
} else {
|
||||
$PurchaseOrderChildModel->insert($child_data);
|
||||
|
||||
if ($this->request->getPost('purchase_status') == 'Returned') {
|
||||
|
||||
|
||||
|
||||
$return_order_id = $this->request->getPost('return_order_id');
|
||||
|
||||
$ReturnModel = new ReturnModel();
|
||||
$ReturnOrderChildModel = new ReturnOrderChildModel();
|
||||
|
||||
$return = $ReturnModel->where('return_order_id', $return_order_id)->first();
|
||||
|
||||
|
||||
$return_data_update =['status'=>$this->request->getPost('purchase_status')];
|
||||
|
||||
|
||||
if ($return) {
|
||||
foreach ($item_details as $index => $item_detail) {
|
||||
foreach ($return_order_child as $child) {
|
||||
$quantity =$this->request->getPost('quantity');
|
||||
|
||||
if ($item_detail == $child['product_id']) {
|
||||
|
||||
// $changed_quantity =['qty'=> $child['qty'] - $quantity[$index]];
|
||||
|
||||
// $purchase_order_child_id = $child['purchase_order_child_id'];
|
||||
|
||||
$PurchaseOrderChildModel->update($purchase_order_child_id, $changed_quantity);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$ReturnModel->update($return_order_id, $return_data_update);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return redirect()->to('return_order');
|
||||
} else {
|
||||
$return_order_id = $this->request->getPost('return_order_id');
|
||||
|
||||
if (!empty($return_order_id)) {
|
||||
|
||||
}
|
||||
$this->returnModel->update($return_order_id, $data);
|
||||
} else {
|
||||
|
||||
$this->returnModel->insert($data);
|
||||
$return_order_id = $this->returnModel->getInsertID();
|
||||
}
|
||||
$orderNumber = 'RO' . str_pad($return_order_id, 8, '0', STR_PAD_LEFT);
|
||||
|
||||
$this->returnModel->update($return_order_id, ['order_number' => $orderNumber]);
|
||||
|
||||
// die;
|
||||
$product_ids = $this->request->getPost('item_details');
|
||||
$quantities = $this->request->getPost('quantity');
|
||||
$amounts = $this->request->getPost('amount');
|
||||
$itemtax=$this->request->getPost('item-tax');
|
||||
$unitprice=$this->request->getPost('unit-price');
|
||||
$selected_items=$this->request->getPost('return_selected_items');
|
||||
$purchase_order_child_id = $this->request->getPost('purchase_order_child_id');
|
||||
// print_r($selected_items);die;
|
||||
|
||||
$status = $this->request->getPost('purchase_status');
|
||||
foreach ($selected_items as $key => $product_id) {
|
||||
$qty = isset($quantities[$key]) ? $quantities[$key] : 0;
|
||||
$selected_item= isset($selected_items[$key]) ? $selected_items[$key] : 0;
|
||||
// print_r($selected_item);die;
|
||||
if ($status == 'Released' && $selected_item == 1) {
|
||||
$this->addBackProductQuantity($ProductModel, $product_id, $qty);
|
||||
}
|
||||
|
||||
|
||||
$tax=isset($itemtax[$key]) ? $itemtax[$key] : 0;
|
||||
$rate=isset($unitprice[$key]) ? $unitprice[$key] : 0;
|
||||
$amount = isset($amounts[$key]) ? $amounts[$key] : 0;
|
||||
|
||||
// $new_qty = $this->calculateUpdatedQuantity($ProductModel, $product_id, $qty);
|
||||
// print_r($discount_type);die;
|
||||
$child_data = [
|
||||
'return_order_id' => $return_order_id,
|
||||
'product_id' => $product_id,
|
||||
'qty' => $qty,
|
||||
'net_price'=>$rate,
|
||||
'tax'=>$tax,
|
||||
'amount' => $amount,
|
||||
'is_selected'=>$selected_item,
|
||||
'isactive'=>1,
|
||||
];
|
||||
// if (!empty($purchase_order_child_id[$key])) {
|
||||
// print_r("22222222222222222222222222");die;
|
||||
|
||||
$ReturnOrderChildModel = new ReturnOrderChildModel();
|
||||
// print_r($purchase_order_child_id[$key]);die;
|
||||
// $ReturnOrderChildModel->update($purchase_order_child_id[$key], $child_data);
|
||||
|
||||
// } else {
|
||||
// print_r("11111111111111111111");die;
|
||||
|
||||
$ReturnOrderChildModel->insert($child_data);
|
||||
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return redirect()->to('purchase_index');
|
||||
}
|
||||
@ -335,11 +375,58 @@ public function download_purchase_invoice($purchase_order_id)
|
||||
|
||||
// Generate the PDF content (HTML) with data
|
||||
$html = view('invoice_purchase_template', ['sales' => $data,'items'=>$items]);
|
||||
// echo $html;die;
|
||||
// echo $html;die;
|
||||
// Load HTML into the mPDF instance
|
||||
$mpdf->WriteHTML($html);
|
||||
|
||||
// Output the PDF to the browser for download
|
||||
$mpdf->Output('invoice_' . date('Y-m-d H-i-s') . '.pdf', 'D');
|
||||
}
|
||||
|
||||
|
||||
public function edit_return_order($return_order_id){
|
||||
|
||||
$data['page_name']= 'Edit Return Order';
|
||||
|
||||
|
||||
$ReturnModel = new ReturnModel();
|
||||
$return_order=$ReturnModel->where('return_order_id', $return_order_id)->first();
|
||||
$data['return_order'] = $return_order;
|
||||
|
||||
$purchase_order_id = $return_order['purchase_order_id'];
|
||||
|
||||
$PurchaseOrderModel = new PurchaseOrderModel();
|
||||
$purchase=$PurchaseOrderModel->where('purchase_order_id', $purchase_order_id)->get()->getRowArray();
|
||||
$data['purchase'] = $purchase;
|
||||
|
||||
|
||||
|
||||
$VendorModel = new VendorModel();
|
||||
$vendor = $VendorModel->findAll();
|
||||
$data['vendor'] = $vendor;
|
||||
|
||||
$data['vendor_id'] = $purchase['vendor_id'];
|
||||
|
||||
$vendorId=$purchase['vendor_id'];
|
||||
$encodedVendorId = json_encode([$vendorId]);
|
||||
$productModel = new ProductModel();
|
||||
|
||||
// Query the database to find the product based on make_id and model_id
|
||||
$product = $productModel->where('JSON_CONTAINS(vendor, \'' . $encodedVendorId . '\')', null, false)
|
||||
->findAll();
|
||||
$data['product']=$product;
|
||||
|
||||
|
||||
|
||||
|
||||
$ReturnOrderChildModel = new ReturnOrderChildModel();
|
||||
$return_order_child=$ReturnOrderChildModel->where('return_order_id', $return_order_id)->findAll();
|
||||
$data['purchase_product']=$return_order_child;
|
||||
|
||||
// echo"<pre>";
|
||||
// print_r($data);die;
|
||||
|
||||
return view('edit_return_order', $data);
|
||||
}
|
||||
|
||||
}
|
||||
10
app/Models/ReturnOrderChildModel.php
Normal file
10
app/Models/ReturnOrderChildModel.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
use CodeIgniter\Model;
|
||||
class ReturnOrderChildModel extends Model
|
||||
{
|
||||
protected $table = 'return_order_child';
|
||||
protected $primaryKey = 'return_order_child_id';
|
||||
protected $allowedFields = ['return_order_child_id','return_order_id','product_id','net_price','qty','discount','tax','amount','created_at','created_by','updated_by','updated_at','isactive','is_selected'];
|
||||
}
|
||||
|
||||
181
app/Views/edit_return_order.php
Normal file
181
app/Views/edit_return_order.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php include('layout/header.php'); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title"><?php echo $page_name?></h4>
|
||||
<div class="page-title-right">
|
||||
<a href="<?= base_url() . "purchase_index"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||
<ol class="breadcrumb m-0">
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"></h4>
|
||||
<form action="<?= base_url() . "add_return_purchase"; ?>" method="post">
|
||||
<input type="hidden" id="purchase_order_id" name="purchase_order_id" value="<?= isset($purchase['purchase_order_id']) ? $purchase['purchase_order_id'] : '' ?>"readonly>
|
||||
<input type="hidden" id="return_order_id" name="return_order_id" value="<?= isset($return_order['return_order_id']) ? $return_order['return_order_id'] : '' ?>"readonly>
|
||||
<h4 class="header-title">Purchase Details :</h4><br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="make" class="col-form-label">Vendor<span class="text-danger">*</span></label>
|
||||
<select class="form-control vendor-select SelExample" name="vendor_id" id="vendor_id">
|
||||
<option value="0">Select Vendor</option>
|
||||
<?php foreach ($vendor as $item): ?>
|
||||
<option value="<?= $item['vendor_id'] ?>" <?= isset($item['vendor_id']) && $vendor_id == $item['vendor_id'] ? 'selected' : '' ?>>
|
||||
<?= $item['vendor_name'] ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_name" class="col-form-label">Contact Person Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="contact_person_name" id="contact_person_name" placeholder="Contact Person Name.."value="<?= isset($purchase['contact_person_name']) ? $purchase['contact_person_name'] : '' ?>" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="contact_person_mobile" class="col-form-label">Contact Person Mobile<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="contact_person_mobile" id="contact_person_mobile" placeholder="Contact Person Mobile" value="<?= isset($purchase['contact_person_mobile']) ? $purchase['contact_person_mobile'] : '' ?>"maxlength="10" minlength="10" onkeypress = "return onlyNumbers(event)" required>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="order_date" class="col-form-label">Order Date</label>
|
||||
<input type="date" class="form-control" name="order_date" id="order_date" value="<?= empty($purchase['order_date']) ? date('Y-m-d') : date('Y-m-d', strtotime($purchase['order_date'])) ?>" readonly>
|
||||
</div>
|
||||
<?php if (!empty($purchase["status"])): ?>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="order_date" class="col-form-label">Return Date</label>
|
||||
<input type="date" class="form-control" name="return_date" id="return_date" value="<?= empty($purchase['return_date']) ? date('Y-m-d') : date('Y-m-d', strtotime($purchase['return_date'])) ?>" >
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="inputPassword4" class="col-form-label">Status<span class="text-danger">*</span>
|
||||
<?php if (isset($return_order['status']) && $return_order['status'] !== ''): ?>
|
||||
(<?= $return_order['status'] ?>)
|
||||
<?php endif; ?></label>
|
||||
</label>
|
||||
<select class="form-control status-select" name="purchase_status" required data-toggle="select2">
|
||||
|
||||
<option value="Returned" selected>Returned</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="header-title">Billing Addresss :</h4><br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="billing_address" class="col-form-label">Billing Addresss<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="billing_address" id="billing_address" placeholder="Billing Addresss"value="<?= isset($business['address']) ? $business['address'] : (isset($purchase['billing_address']) ? $purchase['billing_address'] : '') ?>" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3" >
|
||||
<label for="billing_state" class="col-form-label">Billing State</label>
|
||||
<input type="text" class="form-control" name="billing_state" id="billing_state" placeholder="Billing State"value="<?= isset($business['state']) ? $business['state'] : (isset($purchase['billing_state']) ? $purchase['billing_state'] : '') ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="Billing City" class="col-form-label">Billing City<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="billing_city" id="billing_city" placeholder="Billing City"value="<?= isset($business['city']) ? $business['city'] : (isset($purchase['billing_city']) ? $purchase['billing_city'] : '') ?>" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="Billing Postal Code" class="col-form-label">Billing Pin Code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="billing_postal_code" id="billing_postal_code" placeholder="Billing Pin Code"value="<?= isset($business['postal_code']) ? $business['postal_code'] : (isset($purchase['billing_postal_code']) ? $purchase['billing_postal_code'] : '') ?>" required>
|
||||
</div>
|
||||
</div><br>
|
||||
<h4 class="header-title">Shipping Addresss :</h4><br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="shipping_address" class="col-form-label">Shipping Addresss<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="shipping_address" id="shipping_address" placeholder="Shipping Addresss"value="<?= isset($branch['address']) ? $branch['address'] : (isset($purchase['shipping_address']) ? $purchase['shipping_address'] : '') ?>" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3" >
|
||||
<label for="shipping_state" class="col-form-label">Shipping State</label>
|
||||
<input type="text" class="form-control" name="shipping_state" id="shipping_state" placeholder="Shipping State"value="<?= isset($branch['state']) ? $branch['state'] : (isset($purchase['shipping_state']) ? $purchase['shipping_state'] : '') ?>" >
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="Shipping City" class="col-form-label">Shipping City<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="shipping_city" id="shipping_city" placeholder="Shipping City"value="<?= isset($branch['city']) ? $branch['city'] : (isset($purchase['shipping_city']) ? $purchase['shipping_city'] : '') ?>" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="Shipping Postal Code" class="col-form-label">Shipping Pin Code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="shipping_postal_code" id="shipping_postal_code" placeholder="Shipping Pin Code"value="<?= isset($branch['postal_code']) ? $branch['postal_code'] : (isset($purchase['shipping_postal_code']) ? $purchase['shipping_postal_code'] : '') ?>" required>
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
<div class="form-row" id="itemTableContainer">
|
||||
<div class="form-group col-md-12">
|
||||
<h4>Item Details</h4>
|
||||
<br />
|
||||
<table class="table table-bordered" id="itemTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Item Details</th>
|
||||
<th>Qty</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<!-- Dynamically add rows for item details -->
|
||||
<?php if (isset($purchase_product) && !empty($purchase_product)) : ?>
|
||||
<?php foreach ($purchase_product as $purchasechild) :
|
||||
if ($purchasechild['isactive'] == 1) : ?>
|
||||
<tr>
|
||||
<td style="width:10%;">
|
||||
|
||||
<select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" id="" style="width: 249px !important;">
|
||||
<option value="">Select a Product</option>
|
||||
<?php foreach ($product as $value) : ?>
|
||||
<?php if ((int)$value["isactive"] === 1) : ?>
|
||||
<option value="<?= $value["product_id"] ?>" <?= isset($purchasechild['product_id']) && $purchasechild['product_id'] == $value["product_id"] ? 'selected' : '' ?>>
|
||||
<?= $value["product_name"]; ?>
|
||||
</option>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width:5%;">
|
||||
<input type="number" class="form-control item-quantity" name="quantity[]" min="0" value="<?= isset($purchasechild['qty']) ? $purchasechild['qty'] : '' ?>">
|
||||
</td>
|
||||
|
||||
|
||||
<td hidden><input type="hidden" value="<?= isset($purchasechild['purchase_order_child_id']) ? $purchasechild['purchase_order_child_id'] : '' ?>"name="purchase_order_child_id[]"></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<!-- You can add more rows as needed using JavaScript -->
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (empty($purchase["status"])): ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<!-- Show the "Add More Item" button only if invoice_type is not 1 -->
|
||||
<a class="btn" id="addItem">
|
||||
<h4><i class="fa fa-plus" aria-hidden="true"></i> Add Product</h4>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="header-title">Terms & Condition :</h4><br>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="inputPassword4" class="col-form-label">Terms & Condition</label>
|
||||
<textarea class="form-control" name="terms_condition" placeholder="Terms & Condition" >
|
||||
<?= isset($sales['terms_condition']) ? $sales['terms_condition'] : 'Please check the products properly before purchase. Products once sold cannot be returned.' ?>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!isset($purchase['status']) || $purchase['status'] !== 'Released') : ?>
|
||||
<button type="submit" id="editaddbutton"class="btn btn-primary">Submit</button>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include('layout/footer.php'); ?>
|
||||
@ -163,3 +163,4 @@
|
||||
|
||||
|
||||
<?php include('layout/footer.php'); ?>
|
||||
|
||||
|
||||
@ -62,12 +62,21 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($purchase as $value) : ?>
|
||||
<tr>
|
||||
|
||||
|
||||
<!-- Call the model method -->
|
||||
|
||||
|
||||
<td><?= $value['order_number']; ?></td>
|
||||
<td></td>
|
||||
<td><?= $value['order_date']; ?></td>
|
||||
<td><?= $value['contact_person_name']; ?><br>
|
||||
<?= $value['contact_person_mobile']; ?>
|
||||
</td>
|
||||
<td></td>
|
||||
<td><?= $value['status']; ?></td>
|
||||
<td>
|
||||
<a href="<?= "edit_return_order/" . $value['return_order_id']; ?>" class="edit-button" title="Return"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -135,7 +135,7 @@
|
||||
<?php foreach ($purchase_product as $purchasechild) :
|
||||
if ($purchasechild['isactive'] == 1) : ?>
|
||||
<tr>
|
||||
<td style="width:10%;">
|
||||
<td style="width:10%;">
|
||||
|
||||
<select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" id="" style="width: 249px !important;">
|
||||
<option value="">Select a Product</option>
|
||||
@ -152,7 +152,7 @@
|
||||
<input type="number" class="form-control item-quantity" name="quantity[]" min="0" value="<?= isset($purchasechild['qty']) ? $purchasechild['qty'] : '' ?>">
|
||||
</td>
|
||||
<td style="width:7%;">
|
||||
<input type="checkbox" class="form-control-check-input" name="return_selected_items[]" value="1">
|
||||
<input type="checkbox" class="form-control-check-input" name="return_selected_items[]" value="<?= $purchasechild['product_id'] ?>">
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user