Compare commits

..

167 Commits
2.3.2 ... 2.3.3

Author SHA1 Message Date
jekkos
c408afad67 Cleanup migration script, mostly working now (#262) 2016-01-05 17:41:43 +01:00
jekkos
b1ba7d0afe Split up database.sql in scripts for tables and contraints.
Use both new scripts in phppos_migrate.sql
2016-01-05 07:41:49 +01:00
FrancescoUK
31a223cece Merge pull request #272 from daN4cat/master
#271 fix to error witn xampp due to a spurious "git"
2016-01-04 22:13:29 +00:00
FrancescoUK
3bd778737f #271 fix to error witn xampp due to a spurious "git" 2016-01-04 22:09:38 +00:00
jekkos
648251978e Merge pull request #270 from daN4cat/master
Fixes to #265, #267 and #269
2016-01-04 22:13:25 +01:00
FrancescoUK
240c96a185 #267 remove warning due to junk dirs being inside a language/xx one 2016-01-04 19:44:15 +00:00
FrancescoUK
810000e37c #265 do not override 404 handler in routes.php 2016-01-04 18:23:16 +00:00
FrancescoUK
6aa5126bf0 #269 fix https error issue 2016-01-04 17:55:00 +00:00
jekkos
90591382ce Further cleanup phppos migration script (#262) 2016-01-04 17:26:42 +01:00
jekkos
9e2d89c528 Show discounted price instead of discount itself on receipt 2016-01-04 17:19:50 +01:00
jekkos
1601d679fd Takings not using proper permission (#262) 2016-01-04 17:04:33 +01:00
jekkos
aa0409af48 Add phppos migration script (untested) #258 2016-01-01 17:10:43 +01:00
jekkos
ad194bd4c0 Fix typo in english translation (#260) 2016-01-01 16:46:58 +01:00
jekkos
1779685d31 Encode text before storing it as session variable (#254) 2015-12-30 08:10:14 +01:00
jekkos
51df82f35e Update WHATS_NEW 2015-12-30 07:42:27 +01:00
jekkos
bf0622d7fa Show discounted price per item line 2015-12-26 15:26:32 +01:00
jekkos
da25281df9 Show discounted price per item line 2015-12-26 15:21:54 +01:00
jekkos
2f52d083e8 Update changelog for 2.3.3 2015-12-26 13:13:47 +01:00
jekkos
eb63f49db7 Add barcode generation for EAN8 and EAN13 (#111, #246)
Add config option to use generation when generating barcodes for an
Generate propery barcode with configured format if item_number empty
2015-12-26 11:42:58 +01:00
jekkos
c007513fc8 Fix barcode generation error for empty item numbers 2015-12-13 15:57:03 +01:00
jekkos
9f5782e0ba Add validation for barcode types (#111, #246)
Fallback to code128 if invalid EAN8 or EAN13 is detected
2015-12-13 15:51:25 +01:00
jekkos
2f14a0f868 Fix typo in store language line (#247) 2015-12-13 14:15:43 +01:00
jekkos
fb924daa81 Show reoder level in items form when editing (#241) 2015-12-04 18:13:05 +01:00
jekkos
1bb9acdc37 Fix for adding/deleting stock locations (#242) 2015-12-04 18:09:51 +01:00
jekkos
16d5dfce77 Merge pull request #244 from kamaroly/master
Fixed Severity: Notice Message: Only variable references should be returned by reference Filename: core/Common.php Line Number: 257
2015-12-03 23:06:22 +01:00
Kamaro Lambert
afa203e73c Fixed error Only variable references should be returned by reference
Severity: Notice Message: Only variable references should be returned by reference Filename: core/Common.php Line Number: 257
2015-11-30 23:30:56 +02:00
jekkos
bc85391734 Submit form when hitting enter in search field for items module (#187) 2015-11-09 11:15:42 +01:00
jekkos
7c2cc9646d Don't override custom invoice numbers (#223) 2015-11-09 10:46:35 +01:00
jekkos
c0303cc873 Merge branch 'master' of https://github.com/asakpke/RoshanTech.com-POS 2015-10-20 22:01:37 +02:00
jekkos
0ddd80dc2c Regenerate thai language (#205) 2015-10-20 22:00:18 +02:00
songwutk
af582056d7 update sales_lang.csv : Thai
"sales_suspend_sale" too long in button, so change word fit.
2015-10-20 22:00:18 +02:00
jekkos
56859a77ab Fix path for jquery-ui icons (#207) 2015-10-20 13:23:20 +02:00
jekkos
ec5846e1eb Make receivings datetimepicker consistent with sales form (#169) 2015-10-18 21:37:49 +02:00
jekkos
6d5c192447 Add jquery-ui slider for datepicker #169 2015-10-17 00:22:57 +02:00
FrancescoUK
1b90ac14d2 #169 regenerate dist/ js scripts adding datetimepicker jQuery plugin 2015-10-15 19:12:50 +01:00
FrancescoUK
9c775ca44b #169 Add date and time picker to receivings/form
Some code indentation for better readibility.
2015-10-15 18:03:46 +01:00
FrancescoUK
0d87fc51d9 #169 Add a date time picker to sales/form such user can edit transaction date not in a manual manner
Needs more testing with different date & time formats and sorting out of min.js
2015-10-14 11:40:59 +01:00
jekkos
c4c7d9d792 Merge pull request #169 from marteserede/master
Fix dateformat value in SQL-Query app_config
2015-10-12 09:36:37 +02:00
jekkos
455a5f59d1 Merge pull request #199 from souparno/bug-condition-statement
if condition statement missing, may result in server error
2015-10-10 15:09:10 +02:00
souparno
9cf5d5734f if condition statement missing, may result in server error 2015-10-10 13:11:32 +05:30
jekkos
43b8d32efc Don't use empty on php expression (#196)
Signed-off-by: jekkos <jeroen.peelaerts@gmail.com>
2015-10-09 17:11:24 +02:00
jekkos
0c25b01666 Add default line endings 2015-10-09 11:43:19 +02:00
jekkos
1fd7fda645 Fix totals calculation when adding item multiple times (issue #165)
Fix typo in script comments
2015-10-09 10:24:38 +02:00
jekkos
3eb798917d Clear out empty sales and receivings comments on database upgrade
(#192)
2015-10-08 18:43:52 +02:00
jekkos
64023f6eec Avoid comments coercion to 0 when suspending sales (#192)
Invoice number in suspended sales should not be unique
2015-10-08 18:29:55 +02:00
jekkos
d8a369f39d Remove unique constriant from invoice_number column in suspended_sales 2015-10-08 18:29:55 +02:00
jekkos
98b0df9e80 Merge pull request #194 from daN4cat/master
#192 Remove 0 from comments
2015-10-07 13:11:18 +02:00
FrancescoUK
763a9e73fa #192 Remove 0 from comments
Checked in library get_comment if the string is null and return a '' if that's the case. That removes the 0 from sale comments
2015-10-07 09:37:27 +01:00
jekkos
df5a0448aa Merge pull request #193 from daN4cat/master
#192 Fix to comment not saved when suspending a Sale
2015-10-07 10:07:31 +02:00
Aamir Shahzad
76365afbd2 Added my name, ID and website in COPING 2015-10-06 22:58:37 +05:00
Aamir Shahzad
6e27b4c9ec Extra comments removed 2015-10-06 22:52:00 +05:00
FrancescoUK
a7e2ea5fa7 #192 Fix to comment not saved when suspending a Sale
The issue was that for a strange reason the comment was fetched directly from the form instead of using the sale_lib->get_comment like in the rest of the code.
2015-10-06 17:55:58 +01:00
Aamir Shahzad
986bbc9b36 Better Navigation with TAB key on Sales page 2015-10-06 03:31:57 +05:00
FrancescoUK
03f6d234bc #175 Fix inverted sorting issue 2015-09-28 22:47:16 +01:00
FrancescoUK
79361c976c Refactoring around items and sales search 2015-09-28 19:21:35 +01:00
FrancescoUK
1296f393d7 #175 Add pagination links 2015-09-28 18:24:02 +01:00
FrancescoUK
e49dd4e0b9 #179 Make Items Kit icon visible on home page
Remove the if statement that was in the end preventing any module having a _ to be displayed in the home page.
This solution is consistent with navigation bar one.

Also done some indentation in header and footer to improve readibility.
2015-09-28 13:12:22 +01:00
FrancescoUK
319545b989 #180 Fix to allowing a sale suspend before any payment
Reformatted the register code to increase readibility.
Please note that the real change is just moving the Suspend Sale button from finish_sale_form to cancel_sale_form, adding float:left style to Cancel button and changing the javascript for Suspend sale to address the correct form.
2015-09-28 08:59:22 +01:00
FrancescoUK
4a3e9ef79d #167 Limit description and serialnumber to 30 char before saving item to sale or suspended sale tables 2015-09-27 18:08:10 +01:00
FrancescoUK
e566223db9 #168 Items Kit: search by KIT id 2015-09-27 16:49:50 +01:00
FrancescoUK
22406d0c3a Merge pull request #176 from daN4cat/master
#165 Fix invoice wrong date on sale completion
2015-09-27 16:39:52 +01:00
FrancescoUK
8bb108503c #165 Fix invoice wrong date on sale completion 2015-09-25 19:02:03 +01:00
jekkos
1eb43d2a74 Merge branch 'master' of https://github.com/jekkos/opensourcepos 2015-09-24 22:02:23 +02:00
jekkos
56f7be21ae Merge pull request #171 from souparno/bug-fix-reset-database
reset database syntax contains check, so as it can be used to create…
2015-09-23 22:57:46 +02:00
FrancescoUK
ba6ecf0319 #132 Fix date range missing end date items 2015-09-23 18:04:04 +01:00
souparno
47c8d6c0bd reset database syntax contains check, so as it ccan be used to create the database for the first time 2015-09-23 21:29:17 +05:30
FrancescoUK
d9c49c1a72 #132 revert a modification in item model 2015-09-23 13:00:34 +01:00
FrancescoUK
5af7473769 #132 Set 1-1-2010 as starting date for the date range 2015-09-22 19:01:40 +01:00
FrancescoUK
aa9cd1fe6a #132 Make sure we don't show multiple times the same item given a range 2015-09-22 18:38:21 +01:00
FrancescoUK
58899ca4cf #132 Added date range in item model. Smoke test fine, more to test 2015-09-22 18:38:20 +01:00
FrancescoUK
404bc47e96 #132 Added date picker to Items manage, added date range to controller + model 2015-09-22 18:38:19 +01:00
jekkos
7dfcec394f Substitute invoice numbers on complete once again (#163, #150) 2015-09-22 18:21:19 +02:00
jekkos
0646200f6c Increase colspan for suppliers list
Multiple item kit price with quantity at hand
2015-09-22 07:40:48 +02:00
Martes Erede
2bc7b688ff Fix dateformat value in SQL-Query app_config 2015-09-22 07:17:57 +02:00
FrancescoUK
9309d7f15b Fix to COPYING file to follow correct license & copyright format (see http://mit-license.org/) 2015-09-20 21:48:23 +01:00
FrancescoUK
87153fc70e Add time ranges for quick report searches 2015-09-20 15:03:16 +01:00
FrancescoUK
ff12531b42 Revert "#159 Fixed typo in comment"
This reverts commit f18b54a758.
2015-09-20 14:54:54 +01:00
FrancescoUK
f18b54a758 #159 Fixed typo in comment 2015-09-20 09:18:57 +01:00
FrancescoUK
9a47b448ac #153 Set private internal functions 2015-09-20 09:18:03 +01:00
FrancescoUK
569bf4db69 #111 Change databse.sql barcode defaults 2015-09-19 17:52:14 +01:00
FrancescoUK
f97e02c3d4 Items: allow custom field suggestion and search if checkbox is ticked 2015-09-19 17:46:28 +01:00
FrancescoUK
893345d334 #111 Change barcode types from numbers to strings for better code readability 2015-09-19 17:44:43 +01:00
FrancescoUK
80fcede1ca #152 Remove Alain name and add it to the COPYING under the Copyright section 2015-09-19 17:40:00 +01:00
FrancescoUK
461de2f048 #162 fix further issues due to cost & retail prices added to the table 2015-09-19 15:23:16 +01:00
FrancescoUK
4106378a6c Changed CONCAT and use of " & ' 2015-09-19 13:19:49 +01:00
FrancescoUK
dfb556b27b Fixed typo in comment 2015-09-19 12:43:08 +01:00
FrancescoUK
41607c23bd Fix to #161 when searching a Kit by name in Sales 2015-09-19 12:38:21 +01:00
FrancescoUK
a29b8c2a62 Added Kit prices to table view and barcode #162
Some spacing and retouching here and there.
2015-09-19 12:05:44 +01:00
FrancescoUK
dc45b77573 Fix to Gift card totals issue #159
Various indentation adjustments
2015-09-19 09:22:24 +01:00
FrancescoUK
ad948ac81e Fix to rebase/merge mistake with Barcode_lib 2015-09-18 18:05:43 +01:00
FrancescoUK
eee7f137ef Fix to rebase/merge mistake with Barcode_lib 2015-09-18 18:33:32 +02:00
jekkos
2237c332b9 Derive barcode id from item array 2015-09-18 18:33:22 +02:00
FrancescoUK
d5cf608bac Fix to #152 remove name of people from code comment and add them to COPYING license file 2015-09-18 18:33:22 +02:00
FrancescoUK
96973da280 Item kits issue #155 fix
Added Kit Id column to table view
2015-09-18 18:33:22 +02:00
FrancescoUK
bca4386aed Fix to sale and receiving receipt barcode 2015-09-18 18:33:22 +02:00
FrancescoUK
27f89a63be remove the - from language/id/common_lang.php 2015-09-17 22:00:06 +02:00
FrancescoUK
3f5d0b781b Fix to $lang["common_last_page"] issue #156 2015-09-17 22:00:06 +02:00
FrancescoUK
0984cdbfc4 Fix to sale and receiving receipt barcode 2015-09-17 22:00:06 +02:00
FrancescoUK
c48106f2f5 Fix items view search issue having a ' in the string. Bug #149 2015-09-17 21:59:34 +02:00
jekkos
e1ddcbbb5b Rename Item_quantities model to Item_quantity
Rename Stock_locations model to Stock_location
Fix barcode generation in receipts (sales + receivings)
2015-09-17 21:59:33 +02:00
FrancescoUK
2b7ceb4228 Move Print button in sale/manage (Takings) to top right 2015-09-17 21:59:33 +02:00
jekkos
3c89416b83 Update languages 2015-09-15 23:21:59 +02:00
jekkos
290aee4671 Merge branch 'patch-13' of https://github.com/songwutk/opensourcepos 2015-09-15 23:01:10 +02:00
FrancescoUK
10ea821b2a Leave item_number empty if Code39/128 is selected
Added Empty UPC checkbox in Items view to easily select empty items that need barcode code generation and in case of EAN8/13 fill in item_number
Added language for Empty UPC string
Indentation/spacing adjustment
2015-09-15 17:49:51 +01:00
FrancescoUK
cf0276c772 If item_number (UPC/EAN/ISBN) is empty and a new barcode is generated save it in the item_number field and update the item entry
Refactoring of barcode_lib
Some code alignment adjustment here and there
2015-09-15 11:13:58 +01:00
FrancescoUK
8f2740d349 Centred barcode image
Moved $data to base class and added getData
Fixed indentation
2015-09-14 23:20:20 +01:00
FrancescoUK
eb71dbc300 Fix EAN 13 typos + set pix per bar
Add EAN 8 support
2015-09-14 23:20:19 +01:00
FrancescoUK
68915dd28c Ean13 code generation implementation 2015-09-14 23:20:19 +01:00
FrancescoUK
93d8775ac5 Remove extra comma from end of array 2015-09-14 23:20:18 +01:00
FrancescoUK
807d48ac7b Add EAN13 in Barcode lib
Sketched EAN13 class code
Fix typo
2015-09-14 23:20:17 +01:00
FrancescoUK
79fd666bff Add Ean13 file and class
Fixed typos
2015-09-14 23:20:16 +01:00
FrancescoUK
393ac9bb97 Fixed some minor issues 2015-09-14 23:20:15 +01:00
songwutk
ac95e1f7d8 Update common_lang.csv
Fill thai blank topic.
2015-09-14 16:30:40 +07:00
jekkos
c843c174ed Initialize table sorting if this didn't happen when the page was loaded
initially (#139)
2015-09-14 08:26:41 +02:00
jekkos
d6f052f082 Add default translation in other languages as well (#142) 2015-09-12 20:55:54 +02:00
jekkos
a78ef2fb08 Merge branch 'master' of https://github.com/marteserede/opensourcepos 2015-09-12 20:16:46 +02:00
Martes Erede
4cbbd3a6f7 [#32] using to_currency for currency values in table-data 2015-09-11 16:16:34 +08:00
Martes Erede
4a8c3a83b3 [#32] adding new language-strings and running generate_languages.php 2015-09-11 15:59:27 +08:00
Martes Erede
308be8079f [#32] improving the inventory summary report, including total inventory value 2015-09-11 15:58:57 +08:00
jekkos
335ced948e Remove unneeded fields from sales_temp table 2015-09-09 23:20:31 +02:00
jekkos
b41a006a79 Fix duplicated payment amounts (#136) 2015-09-09 23:09:28 +02:00
jekkos
506aced23e amount_due and change_due were incorrect if multiple items in sale
(#136)
2015-09-09 19:25:44 +02:00
jekkos
e9ea2ba792 Create temp table when necessary 2015-09-07 22:53:19 +02:00
jekkos
2c5f3ee759 Add grunt-cache-breaker plugin (#137)
Fix tax inclusive pricing for daily sales overview (#136)
Fix table sorting when using search in daily sales overview (#131)
2015-09-07 22:15:41 +02:00
jekkos
b680cdff36 Fix table sorting after loading search results 2015-09-07 08:35:59 +02:00
jekkos
80f7966d1c Add default dateformat and timeformat in data scripts 2015-09-06 15:53:11 +02:00
jekkos
e62df579f1 Keep last row in position even after filtering 2015-09-06 13:33:12 +02:00
jekkos
2b6b3914a7 Mark totals row as static (keep it at bottom of the table issue #131) 2015-09-06 13:19:32 +02:00
jekkos
756b675e2b use configured dateformat for jquery ui date parser
disable sorting on columns 0 and 9 (no data there)
default sorting enabled on column 1
2015-09-05 15:05:20 +02:00
jekkos
1d65ceaccf Merge branch 'master' of https://github.com/daN4cat/opensourcepos 2015-09-05 09:52:48 +02:00
jekkos
0c92cc661f Remove date field type for filters 2015-09-05 09:52:30 +02:00
FrancescoUK
c87a936e22 Fix language issue 2015-09-04 23:24:53 +01:00
FrancescoUK
c041a18624 Added Print button to print the current view 2015-09-04 22:51:12 +01:00
jekkos
ac3aab51fa Fix payment summary update on search 2015-09-04 23:35:23 +02:00
jekkos
9281995029 Fix payment summary update on search
Merge branch 'master' of https://github.com/daN4cat/opensourcepos into daN4cat-master
2015-09-04 23:14:06 +02:00
jekkos
f36c700129 Add date filtering in sales overview
Add jquery-ui datepicker
Format dates in sale and receiving forms according to configured
dateformat and timeformat settings
Add missing translations in sale (click delete when not selecting
anything)
Add search box back to search for customer sales and ticket numbers
2015-09-04 22:09:24 +02:00
FrancescoUK
d35ef071bb - Added cash only filter
- Set to 'all' the sale_type so even returns are shown (we might want to add a drop down filter for this too)
2015-09-04 19:30:43 +01:00
FrancescoUK
852f83a8f6 Rename Overview to be Takings (normally used word in retail world) 2015-09-04 10:31:02 +01:00
FrancescoUK
7bbd651779 Remove commented out lines 2015-09-04 10:11:02 +01:00
jekkos
a624d21fcd Fix sale detail edit
Make last row in sale table bold (css)
Add default date range between yesterday and today
Temporarily comment out payment type listing in table itself (tbd)
2015-09-04 08:44:20 +02:00
jekkos
9a2cafc1b1 Review payment type overview
Add some padding to bottom of content area
Fix invoice only searching
Make start and end dates optional
2015-09-03 23:35:57 +02:00
FrancescoUK
b226a40efc Make Gift Card one payment item and not multiple ones in Sale/Overview and in Summary Payment report.
Fixed also the colspan and set to 10.
2015-09-03 19:18:15 +01:00
FrancescoUK
0b8a263443 Sale Overview change:
- set today as view date and comment out the debug dates
2015-09-02 23:22:44 +01:00
FrancescoUK
75fa706299 Sale Overview change
- Refactor and optimise payments part (added now amount to detail sale report too)
- fix some </tr> that should have been </td>
- minor indentation fixes

NOTE: The only_invoices checkbox is not responsive
2015-09-02 23:16:26 +01:00
FrancescoUK
c88f37f8e7 Change Sale Overview to become a daily takings view with totals. 2015-09-01 23:37:26 +01:00
jekkos
3e24b9caff Remove non working datepicker icon
Remove in_array check for duplicated company_name
2015-08-24 21:52:41 +02:00
jekkos
517363b485 Fix deleted checkbox in items form
Clear suggestion cache when toggling deleted filter
2015-08-18 18:10:00 +02:00
jekkos
011caf375f Apply is_deleted in item suggestion search 2015-08-18 08:35:21 +02:00
FrancescoUK
9f1485cfe5 Added Cost & Count to reports, improved Items suggest, added copyrights and some fixes
Added cost and count to reports

- Added cost in temp table, reports at bottom of page and in each
summary and detailed report
- Added count in all the reports
- Renamed some report fields name to make it generic and consistent
across views
- Fixed few issues here and there
- Adjusted some code indentation

NOTE: Proper translation of word Cost is required in all the languages
but English

Improved Items suggestion

- Added select to restrict results fields
- Added distinct in suppliers instead of the array match
- Added $is_deleted in model part but is not still effective

Add copyright statements in COPYING license file

- Added jekkos and FrancescoUK / daN4cat

Other people that contributed should add their statements.
2015-08-17 11:13:04 +01:00
jekkos
0336fe6298 Stop showing duplicate suggestions for company_name 2015-08-16 15:52:25 +02:00
jekkos
4ab2ec1b5b Add supplier attribute search for items (pull request #106)
Add company name to supplier column in summary report
2015-08-16 15:41:39 +02:00
jekkos
eb3657e76f Fix upgrade script (2) 2015-08-13 22:53:52 +02:00
jekkos
61206547cb FIll in empty location_ids for existing data 2015-08-12 15:10:08 +02:00
songwutk
9ae6e3242b Update Thai translate (Pull requests #98, #99, #100, #101, #102) 2015-08-11 18:49:28 +02:00
jekkos
7f5fe9efde Upgrade grunt-mocha-webdriver 2015-08-10 15:32:00 +02:00
jekkos
9e189a503e Merge pull request #105 from gabrielperezs/master
Solved to issues in this request. Spanish support, and temp table creation.
2015-08-10 11:03:58 +02:00
Gabriel Pérez S
da41aec0d1 Spanish traslation 2015-08-10 10:26:11 +02:00
Gabriel Pérez S
03b9924d57 Create table if not exists 2015-08-10 10:14:03 +02:00
jekkos
87222611e6 Remove duplicated last name for suppliers 2015-08-10 09:30:01 +02:00
FrancescoUK
cc06d93d30 Remove LICENSE file (use COPYING now instead)
Update agency_name constraint in update script
Show supplier_id in suppliers for use with item excel import
2015-08-09 12:01:09 +02:00
jekkos
7926a05948 Regenerate language files
Remove committed merge conflict in giftcard_numbering.js
Add sql upgrade script for 2.3.3
2015-08-07 17:17:53 +02:00
FrancescoUK
d7ff4a371c Fix to the License naming clash issue
- Instead of LICENSE used COPYING (it's accepted see:
http://www.theregister.co.uk/2013/04/18/github_licensing_study)
- removed license.txt inside license dir to avoid unnecessary
duplications or clash of license of the ospos code. COPYING is anyway a
rename of LICENSE that was a newer version than the one in
license/license.txt
2015-08-07 15:02:15 +02:00
FrancescoUK
aa144b43eb Fixed invoice date bug
The invoice date was not showing the correct date and neither following
the selected format
2015-08-07 15:02:15 +02:00
FrancescoUK
f806ea84b3 Update to Suppliers feature
- added Agency name to identify agent or distributor behind a brand
- updated view to show supplier ID useful for item imports via excel
sheet
- update database table
- updated language although missing translations
- various bit an pieces missing due to failed rebase
2015-08-07 15:02:15 +02:00
jekkos
17ac5b1837 Bump version number to 2.3.3 2015-07-25 12:03:04 +02:00
FrancescoUK
8bcd2a69dc Add better locale config support (pull request #93)
I've added in this commit the following:

- the means to configure date and time format
- date and time is shown with the selected formats
- a locale tab in the configuration page
- changed location tab to be stock tab and the same for the file names
- translation strings (only English) for the case

NOTE 1: Not related to Locale support but I removed an extra <div
class="field_row clearfix"> from general_config.php

NOTE 2: There is no rules in the submit checks of Locale. Probably this
is something to iron out a bit

NOTE 3: It would be probably nice to add a button in the Locale tab to
regenerate all the translation files in case somebody updates the
translations .csv

Fixed Local config

- Removed text in Red as really not mandatory configuration
- Added time format in 24h and 12h

Updated General Config tab

- reorganised the layout grouping things like company info, taxes and
invoice formating
- increased the limit of max lines per page to 1000 because 50 is too
little. People can do what they want with up to 1000
2015-07-25 12:02:10 +02:00
jekkos
4916f98bcb Fix currency symbol when no dollars are chosen 2015-04-14 13:04:46 +02:00
201 changed files with 25377 additions and 6257 deletions

1
.gitattributes vendored
View File

@@ -1,2 +1,3 @@
dist/ merge=ours
application/language/**/*.php merge=ours
text=auto

View File

@@ -1,6 +1,13 @@
The MIT License (MIT)
Copyright (c) 2014 pappastech
Copyright (c) 2012-2014 pappastech
Copyright (c) 2012 Alain
Copyright (c) 2013 Rob Garrison
Copyright (c) 2013 Parq
Copyright (c) 2013 Ramel
Copyright (c) 2014-2015 jekkos
Copyright (c) 2015 FrancescoUK (aka daN4cat)
Copyright (c) 2015 Aamir Shahzad (aka asakpke), RoshanTech.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@@ -17,4 +24,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -74,6 +74,20 @@ module.exports = function(grunt) {
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
},
cachebreaker: {
dev: {
options: {
match: ['opensourcepos.min.js'],
src: {
path: 'dist/opensourcepos.min.js'
},
replacement: 'md5'
},
files: {
src: ['application/views/partial/header.php']
}
}
}
});
@@ -83,7 +97,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-script-link-tags');
grunt.loadNpmTasks('grunt-mocha-webdriver');
grunt.loadNpmTasks('grunt-cache-breaker');
grunt.registerTask('default', ['tags:js', 'concat', 'uglify', 'tags:minjs']);
grunt.registerTask('default', ['tags:js', 'concat', 'uglify', 'tags:minjs', 'cachebreaker']);
};

View File

@@ -23,4 +23,3 @@ If you like the project, and you are making money out of it on a daily basis, th
[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MUN6AEG7NY6H8)
Or send some coins to **19kwPpAwrUTxbNEs5D6cRR1k4mf5HNa4v2**

View File

@@ -1,3 +1,25 @@
Version 2.3.3
-------------
+ Item kit fixes (search, list, ..)
+ Add datepicker widgets in sale/receiving edit forms
+ Add date filter in items module
+ Add barcode generation logic for EAN8, EAN13
+ Add barcode validation + fallback logic for EAN8, EAN13
+ New config option to generate barcodes if item_number empty
+ Add cost + count to inventory reports
+ Giftcard fixes
+ Refactor sales overview (added date filtering + search options)
+ Better locale config support
+ Improve php compatibility
+ Fix invoice numbering bug on suspend
+ Add configurable locale-dependent dateformat
+ Add grunt-cache-breaker plugin
+ Suspend button appeaers before adding a payment
+ Searching of deleted items, filtering part is removed
+ Remove infamous "0" after leaving sale or receiving comments empty
+ Add SQL script to clean zeroes in sales/receivings comments
+ Numerous other bug fixes
Version 2.3.2
-------------
+ Nominatim (OpenStreetMap) customer address autocompletion

View File

@@ -64,7 +64,7 @@ $autoload['libraries'] = array('database','form_validation','session','user_agen
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('form','url','table','text','currency', 'html', 'download', 'directory');
$autoload['helper'] = array('form','url','table','text','currency', 'html', 'download', 'directory', 'dateformat_helper');
/*
@@ -109,7 +109,7 @@ $autoload['language'] = array();
|
*/
$autoload['model'] = array('Appconfig','Person','Customer','Employee','Module','Item', 'Item_taxes', 'Sale', 'Sale_suspended', 'Supplier','Inventory','Receiving','Giftcard', 'Item_kit', 'Item_kit_items','Stock_locations','Item_quantities');
$autoload['model'] = array('Appconfig','Person','Customer','Employee','Module','Item', 'Item_taxes', 'Sale', 'Sale_suspended', 'Supplier','Inventory','Receiving','Giftcard', 'Item_kit', 'Item_kit_items','Stock_location','Item_quantity');
/* End of file autoload.php */

View File

@@ -9,7 +9,7 @@
|
|
*/
$config['application_version'] = '2.3.2';
$config['application_version'] = '2.3.3';
/*
|--------------------------------------------------------------------------

View File

@@ -43,12 +43,15 @@ $route['no_access/(:any)'] = "no_access/index/$1";
$route['no_access/(:any)/(:any)'] = "no_access/index/$1/$2";
$route['sales/index/(:any)'] = "sales/manage/$1";
$route['sales/index/(:any)/(:any)'] = "sales/manage/$1/$2";
$route['sales/index/(:any)/(:any)/(:any)'] = "sales/manage/$1/$2/$3";
$route['reports/(summary_:any)/(:any)/(:any)'] = "reports/$1/$2/$3";
$route['reports/summary_:any'] = "reports/date_input_excel_export";
$route['reports/(graphical_:any)/(:any)/(:any)'] = "reports/$1/$2/$3";
$route['reports/graphical_:any'] = "reports/date_input";
$route['reports/(inventory_:any)/(:any)'] = "reports/$1/$2";
$route['reports/inventory_:any'] = "reports/excel_export";
$route['reports/inventory_summary'] = "reports/inventory_summary_input";
$route['reports/(inventory_summary)/(:any)/(:any)/(:any)'] = "reports/$1/$2/$3/$4";
$route['reports/(detailed_sales)/(:any)/(:any)/(:any)'] = "reports/$1/$2/$3$/$4";
$route['reports/detailed_sales'] = "reports/date_input_sales";
@@ -61,7 +64,7 @@ $route['reports/specific_discount'] = "reports/specific_discount_input";
$route['scaffolding_trigger'] = "";
$route['404_override'] = 'errors/page_missing';
$route['404_override'] = "";
/* End of file routes.php */
/* Location: ./application/config/routes.php */

View File

@@ -11,7 +11,7 @@ class Config extends Secure_area
function index()
{
$location_names = array();
$data['stock_locations'] = $this->Stock_locations->get_all()->result_array();
$data['stock_locations'] = $this->Stock_location->get_all()->result_array();
$data['support_barcode'] = $this->barcode_lib->get_list_barcodes();
$this->load->view("configs/manage", $data);
$this->_remove_duplicate_cookies();
@@ -24,38 +24,32 @@ class Config extends Secure_area
$batch_save_data=array(
'company'=>$this->input->post('company'),
'address'=>$this->input->post('address'),
'phone'=>$this->input->post('phone'),
'email'=>$this->input->post('email'),
'fax'=>$this->input->post('fax'),
'website'=>$this->input->post('website'),
'default_tax_1_rate'=>$this->input->post('default_tax_1_rate'),
'default_tax_1_name'=>$this->input->post('default_tax_1_name'),
'default_tax_2_rate'=>$this->input->post('default_tax_2_rate'),
'default_tax_2_name'=>$this->input->post('default_tax_2_name'),
'currency_symbol'=>$this->input->post('currency_symbol'),
'currency_side'=>$this->input->post('currency_side'),/**GARRISON ADDED 4/20/2013**/
'return_policy'=>$this->input->post('return_policy'),
'language'=>$this->input->post('language'),
'timezone'=>$this->input->post('timezone'),
'tax_included'=>$this->input->post('tax_included'),
'recv_invoice_format'=>$this->input->post('recv_invoice_format'),
'sales_invoice_format'=>$this->input->post('sales_invoice_format'),
'receiving_calculate_average_price'=>$this->input->post('receiving_calculate_average_price'),
'thousands_separator'=>$this->input->post('thousands_separator'),
'decimal_point'=>$this->input->post('decimal_point'),
'lines_per_page'=>$this->input->post('lines_per_page'),
'default_sales_discount'=>$this->input->post('default_sales_discount'),
'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/
'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/
'custom3_name'=>$this->input->post('custom3_name'),/**GARRISON ADDED 4/20/2013**/
'custom4_name'=>$this->input->post('custom4_name'),/**GARRISON ADDED 4/20/2013**/
'custom5_name'=>$this->input->post('custom5_name'),/**GARRISON ADDED 4/20/2013**/
'custom6_name'=>$this->input->post('custom6_name'),/**GARRISON ADDED 4/20/2013**/
'custom7_name'=>$this->input->post('custom7_name'),/**GARRISON ADDED 4/20/2013**/
'custom8_name'=>$this->input->post('custom8_name'),/**GARRISON ADDED 4/20/2013**/
'custom9_name'=>$this->input->post('custom9_name'),/**GARRISON ADDED 4/20/2013**/
'custom10_name'=>$this->input->post('custom10_name')/**GARRISON ADDED 4/20/2013**/
'address'=>$this->input->post('address'),
'phone'=>$this->input->post('phone'),
'email'=>$this->input->post('email'),
'fax'=>$this->input->post('fax'),
'website'=>$this->input->post('website'),
'default_tax_1_rate'=>$this->input->post('default_tax_1_rate'),
'default_tax_1_name'=>$this->input->post('default_tax_1_name'),
'default_tax_2_rate'=>$this->input->post('default_tax_2_rate'),
'default_tax_2_name'=>$this->input->post('default_tax_2_name'),
'return_policy'=>$this->input->post('return_policy'),
'tax_included'=>$this->input->post('tax_included'),
'recv_invoice_format'=>$this->input->post('recv_invoice_format'),
'sales_invoice_format'=>$this->input->post('sales_invoice_format'),
'receiving_calculate_average_price'=>$this->input->post('receiving_calculate_average_price'),
'lines_per_page'=>$this->input->post('lines_per_page'),
'default_sales_discount'=>$this->input->post('default_sales_discount'),
'custom1_name'=>$this->input->post('custom1_name'),
'custom2_name'=>$this->input->post('custom2_name'),
'custom3_name'=>$this->input->post('custom3_name'),
'custom4_name'=>$this->input->post('custom4_name'),
'custom5_name'=>$this->input->post('custom5_name'),
'custom6_name'=>$this->input->post('custom6_name'),
'custom7_name'=>$this->input->post('custom7_name'),
'custom8_name'=>$this->input->post('custom8_name'),
'custom9_name'=>$this->input->post('custom9_name'),
'custom10_name'=>$this->input->post('custom10_name')
);
if (!empty($upload_data['orig_name']))
@@ -71,9 +65,28 @@ class Config extends Secure_area
$this->_remove_duplicate_cookies();
}
function save_locale()
{
$batch_save_data=array(
'currency_symbol'=>$this->input->post('currency_symbol'),
'currency_side'=>$this->input->post('currency_side'),
'language'=>$this->input->post('language'),
'timezone'=>$this->input->post('timezone'),
'dateformat'=>$this->input->post('dateformat'),
'timeformat'=>$this->input->post('timeformat'),
'thousands_separator'=>$this->input->post('thousands_separator'),
'decimal_point'=>$this->input->post('decimal_point')
);
$result = $this->Appconfig->batch_save( $batch_save_data );
$success = $result ? true : false;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
$this->_remove_duplicate_cookies();
}
function stock_locations()
{
$stock_locations = $this->Stock_locations->get_all()->result_array();
$stock_locations = $this->Stock_location->get_all()->result_array();
$this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations));
}
@@ -92,7 +105,7 @@ class Config extends Secure_area
{
$this->db->trans_start();
$deleted_locations = $this->Stock_locations->get_allowed_locations();
$deleted_locations = $this->Stock_location->get_allowed_locations();
foreach($this->input->post() as $key => $value)
{
if (strstr($key, 'stock_location'))
@@ -101,7 +114,7 @@ class Config extends Secure_area
unset($deleted_locations[$location_id]);
// save or update
$location_data = array('location_name' => $value);
if ($this->Stock_locations->save($location_data, $location_id))
if ($this->Stock_location->save($location_data, $location_id))
{
$this->_clear_session_state();
}
@@ -110,7 +123,7 @@ class Config extends Secure_area
// all locations not available in post will be deleted now
foreach ($deleted_locations as $location_id => $location_name)
{
$this->Stock_locations->delete($location_id);
$this->Stock_location->delete($location_id);
}
$success = $this->db->trans_complete();
echo json_encode(array('success'=>$success,'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
@@ -120,42 +133,42 @@ class Config extends Secure_area
function save_barcode()
{
$batch_save_data=array(
'barcode_type'=>$this->input->post('barcode_type'),
'barcode_quality'=>$this->input->post('barcode_quality'),
'barcode_width'=>$this->input->post('barcode_width'),
'barcode_height'=>$this->input->post('barcode_height'),
'barcode_font'=>$this->input->post('barcode_font'),
'barcode_font_size'=>$this->input->post('barcode_font_size'),
'barcode_first_row'=>$this->input->post('barcode_first_row'),
'barcode_second_row'=>$this->input->post('barcode_second_row'),
'barcode_third_row'=>$this->input->post('barcode_third_row'),
'barcode_num_in_row'=>$this->input->post('barcode_num_in_row'),
'barcode_page_width'=>$this->input->post('barcode_page_width'),
'barcode_page_cellspacing'=>$this->input->post('barcode_page_cellspacing'),
'barcode_content'=>$this->input->post('barcode_content'),
'barcode_type'=>$this->input->post('barcode_type'),
'barcode_quality'=>$this->input->post('barcode_quality'),
'barcode_width'=>$this->input->post('barcode_width'),
'barcode_height'=>$this->input->post('barcode_height'),
'barcode_font'=>$this->input->post('barcode_font'),
'barcode_font_size'=>$this->input->post('barcode_font_size'),
'barcode_first_row'=>$this->input->post('barcode_first_row'),
'barcode_second_row'=>$this->input->post('barcode_second_row'),
'barcode_third_row'=>$this->input->post('barcode_third_row'),
'barcode_num_in_row'=>$this->input->post('barcode_num_in_row'),
'barcode_page_width'=>$this->input->post('barcode_page_width'),
'barcode_page_cellspacing'=>$this->input->post('barcode_page_cellspacing'),
'barcode_generate_if_empty'=>$this->input->post('barcode_generate_if_empty'),
'barcode_content'=>$this->input->post('barcode_content')
);
$result = $this->Appconfig->batch_save( $batch_save_data );
$success = $result ? true : false;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
function save_receipt()
{
$batch_save_data = array (
'use_invoice_template' => $this->input->post ( 'use_invoice_template' ),
'invoice_default_comments' => $this->input->post ( 'invoice_default_comments' ),
'invoice_email_message' => $this->input->post ( 'invoice_email_message' ),
'receipt_show_taxes' => $this->input->post ( 'receipt_show_taxes' ),
'print_silently' => $this->input->post ( 'print_silently' ),
'print_header' => $this->input->post ( 'print_header' ),
'print_footer' => $this->input->post ( 'print_footer' ),
'print_top_margin' => $this->input->post ( 'print_top_margin' ),
'print_left_margin' => $this->input->post ( 'print_left_margin' ),
'print_bottom_margin' => $this->input->post ( 'print_bottom_margin' ),
'print_right_margin' => $this->input->post ( 'print_right_margin' ),
'show_total_discount' => $this->input->post( 'show_total_discount' )
'use_invoice_template' => $this->input->post ( 'use_invoice_template' ),
'invoice_default_comments' => $this->input->post ( 'invoice_default_comments' ),
'invoice_email_message' => $this->input->post ( 'invoice_email_message' ),
'receipt_show_taxes' => $this->input->post ( 'receipt_show_taxes' ),
'print_silently' => $this->input->post ( 'print_silently' ),
'print_header' => $this->input->post ( 'print_header' ),
'print_footer' => $this->input->post ( 'print_footer' ),
'print_top_margin' => $this->input->post ( 'print_top_margin' ),
'print_left_margin' => $this->input->post ( 'print_left_margin' ),
'print_bottom_margin' => $this->input->post ( 'print_bottom_margin' ),
'print_right_margin' => $this->input->post ( 'print_right_margin' ),
'show_total_discount' => $this->input->post( 'show_total_discount' )
);
$result = $this->Appconfig->batch_save( $batch_save_data );
$success = $result ? true : false;
@@ -174,9 +187,7 @@ class Config extends Secure_area
'file_name' => 'company_logo');
$this->load->library('upload', $config);
$this->upload->do_upload('company_logo');
return strlen($this->upload->display_errors()) == 0 ||
!strcmp($this->upload->display_errors(),
'<p>'.$this->lang->line('upload_no_file_selected').'</p>');
return strlen($this->upload->display_errors()) == 0 || !strcmp($this->upload->display_errors(), '<p>'.$this->lang->line('upload_no_file_selected').'</p>');
}
function backup_db()
@@ -186,13 +197,13 @@ class Config extends Secure_area
{
$this->load->dbutil();
$prefs = array(
'format' => 'zip',
'filename' => 'ospos.sql'
'format' => 'zip',
'filename' => 'ospos.sql'
);
$backup =& $this->dbutil->backup($prefs);
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.zip';
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.zip';
$save = 'uploads/'.$file_name;
$this->load->helper('download');
while (ob_get_level()) {

View File

@@ -1,6 +1,7 @@
<?php
require_once ("secure_area.php");
require_once ("interfaces/idata_controller.php");
class Giftcards extends Secure_area implements iData_controller
{
function __construct()
@@ -10,13 +11,13 @@ class Giftcards extends Secure_area implements iData_controller
function index($limit_from=0)
{
$data['controller_name']=$this->get_controller_name();
$data['form_width']=$this->get_form_width();
$data['controller_name'] = $this->get_controller_name();
$data['form_width'] = $this->get_form_width();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$giftcards = $this->Giftcard->get_all($lines_per_page,$limit_from);
$data['links'] = $this->_initialize_pagination($this->Giftcard,$lines_per_page,$limit_from);
$data['manage_table']=get_giftcards_manage_table($giftcards,$this);
$this->load->view('giftcards/manage',$data);
$giftcards = $this->Giftcard->get_all($lines_per_page, $limit_from);
$data['links'] = $this->_initialize_pagination($this->Giftcard, $lines_per_page, $limit_from);
$data['manage_table'] = get_giftcards_manage_table($giftcards, $this);
$this->load->view('giftcards/manage', $data);
}
function search()
@@ -26,8 +27,8 @@ class Giftcards extends Secure_area implements iData_controller
$lines_per_page = $this->Appconfig->get('lines_per_page');
$giftcards = $this->Giftcard->search($search, $lines_per_page, $limit_from);
$total_rows = $this->Giftcard->get_found_rows($search);
$links = $this->_initialize_pagination($this->Giftcard,$lines_per_page, $limit_from, $total_rows);
$data_rows=get_giftcards_manage_table_data_rows($giftcards,$this);
$links = $this->_initialize_pagination($this->Giftcard, $lines_per_page, $limit_from, $total_rows);
$data_rows = get_giftcards_manage_table_data_rows($giftcards, $this);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
}
@@ -36,23 +37,23 @@ class Giftcards extends Secure_area implements iData_controller
*/
function suggest()
{
$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));
$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'), $this->input->post('limit'));
echo implode("\n",$suggestions);
}
/** GARRISON ADDED 5/3/2013 **/
/*
Gives search suggestions for person_id based on what is being searched for
*/
function person_search()
{
$suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('q'),$this->input->post('limit'));
$suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('q'), $this->input->post('limit'));
echo implode("\n",$suggestions);
}
/** END GARRISON ADDED **/
function get_row()
{
$giftcard_id = $this->input->post('row_id');
$data_row=get_giftcard_data_row($this->Giftcard->get_info($giftcard_id),$this);
$data_row = get_giftcard_data_row($this->Giftcard->get_info($giftcard_id), $this);
echo $data_row;
}
@@ -61,7 +62,7 @@ class Giftcards extends Secure_area implements iData_controller
$giftcard_info = $this->Giftcard->get_info($giftcard_id);
$person_name=$giftcard_id > 0? $giftcard_info->first_name . ' ' . $giftcard_info->last_name : '';
$data['selected_person'] = $giftcard_id > 0 && isset($giftcard_info->person_id) ? $giftcard_info->person_id . "|" . $person_name : "";
$data['giftcard_number']= $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1;
$data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1;
$data['giftcard_info'] = $giftcard_info;
$this->load->view("giftcards/form",$data);
}
@@ -70,9 +71,9 @@ class Giftcards extends Secure_area implements iData_controller
{
$giftcard_data = array(
'record_time' => date('Y-m-d H:i:s'),
'giftcard_number'=>$this->input->post('giftcard_number',TRUE),
'value'=>$this->input->post('value',TRUE),
'person_id'=>$this->input->post('person_id',TRUE)?$this->input->post('person_id'):NULL
'giftcard_number'=>$this->input->post('giftcard_number', TRUE),
'value'=>$this->input->post('value', TRUE),
'person_id'=>$this->input->post('person_id', TRUE) ? $this->input->post('person_id') : NULL
);
if( $this->Giftcard->save( $giftcard_data, $giftcard_id ) )
@@ -80,20 +81,20 @@ class Giftcards extends Secure_area implements iData_controller
//New giftcard
if($giftcard_id==-1)
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('giftcards_successful_adding').' '.
$giftcard_data['giftcard_number'],'giftcard_id'=>$giftcard_data['giftcard_id']));
echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_adding').' '.
$giftcard_data['giftcard_number'], 'giftcard_id'=>$giftcard_data['giftcard_id']));
$giftcard_id = $giftcard_data['giftcard_id'];
}
else //previous giftcard
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('giftcards_successful_updating').' '.
$giftcard_data['giftcard_number'],'giftcard_id'=>$giftcard_id));
echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_updating').' '.
$giftcard_data['giftcard_number'], 'giftcard_id'=>$giftcard_id));
}
}
else//failure
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('giftcards_error_adding_updating').' '.
$giftcard_data['giftcard_number'],'giftcard_id'=>-1));
$giftcard_data['giftcard_number'], 'giftcard_id'=>-1));
}
}
@@ -103,12 +104,12 @@ class Giftcards extends Secure_area implements iData_controller
if($this->Giftcard->delete_list($giftcards_to_delete))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('giftcards_successful_deleted').' '.
count($giftcards_to_delete).' '.$this->lang->line('giftcards_one_or_multiple')));
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
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('giftcards_cannot_be_deleted')));
echo json_encode(array('success'=>false, 'message'=>$this->lang->line('giftcards_cannot_be_deleted')));
}
}

View File

@@ -8,15 +8,41 @@ class Item_kits extends Secure_area implements iData_controller
parent::__construct('item_kits');
}
// add the total cost and retail price to a passed items kit retrieving the data from each singolar item part of the kit
private function add_totals_to_item_kit($item_kit)
{
$item_kit->total_cost_price = 0;
$item_kit->total_unit_price = 0;
foreach ($this->Item_kit_items->get_info($item_kit->item_kit_id) as $item_kit_item)
{
$item_info = $this->Item->get_info($item_kit_item['item_id']);
$item_kit->total_cost_price += $item_info->cost_price * $item_kit_item['quantity'];
$item_kit->total_unit_price += $item_info->unit_price * $item_kit_item['quantity'];
}
return $item_kit;
}
function index($limit_from=0)
{
$data['controller_name']=$this->get_controller_name();
$data['form_width']=$this->get_form_width();
$data['controller_name'] = $this->get_controller_name();
$data['form_width'] = $this->get_form_width();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$item_kits = $this->Item_kit->get_all($lines_per_page,$limit_from);
$data['links'] = $this->_initialize_pagination($this->Item_kit,$lines_per_page,$limit_from);
$data['manage_table']=get_item_kits_manage_table($item_kits,$this);
$this->load->view('item_kits/manage',$data);
$item_kits = $this->Item_kit->get_all($lines_per_page, $limit_from);
foreach($item_kits->result() as $item_kit)
{
// calculate the total cost and retail price of the Kit so it can be printed out in the manage table
$item_kit = $this->add_totals_to_item_kit($item_kit);
}
$data['links'] = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from);
$data['manage_table'] = get_item_kits_manage_table($item_kits, $this);
$this->load->view('item_kits/manage', $data);
$this->_remove_duplicate_cookies();
}
function search()
@@ -24,10 +50,19 @@ class Item_kits extends Secure_area implements iData_controller
$search = $this->input->post('search');
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$customers = $this->Item_kit->search($search, $lines_per_page, $limit_from);
$item_kits = $this->Item_kit->search($search, $lines_per_page, $limit_from);
$total_rows = $this->Item_kit->get_found_rows($search);
$links = $this->_initialize_pagination($this->Item_kit,$lines_per_page, $limit_from, $total_rows);
$data_rows=get_item_kits_manage_table_data_rows($customers,$this);
$links = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from, $total_rows, 'search');
foreach($item_kits->result() as $item_kit)
{
// calculate the total cost and retail price of the Kit so it can be printed out in the manage table
$item_kit = $this->add_totals_to_item_kit($item_kit);
}
$data_rows = get_item_kits_manage_table_data_rows($item_kits, $this);
$this->_remove_duplicate_cookies();
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
}
@@ -36,43 +71,51 @@ class Item_kits extends Secure_area implements iData_controller
*/
function suggest()
{
$suggestions = $this->Item_kit->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));
echo implode("\n",$suggestions);
$suggestions = $this->Item_kit->get_search_suggestions($this->input->post('q'), $this->input->post('limit'));
echo implode("\n", $suggestions);
}
function get_row()
{
$item_kit_id = $this->input->post('row_id');
$data_row=get_item_kit_data_row($this->Item_kit->get_info($item_kit_id),$this);
echo $data_row;
// calculate the total cost and retail price of the Kit so it can be added to the table refresh
$item_kit = $this->add_totals_to_item_kit($this->Item_kit->get_info($item_kit_id));
echo (get_item_kit_data_row($item_kit, $this));
$this->_remove_duplicate_cookies();
}
function view($item_kit_id=-1)
{
$data['item_kit_info']=$this->Item_kit->get_info($item_kit_id);
$this->load->view("item_kits/form",$data);
$data['item_kit_info'] = $this->Item_kit->get_info($item_kit_id);
$this->load->view("item_kits/form", $data);
}
function save($item_kit_id=-1)
{
$item_kit_data = array(
'name'=>$this->input->post('name'),
'description'=>$this->input->post('description')
'name' => $this->input->post('name'),
'description' => $this->input->post('description')
);
if($this->Item_kit->save($item_kit_data,$item_kit_id))
if ($this->Item_kit->save($item_kit_data, $item_kit_id))
{
//New item kit
if($item_kit_id==-1)
if ($item_kit_id==-1)
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('item_kits_successful_adding').' '.
$item_kit_data['name'],'item_kit_id'=>$item_kit_data['item_kit_id']));
$item_kit_id = $item_kit_data['item_kit_id'];
echo json_encode(array('success'=>true,
'message'=>$this->lang->line('item_kits_successful_adding').' '.$item_kit_data['name'],
'item_kit_id'=>$item_kit_id));
}
else //previous item
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('item_kits_successful_updating').' '.
$item_kit_data['name'],'item_kit_id'=>$item_kit_id));
echo json_encode(array('success'=>true,
'message'=>$this->lang->line('item_kits_successful_updating').' '.$item_kit_data['name'],
'item_kit_id'=>$item_kit_id));
}
if ($this->input->post('item_kit_item'))
@@ -83,7 +126,7 @@ class Item_kits extends Secure_area implements iData_controller
$item_kit_items[] = array(
'item_id' => $item_id,
'quantity' => $quantity
);
);
}
$this->Item_kit_items->save($item_kit_items, $item_kit_id);
@@ -91,24 +134,25 @@ class Item_kits extends Secure_area implements iData_controller
}
else//failure
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('item_kits_error_adding_updating').' '.
$item_kit_data['name'],'item_kit_id'=>-1));
echo json_encode(array('success'=>false,
'message'=>$this->lang->line('item_kits_error_adding_updating').' '.$item_kit_data['name'],
'item_kit_id'=>-1));
}
}
function delete()
{
$item_kits_to_delete=$this->input->post('ids');
$item_kits_to_delete = $this->input->post('ids');
if($this->Item_kit->delete_list($item_kits_to_delete))
if ($this->Item_kit->delete_list($item_kits_to_delete))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('item_kits_successful_deleted').' '.
count($item_kits_to_delete).' '.$this->lang->line('item_kits_one_or_multiple')));
echo json_encode(array('success'=>true,
'message'=>$this->lang->line('item_kits_successful_deleted').' '.count($item_kits_to_delete).' '.$this->lang->line('item_kits_one_or_multiple')));
}
else
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('item_kits_cannot_be_deleted')));
echo json_encode(array('success'=>false,
'message'=>$this->lang->line('item_kits_cannot_be_deleted')));
}
}
@@ -119,19 +163,25 @@ class Item_kits extends Secure_area implements iData_controller
$item_kit_ids = explode(':', $item_kit_ids);
foreach ($item_kit_ids as $item_kid_id)
{
$item_kit_info = $this->Item_kit->get_info($item_kid_id);
{
// calculate the total cost and retail price of the Kit so it can be added to the barcode text at the bottom
$item_kit = $this->add_totals_to_item_kit($this->Item_kit->get_info($item_kid_id));
$result[] = array('name' =>$item_kit_info->name, 'item_id'=> 'KIT '.$item_kid_id, 'item_number'=>'KIT '.$item_kid_id);
$result[] = array('name'=>$item_kit->name, 'item_id'=>'KIT '.$item_kid_id, 'item_number'=>'KIT '.$item_kid_id, 'cost_price'=>$item_kit->total_cost_price, 'unit_price'=>$item_kit->total_unit_price);
}
$data['items'] = $result;
$data['configs'] = $this->Appconfig->get_all();
$data['barcode_config'] = $this->barcode_lib->get_barcode_config();
$barcode_config = $this->barcode_lib->get_barcode_config();
// in case the selected barcode type is not Code39 or Code128 we set by default Code128
// the rationale for this is that EAN codes cannot have strings as seed, so 'KIT ' is not allowed
if($barcode_config['barcode_type'] != 'Code39' && $barcode_config['barcode_type'] != 'Code128')
{
$barcode_config['barcode_type'] = 'Code128';
}
$data['barcode_config'] = $barcode_config;
$this->load->view("barcode_sheet", $data);
}
/*
get the width for the add/edit form
*/

