Skip to content

Commit f253761

Browse files
author
Shaun Kutch
committed
Updated Register styles
Updated config styles
1 parent 30fa490 commit f253761

File tree

13 files changed

+436
-447
lines changed

13 files changed

+436
-447
lines changed

.DS_Store

0 Bytes
Binary file not shown.

application/.DS_Store

6 KB
Binary file not shown.

application/controllers/sales.php

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function __construct()
1010

1111
function index()
1212
{
13-
$this->_reload();
13+
$this->load_register();
1414
}
1515

1616
function item_search()
@@ -46,14 +46,14 @@ function select_customer()
4646
{
4747
$customer_id = $this->input->post("customer");
4848
$this->sale_lib->set_customer($customer_id);
49-
$this->_reload();
49+
$this->load_register_content();
5050
}
5151

5252
function change_mode()
5353
{
5454
$mode = $this->input->post("mode");
5555
$this->sale_lib->set_mode($mode);
56-
$this->_reload();
56+
$this->load_register_content();
5757
}
5858

5959
//Alain Multiple Payments
@@ -69,7 +69,7 @@ function add_payment()
6969
else
7070
$data['error']=$this->lang->line('sales_must_enter_numeric');
7171

72-
$this->_reload($data);
72+
$this->load_register_content($data);
7373
return;
7474
}
7575

@@ -83,7 +83,7 @@ function add_payment()
8383
if ( $cur_giftcard_value <= 0 )
8484
{
8585
$data['error']='Giftcard balance is '.to_currency( $this->Giftcard->get_giftcard_value( $this->input->post('amount_tendered') ) ).' !';
86-
$this->_reload($data);
86+
$this->load_register_content($data);
8787
return;
8888
}
8989
elseif ( ( $this->Giftcard->get_giftcard_value( $this->input->post('amount_tendered') ) - $this->sale_lib->get_total() ) > 0 )
@@ -102,14 +102,14 @@ function add_payment()
102102
$data['error']='Unable to Add Payment! Please try again!';
103103
}
104104

105-
$this->_reload($data);
105+
$this->load_register_content($data);
106106
}
107107

108108
//Alain Multiple Payments
109109
function delete_payment($payment_id)
110110
{
111111
$this->sale_lib->delete_payment($payment_id);
112-
$this->_reload();
112+
$this->load_register_content();
113113
}
114114

115115
function add()
@@ -136,7 +136,7 @@ function add()
136136
{
137137
$data['warning'] = $this->lang->line('sales_quantity_less_than_zero');
138138
}
139-
$this->_reload($data);
139+
$this->load_register_content($data);
140140
}
141141

142142
function edit_item($line)
@@ -168,19 +168,19 @@ function edit_item($line)
168168
}
169169

170170

171-
$this->_reload($data);
171+
$this->load_register_content($data);
172172
}
173173

174174
function delete_item($item_number)
175175
{
176176
$this->sale_lib->delete_item($item_number);
177-
$this->_reload();
177+
$this->load_register_content();
178178
}
179179

180180
function delete_customer()
181181
{
182182
$this->sale_lib->delete_customer();
183-
$this->_reload();
183+
$this->load_register_content();
184184
}
185185

186186
function complete()
@@ -219,7 +219,7 @@ function complete()
219219
if ( ( $this->sale_lib->get_mode() == 'sale' ) && ( ( to_currency_no_money( $data['total'] ) - $total_payments ) > 1e-6 ) )
220220
{
221221
$data['error'] = $this->lang->line('sales_payment_not_cover_total');
222-
$this->_reload($data);
222+
$this->load_register_content($data);
223223
return false;
224224
}
225225

@@ -318,8 +318,8 @@ function save($sale_id)
318318
echo json_encode(array('success'=>false,'message'=>$this->lang->line('sales_unsuccessfully_updated')));
319319
}
320320
}
321-
322-
function _reload($data=array())
321+
322+
function prepare_data()
323323
{
324324
$person_info = $this->Employee->get_logged_in_employee_info();
325325
$data['cart']=$this->sale_lib->get_cart();
@@ -347,13 +347,26 @@ function _reload($data=array())
347347
$info=$this->Customer->get_info($customer_id);
348348
$data['customer']=$info->first_name.' '.$info->last_name;
349349
}
350+
351+
return $data;
352+
}
353+
354+
function load_register($data=array())
355+
{
356+
$data = $this->prepare_data();
350357
$this->load->view("sales/register",$data);
351358
}
352359

360+
function load_register_content($data=array())
361+
{
362+
$data = $this->prepare_data();
363+
$this->load->view("sales/register_content",$data);
364+
}
365+
353366
function cancel_sale()
354367
{
355368
$this->sale_lib->clear_all();
356-
$this->_reload();
369+
$this->load_register_content();
357370

358371
}
359372

@@ -396,7 +409,7 @@ function suspend()
396409
$data['error_message'] = $this->lang->line('sales_transaction_failed');
397410
}
398411
$this->sale_lib->clear_all();
399-
$this->_reload(array('success' => $this->lang->line('sales_successfully_suspended_sale')));
412+
$this->load_register_content(array('success' => $this->lang->line('sales_successfully_suspended_sale')));
400413
}
401414

402415
function suspended()
@@ -412,7 +425,7 @@ function unsuspend()
412425
$this->sale_lib->clear_all();
413426
$this->sale_lib->copy_entire_suspended_sale($sale_id);
414427
$this->Sale_suspended->delete($sale_id);
415-
$this->_reload();
428+
$this->load_register();
416429
}
417430
}
418431
?>

application/language/english/module_lang.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$lang['module_items']='Items';
2020
$lang['module_items_desc']='Add, Update, Delete, and Search items';
2121

22-
$lang['module_config']='Store Config';
22+
$lang['module_config']='Settings';
2323
$lang['module_config_desc']='Change the store\'s configuration';
2424

2525
$lang['module_receivings']='Receivings';

application/language/english/sales_lang.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
$lang['sales_item_name'] = 'Item Name';
88
$lang['sales_item_number'] = 'Item #';
99
$lang['sales_new_customer'] = 'Add New Customer';
10+
$lang['select_customer'] = 'Select Customer';
11+
$lang['remove_customer'] = 'Remove Customer';
1012
$lang['sales_customer'] = 'Customer';
1113
$lang['sales_no_items_in_cart']='There are no items in the cart';
1214
$lang['sales_total']='Total';
@@ -75,4 +77,7 @@
7577
$lang['sales_unsuspend_and_delete'] = 'Unsuspend and Delete';
7678
$lang['sales_unsuspend'] = 'Unsuspend';
7779
$lang['sales_successfully_suspended_sale'] = 'Your sale has been successfully suspended';
80+
$lang['payments'] = 'Payments';
81+
$lang['totals'] = 'Totals';
82+
$lang['items'] = 'Items';
7883
?>

application/models/appconfig.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ function save($key,$value)
5050
function batch_save($data)
5151
{
5252
$success=true;
53-
53+
var_dump($data);
54+
exit;
5455
//Run these queries as a transaction, we want to make sure we do all or nothing
5556
$this->db->trans_start();
5657
foreach($data as $key=>$value)

application/views/.DS_Store

12 KB
Binary file not shown.

0 commit comments

Comments
 (0)