Skip to content

Commit

Permalink
Merge pull request #87 from andras-tim/devel
Browse files Browse the repository at this point in the history
merge devel branch
  • Loading branch information
andras-tim committed Oct 9, 2015
2 parents a80c621 + b3cfd96 commit 0751b8c
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 52 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [Unreleased][unreleased]


## 0.1.0 - 2015-10-08
### Added
- User login, logout
- Manage items and its barcodes, units, vendors
- Add/remove items in store
- Able to use barcode reader for collecting items
- Can use barcode printer to create labels


[unreleased]: https://github.com/andras-tim/StoreKeeper/compare/v0.1.0...HEAD
15 changes: 11 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@

StoreKeeper is an open source, multilingual warehouse/store management software

*Project is under development, so pleas go back some weeks later for first release!*
*Project is under development!*


Features
--------

The following features are only available via API now.
The following features are available:

* Manage users, sessions (login, logout), handle permissions
* User login, logout
* Manage items and its barcodes, units, vendors
* Add/remove items in store
* Able to use barcode reader for collecting items
* Can use barcode printer to create labels

The following features are only available via API now:

* Manage users, handle permissions
* Can make acquisition and stocktaking
* Can crate works and its customers (handle outbound, returned items)

Expand All @@ -24,7 +31,7 @@ Prepare & Run
All commands can run with ``package.sh`` scripts what you want. All of these scripts has ``--help`` argument for
available getting some info about the current module.

1. Install all dependencies: ``./package.sh install``
1. Install all dependencies: ``./package.sh -p install``
2. Make default configuration files: ``./package.sh make_defaults``
3. Check the ``config/config.yml`` for database and other settings
4. Prepare database: ``./package.sh create_database``
Expand Down
2 changes: 1 addition & 1 deletion VERSION.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[0, 1, 0, "alpha"]
[0, 1, 0]
2 changes: 1 addition & 1 deletion client/app/partials/views/item.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

<td class="field-checkbox">
<app-checkbox-label app-tooltip="{{ 'Master barcode for this item' | translate }}">
<input name="master" type="checkbox" ng-model="barcode.master" ng-change="togglePostCheck(barcode); setBarcodeDirty(barcode)" ng-disabled="!barcode.main">
<input name="master" type="checkbox" ng-model="barcode.master" ng-change="togglePostCheck(barcode); setBarcodeDirty(barcode)">
</app-checkbox-label>
</td>

Expand Down
67 changes: 35 additions & 32 deletions client/po/hu.po
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ msgstr ""
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-Basepath: ../\n"

#: app/partials/sidebars/item.html:53
#: app/partials/sidebars/item.html:55
msgid "Add barcode to a new item"
msgstr "Vonalkód hozzáadása egy új elemhez"

Expand All @@ -32,19 +32,19 @@ msgstr "Cikkszám"
msgid "Article no."
msgstr "Cikkszám"

#: app/partials/sidebars/item.html:54
#: app/partials/sidebars/item.html:56
msgid "Assign barcode to an existing item"
msgstr "Vonalkód hozzárendelése egy létező elemhez"

#: app/js/controllers/sidebars/item.js:253
#: app/js/controllers/sidebars/item.js:257
msgid "Assign to item"
msgstr "Hozzárendelés egy elemhez"

#: app/partials/views/item.html:64
#: app/partials/views/item.html:67
msgid "Barcode"
msgstr "Vonalkód"

#: app/partials/views/item-selector.html:15
#: app/partials/views/item-selector.html:17
msgid "Barcode quantity"
msgstr "Vonalkódhoz rendelt mennyiség"

Expand All @@ -56,24 +56,24 @@ msgstr "Vonalkód, elem név, cikkszám"
msgid "Can not connect to server"
msgstr "Nem lehet csatlakozni a szerverhez"

#: app/partials/views/item-selector.html:26
#: app/partials/views/item-selector.html:33
msgid "Cancel"
msgstr "Mégse"

#: app/partials/views/item.html:119
#: app/partials/widgets/modal/details_modal_navbar.html:17
#: app/partials/views/item.html:122
#: app/partials/widgets/modal/details_modal_navbar.html:9
msgid "Close"
msgstr "Bezárás"

#: app/partials/views/item.html:66
#: app/partials/views/item.html:69
msgid "Commands"
msgstr "Műveletek"

#: app/partials/sidebars/item.html:49
#: app/partials/sidebars/item.html:51
msgid "Count"
msgstr "Darabszám"

#: app/js/controllers/sidebars/item.js:373
#: app/js/controllers/sidebars/item.js:380
msgid "Do you want to clear list?"
msgstr "Biztosan üríteni szeretné az tétellistát?"