View File

@@ -1,6 +1,7 @@
<?php
require_once ("secure_area.php");
require_once ("interfaces/idata_controller.php");
class Items extends Secure_area implements iData_controller
{
function __construct()
@@ -11,19 +12,33 @@ class Items extends Secure_area implements iData_controller
function index($limit_from=0)
{
$stock_location=$this->item_lib->get_item_location();
$stock_locations=$this->Stock_locations->get_allowed_locations();
$stock_location = $this->item_lib->get_item_location();
$stock_locations = $this->Stock_location->get_allowed_locations();
$data['controller_name']=$this->get_controller_name();
$data['form_width']=$this->get_form_width();
$data['controller_name'] = $this->get_controller_name();
$data['form_width'] = $this->get_form_width();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$items = $this->Item->get_all($stock_location,$lines_per_page,$limit_from);
$data['links'] = $this->_initialize_pagination($this->Item,$lines_per_page,$limit_from);
$items = $this->Item->get_all($stock_location, $lines_per_page, $limit_from);
$data['links'] = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from);
$data['stock_location']=$stock_location;
$data['stock_locations']=$stock_locations;
$data['manage_table']=get_items_manage_table( $this->Item->get_all( $stock_location, $lines_per_page, $limit_from), $this );
$this->load->view('items/manage',$data);
// assume year 2010 as starting date for OSPOS
$start_of_time = date($this->config->item('dateformat'), mktime(0,0,0,1,1,2010));
$today = date($this->config->item('dateformat'));
$start_date = $this->input->post('start_date') != NULL ? $this->input->post('start_date', TRUE) : $start_of_time;
$start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date);
$end_date = $this->input->post('end_date') != NULL ? $this->input->post('end_date', TRUE) : $today;
$end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date);
$data['start_date'] = $start_date_formatter->format($this->config->item('dateformat'));
$data['end_date'] = $end_date_formatter->format($this->config->item('dateformat'));
$data['stock_location'] = $stock_location;
$data['stock_locations'] = $stock_locations;
$data['manage_table'] = get_items_manage_table( $this->Item->get_all($stock_location, $lines_per_page, $limit_from), $this );
$this->load->view('items/manage', $data);
$this->_remove_duplicate_cookies();
}
@@ -37,21 +52,37 @@ class Items extends Secure_area implements iData_controller
{
$search = $this->input->post('search');
$this->item_lib->set_item_location($this->input->post('stock_location'));
$stock_location=$this->item_lib->get_item_location();
$data['search_section_state'] = $this->input->post('search_section_state');
$low_inventory=$this->input->post('low_inventory');
$is_serialized=$this->input->post('is_serialized');
$no_description=$this->input->post('no_description');
$search_custom=$this->input->post('search_custom');
$is_deleted=$this->input->post('is_deleted'); // Parq 131215
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$items = $this->Item->search($search,$stock_location,$low_inventory,$is_serialized,$no_description,$search_custom,$is_deleted,$lines_per_page,$limit_from);
$data_rows=get_items_manage_table_data_rows($items,$this);
$total_rows = $this->Item->get_found_rows($search,$stock_location,$low_inventory,$is_serialized,$no_description,$search_custom,$is_deleted);
// assume year 2010 as starting date for OSPOS
$start_of_time = date($this->config->item('dateformat'), mktime(0,0,0,1,1,2010));
$today = date($this->config->item('dateformat'));
$start_date = $this->input->post('start_date') != NULL ? $this->input->post('start_date', TRUE) : $start_of_time;
$start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date);
$end_date = $this->input->post('end_date') != NULL ? $this->input->post('end_date', TRUE) : $today;
$end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date);
$filters = array('start_date' => $start_date_formatter->format('Y-m-d'),
'end_date' => $end_date_formatter->format('Y-m-d'),
'stock_location_id' => $this->item_lib->get_item_location(),
'empty_upc' => $this->input->post('empty_upc'),
'low_inventory' => $this->input->post('low_inventory'),
'is_serialized' => $this->input->post('is_serialized'),
'no_description' => $this->input->post('no_description'),
'search_custom' => $this->input->post('search_custom'),
'is_deleted' => $this->input->post('is_deleted'));
$items = $this->Item->search($search, $filters, $lines_per_page, $limit_from);
$data_rows = get_items_manage_table_data_rows($items, $this);
$total_rows = $this->Item->get_found_rows($search, $filters);
$links = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from, $total_rows, 'search');
$data_rows=get_items_manage_table_data_rows($items,$this);
$data_rows = get_items_manage_table_data_rows($items, $this);
// do not move this line to be after the json_encode otherwise the searhc function won't work!!
$this->_remove_duplicate_cookies();
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
}
@@ -88,13 +119,16 @@ class Items extends Secure_area implements iData_controller
*/
function suggest()
{
$suggestions = $this->Item->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));
$suggestions = $this->Item->get_search_suggestions($this->input->post('q'), $this->input->post('limit'),
$this->input->post('search_custom'), $this->input->post('is_deleted'));
echo implode("\n",$suggestions);
}
function item_search()
{
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit'),'warehouse');
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'), $this->input->post('limit'));
echo implode("\n",$suggestions);
}
@@ -104,16 +138,17 @@ class Items extends Secure_area implements iData_controller
function suggest_category()
{
$suggestions = $this->Item->get_category_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
/**GARRISON ADDED 5/18/2013**/
/*
Gives search suggestions based on what is being searched for
*/
function suggest_location()
{
$suggestions = $this->Item->get_location_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -123,6 +158,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom1()
{
$suggestions = $this->Item->get_custom1_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -132,6 +168,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom2()
{
$suggestions = $this->Item->get_custom2_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -141,6 +178,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom3()
{
$suggestions = $this->Item->get_custom3_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -150,6 +188,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom4()
{
$suggestions = $this->Item->get_custom4_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -159,6 +198,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom5()
{
$suggestions = $this->Item->get_custom5_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -168,6 +208,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom6()
{
$suggestions = $this->Item->get_custom6_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -177,6 +218,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom7()
{
$suggestions = $this->Item->get_custom7_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -186,6 +228,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom8()
{
$suggestions = $this->Item->get_custom8_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -195,6 +238,7 @@ class Items extends Secure_area implements iData_controller
function suggest_custom9()
{
$suggestions = $this->Item->get_custom9_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
@@ -204,21 +248,21 @@ class Items extends Secure_area implements iData_controller
function suggest_custom10()
{
$suggestions = $this->Item->get_custom10_suggestions($this->input->post('q'));
echo implode("\n",$suggestions);
}
/**END GARRISON ADDED**/
function get_row()
{
$item_id = $this->input->post('row_id');
$item_info = $this->Item->get_info($item_id);
$stock_location = $this->item_lib->get_item_location();
$item_quantity = $this->Item_quantities->get_item_quantity($item_id,$stock_location);
$item_quantity = $this->Item_quantity->get_item_quantity($item_id,$stock_location);
$item_info->quantity = $item_quantity->quantity;
$data_row=get_item_data_row($item_info,$this);
$data_row = get_item_data_row($item_info,$this);
echo $data_row;
$this->_remove_duplicate_cookies();
}
@@ -237,33 +281,31 @@ class Items extends Secure_area implements iData_controller
$data['default_tax_1_rate']=($item_id==-1) ? $this->Appconfig->get('default_tax_1_rate') : '';
$data['default_tax_2_rate']=($item_id==-1) ? $this->Appconfig->get('default_tax_2_rate') : '';
$locations_data = $this->Stock_locations->get_undeleted_all()->result_array();
$locations_data = $this->Stock_location->get_undeleted_all()->result_array();
foreach($locations_data as $location)
{
$quantity = $this->Item_quantities->get_item_quantity($item_id,$location['location_id'])->quantity;
$quantity = $this->Item_quantity->get_item_quantity($item_id,$location['location_id'])->quantity;
$quantity = ($item_id == -1) ? null: $quantity;
$location_array[$location['location_id']] = array('location_name'=>$location['location_name'],
'quantity'=>$quantity);
$data['stock_locations']= $location_array;
$location_array[$location['location_id']] = array('location_name'=>$location['location_name'], 'quantity'=>$quantity);
$data['stock_locations'] = $location_array;
}
$this->load->view("items/form",$data);
}
$this->load->view("items/form", $data);
}
//Ramel Inventory Tracking
function inventory($item_id=-1)
{
$data['item_info']=$this->Item->get_info($item_id);
$data['stock_locations'] = array();
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
$stock_locations = $this->Stock_location->get_undeleted_all()->result_array();
foreach($stock_locations as $location_data)
{
$data['stock_locations'][$location_data['location_id']] = $location_data['location_name'];
$data['item_quantities'][$location_data['location_id']] = $this->Item_quantities->get_item_quantity($item_id,$location_data['location_id'])->quantity;
$data['item_quantities'][$location_data['location_id']] = $this->Item_quantity->get_item_quantity($item_id,$location_data['location_id'])->quantity;
}
$this->load->view("items/inventory",$data);
$this->load->view("items/inventory", $data);
}
function count_details($item_id=-1)
@@ -271,15 +313,15 @@ class Items extends Secure_area implements iData_controller
$data['item_info']=$this->Item->get_info($item_id);
$data['stock_locations'] = array();
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
$stock_locations = $this->Stock_location->get_undeleted_all()->result_array();
foreach($stock_locations as $location_data)
{
$data['stock_locations'][$location_data['location_id']] = $location_data['location_name'];
$data['item_quantities'][$location_data['location_id']] = $this->Item_quantities->get_item_quantity($item_id,$location_data['location_id'])->quantity;
$data['item_quantities'][$location_data['location_id']] = $this->Item_quantity->get_item_quantity($item_id,$location_data['location_id'])->quantity;
}
$this->load->view("items/count_details",$data);
} //------------------------------------------- Ramel
$this->load->view("items/count_details", $data);
}
function generate_barcodes($item_ids)
{
@@ -288,10 +330,34 @@ class Items extends Secure_area implements iData_controller
$item_ids = explode(':', $item_ids);
$result = $this->Item->get_multiple_info($item_ids)->result_array();
$config = $this->barcode_lib->get_barcode_config();
$data['barcode_config'] = $config;
// check the list of items to see if any item_number field is empty
foreach($result as &$item)
{
// update the UPC/EAN/ISBN field if empty / null with the newly generated barcode
if (empty($item['item_number']) && $this->Appconfig->get('barcode_generate_if_empty'))
{
// get the newly generated barcode
$barcode_instance = Barcode_lib::barcode_instance($item, $config);
$item['item_number'] = $barcode_instance->getData();
// remove from item any suppliers table info to avoid save failure because of unknown fields
// WARNING: if suppliers table is changed this list needs to be upgraded, which makes the matter a bit tricky to maintain
unset($item['person_id']);
unset($item['company_name']);
unset($item['account_number']);
unset($item['agency_name']);
// update the item in the database in order to save the UPC/EAN/ISBN field
$this->Item->save($item, $item['item_id']);
}
}
$data['items'] = $result;
$data['barcode_config'] = $this->barcode_lib->get_barcode_config();
// display barcodes
$this->load->view("barcode_sheet", $data);
}
function bulk_edit()
@@ -300,7 +366,7 @@ class Items extends Secure_area implements iData_controller
$suppliers = array('' => $this->lang->line('items_none'));
foreach($this->Supplier->get_all()->result_array() as $row)
{
$suppliers[$row['person_id']] = $row['first_name'] .' '. $row['last_name'];
$suppliers[$row['person_id']] = $row['company_name'];
}
$data['suppliers'] = $suppliers;
$data['allow_alt_description_choices'] = array(
@@ -312,6 +378,7 @@ class Items extends Secure_area implements iData_controller
''=>$this->lang->line('items_do_nothing'),
1 =>$this->lang->line('items_change_all_to_serialized'),
0 =>$this->lang->line('items_change_all_to_unserialized'));
$this->load->view("items/form_bulk", $data);
}
@@ -321,28 +388,28 @@ class Items extends Secure_area implements iData_controller
$upload_data = $this->upload->data();
//Save item data
$item_data = array(
'name'=>$this->input->post('name'),
'description'=>$this->input->post('description'),
'category'=>$this->input->post('category'),
'supplier_id'=>$this->input->post('supplier_id')=='' ? null:$this->input->post('supplier_id'),
'item_number'=>$this->input->post('item_number')=='' ? null:$this->input->post('item_number'),
'cost_price'=>$this->input->post('cost_price'),
'unit_price'=>$this->input->post('unit_price'),
'reorder_level'=>$this->input->post('reorder_level'),
'receiving_quantity'=>$this->input->post('receiving_quantity'),
'allow_alt_description'=>$this->input->post('allow_alt_description'),
'is_serialized'=>$this->input->post('is_serialized'),
'deleted'=>$this->input->post('is_deleted'), /** Parq 131215 **/
'custom1'=>$this->input->post('custom1'), /**GARRISON ADDED 4/21/2013**/
'custom2'=>$this->input->post('custom2'),/**GARRISON ADDED 4/21/2013**/
'custom3'=>$this->input->post('custom3'),/**GARRISON ADDED 4/21/2013**/
'custom4'=>$this->input->post('custom4'),/**GARRISON ADDED 4/21/2013**/
'custom5'=>$this->input->post('custom5'),/**GARRISON ADDED 4/21/2013**/
'custom6'=>$this->input->post('custom6'),/**GARRISON ADDED 4/21/2013**/
'custom7'=>$this->input->post('custom7'),/**GARRISON ADDED 4/21/2013**/
'custom8'=>$this->input->post('custom8'),/**GARRISON ADDED 4/21/2013**/
'custom9'=>$this->input->post('custom9'),/**GARRISON ADDED 4/21/2013**/
'custom10'=>$this->input->post('custom10')/**GARRISON ADDED 4/21/2013**/
'name'=>$this->input->post('name'),
'description'=>$this->input->post('description'),
'category'=>$this->input->post('category'),
'supplier_id'=>$this->input->post('supplier_id')=='' ? null:$this->input->post('supplier_id'),
'item_number'=>$this->input->post('item_number')=='' ? null:$this->input->post('item_number'),
'cost_price'=>$this->input->post('cost_price'),
'unit_price'=>$this->input->post('unit_price'),
'reorder_level'=>$this->input->post('reorder_level'),
'receiving_quantity'=>$this->input->post('receiving_quantity'),
'allow_alt_description'=>$this->input->post('allow_alt_description'),
'is_serialized'=>$this->input->post('is_serialized'),
'deleted'=>$this->input->post('is_deleted'),
'custom1'=>$this->input->post('custom1'),
'custom2'=>$this->input->post('custom2'),
'custom3'=>$this->input->post('custom3'),
'custom4'=>$this->input->post('custom4'),
'custom5'=>$this->input->post('custom5'),
'custom6'=>$this->input->post('custom6'),
'custom7'=>$this->input->post('custom7'),
'custom8'=>$this->input->post('custom8'),
'custom9'=>$this->input->post('custom9'),
'custom10'=>$this->input->post('custom10')
);
if (!empty($upload_data['orig_name']))
@@ -350,7 +417,7 @@ class Items extends Secure_area implements iData_controller
$item_data['pic_id'] = $upload_data['raw_name'];
}
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
$cur_item_info = $this->Item->get_info($item_id);
if($this->Item->save($item_data,$item_id))
@@ -358,7 +425,7 @@ class Items extends Secure_area implements iData_controller
$success = TRUE;
$new_item = FALSE;
//New item
if($item_id==-1)
if ($item_id==-1)
{
$item_id = $item_data['item_id'];
$new_item = TRUE;
@@ -375,23 +442,21 @@ class Items extends Secure_area implements iData_controller
}
}
$success &= $this->Item_taxes->save($items_taxes_data, $item_id);
//Save item quantity
$stock_locations = $this->Stock_locations->get_undeleted_all()->result_array();
$stock_locations = $this->Stock_location->get_undeleted_all()->result_array();
foreach($stock_locations as $location_data)
{
$updated_quantity = $this->input->post($location_data['location_id'].'_quantity');
$location_detail = array('item_id'=>$item_id,
'location_id'=>$location_data['location_id'],
'quantity'=>$updated_quantity);
$item_quantity = $this->Item_quantities->get_item_quantity($item_id, $location_data['location_id']);
$item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location_data['location_id']);
if ($item_quantity->quantity != $updated_quantity || $new_item)
{
$success &= $this->Item_quantities->save($location_detail, $item_id, $location_data['location_id']);
$success &= $this->Item_quantity->save($location_detail, $item_id, $location_data['location_id']);
$inv_data = array
(
$inv_data = array(
'trans_date'=>date('Y-m-d H:i:s'),
'trans_items'=>$item_id,
'trans_user'=>$employee_id,
@@ -399,6 +464,7 @@ class Items extends Secure_area implements iData_controller
'trans_comment'=>$this->lang->line('items_manually_editing_of_quantity'),
'trans_inventory'=>$updated_quantity - $item_quantity->quantity
);
$success &= $this->Inventory->insert($inv_data);
}
}
@@ -406,6 +472,7 @@ class Items extends Secure_area implements iData_controller
if ($success && $upload_success)
{
$success_message = $this->lang->line('items_successful_' . ($new_item ? 'adding' : 'updating')) .' '. $item_data['name'];
echo json_encode(array('success'=>true,'message'=>$success_message,'item_id'=>$item_id));
}
else
@@ -413,6 +480,7 @@ class Items extends Secure_area implements iData_controller
$error_message = $upload_success ?
$this->lang->line('items_error_adding_updating') .' '. $item_data['name'] :
$this->upload->display_errors();
echo json_encode(array('success'=>false,
'message'=>$error_message,'item_id'=>$item_id));
}
@@ -424,7 +492,6 @@ class Items extends Secure_area implements iData_controller
'message'=>$this->lang->line('items_error_adding_updating').' '
.$item_data['name'],'item_id'=>-1));
}
}
function check_item_number()
@@ -445,20 +512,19 @@ class Items extends Secure_area implements iData_controller
'max_height' => '480',
'file_name' => sizeof($map));
$this->load->library('upload', $config);
$this->upload->do_upload('item_image');
$this->upload->do_upload('item_image');
return strlen($this->upload->display_errors()) == 0 ||
!strcmp($this->upload->display_errors(),
'<p>'.$this->lang->line('upload_no_file_selected').'</p>');
}
//Ramel Inventory Tracking
function save_inventory($item_id=-1)
{
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$cur_item_info = $this->Item->get_info($item_id);
$location_id = $this->input->post('stock_location');
$inv_data = array
(
$inv_data = array(
'trans_date'=>date('Y-m-d H:i:s'),
'trans_items'=>$item_id,
'trans_user'=>$employee_id,
@@ -466,17 +532,18 @@ class Items extends Secure_area implements iData_controller
'trans_comment'=>$this->input->post('trans_comment'),
'trans_inventory'=>$this->input->post('newquantity')
);
$this->Inventory->insert($inv_data);
//Update stock quantity
$item_quantity= $this->Item_quantities->get_item_quantity($item_id,$location_id);
$item_quantity= $this->Item_quantity->get_item_quantity($item_id,$location_id);
$item_quantity_data = array(
'item_id'=>$item_id,
'location_id'=>$location_id,
'quantity'=>$item_quantity->quantity + $this->input->post('newquantity')
'item_id'=>$item_id,
'location_id'=>$location_id,
'quantity'=>$item_quantity->quantity + $this->input->post('newquantity')
);
if($this->Item_quantities->save($item_quantity_data,$item_id,$location_id))
if($this->Item_quantity->save($item_quantity_data,$item_id,$location_id))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_updating').' '.
$cur_item_info->name,'item_id'=>$item_id));
@@ -486,8 +553,7 @@ class Items extends Secure_area implements iData_controller
echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_error_adding_updating').' '.
$cur_item_info->name,'item_id'=>-1));
}
}//---------------------------------------------------------------------Ramel
}
function bulk_update()
{
@@ -565,6 +631,7 @@ class Items extends Secure_area implements iData_controller
{
$msg = $this->lang->line('items_excel_import_failed');
echo json_encode( array('success'=>false,'message'=>$msg) );
return;
}
else
@@ -588,16 +655,16 @@ class Items extends Secure_area implements iData_controller
'supplier_id' => $this->Supplier->exists($data[3]) ? $data[3] : null,
'allow_alt_description' => $data[12] != '' ? '1' : '0',
'is_serialized' => $data[13] != '' ? '1' : '0',
'custom1' => $data[14], /** GARRISON ADDED 5/6/2013 **/
'custom2' => $data[15], /** GARRISON ADDED 5/6/2013 **/
'custom3' => $data[16], /** GARRISON ADDED 5/6/2013 **/
'custom4' => $data[17], /** GARRISON ADDED 5/6/2013 **/
'custom5' => $data[18], /** GARRISON ADDED 5/6/2013 **/
'custom6' => $data[19], /** GARRISON ADDED 5/6/2013 **/
'custom7' => $data[20], /** GARRISON ADDED 5/6/2013 **/
'custom8' => $data[21], /** GARRISON ADDED 5/6/2013 **/
'custom9' => $data[22], /** GARRISON ADDED 5/6/2013 **/
'custom10' => $data[23] /** GARRISON ADDED 5/6/2013 **/
'custom1' => $data[14],
'custom2' => $data[15],
'custom3' => $data[16],
'custom4' => $data[17],
'custom5' => $data[18],
'custom6' => $data[19],
'custom7' => $data[20],
'custom8' => $data[21],
'custom9' => $data[22],
'custom10' => $data[23]
);
$item_number = $data[0];
$invalidated = false;
@@ -640,7 +707,7 @@ class Items extends Secure_area implements iData_controller
$cols = count($data);
// array to store information if location got a quantity
$allowed_locations = $this->Stock_locations->get_allowed_locations();
$allowed_locations = $this->Stock_location->get_allowed_locations();
for ($col = 24; $col < $cols; $col = $col + 2)
{
$location_id = $data[$col];
@@ -651,15 +718,16 @@ class Items extends Secure_area implements iData_controller
'location_id' => $location_id,
'quantity' => $data[$col + 1],
);
$this->Item_quantities->save($item_quantity_data, $item_data['item_id'], $location_id);
$this->Item_quantity->save($item_quantity_data, $item_data['item_id'], $location_id);
$excel_data = array (
$excel_data = array(
'trans_items'=>$item_data['item_id'],
'trans_user'=>$employee_id,
'trans_comment'=>$comment,
'trans_location'=>$data[$col],
'trans_inventory'=>$data[$col + 1]
);
$this->Inventory->insert($excel_data);
unset($allowed_locations[$location_id]);
}
@@ -677,7 +745,7 @@ class Items extends Secure_area implements iData_controller
'location_id' => $location_id,
'quantity' => 0,
);
$this->Item_quantities->save($item_quantity_data, $item_data['item_id'], $data[$col]);
$this->Item_quantity->save($item_quantity_data, $item_data['item_id'], $data[$col]);
$excel_data = array
(
@@ -699,7 +767,8 @@ class Items extends Secure_area implements iData_controller
}
else
{
echo json_encode( array('success'=>false,'message'=>'Your upload file has no data or not in supported format.') );
echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') );
return;
}
}
@@ -715,7 +784,7 @@ class Items extends Secure_area implements iData_controller
$msg = "Import items successful";
}
echo json_encode( array('success'=>$success,'message'=>$msg) );
echo json_encode( array('success'=>$success, 'message'=>$msg) );
}
/*
@@ -725,6 +794,5 @@ class Items extends Secure_area implements iData_controller
{
return 450;
}
}
?>

View File

@@ -30,7 +30,7 @@ abstract class Person_controller extends Secure_area implements iPerson_controll
}
echo '#';
}
/** GARRISON ADDED 4/25/2013 IN PROGRESS **/
/*
Gives search suggestions based on what is being searched for
*/
@@ -49,6 +49,5 @@ abstract class Person_controller extends Secure_area implements iPerson_controll
$data_row=get_person_data_row($this->Person->get_info($person_id),$this);
echo $data_row;
}
}
?>

