334 lines
10 KiB
PHP
334 lines
10 KiB
PHP
<?php include('techsyn_header.php'); ?>
|
|
<!-- Main Content Container for sid bar d body-->
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) {}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
|
|
<li class="#">Inventory Management</li>
|
|
<li class="active">Procurement</li>
|
|
</ul>
|
|
</div>
|
|
<!-- End of breadcrumb -->
|
|
|
|
|
|
<div class="page-content">
|
|
|
|
<form name="f1" method="post" action="" id="flex_form_procurement">
|
|
<div id="flex1" style="width:100%">
|
|
</div>
|
|
<input type="hidden" name="flex_procurement_id" id="flex_procurement_id" />
|
|
<input type="hidden" name="flex_item_id" id="flex_item_id">
|
|
</form>
|
|
<form name="export_form" method="post" id="export_form" action="">
|
|
|
|
<input type="hidden" name="pdf_action" id="pdf_action" value="pdf_procurement.php" />
|
|
<input type="hidden" name="excel_action" id="excel_action" value="excel_procurement.php" />
|
|
</form>
|
|
</div>
|
|
|
|
|
|
|
|
</div><!-- /.page-content -->
|
|
</div>
|
|
</div><!-- /.main-content -->
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var w = screen.width * .90;
|
|
var h = 0;
|
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
|
$("#flex1").flexigrid({
|
|
url: 'procurement_script.php',
|
|
dataType: 'json',
|
|
colModel: [{
|
|
display: '',
|
|
name: '',
|
|
width: w * .08,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Sr',
|
|
name: 'count',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Procurement No',
|
|
name: 'procurement_ref_no',
|
|
width: w * .10,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Invoice No',
|
|
name: 'invoice_no',
|
|
width: w * .10,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Invoice Date',
|
|
name: 'procurement_date',
|
|
width: w * .10,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Item Name',
|
|
name: 'procurement_id',
|
|
width: w * .25,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Quantity',
|
|
name: 'procurement_id',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Batch',
|
|
name: 'procurement_id',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Per Unit Price',
|
|
name: 'per_unit_price',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'GST(%)',
|
|
name: 'tax',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
}, {
|
|
display: 'Net Value',
|
|
name: 'procurement_id',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Expiry Date',
|
|
name: 'procurement_date',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Item Remarks',
|
|
name: 'remarks',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
|
|
|
|
],
|
|
buttons: [
|
|
|
|
{
|
|
name: 'Add',
|
|
bclass: 'add',
|
|
onpress: add
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'Add Indent Item',
|
|
bclass: 'add',
|
|
onpress: addIndent
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'PDF',
|
|
bclass: 'print',
|
|
onpress: pdf
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'Excel',
|
|
bclass: 'print_excel',
|
|
onpress: excel
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'Download Template',
|
|
bclass: 'print_excel',
|
|
onpress: download_template
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'Upload Excel',
|
|
bclass: 'print_excel',
|
|
onpress: upload_excel
|
|
},
|
|
{
|
|
separator: true
|
|
}
|
|
|
|
],
|
|
searchitems: [
|
|
|
|
// {display: 'Parent ID', name: 'parent_id', isdefault: true},
|
|
{
|
|
display: 'Procurement Refno',
|
|
name: 'procurement_refno'
|
|
},
|
|
{
|
|
display: 'Procurement_date(d-m-y)',
|
|
name: 'procurement_date'
|
|
},
|
|
// {
|
|
// display: 'Item ',
|
|
// name: 'item'
|
|
// },
|
|
// {
|
|
// display: 'Expiry Date ',
|
|
// name: 'item'
|
|
// },
|
|
|
|
{
|
|
display: 'procurement Date Between (dd/mm/yyyy-dd/mm/yyyy)',
|
|
name: 'procurement_date_between'
|
|
}, {
|
|
display: 'Item Remarks ',
|
|
name: 'remarks'
|
|
}
|
|
|
|
],
|
|
sortname: "procurement_date",
|
|
sortorder: "desc",
|
|
usepager: true, //pagination
|
|
|
|
useRp: true,
|
|
rp: 50, //records per page
|
|
showTableToggleBtn: false, //toggle button for the whole table
|
|
resizable: true,
|
|
//width: w,
|
|
height: h,
|
|
singleSelect: true
|
|
});
|
|
});
|
|
|
|
|
|
function open_procurement(id, action) {
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
$("#flex_procurement_id").val(id);
|
|
$("#flex_form_procurement").attr('method', 'POST');
|
|
$("#flex_form_procurement").attr('action', 'procurement.php');
|
|
$("#flex_form_procurement").submit();
|
|
}
|
|
|
|
function open_procurementnew(flex_procurement_id, flex_item_id, action) {
|
|
if (action == "V") {
|
|
$("#flex_procurement_id").val(flex_procurement_id);
|
|
$("#flex_item_id").val(flex_item_id);
|
|
$("#flex_form_procurement").attr('method', 'POST');
|
|
$("#flex_form_procurement").attr('action', 'view_procurement.php');
|
|
$("#flex_form_procurement").submit();
|
|
// location.href="view_procurement.php?flex_procurement_id="+flex_procurement_id+"";
|
|
|
|
} else {
|
|
$("#flex_procurement_id").val(flex_procurement_id);
|
|
$("#flex_item_id").val(flex_item_id);
|
|
$("#flex_form_procurement").attr('method', 'POST');
|
|
$("#flex_form_procurement").attr('action', 'procurement.php');
|
|
$("#flex_form_procurement").submit();
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function add() {
|
|
location.href = "procurement.php";
|
|
}
|
|
|
|
function addIndent() {
|
|
location.href = "procurement_indent.php";
|
|
}
|
|
|
|
function pdf() {
|
|
window.open('ajax_pdf.php', 'OPD-Injury List');
|
|
}
|
|
|
|
function excel() {
|
|
window.open('ajax_excel.php', 'OPD-Injury List');
|
|
}
|
|
|
|
|
|
function download_template() {
|
|
window.location = 'download_template.php';
|
|
}
|
|
|
|
function upload_excel() {
|
|
window.location = 'upload_excel_procurment.php';
|
|
}
|
|
|
|
function delete_procurement(procurementId) {
|
|
$("#flex_procurement_id").val(procurementId);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the Procurement?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_procurement.php',
|
|
type: "POST",
|
|
data: $("#flex_form_procurement").serialize(),
|
|
success: function(data) {
|
|
if (data.indexOf("SUCCESS") != -1) {
|
|
BootstrapDialog.alert('Procurement Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting Procurement');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting Procurement');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
</script>
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|