Expand All @@ -83,23 +83,27 @@ msgstr ""
"Biztosan törölni szeretné a {{ barcode }} ({{ quantity }} {{ unit }}) "
"vonalkódot?"

#: app/js/controllers/sidebars/item.js:319
#: app/js/controllers/sidebars/item.js:323
msgid "Do you want to delete element \"{{ barcode }}\" ({{ count }} pcs)"
msgstr "Biztosan törölni szeretné a {{ barcode }} ({{ quantity }}) tételt?"

#: app/js/controllers/sidebars/item.js:310
#: app/js/controllers/sidebars/item.js:314
msgid ""
"Do you want to delete element \"{{ barcode }}\" ({{ count }} x "
"{{ quantity }} {{ unit }} of item \"{{ name }}\")"
msgstr ""
"Biztosan törölni szeretné a {{ name }}) elem {{ barcode }} ({{ count }} x "
"{{ quantity }} {{ unit }} tételét?"

#: app/js/controllers/sidebars/item.js:334
#: app/js/controllers/sidebars/item.js:391
msgid "Do you want to move all element from list to Items?"
msgstr "Biztos át akarja mozgatni a lista tételeit az Elemekhez?"

#: app/js/controllers/sidebars/item.js:341
msgid "Do you want to print sum {{ count }} pcs. labels?"
msgstr "Biztosan ki szeretne nyomtatni {{ count }} darab címkét?"

#: app/partials/views/item.html:93
#: app/partials/views/item.html:96
msgid "Download label file"
msgstr "Címke fájl letöltése"

Expand Down Expand Up @@ -127,15 +131,15 @@ msgstr "Hiba {{status}}"
msgid "In Stock"
msgstr "Raktáron"

#: app/partials/views/item-selector.html:11 app/partials/views/item.html:9
#: app/partials/views/item-selector.html:13 app/partials/views/item.html:9
msgid "Item"
msgstr "Elem"

#: app/partials/views/item-selector.html:16 app/partials/views/item.html:87
#: app/partials/views/item-selector.html:19 app/partials/views/item.html:90
msgid "Item amount for this barcode"
msgstr "A vonalkódhoz tartozó elemszám"

#: app/partials/views/item-selector.html:11
#: app/partials/views/item-selector.html:13
msgid "Item can not be empty"
msgstr "Az elem nem maradhat üresen"

Expand All @@ -159,12 +163,12 @@ msgstr "Bejelentkezés"
msgid "Logout"
msgstr "Kijelentkezés"

#: app/partials/views/item.html:77
#: app/partials/views/item.html:80
msgid "Master barcode for this item"
msgstr "Fő címke ehhez az elemhez"

#: app/partials/sidebars/item.html:69
msgid "Move elements to the Items"
#: app/partials/sidebars/item.html:71
msgid "Move elements to Items"
msgstr "Tételek mozgatása az Elemekhez"

#: app/partials/views/item.html:30 app/partials/views/items.html:11
Expand All @@ -187,15 +191,15 @@ msgstr "Jelszó"
msgid "Password is required"
msgstr "A jelszót kötelező megadni"

#: app/partials/views/item.html:92
#: app/partials/views/item.html:95
msgid "Print label"
msgstr "Címke nyomtatása"

#: app/partials/sidebars/item.html:55
#: app/partials/sidebars/item.html:57
msgid "Print label for this element"
msgstr "Címke nyomtatása ehhez a tételhez"

#: app/partials/sidebars/item.html:67
#: app/partials/sidebars/item.html:69
msgid "Print labels for all elements"
msgstr "Címke nyomtatás az összes tételhez"

Expand All @@ -204,39 +208,39 @@ msgstr "Címke nyomtatás az összes tételhez"
msgid "Quantity"
msgstr "Mennyiség"

#: app/partials/views/item.html:65
#: app/partials/views/item.html:68
msgid "Quantity ({{ item.unit.unit }})"
msgstr "Mennyiség"

#: app/partials/views/item-selector.html:15
#: app/partials/views/item-selector.html:17
msgid "Quantity can not be empty"
msgstr "A mennyiség nem maradhat üresen"

#: app/partials/views/login.html:17
msgid "Remember me"
msgstr "Emlékezz rám"

#: app/partials/sidebars/item.html:68
#: app/partials/sidebars/item.html:70
msgid "Remove all elements from list"
msgstr "Az összes tltel eltávolítása a listából"

#: app/partials/views/item.html:94
#: app/partials/views/item.html:97
msgid "Remove label"
msgstr "Címke törlése"

#: app/partials/sidebars/item.html:56
#: app/partials/sidebars/item.html:58
msgid "Remove this element"
msgstr "Elem eltávolítása"