View File

@@ -45,7 +45,7 @@ class Receivings extends Secure_area
$mode = $this->input->post("mode");
$this->receiving_lib->set_mode($mode);
}
else if ($this->Stock_locations->is_allowed_location($stock_source, 'receivings'))
else if ($this->Stock_location->is_allowed_location($stock_source, 'receivings'))
{
$this->receiving_lib->set_stock_source($stock_source);
$this->receiving_lib->set_stock_destination($stock_destination);
@@ -181,9 +181,9 @@ class Receivings extends Secure_area
$data['cart']=$this->receiving_lib->get_cart();
$data['total']=$this->receiving_lib->get_total();
$data['receipt_title']=$this->lang->line('recvs_receipt');
$data['transaction_time']= date('m/d/Y h:i:s a');
$data['transaction_time']= date($this->config->item('dateformat').' '.$this->config->item('timeformat'));
$data['mode']=$this->receiving_lib->get_mode();
$data['show_stock_locations']=$this->Stock_locations->show_locations('receivings');
$data['show_stock_locations']=$this->Stock_location->show_locations('receivings');
$supplier_id=$this->receiving_lib->get_supplier();
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$comment = $this->input->post('comment');
@@ -220,8 +220,7 @@ class Receivings extends Secure_area
{
$data['error_message'] = $this->lang->line('receivings_transaction_failed');
}
$barcode_config=array('barcode_type'=>2,'barcode_width'=>200, 'barcode_height'=>30, 'barcode_quality'=>100);
$data['barcode']=$this->barcode_lib->generate_barcode($data['receiving_id'],$barcode_config);
$data['barcode']=$this->barcode_lib->generate_receipt_barcode($data['receiving_id']);
$data['print_after_sale'] = $this->receiving_lib->is_print_after_sale();
$this->load->view("receivings/receipt",$data);
$this->receiving_lib->clear_all();
@@ -229,7 +228,7 @@ class Receivings extends Secure_area
$this->_remove_duplicate_cookies();
}
function _substitute_variable($text, $variable, $object, $function)
private function _substitute_variable($text, $variable, $object, $function)
{
// don't query if this variable isn't used
if (strstr($text, $variable))
@@ -240,7 +239,7 @@ class Receivings extends Secure_area
return $text;
}
function _substitute_variables($text,$supplier_info)
private function _substitute_variables($text,$supplier_info)
{
$text=$this->_substitute_variable($text, '$YCO', $this->Receiving, 'get_invoice_number_for_year');
$text=$this->_substitute_variable($text, '$CO', $this->Receiving , 'get_invoice_count');
@@ -250,7 +249,7 @@ class Receivings extends Secure_area
}
function _substitute_supplier($text,$supplier_info)
private function _substitute_supplier($text,$supplier_info)
{
$supplier_id=$this->receiving_lib->get_supplier();
if($supplier_id!=-1)
@@ -266,16 +265,13 @@ class Receivings extends Secure_area
return $text;
}
function _substitute_invoice_number($supplier_info='')
private function _substitute_invoice_number($supplier_info='')
{
$invoice_number=$this->receiving_lib->get_invoice_number();
if (empty($invoice_number))
{
$invoice_number=$this->config->config['recv_invoice_format'];
}
$invoice_number=$this->config->config['recv_invoice_format'];
$invoice_number = $this->_substitute_variables($invoice_number,$supplier_info);
$this->receiving_lib->set_invoice_number($invoice_number);
return $invoice_number;
return $this->receiving_lib->get_invoice_number();
}
function requisition_complete()
@@ -306,15 +302,14 @@ class Receivings extends Secure_area
$data['total']=$this->receiving_lib->get_total();
$data['mode']=$this->receiving_lib->get_mode();
$data['receipt_title']=$this->lang->line('recvs_receipt');
$data['transaction_time']= date('m/d/Y h:i:s a', strtotime($receiving_info['receiving_time']));
$data['show_stock_locations']=$this->Stock_locations->show_locations('receivings');
$data['transaction_time']= date($this->config->item('dateformat').' '.$this->config->item('timeformat'), strtotime($receiving_info['receiving_time']));
$data['show_stock_locations']=$this->Stock_location->show_locations('receivings');
$supplier_id=$this->receiving_lib->get_supplier();
$emp_info=$this->Employee->get_info($receiving_info['employee_id']);
$data['payment_type']=$receiving_info['payment_type'];
$data['invoice_number']=$this->receiving_lib->get_invoice_number();
$data['receiving_id']='RECV '.$receiving_id;
$barcode_config=array('barcode_type'=>2,'barcode_width'=>200, 'barcode_height'=>30, 'barcode_quality'=>100);
$data['barcode']=$this->barcode_lib->generate_barcode($data['receiving_id'],$barcode_config);
$data['barcode']=$this->barcode_lib->generate_receipt_barcode($data['receiving_id']);
$data['employee']=$emp_info->first_name.' '.$emp_info->last_name;
if($supplier_id!=-1)
@@ -328,14 +323,14 @@ class Receivings extends Secure_area
$this->_remove_duplicate_cookies();
}
function _reload($data=array())
private function _reload($data=array())
{
$person_info = $this->Employee->get_logged_in_employee_info();
$data['cart']=$this->receiving_lib->get_cart();
$data['modes']=array('receive'=>$this->lang->line('recvs_receiving'),'return'=>$this->lang->line('recvs_return'));
$data['mode']=$this->receiving_lib->get_mode();
$data['stock_locations']=$this->Stock_locations->get_allowed_locations('receivings');
$data['stock_locations']=$this->Stock_location->get_allowed_locations('receivings');
$show_stock_locations = count($data['stock_locations']) > 1;
if ($show_stock_locations)
{
@@ -371,28 +366,30 @@ class Receivings extends Secure_area
function save($receiving_id)
{
$date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $this->input->post('date', TRUE));
$receiving_data = array(
'receiving_time' => date('Y-m-d H:i:s', strtotime($this->input->post('date'))),
'supplier_id' => $this->input->post('supplier_id') ? $this->input->post('supplier_id') : null,
'employee_id' => $this->input->post('employee_id'),
'comment' => $this->input->post('comment'),
'invoice_number' => $this->input->post('invoice_number') != '' ? $this->input->post('invoice_number') : null
'receiving_time' => $date_formatter->format('Y-m-d H:i:s'),
'supplier_id' => $this->input->post('supplier_id') ? $this->input->post('supplier_id') : null,
'employee_id' => $this->input->post('employee_id'),
'comment' => $this->input->post('comment'),
'invoice_number' => $this->input->post('invoice_number') != '' ? $this->input->post('invoice_number') : null
);
if ($this->Receiving->update($receiving_data, $receiving_id))
{
echo json_encode(array(
'success'=>true,
'message'=>$this->lang->line('recvs_successfully_updated'),
'id'=>$receiving_id)
'success'=>true,
'message'=>$this->lang->line('recvs_successfully_updated'),
'id'=>$receiving_id)
);
}
else
{
echo json_encode(array(
'success'=>false,
'message'=>$this->lang->line('recvs_unsuccessfully_updated'),
'id'=>$receiving_id)
'success'=>false,
'message'=>$this->lang->line('recvs_unsuccessfully_updated'),
'id'=>$receiving_id)
);
}
}
@@ -410,6 +407,5 @@ class Receivings extends Secure_area
$exists=!empty($invoice_number) && $this->Receiving->invoice_number_exists($invoice_number,$receiving_id);
echo json_encode(array('success'=>!$exists,'message'=>$this->lang->line('recvs_invoice_number_duplicate')));
}
}
?>

View File

