mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-20 07:14:33 -04:00
Giftcard random number/alpha numeric
This commit is contained in:
commit
0114223e99
26 files changed
+191
-55
No files matched your search
@@ -271,6 +271,7 @@ class Config extends Secure_Controller
|
||||
'custom9_name' => $this->input->post('custom9_name'),
|
||||
'custom10_name' => $this->input->post('custom10_name'),
|
||||
'statistics' => $this->input->post('statistics') != NULL,
|
||||
'giftcard_number' => $this->input->post('giftcard_number'),
|
||||
);
|
||||
|
||||
$result = $this->Appconfig->batch_save($batch_save_data);
|
||||
|
||||
@@ -63,10 +63,17 @@ class Giftcards extends Secure_Controller
|
||||
$giftcard_info = $this->Giftcard->get_info($giftcard_id);
|
||||
|
||||
$data['selected_person_name'] = ($giftcard_id > 0 && isset($giftcard_info->person_id)) ? $giftcard_info->first_name . ' ' . $giftcard_info->last_name : '';
|
||||
$data['selected_person_id'] = $giftcard_info->person_id;
|
||||
$data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1;
|
||||
$data['giftcard_id'] = $giftcard_id;
|
||||
$data['giftcard_value'] = $giftcard_info->value;
|
||||
$data['selected_person_id'] = $giftcard_info->person_id;
|
||||
if($this->config->item('giftcard_number') == "random")
|
||||
{
|
||||
$data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1;
|
||||
}
|
||||
$data['giftcard_id'] = $giftcard_id;
|
||||
$data['giftcard_value'] = $giftcard_info->value;
|
||||
|
||||
$data = $this->xss_clean($data);
|
||||
|
||||
@@ -75,9 +82,16 @@ class Giftcards extends Secure_Controller
|
||||
|
||||
public function save($giftcard_id = -1)
|
||||
{
|
||||
$giftcard_number = $this->input->post('giftcard_number');
|
||||
|
||||
if($giftcard_id == -1 && trim($giftcard_number) == '')
|
||||
{
|
||||
$giftcard_number = $this->Giftcard->generate_unique_giftcard_name($this->input->post('value'));
|
||||
}
|
||||
|
||||
$giftcard_data = array(
|
||||
'record_time' => date('Y-m-d H:i:s'),
|
||||
'giftcard_number' => $this->input->post('giftcard_number'),
|
||||
'giftcard_number' => $giftcard_number,
|
||||
'value' => parse_decimals($this->input->post('value')),
|
||||
'person_id' => $this->input->post('person_id') == '' ? NULL : $this->input->post('person_id')
|
||||
);
|
||||
@@ -89,12 +103,12 @@ class Giftcards extends Secure_Controller
|
||||
//New giftcard
|
||||
if($giftcard_id == -1)
|
||||
{
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_adding').' '.
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_adding') . ' ' .
|
||||
$giftcard_data['giftcard_number'], 'id' => $giftcard_data['giftcard_id']));
|
||||
}
|
||||
else //Existing giftcard
|
||||
{
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_updating').' '.
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_updating') . ' ' .
|
||||
$giftcard_data['giftcard_number'], 'id' => $giftcard_id));
|
||||
}
|
||||
}
|
||||
@@ -102,7 +116,7 @@ class Giftcards extends Secure_Controller
|
||||
{
|
||||
$giftcard_data = $this->xss_clean($giftcard_data);
|
||||
|
||||
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('giftcards_error_adding_updating').' '.
|
||||
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('giftcards_error_adding_updating') . ' ' .
|
||||
$giftcard_data['giftcard_number'], 'id' => -1));
|
||||
}
|
||||
}
|
||||
@@ -113,7 +127,7 @@ class Giftcards extends Secure_Controller
|
||||
|
||||
if($this->Giftcard->delete_list($giftcards_to_delete))
|
||||
{
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_deleted').' '.
|
||||
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_deleted') . ' ' .
|
||||
count($giftcards_to_delete).' '.$this->lang->line('giftcards_one_or_multiple')));
|
||||
}
|
||||
else
|
||||
|
||||
@@ -195,10 +195,16 @@ class Sales extends Secure_Controller
|
||||
public function add_payment()
|
||||
{
|
||||
$data = array();
|
||||
$this->form_validation->set_rules('amount_tendered', 'lang:sales_amount_tendered', 'trim|required|callback_numeric');
|
||||
|
||||
$payment_type = $this->input->post('payment_type');
|
||||
|
||||
if($payment_type != $this->lang->line('sales_giftcard'))
|
||||
{
|
||||
$this->form_validation->set_rules('amount_tendered', 'lang:sales_amount_tendered', 'trim|required|callback_numeric');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->form_validation->set_rules('amount_tendered', 'lang:sales_amount_tendered', 'trim|required');
|
||||
}
|
||||
if($this->form_validation->run() == FALSE)
|
||||
{
|
||||
if($payment_type == $this->lang->line('sales_giftcard'))
|
||||
@@ -242,7 +248,7 @@ class Sales extends Secure_Controller
|
||||
{
|
||||
$customer_id = $this->sale_lib->get_customer();
|
||||
$package_id = $this->Customer->get_info($customer_id)->package_id;
|
||||
if(isset($package_id) && $package_id!=NULL)
|
||||
if(!empty($package_id))
|
||||
{
|
||||
$package_name = $this->Customer_rewards->get_name($package_id);
|
||||
$points = $this->Customer->get_info($customer_id)->points;
|
||||
@@ -255,7 +261,7 @@ class Sales extends Secure_Controller
|
||||
|
||||
if(($cur_rewards_value - $current_payments_with_rewards) <= 0)
|
||||
{
|
||||
$data['error'] = $this->lang->line('rewards_remaining_balance'). to_currency($cur_rewards_value);
|
||||
$data['error'] = $this->lang->line('rewards_remaining_balance') . to_currency($cur_rewards_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -269,7 +275,6 @@ class Sales extends Secure_Controller
|
||||
$this->sale_lib->add_payment($payment_type, $amount_tendered);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "فاصل الاف";
|
||||
$lang["config_timezone"] = "المنطقة الزمنية";
|
||||
$lang["config_top"] = "علوى";
|
||||
$lang["config_website"] = "موقع الشركة";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Tausendertrennzeichen";
|
||||
$lang["config_timezone"] = "Zeitzone";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "Website";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Tausendertrennzeichen";
|
||||
$lang["config_timezone"] = "Zeitzone";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "Website";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
|
||||
$lang["config_timezone"] = "Timezone";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "Website";
|
||||
$lang["config_giftcard_number"] = "Gift Card Number";
|
||||
$lang["config_giftcard_series"] = "Generate in Series";
|
||||
$lang["config_giftcard_random"] = "Generate Random";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Separador de miles";
|
||||
$lang["config_timezone"] = "Zona Horaria";
|
||||
$lang["config_top"] = "Arriba";
|
||||
$lang["config_website"] = "Sitio Web";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,4 @@ $lang["config_thousands_separator"] = "Thousands Separator";
|
||||
$lang["config_timezone"] = "Fuseau Horaire";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "Site-web";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Razdjelnik za tisućice";
|
||||
$lang["config_timezone"] = "Vremenska zona";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "web strana";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Ezres elválasztó";
|
||||
$lang["config_timezone"] = "Időzóna";
|
||||
$lang["config_top"] = "Felül";
|
||||
$lang["config_website"] = "Weboldal";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Pemisah Ribuan";
|
||||
$lang["config_timezone"] = "Zona Waktu";
|
||||
$lang["config_top"] = "Atas";
|
||||
$lang["config_website"] = "Situs Perusahaan";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,4 @@ $lang["config_thousands_separator"] = "duizenden Separator";
|
||||
$lang["config_timezone"] = "Tijdzone";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "Website";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
@@ -219,3 +219,5 @@ $lang["config_thousands_separator"] = "Separador de milhar";
|
||||
$lang["config_timezone"] = "Fuso horário";
|
||||
$lang["config_top"] = "Topo";
|
||||
$lang["config_website"] = "Site da internet";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
|
||||
$lang["config_timezone"] = "Часовой пояс";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "Веб-сайт";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "";
|
||||
$lang["config_timezone"] = "";
|
||||
$lang["config_top"] = "";
|
||||
$lang["config_website"] = "";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "ตัวคั่นหลักพั
|
||||
$lang["config_timezone"] = "โซนเวลา";
|
||||
$lang["config_top"] = "ด้านบน";
|
||||
$lang["config_website"] = "เว็บไซต์";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
|
||||
$lang["config_timezone"] = "Saat Dilimi";
|
||||
$lang["config_top"] = "Üst";
|
||||
$lang["config_website"] = "Website";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -219,3 +219,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
|
||||
$lang["config_timezone"] = "時區";
|
||||
$lang["config_top"] = "Top";
|
||||
$lang["config_website"] = "網站";
|
||||
$lang["config_giftcard_number"] = "";
|
||||
$lang["config_giftcard_series"] = "";
|
||||
$lang["config_giftcard_random"] = "";
|
||||
@@ -19,8 +19,10 @@ class Giftcard extends CI_Model
|
||||
public function get_max_number()
|
||||
{
|
||||
$this->db->select_max('giftcard_number');
|
||||
$this->db->from('giftcards');
|
||||
$this->db->where('giftcard_number REGEXP', "'^[0-9]+$'", FALSE);
|
||||
|
||||
return $this->db->get('giftcards')->row();
|
||||
return $this->db->get()->row();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -256,5 +258,34 @@ class Giftcard extends CI_Model
|
||||
$this->db->where('giftcard_number', $giftcard_number);
|
||||
$this->db->update('giftcards', array('value' => $value));
|
||||
}
|
||||
|
||||
/*
|
||||
Determines if a given giftcard_name esists
|
||||
*/
|
||||
public function exists_gitcard_name($giftcard_name)
|
||||
{
|
||||
$giftcard_name = strtoupper($giftcard_name);
|
||||
$this->db->from('giftcards');
|
||||
$this->db->where('giftcard_number', $giftcard_name);
|
||||
$this->db->where('deleted', 0);
|
||||
|
||||
return ($this->db->get()->num_rows() == 1);
|
||||
}
|
||||
|
||||
/*
|
||||
Generate unique gift card name/number
|
||||
*/
|
||||
public function generate_unique_giftcard_name($value)
|
||||
{
|
||||
$value = str_replace('.', 'DE', $value);
|
||||
$random = bin2hex(openssl_random_pseudo_bytes(3));
|
||||
$giftcard_name = (string)$random . '-' . $value;
|
||||
if($this->exists_gitcard_name($giftcard_name))
|
||||
{
|
||||
$this->generate_unique_giftcard_name($value);
|
||||
}
|
||||
|
||||
return strtoupper($giftcard_name);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -60,29 +60,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_customer_sales_tax_support'), 'customer_sales_tax_support', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_checkbox(array(
|
||||
'name' => 'customer_sales_tax_support',
|
||||
'id' => 'customer_sales_tax_support',
|
||||
'value' => 'customer_sales_tax_support',
|
||||
'checked'=>$this->config->item('customer_sales_tax_support'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_default_origin_tax_code'), 'default_origin_tax_code', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_input(array(
|
||||
'name' => 'default_origin_tax_code',
|
||||
'id' => 'default_origin_tax_code',
|
||||
'class' => 'form-control input-sm text-uppercase',
|
||||
'value'=>$this->config->item('default_origin_tax_code'))); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_default_sales_discount'), 'default_sales_discount', array('class' => 'control-label col-xs-2 required')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<div class="input-group">
|
||||
@@ -147,6 +147,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_giftcard_number'), 'giftcard_number', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name' => 'giftcard_number',
|
||||
'value' => 'series',
|
||||
'checked'=>$this->config->item('giftcard_number') === "series")); ?>
|
||||
<?php echo $this->lang->line('config_giftcard_series'); ?>
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<?php echo form_radio(array(
|
||||
'name' => 'giftcard_number',
|
||||
'value' => 'random',
|
||||
'checked'=>$this->config->item('giftcard_number') === "random")); ?>
|
||||
<?php echo $this->lang->line('config_giftcard_random'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_statistics'), 'statistics', array('class' => 'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
@@ -303,24 +323,24 @@ $(document).ready(function()
|
||||
|
||||
rules:
|
||||
{
|
||||
default_tax_1_rate:
|
||||
{
|
||||
default_tax_1_rate:
|
||||
{
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
},
|
||||
default_tax2_rate:
|
||||
{
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
lines_per_page:
|
||||
{
|
||||
required: true,
|
||||
lines_per_page:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
default_sales_discount:
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
default_sales_discount:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
messages:
|
||||
|
||||
@@ -17,8 +17,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$class = '';
|
||||
if($this->config->item('giftcard_number') == 'series')
|
||||
{
|
||||
$class = ' required';
|
||||
}
|
||||
?>
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('giftcards_giftcard_number'), 'name', array('class'=>'required control-label col-xs-3')); ?>
|
||||
<?php echo form_label($this->lang->line('giftcards_giftcard_number'), 'name', array('class'=>'control-label col-xs-3'.$class)); ?>
|
||||
<div class='col-xs-4'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'giftcard_number',
|
||||
@@ -69,13 +76,13 @@ $(document).ready(function()
|
||||
|
||||
var autocompleter = $("#person_name").autocomplete({
|
||||
source: '<?php echo site_url("customers/suggest"); ?>',
|
||||
minChars: 0,
|
||||
delay: 15,
|
||||
cacheLength: 1,
|
||||
minChars: 0,
|
||||
delay: 15,
|
||||
cacheLength: 1,
|
||||
appendTo: '.modal-content',
|
||||
select: fill_value,
|
||||
focus: fill_value
|
||||
});
|
||||
});
|
||||
|
||||
// declare submitHandler as an object.. will be reused
|
||||
var submit_form = function() {
|
||||
@@ -100,11 +107,13 @@ $(document).ready(function()
|
||||
},
|
||||
rules:
|
||||
{
|
||||
<?php if($this->config->item('giftcard_number') == "series"){ ?>
|
||||
giftcard_number:
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
{
|
||||
required:true,
|
||||
number:true
|
||||
},
|
||||
<?php } ?>
|
||||
value:
|
||||
{
|
||||
required:true,
|
||||
@@ -113,11 +122,13 @@ $(document).ready(function()
|
||||
},
|
||||
messages:
|
||||
{
|
||||
<?php if($this->config->item('giftcard_number') == "series"){ ?>
|
||||
giftcard_number:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('giftcards_number_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('giftcards_number'); ?>"
|
||||
},
|
||||
{
|
||||
required:"<?php echo $this->lang->line('giftcards_number_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('giftcards_number'); ?>"
|
||||
},
|
||||
<?php } ?>
|
||||
value:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('giftcards_value_required'); ?>",
|
||||
@@ -126,4 +137,4 @@ $(document).ready(function()
|
||||
}
|
||||
}, form_support.error));
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@@ -216,3 +216,11 @@ ALTER TABLE `ospos_people`
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('financial_year','1');
|
||||
|
||||
-- alter giftcard field number to be varchar
|
||||
|
||||
ALTER TABLE `ospos_giftcards` CHANGE `giftcard_number` `giftcard_number` VARCHAR(255) NULL;
|
||||
|
||||
-- add support for select between gitcard number series or random
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('giftcard_number', 'series');
|
||||
@@ -94,7 +94,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('customer_reward_enable',''),
|
||||
('default_origin_tax_code', ''),
|
||||
('cash_decimals', '2'),
|
||||
('financial_year','1');
|
||||
('financial_year','1'),
|
||||
('giftcard_number', 'series');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -154,7 +155,7 @@ INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `
|
||||
CREATE TABLE `ospos_giftcards` (
|
||||
`record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`giftcard_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`giftcard_number` int(10) NOT NULL,
|
||||
`giftcard_number` VARCHAR(255) NULL,
|
||||
`value` decimal(15,2) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`person_id` INT(10) DEFAULT NULL,
|
||||
|
||||
@@ -94,7 +94,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('customer_reward_enable',''),
|
||||
('default_origin_tax_code', ''),
|
||||
('cash_decimals', '2'),
|
||||
('financial_year','1');
|
||||
('financial_year','1'),
|
||||
('giftcard_number', 'series');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -154,7 +155,7 @@ INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `
|
||||
CREATE TABLE `ospos_giftcards` (
|
||||
`record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`giftcard_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`giftcard_number` int(10) NOT NULL,
|
||||
`giftcard_number` VARCHAR(255) NULL,
|
||||
`value` decimal(15,2) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`person_id` INT(10) DEFAULT NULL,
|
||||
|
||||
+3
-2
@@ -94,7 +94,8 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('customer_reward_enable',''),
|
||||
('default_origin_tax_code', ''),
|
||||
('cash_decimals', '2'),
|
||||
('financial_year','1');
|
||||
('financial_year','1'),
|
||||
('giftcard_number', 'series');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
@@ -154,7 +155,7 @@ INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`, `
|
||||
CREATE TABLE `ospos_giftcards` (
|
||||
`record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`giftcard_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`giftcard_number` int(10) NOT NULL,
|
||||
`giftcard_number` VARCHAR(255) NULL,
|
||||
`value` decimal(15,2) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`person_id` INT(10) DEFAULT NULL,
|
||||
|
||||
Reference in new issue
Block a user