mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-03 05:12:50 -04:00
Fix locale support to Giftcard with decimals (#1694)
This commit is contained in:
@@ -49,7 +49,7 @@ class Giftcards extends Secure_Controller
|
||||
|
||||
echo json_encode($suggestions);
|
||||
}
|
||||
|
||||
|
||||
public function suggest_search()
|
||||
{
|
||||
$suggestions = $this->xss_clean($this->Giftcard->get_search_suggestions($this->input->post('term')));
|
||||
@@ -86,7 +86,7 @@ class Giftcards extends Secure_Controller
|
||||
|
||||
$this->load->view("giftcards/form", $data);
|
||||
}
|
||||
|
||||
|
||||
public function save($giftcard_id = -1)
|
||||
{
|
||||
$giftcard_number = $this->input->post('giftcard_number');
|
||||
@@ -106,7 +106,7 @@ class Giftcards extends Secure_Controller
|
||||
if($this->Giftcard->save($giftcard_data, $giftcard_id))
|
||||
{
|
||||
$giftcard_data = $this->xss_clean($giftcard_data);
|
||||
|
||||
|
||||
//New giftcard
|
||||
if($giftcard_id == -1)
|
||||
{
|
||||
@@ -130,7 +130,12 @@ class Giftcards extends Secure_Controller
|
||||
|
||||
public function ajax_check_number_giftcard()
|
||||
{
|
||||
$parsed_value = parse_decimals($this->input->post('giftcard_amount'));
|
||||
$value = $this->input->post('giftcard_amount');
|
||||
$parsed_value = parse_decimals($value);
|
||||
if(strcmp(strval($parsed_value), strval($value)) != 0)
|
||||
{
|
||||
$parsed_value = FALSE;
|
||||
}
|
||||
echo json_encode(array('success' => !empty($parsed_value), 'giftcard_amount' => $parsed_value));
|
||||
}
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@ $(document).ready(function()
|
||||
'thousands_separator': $("#thousands_separator").is(":checked")
|
||||
}),
|
||||
dataFilter: function(data) {
|
||||
setup_csrf_token();
|
||||
var response = JSON.parse(data);
|
||||
$("#number_locale_example").text(response.number_locale_example);
|
||||
$("#currency_symbol").val(response.currency_symbol);
|
||||
|
||||
@@ -106,7 +106,7 @@ $(document).ready(function()
|
||||
},
|
||||
rules:
|
||||
{
|
||||
<?php if ($this->config->item('giftcard_number') == "series") { ?>
|
||||
<?php if($this->config->item('giftcard_number') == "series") { ?>
|
||||
giftcard_number:
|
||||
{
|
||||
required: true,
|
||||
@@ -120,12 +120,11 @@ $(document).ready(function()
|
||||
{
|
||||
url: "<?php echo site_url($controller_name . '/ajax_check_number_giftcard')?>",
|
||||
type: 'post',
|
||||
data: $.extend(csrf_form_base(),
|
||||
{
|
||||
data: $.extend(csrf_form_base(), {
|
||||
'amount': $("#giftcard_amount").val()
|
||||
}),
|
||||
dataFilter: function(data)
|
||||
{
|
||||
dataFilter: function(data) {
|
||||
setup_csrf_token();
|
||||
var response = JSON.parse(data);
|
||||
$("#giftcard_amount").text(response.value);
|
||||
return response.success;
|
||||
|
||||
Reference in New Issue
Block a user