@@ -69,6 +69,7 @@ class Reports extends Secure_area
to_currency($report_data['subtotal']),
to_currency($report_data['total']),
to_currency($report_data['tax']),
to_currency($report_data['cost']),
to_currency($report_data['profit']),
$report_data['payment_type'],
$report_data['comment']);
@@ -98,7 +99,7 @@ class Reports extends Secure_area
function get_summary_data($start_date, $end_date = NULL, $sale_type=0)
{
$end_date = $end_date ?: $start_date;
$end_date = $end_date ? $end_date : $start_date;
$this->load->model('reports/Summary_sales');
$model = $this->Summary_sales;
$summary = $model->getSummaryData(array(
@@ -118,12 +119,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['sale_date'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']));
$tabular_data[] = array($row['sale_date'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
}
$data = array(
"title" => $this->lang->line('reports_sales_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -143,12 +144,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['category'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']));
$tabular_data[] = array($row['category'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
}
$data = array(
"title" => $this->lang->line('reports_categories_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -168,12 +169,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['customer'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']));
$tabular_data[] = array($row['customer'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
}
$data = array(
"title" => $this->lang->line('reports_customers_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -193,12 +194,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['supplier'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']));
$tabular_data[] = array($row['supplier'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
}
$data = array(
"title" => $this->lang->line('reports_suppliers_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -218,12 +219,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array(character_limiter($row['name'], 16), $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']));
$tabular_data[] = array(character_limiter($row['name'], 40), $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
}
$data = array(
"title" => $this->lang->line('reports_items_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -243,12 +244,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['employee'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']));
$tabular_data[] = array($row['employee'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
}
$data = array(
"title" => $this->lang->line('reports_employees_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -268,12 +269,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['percent'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']));
$tabular_data[] = array($row['percent'], $row['count'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']));
}
$data = array(
"title" => $this->lang->line('reports_taxes_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -293,12 +294,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['discount_percent'],$row['count']);
$tabular_data[] = array($row['discount_percent'], $row['count']);
}
$data = array(
"title" => $this->lang->line('reports_discounts_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -308,6 +309,7 @@ class Reports extends Secure_area
$this->load->view("reports/tabular",$data);
}
//Summary payments report
function summary_payments($start_date, $end_date, $sale_type, $export_excel=0)
{
$this->load->model('reports/Summary_payments');
@@ -317,12 +319,12 @@ class Reports extends Secure_area
foreach($report_data as $row)
{
$tabular_data[] = array($row['payment_type'],to_currency($row['payment_amount']));
$tabular_data[] = array($row['payment_type'], $row['count'], to_currency($row['payment_amount']));
}
$data = array(
"title" => $this->lang->line('reports_payments_summary_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type)),
@@ -344,7 +346,7 @@ class Reports extends Secure_area
function date_input_sales()
{
$data = $this->_get_common_report_data();
$stock_locations = $this->Stock_locations->get_allowed_locations('sales');
$stock_locations = $this->Stock_location->get_allowed_locations('sales');
$stock_locations['all'] = $this->lang->line('reports_all');
$data['stock_locations'] = array_reverse($stock_locations, TRUE);
$data['mode'] = 'sale';
@@ -354,7 +356,7 @@ class Reports extends Secure_area
function date_input_recv()
{
$data = $this->_get_common_report_data();
$stock_locations = $this->Stock_locations->get_allowed_locations('receivings');
$stock_locations = $this->Stock_location->get_allowed_locations('receivings');
$stock_locations['all'] = $this->lang->line('reports_all');
$data['stock_locations'] = array_reverse($stock_locations, TRUE);
$data['mode'] = 'receiving';
@@ -370,7 +372,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_sales_summary_report'),
"data_file" => site_url("reports/graphical_summary_sales_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -387,7 +389,7 @@ class Reports extends Secure_area
$graph_data = array();
foreach($report_data as $row)
{
$graph_data[date('m/d/Y', strtotime($row['sale_date']))]= $row['total'];
$graph_data[date($this->config->item('dateformat'), strtotime($row['sale_date']))]= $row['total'];
}
$data = array(
@@ -410,7 +412,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_items_summary_report'),
"data_file" => site_url("reports/graphical_summary_items_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -449,7 +451,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_categories_summary_report'),
"data_file" => site_url("reports/graphical_summary_categories_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -477,6 +479,7 @@ class Reports extends Secure_area
$this->load->view("reports/graphs/pie",$data);
}
//Graphical summary suppliers report
function graphical_summary_suppliers($start_date, $end_date, $sale_type)
{
$this->load->model('reports/Summary_suppliers');
@@ -485,7 +488,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_suppliers_summary_report'),
"data_file" => site_url("reports/graphical_summary_suppliers_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -513,6 +516,7 @@ class Reports extends Secure_area
$this->load->view("reports/graphs/pie",$data);
}
//Graphical summary employees report
function graphical_summary_employees($start_date, $end_date, $sale_type)
{
$this->load->model('reports/Summary_employees');
@@ -521,7 +525,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_employees_summary_report'),
"data_file" => site_url("reports/graphical_summary_employees_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -549,6 +553,7 @@ class Reports extends Secure_area
$this->load->view("reports/graphs/pie",$data);
}
//Graphical summary taxes report
function graphical_summary_taxes($start_date, $end_date, $sale_type)
{
$this->load->model('reports/Summary_taxes');
@@ -557,7 +562,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_taxes_summary_report'),
"data_file" => site_url("reports/graphical_summary_taxes_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -594,7 +599,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_customers_summary_report'),
"data_file" => site_url("reports/graphical_summary_customers_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -633,7 +638,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_discounts_summary_report'),
"data_file" => site_url("reports/graphical_summary_discounts_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -663,6 +668,7 @@ class Reports extends Secure_area
$this->load->view("reports/graphs/bar",$data);
}
//Graphical summary payments report
function graphical_summary_payments($start_date, $end_date, $sale_type)
{
$this->load->model('reports/Summary_payments');
@@ -671,7 +677,7 @@ class Reports extends Secure_area
$data = array(
"title" => $this->lang->line('reports_payments_summary_report'),
"data_file" => site_url("reports/graphical_summary_payments_graph/$start_date/$end_date/$sale_type"),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"summary_data" => $model->getSummaryData(array('start_date'=>$start_date, 'end_date'=>$end_date, 'sale_type' => $sale_type))
);
@@ -700,6 +706,7 @@ class Reports extends Secure_area
$this->load->view("reports/graphs/pie",$data);
}
function specific_customer_input()
{
$data = $this->_get_common_report_data();
@@ -727,18 +734,18 @@ class Reports extends Secure_area
foreach($report_data['summary'] as $key=>$row)
{
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']), $row['payment_type'], $row['comment']);
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
foreach($report_data['details'][$key] as $drow)
{
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),to_currency($drow['profit']), $drow['discount_percent'].'%');
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%');
}
}
$customer_info = $this->Customer->get_info($customer_id);
$data = array(
"title" => $customer_info->first_name .' '. $customer_info->last_name.' '.$this->lang->line('reports_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"summary_data" => $summary_data,
"details_data" => $details_data,
@@ -777,18 +784,18 @@ class Reports extends Secure_area
foreach($report_data['summary'] as $key=>$row)
{
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']), $row['payment_type'], $row['comment']);
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
foreach($report_data['details'][$key] as $drow)
{
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),to_currency($drow['profit']), $drow['discount_percent'].'%');
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%');
}
}
$employee_info = $this->Employee->get_info($employee_id);
$data = array(
"title" => $employee_info->first_name .' '. $employee_info->last_name.' '.$this->lang->line('reports_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"summary_data" => $summary_data,
"details_data" => $details_data,
@@ -831,13 +838,13 @@ class Reports extends Secure_area
foreach($report_data['details'][$key] as $drow)
{
$details_data[$key][] = array($drow['name'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%');
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%');
}
}
$data = array(
"title" => $discount. '% '.$this->lang->line('reports_discount') . ' ' . $this->lang->line('reports_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $headers,
"summary_data" => $summary_data,
"details_data" => $details_data,
@@ -861,26 +868,26 @@ class Reports extends Secure_area
$summary_data = array();
$details_data = array();
$show_locations = $this->Stock_locations->multiple_locations();
$show_locations = $this->Stock_location->multiple_locations();
foreach($report_data['summary'] as $key=>$row)
{
$summary_data[] = array(anchor('sales/edit/'.$row['sale_id'] . '/width:'.FORM_WIDTH, 'POS '.$row['sale_id'], array('class' => 'thickbox')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),to_currency($row['profit']), $row['payment_type'], $row['comment']);
$summary_data[] = array(anchor('sales/edit/'.$row['sale_id'] . '/width:'.FORM_WIDTH, 'POS '.$row['sale_id'], array('class' => 'thickbox')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
foreach($report_data['details'][$key] as $drow)
{
$quantity_purchased = $drow['quantity_purchased'];
if ($show_locations)
{
$quantity_purchased .= ' [' . $this->Stock_locations->get_location_name($drow['item_location']) . ']';
$quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']';
}
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $quantity_purchased, to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),to_currency($drow['profit']), $drow['discount_percent'].'%');
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $quantity_purchased, to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%');
}
}
$data = array(
"title" =>$this->lang->line('reports_detailed_sales_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"editable" => "sales",
"summary_data" => $summary_data,
@@ -904,7 +911,7 @@ class Reports extends Secure_area
$summary_data = array();
$details_data = array();
$show_locations = $this->Stock_locations->multiple_locations();
$show_locations = $this->Stock_location->multiple_locations();
foreach($report_data['summary'] as $key=>$row)
{
@@ -915,7 +922,7 @@ class Reports extends Secure_area
$quantity_purchased = $drow['receiving_quantity'] > 1 ? $drow['quantity_purchased'] . ' x ' . $drow['receiving_quantity'] : $drow['quantity_purchased'];
if ($show_locations)
{
$quantity_purchased .= ' [' . $this->Stock_locations->get_location_name($drow['item_location']) . ']';
$quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']';
}
$details_data[$key][] = array($drow['item_number'], $drow['name'], $drow['category'], $quantity_purchased, to_currency($drow['total']), $drow['discount_percent'].'%');
}
@@ -923,7 +930,7 @@ class Reports extends Secure_area
$data = array(
"title" =>$this->lang->line('reports_detailed_receivings_report'),
"subtitle" => date('m/d/Y', strtotime($start_date)) .'-'.date('m/d/Y', strtotime($end_date)),
"subtitle" => date($this->config->item('dateformat'), strtotime($start_date)) .'-'.date($this->config->item('dateformat'), strtotime($end_date)),
"headers" => $model->getDataColumns(),
"header_width" => intval(100 / count($headers['summary'])),
"editable" => "receivings",
@@ -965,15 +972,38 @@ class Reports extends Secure_area
$this->load->view("reports/tabular",$data);
}
function inventory_summary($export_excel=0)
function inventory_summary_input()
{
$data = array();
$this->load->model('reports/Inventory_Summary');
$model = $this->Inventory_Summary;
$data['item_count'] = $model->getItemCountDropdownArray();
$stock_locations = $this->Stock_location->get_allowed_locations();
$stock_locations['all'] = $this->lang->line('reports_all');
$data['stock_locations'] = array_reverse($stock_locations, TRUE);
$this->load->view("reports/inventory_summary_input", $data);
}
function inventory_summary($export_excel=0, $location_id = 'all', $item_count = 'all')
{
$this->load->model('reports/Inventory_summary');
$model = $this->Inventory_summary;
$tabular_data = array();
$report_data = $model->getData(array());
$report_data = $model->getData(array('location_id'=>$location_id,'item_count'=>$item_count));
foreach($report_data as $row)
{
$tabular_data[] = array($row['name'], $row['item_number'], $row['description'], $row['quantity'], $row['reorder_level'],$row['location_name']);
$tabular_data[] = array($row['name'],
$row['item_number'],
$row['description'],
$row['quantity'],
$row['reorder_level'],
$row['location_name'],
to_currency($row['cost_price']),
to_currency($row['unit_price']),
to_currency($row['sub_total_value']));
}
$data = array(
@@ -981,7 +1011,7 @@ class Reports extends Secure_area
"subtitle" => '',
"headers" => $model->getDataColumns(),
"data" => $tabular_data,
"summary_data" => $model->getSummaryData(array()),
"summary_data" => $model->getSummaryData($report_data),
"export_excel" => $export_excel
);

View File

@@ -14,28 +14,66 @@ class Sales extends Secure_area
$this->_reload();
}
function manage($payment_type = 0, $limit_from = 0)
function manage($only_invoices = FALSE, $only_cash = FALSE, $limit_from = 0)
{
$data['controller_name']=strtolower($this->uri->segment(1));
$data['payment_types'] = array($this->lang->line('sales_no_filter'), $this->lang->line('sales_invoice'));
$data['search_section_state']=$this->input->post('search_section_state');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$sales = $this->Sale->get_all($payment_type,$lines_per_page,$limit_from);
$total_rows = $this->Sale->get_found_rows($payment_type);
$data['payment_type'] = $payment_type;
$data['links'] = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, -1, 'manage', $payment_type);
$data['manage_table']=get_sales_manage_table($sales,$this);
$this->load->view($data['controller_name'] . '/manage',$data);
$person_id = $this->session->userdata('person_id');
if (!$this->Employee->has_grant('reports_sales', $person_id))
{
redirect('no_access/sales/reports_sales');
}
else
{
$this->Sale->create_sales_items_temp_table();
$data['controller_name'] = strtolower($this->uri->segment(1));
$data['only_invoices'] = array($this->lang->line('sales_no_filter'), $this->lang->line('sales_invoice'));
$data['search_section_state'] = $this->input->post('search_section_state');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$today = date($this->config->item('dateformat'));
$start_date = $this->input->post('start_date') != NULL ? $this->input->post('start_date', TRUE) : $today;
$start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date);
$end_date = $this->input->post('end_date') != NULL ? $this->input->post('end_date', TRUE) : $today;
$end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date);
$sale_type = 'all';
$location_id = 'all';
$is_valid_receipt = FALSE;
$search = null;
$filters = array('sale_type' => $sale_type,
'location_id' => $location_id,
'start_date' => $start_date_formatter->format('Y-m-d'),
'end_date' => $end_date_formatter->format('Y-m-d'),
'only_invoices' => $only_invoices,
'only_cash' => $only_cash,
'is_valid_receipt' => $is_valid_receipt);
$sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array();
$payments = $this->Sale->get_payments_summary($search, $filters);
$total_rows = $this->Sale->get_found_rows($search, $filters);
$data['only_invoices'] = $only_invoices;
$data['start_date'] = $start_date_formatter->format($this->config->item('dateformat'));
$data['end_date'] = $end_date_formatter->format($this->config->item('dateformat'));
$data['links'] = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, $total_rows, 'manage', $only_invoices);
$data['manage_table'] = get_sales_manage_table($sales, $this);
$data['payments_summary'] = get_sales_manage_payments_summary($payments, $sales, $this);
$this->load->view($data['controller_name'] . '/manage', $data);
}
$this->_remove_duplicate_cookies();
}
function get_row()
{
$this->Sale->create_sales_items_temp_table();
$sale_id = $this->input->post('row_id');
$sale_info = $this->Sale->get_info($sale_id)->result_array();
$data_row=get_sale_data_row($sale_info[0],$this);
$data_row = get_sales_manage_sale_data_row($sale_info[0], $this);
echo $data_row;
}
@@ -51,33 +89,62 @@ class Sales extends Secure_area
function search()
{
$payment_type = $this->input->post('payment_type', TRUE);
$this->Sale->create_sales_items_temp_table();
$only_invoices = $this->input->post('only_invoices', TRUE);
$only_cash = $this->input->post('only_cash', TRUE);
$lines_per_page = $this->Appconfig->get('lines_per_page');
$limit_from = $this->input->post('limit_from', TRUE);
$search = $this->input->post('search', TRUE);
$lines_per_page = $this->Appconfig->get('lines_per_page');
$sales = $this->Sale->search($search, $payment_type, $lines_per_page, $limit_from, $search);
$total_rows = $this->Sale->get_found_rows($search);
$links = $this->_initialize_pagination($this->Sale,$lines_per_page,$limit_from,$total_rows,'search',$payment_type);
$data_rows=get_sales_manage_table_data_rows($sales,$this);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
$today = date($this->config->item('dateformat'));
$start_date = $this->input->post('start_date') != NULL ? $this->input->post('start_date', TRUE) : $today;
$start_date_formatter = date_create_from_format($this->config->item('dateformat'), $start_date);
$end_date = $this->input->post('end_date') != NULL ? $this->input->post('end_date', TRUE) : $today;
$end_date_formatter = date_create_from_format($this->config->item('dateformat'), $end_date);
$is_valid_receipt = isset($search) ? $this->sale_lib->is_valid_receipt($search) : FALSE;
$sale_type = 'all';
$location_id = 'all';
$filters = array('sale_type' => $sale_type,
'location_id' => $location_id,
'start_date' => $start_date_formatter->format('Y-m-d'),
'end_date' => $end_date_formatter->format('Y-m-d'),
'only_invoices' => $only_invoices,
'only_cash' => $only_cash,
'is_valid_receipt' => $is_valid_receipt);
$sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array();
$payments = $this->Sale->get_payments_summary($search, $filters);
$total_rows = $this->Sale->get_found_rows($search, $filters);
$links = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, $total_rows, 'search', $only_invoices);
$sale_rows = get_sales_manage_table_data_rows($sales, $this);
$payment_summary = get_sales_manage_payments_summary($payments, $sales, $this);
$this->_remove_duplicate_cookies();
echo json_encode(array('total_rows' => $total_rows, 'rows' => $sale_rows, 'pagination' => $links, 'payment_summary' => $payment_summary));
}
function item_search()
{
$suggestions = array();
if ($this->sale_lib->get_mode() == 'return')
{
$this->sale_lib->is_valid_receipt($this->input->post('q')) && $suggestions[] = $this->input->post('q');
}
$suggestions = array_merge($suggestions, $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit')));
$suggestions = array_merge($suggestions, $this->Item_kit->get_item_kit_search_suggestions($this->input->post('q'),$this->input->post('limit')));
echo implode("\n",$suggestions);
echo implode("\n", $suggestions);
}
function customer_search()
{
$suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('q'),$this->input->post('limit'));
echo implode("\n",$suggestions);
}
@@ -86,6 +153,7 @@ class Sales extends Secure_area
$search = $this->input->post('q', TRUE);
$limit = $this->input->post('limit', TRUE);
$suggestions = $this->Sale->get_search_suggestions($search, $limit);
echo implode("\n",$suggestions);
}
@@ -104,7 +172,7 @@ class Sales extends Secure_area
$mode = $this->input->post("mode");
$this->sale_lib->set_mode($mode);
}
else if ($this->Stock_locations->is_allowed_location($stock_location, 'sales'))
else if ($this->Stock_location->is_allowed_location($stock_location, 'sales'))
{
$this->sale_lib->set_sale_location($stock_location);
}
@@ -113,7 +181,7 @@ class Sales extends Secure_area
function set_comment()
{
$this->sale_lib->set_comment($this->input->post('comment'));
$this->sale_lib->set_comment($this->input->post('comment'));
}
function set_invoice_number()
@@ -133,10 +201,10 @@ class Sales extends Secure_area
function set_email_receipt()
{
$this->sale_lib->set_email_receipt($this->input->post('email_receipt'));
$this->sale_lib->set_email_receipt($this->input->post('email_receipt'));
}
//Alain Multiple Payments
// Multiple Payments
function add_payment()
{
$data = array();
@@ -145,11 +213,16 @@ class Sales extends Secure_area
if ( $this->form_validation->run() == FALSE )
{
if ( $this->input->post( 'payment_type' ) == $this->lang->line( 'sales_gift_card' ) )
{
$data['error']=$this->lang->line('sales_must_enter_numeric_giftcard');
}
else
{
$data['error']=$this->lang->line('sales_must_enter_numeric');
}
$this->_reload( $data );
return;
}
@@ -186,7 +259,7 @@ class Sales extends Secure_area
$this->_reload($data);
}
//Alain Multiple Payments
// Multiple Payments
function delete_payment( $payment_id )
{
$this->sale_lib->delete_payment( $payment_id );
@@ -205,18 +278,11 @@ class Sales extends Secure_area
{
$this->sale_lib->return_entire_sale($item_id_or_number_or_item_kit_or_receipt);
}
elseif($this->Sale_suspended->invoice_number_exists($item_id_or_number_or_item_kit_or_receipt))
{
$this->sale_lib->clear_all();
$sale_id=$this->Sale_suspended->get_sale_by_invoice_number($item_id_or_number_or_item_kit_or_receipt)->row()->sale_id;
$this->sale_lib->copy_entire_suspended_sale($sale_id);
$this->Sale_suspended->delete($sale_id);
}
elseif($this->sale_lib->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt))
else if($this->sale_lib->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt))
{
$this->sale_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt,$item_location);
}
elseif(!$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt,$quantity,$item_location,$this->config->item('default_sales_discount')))
else if(!$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt,$quantity,$item_location,$this->config->item('default_sales_discount')))
{
$data['error']=$this->lang->line('sales_unable_to_add_item');
}
@@ -230,7 +296,7 @@ class Sales extends Secure_area
function edit_item($line)
{
$data= array();
$data = array();
$this->form_validation->set_rules('price', 'lang:items_price', 'required|numeric');
$this->form_validation->set_rules('quantity', 'lang:items_quantity', 'required|numeric');
@@ -243,14 +309,13 @@ class Sales extends Secure_area
$discount = $this->input->post("discount");
$item_location = $this->input->post("location");
if ($this->form_validation->run() != FALSE)
{
$this->sale_lib->edit_item($line,$description,$serialnumber,$quantity,$discount,$price);
$this->sale_lib->edit_item($line, $description, $serialnumber, $quantity, $discount, $price);
}
else
{
$data['error']=$this->lang->line('sales_error_editing_item');
$data['error'] = $this->lang->line('sales_error_editing_item');
}
if($this->sale_lib->out_of_stock($this->sale_lib->get_item_id($line),$item_location))
@@ -258,7 +323,6 @@ class Sales extends Secure_area
$data['warning'] = $this->lang->line('sales_quantity_less_than_zero');
}
$this->_reload($data);
}
@@ -278,72 +342,70 @@ class Sales extends Secure_area
function complete()
{
$data['cart']=$this->sale_lib->get_cart();
$data['subtotal']=$this->sale_lib->get_subtotal();
$data['discounted_subtotal']=$this->sale_lib->get_subtotal(TRUE);
$data['tax_exclusive_subtotal']=$this->sale_lib->get_subtotal(TRUE, TRUE);
$data['taxes']=$this->sale_lib->get_taxes();
$data['total']=$this->sale_lib->get_total();
$data['discount']=$this->sale_lib->get_discount();
$data['receipt_title']=$this->lang->line('sales_receipt');
$data['transaction_time']= date('m/d/Y h:i:s a');
$data['transaction_date']= date('d/m/Y', strtotime($data['transaction_time']));
$data['show_stock_locations']=$this->Stock_locations->show_locations('sales');
$customer_id=$this->sale_lib->get_customer();
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$comment=$this->sale_lib->get_comment();
$data['comments']=$comment;
$data['cart'] = $this->sale_lib->get_cart();
$data['subtotal'] = $this->sale_lib->get_subtotal();
$data['discounted_subtotal'] = $this->sale_lib->get_subtotal(TRUE);
$data['tax_exclusive_subtotal'] = $this->sale_lib->get_subtotal(TRUE, TRUE);
$data['taxes'] = $this->sale_lib->get_taxes();
$data['total'] = $this->sale_lib->get_total();
$data['discount'] = $this->sale_lib->get_discount();
$data['receipt_title'] = $this->lang->line('sales_receipt');
$data['transaction_time'] = date($this->config->item('dateformat').' '.$this->config->item('timeformat'));
$data['transaction_date'] = date($this->config->item('dateformat'));
$data['show_stock_locations'] = $this->Stock_location->show_locations('sales');
$customer_id = $this->sale_lib->get_customer();
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
$data['comments'] = $this->sale_lib->get_comment();
$emp_info=$this->Employee->get_info($employee_id);
$data['payments']=$this->sale_lib->get_payments();
$data['amount_change']=$this->sale_lib->get_amount_due() * -1;
$data['amount_due']=$this->sale_lib->get_amount_due();
$data['employee']=$emp_info->first_name.' '.$emp_info->last_name;
$data['payments'] = $this->sale_lib->get_payments();
$data['amount_change'] = $this->sale_lib->get_amount_due() * -1;
$data['amount_due'] = $this->sale_lib->get_amount_due();
$data['employee'] = $emp_info->first_name.' '.$emp_info->last_name;
$data['company_info'] = implode("\n", array(
$this->config->item('address'),
$this->config->item('phone'),
$this->config->item('account_number')
));
$cust_info='';
$cust_info = '';
if($customer_id!=-1)
{
$cust_info=$this->Customer->get_info($customer_id);
$cust_info = $this->Customer->get_info($customer_id);
if (isset($cust_info->company_name))
{
$data['customer']=$cust_info->company_name;
$data['customer'] = $cust_info->company_name;
}
else
{
$data['customer']=$cust_info->first_name.' '.$cust_info->last_name;
$data['customer'] = $cust_info->first_name.' '.$cust_info->last_name;
}
$data['customer_address'] = $cust_info->address_1;
$data['customer_location'] = $cust_info->zip . ' ' . $cust_info->city;
$data['account_number'] = $cust_info->account_number;
$data['customer_info'] = implode("\n", array(
$data['customer'],
$data['customer_address'],
$data['customer_location'],
$data['account_number']
$data['customer'],
$data['customer_address'],
$data['customer_location'],
$data['account_number']
));
}
$invoice_number=$this->_substitute_invoice_number($cust_info);
$invoice_number = $this->_substitute_invoice_number($cust_info);
if ($this->sale_lib->is_invoice_number_enabled() && $this->Sale->invoice_number_exists($invoice_number))
{
$data['error']=$this->lang->line('sales_invoice_number_duplicate');
$data['error'] = $this->lang->line('sales_invoice_number_duplicate');
$this->_reload($data);
}
else
{
$invoice_number = $this->sale_lib->is_invoice_number_enabled() ? $invoice_number : NULL;
$data['invoice_number']=$invoice_number;
$data['sale_id']='POS '.$this->Sale->save($data['cart'],$customer_id,$employee_id,$comment,$invoice_number,$data['payments']);
$data['invoice_number'] = $invoice_number;
$data['sale_id'] = 'POS '.$this->Sale->save($data['cart'], $customer_id, $employee_id, $data['comments'], $invoice_number, $data['payments']);
if ($data['sale_id'] == 'POS -1')
{
$data['error_message'] = $this->lang->line('sales_transaction_failed');
}
else
{
$barcode_config=array('barcode_type'=>2,'barcode_width'=>200, 'barcode_height'=>30, 'barcode_quality'=>100);
$data['barcode']=$this->barcode_lib->generate_barcode($data['sale_id'],$barcode_config);
$data['barcode'] = $this->barcode_lib->generate_receipt_barcode($data['sale_id']);
// if we want to email. .. just attach the pdf in there?
if ($this->sale_lib->get_email_receipt() && !empty($cust_info->email))
{
@@ -372,7 +434,7 @@ class Sales extends Secure_area
$this->email->send();
}
}
$data['cur_giftcard_value']=$this->sale_lib->get_giftcard_remainder();
$data['cur_giftcard_value'] = $this->sale_lib->get_giftcard_remainder();
$data['print_after_sale'] = $this->sale_lib->is_print_after_sale();
if ($this->sale_lib->is_invoice_number_enabled() && $this->config->item('use_invoice_template'))
{
@@ -388,7 +450,7 @@ class Sales extends Secure_area
$this->_remove_duplicate_cookies();
}
function _invoice_email_pdf($data)
private function _invoice_email_pdf($data)
{
$data['image_prefix'] = "";
$html = $this->load->view('sales/invoice_email', $data, true);
@@ -397,10 +459,12 @@ class Sales extends Secure_area
$file_content = pdf_create($html, '', false);
$filename = sys_get_temp_dir() . '/'. $this->lang->line('sales_invoice') .'-' . str_replace('/', '-' , $data["invoice_number"]) . '.pdf';
write_file($filename, $file_content);
return $filename;
}
function invoice_email($sale_id) {
function invoice_email($sale_id)
{
$sale_data = $this->_load_sale_data($sale_id);
$sale_data['image_prefix'] = base_url();
$this->load->view('sales/invoice_email', $sale_data);
@@ -408,7 +472,8 @@ class Sales extends Secure_area
$this->_remove_duplicate_cookies();
}
function send_invoice($sale_id) {
function send_invoice($sale_id)
{
$sale_data = $this->_load_sale_data($sale_id);
$text = $this->config->item('invoice_email_message');
$text = str_replace('$INV', $sale_data['invoice_number'], $text);
@@ -428,15 +493,15 @@ class Sales extends Secure_area
$message = $this->lang->line($result ? 'sales_invoice_sent' : 'sales_invoice_unsent') . ' ' . $sale_data["customer_email"];
}
echo json_encode(array(
'success'=>$result,
'message'=>$message,
'id'=>$sale_id)
'success'=>$result,
'message'=>$message,
'id'=>$sale_id)
);
$this->sale_lib->clear_all();
$this->_remove_duplicate_cookies();
}
function _substitute_variable($text, $variable, $object, $function)
private function _substitute_variable($text, $variable, $object, $function)
{
// don't query if this variable isn't used
if (strstr($text, $variable))
@@ -444,10 +509,11 @@ class Sales extends Secure_area
$value = call_user_func(array($object, $function));
$text = str_replace($variable, $value, $text);
}
return $text;
}
function _substitute_customer($text, $cust_info)
private function _substitute_customer($text, $cust_info)
{
// substitute customer info
$customer_id=$this->sale_lib->get_customer();
@@ -461,90 +527,90 @@ class Sales extends Secure_area
}
$text=str_replace('$CI',$acronym,$text);
}
return $text;
}
function _substitute_variables($text, $cust_info)
private function _substitute_variables($text, $cust_info)
{
$text=$this->_substitute_variable($text, '$YCO', $this->Sale, 'get_invoice_number_for_year');
$text=$this->_substitute_variable($text, '$CO', $this->Sale , 'get_invoice_count');
$text=$this->_substitute_variable($text, '$SCO', $this->Sale_suspended, 'get_invoice_count');
$text=strftime($text);
$text=$this->_substitute_customer($text, $cust_info);
return $text;
}
function _substitute_invoice_number($cust_info)
private function _substitute_invoice_number($cust_info)
{
$invoice_number=$this->sale_lib->get_invoice_number();
if (empty($invoice_number))
{
$invoice_number=$this->config->config['sales_invoice_format'];
}
$invoice_number = $this->config->config['sales_invoice_format'];
$invoice_number = $this->_substitute_variables($invoice_number, $cust_info);
$this->sale_lib->set_invoice_number($invoice_number);
return $invoice_number;
$this->sale_lib->set_invoice_number($invoice_number, TRUE);
return $this->sale_lib->get_invoice_number();
}
function _load_sale_data($sale_id) {
private function _load_sale_data($sale_id)
{
$this->Sale->create_sales_items_temp_table();
$this->sale_lib->clear_all();
$sale_info = $this->Sale->get_info($sale_id)->row_array();
$this->sale_lib->copy_entire_sale($sale_id);
$data['cart']=$this->sale_lib->get_cart();
$data['payments']=$this->sale_lib->get_payments();
$data['subtotal']=$this->sale_lib->get_subtotal();
$data['discounted_subtotal']=$this->sale_lib->get_subtotal(TRUE);
$data['tax_exclusive_subtotal']=$this->sale_lib->get_subtotal(TRUE, TRUE);
$data['taxes']=$this->sale_lib->get_taxes();
$data['total']=$this->sale_lib->get_total();
$data['discount']=$this->sale_lib->get_discount();
$data['receipt_title']=$this->lang->line('sales_receipt');
$data['transaction_time']= date('d/m/Y H:i:s', strtotime($sale_info['sale_time']));
$data['show_stock_locations']=$this->Stock_locations->show_locations('sales');
$data['transaction_date']= date('d/m/Y', strtotime($sale_info['sale_time']));
$customer_id=$this->sale_lib->get_customer();
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$emp_info=$this->Employee->get_info($employee_id);
$data['amount_change']=$this->sale_lib->get_amount_due() * -1;
$data['amount_due']=$this->sale_lib->get_amount_due();
$data['employee']=$emp_info->first_name.' '.$emp_info->last_name;
$data['cart'] = $this->sale_lib->get_cart();
$data['payments'] = $this->sale_lib->get_payments();
$data['subtotal'] = $this->sale_lib->get_subtotal();
$data['discounted_subtotal'] = $this->sale_lib->get_subtotal(TRUE);
$data['tax_exclusive_subtotal'] = $this->sale_lib->get_subtotal(TRUE, TRUE);
$data['taxes'] = $this->sale_lib->get_taxes();
$data['total'] = $this->sale_lib->get_total();
$data['discount'] = $this->sale_lib->get_discount();
$data['receipt_title'] = $this->lang->line('sales_receipt');
$data['transaction_time'] = date($this->config->item('dateformat').' '.$this->config->item('timeformat'), strtotime($sale_info['sale_time']));
$data['transaction_date'] = date($this->config->item('dateformat'), strtotime($sale_info['sale_time']));
$data['show_stock_locations'] = $this->Stock_location->show_locations('sales');
$customer_id = $this->sale_lib->get_customer();
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
$emp_info = $this->Employee->get_info($employee_id);
$data['amount_change'] = $this->sale_lib->get_amount_due() * -1;
$data['amount_due'] = $this->sale_lib->get_amount_due();
$data['employee'] = $emp_info->first_name.' '.$emp_info->last_name;
if($customer_id!=-1)
{
$cust_info=$this->Customer->get_info($customer_id);
$cust_info = $this->Customer->get_info($customer_id);
if (isset($cust_info->company_name))
{
$data['customer']=$cust_info->company_name;
$data['customer'] = $cust_info->company_name;
}
else
{
$data['customer']=$cust_info->first_name.' '.$cust_info->last_name;
$data['customer'] = $cust_info->first_name.' '.$cust_info->last_name;
}
$data['first_name']=$cust_info->first_name;
$data['last_name']=$cust_info->last_name;
$data['first_name'] = $cust_info->first_name;
$data['last_name'] = $cust_info->last_name;
$data['customer_address'] = $cust_info->address_1;
$data['customer_location'] = $cust_info->zip . ' ' . $cust_info->city;
$data['customer_email'] = $cust_info->email;
$data['account_number'] = $cust_info->account_number;
$data['customer_info'] = implode("\n", array(
$data['customer'],
$data['customer_address'],
$data['customer_location'],
$data['account_number']
$data['customer'],
$data['customer_address'],
$data['customer_location'],
$data['account_number']
));
}
$data['sale_id']='POS '.$sale_id;
$data['comments'] = $sale_info[ 'comment' ];
$data['sale_id'] = 'POS '.$sale_id;
$data['comments'] = $sale_info['comment'];
$data['invoice_number'] = $sale_info['invoice_number'];
$data['company_info'] = implode("\n", array(
$this->config->item('address'),
$this->config->item('phone'),
$this->config->item('account_number')
$this->config->item('address'),
$this->config->item('phone'),
$this->config->item('account_number')
));
// static barcode config for receipts + invoices
$barcode_config=array('barcode_type'=>2,'barcode_width'=>200, 'barcode_height'=>30, 'barcode_quality'=>100);
$data['barcode']=$this->barcode_lib->generate_barcode($data['sale_id'],$barcode_config);
$data['barcode'] = $this->barcode_lib->generate_receipt_barcode($data['sale_id']);
$data['print_after_sale'] = FALSE;
return $data;
}
@@ -575,6 +641,7 @@ class Sales extends Secure_area
{
$data['employees'][$employee->person_id] = $employee->first_name . ' '. $employee->last_name;
}
$this->Sale->create_sales_items_temp_table();
$sale_info = $this->Sale->get_info($sale_id)->row_array();
$person_name = $sale_info['first_name'] . " " . $sale_info['last_name'];
@@ -584,7 +651,8 @@ class Sales extends Secure_area
$this->load->view('sales/form', $data);
}
function delete($sale_id = -1, $update_inventory=TRUE) {
function delete($sale_id = -1, $update_inventory=TRUE)
{
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$sale_ids= $sale_id == -1 ? $this->input->post('ids') : array($sale_id);
@@ -601,8 +669,10 @@ class Sales extends Secure_area
function save($sale_id)
{
$start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $this->input->post('date', TRUE));
$sale_data = array(
'sale_time' => date('Y-m-d H:i:s', strtotime($this->input->post('date'))),
'sale_time' => $start_date_formatter->format('Y-m-d H:i:s'),
'customer_id' => $this->input->post('customer_id') ? $this->input->post('customer_id') : NULL,
'employee_id' => $this->input->post('employee_id'),
'comment' => $this->input->post('comment'),
@@ -627,7 +697,7 @@ class Sales extends Secure_area
}
}
function _payments_cover_total()
private function _payments_cover_total()
{
$total_payments = 0;
@@ -646,28 +716,28 @@ class Sales extends Secure_area
return true;
}
function _reload($data=array())
private function _reload($data=array())
{
$person_info = $this->Employee->get_logged_in_employee_info();
$data['cart']=$this->sale_lib->get_cart();
$data['modes']=array('sale'=>$this->lang->line('sales_sale'),'return'=>$this->lang->line('sales_return'));
$data['mode']=$this->sale_lib->get_mode();
$data['cart'] = $this->sale_lib->get_cart();
$data['modes'] = array('sale'=>$this->lang->line('sales_sale'),'return'=>$this->lang->line('sales_return'));
$data['mode'] = $this->sale_lib->get_mode();
$data['stock_locations']=$this->Stock_locations->get_allowed_locations('sales');
$data['stock_location']=$this->sale_lib->get_sale_location();
$data['stock_locations'] = $this->Stock_location->get_allowed_locations('sales');
$data['stock_location'] = $this->sale_lib->get_sale_location();
$data['subtotal']=$this->sale_lib->get_subtotal(TRUE);
$data['tax_exclusive_subtotal']=$this->sale_lib->get_subtotal(TRUE, TRUE);
$data['taxes']=$this->sale_lib->get_taxes();
$data['discount']=$this->sale_lib->get_discount();
$data['total']=$this->sale_lib->get_total();
$data['items_module_allowed']=$this->Employee->has_grant('items', $person_info->person_id);
$data['comment']=$this->sale_lib->get_comment();
$data['email_receipt']=$this->sale_lib->get_email_receipt();
$data['payments_total']=$this->sale_lib->get_payments_total();
$data['amount_due']=$this->sale_lib->get_amount_due();
$data['payments']=$this->sale_lib->get_payments();
$data['payment_options']=array(
$data['subtotal'] = $this->sale_lib->get_subtotal(TRUE);
$data['tax_exclusive_subtotal'] = $this->sale_lib->get_subtotal(TRUE, TRUE);
$data['taxes'] = $this->sale_lib->get_taxes();
$data['discount'] = $this->sale_lib->get_discount();
$data['total'] = $this->sale_lib->get_total();
$data['items_module_allowed'] = $this->Employee->has_grant('items', $person_info->person_id);
$data['comment'] = $this->sale_lib->get_comment();
$data['email_receipt'] = $this->sale_lib->get_email_receipt();
$data['payments_total'] = $this->sale_lib->get_payments_total();
$data['amount_due'] = $this->sale_lib->get_amount_due();
$data['payments'] = $this->sale_lib->get_payments();
$data['payment_options'] = array(
$this->lang->line('sales_cash') => $this->lang->line('sales_cash'),
$this->lang->line('sales_check') => $this->lang->line('sales_check'),
$this->lang->line('sales_giftcard') => $this->lang->line('sales_giftcard'),
@@ -675,19 +745,21 @@ class Sales extends Secure_area
$this->lang->line('sales_credit') => $this->lang->line('sales_credit')
);
$customer_id=$this->sale_lib->get_customer();
$cust_info='';
$customer_id = $this->sale_lib->get_customer();
$cust_info = '';
if($customer_id!=-1)
{
$cust_info=$this->Customer->get_info($customer_id);
$data['customer']=$cust_info->first_name.' '.$cust_info->last_name;
$data['customer_email']=$cust_info->email;
$cust_info = $this->Customer->get_info($customer_id);
$data['customer'] = $cust_info->first_name.' '.$cust_info->last_name;
$data['customer_email'] = $cust_info->email;
}
$data['invoice_number']=$this->_substitute_invoice_number($cust_info);
$data['invoice_number_enabled']=$this->sale_lib->is_invoice_number_enabled();
$data['print_after_sale']=$this->sale_lib->is_print_after_sale();
$data['payments_cover_total']=$this->_payments_cover_total();
$data['invoice_number'] = $this->_substitute_invoice_number($cust_info);
$data['invoice_number_enabled'] = $this->sale_lib->is_invoice_number_enabled();
$data['print_after_sale'] = $this->sale_lib->is_print_after_sale();
$data['payments_cover_total'] = $this->_payments_cover_total();
$this->load->view("sales/register",$data);
$this->_remove_duplicate_cookies();
}
@@ -699,60 +771,54 @@ class Sales extends Secure_area
function suspend()
{
$data['cart']=$this->sale_lib->get_cart();
$data['subtotal']=$this->sale_lib->get_subtotal();
$data['taxes']=$this->sale_lib->get_taxes();
$data['total']=$this->sale_lib->get_total();
$data['receipt_title']=$this->lang->line('sales_receipt');
$data['transaction_time']= date('m/d/Y h:i:s a');
$customer_id=$this->sale_lib->get_customer();
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$comment = $this->input->post('comment');
$invoice_number=$this->sale_lib->get_invoice_number();
$emp_info=$this->Employee->get_info($employee_id);
$payment_type = $this->input->post('payment_type');
$data['payment_type']=$this->input->post('payment_type');
//Alain Multiple payments
$data['payments']=$this->sale_lib->get_payments();
$data['amount_change']=to_currency($this->sale_lib->get_amount_due() * -1);
$data['employee']=$emp_info->first_name.' '.$emp_info->last_name;
if ($this->Sale_suspended->invoice_number_exists($invoice_number))
$data['cart'] = $this->sale_lib->get_cart();
$data['subtotal'] = $this->sale_lib->get_subtotal();
$data['taxes'] = $this->sale_lib->get_taxes();
$data['total'] = $this->sale_lib->get_total();
$data['receipt_title'] = $this->lang->line('sales_receipt');
$data['transaction_time'] = date($this->config->item('dateformat').' '.$this->config->item('timeformat'));
$customer_id = $this->sale_lib->get_customer();
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
$comment = $this->sale_lib->get_comment();
$invoice_number = $this->sale_lib->get_invoice_number();
$emp_info = $this->Employee->get_info($employee_id);
$data['payment_type'] = $this->input->post('payment_type');
// Multiple payments
$data['payments'] = $this->sale_lib->get_payments();
$data['amount_change'] = to_currency($this->sale_lib->get_amount_due() * -1);
$data['employee'] = $emp_info->first_name.' '.$emp_info->last_name;
if($customer_id!=-1)
{
$this->_reload(array('error' => $data['error']=$this->lang->line('sales_invoice_number_duplicate')));
$cust_info = $this->Customer->get_info($customer_id);
if (isset($cust_info->company_name))
{
$data['customer'] = $cust_info->company_name;
}
else
{
$data['customer'] = $cust_info->first_name.' '.$cust_info->last_name;
}
}
else
$total_payments = 0;
foreach($data['payments'] as $payment)
{
if($customer_id!=-1)
{
$cust_info=$this->Customer->get_info($customer_id);
if (isset($cust_info->company_name))
{
$data['customer']=$cust_info->company_name;
}
else
{
$data['customer']=$cust_info->first_name.' '.$cust_info->last_name;
}
}
$total_payments = 0;
foreach($data['payments'] as $payment)
{
$total_payments = bcadd($total_payments, $payment['payment_amount'], PRECISION);
}
//SAVE sale to database
$data['sale_id']='POS '.$this->Sale_suspended->save($data['cart'], $customer_id,$employee_id,$comment,$invoice_number,$data['payments']);
if ($data['sale_id'] == 'POS -1')
{
$data['error_message'] = $this->lang->line('sales_transaction_failed');
}
$this->sale_lib->clear_all();
$this->_reload(array('success' => $this->lang->line('sales_successfully_suspended_sale')));
$total_payments = bcadd($total_payments, $payment['payment_amount'], PRECISION);
}
//SAVE sale to database
$data['sale_id'] = 'POS '.$this->Sale_suspended->save($data['cart'], $customer_id, $employee_id, $comment, $invoice_number, $data['payments']);
if ($data['sale_id'] == 'POS -1')
{
$data['error_message'] = $this->lang->line('sales_transaction_failed');
}
$this->sale_lib->clear_all();
$this->_reload(array('success' => $this->lang->line('sales_successfully_suspended_sale')));
}
function suspended()
@@ -776,8 +842,7 @@ class Sales extends Secure_area
$sale_id=$this->input->post('sale_id');
$invoice_number=$this->input->post('invoice_number');
$exists=!empty($invoice_number) && $this->Sale->invoice_number_exists($invoice_number,$sale_id);
echo json_encode(array('success'=>!$exists,'message'=>$this->lang->line('sales_invoice_number_duplicate')));
echo json_encode(array('success'=>!$exists, 'message'=>$this->lang->line('sales_invoice_number_duplicate')));
}
}
?>

View File

@@ -73,6 +73,7 @@ class Suppliers extends Person_controller
);
$supplier_data=array(
'company_name'=>$this->input->post('company_name'),
'agency_name'=>$this->input->post('agency_name'),
'account_number'=>$this->input->post('account_number')=='' ? null:$this->input->post('account_number'),
);
if($this->Supplier->save($person_data,$supplier_data,$supplier_id))
@@ -131,5 +132,5 @@ class Suppliers extends Person_controller
{
return 360;
}
}
}
?>

View File

@@ -1,5 +1,4 @@
<?php
/** GARRISON MODIFIED 4/20/2013 **/
function to_currency($number,$escape=FALSE)
{
$CI =& get_instance();
@@ -22,7 +21,6 @@ function to_currency($number,$escape=FALSE)
return '-'.number_format(abs($number), 2, $decimal_point, $thousands_separator).$currency_symbol;
}
}
/** END MODIFIED **/
function to_currency_no_money($number)
{

View File

@@ -0,0 +1,69 @@
<?php
/*
* Matches each symbol of PHP date format standard
* with jQuery equivalent codeword
* @author Tristan Jahier
*/
function dateformat_jquery($php_format)
{
$SYMBOLS_MATCHING = array(
// Day
'd' => 'dd',
'D' => 'D',
'j' => 'd',
'l' => 'DD',
'N' => '',
'S' => '',
'w' => '',
'z' => 'o',
// Week
'W' => '',
// Month
'F' => 'MM',
'm' => 'mm',
'M' => 'M',
'n' => 'm',
't' => '',
// Year
'L' => '',
'o' => '',
'Y' => 'yy',
'y' => 'y',
// Time
'a' => 'tt',
'A' => 'TT',
'B' => '',
'g' => 'h',
'G' => 'H',
'h' => 'hh',
'H' => 'HH',
'i' => 'mm',
's' => 'ss',
'u' => ''
);
$jqueryui_format = "";
$escaping = false;
for($i = 0; $i < strlen($php_format); $i++)
{
$char = $php_format[$i];
if($char === '\\') // PHP date format escaping character
{
$i++;
if($escaping) $jqueryui_format .= $php_format[$i];
else $jqueryui_format .= '\'' . $php_format[$i];
$escaping = true;
}
else
{
if($escaping) { $jqueryui_format .= "'"; $escaping = false; }
if(isset($SYMBOLS_MATCHING[$char]))
$jqueryui_format .= $SYMBOLS_MATCHING[$char];
else
$jqueryui_format .= $char;
}
}
return $jqueryui_format;
}
?>

View File

@@ -1,36 +1,45 @@
<?php
function get_simple_date_ranges()
{
$CI =& get_instance();
$CI->load->language('reports');
$today = date('Y-m-d');
$yesterday = date('Y-m-d', mktime(0,0,0,date("m"),date("d")-1,date("Y")));
$six_days_ago = date('Y-m-d', mktime(0,0,0,date("m"),date("d")-6,date("Y")));
$start_of_this_month = date('Y-m-d', mktime(0,0,0,date("m"),1,date("Y")));
$end_of_this_month = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00'))));
$start_of_last_month = date('Y-m-d', mktime(0,0,0,date("m")-1,1,date("Y")));
$end_of_last_month = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime((date('m') - 1).'/01/'.date('Y').' 00:00:00'))));
$start_of_this_year = date('Y-m-d', mktime(0,0,0,1,1,date("Y")));
$end_of_this_year = date('Y-m-d', mktime(0,0,0,12,31,date("Y")));
$start_of_last_year = date('Y-m-d', mktime(0,0,0,1,1,date("Y")-1));
$end_of_last_year = date('Y-m-d', mktime(0,0,0,12,31,date("Y")-1));
$start_of_time = date('Y-m-d', 0);
$CI =& get_instance();
$CI->load->language('reports');
return array(
$today. '/' . $today => $CI->lang->line('reports_today'),
$yesterday. '/' . $yesterday => $CI->lang->line('reports_yesterday'),
$six_days_ago. '/' . $today => $CI->lang->line('reports_last_7'),
$start_of_this_month . '/' . $end_of_this_month => $CI->lang->line('reports_this_month'),
$start_of_last_month . '/' . $end_of_last_month => $CI->lang->line('reports_last_month'),
$start_of_this_year . '/' . $end_of_this_year => $CI->lang->line('reports_this_year'),
$start_of_last_year . '/' . $end_of_last_year => $CI->lang->line('reports_last_year'),
$start_of_time . '/' . $today => $CI->lang->line('reports_all_time'),
);
$today = date('Y-m-d');
$today_last_year = date('Y-m-d', mktime(0,0,0,date("m"),date("d"),date("Y")-1));
$yesterday = date('Y-m-d', mktime(0,0,0,date("m"),date("d")-1,date("Y")));
$six_days_ago = date('Y-m-d', mktime(0,0,0,date("m"),date("d")-6,date("Y")));
$start_of_this_month = date('Y-m-d', mktime(0,0,0,date("m"),1,date("Y")));
$end_of_this_month = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00'))));
$start_of_this_month_last_year = date('Y-m-d', mktime(0,0,0,date("m"),1,date("Y")-1));
$end_of_this_month_last_year = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.(date('Y')-1).' 00:00:00'))));
$start_of_last_month = date('Y-m-d', mktime(0,0,0,date("m")-1,1,date("Y")));
$end_of_last_month = date('Y-m-d',strtotime('-1 second',strtotime('+1 month',strtotime((date('m') - 1).'/01/'.date('Y').' 00:00:00'))));
$start_of_this_year = date('Y-m-d', mktime(0,0,0,1,1,date("Y")));
$end_of_this_year = date('Y-m-d', mktime(0,0,0,12,31,date("Y")));
$start_of_last_year = date('Y-m-d', mktime(0,0,0,1,1,date("Y")-1));
$end_of_last_year = date('Y-m-d', mktime(0,0,0,12,31,date("Y")-1));
$start_of_time = date('Y-m-d', 0);
return array(
$today . '/' . $today => $CI->lang->line('reports_today'),
$today_last_year . '/' . $today_last_year => $CI->lang->line('reports_today_last_year'),
$yesterday . '/' . $yesterday => $CI->lang->line('reports_yesterday'),
$six_days_ago . '/' . $today => $CI->lang->line('reports_last_7'),
$start_of_this_month . '/' . $today => $CI->lang->line('reports_this_month_to_today'),
$start_of_this_month . '/' . $end_of_this_month => $CI->lang->line('reports_this_month'),
$start_of_this_month_last_year . '/' . $today_last_year => $CI->lang->line('reports_this_month_to_today_last_year'),
$start_of_this_month_last_year . '/' . $end_of_this_month_last_year => $CI->lang->line('reports_this_month_last_year'),
$start_of_last_month . '/' . $end_of_last_month => $CI->lang->line('reports_last_month'),
$start_of_this_year . '/' . $end_of_this_year => $CI->lang->line('reports_this_year'),
$start_of_last_year . '/' . $end_of_last_year => $CI->lang->line('reports_last_year'),
$start_of_time . '/' . $today => $CI->lang->line('reports_all_time')
);
}
function get_months()
{
$months = array();
for($k=1;$k<=12;$k++)
{
$cur_month = mktime(0, 0, 0, $k, 1, 2000);
@@ -56,6 +65,7 @@ function get_days()
function get_years()
{
$years = array();
for($k=0;$k<10;$k++)
{
$years[date("Y")-$k] = date("Y")-$k;
@@ -83,6 +93,7 @@ function random_color()
while(strlen($c)<6){
$c .= sprintf("%02X", mt_rand(0, 255));
}
return $c;
}

View File

@@ -1,16 +1,18 @@
<?php
function get_sales_manage_table($sales,$controller)
function get_sales_manage_table($sales, $controller)
{
$CI =& get_instance();
$table='<table class="tablesorter" id="sortable_table">';
$headers = array('&nbsp;',
$CI->lang->line('sales_receipt_number'),
$CI->lang->line('sales_sale_time'),
$CI->lang->line('customers_customer'),
$CI->lang->line('sales_amount_tendered'),
$CI->lang->line('sales_amount_due'),
$CI->lang->line('sales_receipt_number'),
$CI->lang->line('sales_change_due'),
$CI->lang->line('sales_payment'),
$CI->lang->line('sales_invoice_number'),
'&nbsp');
@@ -20,58 +22,99 @@ function get_sales_manage_table($sales,$controller)
$table.="<th>$header</th>";
}
$table.='</tr></thead><tbody>';
$table.=get_sales_manage_table_data_rows($sales,$controller);
$table.=get_sales_manage_table_data_rows($sales, $controller);
$table.='</tbody></table>';
return $table;
}
/*
Gets the html data rows for the people.
Gets the html data rows for the sales.
*/
function get_sales_manage_table_data_rows($sales,$controller)
function get_sales_manage_table_data_rows($sales, $controller)
{
$CI =& get_instance();
$table_data_rows='';
$table_data_rows = '';
$sum_amount_tendered = 0;
$sum_amount_due = 0;
$sum_change_due = 0;
foreach($sales->result_array() as $sale)
foreach($sales as $key=>$sale)
{
$table_data_rows.=get_sale_data_row($sale,$controller);
$table_data_rows .= get_sales_manage_sale_data_row($sale, $controller);
$sum_amount_tendered += $sale['amount_tendered'];
$sum_amount_due += $sale['amount_due'];
$sum_change_due += $sale['change_due'];
}
if($sales->num_rows()==0)
if($table_data_rows == '')
{
$table_data_rows.="<tr><td colspan='8'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('sales_no_sales_to_display')."</div></tr></tr>";
$table_data_rows .= "<tr><td colspan='10'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('sales_no_sales_to_display')."</div></td></tr>";
}
else
{
$table_data_rows .= "<tr class='static-last'><td>&nbsp;</td><td>".$CI->lang->line('sales_total')."</td><td>&nbsp;</td><td>&nbsp;</td><td>".to_currency($sum_amount_tendered)."</td><td>".to_currency($sum_amount_due)."</td><td>".to_currency($sum_change_due)."</td><td colspan=\"3\"></td></tr>";
}
return $table_data_rows;
}
function get_sale_data_row($sale,$controller)
function get_sales_manage_sale_data_row($sale, $controller)
{
$CI =& get_instance();
$controller_name=$CI->uri->segment(1);
$controller_name = $CI->uri->segment(1);
$width = $controller->get_form_width();
$table_data_row='<tr>';
$table_data_row.='<td width="3%"><input type="checkbox" id="sale_"' . $sale[ 'sale_id' ] . ' value="' . $sale[ 'sale_id' ]. '" /></td>';
$table_data_row.='<td width="17%">'.date('d/m/Y H:i' , strtotime($sale[ 'sale_time' ])).'</td>';
$table_data_row.='<td width="23%">'.character_limiter( $sale[ 'last_name' ] . " " . $sale[ 'first_name' ] ,25).'</td>';
$table_data_row.='<td width="10%">'.to_currency( $sale[ 'amount_tendered' ] ).'</td>';
$table_data_row.='<td width="10%">'.to_currency( $sale[ 'amount_due' ] ).'</td>';
$table_data_row.='<td width="15%">'.'Ticket ' . $sale[ 'sale_id' ]. '</td>';
$table_data_row.='<td width="10%">'.$sale[ 'invoice_number' ].'</td>';
$table_data_row.='<td width="12%">';
$table_data_row.=anchor($controller_name."/edit/" . $sale[ 'sale_id' ] . "/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update')));
$table_data_row.='<td width="3%"><input type="checkbox" id="sale_' . $sale['sale_id'] . '" value="' . $sale['sale_id']. '" /></td>';
$table_data_row.='<td width="15%">'.'POS ' . $sale['sale_id'] . '</td>';
$table_data_row.='<td width="17%">'.date( $CI->config->item('dateformat') . ' ' . $CI->config->item('timeformat'), strtotime($sale['sale_time']) ).'</td>';
$table_data_row.='<td width="23%">'.character_limiter( $sale['customer_name'], 25).'</td>';
$table_data_row.='<td width="8%">'.to_currency( $sale['amount_tendered'] ).'</td>';
$table_data_row.='<td width="8%">'.to_currency( $sale['amount_due'] ).'</td>';
$table_data_row.='<td width="8%">'.to_currency( $sale['change_due'] ).'</td>';
$table_data_row.='<td width="12%">'.$sale['payment_type'].'</td>';
$table_data_row.='<td width="8%">'.$sale['invoice_number'].'</td>';
$table_data_row.='<td width="8%">';
$table_data_row.=anchor($controller_name."/edit/" . $sale['sale_id'] . "/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update')));
$table_data_row.='&nbsp;&nbsp;&nbsp;&nbsp;';
$table_data_row.='<a href="'.site_url($controller_name. "/receipt/" . $sale[ 'sale_id' ]) . '">' . $CI->lang->line('sales_show_receipt') . '</a>';
$table_data_row.='<a href="'.site_url($controller_name. "/receipt/" . $sale['sale_id']) . '">' . $CI->lang->line('sales_show_receipt') . '</a>';
$table_data_row.='&nbsp;&nbsp;&nbsp;&nbsp;';
$table_data_row.='<a href="'.site_url($controller_name. "/invoice/" . $sale[ 'sale_id' ]) . '">' . $CI->lang->line('sales_show_invoice') . '</a>';
$table_data_row.='<a href="'.site_url($controller_name. "/invoice/" . $sale['sale_id']) . '">' . $CI->lang->line('sales_show_invoice') . '</a>';
$table_data_row.='</td>';
$table_data_row.='</tr>';
return $table_data_row;
}
/*
Get the sales payments summary
*/
function get_sales_manage_payments_summary($payments, $sales, $controller)
{
$CI =& get_instance();
$table='<div id="report_summary">';
foreach($payments as $key=>$payment)
{
$amount = $payment['payment_amount'];
// WARNING: the strong assumption here is that if a change is due it was a cash transaction always
// therefore we remove from the total cash amount any change due
if( $payment['payment_type'] == $CI->lang->line('sales_cash') )
{
foreach($sales as $key=>$sale)
{
$amount -= $sale['change_due'];
}
}
$table.='<div class="summary_row">'.$payment['payment_type'].': '.to_currency( $amount ) . '</div>';
}
$table.='</div>';
return $table;
}
/*
Gets the html table to manage people.
*/
@@ -95,6 +138,7 @@ function get_people_manage_table($people,$controller)
$table.='</tr></thead><tbody>';
$table.=get_people_manage_table_data_rows($people,$controller);
$table.='</tbody></table>';
return $table;
}
@@ -148,6 +192,7 @@ function get_detailed_data_row($row, $controller)
$table_data_row.='</td>';
}
$table_data_row.='</tr>';
return $table_data_row;
}
@@ -161,10 +206,12 @@ function get_supplier_manage_table($suppliers,$controller)
$headers = array('<input type="checkbox" id="select_all" />',
$CI->lang->line('suppliers_company_name'),
$CI->lang->line('suppliers_agency_name'),
$CI->lang->line('common_last_name'),
$CI->lang->line('common_first_name'),
$CI->lang->line('common_email'),
$CI->lang->line('common_phone_number'),
$CI->lang->line('suppliers_supplier_id'),
'&nbsp');
$table.='<thead><tr>';
@@ -175,6 +222,7 @@ function get_supplier_manage_table($suppliers,$controller)
$table.='</tr></thead><tbody>';
$table.=get_supplier_manage_table_data_rows($suppliers,$controller);
$table.='</tbody></table>';
return $table;
}
@@ -193,7 +241,7 @@ function get_supplier_manage_table_data_rows($suppliers,$controller)
if($suppliers->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='7'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('common_no_persons_to_display')."</div></tr></tr>";
$table_data_rows.="<tr><td colspan='9'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('common_no_persons_to_display')."</div></td></tr>";
}
return $table_data_rows;
@@ -208,11 +256,13 @@ function get_supplier_data_row($supplier,$controller)
$table_data_row='<tr>';
$table_data_row.="<td width='5%'><input type='checkbox' id='person_$supplier->person_id' value='".$supplier->person_id."'/></td>";
$table_data_row.='<td width="17%">'.character_limiter($supplier->company_name,13).'</td>';
$table_data_row.='<td width="17%">'.character_limiter($supplier->agency_name,13).'</td>';
$table_data_row.='<td width="17%">'.character_limiter($supplier->last_name,13).'</td>';
$table_data_row.='<td width="17%">'.character_limiter($supplier->first_name,13).'</td>';
$table_data_row.='<td width="22%">'.mailto($supplier->email,character_limiter($supplier->email,22)).'</td>';
$table_data_row.='<td width="17%">'.character_limiter($supplier->phone_number,13).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$supplier->person_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='<td width="17%">'.character_limiter($supplier->phone_number,13).'</td>';
$table_data_row.='<td width="5%">'.character_limiter($supplier->person_id,5).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$supplier->person_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='</tr>';
return $table_data_row;
@@ -230,6 +280,7 @@ function get_items_manage_table($items,$controller)
$CI->lang->line('items_item_number'),
$CI->lang->line('items_name'),
$CI->lang->line('items_category'),
$CI->lang->line('suppliers_company_name'),
$CI->lang->line('items_cost_price'),
$CI->lang->line('items_unit_price'),
$CI->lang->line('items_quantity'),
@@ -247,6 +298,7 @@ function get_items_manage_table($items,$controller)
$table.='</tr></thead><tbody>';
$table.=get_items_manage_table_data_rows($items,$controller);
$table.='</tbody></table>';
return $table;
}
@@ -265,7 +317,7 @@ function get_items_manage_table_data_rows($items,$controller)
if($items->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='12'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('items_no_items_to_display')."</div></tr></tr>";
$table_data_rows.="<tr><td colspan='12'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('items_no_items_to_display')."</div></td></tr>";
}
return $table_data_rows;
@@ -291,6 +343,7 @@ function get_item_data_row($item,$controller)
$table_data_row.='<td width="15%">'.$item->item_number.'</td>';
$table_data_row.='<td width="20%">'.$item->name.'</td>';
$table_data_row.='<td width="14%">'.$item->category.'</td>';
$table_data_row.='<td width="14%">'.$item->company_name.'</td>';
$table_data_row.='<td width="14%">'.to_currency($item->cost_price).'</td>';
$table_data_row.='<td width="14%">'.to_currency($item->unit_price).'</td>';
$table_data_row.='<td width="14%">'.$item->quantity.'</td>';
@@ -306,12 +359,12 @@ function get_item_data_row($item,$controller)
}
$table_data_row.='<td align="center" width="55px">' . $image . '</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$item->item_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
//Ramel Inventory Tracking
$table_data_row.='<td width="10%">'.anchor($controller_name."/inventory/$item->item_id/width:$width", $CI->lang->line('common_inv'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_count')))./*'</td>';//inventory count
$table_data_row.='<td width="5%">'*/'&nbsp;&nbsp;&nbsp;&nbsp;'.anchor($controller_name."/count_details/$item->item_id/width:$width", $CI->lang->line('common_det'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_details_count'))).'</td>';//inventory details
$table_data_row.='</tr>';
return $table_data_row;
}
@@ -321,7 +374,6 @@ Gets the html table to manage giftcards.
function get_giftcards_manage_table( $giftcards, $controller )
{
$CI =& get_instance();
$table='<table class="tablesorter" id="sortable_table">';
$headers = array('<input type="checkbox" id="select_all" />',
@@ -340,6 +392,7 @@ function get_giftcards_manage_table( $giftcards, $controller )
$table.='</tr></thead><tbody>';
$table.=get_giftcards_manage_table_data_rows( $giftcards, $controller );
$table.='</tbody></table>';
return $table;
}
@@ -358,13 +411,12 @@ function get_giftcards_manage_table_data_rows( $giftcards, $controller )
if($giftcards->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='11'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('giftcards_no_giftcards_to_display')."</div></tr></tr>";
$table_data_rows.="<tr><td colspan='11'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('giftcards_no_giftcards_to_display')."</div></td></tr>";
}
return $table_data_rows;
}
/** GARRISON MODIFIED 4/25/2013 **/
function get_giftcard_data_row($giftcard,$controller)
{
$CI =& get_instance();
@@ -377,12 +429,11 @@ function get_giftcard_data_row($giftcard,$controller)
$table_data_row.='<td width="15%">'.$giftcard->first_name.'</td>';
$table_data_row.='<td width="15%">'.$giftcard->giftcard_number.'</td>';
$table_data_row.='<td width="20%">'.to_currency($giftcard->value).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$giftcard->giftcard_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$giftcard->giftcard_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='</tr>';
return $table_data_row;
}
/** END GARRISON MODIFIED **/
/*
Gets the html table to manage item kits.
@@ -390,12 +441,14 @@ Gets the html table to manage item kits.
function get_item_kits_manage_table( $item_kits, $controller )
{
$CI =& get_instance();
$table='<table class="tablesorter" id="sortable_table">';
$headers = array('<input type="checkbox" id="select_all" />',
$CI->lang->line('item_kits_kit'),
$CI->lang->line('item_kits_name'),
$CI->lang->line('item_kits_description'),
$CI->lang->line('items_cost_price'),
$CI->lang->line('items_unit_price'),
'&nbsp',
);
@@ -407,31 +460,32 @@ function get_item_kits_manage_table( $item_kits, $controller )
$table.='</tr></thead><tbody>';
$table.=get_item_kits_manage_table_data_rows( $item_kits, $controller );
$table.='</tbody></table>';
return $table;
}
/*
Gets the html data rows for the item kits.
*/
function get_item_kits_manage_table_data_rows( $item_kits, $controller )
function get_item_kits_manage_table_data_rows($item_kits, $controller)
{
$CI =& get_instance();
$table_data_rows='';
foreach($item_kits->result() as $item_kit)
{
$table_data_rows.=get_item_kit_data_row( $item_kit, $controller );
$table_data_rows .= get_item_kit_data_row($item_kit, $controller);
}
if($item_kits->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='11'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('item_kits_no_item_kits_to_display')."</div></tr></tr>";
$table_data_rows .= "<tr><td colspan='11'><div class='warning_message' style='padding:7px;'>".$CI->lang->line('item_kits_no_item_kits_to_display')."</div></td></tr>";
}
return $table_data_rows;
}
function get_item_kit_data_row($item_kit,$controller)
function get_item_kit_data_row($item_kit, $controller)
{
$CI =& get_instance();
$controller_name=strtolower(get_class($CI));
@@ -439,12 +493,15 @@ function get_item_kit_data_row($item_kit,$controller)
$table_data_row='<tr>';
$table_data_row.="<td width='3%'><input type='checkbox' id='item_kit_$item_kit->item_kit_id' value='".$item_kit->item_kit_id."'/></td>";
$table_data_row.='<td width="15%">'.'KIT '.$item_kit->item_kit_id.'</td>';
$table_data_row.='<td width="15%">'.$item_kit->name.'</td>';
$table_data_row.='<td width="20%">'.character_limiter($item_kit->description, 25).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$item_kit->item_kit_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='<td width="15%">'.to_currency($item_kit->total_cost_price).'</td>';
$table_data_row.='<td width="15%">'.to_currency($item_kit->total_unit_price).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$item_kit->item_kit_id/width:$width", $CI->lang->line('common_edit'),array('class'=>'thickbox','title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='</tr>';
return $table_data_row;
}
?>
?>

View File

@@ -24,7 +24,7 @@ function load_config()
$map = directory_map('./application/language/' . $language);
foreach($map as $file)
{
if ( substr(strrchr($file,'.'),1) == "php")
if ( !is_array($file) && substr(strrchr($file,'.'), 1) == "php")
{
$CI->lang->load( str_replace( '_lang.php', '', $file ), $language);
}

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "You have selected one or more rows, these will
$lang["common_country"] = "Country";
$lang["common_date"] = "Date";
$lang["common_delete"] = "Delete";
$lang["common_print"] = "Print";
$lang["common_det"] = "details";
$lang["common_edit"] = "edit";
$lang["common_email"] = "E-Mail";
@@ -24,7 +25,7 @@ $lang["common_inv"] = "inv";
$lang["common_last_name"] = "Last Name";
$lang["common_last_name_required"] = "The last name is a required field";
$lang["common_last_page"] = "Last";
$lang["common_learn_about_project"] = "to learn the lastest information about the project";
$lang["common_learn_about_project"] = "to learn the latest information about the project";
$lang["common_list_of"] = "List of";
$lang["common_logout"] = "Logout";
$lang["common_new"] = "New";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Row 2";
$lang["config_barcode_third_row"] = "Row 3";
$lang["config_barcode_type"] = "Barcode Type";
$lang["config_barcode_width"] = "Width (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "Company Name";
$lang["config_company_logo"] = "Company Logo";
$lang["config_company_required"] = "Company name is a required field";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Timezone";
$lang["config_use_invoice_template"] = "Use invoice template";
$lang["config_website"] = "Website";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "Error adding/updating Item Kit";
$lang["item_kits_info"] = "Item Kit Info";
$lang["item_kits_item"] = "Item";
$lang["item_kits_items"] = "Items";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "Item Kit Name";
$lang["item_kits_new"] = "New Item Kit";
$lang["item_kits_no_item_kits_to_display"] = "No item kits to display";

View File

@@ -41,6 +41,7 @@ $lang["items_item"] = "Item";
$lang["items_item_number"] = "UPC/EAN/ISBN";
$lang["items_item_number_duplicate"] = "The item number is already present in the database";
$lang["items_location"] = "Location";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Out Of Stock Items";
$lang["items_manually_editing_of_quantity"] = "Manual Edit of Quantity";
$lang["items_must_select_item_for_barcode"] = "You must select at least 1 item to generate barcodes";

View File

@@ -1,7 +1,7 @@
<?php
$lang["module_config"] = "Store Config";
$lang["module_config_desc"] = "Change the store\'s configuration";
$lang["module_config_desc"] = "Change the store's configuration";
$lang["module_customers"] = "Customers";
$lang["module_customers_desc"] = "Add, Update, Delete, and Search customers";
$lang["module_employees"] = "Employees";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "Payment Type";
$lang["reports_payments"] = "Payments";
$lang["reports_payments_summary_report"] = "Payments Summary Report";
$lang["reports_profit"] = "Profit";
$lang["reports_cost"] = "Cost";
$lang["reports_quantity_purchased"] = "Quantity Purchased";
$lang["reports_received_by"] = "Received By";
$lang["reports_receiving_id"] = "Receiving ID";
@@ -76,7 +77,7 @@ $lang["reports_sales_summary_report"] = "Sales Summary Report";
$lang["reports_serial_number"] = "Serial #";
$lang["reports_sold_by"] = "Sold By";
$lang["reports_sold_to"] = "Sold To";
$lang["reports_stock_location"] = "Stock location";
$lang["reports_stock_location"] = "Stock Location";
$lang["reports_subtotal"] = "Subtotal";
$lang["reports_summary_reports"] = "Summary Reports";
$lang["reports_supplied_by"] = "Supplied by";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "Tax Percent";
$lang["reports_taxes"] = "Taxes";
$lang["reports_taxes_summary_report"] = "Taxes Summary Report";
$lang["reports_this_month"] = "This Month";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "This Year";
$lang["reports_today"] = "Today";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "Total";
$lang["reports_type"] = "Type";
$lang["reports_welcome_message"] = "Welcome to the reports panel. Please select a report to view.";
$lang["reports_yesterday"] = "Yesterday";
$lang["reports_item_count"] = "Filter Item Count";
$lang["reports_cost_price"] = "Cost Price";
$lang["reports_unit_price"] = "Retail Price";
$lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "Invoice";
$lang["sales_invoice_confirm"] = "This invoice will be sent to";
$lang["sales_invoice_enable"] = "Create Invoice";
$lang["sales_invoice_filter"] = "Invoices";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_invoice_no_email"] = "This customer does not have a valid email address";
$lang["sales_invoice_number"] = "Invoice #";
$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "All";
$lang["sales_no_items_in_cart"] = "There are no items in the cart";
$lang["sales_no_sales_to_display"] = "No sales to display";
$lang["sales_one_or_multiple"] = "sale(s)";
$lang["sales_overview"] = "Overview";
$lang["sales_takings"] = "Takings";
$lang["sales_payment"] = "Payment Type";
$lang["sales_payment_amount"] = "Amount";
$lang["sales_payment_not_cover_total"] = "Payment Amount does not cover Total";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "Sale unsuccessfully updated";
$lang["sales_unsuspend"] = "Unsuspend";
$lang["sales_unsuspend_and_delete"] = "";
$lang["sales_update"] = "Edit Sale";
$lang["sales_date_range"] = "Date Range";
$lang["sales_none_selected"] = "You have not selected any sales to delete";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "Supplier Information";
$lang["suppliers_cannot_be_deleted"] = "Could not deleted selected suppliers, one or more of the selected suppliers has sales.";
$lang["suppliers_company_name"] = "Company Name";
$lang["suppliers_company_name_required"] = "Company Name is a required field";
$lang["suppliers_agency_name"] = "Agency Name";
$lang["suppliers_confirm_delete"] = "Are you sure you want to delete the selected suppliers?";
$lang["suppliers_error_adding_updating"] = "Error adding/updating supplier";
$lang["suppliers_new"] = "New Supplier";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "You have successfully added supplier";
$lang["suppliers_successful_deleted"] = "You have successfully deleted";
$lang["suppliers_successful_updating"] = "You have successfully updated supplier";
$lang["suppliers_supplier"] = "Supplier";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "Update Supplier";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "Has seleccionado una o más filas. Éstas no e
$lang["common_country"] = "País";
$lang["common_date"] = "Date";
$lang["common_delete"] = "Borrar";
$lang["common_print"] = "Print";
$lang["common_det"] = "detalles";
$lang["common_edit"] = "editar";
$lang["common_email"] = "E-Mail";
@@ -23,7 +24,7 @@ $lang["common_gender_male"] = "M";
$lang["common_inv"] = "inv";
$lang["common_last_name"] = "Apellidos";
$lang["common_last_name_required"] = "Apellidos es un campo requerido";
$lang["common_last_page"] = "Última";
$lang["common_last_page"] = "<EFBFBD>ltima";
$lang["common_learn_about_project"] = "para leer la información más reciente acerca del proyecto";
$lang["common_list_of"] = "Lista de";
$lang["common_logout"] = "Salir";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Fila 1";
$lang["config_barcode_third_row"] = "Fila 2";
$lang["config_barcode_type"] = "Tipo de Código de Barra";
$lang["config_barcode_width"] = "Ancho (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "Nombre del Comercio";
$lang["config_company_logo"] = "Logotipo del Comercio";
$lang["config_company_required"] = "Nombre del Comercio es requerido";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Separador de miles";
$lang["config_timezone"] = "Zona Horaria";
$lang["config_use_invoice_template"] = "Use plantilla de factura";
$lang["config_website"] = "Sitio Web";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "Error agregando/actualizando el Kit
$lang["item_kits_info"] = "Info de Kit de Artículos";
$lang["item_kits_item"] = "Artículo";
$lang["item_kits_items"] = "Artículos";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "Nombre del Kit de Artículos";
$lang["item_kits_new"] = "Nuevo Kit de Artículos";
$lang["item_kits_no_item_kits_to_display"] = "No hay kits de artículos para mostrar";

View File

@@ -41,6 +41,7 @@ $lang["items_item"] = "Artículo";
$lang["items_item_number"] = "UPC/EAN/ISBN";
$lang["items_item_number_duplicate"] = "El número de artículo ya esta presente en la base de datos";
$lang["items_location"] = "Ubicación";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Artículos de Inventario Escaso";
$lang["items_manually_editing_of_quantity"] = "Edición Manual de Cantidad";
$lang["items_must_select_item_for_barcode"] = "Debes seleccionar al menos 1 artículo para generar códigos de barras";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "Tipo de Pago";
$lang["reports_payments"] = "Pagos";
$lang["reports_payments_summary_report"] = "Reporte de Resumen de Pagos";
$lang["reports_profit"] = "Ganancia";
$lang["reports_cost"] = "Cost";
$lang["reports_quantity_purchased"] = "Cantidad Comprada";
$lang["reports_received_by"] = "Recibido por";
$lang["reports_receiving_id"] = "ID de Recepción";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "Porcentaje de Impuestos";
$lang["reports_taxes"] = "Impuestos";
$lang["reports_taxes_summary_report"] = "Reporte de Resumen de Impuestos";
$lang["reports_this_month"] = "Este Mes";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "Este Año";
$lang["reports_today"] = "Hoy";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "Total";
$lang["reports_type"] = "Tipo";
$lang["reports_welcome_message"] = "Bienvenido(a) al panel de reportes. Selecciona un reporte para verlo.";
$lang["reports_yesterday"] = "Ayer";
$lang["reports_item_count"] = "Filter Item Count";
$lang["reports_cost_price"] = "Precio de Compra";
$lang["reports_unit_price"] = "Precio de Venta";
$lang["reports_sub_total_value"] = "Subtotal";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "tarjeta de Crédito";
$lang["sales_invoice_confirm"] = "Esta factura sera enviada a";
$lang["sales_invoice_enable"] = "Crear factura";
$lang["sales_invoice_filter"] = "Facturas";
$lang["sales_cash_filter"] = "Efectivo";
$lang["sales_invoice_no_email"] = "Este cliente no tiene un email válido";
$lang["sales_invoice_number"] = "Factura #";
$lang["sales_invoice_number_duplicate"] = "Por favor ingrese un número de factura único";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "Todos";
$lang["sales_no_items_in_cart"] = "No hay artículos en el carrito";
$lang["sales_no_sales_to_display"] = "No hay ventas que mostrar";
$lang["sales_one_or_multiple"] = "venta(s)";
$lang["sales_overview"] = "Resumen";
$lang["sales_takings"] = "Resumen";
$lang["sales_payment"] = "Tipo de Pago";
$lang["sales_payment_amount"] = "Cantidad";
$lang["sales_payment_not_cover_total"] = "La Cantidad Recibida no cubre el pago total";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "Ha fallado la actualización de la vent
$lang["sales_unsuspend"] = "Retomar";
$lang["sales_unsuspend_and_delete"] = "Retomar y Borrar";
$lang["sales_update"] = "Editar Venta";
$lang["sales_date_range"] = "Rango de Fecha";
$lang["sales_none_selected"] = "No has seleccionado venta para editar";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "Información de Proveedores";
$lang["suppliers_cannot_be_deleted"] = "No se pudo borrar los proveedores seleccionados. Uno o más de los seleccionados tiene ventas.";
$lang["suppliers_company_name"] = "Nombre de la Compañía";
$lang["suppliers_company_name_required"] = "Nombre de la Compañía es requerido";
$lang["suppliers_agency_name"] = "Nombre de la Agency";
$lang["suppliers_confirm_delete"] = "¿Seguro(a) de querer borrar los proveedores seleccionados?";
$lang["suppliers_error_adding_updating"] = "Error agregando/actualizando proveedor";
$lang["suppliers_new"] = "Nuevo Proveedor";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "Has agregado el proveedor satisfactoriam
$lang["suppliers_successful_deleted"] = "Has borrado satisfactoriamente a";
$lang["suppliers_successful_updating"] = "Has actualizado el proveedor satisfactoriamente";
$lang["suppliers_supplier"] = "Proveedor";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "Actualizar Proveedor";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "Vous avez sélectionné une ou plusieurs ligne
$lang["common_country"] = "Pays";
$lang["common_date"] = "Date";
$lang["common_delete"] = "Effacer";
$lang["common_print"] = "Imprimer";
$lang["common_det"] = "détails";
$lang["common_edit"] = "éditer";
$lang["common_email"] = "E-Mail";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Row 3";
$lang["config_barcode_third_row"] = "Row 4";
$lang["config_barcode_type"] = "Barcode Type";
$lang["config_barcode_width"] = "Width (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "Nome de l\'Entreprise";
$lang["config_company_logo"] = "Company Logo";
$lang["config_company_required"] = "Le nom d\'entreprise est requis";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Fuseau Horaire";
$lang["config_use_invoice_template"] = "Use invoice template";
$lang["config_website"] = "Site-web";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "Érreur d\'ajout/édition de Kit";
$lang["item_kits_info"] = "Détails du Kit";
$lang["item_kits_item"] = "Item";
$lang["item_kits_items"] = "Items";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "Nom du Kit";
$lang["item_kits_new"] = "Nouveau Kit";
$lang["item_kits_no_item_kits_to_display"] = "Aucun kit à afficher";

View File

@@ -41,6 +41,7 @@ $lang["items_item"] = "Item";
$lang["items_item_number"] = "UPC/EAN/ISBN";
$lang["items_item_number_duplicate"] = "The item number is already present in the database";
$lang["items_location"] = "Location";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Items à Stock Faible";
$lang["items_manually_editing_of_quantity"] = "Édition Manuelle de Quantité";
$lang["items_must_select_item_for_barcode"] = "Vous devez sélectionner au moins un item";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "Type Paiement";
$lang["reports_payments"] = "Paiements";
$lang["reports_payments_summary_report"] = "Rapport: Résumé des Paiements";
$lang["reports_profit"] = "Bénéfice";
$lang["reports_cost"] = "Cost";
$lang["reports_quantity_purchased"] = "Quantité Achetée";
$lang["reports_received_by"] = "Recu par";
$lang["reports_receiving_id"] = "";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "Pourcentage d\'imposition";
$lang["reports_taxes"] = "Taxes";
$lang["reports_taxes_summary_report"] = "Rapport: Résumé Taxes";
$lang["reports_this_month"] = "Ce mois";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "Cette Année";
$lang["reports_today"] = "Aujourd\'hui";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "Total";
$lang["reports_type"] = "Type";
$lang["reports_welcome_message"] = "Bienvenue à la page des rapports. Veuillez sélectionner un rapport à visualiser.";
$lang["reports_yesterday"] = "Hier";
$lang["reports_item_count"] = "Filter Item Count";
$lang["reports_cost_price"] = "Prix de Gros";
$lang["reports_unit_price"] = "Prix au Détail";
$lang["reports_sub_total_value"] = "Sous-Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "Invoice";
$lang["sales_invoice_confirm"] = "This invoice will be sent to";
$lang["sales_invoice_enable"] = "Create Invoice";
$lang["sales_invoice_filter"] = "Invoices";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_invoice_no_email"] = "This customer does not have a valid email address";
$lang["sales_invoice_number"] = "Invoice #";
$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "All";
$lang["sales_no_items_in_cart"] = "Il n\'y a rien dans votre panier";
$lang["sales_no_sales_to_display"] = "No sales to display";
$lang["sales_one_or_multiple"] = "";
$lang["sales_overview"] = "Overview";
$lang["sales_takings"] = "Takings";
$lang["sales_payment"] = "Type Paiement";
$lang["sales_payment_amount"] = "Somme";
$lang["sales_payment_not_cover_total"] = "Le Paiement ne couvre pas le Total";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "Échec d\'édition";
$lang["sales_unsuspend"] = "Débloquer";
$lang["sales_unsuspend_and_delete"] = "";
$lang["sales_update"] = "Edit Sale";
$lang["sales_date_range"] = "Plage de dates";
$lang["sales_none_selected"] = "Vous n\\\'avez sélectionné aucun élément";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "Informations fournisseur";
$lang["suppliers_cannot_be_deleted"] = "Impossible de supprimer le(s) fournisseur(s) sélectionné(s). Un ou plusieurs ont des ventes.";
$lang["suppliers_company_name"] = "Nom d\'Entreprise";
$lang["suppliers_company_name_required"] = "Le Nom d\'Entreprise est un champ requis";
$lang["suppliers_agency_name"] = "Nom d\'Agence";
$lang["suppliers_confirm_delete"] = "Etes vous sûr(e) de vouloir supprimer ce(s) fournisseur(s)?";
$lang["suppliers_error_adding_updating"] = "Error lors de l\'ajout/suppression de fournisseur";
$lang["suppliers_new"] = "Nouveau Fournisseur";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "Fournisseur ajouté avec succès";
$lang["suppliers_successful_deleted"] = "Suppression réussie";
$lang["suppliers_successful_updating"] = "Fournisseur édité avec succès";
$lang["suppliers_supplier"] = "Fournisseur";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "Éditer Fournisseur";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "Anda telah memilih satu atau lebih baris, ini
$lang["common_country"] = "Negara";
$lang["common_date"] = "Date";
$lang["common_delete"] = "Hapus";
$lang["common_print"] = "Print";
$lang["common_det"] = "Detail";
$lang["common_edit"] = "Ubah";
$lang["common_email"] = "E-Mail";
@@ -22,7 +23,7 @@ $lang["common_gender_female"] = "V";
$lang["common_gender_male"] = "M";
$lang["common_inv"] = "Persediaan";
$lang["common_last_name"] = "Nama Belakang";
$lang["common_last_name_required"] = "Nama belakang wajib diisi.";
$lang["common_last_name_required"] = "Nama belakang wajib diisi.common_last_page";
$lang["common_last_page"] = "Last";
$lang["common_learn_about_project"] = "Untuk belajar informasi terbaru tentang proyek ini";
$lang["common_list_of"] = "Daftar";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Row 8";
$lang["config_barcode_third_row"] = "Row 9";
$lang["config_barcode_type"] = "Barcode Type";
$lang["config_barcode_width"] = "Width (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "Nama Perusahaan";
$lang["config_company_logo"] = "Company Logo";
$lang["config_company_required"] = "Nama Perusahaan wajib diisi";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Pemisah Ribuan";
$lang["config_timezone"] = "Zona Waktu";
$lang["config_use_invoice_template"] = "Use invoice template";
$lang["config_website"] = "Situs Perusahaan";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "Tambah/Ubah Item Paket tidak berhasi
$lang["item_kits_info"] = "Item Paket Info";
$lang["item_kits_item"] = "Item Barang";
$lang["item_kits_items"] = "Item Barang";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "Nama Item Paket";
$lang["item_kits_new"] = "Item Paket Baru";
$lang["item_kits_no_item_kits_to_display"] = "Tidak ada Item Paket yang ditampilkan";

View File

@@ -41,6 +41,7 @@ $lang["items_item"] = "Item";
$lang["items_item_number"] = "Kode Barang";
$lang["items_item_number_duplicate"] = "The item number is already present in the database";
$lang["items_location"] = "Lokasi Barang";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Daftar Stock Rendah";
$lang["items_manually_editing_of_quantity"] = "Perubahan jumlah Stok secara manual";
$lang["items_must_select_item_for_barcode"] = "Anda harus memilih minimal 1 item untuk membuat barcode";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "Tipe Pembayaran";
$lang["reports_payments"] = "Pembayaran";
$lang["reports_payments_summary_report"] = "Laporan Ringkasan Pembayaran";
$lang["reports_profit"] = "Keuntungan/Laba";
$lang["reports_cost"] = "";
$lang["reports_quantity_purchased"] = "Jumlah Dibeli";
$lang["reports_received_by"] = "Diterima Oleh";
$lang["reports_receiving_id"] = "Id Penerima";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "Persentase Pajak";
$lang["reports_taxes"] = "Pajak";
$lang["reports_taxes_summary_report"] = "Laporan Ringkasan Pajak";
$lang["reports_this_month"] = "Bulan ini";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "Tahun ini";
$lang["reports_today"] = "Hari ini";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "Total";
$lang["reports_type"] = "Tipe";
$lang["reports_welcome_message"] = "Selamat Datang ke panel laporan. Silakan pilih laporan untuk melihat/cetak.";
$lang["reports_yesterday"] = "Kemarin";
$lang["reports_item_count"] = "";
$lang["reports_cost_price"] = "Harga Pokok";
$lang["reports_unit_price"] = "Harga Jual";
$lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Nilai Persediaan";
$lang["reports_zero_and_less"] = "Stok habis dan minus";
$lang["reports_more_than_zero"] = "Stok belum habis";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "Invoice";
$lang["sales_invoice_confirm"] = "This invoice will be sent to";
$lang["sales_invoice_enable"] = "Create Invoice";
$lang["sales_invoice_filter"] = "Invoices";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_invoice_no_email"] = "This customer does not have a valid email address";
$lang["sales_invoice_number"] = "Nomor Nota";
$lang["sales_invoice_number_duplicate"] = "Nomor Nota Double";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "All";
$lang["sales_no_items_in_cart"] = "Tidak ada Item dalam Keranjang Belanja";
$lang["sales_no_sales_to_display"] = "No sales to display";
$lang["sales_one_or_multiple"] = "";
$lang["sales_overview"] = "Overview";
$lang["sales_takings"] = "Takings";
$lang["sales_payment"] = "Type Pembayaran";
$lang["sales_payment_amount"] = "Amount";
$lang["sales_payment_not_cover_total"] = "Jumlah pembayaran tidak mencakup Total";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "Penjualan tidak berhasil diperbarui";
$lang["sales_unsuspend"] = "Batal Penangguhan";
$lang["sales_unsuspend_and_delete"] = "Batalkan dan hapus penangguhan";
$lang["sales_update"] = "Edit Sale";
$lang["sales_date_range"] = "Rentang Tanggal";
$lang["sales_none_selected"] = "Anda belum memilih item untuk diubah";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "Informasi Pemasok ";
$lang["suppliers_cannot_be_deleted"] = "Tidak bisa dihapus pemasok yang dipilih, satu atau lebih dari pemasok yang dipilih memiliki penjualan.";
$lang["suppliers_company_name"] = "Nama Perusahaan";
$lang["suppliers_company_name_required"] = "Nama Perusahaan wajib diisi";
$lang["suppliers_agency_name"] = "Nama";
$lang["suppliers_confirm_delete"] = "Apakah Anda yakin ingin menghapus pemasok yang dipilih?";
$lang["suppliers_error_adding_updating"] = "Kesalahan Menambah / memperbarui data pemasok";
$lang["suppliers_new"] = "Pemasok Baru";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "Anda telah berhasil menambahkan data pem
$lang["suppliers_successful_deleted"] = "Anda telah berhasil menghapus data pemasok";
$lang["suppliers_successful_updating"] = "Anda telah berhasil memperbarui data pemasok";
$lang["suppliers_supplier"] = "Pemasok";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "Ubah data Pemasok";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "U hebt een of meerdere rijen geselecteerd, dez
$lang["common_country"] = "Land";
$lang["common_date"] = "Datum";
$lang["common_delete"] = "Verwijder";
$lang["common_print"] = "Print";
$lang["common_det"] = "details";
$lang["common_edit"] = "bewerk";
$lang["common_email"] = "Email";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Rij 2";
$lang["config_barcode_third_row"] = "Rij 3";
$lang["config_barcode_type"] = "Barcode Type";
$lang["config_barcode_width"] = "Breedte (px)";
$lang["config_barcode_generate_if_empty"] = "Genereer indien leeg";
$lang["config_company"] = "Bedrijfsnaam";
$lang["config_company_logo"] = "Logo";
$lang["config_company_required"] = "De bedrijfsnaam moet ingevuld worden";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Tijdzone";
$lang["config_use_invoice_template"] = "Gebruik template voor facturen";
$lang["config_website"] = "Website";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "Fout bij het toevoegen/aanpassen van
$lang["item_kits_info"] = "Product Set Info";
$lang["item_kits_item"] = "Product";
$lang["item_kits_items"] = "Producten";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "Naam";
$lang["item_kits_new"] = "Nieuwe Set";
$lang["item_kits_no_item_kits_to_display"] = "Geen sets gevonden";

View File

@@ -41,7 +41,8 @@ $lang["items_item"] = "Product";
$lang["items_item_number"] = "UPC/EAN/ISBN";
$lang["items_item_number_duplicate"] = "De barcode nummer is reeds aanwezig in de database";
$lang["items_location"] = "Locatie";
$lang["items_low_inventory_items"] = "Producten niet in stock";
$lang["items_empty_upc_items"] = "Zonder barcode";
$lang["items_low_inventory_items"] = "Niet in stock";
$lang["items_manually_editing_of_quantity"] = "Manuele aanpassing hoeveelheid";
$lang["items_must_select_item_for_barcode"] = "U moet ten minste 1 product selecteren om een barcode te genereren";
$lang["items_name"] = "Productnaam";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "Betaald";
$lang["reports_payments"] = "Betalingen";
$lang["reports_payments_summary_report"] = "Overzicht Betalingen";
$lang["reports_profit"] = "Winst";
$lang["reports_cost"] = "Cost";
$lang["reports_quantity_purchased"] = "Aangekochte Hoeveelheid";
$lang["reports_received_by"] = "Ontvangen door";
$lang["reports_receiving_id"] = "";
@@ -76,7 +77,7 @@ $lang["reports_sales_summary_report"] = "Overzicht Verkoop";
$lang["reports_serial_number"] = "Nummer";
$lang["reports_sold_by"] = "Werknemer";
$lang["reports_sold_to"] = "Klant";
$lang["reports_stock_location"] = "";
$lang["reports_stock_location"] = "Stock Locatie";
$lang["reports_subtotal"] = "Subtotaal";
$lang["reports_summary_reports"] = "Overzicht Rapporten";
$lang["reports_supplied_by"] = "Geleverd door";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "VAT Percentage";
$lang["reports_taxes"] = "Belastingen";
$lang["reports_taxes_summary_report"] = "Rapport Overzicht Belastingen";
$lang["reports_this_month"] = "Deze Maand";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "Dit Jaar";
$lang["reports_today"] = "Vandaag";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "Totaal";
$lang["reports_type"] = "Type";
$lang["reports_welcome_message"] = "Welkom bij de rapporten. Selecteer hier een rapport.";
$lang["reports_yesterday"] = "Gisteren";
$lang["reports_item_count"] = "Filter Item Count";
$lang["reports_cost_price"] = "Aankoopprijs";
$lang["reports_unit_price"] = "Verkoopprijs";
$lang["reports_sub_total_value"] = "Subtotaal";
$lang["reports_total_inventory_value"] = "Totale waarde stock";
$lang["reports_zero_and_less"] = "Nul en minder";
$lang["reports_more_than_zero"] = "Meer dan nul";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "Factuur";
$lang["sales_invoice_confirm"] = "Deze factuur zal verstuurd worden naar";
$lang["sales_invoice_enable"] = "Maak Factuur";
$lang["sales_invoice_filter"] = "Facturen";
$lang["sales_cash_filter"] = "Contant";
$lang["sales_invoice_no_email"] = "Er werd geen email adres gevonden voor deze klant";
$lang["sales_invoice_number"] = "Factuur #";
$lang["sales_invoice_number_duplicate"] = "Vul een unieke nummer in";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "Alle";
$lang["sales_no_items_in_cart"] = "Er zijn geen aankopen geselecteerd";
$lang["sales_no_sales_to_display"] = "Er werden geen aankopen gevonden";
$lang["sales_one_or_multiple"] = "aankopen verwijderd";
$lang["sales_overview"] = "Overzicht";
$lang["sales_takings"] = "Overzicht";
$lang["sales_payment"] = "Betaalmethode";
$lang["sales_payment_amount"] = "Bedrag";
$lang["sales_payment_not_cover_total"] = "Betaalde hoeveelheid is onvoldoende";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "Fout bij het bewaren van ticket";
$lang["sales_unsuspend"] = "Hervat";
$lang["sales_unsuspend_and_delete"] = "";
$lang["sales_update"] = "Bewerk Ticket";
$lang["sales_date_range"] = "Periode";
$lang["sales_none_selected"] = "U hebt geen aankopen geselecteerd";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "Informatie Leverancier";
$lang["suppliers_cannot_be_deleted"] = "De geselecteeerde leveranciers konden niet worden verwijderd. Eén of meerdere leveranciers hebben ordergegevens in de database zitten.";
$lang["suppliers_company_name"] = "Bedrijfsnaam";
$lang["suppliers_company_name_required"] = "Bedrijfsnaam moet ingevuld worden";
$lang["suppliers_agency_name"] = "Agencynaam";
$lang["suppliers_confirm_delete"] = "Bent u zeker dat u de geselecteerde leveranciers wil verwijderen?";
$lang["suppliers_error_adding_updating"] = "Fout bij het toevoegen/aanpassen van een leverancier";
$lang["suppliers_new"] = "N. Leverancier";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "Leverancier succesvol toegevoegd";
$lang["suppliers_successful_deleted"] = "Er werd(en)";
$lang["suppliers_successful_updating"] = "Wijzigingen leveranciersgegevens bewaard";
$lang["suppliers_supplier"] = "Leverancier";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "Bewerk Leverancier";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "Вы выбрали одну или неско
$lang["common_country"] = "Страна";
$lang["common_date"] = "Date";
$lang["common_delete"] = "Удалить";
$lang["common_print"] = "Print";
$lang["common_det"] = "детали";
$lang["common_edit"] = "редактировать";
$lang["common_email"] = "Электронная почта";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Row 5";
$lang["config_barcode_third_row"] = "Row 6";
$lang["config_barcode_type"] = "Barcode Type";
$lang["config_barcode_width"] = "Width (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "Название Компании";
$lang["config_company_logo"] = "Company Logo";
$lang["config_company_required"] = "Имя Компании обязательный пробел";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Часовой пояс";
$lang["config_use_invoice_template"] = "Use invoice template";
$lang["config_website"] = "Веб-сайт";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "Ошибка при добавлен
$lang["item_kits_info"] = "Информация о товаре комплекта";
$lang["item_kits_item"] = "товар";
$lang["item_kits_items"] = "товары";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "Наименование товара комплект";
$lang["item_kits_new"] = "Новый товар комплект";
$lang["item_kits_no_item_kits_to_display"] = "Нет товара комплекты для отображения";

View File

@@ -41,6 +41,7 @@ $lang["items_item"] = "Товар";
$lang["items_item_number"] = "UPC/EAN/ISBN";
$lang["items_item_number_duplicate"] = "The item number is already present in the database";
$lang["items_location"] = "место";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Низкий инвентаризации товары";
$lang["items_manually_editing_of_quantity"] = "Руководство Изменить количество";
$lang["items_must_select_item_for_barcode"] = "Вы должны выбрать хотя бы 1 товар для создания штрих-кодов";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "Вид оплаты";
$lang["reports_payments"] = "Оплаты";
$lang["reports_payments_summary_report"] = "Платежей Сводный отчет";
$lang["reports_profit"] = "прибыль";
$lang["reports_cost"] = "Cost";
$lang["reports_quantity_purchased"] = "купенный количество";
$lang["reports_received_by"] = "получило за";
$lang["reports_receiving_id"] = "";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "процент налога";
$lang["reports_taxes"] = "Налоги";
$lang["reports_taxes_summary_report"] = "Сводный отчет налоги";
$lang["reports_this_month"] = "В этом месяце";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "В этом году";
$lang["reports_today"] = "сегодня";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "сумма";
$lang["reports_type"] = "тип";
$lang["reports_welcome_message"] = "Добро пожаловать в панель отчетов. Пожалуйста, выберите отчет для просмотра.";
$lang["reports_yesterday"] = "вчера";
$lang["reports_item_count"] = "Filter Item Count";
$lang["reports_cost_price"] = "Оптовая Цена";
$lang["reports_unit_price"] = "Розничная Цена";
$lang["reports_sub_total_value"] = "промежуточный итог";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "Invoice";
$lang["sales_invoice_confirm"] = "This invoice will be sent to";
$lang["sales_invoice_enable"] = "Create Invoice";
$lang["sales_invoice_filter"] = "Invoices";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_invoice_no_email"] = "This customer does not have a valid email address";
$lang["sales_invoice_number"] = "Invoice #";
$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "All";
$lang["sales_no_items_in_cart"] = "Там нет товаров в корзине";
$lang["sales_no_sales_to_display"] = "No sales to display";
$lang["sales_one_or_multiple"] = "";
$lang["sales_overview"] = "Overview";
$lang["sales_takings"] = "Takings";
$lang["sales_payment"] = "Вид оплаты";
$lang["sales_payment_amount"] = "количество";
$lang["sales_payment_not_cover_total"] = "оплачиваемая сумма недостаточно";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "Продажа безуспешно о
$lang["sales_unsuspend"] = "Разблокировать";
$lang["sales_unsuspend_and_delete"] = "Разблокировать и удалить";
$lang["sales_update"] = "Edit Sale";
$lang["sales_date_range"] = "размах числа";
$lang["sales_none_selected"] = "Вы не выбрали ни одной товари для редактирования";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "Информация о поставщи
$lang["suppliers_cannot_be_deleted"] = "Не удалось удалить выбранные поставщиков, один или более из выбранных поставщиков имеет продаж.";
$lang["suppliers_company_name"] = "Название компании";
$lang["suppliers_company_name_required"] = "Название компании является обязательным полем";
$lang["suppliers_agency_name"] = " ";
$lang["suppliers_confirm_delete"] = "Вы уверены, что хотите удалить выбранных поставщиков?";
$lang["suppliers_error_adding_updating"] = "Ошибка при добавлении/обновлении поставщиком";
$lang["suppliers_new"] = "Новый поставщик";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "Вы успешно добавили п
$lang["suppliers_successful_deleted"] = "Вы успешно удален";
$lang["suppliers_successful_updating"] = "Вы успешно обновляли поставщиком";
$lang["suppliers_supplier"] = "поставщик";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "Обновить поставщика";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "คุณเลือกมากกว่า
$lang["common_country"] = "ประเทศ";
$lang["common_date"] = "Date";
$lang["common_delete"] = "ลบ";
$lang["common_print"] = "พิมพ์";
$lang["common_det"] = "สรุป";
$lang["common_edit"] = "แก้ไข";
$lang["common_email"] = "E-Mail";
@@ -16,24 +17,24 @@ $lang["common_email_invalid_format"] = "e-mail address ไม่ถูกต้
$lang["common_fields_required_message"] = "ช่องสีแดงต้องกรอก";
$lang["common_first_name"] = "ชื่อ";
$lang["common_first_name_required"] = "ชื่อต้องกรอก";
$lang["common_first_page"] = "First";
$lang["common_gender"] = "";
$lang["common_gender_female"] = "V";
$lang["common_gender_male"] = "";
$lang["common_first_page"] = "อันดับแรก";
$lang["common_gender"] = "เพศ";
$lang["common_gender_female"] = "หญิง";
$lang["common_gender_male"] = "ชาย";
$lang["common_inv"] = "ยอด";
$lang["common_last_name"] = "นามสกุล";
$lang["common_last_name_required"] = "นามสกุลต้องกรอก";
$lang["common_last_page"] = "Last";
$lang["common_learn_about_project"] = "เพื่อศึกษาข้อมูลล่าสุดของโครงการ";
$lang["common_list_of"] = "รายการ";
$lang["common_logout"] = "";
$lang["common_logout"] = "ออกจากระบบ";
$lang["common_new"] = "New";
$lang["common_no_persons_to_display"] = "ไม่พบข้อมูลตัวบุคคล";
$lang["common_or"] = "";
$lang["common_or"] = "หรือ";
$lang["common_phone_number"] = "โทรศัพท์";
$lang["common_phone_number_required"] = "";
$lang["common_phone_number_required"] = "ต้องกรอกเบอร์โทร";
$lang["common_please_visit_my"] = "เยี่ยมชมที่";
$lang["common_powered_by"] = "";
$lang["common_powered_by"] = "จัดทำโดย";
$lang["common_price"] = "ราคา";
$lang["common_remove"] = "ลบ";
$lang["common_return_policy"] = "นโยบายคืนสินค้า";
@@ -42,15 +43,15 @@ $lang["common_search_options"] = "Search options";
$lang["common_searched_for"] = "ค้นหาสำหรับ";
$lang["common_state"] = "จังหวัด";
$lang["common_submit"] = "ส่งข้อมูล";
$lang["common_view_recent_sales"] = "สำรวจการขายเมื่อเร็วๆนี้";
$lang["common_view_recent_sales"] = "การขายล่าสุด";
$lang["common_website"] = "website";
$lang["common_welcome"] = "";
$lang["common_welcome"] = "ยินดีต้อนรับ";
$lang["common_welcome_message"] = "Opensource Point of sale. กรุณาเลือกคำสั่งเมนูด้านล่าง ";
$lang["common_you_are_using_ospos"] = "คุณกำลังใช้ Opensource Point of Sales รุ่น";
$lang["common_zip"] = "รหัสไปรษณีย์";
$lang["common_import"] = "Import";
$lang["common_import"] = "นำเข้า";
$lang["common_download_import_template"] = "Download Import Excel Template (CSV)";
$lang["common_import_file_path"] = "file path";
$lang["common_import_excel"] = "Excel Import";
$lang["common_import_full_path"] = "Full path to excel file required";
$lang["common_required"] = "Required";
$lang["common_required"] = "ต้องกรอก";

View File

@@ -2,34 +2,35 @@
$lang["config_address"] = "ที่อยู่";
$lang["config_address_required"] = "ที่อยู่ต้องกรอก";
$lang["config_backup_button"] = "Backup";
$lang["config_backup_database"] = "Backup Database";
$lang["config_backup_button"] = "สำรองข้อมูล";
$lang["config_backup_database"] = "สำรองฐานข้อมูล";
$lang["config_barcode_company"] = "ชื่อร้านค้า";
$lang["config_barcode_configuration"] = "Barcode Configuration";
$lang["config_barcode_content"] = "Barcode Content";
$lang["config_barcode_first_row"] = "";
$lang["config_barcode_font"] = "";
$lang["config_barcode_height"] = "";
$lang["config_barcode_id"] = "Item Id";
$lang["config_barcode_info"] = "";
$lang["config_barcode_layout"] = "";
$lang["config_barcode_name"] = "Name";
$lang["config_barcode_configuration"] = "ตั้งค่าระบบบาร์โค้ด";
$lang["config_barcode_content"] = "รหัสที่พิมพ์";
$lang["config_barcode_first_row"] = "แถว 1";
$lang["config_barcode_font"] = "แบบอักษร";
$lang["config_barcode_height"] = "สูง (px)";
$lang["config_barcode_id"] = "รหัสสินค้า/ชื่อสินค้า";
$lang["config_barcode_info"] = "ตั้งค่าบาร์โค้ด";
$lang["config_barcode_layout"] = "โครงร่างการพิมพ์";
$lang["config_barcode_name"] = "สินค้า";
$lang["config_barcode_number"] = "UPC/EAN/ISBN";
$lang["config_barcode_number_in_row"] = "";
$lang["config_barcode_page_cellspacing"] = "";
$lang["config_barcode_page_width"] = "";
$lang["config_barcode_price"] = "Price";
$lang["config_barcode_quality"] = "";
$lang["config_barcode_second_row"] = "";
$lang["config_barcode_third_row"] = "";
$lang["config_barcode_type"] = "";
$lang["config_barcode_width"] = "";
$lang["config_barcode_number_in_row"] = "จำนวนดวงใน 1 แถว";
$lang["config_barcode_page_cellspacing"] = "ระยะห่างต่อดวง";
$lang["config_barcode_page_width"] = "ความกว้างในหน้า";
$lang["config_barcode_price"] = "ราคา";
$lang["config_barcode_quality"] = "คุณภาพ (1-100)";
$lang["config_barcode_second_row"] = "แถว 2";
$lang["config_barcode_third_row"] = "แถว 3";
$lang["config_barcode_type"] = "ประเภทบาร์โค้ด";
$lang["config_barcode_width"] = "กว้าง (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "ชื่อร้านค้า";
$lang["config_company_logo"] = "Company Logo";
$lang["config_company_logo"] = "ภาพโลโก้";
$lang["config_company_required"] = "ชื่อร้านค้าต้องกรอก";
$lang["config_company_website_url"] = "เว็บไซต์ร้านค้าไม่ถูกต้อง";
$lang["config_currency_side"] = "ด้านขวา";
$lang["config_currency_symbol"] = "ัญลักษณ์ค่าเงิน";
$lang["config_currency_symbol"] = "ัญลักษณ์ค่าเงิน";
$lang["config_custom1"] = "พื้นที่เพิ่มเติม 1";
$lang["config_custom10"] = "พื้นที่เพิ่มเติม 10";
$lang["config_custom2"] = "พื้นที่เพิ่มเติม 2";
@@ -40,7 +41,7 @@ $lang["config_custom6"] = "พื้นที่เพิ่มเติม 6";
$lang["config_custom7"] = "พื้นที่เพิ่มเติม 7";
$lang["config_custom8"] = "พื้นที่เพิ่มเติม 8";
$lang["config_custom9"] = "พื้นที่เพิ่มเติม 9";
$lang["config_decimal_point"] = "Decimal Point";
$lang["config_decimal_point"] = "จุดทศนิยม";
$lang["config_default_barcode_font_size_number"] = "The default barcode font size must be a number";
$lang["config_default_barcode_font_size_required"] = "The default barcode font size is a required field";
$lang["config_default_barcode_height_number"] = "The default barcode height must be a number";
@@ -63,8 +64,8 @@ $lang["config_default_tax_rate_1"] = "อัตราภาษี 1";
$lang["config_default_tax_rate_2"] = "อัตราภาษี 2";
$lang["config_default_tax_rate_number"] = "อัตราภาษีเริ่มต้นต้องเป็นตัวเลข";
$lang["config_default_tax_rate_required"] = "อัตราภาษีเริ่มต้นต้องกรอก";
$lang["config_fax"] = "แฟ็ก";
$lang["config_general_configuration"] = "General Configuration";
$lang["config_fax"] = "แฟ็กซ์";
$lang["config_general_configuration"] = "ตั้งค่าทั่วไป";
$lang["config_info"] = "ข้อมูลร้านค้า";
$lang["config_invoice_default_comments"] = "Default Invoice Comments";
$lang["config_invoice_email_message"] = "Invoice Email Template";
@@ -77,7 +78,7 @@ $lang["config_lines_per_page_required"] = "The lines per page is a required fiel
$lang["config_location_configuration"] = "Stock Locations";
$lang["config_location_info"] = "Location Configuration Information";
$lang["config_logout"] = "Don't you want to make a backup before logging out?";
$lang["config_number_format"] = "Number Format";
$lang["config_number_format"] = "รูปแบบตัวเลข";
$lang["config_phone"] = "เบอร์โทรศัพท์";
$lang["config_phone_required"] = "เบอร์โทรต้องกรอก";
$lang["config_print_bottom_margin"] = "Margin Bottom";
@@ -111,7 +112,10 @@ $lang["config_stock_location_duplicate"] = "";
$lang["config_stock_location_invalid_chars"] = "The stock location name can not contain '_'";
$lang["config_stock_location_required"] = "จำเป็นต้องระบุสถานที่เก็บ";
$lang["config_tax_included"] = "รวมภาษีแล้ว";
$lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Timezone";
$lang["config_thousands_separator"] = "ตัวคั่นหลักพัน";
$lang["config_timezone"] = "โซนเวลา";
$lang["config_use_invoice_template"] = "Use invoice template";
$lang["config_website"] = "เว็บไซต์";
$lang["config_locale_configuration"] = "ตั้งค่าภาษา";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "รูปแบบวันเวลา";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "เพิ่ม/ปรับปร
$lang["item_kits_info"] = "ข้อมูลสินค้าหมู่";
$lang["item_kits_item"] = "สินค้า";
$lang["item_kits_items"] = "สินค้า";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "ชื่อสินค้าหมู่";
$lang["item_kits_new"] = "สร้างสินค้าหมู่";
$lang["item_kits_no_item_kits_to_display"] = "ไม่มีสินค้าแสดง";

View File

@@ -2,9 +2,9 @@
$lang["items_add_minus"] = "เพิ่ม/ลบ จำนวนสินค้าคงคลัง";
$lang["items_allow_alt_desciption"] = "Allow Alt Description";
$lang["items_allow_alt_description"] = "";
$lang["items_allow_alt_description"] = "แสดงข้อมูลเพิ่มเติม";
$lang["items_amazon"] = "Amazon";
$lang["items_basic_information"] = "ข้อมูลสินค้";
$lang["items_basic_information"] = "ข้อมูลสินค้";
$lang["items_bulk_edit"] = "แก้ไขความจุ";
$lang["items_buy_price_required"] = "ราคาซื้อขายต้องกรอก";
$lang["items_cannot_be_deleted"] = "ไม่สามารถลบสินค้าที่เลือก, สินค้าที่เลือกถูกขายไปแล้ว.";
@@ -30,17 +30,18 @@ $lang["items_edit_multiple_items"] = "แก้ใขสินค้าต่า
$lang["items_error_adding_updating"] = "เพิ่ม/ปรับแต่ง สินค้าล้มเหลว";
$lang["items_error_updating_multiple"] = "ปรับแต่งสินค้าล้มเหลว";
$lang["items_excel_import_failed"] = "นำเข้าข้อมูล Excel ล้มเหลว";
$lang["items_generate_barcodes"] = "สร้างบาร์โค๊ด";
$lang["items_image"] = "Avatar";
$lang["items_generate_barcodes"] = "พิมพ์บาร์โค๊ด";
$lang["items_image"] = "รูป";
$lang["items_info_provided_by"] = "จัดเตรียมข้อมูลโดย";
$lang["items_inventory"] = "สินค้าคงเหลือ";
$lang["items_inventory_comments"] = "คำอธิบาย";
$lang["items_is_deleted"] = "ถูกลบแล้ว";
$lang["items_is_serialized"] = "สินค้ามีซีเรียนัมเบอร์";
$lang["items_is_serialized"] = "สินค้ามีซีเรียนัมเบอร์";
$lang["items_item"] = "สินค้า";
$lang["items_item_number"] = "โค๊ด";
$lang["items_item_number_duplicate"] = "The item number is already present in the database";
$lang["items_location"] = "ที่ตั้ง";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "สินค้าคงเหลือน้อย";
$lang["items_manually_editing_of_quantity"] = "แก้ไขจำนวน";
$lang["items_must_select_item_for_barcode"] = "คุต้องเลือกสินค้าอย่างน้อยหนึ่งอย่างเพื่อจะสร้างบาร์โค๊ด";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "ชนิดของการจ่าย";
$lang["reports_payments"] = "รายจ่าย";
$lang["reports_payments_summary_report"] = "รายงานสรุปการจ่าย";
$lang["reports_profit"] = "กำไร";
$lang["reports_cost"] = "Cost";
$lang["reports_quantity_purchased"] = "จำนวนการช์้อ";
$lang["reports_received_by"] = "รับโดย";
$lang["reports_receiving_id"] = "IDรับสินค้า";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "เปอร์เซ็นภาษี";
$lang["reports_taxes"] = "ภาษี";
$lang["reports_taxes_summary_report"] = "รายงานสรุปภาษี";
$lang["reports_this_month"] = "เดือนนี้";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "ปีนี้";
$lang["reports_today"] = "วันนี้";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "ยอดรวม";
$lang["reports_type"] = "ชนิด";
$lang["reports_welcome_message"] = "ยินดีต้อนรับเข้าสู่รายงาน. โปรดเลือกชนิดของรายงาน.";
$lang["reports_yesterday"] = "เมื่อวานนี้";
$lang["reports_item_count"] = "Filter Item Count";
$lang["reports_cost_price"] = "ราคาทุน";
$lang["reports_unit_price"] = "ราคาขาย";
$lang["reports_sub_total_value"] = "ยอดรวมหักภาษี ";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";

View File

@@ -1,27 +1,27 @@
<?php
$lang["sales_add_payment"] = "เพิ่มบิล";
$lang["sales_amount_due"] = "";
$lang["sales_amount_tendered"] = "จำนวนประมูล";
$lang["sales_amount_due"] = "ยอดต้องชำระ";
$lang["sales_amount_tendered"] = "ชำระเข้ามา";
$lang["sales_basic_information"] = "";
$lang["sales_cancel_sale"] = "ยกเลิกการขาย";
$lang["sales_cash"] = "เงินสด";
$lang["sales_change_due"] = "เงินทอน";
$lang["sales_check"] = "เช็";
$lang["sales_check"] = "เช็";
$lang["sales_check_balance"] = "Check remainder";
$lang["sales_comment"] = "หมายเหตุ";
$lang["sales_comments"] = "หมายเหตุ";
$lang["sales_complete_sale"] = "สำเร็จการขาย";
$lang["sales_complete_sale"] = "การขาย";
$lang["sales_confirm_cancel_sale"] = "แน่ใจหรือไม่ที่จะล้างรายการขาย? สินค้าทุกอย่างจะถูกลบจากบอร์ด.";
$lang["sales_confirm_delete"] = "Are you sure you want to delete the selected sales?";
$lang["sales_confirm_finish_sale"] = "แน่ใจหรือไม่ที่จะสำเร็จการขาย? ไม่สามารถย้อนกลับได้.";
$lang["sales_confirm_suspend_sale"] = "แน่ใจหรือไม่ที่จะระงับการขาย?";
$lang["sales_credit"] = "เครดิการ์ด";
$lang["sales_credit"] = "เครดิการ์ด";
$lang["sales_customer"] = "ลูกค้า";
$lang["sales_date"] = "วันที่ขาย";
$lang["sales_date_required"] = "A correct date needs to be filled in";
$lang["sales_date_type"] = "Date field is required";
$lang["sales_debit"] = "เดบิการ์ด";
$lang["sales_debit"] = "เดบิการ์ด";
$lang["sales_delete_confirmation"] = "แน่ใจหรือไม่ที่จะลบรายการขายนี้, ลบแล้วไม่สามารถเรียกกลับคืนใด้";
$lang["sales_delete_entire_sale"] = "ลบการขายทั้งหมด";
$lang["sales_delete_successful"] = "คุณลบการขายสำเร็จ";
@@ -29,7 +29,7 @@ $lang["sales_delete_unsuccessful"] = "คุณลบการขายไม่
$lang["sales_description_abbrv"] = "Desc";
$lang["sales_discount"] = "ส่วนลด %";
$lang["sales_discount_included"] = "% Discount";
$lang["sales_discount"] = "Discount";
$lang["sales_discount"] = "ส่วนลด";
$lang["sales_discount_short"] = "";
$lang["sales_edit"] = "แก้ไข";
$lang["sales_edit_item"] = "แก้ไขสินค้า";
@@ -43,16 +43,17 @@ $lang["sales_giftcard"] = "Gift Card";
$lang["sales_giftcard_balance"] = "Giftcard Balance";
$lang["sales_giftcard_number"] = "เลขที่ Gift Card";
$lang["sales_id"] = "เลขที่ขาย";
$lang["sales_invoice"] = "Invoice";
$lang["sales_invoice"] = "ใบแจ้งหนี้";
$lang["sales_invoice_confirm"] = "This invoice will be sent to";
$lang["sales_invoice_enable"] = "Create Invoice";
$lang["sales_invoice_filter"] = "Invoices";
$lang["sales_invoice_enable"] = "ออกใบแจ้งหนี้";
$lang["sales_invoice_filter"] = "ใบแจ้งหนี้";
$lang["sales_cash_filter"] = "เงินสด";
$lang["sales_invoice_no_email"] = "This customer does not have a valid email address";
$lang["sales_invoice_number"] = "Invoice #";
$lang["sales_invoice_number"] = "เลขใบแจ้งหนี้";
$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number";
$lang["sales_invoice_sent"] = "Invoice sent to";
$lang["sales_invoice_unsent"] = "Invoice failed to be sent to";
$lang["sales_invoice_update"] = "Recount";
$lang["sales_invoice_update"] = "คำนวณใหม่";
$lang["sales_item_insufficient_of_stock"] = "จำนวนสินค้าไม่เพียงพอ";
$lang["sales_item_name"] = "ชื่อสินค้า";
$lang["sales_item_number"] = "สินค้า #";
@@ -67,39 +68,39 @@ $lang["sales_no_filter"] = "All";
$lang["sales_no_items_in_cart"] = "ไม่พบสินค้าในตระกร้า";
$lang["sales_no_sales_to_display"] = "No sales to display";
$lang["sales_one_or_multiple"] = "";
$lang["sales_overview"] = "Overview";
$lang["sales_takings"] = "ประวัติ";
$lang["sales_payment"] = "รูปแบบชำระเงิน";
$lang["sales_payment_amount"] = "";
$lang["sales_payment_not_cover_total"] = " ปริมาณการจ่ายที่ไม่เพียงพอกะยอดรวม";
$lang["sales_payment_type"] = "";
$lang["sales_payments_total"] = "";
$lang["sales_payment_type"] = "ชำระโดย";
$lang["sales_payments_total"] = "ยอดชำระแล้ว";
$lang["sales_price"] = "ราคา";
$lang["sales_print_after_sale"] = "พิมพ์บิลหลังการขาย";
$lang["sales_quantity"] = "จำนวน";
$lang["sales_quantity_less_than_zero"] = "คำเตือน ถ้าจำนวนของไม่เพียงพอกับความต้องการหรือไม่ตรงกับยอดในบันชี ก็สามารถทำการขายได้ แต่ต้องเชคปริมานสินค้าคงคลัง";
$lang["sales_receipt"] = "บิลขาย";
$lang["sales_receipt_number"] = "";
$lang["sales_receipt_number"] = "จุดขาย#";
$lang["sales_register"] = "ลงทะเบียนขาย";
$lang["sales_remove_customer"] = "ลบลูกค้า";
$lang["sales_return"] = "คืน";
$lang["sales_sale"] = "";
$lang["sales_sale"] = "ขาย";
$lang["sales_sale_for_customer"] = "ลูกค้า:";
$lang["sales_sale_time"] = "";
$lang["sales_sale_time"] = "เวลา";
$lang["sales_select_customer"] = "เลือกลูกค้า (Optional)";
$lang["sales_send_invoice"] = "Send Invoice";
$lang["sales_send_invoice"] = "ส่งใบแจ้งหนี้";
$lang["sales_serial"] = "Serial";
$lang["sales_show_invoice"] = "invoice";
$lang["sales_show_receipt"] = "receipt";
$lang["sales_show_invoice"] = "ใบแจ้งหนี้";
$lang["sales_show_receipt"] = "ใบเสร็จ";
$lang["sales_start_typing_customer_name"] = "เริ่มต้นพิมพ์ชื่อลูกค้า...";
$lang["sales_start_typing_item_name"] = "เริ่มต้นพิมพ์ชื่อสินค้า หรือ สแกนบาร์โค๊ด...";
$lang["sales_stock_location"] = "";
$lang["sales_stock_location"] = "ที่เก็บ";
$lang["sales_sub_total"] = "ยอดรวมหักภาษี ";
$lang["sales_successfully_deleted"] = "ลบการขายสมยูรณ์";
$lang["sales_successfully_suspended_sale"] = "การขายของคุณถูกระงับเรียบร้อย";
$lang["sales_successfully_updated"] = "อัพเดทการขายสมบูรณ์";
$lang["sales_suspend_sale"] = "ระงับการขายชั่วคราว";
$lang["sales_suspended_sale_id"] = "รหัสการขายที่ถูกระงับ";
$lang["sales_suspended_sales"] = "การขายที่ถูกระงับ";
$lang["sales_suspend_sale"] = "พักรายการ";
$lang["sales_suspended_sale_id"] = "รหัสการขายที่ถูกพัก";
$lang["sales_suspended_sales"] = "การขายที่พักไว้";
$lang["sales_tax"] = "ภาษี";
$lang["sales_tax_percent"] = "ภาษี %";
$lang["sales_total"] = "ยอดรวม";
@@ -110,4 +111,6 @@ $lang["sales_unsuccessfully_deleted"] = "ลบการขายไม่สำ
$lang["sales_unsuccessfully_updated"] = "อัพเดทการขายไม่สมบูรณ์";
$lang["sales_unsuspend"] = "ยกเลิกการระงับ";
$lang["sales_unsuspend_and_delete"] = "ยกเลิกการระงับ และ ลบ";
$lang["sales_update"] = "Edit Sale";
$lang["sales_update"] = "แก้ไขการขาย";
$lang["sales_date_range"] = "ระหว่างวันที่";
$lang["sales_none_selected"] = "กรุณาเลือสินค้าที่ต้องการแก้ไข";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "ข้อมูลผู้ผลิต"
$lang["suppliers_cannot_be_deleted"] = "ลบผู้ผลิตที่ถูกเลือกไม่ได้, one or more of the selected suppliers has sales.";
$lang["suppliers_company_name"] = "ชื่อบริษัท";
$lang["suppliers_company_name_required"] = "ชื่อบริษัทต้องกรอก";
$lang["suppliers_agency_name"] = " ";
$lang["suppliers_confirm_delete"] = "แน่ใจหรือไม่ที่จะลบผู้ผลิตที่ถููกเลือก?";
$lang["suppliers_error_adding_updating"] = "เพิ่ม/แก้ไข ผู้ผลิต ล้มเหลว";
$lang["suppliers_new"] = "ผู้ผลิตรายใหม่";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "เพิ่มผู้ผลิตส
$lang["suppliers_successful_deleted"] = "ลบสำเร็จ";
$lang["suppliers_successful_updating"] = "ปรับปรุงผู้ผลิตสำเร็จ";
$lang["suppliers_supplier"] = "ผู้ผลิต";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "ปรับปรุงผู้ผลิต";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "Birden fazla satır seçtiniz, arama yaptığ
$lang["common_country"] = "Ülke";
$lang["common_date"] = "Date";
$lang["common_delete"] = "Sil";
$lang["common_print"] = "Print";
$lang["common_det"] = "Detaylar";
$lang["common_edit"] = "düzenle";
$lang["common_email"] = "E-Posta";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Row 7";
$lang["config_barcode_third_row"] = "Row 8";
$lang["config_barcode_type"] = "Barcode Type";
$lang["config_barcode_width"] = "Width (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "Şirket Adı";
$lang["config_company_logo"] = "Company Logo";
$lang["config_company_required"] = "Şirket Adı zorunlu alandır";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "Saat Dilimi";
$lang["config_use_invoice_template"] = "Use invoice template";
$lang["config_website"] = "Website";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "Ürün seti ekleme/güncelleme hatas
$lang["item_kits_info"] = "Ürün Seti Bilgisi";
$lang["item_kits_item"] = "Ürün";
$lang["item_kits_items"] = "Ürünler";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "Ürün Seti İsmi";
$lang["item_kits_new"] = "Yeni Ürün Seti";
$lang["item_kits_no_item_kits_to_display"] = "Gösterecek ürün seti yok";

View File

@@ -41,6 +41,7 @@ $lang["items_item"] = "Ürün";
$lang["items_item_number"] = "UPC/EAN/ISBN";
$lang["items_item_number_duplicate"] = "The item number is already present in the database";
$lang["items_location"] = "Yer";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "";
$lang["items_manually_editing_of_quantity"] = "Elle adet düzeltme";
$lang["items_must_select_item_for_barcode"] = "Barkod üretmek için en az bir ürün seçmelisiniz";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "Ödeme Türü";
$lang["reports_payments"] = "Ödemeler";
$lang["reports_payments_summary_report"] = "Ödeme Özet Raporu";
$lang["reports_profit"] = "Kâr";
$lang["reports_cost"] = "";
$lang["reports_quantity_purchased"] = "Satın Alınan Adet";
$lang["reports_received_by"] = "Alım Yapan";
$lang["reports_receiving_id"] = "Alım No";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "Vergi Oranı";
$lang["reports_taxes"] = "Vergiler";
$lang["reports_taxes_summary_report"] = "Vergi Özet Raporu";
$lang["reports_this_month"] = "Bu Ay";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "Bu Yıl";
$lang["reports_today"] = "Bugün";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "Toplam";
$lang["reports_type"] = "Tür";
$lang["reports_welcome_message"] = "Rapor paneline hoş geldiniz. Görmek istediğiniz raporu seçiniz.";
$lang["reports_yesterday"] = "Dün";
$lang["reports_item_count"] = "Filter Stok Habis/Belum Habis/Minus";
$lang["reports_cost_price"] = "Maliyet Fiyatı";
$lang["reports_unit_price"] = "Satış Fiyatı";
$lang["reports_sub_total_value"] = "Ara Toplam";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "Invoice";
$lang["sales_invoice_confirm"] = "This invoice will be sent to";
$lang["sales_invoice_enable"] = "Create Invoice";
$lang["sales_invoice_filter"] = "Invoices";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_invoice_no_email"] = "This customer does not have a valid email address";
$lang["sales_invoice_number"] = "Invoice #";
$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "All";
$lang["sales_no_items_in_cart"] = "Sepette Ürün Yok";
$lang["sales_no_sales_to_display"] = "No sales to display";
$lang["sales_one_or_multiple"] = "";
$lang["sales_overview"] = "Overview";
$lang["sales_takings"] = "Takings";
$lang["sales_payment"] = "Ödeme Türü";
$lang["sales_payment_amount"] = "Tutar";
$lang["sales_payment_not_cover_total"] = "Ödemeler toplam tutarı karşılamıyor";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "Satış düzenlenemedi";
$lang["sales_unsuspend"] = "Satışa Al";
$lang["sales_unsuspend_and_delete"] = "";
$lang["sales_update"] = "Edit Sale";
$lang["sales_date_range"] = "Tarih Aralığı";
$lang["sales_none_selected"] = "Düzenlemek için ürün seçmediniz";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "Sağlayıcı Bilgisi";
$lang["suppliers_cannot_be_deleted"] = "Sağlayıcı silinemedi, bazı sağlayıcıların satışı var.";
$lang["suppliers_company_name"] = "Şirket Adı";
$lang["suppliers_company_name_required"] = "Şirket Adı zorunlu alandır";
$lang["suppliers_agency_name"] = " ";
$lang["suppliers_confirm_delete"] = "Seçili sağlayıcıları düzenlemek istiyor musunuz?";
$lang["suppliers_error_adding_updating"] = "Sağlayıcı ekleme/düzenleme hatası";
$lang["suppliers_new"] = "Yeni Sağlayıcı";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "Sağlayıcı eklendi";
$lang["suppliers_successful_deleted"] = "Sağlayıcı silindi";
$lang["suppliers_successful_updating"] = "Sağlayıcı düzenlendi";
$lang["suppliers_supplier"] = "Sağlayıcı";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "Sağlayıcıyı Düzenle";

View File

@@ -9,6 +9,7 @@ $lang["common_confirm_search"] = "您已經選擇一行或多行,在搜索後
$lang["common_country"] = "國家";
$lang["common_date"] = "Date";
$lang["common_delete"] = "刪除";
$lang["common_print"] = "Print";
$lang["common_det"] = "更多";
$lang["common_edit"] = "編輯";
$lang["common_email"] = "E-Mail";

View File

@@ -24,6 +24,7 @@ $lang["config_barcode_second_row"] = "Row 4";
$lang["config_barcode_third_row"] = "Row 5";
$lang["config_barcode_type"] = "Barcode Type";
$lang["config_barcode_width"] = "Width (px)";
$lang["config_barcode_generate_if_empty"] = "Generate if empty";
$lang["config_company"] = "公司名稱";
$lang["config_company_logo"] = "Company Logo";
$lang["config_company_required"] = "公司名稱為必填";
@@ -115,3 +116,6 @@ $lang["config_thousands_separator"] = "Thousands Separator";
$lang["config_timezone"] = "時區";
$lang["config_use_invoice_template"] = "Use invoice template";
$lang["config_website"] = "網站";
$lang["config_locale_configuration"] = "Localisation Configuration";
$lang["config_locale_info"] = "Localisation Configuration Information";
$lang["config_datetimeformat"] = "Date and Time format";

View File

@@ -8,6 +8,7 @@ $lang["item_kits_error_adding_updating"] = "新增/更新產品套件錯誤";
$lang["item_kits_info"] = "產品套件資料";
$lang["item_kits_item"] = "產品";
$lang["item_kits_items"] = "產品";
$lang["item_kits_kit"] = "Kit Id";
$lang["item_kits_name"] = "產品套件";
$lang["item_kits_new"] = "新增產品套件";
$lang["item_kits_no_item_kits_to_display"] = "沒有產品套件";

View File

@@ -41,6 +41,7 @@ $lang["items_item"] = "產品";
$lang["items_item_number"] = "UPC/EAN/ISBN";
$lang["items_item_number_duplicate"] = "The item number is already present in the database";
$lang["items_location"] = "位置";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "低庫存產品";
$lang["items_manually_editing_of_quantity"] = "手動編輯數量";
$lang["items_must_select_item_for_barcode"] = "您必須至少選擇一個產品生才能產生條碼";

View File

@@ -48,6 +48,7 @@ $lang["reports_payment_type"] = "付款方式";
$lang["reports_payments"] = "付款";
$lang["reports_payments_summary_report"] = "收入報告摘要";
$lang["reports_profit"] = "利潤";
$lang["reports_cost"] = "Cost";
$lang["reports_quantity_purchased"] = "銷售金額";
$lang["reports_received_by"] = "收款人";
$lang["reports_receiving_id"] = "";
@@ -88,9 +89,20 @@ $lang["reports_tax_percent"] = "稅率";
$lang["reports_taxes"] = "稅額";
$lang["reports_taxes_summary_report"] = "稅金摘要報告";
$lang["reports_this_month"] = "這個月";
$lang["reports_this_month_last_year"] = "This Month Last Year";
$lang["reports_this_month_to_today"] = "This Month To Today";
$lang["reports_this_month_to_today_last_year"] = "This Month To Today Last Year";
$lang["reports_this_year"] = "今年";
$lang["reports_today"] = "今天";
$lang["reports_today_last_year"] = "Today Last Year";
$lang["reports_total"] = "總計";
$lang["reports_type"] = "類型";
$lang["reports_welcome_message"] = "歡迎使用報表系統。請選擇要查看的報表。";
$lang["reports_yesterday"] = "昨天";
$lang["reports_item_count"] = "Filter Item Count";
$lang["reports_cost_price"] = "成本價";
$lang["reports_unit_price"] = "單價";
$lang["reports_sub_total_value"] = "小計";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";

View File

@@ -47,6 +47,7 @@ $lang["sales_invoice"] = "Invoice";
$lang["sales_invoice_confirm"] = "This invoice will be sent to";
$lang["sales_invoice_enable"] = "Create Invoice";
$lang["sales_invoice_filter"] = "Invoices";
$lang["sales_cash_filter"] = "Cash";
$lang["sales_invoice_no_email"] = "This customer does not have a valid email address";
$lang["sales_invoice_number"] = "Invoice #";
$lang["sales_invoice_number_duplicate"] = "Please enter an unique invoice number";
@@ -67,7 +68,7 @@ $lang["sales_no_filter"] = "All";
$lang["sales_no_items_in_cart"] = "購物車中沒有任何產品";
$lang["sales_no_sales_to_display"] = "No sales to display";
$lang["sales_one_or_multiple"] = "";
$lang["sales_overview"] = "Overview";
$lang["sales_takings"] = "Takings";
$lang["sales_payment"] = "付款方式";
$lang["sales_payment_amount"] = "Amount";
$lang["sales_payment_not_cover_total"] = "付款金額不足";
@@ -111,3 +112,5 @@ $lang["sales_unsuccessfully_updated"] = "銷售資料更新失敗";
$lang["sales_unsuspend"] = "取消暫停銷售";
$lang["sales_unsuspend_and_delete"] = "取消暫停銷售並刪除";
$lang["sales_update"] = "Edit Sale";
$lang["sales_date_range"] = "日期範圍";
$lang["sales_none_selected"] = "您還沒有選擇任何產品進行編輯";

View File

@@ -5,6 +5,7 @@ $lang["suppliers_basic_information"] = "供應商資料";
$lang["suppliers_cannot_be_deleted"] = "無法刪除所選擇的供應商,選定的供應商中至少有一家已有銷售紀錄。";
$lang["suppliers_company_name"] = "公司名稱";
$lang["suppliers_company_name_required"] = "公司名稱是必填欄位";
$lang["suppliers_agency_name"] = " ";
$lang["suppliers_confirm_delete"] = "你確定要刪除選定的供應商嗎?";
$lang["suppliers_error_adding_updating"] = "新增/更新供應商錯誤";
$lang["suppliers_new"] = "新增供應商";
@@ -14,4 +15,5 @@ $lang["suppliers_successful_adding"] = "您已成功新增供應商";
$lang["suppliers_successful_deleted"] = "您已成功刪除供應商";
$lang["suppliers_successful_updating"] = "您已成功更新供應商";
$lang["suppliers_supplier"] = "供應商";
$lang["suppliers_supplier_id"] = "Id";
$lang["suppliers_update"] = "更新供應商";

View File

@@ -4,129 +4,229 @@ use emberlabs\Barcode\BarcodeBase;
require APPPATH.'/views/barcodes/BarcodeBase.php';
require APPPATH.'/views/barcodes/Code39.php';
require APPPATH.'/views/barcodes/Code128.php';
require APPPATH.'/views/barcodes/Ean13.php';
require APPPATH.'/views/barcodes/Ean8.php';
class Barcode_lib
{
var $CI;
var $supported_barcodes = array(1 => 'Code 39', 2 => 'Code 128');
function __construct()
{
$this->CI =& get_instance();
}
function get_list_barcodes()
{
return $this->supported_barcodes;
}
function get_barcode_config()
{
$data['barcode_type'] = $this->CI->Appconfig->get('barcode_type');
$data['barcode_font'] = $this->CI->Appconfig->get('barcode_font');
$data['barcode_font_size'] = $this->CI->Appconfig->get('barcode_font_size');
$data['barcode_height'] = $this->CI->Appconfig->get('barcode_height');
$data['barcode_width'] = $this->CI->Appconfig->get('barcode_width');
$data['barcode_quality'] = $this->CI->Appconfig->get('barcode_quality');
$data['barcode_first_row'] = $this->CI->Appconfig->get('barcode_first_row');
$data['barcode_second_row'] = $this->CI->Appconfig->get('barcode_second_row');
$data['barcode_third_row'] = $this->CI->Appconfig->get('barcode_third_row');
$data['barcode_num_in_row'] = $this->CI->Appconfig->get('barcode_num_in_row');
$data['barcode_page_width'] = $this->CI->Appconfig->get('barcode_page_width');
$data['barcode_page_cellspacing'] = $this->CI->Appconfig->get('barcode_page_cellspacing');
return $data;
}
function generate_barcode($barcode_content, $barcode_config)
{
try
{
if ($barcode_config['barcode_type'] == '1')
{
$barcode = new emberlabs\Barcode\Code39();
}
else
{
$barcode = new emberlabs\Barcode\Code128();
}
$barcode->setData($barcode_content);
$barcode->setQuality($barcode_config['barcode_quality']);
$barcode->setDimensions($barcode_config['barcode_width'], $barcode_config['barcode_height']);
$barcode->draw();
return $barcode->base64();
return "";
}
catch(Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
function create_display_barcode($item, $barcode_config)
{
$display_table = "<table>";
$display_table .= "<tr><td align='center'>". $this->manage_display_layout($barcode_config['barcode_first_row'], $item, $barcode_config)."</td></tr>";
$barcode_content=$this->CI->Appconfig->get('barcode_content') === "id" ? $item['item_id'] : $item['item_number'];
$barcode = $this->generate_barcode($barcode_content,$barcode_config);
$display_table .= "<tr><td align='center'><img src='data:image/png;base64,$barcode' /></td></tr>";
$display_table .= "<tr><td align='center'>". $this->manage_display_layout($barcode_config['barcode_second_row'], $item, $barcode_config)."</td></tr>";
$display_table .= "<tr><td align='center'>". $this->manage_display_layout($barcode_config['barcode_third_row'], $item, $barcode_config)."</td></tr>";
$display_table .= "</table>";
return $display_table;
}
private function manage_display_layout($layout_type, $item, $barcode_config)
{
$result = '';
if($layout_type == 'name')
{
$result = $this->CI->lang->line('items_name') . " " . $item['name'];
}
else if($layout_type == 'category' && isset($item['category']))
{
$result = $this->CI->lang->line('items_category') . " " . $item['category'];
}
else if($layout_type == 'cost_price' && isset($item['cost_price']))
{
$result = $this->CI->lang->line('items_cost_price') . " " . to_currency($item['cost_price']);
}
else if($layout_type == 'unit_price' && isset($item['unit_price']))
{
$result = $this->CI->lang->line('items_unit_price') . " " . to_currency($item['unit_price']);
}
else if($layout_type == 'company_name')
{
$result = $this->CI->Appconfig->get('company');
}
else if($layout_type == 'item_code')
{
$result = $this->CI->Appconfig->get('barcode_content') !== "id" && isset($item['item_number']) ? $item['item_number'] : $item['item_id'];
}
return $result;
}
function listfonts($folder)
{
$array = array();
if (($handle = opendir($folder)) !== false) {
while (($file = readdir($handle)) !== false) {
if(substr($file, -4, 4) === '.ttf') {
$array[$file] = $file;
}
}
}
closedir($handle);
array_unshift($array, 'No Label');
return $array;
}
private $CI = null;
private $supported_barcodes = array('Code39' => 'Code 39', 'Code128' => 'Code 128', 'Ean8' => 'EAN 8', 'Ean13' => 'EAN 13');
function __construct()
{
$this->CI =& get_instance();
}
public function get_list_barcodes()
{
return $this->supported_barcodes;
}
public function get_barcode_config()
{
$data['company'] = $this->CI->Appconfig->get('company');
$data['barcode_content'] = $this->CI->Appconfig->get('barcode_content');
$data['barcode_type'] = $this->CI->Appconfig->get('barcode_type');
$data['barcode_font'] = $this->CI->Appconfig->get('barcode_font');
$data['barcode_font_size'] = $this->CI->Appconfig->get('barcode_font_size');
$data['barcode_height'] = $this->CI->Appconfig->get('barcode_height');
$data['barcode_width'] = $this->CI->Appconfig->get('barcode_width');
$data['barcode_quality'] = $this->CI->Appconfig->get('barcode_quality');
$data['barcode_first_row'] = $this->CI->Appconfig->get('barcode_first_row');
$data['barcode_second_row'] = $this->CI->Appconfig->get('barcode_second_row');
$data['barcode_third_row'] = $this->CI->Appconfig->get('barcode_third_row');
$data['barcode_num_in_row'] = $this->CI->Appconfig->get('barcode_num_in_row');
$data['barcode_page_width'] = $this->CI->Appconfig->get('barcode_page_width');
$data['barcode_page_cellspacing'] = $this->CI->Appconfig->get('barcode_page_cellspacing');
$data['barcode_generate_if_empty'] = $this->CI->Appconfig->get('barcode_generate_if_empty');
return $data;
}
function get_font_name($font_file_name)
{
return substr($font_file_name, 0, -4);
}
public function validate_barcode($barcode)
{
$barcode_type = $this->CI->Appconfig->get('barcode_type');
$barcode_instance = $this->get_barcode_instance($barcode_type);
return $barcode_instance->validate($barcode);
}
public static function barcode_instance($item, $barcode_config)
{
$barcode_instance = Barcode_lib::get_barcode_instance($barcode_config['barcode_type']);
$is_valid = empty($item['item_number']) && $barcode_config['barcode_generate_if_empty'] || $barcode_instance->validate($item['item_number']);
// if barcode validation does not succeed,
if (!$is_valid)
{
$barcode_instance = Barcode_lib::get_barcode_instance();
}
$seed = Barcode_lib::barcode_seed($item, $barcode_instance, $barcode_config);
$barcode_instance->setData($seed);
return $barcode_instance;
}
private static function get_barcode_instance($barcode_type='Code128')
{
switch($barcode_type)
{
case 'Code39':
return new emberlabs\Barcode\Code39();
break;
case 'Code128':
default:
return new emberlabs\Barcode\Code128();
break;
case 'Ean8':
return new emberlabs\Barcode\Ean8();
break;
case 'Ean13':
return new emberlabs\Barcode\Ean13();
break;
}
}
private static function barcode_seed($item, $barcode_instance, $barcode_config)
{
$seed = $barcode_config['barcode_content'] !== "id" && isset($item['item_number']) ? $item['item_number'] : $item['item_id'];
if( $barcode_config['barcode_content'] !== "id" && !empty($item['item_number']))
{
$seed = $item['item_number'];
}
else
{
if ($barcode_config['barcode_generate_if_empty'])
{
// generate barcode with the correct instance
$seed = $barcode_instance->generate($seed);
}
else
{
$seed = $item['item_id'];
}
}
return $seed;
}
private function generate_barcode($item, $barcode_config)
{
try
{
$barcode_instance = Barcode_lib::barcode_instance($item, $barcode_config);
$barcode_instance->setQuality($barcode_config['barcode_quality']);
$barcode_instance->setDimensions($barcode_config['barcode_width'], $barcode_config['barcode_height']);
$barcode_instance->draw();
return $barcode_instance->base64();
}
catch(Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
public function generate_receipt_barcode($barcode_content)
{
try
{
// Code128 is the default and used in this case for the receipts
$barcode = $this->get_barcode_instance();
// set the receipt number to generate the barcode for
$barcode->setData($barcode_content);
// image quality 100
$barcode->setQuality(100);
// width: 200, height: 30
$barcode->setDimensions(200, 30);
// draw the image
$barcode->draw();
return $barcode->base64();
}
catch(Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}
public function display_barcode($item, $barcode_config)
{
$display_table = "<table>";
$display_table .= "<tr><td align='center'>" . $this->manage_display_layout($barcode_config['barcode_first_row'], $item, $barcode_config) . "</td></tr>";
$barcode = $this->generate_barcode($item, $barcode_config);
$display_table .= "<tr><td align='center'><img src='data:image/png;base64,$barcode' /></td></tr>";
$display_table .= "<tr><td align='center'>" . $this->manage_display_layout($barcode_config['barcode_second_row'], $item, $barcode_config) . "</td></tr>";
$display_table .= "<tr><td align='center'>" . $this->manage_display_layout($barcode_config['barcode_third_row'], $item, $barcode_config) . "</td></tr>";
$display_table .= "</table>";
return $display_table;
}
private function manage_display_layout($layout_type, $item, $barcode_config)
{
$result = '';
if($layout_type == 'name')
{
$result = $this->CI->lang->line('items_name') . " " . $item['name'];
}
else if($layout_type == 'category' && isset($item['category']))
{
$result = $this->CI->lang->line('items_category') . " " . $item['category'];
}
else if($layout_type == 'cost_price' && isset($item['cost_price']))
{
$result = $this->CI->lang->line('items_cost_price') . " " . to_currency($item['cost_price']);
}
else if($layout_type == 'unit_price' && isset($item['unit_price']))
{
$result = $this->CI->lang->line('items_unit_price') . " " . to_currency($item['unit_price']);
}
else if($layout_type == 'company_name')
{
$result = $barcode_config['company'];
}
else if($layout_type == 'item_code')
{
$result = $barcode_config['barcode_content'] !== "id" && isset($item['item_number']) ? $item['item_number'] : $item['item_id'];
}
return $result;
}
public function listfonts($folder)
{
$array = array();
if (($handle = opendir($folder)) !== false)
{
while (($file = readdir($handle)) !== false)
{
if(substr($file, -4, 4) === '.ttf')
{
$array[$file] = $file;
}
}
}
closedir($handle);
array_unshift($array, 'No Label');
return $array;
}
public function get_font_name($font_file_name)
{
return substr($font_file_name, 0, -4);
}
}
?>

View File

@@ -13,7 +13,7 @@ class Item_lib
{
if(!$this->CI->session->userdata('item_location'))
{
$location_id = $this->CI->Stock_locations->get_default_location_id();
$location_id = $this->CI->Stock_location->get_default_location_id();
$this->set_item_location($location_id);
}
return $this->CI->session->userdata('item_location');

View File

@@ -2,57 +2,57 @@
class Receiving_lib
{
var $CI;
var $CI;
function __construct()
{
$this->CI =& get_instance();
}
function __construct()
{
$this->CI =& get_instance();
}
function get_cart()
{
if(!$this->CI->session->userdata('cartRecv'))
$this->set_cart(array());
function get_cart()
{
if(!$this->CI->session->userdata('cartRecv'))
$this->set_cart(array());
return $this->CI->session->userdata('cartRecv');
}
return $this->CI->session->userdata('cartRecv');
}
function set_cart($cart_data)
{
$this->CI->session->set_userdata('cartRecv',$cart_data);
}
function set_cart($cart_data)
{
$this->CI->session->set_userdata('cartRecv',$cart_data);
}
function get_supplier()
{
if(!$this->CI->session->userdata('supplier'))
$this->set_supplier(-1);
function get_supplier()
{
if(!$this->CI->session->userdata('supplier'))
$this->set_supplier(-1);
return $this->CI->session->userdata('supplier');
}
return $this->CI->session->userdata('supplier');
}
function set_supplier($supplier_id)
{
$this->CI->session->set_userdata('supplier',$supplier_id);
}
function set_supplier($supplier_id)
{
$this->CI->session->set_userdata('supplier',$supplier_id);
}
function get_mode()
{
if(!$this->CI->session->userdata('recv_mode'))
$this->set_mode('receive');
function get_mode()
{
if(!$this->CI->session->userdata('recv_mode'))
$this->set_mode('receive');
return $this->CI->session->userdata('recv_mode');
}
return $this->CI->session->userdata('recv_mode');
}
function set_mode($mode)
{
$this->CI->session->set_userdata('recv_mode',$mode);
}
function set_mode($mode)
{
$this->CI->session->set_userdata('recv_mode',$mode);
}
function get_stock_source()
{
if(!$this->CI->session->userdata('recv_stock_source'))
{
$location_id = $this->CI->Stock_locations->get_default_location_id();
$location_id = $this->CI->Stock_location->get_default_location_id();
$this->set_stock_source($location_id);
}
return $this->CI->session->userdata('recv_stock_source');
@@ -60,54 +60,60 @@ class Receiving_lib
function get_comment()
{
return $this->CI->session->userdata('comment');
// avoid returning a null that results in a 0 in the comment if nothing is set/available
$comment = $this->CI->session->userdata('comment');
return empty($comment) ? '' : $comment;
}
function set_comment($comment)
{
$this->CI->session->set_userdata('comment', $comment);
$this->CI->session->set_userdata('comment', $comment);
}
function clear_comment()
{
$this->CI->session->unset_userdata('comment');
$this->CI->session->unset_userdata('comment');
}
function get_invoice_number()
function get_invoice_number()
{
return $this->CI->session->userdata('recv_invoice_number');
return $this->CI->session->userdata('recv_invoice_number');
}
function set_invoice_number($invoice_number)
function set_invoice_number($invoice_number, $keep_custom = FALSE)
{
$this->CI->session->set_userdata('recv_invoice_number', $invoice_number);
$current_invoice_number = $this->CI->session->userdata('recv_invoice_number');
if (!$keep_custom || empty($current_invoice_number))
{
$this->CI->session->set_userdata('recv_invoice_number', $invoice_number);
}
}
function clear_invoice_number()
{
$this->CI->session->unset_userdata('recv_invoice_number');
$this->CI->session->unset_userdata('recv_invoice_number');
}
function is_invoice_number_enabled()
{
return $this->CI->session->userdata('recv_invoice_number_enabled') == 'true' ||
$this->CI->session->userdata('recv_invoice_number_enabled') == '1';
return $this->CI->session->userdata('recv_invoice_number_enabled') == 'true' ||
$this->CI->session->userdata('recv_invoice_number_enabled') == '1';
}
function set_invoice_number_enabled($invoice_number_enabled)
{
return $this->CI->session->set_userdata('recv_invoice_number_enabled', $invoice_number_enabled);
return $this->CI->session->set_userdata('recv_invoice_number_enabled', $invoice_number_enabled);
}
function is_print_after_sale()
{
return $this->CI->session->userdata('recv_print_after_sale') == 'true' ||
$this->CI->session->userdata('recv_print_after_sale') == '1';
return $this->CI->session->userdata('recv_print_after_sale') == 'true' ||
$this->CI->session->userdata('recv_print_after_sale') == '1';
}
function set_print_after_sale($print_after_sale)
{
return $this->CI->session->set_userdata('recv_print_after_sale', $print_after_sale);
return $this->CI->session->set_userdata('recv_print_after_sale', $print_after_sale);
}
function set_stock_source($stock_source)
@@ -117,15 +123,15 @@ class Receiving_lib
function clear_stock_source()
{
$this->CI->session->unset_userdata('recv_stock_source');
$this->CI->session->unset_userdata('recv_stock_source');
}
function get_stock_destination()
{
if(!$this->CI->session->userdata('recv_stock_destination'))
{
$location_id = $this->CI->Stock_locations->get_default_location_id();
$this->set_stock_destination($location_id);
$location_id = $this->CI->Stock_location->get_default_location_id();
$this->set_stock_destination($location_id);
}
return $this->CI->session->userdata('recv_stock_destination');
}
@@ -137,23 +143,23 @@ class Receiving_lib
function clear_stock_destination()
{
$this->CI->session->unset_userdata('recv_stock_destination');
$this->CI->session->unset_userdata('recv_stock_destination');
}
function add_item($item_id,$quantity=1,$item_location=null,$discount=0,$price=null,$description=null,$serialnumber=null,$receiving_quantity=null)
{
//make sure item exists in database.
if(!$this->CI->Item->exists($item_id))
{
//try to get item id given an item_number
$item_id = $this->CI->Item->get_item_id($item_id);
function add_item($item_id,$quantity=1,$item_location=null,$discount=0,$price=null,$description=null,$serialnumber=null,$receiving_quantity=null)
{
//make sure item exists in database.
if(!$this->CI->Item->exists($item_id))
{
//try to get item id given an item_number
$item_id = $this->CI->Item->get_item_id($item_id);
if(!$item_id)
return false;
}
if(!$item_id)
return false;
}
//Get items in the receiving so far.
$items = $this->get_cart();
//Get items in the receiving so far.
$items = $this->get_cart();
//We need to loop through all items in the cart.
//If the item is already there, get it's key($updatekey).
@@ -162,215 +168,215 @@ class Receiving_lib
$maxkey=0; //Highest key so far
$itemalreadyinsale=FALSE; //We did not find the item yet.
$insertkey=0; //Key to use for new entry.
$updatekey=0; //Key to use to update(quantity)
$insertkey=0; //Key to use for new entry.
$updatekey=0; //Key to use to update(quantity)
foreach ($items as $item)
{
foreach ($items as $item)
{
//We primed the loop so maxkey is 0 the first time.
//Also, we have stored the key in the element itself so we can compare.
//There is an array function to get the associated key for an element, but I like it better
//like that!
if($maxkey <= $item['line'])
{
$maxkey = $item['line'];
}
if($maxkey <= $item['line'])
{
$maxkey = $item['line'];
}
if($item['item_id']==$item_id && $item['item_location']==$item_location)
{
$itemalreadyinsale=TRUE;
$updatekey=$item['line'];
}
}
if($item['item_id']==$item_id && $item['item_location']==$item_location)
{
$itemalreadyinsale=TRUE;
$updatekey=$item['line'];
}
}
$insertkey=$maxkey+1;
$item_info=$this->CI->Item->get_info($item_id,$item_location);
//array records are identified by $insertkey and item_id is just another field.
$price=$price!=null ? $price: $item_info->cost_price;
$item = array(($insertkey)=>
array(
'item_id'=>$item_id,
'item_location'=>$item_location,
'stock_name'=>$this->CI->Stock_locations->get_location_name($item_location),
'line'=>$insertkey,
'name'=>$item_info->name,
'description'=>$description!=null ? $description: $item_info->description,
'serialnumber'=>$serialnumber!=null ? $serialnumber: '',
'allow_alt_description'=>$item_info->allow_alt_description,
'is_serialized'=>$item_info->is_serialized,
'quantity'=>$quantity,
$insertkey=$maxkey+1;
$item_info=$this->CI->Item->get_info($item_id,$item_location);
//array records are identified by $insertkey and item_id is just another field.
$price=$price!=null ? $price: $item_info->cost_price;
$item = array(($insertkey)=>
array(
'item_id'=>$item_id,
'item_location'=>$item_location,
'stock_name'=>$this->CI->Stock_location->get_location_name($item_location),
'line'=>$insertkey,
'name'=>base64_encode($item_info->name),
'description'=>base64_encode($description!=null ? $description: $item_info->description),
'serialnumber'=>$serialnumber!=null ? $serialnumber: '',
'allow_alt_description'=>$item_info->allow_alt_description,
'is_serialized'=>$item_info->is_serialized,
'quantity'=>$quantity,
'discount'=>$discount,
'in_stock'=>$this->CI->Item_quantities->get_item_quantity($item_id, $item_location)->quantity,
'price'=>$price,
'receiving_quantity'=>$receiving_quantity!=null ? $receiving_quantity : $item_info->receiving_quantity,
'total'=>$this->get_item_total($quantity, $price, $discount)
)
);
'in_stock'=>$this->CI->Item_quantity->get_item_quantity($item_id, $item_location)->quantity,
'price'=>$price,
'receiving_quantity'=>$receiving_quantity!=null ? $receiving_quantity : $item_info->receiving_quantity,
'total'=>$this->get_item_total($quantity, $price, $discount)
)
);
//Item already exists
if($itemalreadyinsale)
{
$items[$updatekey]['quantity']+=$quantity;
}
else
{
//add to existing array
$items+=$item;
}
//Item already exists
if($itemalreadyinsale)
{
$items[$updatekey]['quantity']+=$quantity;
}
else
{
//add to existing array
$items+=$item;
}
$this->set_cart($items);
return true;
$this->set_cart($items);
return true;
}
}
function edit_item($line,$description,$serialnumber,$quantity,$discount,$price)
{
$items = $this->get_cart();
if(isset($items[$line]))
{
$line = &$items[$line];
$line['description'] = $description;
$line['serialnumber'] = $serialnumber;
$line['quantity'] = $quantity;
$line['discount'] = $discount;
$line['price'] = $price;
$line['total'] = $this->get_item_total($quantity, $price, $discount);
$this->set_cart($items);
}
function edit_item($line,$description,$serialnumber,$quantity,$discount,$price)
{
$items = $this->get_cart();
if(isset($items[$line]))
{
$line = &$items[$line];
$line['description'] = base64_encode($description);
$line['serialnumber'] = $serialnumber;
$line['quantity'] = $quantity;
$line['discount'] = $discount;
$line['price'] = $price;
$line['total'] = $this->get_item_total($quantity, $price, $discount);
$this->set_cart($items);
}
return false;
}
return false;
}
function is_valid_receipt($receipt_receiving_id)
{
//RECV #
$pieces = explode(' ',$receipt_receiving_id);
function is_valid_receipt($receipt_receiving_id)
{
//RECV #
$pieces = explode(' ',$receipt_receiving_id);
if(count($pieces)==2)
{
return $this->CI->Receiving->exists($pieces[1]);
}
else
{
return $this->CI->Receiving->get_receiving_by_invoice_number($receipt_receiving_id)->num_rows() > 0;
}
if(count($pieces)==2)
{
return $this->CI->Receiving->exists($pieces[1]);
}
else
{
return $this->CI->Receiving->get_receiving_by_invoice_number($receipt_receiving_id)->num_rows() > 0;
}
return false;
}
function is_valid_item_kit($item_kit_id)
{
//KIT #
$pieces = explode(' ',$item_kit_id);
return false;
}
function is_valid_item_kit($item_kit_id)
{
//KIT #
$pieces = explode(' ',$item_kit_id);
if(count($pieces)==2)
{
return $this->CI->Item_kit->exists($pieces[1]);
}
if(count($pieces)==2)
{
return $this->CI->Item_kit->exists($pieces[1]);
}
return false;
}
return false;
}
function return_entire_receiving($receipt_receiving_id)
{
//POS #
$pieces = explode(' ',$receipt_receiving_id);
if ($pieces[0] == "RECV")
{
$receiving_id = $pieces[1];
}
else
{
$receiving = $this->CI->Receiving->get_receiving_by_invoice_number($receipt_receiving_id)->row();
$receiving_id = $receiving->receiving_id;
}
function return_entire_receiving($receipt_receiving_id)
{
//POS #
$pieces = explode(' ',$receipt_receiving_id);
if ($pieces[0] == "RECV")
{
$receiving_id = $pieces[1];
}
else
{
$receiving = $this->CI->Receiving->get_receiving_by_invoice_number($receipt_receiving_id)->row();
$receiving_id = $receiving->receiving_id;
}
$this->empty_cart();
$this->delete_supplier();
$this->clear_comment();
$this->empty_cart();
$this->delete_supplier();
$this->clear_comment();
foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)
{
$this->add_item($row->item_id,-$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber,$row->receiving_quantity);
}
$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);
}
function add_item_kit($external_item_kit_id,$item_location)
{
//KIT #
$pieces = explode(' ',$external_item_kit_id);
$item_kit_id = $pieces[1];
foreach ($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item)
{
$this->add_item($item_kit_item['item_id'],$item_kit_item['quantity'],$item_location);
}
}
foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)
{
$this->add_item($row->item_id,-$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber,$row->receiving_quantity);
}
$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);
}
function add_item_kit($external_item_kit_id,$item_location)
{
//KIT #
$pieces = explode(' ',$external_item_kit_id);
$item_kit_id = $pieces[1];
foreach ($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item)
{
$this->add_item($item_kit_item['item_id'],$item_kit_item['quantity'],$item_location);
}
}
function copy_entire_receiving($receiving_id)
{
$this->empty_cart();
$this->delete_supplier();
function copy_entire_receiving($receiving_id)
{
$this->empty_cart();
$this->delete_supplier();
foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)
{
$this->add_item($row->item_id,$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber,$row->receiving_quantity);
}
$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);
$receiving_info=$this->CI->Receiving->get_info($receiving_id);
//$this->set_invoice_number($receiving_info->row()->invoice_number);
}
function delete_item($line)
{
$items=$this->get_cart();
unset($items[$line]);
$this->set_cart($items);
}
foreach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)
{
$this->add_item($row->item_id,$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber,$row->receiving_quantity);
}
$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);
$receiving_info=$this->CI->Receiving->get_info($receiving_id);
//$this->set_invoice_number($receiving_info->row()->invoice_number);
}
function delete_item($line)
{
$items=$this->get_cart();
unset($items[$line]);
$this->set_cart($items);
}
function empty_cart()
{
$this->CI->session->unset_userdata('cartRecv');
}
function empty_cart()
{
$this->CI->session->unset_userdata('cartRecv');
}
function delete_supplier()
{
$this->CI->session->unset_userdata('supplier');
}
function delete_supplier()
{
$this->CI->session->unset_userdata('supplier');
}
function clear_mode()
{
$this->CI->session->unset_userdata('receiving_mode');
}
{
$this->CI->session->unset_userdata('receiving_mode');
}
function clear_all()
{
$this->clear_mode();
$this->empty_cart();
$this->delete_supplier();
$this->clear_comment();
$this->clear_invoice_number();
}
function get_item_total($quantity, $price, $discount_percentage)
{
$total = bcmul($quantity, $price, PRECISION);
$discount_fraction = bcdiv($discount_percentage, 100, PRECISION);
$discount_amount = bcmul($total, $discount_fraction, PRECISION);
return bcsub($total, $discount_amount, PRECISION);
}
function clear_all()
{
$this->clear_mode();
$this->empty_cart();
$this->delete_supplier();
$this->clear_comment();
$this->clear_invoice_number();
}
function get_item_total($quantity, $price, $discount_percentage)
{
$total = bcmul($quantity, $price, PRECISION);
$discount_fraction = bcdiv($discount_percentage, 100, PRECISION);
$discount_amount = bcmul($total, $discount_fraction, PRECISION);
return bcsub($total, $discount_amount, PRECISION);
}
function get_total()
{
$total = 0;
foreach($this->get_cart() as $item)
{
$total = bcadd($total, $this->get_item_total($item['quantity'], $item['price'], $item['discount']), PRECISION);
}
return $total;
}
function get_total()
{
$total = 0;
foreach($this->get_cart() as $item)
{
$total = bcadd($total, $this->get_item_total($item['quantity'], $item['price'], $item['discount']), PRECISION);
}
return $total;
}
}
?>

View File

@@ -22,7 +22,7 @@ class Sale_lib
$this->CI->session->set_userdata('cart',$cart_data);
}
//Alain Multiple Payments
// Multiple Payments
function get_payments()
{
if( !$this->CI->session->userdata( 'payments' ) )
@@ -31,7 +31,7 @@ class Sale_lib
return $this->CI->session->userdata('payments');
}
//Alain Multiple Payments
// Multiple Payments
function set_payments($payments_data)
{
$this->CI->session->set_userdata('payments',$payments_data);
@@ -39,7 +39,9 @@ class Sale_lib
function get_comment()
{
return $this->CI->session->userdata('comment');
// avoid returning a null that results in a 0 in the comment if nothing is set/available
$comment = $this->CI->session->userdata('comment');
return empty($comment) ? '' : $comment;
}
function set_comment($comment)
@@ -57,9 +59,14 @@ class Sale_lib
return $this->CI->session->userdata('sales_invoice_number');
}
function set_invoice_number($invoice_number)
function set_invoice_number($invoice_number, $keep_custom = FALSE)
{
$this->CI->session->set_userdata('sales_invoice_number', $invoice_number);
$current_invoice_number = $this->CI->session->userdata('sales_invoice_number');
if (!$keep_custom || empty($current_invoice_number))
{
$this->CI->session->set_userdata('sales_invoice_number', $invoice_number);
}
}
function clear_invoice_number()
@@ -130,7 +137,7 @@ class Sale_lib
}
//Alain Multiple Payments
// Multiple Payments
function edit_payment($payment_id,$payment_amount)
{
$payments = $this->get_payments();
@@ -144,7 +151,7 @@ class Sale_lib
return false;
}
//Alain Multiple Payments
// Multiple Payments
function delete_payment( $payment_id )
{
$payments = $this->get_payments();
@@ -152,13 +159,13 @@ class Sale_lib
$this->set_payments( $payments );
}
//Alain Multiple Payments
// Multiple Payments
function empty_payments()
{
$this->CI->session->unset_userdata('payments');
}
//Alain Multiple Payments
// Multiple Payments
function get_payments_total()
{
$subtotal = 0;
@@ -169,7 +176,7 @@ class Sale_lib
return to_currency_no_money($subtotal);
}
//Alain Multiple Payments
// Multiple Payments
function get_amount_due()
{
$amount_due=0;
@@ -209,7 +216,7 @@ class Sale_lib
{
if(!$this->CI->session->userdata('sale_location'))
{
$location_id = $this->CI->Stock_locations->get_default_location_id();
$location_id = $this->CI->Stock_location->get_default_location_id();
$this->set_sale_location($location_id);
}
return $this->CI->session->userdata('sale_location');
@@ -248,7 +255,7 @@ class Sale_lib
return false;
}
//Alain Serialization and Description
// Serialization and Description
//Get all items in the cart so far...
$items = $this->get_cart();
@@ -262,7 +269,7 @@ class Sale_lib
$itemalreadyinsale=FALSE; //We did not find the item yet.
$insertkey=0; //Key to use for new entry.
$updatekey=0; //Key to use to update(quantity)
$item_info=$this->CI->Item->get_info($item_id,$item_location);
foreach ($items as $item)
{
//We primed the loop so maxkey is 0 the first time.
@@ -276,46 +283,52 @@ class Sale_lib
if($item['item_id']==$item_id && $item['item_location']==$item_location)
{
$itemalreadyinsale=TRUE;
$updatekey=$item['line'];
$updatekey = $item['line'];
if (!$item_info->is_serialized)
{
$quantity += $items[$updatekey]['quantity'];
}
}
}
$insertkey=$maxkey+1;
$item_info=$this->CI->Item->get_info($item_id,$item_location);
//array/cart records are identified by $insertkey and item_id is just another field.
$price=$price!=null?$price:$item_info->unit_price;
$total=$this->get_item_total($quantity, $price, $discount);
$item = array(($insertkey)=>
array(
'item_id'=>$item_id,
'item_location'=>$item_location,
'stock_name'=>$this->CI->Stock_locations->get_location_name($item_location),
'line'=>$insertkey,
'name'=>$item_info->name,
'item_number'=>$item_info->item_number,
'description'=>$description!=null ? $description: $item_info->description,
'serialnumber'=>$serialnumber!=null ? $serialnumber: '',
'allow_alt_description'=>$item_info->allow_alt_description,
'is_serialized'=>$item_info->is_serialized,
'quantity'=>$quantity,
'discount'=>$discount,
'in_stock'=>$this->CI->Item_quantities->get_item_quantity($item_id, $item_location)->quantity,
'price'=>$price,
'total'=>$total,
'discounted_total'=>$this->get_item_total($quantity, $price, $discount, TRUE)
)
);
$discounted_total=$this->get_item_total($quantity, $price, $discount, TRUE);
//Item already exists and is not serialized, add to quantity
if($itemalreadyinsale && ($item_info->is_serialized ==0) )
{
$items[$updatekey]['quantity']+=$quantity;
}
else
if(!$itemalreadyinsale || $item_info->is_serialized)
{
$item = array(($insertkey)=>
array(
'item_id'=>$item_id,
'item_location'=>$item_location,
'stock_name'=>$this->CI->Stock_location->get_location_name($item_location),
'line'=>$insertkey,
'name'=>base64_encode($item_info->name),
'item_number'=>$item_info->item_number,
'description'=>base64_encode($description!=null ? $description: $item_info->description),
'serialnumber'=>$serialnumber!=null ? $serialnumber: '',
'allow_alt_description'=>$item_info->allow_alt_description,
'is_serialized'=>$item_info->is_serialized,
'quantity'=>$quantity,
'discount'=>$discount,
'in_stock'=>$this->CI->Item_quantity->get_item_quantity($item_id, $item_location)->quantity,
'price'=>$price,
'total'=>$total,
'discounted_total'=>$discounted_total,
)
);
//add to existing array
$items+=$item;
}
else
{
$line = &$items[$updatekey];
$line['quantity'] = $quantity;
$line['total'] = $total;
$line['discounted_total'] = $discounted_total;
}
$this->set_cart($items);
return true;
@@ -332,10 +345,10 @@ class Sale_lib
//$item = $this->CI->Item->get_info($item_id);
$item_quantity = $this->CI->Item_quantities->get_item_quantity($item_id,$item_location)->quantity;
$quanity_added = $this->get_quantity_already_added($item_id,$item_location);
$item_quantity = $this->CI->Item_quantity->get_item_quantity($item_id,$item_location)->quantity;
$quantity_added = $this->get_quantity_already_added($item_id,$item_location);
if ($item_quantity - $quanity_added < 0)
if ($item_quantity - $quantity_added < 0)
{
return true;
}
@@ -379,7 +392,7 @@ class Sale_lib
if(isset($items[$line]))
{
$line = &$items[$line];
$line['description'] = $description;
$line['description'] = base64_encode($description);
$line['serialnumber'] = $serialnumber;
$line['quantity'] = $quantity;
$line['discount'] = $discount;

View File

@@ -4,20 +4,20 @@ class Giftcard extends CI_Model
/*
Determines if a given giftcard_id is an giftcard
*/
function exists( $giftcard_id )
function exists($giftcard_id)
{
$this->db->from('giftcards');
$this->db->where('giftcard_id',$giftcard_id);
$this->db->where('deleted',0);
$query = $this->db->get();
$this->db->where('giftcard_id', $giftcard_id);
$this->db->where('deleted', 0);
return ($query->num_rows()==1);
return ($this->db->get()->num_rows()==1);
}
function get_max_number ( )
function get_max_number()
{
$this->db->select_max('giftcard_number');
$query = $this->db->get('giftcards');
return $query->row();
}
@@ -25,25 +25,30 @@ class Giftcard extends CI_Model
{
return $this->db->count_all('giftcards');
}
/*
Returns all the giftcards
*/
function get_all($rows=0, $limit_from=0)
{
$this->db->from('giftcards');
$this->db->join('people','people.person_id=giftcards.person_id', 'left');//GARRISON ADDED 4/25/2013
$this->db->where('deleted',0);
$this->db->order_by("giftcard_number");
if ($rows > 0) {
$this->db->join('people', 'people.person_id=giftcards.person_id', 'left');
$this->db->where('deleted', 0);
$this->db->order_by('giftcard_number');
if ($rows > 0)
{
$this->db->limit($rows, $limit_from);
}
return $this->db->get();
}
function count_all()
{
$this->db->from('giftcards');
$this->db->where('deleted',0);
$this->db->where('deleted', 0);
return $this->db->count_all_results();
}
@@ -53,9 +58,9 @@ class Giftcard extends CI_Model
function get_info($giftcard_id)
{
$this->db->from('giftcards');
$this->db->join('people', 'people.person_id = giftcards.person_id', 'left');
$this->db->where('giftcard_id',$giftcard_id);
$this->db->where('deleted',0);
$this->db->join('people', 'people.person_id=giftcards.person_id', 'left');
$this->db->where('giftcard_id', $giftcard_id);
$this->db->where('deleted', 0);
$query = $this->db->get();
@@ -66,7 +71,7 @@ class Giftcard extends CI_Model
else
{
//Get empty base parent object, as $giftcard_id is NOT an giftcard
$giftcard_obj=new stdClass();
$giftcard_obj = new stdClass();
//Get all the fields from giftcards table
$fields = $this->db->list_fields('giftcards');
@@ -86,8 +91,8 @@ class Giftcard extends CI_Model
function get_giftcard_id($giftcard_number)
{
$this->db->from('giftcards');
$this->db->where('giftcard_number',$giftcard_number);
$this->db->where('deleted',0);
$this->db->where('giftcard_number', $giftcard_number);
$this->db->where('deleted', 0);
$query = $this->db->get();
@@ -105,38 +110,43 @@ class Giftcard extends CI_Model
function get_multiple_info($giftcard_ids)
{
$this->db->from('giftcards');
$this->db->where_in('giftcard_id',$giftcard_ids);
$this->db->where('deleted',0);
$this->db->order_by("giftcard_number", "asc");
$this->db->where_in('giftcard_id', $giftcard_ids);
$this->db->where('deleted', 0);
$this->db->order_by('giftcard_number', 'asc');
return $this->db->get();
}
/*
Inserts or updates a giftcard
*/
function save(&$giftcard_data,$giftcard_id=false)
function save(&$giftcard_data, $giftcard_id=false)
{
if (!$giftcard_id or !$this->exists($giftcard_id))
{
if($this->db->insert('giftcards',$giftcard_data))
if($this->db->insert('giftcards', $giftcard_data))
{
$giftcard_data['giftcard_id']=$this->db->insert_id();
$giftcard_data['giftcard_id'] = $this->db->insert_id();
return true;
}
return false;
}
$this->db->where('giftcard_id', $giftcard_id);
return $this->db->update('giftcards',$giftcard_data);
}
/*
Updates multiple giftcards at once
*/
function update_multiple($giftcard_data,$giftcard_ids)
function update_multiple($giftcard_data, $giftcard_ids)
{
$this->db->where_in('giftcard_id',$giftcard_ids);
return $this->db->update('giftcards',$giftcard_data);
$this->db->where_in('giftcard_id', $giftcard_ids);
return $this->db->update('giftcards', $giftcard_data);
}
/*
@@ -145,6 +155,7 @@ class Giftcard extends CI_Model
function delete($giftcard_id)
{
$this->db->where('giftcard_id', $giftcard_id);
return $this->db->update('giftcards', array('deleted' => 1));
}
@@ -153,21 +164,22 @@ class Giftcard extends CI_Model
*/
function delete_list($giftcard_ids)
{
$this->db->where_in('giftcard_id',$giftcard_ids);
$this->db->where_in('giftcard_id', $giftcard_ids);
return $this->db->update('giftcards', array('deleted' => 1));
}
/*
Get search suggestions to find giftcards
*/
function get_search_suggestions($search,$limit=25)
function get_search_suggestions($search, $limit=25)
{
$suggestions = array();
$this->db->from('giftcards');
$this->db->like('giftcard_number', $search);
$this->db->where('deleted',0);
$this->db->order_by("giftcard_number", "asc");
$this->db->where('deleted', 0);
$this->db->order_by('giftcard_number', 'asc');
$by_number = $this->db->get();
foreach($by_number->result() as $row)
@@ -175,31 +187,29 @@ class Giftcard extends CI_Model
$suggestions[]=$row->giftcard_number;
}
/** GARRISON MODIFIED 4/24/2013 **/
$this->db->from('customers');
$this->db->join('people','customers.person_id=people.person_id', 'left');
$this->db->like("first_name",$this->db->escape_like_str($search));
$this->db->or_like("last_name",$this->db->escape_like_str($search));
$this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db->escape_like_str($search));
$this->db->where("deleted","0");
$this->db->order_by("last_name", "asc");
$this->db->join('people', 'customers.person_id=people.person_id', 'left');
$this->db->like('first_name', $this->db->escape_like_str($search));
$this->db->or_like('last_name', $this->db->escape_like_str($search));
$this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search));
$this->db->where('deleted', 0);
$this->db->order_by('last_name', 'asc');
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[]=$row->first_name.' '.$row->last_name;
}
/** END GARRISON MODIFIED **/
}
//only return $limit suggestions
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
$suggestions = array_slice($suggestions, 0, $limit);
}
return $suggestions;
}
/** GARRISON ADDED 5/3/2013 **/
/*
Get search suggestions to find customers
*/
@@ -209,12 +219,12 @@ class Giftcard extends CI_Model
$this->db->select('person_id');
$this->db->from('people');
$this->db->like('person_id',$this->db->escape_like_str($search));
$this->db->or_like('first_name',$this->db->escape_like_str($search));
$this->db->or_like('last_name',$this->db->escape_like_str($search));
$this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db->escape_like_str($search));
$this->db->or_like('email',$this->db->escape_like_str($search));
$this->db->or_like('phone_number',$this->db->escape_like_str($search));
$this->db->like('person_id', $this->db->escape_like_str($search));
$this->db->or_like('first_name', $this->db->escape_like_str($search));
$this->db->or_like('last_name', $this->db->escape_like_str($search));
$this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search));
$this->db->or_like('email', $this->db->escape_like_str($search));
$this->db->or_like('phone_number', $this->db->escape_like_str($search));
$this->db->order_by('person_id', 'asc');
$by_person_id = $this->db->get();
@@ -223,55 +233,62 @@ class Giftcard extends CI_Model
$suggestions[]=$row->person_id;
}
//only return $limit suggestions
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
}
}
return $suggestions;
}
/** GARRISON MODIFIED 4/24/2013 **/
/*
Preform a search on giftcards
*/
function search($search, $rows = 0, $limit_from = 0)
{
$this->db->from('giftcards');
$this->db->join('people','giftcards.person_id=people.person_id', 'left');
$this->db->like("first_name",$this->db->escape_like_str($search));
$this->db->or_like("last_name",$this->db->escape_like_str($search));
$this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db->escape_like_str($search));
$this->db->or_like("giftcard_number",$this->db->escape_like_str($search));
$this->db->or_like("giftcards.person_id",$this->db->escape_like_str($search));
$this->db->where('deleted','0');
$this->db->order_by("giftcard_number", "asc");
if ($rows > 0) {
$this->db->join('people', 'giftcards.person_id=people.person_id', 'left');
$this->db->like('first_name', $this->db->escape_like_str($search));
$this->db->or_like('last_name', $this->db->escape_like_str($search));
$this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search));
$this->db->or_like('giftcard_number', $this->db->escape_like_str($search));
$this->db->or_like('giftcards.person_id', $this->db->escape_like_str($search));
$this->db->where('deleted', 0);
$this->db->order_by('giftcard_number', 'asc');
if ($rows > 0)
{
$this->db->limit($rows, $limit_from);
}
}
return $this->db->get();
}
function get_found_rows($search)
{
$this->db->from('giftcards');
$this->db->join('people','giftcards.person_id=people.person_id', 'left');
$this->db->like("first_name",$this->db->escape_like_str($search));
$this->db->or_like("last_name",$this->db->escape_like_str($search));
$this->db->or_like("CONCAT(`first_name`,' ',`last_name`)",$this->db->escape_like_str($search));
$this->db->or_like("giftcard_number",$this->db->escape_like_str($search));
$this->db->or_like("giftcards.person_id",$this->db->escape_like_str($search));
$this->db->join('people', 'giftcards.person_id=people.person_id', 'left');
$this->db->like('first_name', $this->db->escape_like_str($search));
$this->db->or_like('last_name', $this->db->escape_like_str($search));
$this->db->or_like('CONCAT(first_name, " ", last_name)', $this->db->escape_like_str($search));
$this->db->or_like('giftcard_number', $this->db->escape_like_str($search));
$this->db->or_like('giftcards.person_id', $this->db->escape_like_str($search));
$this->db->where('deleted', 0);
return $this->db->get()->num_rows();
}
public function get_giftcard_value( $giftcard_number )
{
if ( !$this->exists( $this->get_giftcard_id($giftcard_number)))
if ( !$this->exists( $this->get_giftcard_id($giftcard_number) ) )
{
return 0;
}
$this->db->from('giftcards');
$this->db->where('giftcard_number',$giftcard_number);
$this->db->where('giftcard_number', $giftcard_number);
return $this->db->get()->row()->value;
}

