@@ -24,74 +24,74 @@ discard block |
||
24 | 24 | if ( ! defined('BASEPATH')) { |
25 | 25 | exit('No direct script access allowed'); |
26 | 26 | } |
27 | -class invoices_form{ |
|
27 | +class invoices_form { |
|
28 | 28 | function __construct($library_name = '') { |
29 | 29 | $this->CI = & get_instance(); |
30 | 30 | } |
31 | - function build_invoices_list_for_admin(){ |
|
31 | + function build_invoices_list_for_admin() { |
|
32 | 32 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
33 | - $currency_id=$account_info['currency_id']; |
|
34 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
33 | + $currency_id = $account_info['currency_id']; |
|
34 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
35 | 35 | |
36 | 36 | $logintype = $this->CI->session->userdata('logintype'); |
37 | - $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
38 | - $grid_field_arr = json_encode(array( |
|
39 | - array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
40 | - array("Type","130","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
41 | - array("Account","130","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
42 | - array("Generated<br/> Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
43 | - array("From Date","120","from_date","from_date","","get_from_date","","true","center"), |
|
44 | - array("Due Date","130","","","","","","true","center"), |
|
45 | - array("Last <br/>Pay Date","100","","","","","","true","center"), |
|
46 | - array("Amount($currency)","120","id","id","id","get_invoice_total","","true","right"), |
|
37 | + $url = ($logintype == 0 || $logintype == 3) ? "/user/user_invoice_download/" : '/invoices/invoice_main_download/'; |
|
38 | + $grid_field_arr = json_encode(array( |
|
39 | + array("Number", "110", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
40 | + array("Type", "130", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
41 | + array("Account", "130", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
42 | + array("Generated<br/> Date", "140", "invoice_date", "invoice_date", "", "get_invoice_date", "", "true", "center"), |
|
43 | + array("From Date", "120", "from_date", "from_date", "", "get_from_date", "", "true", "center"), |
|
44 | + array("Due Date", "130", "", "", "", "", "", "true", "center"), |
|
45 | + array("Last <br/>Pay Date", "100", "", "", "", "", "", "true", "center"), |
|
46 | + array("Amount($currency)", "120", "id", "id", "id", "get_invoice_total", "", "true", "right"), |
|
47 | 47 | |
48 | - array("Outstanding <br/>Amount($currency)","140","","","","","","true","right"), |
|
48 | + array("Outstanding <br/>Amount($currency)", "140", "", "", "", "", "", "true", "right"), |
|
49 | 49 | // array("Payment", "110", "payment", "", "", ""), |
50 | - array("Action","120","","","",array( |
|
51 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
50 | + array("Action", "120", "", "", "", array( |
|
51 | + "DOWNLOAD"=>array("url"=>$url, "mode"=>"single"), |
|
52 | 52 | // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
53 | 53 | )) |
54 | 54 | )); |
55 | 55 | return $grid_field_arr; |
56 | 56 | } |
57 | - function build_invoices_list_for_customer_admin(){ |
|
57 | + function build_invoices_list_for_customer_admin() { |
|
58 | 58 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
59 | - $currency_id=$account_info['currency_id']; |
|
60 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
59 | + $currency_id = $account_info['currency_id']; |
|
60 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
61 | 61 | |
62 | 62 | $logintype = $this->CI->session->userdata('logintype'); |
63 | - $url= ($logintype==0 ||$logintype==3 ) ? "/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
64 | - $grid_field_arr = json_encode(array( |
|
65 | - array("Number","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
66 | - array("Type","110","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
67 | - array("Generated<br/> Date","120","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
68 | - array("From Date","120","from_date","from_date","","get_from_date","","true","center"), |
|
69 | - array("Due Date","130","","","","","","true","center"), |
|
70 | - array("Last <br/>Pay Date","100","","","","","","true","center"), |
|
71 | - array("Amount($currency)","100","id","id","id","get_invoice_total","","true","right"), |
|
63 | + $url = ($logintype == 0 || $logintype == 3) ? "/user/user_invoice_download/" : '/invoices/invoice_main_download/'; |
|
64 | + $grid_field_arr = json_encode(array( |
|
65 | + array("Number", "110", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
66 | + array("Type", "110", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
67 | + array("Generated<br/> Date", "120", "invoice_date", "invoice_date", "", "get_invoice_date", "", "true", "center"), |
|
68 | + array("From Date", "120", "from_date", "from_date", "", "get_from_date", "", "true", "center"), |
|
69 | + array("Due Date", "130", "", "", "", "", "", "true", "center"), |
|
70 | + array("Last <br/>Pay Date", "100", "", "", "", "", "", "true", "center"), |
|
71 | + array("Amount($currency)", "100", "id", "id", "id", "get_invoice_total", "", "true", "right"), |
|
72 | 72 | |
73 | - array("Outstanding <br/>Amount($currency)","100","","","","","","true","right"), |
|
74 | - array("Action","120","","","",array( |
|
75 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
73 | + array("Outstanding <br/>Amount($currency)", "100", "", "", "", "", "", "true", "right"), |
|
74 | + array("Action", "120", "", "", "", array( |
|
75 | + "DOWNLOAD"=>array("url"=>$url, "mode"=>"single"), |
|
76 | 76 | )) |
77 | 77 | )); |
78 | 78 | return $grid_field_arr; |
79 | 79 | } |
80 | - function build_invoices_list_for_customer(){ |
|
81 | - $url=($this->CI->session->userdata('logintype')==0 )?"/user/user_invoice_download/":'/invoices/invoice_main_download/'; |
|
80 | + function build_invoices_list_for_customer() { |
|
81 | + $url = ($this->CI->session->userdata('logintype') == 0) ? "/user/user_invoice_download/" : '/invoices/invoice_main_download/'; |
|
82 | 82 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
83 | - $grid_field_arr = json_encode(array( |
|
84 | - array("Number","100","id","id,'',type","invoices","build_concat_string","","true","center"), |
|
85 | - array("Account","110","accountid","first_name,last_name,number","accounts","build_concat_string","","true","center"), |
|
86 | - array("Generated Date","140","invoice_date","invoice_date","","get_invoice_date","","true","center"), |
|
87 | - array("From Date","140","from_date","from_date","","get_from_date","","true","center"), |
|
88 | - array("Due Date","150","","","","","","true","center"), |
|
89 | - array("Last Pay Date","150","","","","","","true","center"), |
|
90 | - array("Amount","150","id","id","id","get_invoice_total","","true","center"), |
|
91 | - array("Outstanding Amount","150","","","",""), |
|
83 | + $grid_field_arr = json_encode(array( |
|
84 | + array("Number", "100", "id", "id,'',type", "invoices", "build_concat_string", "", "true", "center"), |
|
85 | + array("Account", "110", "accountid", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
86 | + array("Generated Date", "140", "invoice_date", "invoice_date", "", "get_invoice_date", "", "true", "center"), |
|
87 | + array("From Date", "140", "from_date", "from_date", "", "get_from_date", "", "true", "center"), |
|
88 | + array("Due Date", "150", "", "", "", "", "", "true", "center"), |
|
89 | + array("Last Pay Date", "150", "", "", "", "", "", "true", "center"), |
|
90 | + array("Amount", "150", "id", "id", "id", "get_invoice_total", "", "true", "center"), |
|
91 | + array("Outstanding Amount", "150", "", "", "", ""), |
|
92 | 92 | // array("Payment", "110", "payment", "", "", ""), |
93 | - array("Action","160","","","",array( |
|
94 | - "DOWNLOAD"=>array("url"=>$url,"mode"=>"single"), |
|
93 | + array("Action", "160", "", "", "", array( |
|
94 | + "DOWNLOAD"=>array("url"=>$url, "mode"=>"single"), |
|
95 | 95 | // "VIEW" => array("url" => "invoices/invoice_summary_payment/", "mode" => "popup") |
96 | 96 | )) |
97 | 97 | )); |
@@ -100,89 +100,89 @@ discard block |
||
100 | 100 | function get_invoice_search_form() |
101 | 101 | { |
102 | 102 | $account_data = $this->CI->session->userdata("accountinfo"); |
103 | - $reseller_id=$account_data['type']==1 ? $account_data['id']:0; |
|
104 | - $form['forms'] = array("",array('id'=>"invoice_search")); |
|
103 | + $reseller_id = $account_data['type'] == 1 ? $account_data['id'] : 0; |
|
104 | + $form['forms'] = array("", array('id'=>"invoice_search")); |
|
105 | 105 | $form['Search'] = array( |
106 | - array('Number', 'INPUT', array('name' => 'invoiceid[invoiceid]','','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'id[invoiceid-string]', '', '','', 'search_string_type', ''), |
|
107 | - array('From Date', 'INPUT', array('name' => 'from_date[0]','id'=>'invoice_from_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
108 | - array('To Date', 'INPUT', array('name' => 'to_date[0]','id'=>'invoice_to_date','size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
106 | + array('Number', 'INPUT', array('name' => 'invoiceid[invoiceid]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'id[invoiceid-string]', '', '', '', 'search_string_type', ''), |
|
107 | + array('From Date', 'INPUT', array('name' => 'from_date[0]', 'id'=>'invoice_from_date', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
108 | + array('To Date', 'INPUT', array('name' => 'to_date[0]', 'id'=>'invoice_to_date', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '', 'from_date[from_date-date]'), |
|
109 | 109 | |
110 | 110 | array('Amount', 'INPUT', array('name' => 'amount[amount]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'amount[amount-string]', '', '', '', 'search_string_type', ''), |
111 | - array('Generated Date', 'INPUT', array('name' => 'invoice_date[0]','','size' => '20', 'class' => "text field",'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'), |
|
111 | + array('Generated Date', 'INPUT', array('name' => 'invoice_date[0]', '', 'size' => '20', 'class' => "text field", 'id'=>'invoice_date'), '', 'tOOL TIP', '', 'invoice_date[invoice_date-date]'), |
|
112 | 112 | array('Invoice', 'deleted', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_invoice_details'), |
113 | - array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id,"type"=>"GLOBAL")), |
|
114 | - array('', 'HIDDEN', 'ajax_search','1', '', '', ''), |
|
115 | - array('', 'HIDDEN', 'advance_search','1', '', '', '')); |
|
113 | + array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => $reseller_id, "type"=>"GLOBAL")), |
|
114 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
115 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '')); |
|
116 | 116 | |
117 | - $form['button_search'] = array('name' => 'action', 'id'=>"invoice_search_btn",'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
118 | - $form['button_reset'] = array('name' => 'action','id'=>"id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
117 | + $form['button_search'] = array('name' => 'action', 'id'=>"invoice_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
118 | + $form['button_reset'] = array('name' => 'action', 'id'=>"id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
119 | 119 | |
120 | 120 | return $form; |
121 | 121 | } |
122 | 122 | |
123 | - function build_grid_buttons(){ |
|
123 | + function build_grid_buttons() { |
|
124 | 124 | $buttons_json = json_encode(array( |
125 | 125 | )); |
126 | 126 | return $buttons_json; |
127 | 127 | } |
128 | - function get_invoiceconf_form_fields($invoiceconf = '0'){ |
|
129 | - if(!empty($invoiceconf)){ |
|
130 | - if($invoiceconf['logo'] != ''){ |
|
131 | - $logo=$invoiceconf['file']; |
|
132 | - }else{ |
|
133 | - $logo=$invoiceconf['logo']; |
|
128 | + function get_invoiceconf_form_fields($invoiceconf = '0') { |
|
129 | + if ( ! empty($invoiceconf)) { |
|
130 | + if ($invoiceconf['logo'] != '') { |
|
131 | + $logo = $invoiceconf['file']; |
|
132 | + } else { |
|
133 | + $logo = $invoiceconf['logo']; |
|
134 | 134 | } |
135 | - $accountid=$invoiceconf['accountid']; |
|
136 | - if($logo != ''){ |
|
137 | - $file_name= base_url()."upload/$logo"; |
|
138 | - $image_path= array('Existing Image', 'IMAGE', array('type'=>'image','name' => 'image' ,'style'=>'width:100%;margin-top:20px;','src'=> $file_name), '', 'tOOL TIP', ''); |
|
139 | - $delete_logo=array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit','style'=>'margin-top:20px;','name' => 'button','id'=>'logo_delete','size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
140 | - }else{ |
|
141 | - $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ,'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
|
142 | - $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'ankit','style'=>'margin-top:0px;','name' => 'button','id'=>'logo_delete','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
135 | + $accountid = $invoiceconf['accountid']; |
|
136 | + if ($logo != '') { |
|
137 | + $file_name = base_url()."upload/$logo"; |
|
138 | + $image_path = array('Existing Image', 'IMAGE', array('type'=>'image', 'name' => 'image', 'style'=>'width:100%;margin-top:20px;', 'src'=> $file_name), '', 'tOOL TIP', ''); |
|
139 | + $delete_logo = array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit', 'style'=>'margin-top:20px;', 'name' => 'button', 'id'=>'logo_delete', 'size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
140 | + } else { |
|
141 | + $image_path = array('Existing Image', 'HIDDEN', array('type'=>'', 'name' => '', 'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
|
142 | + $delete_logo = array('Delete logo', 'HIDDEN', array('value'=>'ankit', 'style'=>'margin-top:0px;', 'name' => 'button', 'id'=>'logo_delete', 'size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
143 | 143 | // $image_path=array(); |
144 | 144 | } |
145 | 145 | |
146 | - }else{ |
|
146 | + } else { |
|
147 | 147 | $logo = ''; |
148 | 148 | $file_name = ''; |
149 | - $accountid=0; |
|
150 | - $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ), '', 'tOOL TIP', ''); |
|
151 | - $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'','style'=>'margin-top:0px;','name' => 'button','onclick'=>'return image_delete('.$accountid.')','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
149 | + $accountid = 0; |
|
150 | + $image_path = array('Existing Image', 'HIDDEN', array('type'=>'', 'name' => ''), '', 'tOOL TIP', ''); |
|
151 | + $delete_logo = array('Delete logo', 'HIDDEN', array('value'=>'', 'style'=>'margin-top:0px;', 'name' => 'button', 'onclick'=>'return image_delete('.$accountid.')', 'size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
|
152 | 152 | //$image_path=array(); |
153 | 153 | |
154 | 154 | |
155 | 155 | } |
156 | - $form['forms'] = array(base_url() . 'invoices/invoice_conf/',array('id'=>'invoice_conf_form','method'=>'POST','name'=>'invoice_conf_form','enctype'=>'multipart/form-data')); |
|
156 | + $form['forms'] = array(base_url().'invoices/invoice_conf/', array('id'=>'invoice_conf_form', 'method'=>'POST', 'name'=>'invoice_conf_form', 'enctype'=>'multipart/form-data')); |
|
157 | 157 | $form['Configuration '] = array( |
158 | - array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
159 | - array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
158 | + array('', 'HIDDEN', array('name'=>'id'), '', '', '', ''), |
|
159 | + array('', 'HIDDEN', array('name'=>'accountid'), '', '', '', ''), |
|
160 | 160 | // array('', 'HIDDEN', array('name' => 'start_name','value' => '1'), '', '', ''), |
161 | - array('Company name', 'INPUT', array('name' => 'company_name','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
162 | - array('Address', 'INPUT', array('name' => 'address','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
163 | - array('City', 'INPUT', array('name' => 'city','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
164 | - array('Province', 'INPUT', array('name' => 'province','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
165 | - array('Country', 'INPUT', array('name' => 'country','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
166 | - array('Zipcode', 'INPUT', array('name' => 'zipcode','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
167 | - array('Telephone', 'INPUT', array('name' => 'telephone','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
168 | - array('Fax', 'INPUT', array('name' => 'fax','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
169 | - array('Email Address', 'INPUT', array('name' => 'emailaddress','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
170 | - array('Website', 'INPUT', array('name' => 'website','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
161 | + array('Company name', 'INPUT', array('name' => 'company_name', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
162 | + array('Address', 'INPUT', array('name' => 'address', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
163 | + array('City', 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
164 | + array('Province', 'INPUT', array('name' => 'province', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
165 | + array('Country', 'INPUT', array('name' => 'country', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
166 | + array('Zipcode', 'INPUT', array('name' => 'zipcode', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
167 | + array('Telephone', 'INPUT', array('name' => 'telephone', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
168 | + array('Fax', 'INPUT', array('name' => 'fax', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
169 | + array('Email Address', 'INPUT', array('name' => 'emailaddress', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
170 | + array('Website', 'INPUT', array('name' => 'website', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
171 | 171 | |
172 | 172 | |
173 | 173 | ); |
174 | 174 | $form['Invoice Configuration '] = array( |
175 | - array('', 'HIDDEN', array('name'=>'id'),'', '', '', ''), |
|
176 | - array('', 'HIDDEN', array('name'=>'accountid'),'', '', '', ''), |
|
175 | + array('', 'HIDDEN', array('name'=>'id'), '', '', '', ''), |
|
176 | + array('', 'HIDDEN', array('name'=>'accountid'), '', '', '', ''), |
|
177 | 177 | array('Invoice Notification', 'invoice_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
178 | 178 | array('Invoice Due Notification', 'invoice_due_notification', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_allow_invoice'), |
179 | - array('Invoice Date Interval', 'INPUT', array('name' => 'interval','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
180 | - array('Notify before days', 'INPUT', array('name' => 'notify_before_day','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
181 | - array('Invoice Prefix', 'INPUT', array('name' => 'invoice_prefix','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
182 | - array('Invoice Start Form', 'INPUT', array('name' => 'invoice_start_from','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
183 | - array('Invoice Taxes number', 'INPUT', array('name' => 'invoice_taxes_number','size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
184 | - array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
185 | - array('', 'HIDDEN', array('name'=>''),'', '', '', ''), |
|
179 | + array('Invoice Date Interval', 'INPUT', array('name' => 'interval', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
180 | + array('Notify before days', 'INPUT', array('name' => 'notify_before_day', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
181 | + array('Invoice Prefix', 'INPUT', array('name' => 'invoice_prefix', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
182 | + array('Invoice Start Form', 'INPUT', array('name' => 'invoice_start_from', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
183 | + array('Invoice Taxes number', 'INPUT', array('name' => 'invoice_taxes_number', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
|
184 | + array('', 'HIDDEN', array('name'=>''), '', '', '', ''), |
|
185 | + array('', 'HIDDEN', array('name'=>''), '', '', '', ''), |
|
186 | 186 | ); |
187 | 187 | $form['Company personalization'] = array( |
188 | 188 | |
@@ -190,11 +190,11 @@ discard block |
||
190 | 190 | array('Website Domain', 'INPUT', array('name' => 'domain', 'size' => '20', 'maxlength' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
191 | 191 | array('Website Header', 'INPUT', array('name' => 'website_title', 'size' => '100', 'maxlength' => '100', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
192 | 192 | array('Website Footer', 'INPUT', array('name' => 'website_footer', 'size' => '200', 'maxlength' => '200', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
193 | - array('Company logo', 'IMAGE', array('name' => 'file','size' => '20', 'maxlength' => '100', 'class' => "",'id'=>'uploadFile','type'=>'file'),'class' => '', 'tOOL TIP', 'Please Enter account number'), |
|
193 | + array('Company logo', 'IMAGE', array('name' => 'file', 'size' => '20', 'maxlength' => '100', 'class' => "", 'id'=>'uploadFile', 'type'=>'file'), 'class' => '', 'tOOL TIP', 'Please Enter account number'), |
|
194 | 194 | //array('', 'BLANL_DIV', array('name'=>'accountid','id'=>'imagePreview'),'', '', '', ''), |
195 | - $delete_logo,$image_path, |
|
195 | + $delete_logo, $image_path, |
|
196 | 196 | ); |
197 | - $form['button_save'] = array('name' => 'action', 'content' =>'Save' , 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
|
197 | + $form['button_save'] = array('name' => 'action', 'content' =>'Save', 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
|
198 | 198 | |
199 | 199 | return $form; |
200 | 200 |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | if(!empty($invoiceconf)){ |
130 | 130 | if($invoiceconf['logo'] != ''){ |
131 | 131 | $logo=$invoiceconf['file']; |
132 | - }else{ |
|
132 | + } else{ |
|
133 | 133 | $logo=$invoiceconf['logo']; |
134 | 134 | } |
135 | 135 | $accountid=$invoiceconf['accountid']; |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | $file_name= base_url()."upload/$logo"; |
138 | 138 | $image_path= array('Existing Image', 'IMAGE', array('type'=>'image','name' => 'image' ,'style'=>'width:100%;margin-top:20px;','src'=> $file_name), '', 'tOOL TIP', ''); |
139 | 139 | $delete_logo=array('Delete logo', 'DEL_BUTTON', array('value'=>'ankit','style'=>'margin-top:20px;','name' => 'button','id'=>'logo_delete','size' => '20', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
140 | - }else{ |
|
140 | + } else{ |
|
141 | 141 | $image_path= array('Existing Image', 'HIDDEN', array('type'=>'','name' => '' ,'style'=>'width:250px;'), '', 'tOOL TIP', ''); |
142 | 142 | $delete_logo= array('Delete logo', 'HIDDEN', array('value'=>'ankit','style'=>'margin-top:0px;','name' => 'button','id'=>'logo_delete','size' => '20', 'maxlength' => '100', 'class' => "btn btn-line-parrot"), '', 'tOOL TIP', 'Please Enter account number'); |
143 | 143 | // $image_path=array(); |
144 | 144 | } |
145 | 145 | |
146 | - }else{ |
|
146 | + } else{ |
|
147 | 147 | $logo = ''; |
148 | 148 | $file_name = ''; |
149 | 149 | $accountid=0; |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | </tr> |
182 | 182 | <tr> |
183 | 183 | <td> |
184 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
184 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
185 | 185 | </td> |
186 | 186 | </tr> |
187 | 187 | <tr> |
188 | 188 | <td> |
189 | 189 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
190 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
190 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
191 | 191 | ?></span> |
192 | 192 | </td> |
193 | 193 | </tr> |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | <th >Amount</th> |
219 | 219 | </tr> |
220 | 220 | <?php |
221 | -$j=1; |
|
221 | +$j = 1; |
|
222 | 222 | |
223 | - foreach($invoice_total_query as $value){ |
|
224 | - $id=$value['id']; |
|
225 | - $debit=$value['debit']; |
|
226 | - $created_date=$value['created_date']; |
|
223 | + foreach ($invoice_total_query as $value) { |
|
224 | + $id = $value['id']; |
|
225 | + $debit = $value['debit']; |
|
226 | + $created_date = $value['created_date']; |
|
227 | 227 | ?> |
228 | 228 | <tr> |
229 | 229 | <td width="20" align="center"> |
@@ -165,15 +165,15 @@ |
||
165 | 165 | </div> |
166 | 166 | <div class="col-md-5"><label style="text-align:left;float:left;" class="col-md-3"><?php echo gettext('Accounts'); ?> </label> |
167 | 167 | <?php |
168 | - if($login_type == -1){ |
|
169 | - $where="deleted = '0' AND reseller_id = '0' AND status = '0' AND (type= '0' OR type= '3' OR type= '1')"; |
|
170 | - }if($login_type == 1){ |
|
171 | - $where="deleted = '0' AND reseller_id = '$id' AND status = '0' AND (type= '0' OR type= '3' OR type='1')"; |
|
168 | + if ($login_type == -1) { |
|
169 | + $where = "deleted = '0' AND reseller_id = '0' AND status = '0' AND (type= '0' OR type= '3' OR type= '1')"; |
|
170 | + }if ($login_type == 1) { |
|
171 | + $where = "deleted = '0' AND reseller_id = '$id' AND status = '0' AND (type= '0' OR type= '3' OR type='1')"; |
|
172 | 172 | |
173 | 173 | } |
174 | - $account=$this->db_model->build_dropdown_invoices('id,first_name,last_name,number,type', 'accounts', '', $where);?> |
|
174 | + $account = $this->db_model->build_dropdown_invoices('id,first_name,last_name,number,type', 'accounts', '', $where); ?> |
|
175 | 175 | |
176 | - <?php echo form_dropdown_all('accountid', $account,''); ?> |
|
176 | + <?php echo form_dropdown_all('accountid', $account, ''); ?> |
|
177 | 177 | </div> |
178 | 178 | <div> |
179 | 179 | <div><label style="text-align:left;float:left;" class="col-md-1"><?php echo gettext('Notes'); ?> </label> |
@@ -158,13 +158,13 @@ |
||
158 | 158 | </tr> |
159 | 159 | <tr> |
160 | 160 | <td> |
161 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
161 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
162 | 162 | </td> |
163 | 163 | </tr> |
164 | 164 | <tr> |
165 | 165 | <td> |
166 | 166 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
167 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
167 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
168 | 168 | ?></span> |
169 | 169 | </td> |
170 | 170 | </tr> |
@@ -14,7 +14,7 @@ |
||
14 | 14 | <div class="w-section inverse no-padding"> |
15 | 15 | <?php echo $form; ?> |
16 | 16 | <?php |
17 | - if(isset($validation_errors) && $validation_errors != ''){ ?> |
|
17 | + if (isset($validation_errors) && $validation_errors != '') { ?> |
|
18 | 18 | <script> |
19 | 19 | var ERR_STR = '<?php echo $validation_errors; ?>'; |
20 | 20 | print_error(ERR_STR); |
@@ -100,13 +100,13 @@ discard block |
||
100 | 100 | </tr> |
101 | 101 | <tr> |
102 | 102 | <td> |
103 | - <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span> |
|
103 | + <b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span> |
|
104 | 104 | </td> |
105 | 105 | </tr> |
106 | 106 | <tr> |
107 | 107 | <td> |
108 | 108 | <b>Due Date : </b><span style="color:#a09d9d;"><?php |
109 | - echo date('Y-m-d', strtotime($payment_due_date)) ; |
|
109 | + echo date('Y-m-d', strtotime($payment_due_date)); |
|
110 | 110 | ?></span> |
111 | 111 | </td> |
112 | 112 | </tr> |
@@ -140,24 +140,24 @@ discard block |
||
140 | 140 | </th> |
141 | 141 | </tr> |
142 | 142 | <?php |
143 | -$paypal=0; |
|
144 | - foreach($invoice_final_query as $value){ |
|
143 | +$paypal = 0; |
|
144 | + foreach ($invoice_final_query as $value) { |
|
145 | 145 | |
146 | - if($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
147 | - $debit=$value['debit']; |
|
148 | - $credit=$value['credit']; |
|
149 | - $paypal+=$credit; |
|
150 | - $created_date=$value['created_date']; |
|
151 | - $paypalid=$value['item_id']; |
|
152 | - $outstanding=$amount-$paypal; |
|
153 | - $amount_visible='0000'; |
|
146 | + if ($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') { |
|
147 | + $debit = $value['debit']; |
|
148 | + $credit = $value['credit']; |
|
149 | + $paypal += $credit; |
|
150 | + $created_date = $value['created_date']; |
|
151 | + $paypalid = $value['item_id']; |
|
152 | + $outstanding = $amount - $paypal; |
|
153 | + $amount_visible = '0000'; |
|
154 | 154 | |
155 | 155 | |
156 | 156 | |
157 | 157 | ?> |
158 | 158 | <tr style="height:20px;"> |
159 | 159 | <td><?php echo $value['description']; ?> </td> |
160 | - <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php echo $to_currency; ?></div></td> |
|
160 | + <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php echo $to_currency; ?></div></td> |
|
161 | 161 | <input type="hidden" name="new_amount" value="<?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?>"> |
162 | 162 | |
163 | 163 | |
@@ -196,18 +196,18 @@ discard block |
||
196 | 196 | |
197 | 197 | </tr> |
198 | 198 | <?php |
199 | -$paypal=0; |
|
200 | -if($invoice_date){ |
|
201 | - foreach($invoice_total_query as $value){ |
|
199 | +$paypal = 0; |
|
200 | +if ($invoice_date) { |
|
201 | + foreach ($invoice_total_query as $value) { |
|
202 | 202 | |
203 | 203 | |
204 | - $debit=$value['debit']; |
|
205 | - $credit=$value['credit']; |
|
206 | - $paypal+=$credit; |
|
207 | - $created_date=$value['created_date']; |
|
208 | - $paypalid=$value['item_id']; |
|
209 | - $outstanding=$amount-$paypal; |
|
210 | - $amount_visible='0000'; |
|
204 | + $debit = $value['debit']; |
|
205 | + $credit = $value['credit']; |
|
206 | + $paypal += $credit; |
|
207 | + $created_date = $value['created_date']; |
|
208 | + $paypalid = $value['item_id']; |
|
209 | + $outstanding = $amount - $paypal; |
|
210 | + $amount_visible = '0000'; |
|
211 | 211 | |
212 | 212 | |
213 | 213 |
@@ -298,7 +298,7 @@ |
||
298 | 298 | </td> |
299 | 299 | </tr> |
300 | 300 | </table> |
301 | -<?php }elseif ($logintype == 1) {?> |
|
301 | +<?php } elseif ($logintype == 1) {?> |
|
302 | 302 | <table class="invoice_table1 pull-right"> |
303 | 303 | <tr style="border-bottom:2px solid #dfdfe1; color:#474747;"><th colspan="2">Payment Amount :</th></tr> |
304 | 304 | <tr> |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | unset($argv[1]); |
23 | 23 | // $argv = array_merge($argv, $config["argv"][$path]); |
24 | 24 | $argv[0] = $argv[0]; |
25 | - $argv[1] =$config["argv"][$path]; |
|
25 | + $argv[1] = $config["argv"][$path]; |
|
26 | 26 | $_SERVER['argv'] = $argv; |
27 | 27 | } else |
28 | 28 | die('Use: php cron.php controller/method'); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | ob_start(); |
42 | 42 | |
43 | 43 | // chdir( dirname( CRON_CI_INDEX ) ); |
44 | -require( CRON_CI_INDEX ); // main CI index.php file |
|
44 | +require(CRON_CI_INDEX); // main CI index.php file |
|
45 | 45 | $output = ob_get_contents(); |
46 | 46 | |
47 | 47 | if (CRON_FLUSH_BUFFERS === TRUE) |
48 | - while (@ob_end_flush()); // display buffer contents |
|
48 | + while (@ob_end_flush()); // display buffer contents |
|
49 | 49 | else |
50 | 50 | ob_end_clean(); |
51 | 51 |
@@ -11,21 +11,24 @@ discard block |
||
11 | 11 | define('CRON_BETA_MODE', $config['CRON_BETA_MODE']); |
12 | 12 | |
13 | 13 | // Set index.php location |
14 | -if (isset($config['CRON_CI_INDEX']) && $config['CRON_CI_INDEX']) |
|
14 | +if (isset($config['CRON_CI_INDEX']) && $config['CRON_CI_INDEX']) { |
|
15 | 15 | define('CRON_CI_INDEX', $config['CRON_CI_INDEX']); |
16 | -else |
|
16 | +} else { |
|
17 | 17 | define('CRON_CI_INDEX', '../index.php'); |
18 | +} |
|
18 | 19 | |
19 | -if (count($argv) <= 2) |
|
20 | +if (count($argv) <= 2) { |
|
20 | 21 | if (count($config['argv'])) { |
21 | 22 | $path = $argv[1]; |
23 | +} |
|
22 | 24 | unset($argv[1]); |
23 | 25 | // $argv = array_merge($argv, $config["argv"][$path]); |
24 | 26 | $argv[0] = $argv[0]; |
25 | 27 | $argv[1] =$config["argv"][$path]; |
26 | 28 | $_SERVER['argv'] = $argv; |
27 | - } else |
|
28 | - die('Use: php cron.php controller/method'); |
|
29 | + } else { |
|
30 | + die('Use: php cron.php controller/method'); |
|
31 | + } |
|
29 | 32 | |
30 | 33 | // Simulate an HTTP request |
31 | 34 | $_SERVER['PATH_INFO'] = $argv[1]; |
@@ -44,10 +47,13 @@ discard block |
||
44 | 47 | require( CRON_CI_INDEX ); // main CI index.php file |
45 | 48 | $output = ob_get_contents(); |
46 | 49 | |
47 | -if (CRON_FLUSH_BUFFERS === TRUE) |
|
48 | - while (@ob_end_flush()); // display buffer contents |
|
49 | - else |
|
50 | - ob_end_clean(); |
|
50 | +if (CRON_FLUSH_BUFFERS === TRUE) { |
|
51 | + while (@ob_end_flush()); |
|
52 | +} |
|
53 | +// display buffer contents |
|
54 | + else { |
|
55 | + ob_end_clean(); |
|
56 | + } |
|
51 | 57 | |
52 | 58 | echo "\n"; |
53 | 59 | ?> |
@@ -68,7 +68,7 @@ |
||
68 | 68 | * as this file. |
69 | 69 | * |
70 | 70 | */ |
71 | - $assets_path='assets'; |
|
71 | + $assets_path = 'assets'; |
|
72 | 72 | /* |
73 | 73 | *--------------------------------------------------------------- |
74 | 74 | * APPLICATION FOLDER NAME |
@@ -1025,18 +1025,15 @@ |
||
1025 | 1025 | { |
1026 | 1026 | include($path.'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); |
1027 | 1027 | break; |
1028 | - } |
|
1029 | - elseif (defined('ENVIRONMENT') AND file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1028 | + } elseif (defined('ENVIRONMENT') AND file_exists($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) |
|
1030 | 1029 | { |
1031 | 1030 | include($path.'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); |
1032 | 1031 | break; |
1033 | - } |
|
1034 | - elseif (file_exists($path.'config/'.strtolower($class).'.php')) |
|
1032 | + } elseif (file_exists($path.'config/'.strtolower($class).'.php')) |
|
1035 | 1033 | { |
1036 | 1034 | include($path.'config/'.strtolower($class).'.php'); |
1037 | 1035 | break; |
1038 | - } |
|
1039 | - elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1036 | + } elseif (file_exists($path.'config/'.ucfirst(strtolower($class)).'.php')) |
|
1040 | 1037 | { |
1041 | 1038 | include($path.'config/'.ucfirst(strtolower($class)).'.php'); |
1042 | 1039 | break; |