#: app/partials/views/item.html:118
#: app/partials/views/item.html:121
msgid "Save"
msgstr "Mentés"

#: app/partials/views/login.html:23
msgid "Sign in"
msgstr "Bejelentkezés"

#: app/partials/views/item.html:50
#: app/partials/views/item.html:51
msgid "System will send a warning when the quantity decreases under this value"
msgstr ""
"A rendszer figyelmeztetni fog, ha a mennyiség ez alá az érték alá csökkenne"
Expand All @@ -250,7 +254,6 @@ msgid "The form is dirty. Do you want to stay on the page?"
msgstr "Az űrlap még nincs mentve. Biztos el akarja hagyni az oldalt?"

#: app/partials/header.html:6
#: app/partials/widgets/modal/details_modal_navbar.html:6
msgid "Toggle menu"
msgstr "Menü megjelenítése/elrejtése"

Expand Down
13 changes: 10 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@ Welcome to StoreKeeper's documentation!
StoreKeeper is an open source, multilingual warehouse/store management software

.. warning::
*Project is under development, so pleas go back some weeks later for first release!*
*Project is under development!*


Features
--------

The following features are only available via API now.
The following features are available:

* Manage users, sessions (login, logout), handle permissions
* User login, logout
* Manage items and its barcodes, units, vendors
* Add/remove items in store
* Able to use barcode reader for collecting items
* Can use barcode printer to create labels

The following features are only available via API now:

* Manage users, handle permissions
* Can make acquisition and stocktaking
* Can crate works and its customers (handle outbound, returned items)

Expand Down
2 changes: 1 addition & 1 deletion docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Prepare & Run
All commands can run with ``package.sh`` scripts what you want. All of these scripts has ``--help`` argument for
available getting some info about the current module.

1. Install all dependencies: ``./package.sh install``
1. Install all dependencies: ``./package.sh -p install``
2. Make default configuration files: ``./package.sh make_defaults``
3. Check the ``config/config.yml`` for database and other settings
4. Prepare database: ``./package.sh create_database``
Expand Down
12 changes: 7 additions & 5 deletions server/app/views/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,20 @@ def get(self):

results = []

expression = '%{}%'.format(data['expression'])
barcodes = Barcode.query.filter(
Barcode.barcode.contains(data['expression'])
Barcode.barcode.ilike(expression)
).limit(data['limit']).all()
results.extend([_CreateObject(type='barcode', item_id=row.item_id, barcode=row.barcode, quantity=row.quantity,
name=row.item.name, unit=row.item.unit.unit) for row in barcodes])

if len(results) < data['limit']:
items = db.session.query(Item, Barcode).join(Barcode).filter(
and_(
or_(Item.name.contains(data['expression']), Item.article_number.contains(data['expression'])),
or_(
Item.name.ilike(expression),
Item.article_number.ilike(expression)
),
Barcode.master
)
).limit(data['limit'] - len(results)).all()
Expand Down Expand Up @@ -125,7 +129,7 @@ def post(self, id: int):

if barcode.main is None and barcode.barcode and _is_main_barcode(barcode.barcode):
barcode.main = True
if barcode.master is None and barcode.main and item.barcodes.count() == 0:
if barcode.master is None and item.barcodes.count() == 0:
barcode.master = True

_can_be_master_barcode(barcode)
Expand Down Expand Up @@ -245,8 +249,6 @@ def _is_main_barcode(barcode: str) -> bool:
def _can_be_master_barcode(barcode: Barcode):
if not barcode.master:
return
if barcode.master and barcode.barcode and not barcode.main:
abort(422, message={'master': ['Can not set non-main barcode as master barcode.']})
if Barcode.query.filter(Barcode.id != barcode.id,
Barcode.item_id == barcode.item_id,
Barcode.master).count() > 0:
Expand Down
7 changes: 2 additions & 5 deletions server/test/views/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,8 @@ def test_can_not_add_more_than_once_an_barcode_to_a_item(self):
expected_data={'message': {'barcode': ['Already exists.']}},
expected_status_codes=422)

def test_can_not_adding_new_master_non_main_barcode(self):
self.assertApiPost(data=ItemBarcodes.BARCODE2.set(change={'master': True}),
expected_data={'message': {'master': [
'Can not set non-main barcode as master barcode.']}},
expected_status_codes=422)
def test_can_add_new_master_non_main_barcode(self):
self.assertApiPost(data=ItemBarcodes.BARCODE2.set(change={'master': True}))

def test_can_not_add_more_than_one_master_barcode(self):
self.assertApiPost(data=ItemBarcodes.BARCODE1)
Expand Down

0 comments on commit 0751b8c

Please sign in to comment.