View File

@@ -4,16 +4,16 @@ class Item extends CI_Model
/*
Determines if a given item_id is an item
*/
function exists($item_id)
public function exists($item_id)
{
$this->db->from('items');
$this->db->where('item_id',$item_id);
$this->db->where('item_id', $item_id);
$query = $this->db->get();
return ($query->num_rows()==1);
return ($query->num_rows() == 1);
}
function item_number_exists($item_number,$item_id='')
public function item_number_exists($item_number, $item_id='')
{
$this->db->from('items');
$this->db->where('item_number', $item_number);
@@ -22,93 +22,144 @@ class Item extends CI_Model
$this->db->where('item_id !=', $item_id);
}
$query=$this->db->get();
return ($query->num_rows()==1);
return ($query->num_rows() == 1);
}
function get_total_rows()
public function get_total_rows()
{
$this->db->from('items');
$this->db->where('deleted',0);
$this->db->where('deleted', 0);
return $this->db->count_all_results();
}
function get_found_rows($search,$stock_location_id=-1,$low_inventory=0,$is_serialized=0,$no_description=0,$search_custom=0,$is_deleted=0)
{
$this->db->from("items");
if ($stock_location_id > -1)
{
$this->db->join('item_quantities','item_quantities.item_id=items.item_id');
$this->db->where('location_id',$stock_location_id);
}
if (!empty($search))
{
if ($search_custom==0)
{
$this->db->where("(name LIKE '%" . $search . "%' OR " .
"item_number LIKE '" . $search . "%' OR " .
$this->db->dbprefix('items').".item_id LIKE '" . $search . "%' OR " .
"category LIKE '%" . $search . "%')");
}
else
{
$this->db->or_like('custom1',$search);
$this->db->or_like('custom2',$search);
$this->db->or_like('custom3',$search);
$this->db->or_like('custom4',$search);
$this->db->or_like('custom5',$search);
$this->db->or_like('custom6',$search);
$this->db->or_like('custom7',$search);
$this->db->or_like('custom8',$search);
$this->db->or_like('custom9',$search);
$this->db->or_like('custom10',$search);
}
}
$this->db->where('items.deleted', $is_deleted);
if ($low_inventory !=0 )
{
$this->db->where('quantity <=', 'reorder_level');
}
if ($is_serialized !=0 )
{
$this->db->where('is_serialized', 1);
}
if ($no_description!=0 )
{
$this->db->where('items.description','');
}
return $this->db->get()->num_rows();
}
/*
Returns all the items
Get number of rows
*/
function get_all($stock_location_id=-1, $rows = 0, $limit_from = 0)
public function get_found_rows($search, $filters)
{
return $this->search($search, $filters)->num_rows();
}
/*
Perform a search on items
*/
public function search($search, $filters, $rows=0, $limit_from=0)
{
$this->db->from('items');
if ($stock_location_id > -1)
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
$this->db->join('inventory', 'inventory.trans_items = items.item_id');
if ($filters['stock_location_id'] > -1)
{
$this->db->join('item_quantities','item_quantities.item_id=items.item_id');
$this->db->where('location_id',$stock_location_id);
$this->db->join('item_quantities', 'item_quantities.item_id = items.item_id');
$this->db->where('location_id', $filters['stock_location_id']);
}
$this->db->where('deleted',0);
$this->db->order_by("name","asc");
if ($rows > 0) {
if (empty($search))
{
$this->db->where('DATE_FORMAT(trans_date, "%Y-%m-%d") BETWEEN ' . $this->db->escape($filters['start_date']) . ' AND ' . $this->db->escape($filters['end_date']));
}
else
{
if ($filters['search_custom'] == FALSE)
{
$this->db->where("(name LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"item_number LIKE '" . $this->db->escape_like_str($search) . "%' OR " .
$this->db->dbprefix('items').".item_id LIKE '" . $this->db->escape_like_str($search) . "%' OR " .
"company_name LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"category LIKE '%" . $this->db->escape_like_str($search) . "%')");
}
else
{
$this->db->where("(custom1 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom2 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom3 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom4 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom5 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom6 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom7 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom8 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom9 LIKE '%" . $this->db->escape_like_str($search) . "%' OR " .
"custom10 LIKE '%" . $this->db->escape_like_str($search) . "%')");
}
}
$this->db->where('items.deleted', $filters['is_deleted']);
if ($filters['empty_upc'] != FALSE)
{
$this->db->where('item_number', null);
}
if ($filters['low_inventory'] != FALSE)
{
$this->db->where('quantity <=', 'reorder_level');
}
if ($filters['is_serialized'] != FALSE)
{
$this->db->where('is_serialized', 1);
}
if ($filters['no_description'] != FALSE)
{
$this->db->where('items.description', '');
}
// avoid duplicate entry with same name because of inventory reporting multiple changes on the same item in the same date range
$this->db->group_by('items.name');
// order by name of item
$this->db->order_by('items.name', 'asc');
if ($rows > 0)
{
$this->db->limit($rows, $limit_from);
}
return $this->db->get();
}
/*
Returns all the items
*/
public function get_all($stock_location_id=-1, $rows=0, $limit_from=0)
{
$this->db->from('items');
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
if ($stock_location_id > -1)
{
$this->db->join('item_quantities', 'item_quantities.item_id=items.item_id');
$this->db->where('location_id', $stock_location_id);
}
$this->db->where('items.deleted', 0);
// order by name of item
$this->db->order_by('items.name', 'asc');
if ($rows > 0)
{
$this->db->limit($rows, $limit_from);
}
return $this->db->get();
}
/*
Gets information about a particular item
*/
function get_info($item_id)
public function get_info($item_id)
{
$this->db->select('items.*');
$this->db->select('suppliers.company_name');
$this->db->from('items');
$this->db->where('item_id',$item_id);
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
$this->db->where('item_id', $item_id);
$query = $this->db->get();
if($query->num_rows()==1)
if($query->num_rows() == 1)
{
return $query->row();
}
@@ -132,11 +183,12 @@ class Item extends CI_Model
/*
Get an item id given an item number
*/
function get_item_id($item_number)
public function get_item_id($item_number)
{
$this->db->from('items');
$this->db->where('item_number',$item_number);
$this->db->where('deleted',0); // Parq 131226
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
$this->db->where('item_number', $item_number);
$this->db->where('items.deleted', 0);
$query = $this->db->get();
@@ -151,18 +203,20 @@ class Item extends CI_Model
/*
Gets information about multiple items
*/
function get_multiple_info($item_ids)
public function get_multiple_info($item_ids)
{
$this->db->from('items');
$this->db->where_in('item_id',$item_ids);
$this->db->join('suppliers', 'suppliers.person_id = items.supplier_id', 'left');
$this->db->where_in('item_id', $item_ids);
$this->db->order_by('item_id', 'asc');
return $this->db->get();
}
/*
Inserts or updates a item
*/
function save(&$item_data,$item_id=false)
public function save(&$item_data, $item_id=false)
{
if (!$item_id or !$this->exists($item_id))
{
@@ -175,192 +229,217 @@ class Item extends CI_Model
}
$this->db->where('item_id', $item_id);
return $this->db->update('items',$item_data);
return $this->db->update('items', $item_data);
}
/*
Updates multiple items at once
*/
function update_multiple($item_data,$item_ids)
public function update_multiple($item_data, $item_ids)
{
$this->db->where_in('item_id',$item_ids);
return $this->db->update('items',$item_data);
}
/*
Deletes one item
*/
function delete($item_id)
public function delete($item_id)
{
$this->db->where('item_id', $item_id);
return $this->db->update('items', array('deleted' => 1));
}
/*
Deletes a list of items
*/
function delete_list($item_ids)
public function delete_list($item_ids)
{
$this->db->where_in('item_id',$item_ids);
return $this->db->update('items', array('deleted' => 1));
}
/*
Get search suggestions to find items
*/
function get_search_suggestions($search,$limit=25)
public function get_search_suggestions($search, $limit=25, $search_custom=0, $is_deleted=0)
{
$suggestions = array();
$this->db->from('items');
$this->db->like('name', $search);
$this->db->where('deleted',0);
$this->db->order_by("name", "asc");
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[]=$row->name;
}
$this->db->select('category');
$this->db->from('items');
$this->db->where('deleted',0);
$this->db->where('deleted', $is_deleted);
$this->db->distinct();
$this->db->like('category', $search);
$this->db->order_by("category", "asc");
$this->db->order_by('category', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->category;
$suggestions[] = $row->category;
}
$this->db->select('company_name');
$this->db->from('suppliers');
$this->db->like('company_name', $search);
// restrict to non deleted companies only if is_deleted if false
if( $is_deleted == 0 )
{
$this->db->where('deleted', $is_deleted);
}
$this->db->distinct();
$this->db->order_by('company_name', 'asc');
$by_company_name = $this->db->get();
foreach($by_company_name->result() as $row)
{
$suggestions[] = $row->company_name;
}
$this->db->select('name');
$this->db->from('items');
$this->db->like('name', $search);
$this->db->where('deleted', $is_deleted);
$this->db->order_by('name', 'asc');
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[] = $row->name;
}
$this->db->select('item_number');
$this->db->from('items');
$this->db->like('item_number', $search);
$this->db->where('deleted',0);
$this->db->order_by("item_number", "asc");
$this->db->where('deleted', $is_deleted);
$this->db->order_by('item_number', 'asc');
$by_item_number = $this->db->get();
foreach($by_item_number->result() as $row)
{
$suggestions[]=$row->item_number;
$suggestions[] = $row->item_number;
}
/** GARRISON ADDED 4/21/2013 **/
//Search by description
//Search by description
$this->db->select('name, description');
$this->db->from('items');
$this->db->like('description', $search);
$this->db->where('deleted',0);
$this->db->order_by("description", "asc");
$this->db->where('deleted', $is_deleted);
$this->db->order_by('description', 'asc');
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
if (!in_array($row->name, $suggestions))
{
$suggestions[]=$row->name;
$suggestions[] = $row->name;
}
}
/** END GARRISON ADDED **/
/** GARRISON ADDED 4/22/2013 **/
//Search by custom fields
/* $this->db->from('items');
$this->db->like('custom1', $search);
$this->db->or_like('custom2', $search);
$this->db->or_like('custom3', $search);
$this->db->or_like('custom4', $search);
$this->db->or_like('custom5', $search);
$this->db->or_like('custom6', $search);
$this->db->or_like('custom7', $search);
$this->db->or_like('custom8', $search);
$this->db->or_like('custom9', $search);
$this->db->or_like('custom10', $search);
$this->db->where('deleted',0);
$this->db->order_by("name", "asc");
$by_name = $this->db->get();
foreach($by_name->result() as $row)
//Search by custom fields
if ($search_custom != 0)
{
$suggestions[]=$row->name;
} */
/** END GARRISON ADDED **/
$this->db->from('items');
$this->db->like('custom1', $search);
$this->db->or_like('custom2', $search);
$this->db->or_like('custom3', $search);
$this->db->or_like('custom4', $search);
$this->db->or_like('custom5', $search);
$this->db->or_like('custom6', $search);
$this->db->or_like('custom7', $search);
$this->db->or_like('custom8', $search);
$this->db->or_like('custom9', $search);
$this->db->or_like('custom10', $search);
$this->db->where('deleted', $is_deleted);
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[] = $row->name;
}
}
//only return $limit suggestions
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
$suggestions = array_slice($suggestions, 0, $limit);
}
return $suggestions;
return $suggestions;
}
function get_item_search_suggestions($search,$limit=25)
public function get_item_search_suggestions($search, $limit=25, $search_custom=0, $is_deleted=0)
{
$suggestions = array();
$this->db->select('item_id, name');
$this->db->from('items');
$this->db->where('deleted',0);
$this->db->where('deleted', $is_deleted);
$this->db->like('name', $search);
$this->db->order_by("name", "asc");
$this->db->order_by('name', 'asc');
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[]=$row->item_id.'|'.$row->name;
$suggestions[] = $row->item_id.'|'.$row->name;
}
$this->db->select('item_id, item_number');
$this->db->from('items');
$this->db->where('deleted',0);
$this->db->where('deleted', $is_deleted);
$this->db->like('item_number', $search);
$this->db->order_by("item_number", "asc");
$this->db->order_by('item_number', 'asc');
$by_item_number = $this->db->get();
foreach($by_item_number->result() as $row)
{
$suggestions[]=$row->item_id.'|'.$row->item_number;
$suggestions[] = $row->item_id.'|'.$row->item_number;
}
/** GARRISON ADDED 4/21/2013 **/
//Search by description
//Search by description
$this->db->select('item_id, name, description');
$this->db->from('items');
$this->db->where('deleted',0);
$this->db->where('deleted', $is_deleted);
$this->db->like('description', $search);
$this->db->order_by("description", "asc");
$this->db->order_by('description', 'asc');
$by_description = $this->db->get();
foreach($by_description->result() as $row)
{
$entry=$row->item_id.'|'.$row->name;
$entry = $row->item_id.'|'.$row->name;
if (!in_array($entry, $suggestions))
{
$suggestions[]=$entry;
$suggestions[] = $entry;
}
}
/** END GARRISON ADDED **/
/** GARRISON ADDED 4/22/2013 **/
//Search by custom fields
/* $this->db->from('items');
$this->db->where('deleted',0);
$this->db->like('custom1', $search);
$this->db->or_like('custom2', $search);
$this->db->or_like('custom3', $search);
$this->db->or_like('custom4', $search);
$this->db->or_like('custom5', $search);
$this->db->or_like('custom6', $search);
$this->db->or_like('custom7', $search);
$this->db->or_like('custom8', $search);
$this->db->or_like('custom9', $search);
$this->db->or_like('custom10', $search);
$this->db->order_by("name", "asc");
$by_description = $this->db->get();
foreach($by_description->result() as $row)
//Search by custom fields
if ($search_custom != 0)
{
$suggestions[]=$row->item_id.'|'.$row->name;
} */
/** END GARRISON ADDED **/
$this->db->from('items');
$this->db->where('deleted', $is_deleted);
$this->db->like('custom1', $search);
$this->db->or_like('custom2', $search);
$this->db->or_like('custom3', $search);
$this->db->or_like('custom4', $search);
$this->db->or_like('custom5', $search);
$this->db->or_like('custom6', $search);
$this->db->or_like('custom7', $search);
$this->db->or_like('custom8', $search);
$this->db->or_like('custom9', $search);
$this->db->or_like('custom10', $search);
$by_description = $this->db->get();
foreach($by_description->result() as $row)
{
$suggestions[] = $row->item_id.'|'.$row->name;
}
}
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
}
return $suggestions;
}
function get_category_suggestions($search)
public function get_category_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -368,18 +447,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('category', $search);
$this->db->where('deleted', 0);
$this->db->order_by("category", "asc");
$this->db->order_by('category', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->category;
$suggestions[] = $row->category;
}
return $suggestions;
}
/** GARRISON ADDED 5/18/2013 **/
function get_location_suggestions($search)
public function get_location_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -387,17 +465,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('location', $search);
$this->db->where('deleted', 0);
$this->db->order_by("location", "asc");
$this->db->order_by('location', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->location;
$suggestions[] = $row->location;
}
return $suggestions;
}
function get_custom1_suggestions($search)
public function get_custom1_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -405,17 +483,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom1', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom1", "asc");
$this->db->order_by('custom1', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom1;
$suggestions[] = $row->custom1;
}
return $suggestions;
}
function get_custom2_suggestions($search)
public function get_custom2_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -423,17 +501,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom2', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom2", "asc");
$this->db->order_by('custom2', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom2;
$suggestions[] = $row->custom2;
}
return $suggestions;
}
function get_custom3_suggestions($search)
public function get_custom3_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -441,17 +519,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom3', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom3", "asc");
$this->db->order_by('custom3', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom3;
$suggestions[] = $row->custom3;
}
return $suggestions;
}
function get_custom4_suggestions($search)
public function get_custom4_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -459,17 +537,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom4', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom4", "asc");
$this->db->order_by('custom4', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom4;
$suggestions[] = $row->custom4;
}
return $suggestions;
}
function get_custom5_suggestions($search)
public function get_custom5_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -477,17 +555,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom5', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom5", "asc");
$this->db->order_by('custom5', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom5;
$suggestions[] = $row->custom5;
}
return $suggestions;
}
function get_custom6_suggestions($search)
public function get_custom6_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -495,17 +573,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom6', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom6", "asc");
$this->db->order_by('custom6', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom6;
$suggestions[] = $row->custom6;
}
return $suggestions;
}
function get_custom7_suggestions($search)
public function get_custom7_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -513,17 +591,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom7', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom7", "asc");
$this->db->order_by('custom7', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom7;
$suggestions[] = $row->custom7;
}
return $suggestions;
}
function get_custom8_suggestions($search)
public function get_custom8_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -531,17 +609,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom8', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom8", "asc");
$this->db->order_by('custom8', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom8;
$suggestions[] = $row->custom8;
}
return $suggestions;
}
function get_custom9_suggestions($search)
public function get_custom9_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -549,17 +627,17 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom9', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom9", "asc");
$this->db->order_by('custom9', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom9;
$suggestions[] = $row->custom9;
}
return $suggestions;
}
function get_custom10_suggestions($search)
public function get_custom10_suggestions($search)
{
$suggestions = array();
$this->db->distinct();
@@ -567,78 +645,23 @@ class Item extends CI_Model
$this->db->from('items');
$this->db->like('custom10', $search);
$this->db->where('deleted', 0);
$this->db->order_by("custom10", "asc");
$this->db->order_by('custom10', 'asc');
$by_category = $this->db->get();
foreach($by_category->result() as $row)
{
$suggestions[]=$row->custom10;
$suggestions[] = $row->custom10;
}
return $suggestions;
}
/** END GARRISON ADDED **/
/*
Persform a search on items
*/
function search($search,$stock_location_id=-1,$low_inventory=0,$is_serialized=0,$no_description=0,$search_custom=0,$deleted=0,$rows = 0,$limit_from = 0)
{
$this->db->from("items");
if ($stock_location_id > -1)
{
$this->db->join('item_quantities','item_quantities.item_id=items.item_id');
$this->db->where('location_id',$stock_location_id);
}
if (!empty($search))
{
if ($search_custom==0)
{
$this->db->where("(name LIKE '%" . $search . "%' OR " .
"item_number LIKE '" . $search . "%' OR " .
$this->db->dbprefix('items').".item_id LIKE '" . $search . "%' OR " .
"category LIKE '%" . $search . "%')");
}
else
{
$this->db->or_like('custom1',$search);
$this->db->or_like('custom2',$search);
$this->db->or_like('custom3',$search);
$this->db->or_like('custom4',$search);
$this->db->or_like('custom5',$search);
$this->db->or_like('custom6',$search);
$this->db->or_like('custom7',$search);
$this->db->or_like('custom8',$search);
$this->db->or_like('custom9',$search);
$this->db->or_like('custom10',$search);
}
}
$this->db->where('items.deleted', $deleted);
if ($low_inventory !=0 )
{
$this->db->where('quantity <=', 'reorder_level');
}
if ($is_serialized !=0 )
{
$this->db->where('is_serialized', 1);
}
if ($no_description!=0 )
{
$this->db->where('items.description','');
}
$this->db->order_by('items.name', "asc");
if ($rows > 0) {
$this->db->limit($rows, $limit_from);
}
return $this->db->get();
}
function get_categories()
public function get_categories()
{
$this->db->select('category');
$this->db->from('items');
$this->db->where('deleted',0);
$this->db->where('deleted', 0);
$this->db->distinct();
$this->db->order_by("category", "asc");
$this->db->order_by('category', 'asc');
return $this->db->get();
}
@@ -655,7 +678,7 @@ class Item extends CI_Model
* caution: must be used there before item_quantities gets updated, otherwise average price is wrong!
*
*/
function change_cost_price($item_id, $items_received, $new_price, $old_price = null)
public function change_cost_price($item_id, $items_received, $new_price, $old_price = null)
{
if($old_price === null)
{
@@ -665,9 +688,9 @@ class Item extends CI_Model
$this->db->from('item_quantities');
$this->db->select_sum('quantity');
$this->db->where('item_id',$item_id);
$this->db->join('stock_locations','stock_locations.location_id=item_quantities.location_id');
$this->db->where('stock_locations.deleted',0);
$this->db->where('item_id', $item_id);
$this->db->join('stock_locations', 'stock_locations.location_id=item_quantities.location_id');
$this->db->where('stock_locations.deleted', 0);
$old_total_quantity = $this->db->get()->row()->quantity;
$total_quantity = $old_total_quantity + $items_received;
@@ -677,6 +700,5 @@ class Item extends CI_Model
return $this->save($data, $item_id);
}
}
?>

