mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-02-18 14:48:42 -05:00
Use POST for delete supplier & customer (#3336)
This commit is contained in:
@@ -133,7 +133,7 @@ if (isset($success))
|
||||
?>
|
||||
<?php echo form_open($controller_name."/edit_item/$line", array('class'=>'form-horizontal', 'id'=>'cart_'.$line)); ?>
|
||||
<tr>
|
||||
<td><?php echo anchor($controller_name."/delete_item/$line", '<span class="glyphicon glyphicon-trash"></span>');?></td>
|
||||
<td><span data-item-id="<?php echo $line;?>" class="delete_item_button"><span class="glyphicon glyphicon-trash"></span></span></td>
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td style="align:center;">
|
||||
<?php echo $item['name'] . ' '. implode(' ', array($item['attribute_values'], $item['attribute_dtvalues'])); ?><br /> <?php echo '[' . to_quantity_decimals($item['in_stock']) . ' in ' . $item['stock_name'] . ']'; ?>
|
||||
@@ -276,8 +276,10 @@ if (isset($success))
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php echo anchor($controller_name."/remove_supplier", '<span class="glyphicon glyphicon-remove"> </span>' . $this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier'),
|
||||
array('class'=>'btn btn-danger btn-sm', 'id'=>'remove_supplier_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier'))); ?>
|
||||
<button class="btn btn-danger btn-sm" id="remove_supplier_button" title="<?php echo $this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier')?>">
|
||||
<span class="glyphicon glyphicon-remove"> </span><?php echo $this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier') ?>
|
||||
</button>
|
||||
|
||||
<?php
|
||||
}
|
||||
else
|
||||
@@ -402,6 +404,20 @@ if (isset($success))
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
const redirect = function() {
|
||||
window.location.href = "<?php echo site_url('receivings'); ?>";
|
||||
};
|
||||
|
||||
$("#remove_supplier_button").click(function()
|
||||
{
|
||||
$.post("<?php echo site_url('receivings/remove_supplier'); ?>", redirect);
|
||||
});
|
||||
|
||||
$(".delete_item_button").click(function() {
|
||||
const item_id = $(this).data('item-id');
|
||||
$.post("<?php echo site_url('receivings/delete_item/'); ?>" + item_id, redirect);
|
||||
});
|
||||
|
||||
$("#item").autocomplete(
|
||||
{
|
||||
source: '<?php echo site_url($controller_name."/stock_item_search"); ?>',
|
||||
|
||||
@@ -136,8 +136,8 @@ if(isset($success))
|
||||
<?php echo form_open($controller_name."/edit_item/$line", array('class'=>'form-horizontal', 'id'=>'cart_'.$line)); ?>
|
||||
<tr>
|
||||
<td>
|
||||
<span data-item-id="<?php echo $line; ?>" class="delete_item_button"><span class="glyphicon glyphicon-trash"></span></span>
|
||||
<?php
|
||||
echo anchor($controller_name . "/delete_item/$line", '<span class="glyphicon glyphicon-trash"></span>');
|
||||
echo form_hidden('location', $item['item_location']);
|
||||
echo form_input(array('type'=>'hidden', 'name'=>'item_id', 'value'=>$item['item_id']));
|
||||
?>
|
||||
@@ -382,8 +382,10 @@ if(isset($success))
|
||||
?>
|
||||
</table>
|
||||
|
||||
<?php echo anchor($controller_name."/remove_customer", '<span class="glyphicon glyphicon-remove"> </span>' . $this->lang->line('common_remove').' '.$this->lang->line('customers_customer'),
|
||||
array('class'=>'btn btn-danger btn-sm', 'id'=>'remove_customer_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('customers_customer'))); ?>
|
||||
<button class="btn btn-danger btn-sm" id="remove_customer_button" title="<?php echo $this->lang->line('common_remove').' '.$this->lang->line('customers_customer')?>">
|
||||
<span class="glyphicon glyphicon-remove"> </span><?php echo $this->lang->line('common_remove').' '.$this->lang->line('customers_customer') ?>
|
||||
</button>
|
||||
|
||||
<?php
|
||||
}
|
||||
else
|
||||
@@ -544,7 +546,7 @@ if(isset($success))
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo anchor($controller_name."/delete_payment/$payment_id", '<span class="glyphicon glyphicon-trash"></span>'); ?></td>
|
||||
<td><span data-payment-id="<?php echo $payment_id; ?>" class="delete_payment_button"><span class="glyphicon glyphicon-trash"></span></span></td>
|
||||
<td><?php echo $payment['payment_type']; ?></td>
|
||||
<td style="text-align: right;"><?php echo to_currency($payment['payment_amount']); ?></td>
|
||||
</tr>
|
||||
@@ -662,6 +664,26 @@ if(isset($success))
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
const redirect = function() {
|
||||
window.location.href = "<?php echo site_url('sales'); ?>";
|
||||
};
|
||||
|
||||
$("#remove_customer_button").click(function()
|
||||
{
|
||||
$.post("<?php echo site_url('sales/remove_customer'); ?>", redirect);
|
||||
});
|
||||
|
||||
$(".delete_item_button").click(function()
|
||||
{
|
||||
const item_id = $(this).data('item-id');
|
||||
$.post("<?php echo site_url('sales/delete_item/'); ?>" + item_id, redirect);
|
||||
});
|
||||
|
||||
$(".delete_payment_button").click(function() {
|
||||
const item_id = $(this).data('payment-id');
|
||||
$.post("<?php echo site_url('sales/delete_payment/'); ?>" + item_id, redirect);
|
||||
});
|
||||
|
||||
$("input[name='item_number']").change(function() {
|
||||
var item_id = $(this).parents('tr').find("input[name='item_id']").val();
|
||||
var item_number = $(this).val();
|
||||
|
||||
Reference in New Issue
Block a user