View File

@@ -7,28 +7,31 @@ class Item_kit extends CI_Model
function exists($item_kit_id)
{
$this->db->from('item_kits');
$this->db->where('item_kit_id',$item_kit_id);
$query = $this->db->get();
$this->db->where('item_kit_id', $item_kit_id);
return ($query->num_rows()==1);
return ($this->db->get()->num_rows()==1);
}
/*
Returns all the item kits
*/
function get_all($rows = 0, $limit_from = 0)
function get_all($rows=0, $limit_from=0)
{
$this->db->from('item_kits');
$this->db->order_by("name", "asc");
if ($rows > 0) {
$this->db->order_by('name', 'asc');
if ($rows > 0)
{
$this->db->limit($rows, $limit_from);
}
return $this->db->get();
}
function get_total_rows()
{
$this->db->from('item_kits');
return $this->db->count_all_results();
}
@@ -38,7 +41,7 @@ class Item_kit extends CI_Model
function get_info($item_kit_id)
{
$this->db->from('item_kits');
$this->db->where('item_kit_id',$item_kit_id);
$this->db->where('item_kit_id', $item_kit_id);
$query = $this->db->get();
@@ -49,14 +52,14 @@ class Item_kit extends CI_Model
else
{
//Get empty base parent object, as $item_kit_id is NOT an item kit
$item_obj=new stdClass();
$item_obj = new stdClass();
//Get all the fields from items table
$fields = $this->db->list_fields('item_kits');
foreach ($fields as $field)
{
$item_obj->$field='';
$item_obj->$field = '';
}
return $item_obj;
@@ -69,28 +72,32 @@ class Item_kit extends CI_Model
function get_multiple_info($item_kit_ids)
{
$this->db->from('item_kits');
$this->db->where_in('item_kit_id',$item_kit_ids);
$this->db->order_by("name", "asc");
$this->db->where_in('item_kit_id', $item_kit_ids);
$this->db->order_by('name', 'asc');
return $this->db->get();
}
/*
Inserts or updates an item kit
*/
function save(&$item_kit_data,$item_kit_id=false)
function save(&$item_kit_data, $item_kit_id=false)
{
if (!$item_kit_id or !$this->exists($item_kit_id))
{
if($this->db->insert('item_kits',$item_kit_data))
if($this->db->insert('item_kits', $item_kit_data))
{
$item_kit_data['item_kit_id']=$this->db->insert_id();
$item_kit_data['item_kit_id'] = $this->db->insert_id();
return true;
}
return false;
}
$this->db->where('item_kit_id', $item_kit_id);
return $this->db->update('item_kits',$item_kit_data);
return $this->db->update('item_kits', $item_kit_data);
}
/*
@@ -106,33 +113,53 @@ class Item_kit extends CI_Model
*/
function delete_list($item_kit_ids)
{
$this->db->where_in('item_kit_id',$item_kit_ids);
$this->db->where_in('item_kit_id', $item_kit_ids);
return $this->db->delete('item_kits');
}
/*
Get search suggestions to find kits
*/
function get_search_suggestions($search,$limit=25)
function get_search_suggestions($search, $limit=25)
{
$suggestions = array();
$this->db->from('item_kits');
$this->db->like('name', $search);
$this->db->order_by("name", "asc");
$by_name = $this->db->get();
foreach($by_name->result() as $row)
//KIT #
if (stripos($search, 'KIT ') !== false)
{
$suggestions[]=$row->name;
$this->db->like('item_kit_id', str_ireplace('KIT ', '', $search));
$this->db->order_by('item_kit_id', 'asc');
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[] = 'KIT ' . $row->item_kit_id;
}
}
else
{
$this->db->like('name', $search);
$this->db->order_by('name', 'asc');
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[] = $row->name;
}
}
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
$suggestions = array_slice($suggestions, 0, $limit);
}
return $suggestions;
return $suggestions;
}
function get_item_kit_search_suggestions($search, $limit=25)
@@ -141,42 +168,61 @@ class Item_kit extends CI_Model
$this->db->from('item_kits');
$this->db->like('name', $search);
$this->db->order_by("name", "asc");
$this->db->order_by('name', 'asc');
$by_name = $this->db->get();
foreach($by_name->result() as $row)
{
$suggestions[]='KIT '.$row->item_kit_id.'|'.$row->name;
// do not touch the '|' otherwise the sale search will not fetch the kit
$suggestions[] = 'KIT ' . $row->item_kit_id . '|' . $row->name;
}
//only return $limit suggestions
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
$suggestions = array_slice($suggestions, 0, $limit);
}
return $suggestions;
}
/*
Preform a search on items
Perform a search on items
*/
function search($search, $rows = 0, $limit_from = 0)
function search($search, $rows=0, $limit_from=0)
{
$this->db->from('item_kits');
$this->db->where("name LIKE '%".$this->db->escape_like_str($search)."%' or
description LIKE '%".$this->db->escape_like_str($search)."%'");
$this->db->order_by("name", "asc");
if ($rows > 0) {
$this->db->like('name', $search);
$this->db->or_like('description', $search);
//KIT #
if (stripos($search, 'KIT ') !== false)
{
$this->db->or_like('item_kit_id', str_ireplace('KIT ', '', $search));
}
$this->db->order_by('name', 'asc');
if ($rows > 0)
{
$this->db->limit($rows, $limit_from);
}
return $this->db->get();
}
function get_found_rows($search)
{
$this->db->from('item_kits');
$this->db->where("name LIKE '%".$this->db->escape_like_str($search)."%' or
description LIKE '%".$this->db->escape_like_str($search)."%'");
$this->db->like('name', $search);
$this->db->or_like('description', $search);
//KIT #
if (stripos($search, 'KIT ') !== false)
{
$this->db->or_like('item_kit_id', str_ireplace('KIT ', '', $search));
}
return $this->db->get()->num_rows();
}
}

View File

@@ -7,7 +7,8 @@ class Item_kit_items extends CI_Model
function get_info($item_kit_id)
{
$this->db->from('item_kit_items');
$this->db->where('item_kit_id',$item_kit_id);
$this->db->where('item_kit_id', $item_kit_id);
//return an array of item kit items for an item
return $this->db->get()->result_array();
}
@@ -25,10 +26,11 @@ class Item_kit_items extends CI_Model
foreach ($item_kit_items_data as $row)
{
$row['item_kit_id'] = $item_kit_id;
$this->db->insert('item_kit_items',$row);
$this->db->insert('item_kit_items', $row);
}
$this->db->trans_complete();
return true;
}

View File

@@ -1,66 +1,66 @@
<?php
class Item_quantities extends CI_Model
{
function exists($item_id,$location_id)
{
$this->db->from('item_quantities');
$this->db->where('item_id',$item_id);
$this->db->where('location_id',$location_id);
$query = $this->db->get();
return ($query->num_rows()==1);
}
function save($location_detail, $item_id, $location_id)
{
if (!$this->exists($item_id,$location_id))
{
if($this->db->insert('item_quantities',$location_detail))
{
return true;
}
return false;
}
$this->db->where('item_id', $item_id);
$this->db->where('location_id', $location_id);
return $this->db->update('item_quantities',$location_detail);
}
function get_item_quantity($item_id, $location_id)
{
$this->db->from('item_quantities');
$this->db->where('item_id',$item_id);
$this->db->where('location_id',$location_id);
$result = $this->db->get()->row();
if(empty($result) == true)
{
//Get empty base parent object, as $item_id is NOT an item
$result=new stdClass();
//Get all the fields from items table (TODO to be reviewed)
$fields = $this->db->list_fields('item_quantities');
foreach ($fields as $field)
{
$result->$field='';
}
<?php
class Item_quantity extends CI_Model
{
function exists($item_id,$location_id)
{
$this->db->from('item_quantities');
$this->db->where('item_id',$item_id);
$this->db->where('location_id',$location_id);
$query = $this->db->get();
return ($query->num_rows()==1);
}
function save($location_detail, $item_id, $location_id)
{
if (!$this->exists($item_id,$location_id))
{
if($this->db->insert('item_quantities',$location_detail))
{
return true;
}
return false;
}
$this->db->where('item_id', $item_id);
$this->db->where('location_id', $location_id);
return $this->db->update('item_quantities',$location_detail);
}
function get_item_quantity($item_id, $location_id)
{
$this->db->from('item_quantities');
$this->db->where('item_id',$item_id);
$this->db->where('location_id',$location_id);
$result = $this->db->get()->row();
if(empty($result) == true)
{
//Get empty base parent object, as $item_id is NOT an item
$result=new stdClass();
//Get all the fields from items table (TODO to be reviewed)
$fields = $this->db->list_fields('item_quantities');
foreach ($fields as $field)
{
$result->$field='';
}
$result->quantity = 0;
}
return $result;
}
/*
* changes to quantity of an item according to the given amount.
* if $quantity_change is negative, it will be subtracted,
* if it is positive, it will be added to the current quantity
*/
function change_quantity($item_id, $location_id, $quantity_change)
{
$quantity_old = $this->get_item_quantity($item_id, $location_id);
$quantity_new = $quantity_old->quantity + intval($quantity_change);
$location_detail = array('item_id'=>$item_id,
'location_id'=>$location_id,
'quantity'=>$quantity_new);
return $this->save($location_detail,$item_id,$location_id);
}
}
}
return $result;
}
/*
* changes to quantity of an item according to the given amount.
* if $quantity_change is negative, it will be subtracted,
* if it is positive, it will be added to the current quantity
*/
function change_quantity($item_id, $location_id, $quantity_change)
{
$quantity_old = $this->get_item_quantity($item_id, $location_id);
$quantity_new = $quantity_old->quantity + intval($quantity_change);
$location_detail = array('item_id'=>$item_id,
'location_id'=>$location_id,
'quantity'=>$quantity_new);
return $this->save($location_detail,$item_id,$location_id);
}
}
?>

View File

@@ -84,7 +84,7 @@ class Person extends CI_Model
$this->db->where('person_id', $person_id);
return $this->db->update('people',$person_data);
}
/** GARRISON ADDED 4/25/2013 IN PROGRESS **/
/*
Get search suggestions to find customers
*/
@@ -113,7 +113,8 @@ class Person extends CI_Model
if(count($suggestions > $limit))
{
$suggestions = array_slice($suggestions, 0,$limit);
}
}
return $suggestions;
}
@@ -122,7 +123,7 @@ class Person extends CI_Model
*/
function delete($person_id)
{
return true;;
return true;
}
/*

View File

@@ -81,7 +81,7 @@ class Receiving extends CI_Model
'receiving_id'=>$receiving_id,
'item_id'=>$item['item_id'],
'line'=>$item['line'],
'description'=>$item['description'],
'description'=>base64_decode($item['description']),
'serialnumber'=>$item['serialnumber'],
'quantity_purchased'=>$item['quantity'],
'receiving_quantity'=>$item['receiving_quantity'],
@@ -106,8 +106,8 @@ class Receiving extends CI_Model
}
//Update stock quantity
$item_quantity = $this->Item_quantities->get_item_quantity($item['item_id'], $item['item_location']);
$this->Item_quantities->save(array('quantity'=>$item_quantity->quantity + $items_received,
$item_quantity = $this->Item_quantity->get_item_quantity($item['item_id'], $item['item_location']);
$this->Item_quantity->save(array('quantity'=>$item_quantity->quantity + $items_received,
'item_id'=>$item['item_id'],
'location_id'=>$item['item_location']), $item['item_id'], $item['item_location']);
@@ -169,7 +169,7 @@ class Receiving extends CI_Model
$this->Inventory->insert($inv_data);
// update quantities
$this->Item_quantities->change_quantity($item['item_id'],
$this->Item_quantity->change_quantity($item['item_id'],
$item['item_location'],
$item['quantity_purchased']*-1);
}
@@ -211,15 +211,16 @@ class Receiving extends CI_Model
}
//We create a temp table that allows us to do easy report/receiving queries
public function create_receivings_items_temp_table()
function create_receivings_items_temp_table()
{
$this->db->query("CREATE TEMPORARY TABLE ".$this->db->dbprefix('receivings_items_temp')."
$this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS ".$this->db->dbprefix('receivings_items_temp')."
(SELECT date(receiving_time) as receiving_date, ".$this->db->dbprefix('receivings_items').".receiving_id, comment, item_location, invoice_number, payment_type, employee_id,
".$this->db->dbprefix('items').".item_id, ".$this->db->dbprefix('receivings').".supplier_id, quantity_purchased, ".$this->db->dbprefix('receivings_items').".receiving_quantity,
item_cost_price, item_unit_price, discount_percent, (item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) as subtotal,
".$this->db->dbprefix('receivings_items').".line as line, serialnumber, ".$this->db->dbprefix('receivings_items').".description as description,
(item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) as total,
(item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) - (item_cost_price*quantity_purchased) as profit
(item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) - (item_cost_price*quantity_purchased) as profit,
(item_cost_price*quantity_purchased) as cost
FROM ".$this->db->dbprefix('receivings_items')."
INNER JOIN ".$this->db->dbprefix('receivings')." ON ".$this->db->dbprefix('receivings_items').'.receiving_id='.$this->db->dbprefix('receivings').'.receiving_id'."
INNER JOIN ".$this->db->dbprefix('items')." ON ".$this->db->dbprefix('receivings_items').'.item_id='.$this->db->dbprefix('items').'.item_id'."

View File

@@ -9,18 +9,19 @@ class Detailed_receivings extends Report
public function getDataColumns()
{
return array('summary' => array($this->lang->line('reports_receiving_id'), $this->lang->line('reports_date'), $this->lang->line('reports_items_received'), $this->lang->line('reports_received_by'), $this->lang->line('reports_supplied_by'), $this->lang->line('reports_total'), $this->lang->line('reports_payment_type'), $this->lang->line('recvs_invoice_number'), $this->lang->line('reports_comments')),
'details' => array($this->lang->line('reports_item_number'), $this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_quantity_purchased'), $this->lang->line('reports_total'), $this->lang->line('reports_discount'))
return array('summary' => array($this->lang->line('reports_receiving_id'), $this->lang->line('reports_date'), $this->lang->line('reports_count'), $this->lang->line('reports_received_by'), $this->lang->line('reports_supplied_by'), $this->lang->line('reports_total'), $this->lang->line('reports_payment_type'), $this->lang->line('recvs_invoice_number'), $this->lang->line('reports_comments')),
'details' => array($this->lang->line('reports_item_number'), $this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_count'), $this->lang->line('reports_total'), $this->lang->line('reports_discount'))
);
}
public function getDataByReceivingId($receiving_id)
{
$this->db->select('receiving_id, DATE_FORMAT(receiving_date, "%d-%m-%Y") AS receiving_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name," ",employee.last_name) as employee_name, suppliers.company_name as supplier_name, sum(subtotal) as subtotal, sum(total) as total, sum(profit) as profit, payment_type, comment, invoice_number', false);
$this->db->select('receiving_id, DATE_FORMAT(receiving_date, "%d-%m-%Y") AS receiving_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name, " ", employee.last_name) as employee_name, suppliers.company_name as supplier_name, sum(subtotal) as subtotal, sum(total) as total, sum(profit) as profit, payment_type, comment, invoice_number', false);
$this->db->from('receivings_items_temp');
$this->db->join('people as employee', 'receivings_items_temp.employee_id = employee.person_id');
$this->db->join('suppliers as suppliers', 'receivings_items_temp.supplier_id = suppliers.person_id', 'left');
$this->db->where('receiving_id', $receiving_id);
return $this->db->get()->row_array();
}
@@ -72,6 +73,7 @@ class Detailed_receivings extends Report
$this->db->select('sum(total) as total');
$this->db->from('receivings_items_temp');
$this->db->where('receiving_date BETWEEN '. $this->db->escape($inputs['start_date']). ' and '. $this->db->escape($inputs['end_date']));
if ($inputs['location_id'] != 'all')
{
$this->db->where('item_location', $inputs['location_id']);

View File

@@ -9,32 +9,35 @@ class Detailed_sales extends Report
public function getDataColumns()
{
return array('summary' => array($this->lang->line('reports_sale_id'), $this->lang->line('reports_date'), $this->lang->line('reports_items_purchased'), $this->lang->line('reports_sold_by'), $this->lang->line('reports_sold_to'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_profit'), $this->lang->line('reports_payment_type'), $this->lang->line('reports_comments')),
'details' => array($this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_serial_number'), $this->lang->line('reports_description'), $this->lang->line('reports_quantity_purchased'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_profit'),$this->lang->line('reports_discount'))
return array('summary' => array($this->lang->line('reports_sale_id'), $this->lang->line('reports_date'), $this->lang->line('reports_count'), $this->lang->line('reports_sold_by'), $this->lang->line('reports_sold_to'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_cost'), $this->lang->line('reports_profit'), $this->lang->line('reports_payment_type'), $this->lang->line('reports_comments')),
'details' => array($this->lang->line('reports_name'), $this->lang->line('reports_category'), $this->lang->line('reports_serial_number'), $this->lang->line('reports_description'), $this->lang->line('reports_count'), $this->lang->line('reports_subtotal'), $this->lang->line('reports_total'), $this->lang->line('reports_tax'), $this->lang->line('reports_cost'), $this->lang->line('reports_profit'), $this->lang->line('reports_discount'))
);
}
public function getDataBySaleId($sale_id)
{
$this->db->select('sale_id, DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name," ",employee.last_name) as employee_name, CONCAT(customer.first_name," ",customer.last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(profit) as profit, payment_type, comment', false);
$this->db->select('sale_id, DATE_FORMAT(sale_time, "%d-%m-%Y") AS sale_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name, " ", employee.last_name) as employee_name, CONCAT(customer.first_name," ",customer.last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit, payment_type, comment', false);
$this->db->from('sales_items_temp');
$this->db->join('people as employee', 'sales_items_temp.employee_id = employee.person_id');
$this->db->join('people as customer', 'sales_items_temp.customer_id = customer.person_id', 'left');
$this->db->where('sale_id', $sale_id);
return $this->db->get()->row_array();
}
public function getData(array $inputs)
{
$this->db->select('sale_id, sale_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name," ",employee.last_name) as employee_name, CONCAT(customer.first_name," ",customer.last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(profit) as profit, payment_type, comment', false);
$this->db->select('sale_id, sale_date, sum(quantity_purchased) as items_purchased, CONCAT(employee.first_name," ",employee.last_name) as employee_name, CONCAT(customer.first_name," ",customer.last_name) as customer_name, sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit, payment_type, comment', false);
$this->db->from('sales_items_temp');
$this->db->join('people as employee', 'sales_items_temp.employee_id = employee.person_id');
$this->db->join('people as customer', 'sales_items_temp.customer_id = customer.person_id', 'left');
$this->db->where('sale_date BETWEEN '. $this->db->escape($inputs['start_date']). ' and '. $this->db->escape($inputs['end_date']));
if ($inputs['location_id'] != 'all')
{
$this->db->where('item_location', $inputs['location_id']);
}
if ($inputs['sale_type'] == 'sales')
{
$this->db->where('quantity_purchased > 0');
@@ -42,7 +45,8 @@ class Detailed_sales extends Report
elseif ($inputs['sale_type'] == 'returns')
{
$this->db->where('quantity_purchased < 0');
}
}
$this->db->group_by('sale_id');
$this->db->order_by('sale_date');
@@ -52,7 +56,7 @@ class Detailed_sales extends Report
foreach($data['summary'] as $key=>$value)
{
$this->db->select('name, category, quantity_purchased, item_location, serialnumber, sales_items_temp.description, subtotal,total, tax, profit, discount_percent');
$this->db->select('name, category, quantity_purchased, item_location, serialnumber, sales_items_temp.description, subtotal, total, tax, cost, profit, discount_percent');
$this->db->from('sales_items_temp');
$this->db->join('items', 'sales_items_temp.item_id = items.item_id');
$this->db->where('sale_id', $value['sale_id']);
@@ -64,13 +68,15 @@ class Detailed_sales extends Report
public function getSummaryData(array $inputs)
{
$this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(profit) as profit');
$this->db->select('sum(subtotal) as subtotal, sum(total) as total, sum(tax) as tax, sum(cost) as cost, sum(profit) as profit');
$this->db->from('sales_items_temp');
$this->db->where('sale_date BETWEEN '. $this->db->escape($inputs['start_date']). ' and '. $this->db->escape($inputs['end_date']));
if ($inputs['location_id'] != 'all')
{
$this->db->where('item_location', $inputs['location_id']);
}
if ($inputs['sale_type'] == 'sales')
{
$this->db->where('quantity_purchased > 0');
@@ -78,8 +84,8 @@ class Detailed_sales extends Report
elseif ($inputs['sale_type'] == 'returns')
{
$this->db->where('quantity_purchased < 0');
}
}
return $this->db->get()->row_array();
}
}

View File

@@ -17,16 +17,12 @@ class Inventory_low extends Report
$this->db->from('items');
$this->db->join('item_quantities','items.item_id=item_quantities.item_id');
$this->db->join('stock_locations','item_quantities.location_id=stock_locations.location_id');
$this->db->select('name, item_number, reorder_level, item_quantities.quantity,description,location_name');
$this->db->select('name, item_number, reorder_level, item_quantities.quantity, description, location_name');
$this->db->where('item_quantities.quantity <= reorder_level');
$this->db->where('items.deleted = 0');
$this->db->where('items.deleted', 0);
$this->db->order_by('name');
return $this->db->get()->result_array();
}
public function getSummaryData(array $inputs)

Some files were not shown because too many files have changed in this diff Show More