Philipp Rothmann
33034e66b8
fix: add null checks for articles convert_units
...
Prevents division by zero exception because of a unit beeing 0.
A Unit becomes also zero e.g. when a comma symbol is used Unit.new("0,9kg") == 0
fixes #1014
2023-06-22 22:49:22 +02:00
Philipp Rothmann
fb2b4d8a8a
chore: rubocop
...
chore: fix api test conventions
chore: rubocop -A spec/
chore: more rubocop -A
fix failing test
rubocop fixes
removes helper methods that are in my opinion dead code
more rubocop fixes
rubocop -a --auto-gen-config
2023-06-09 17:35:05 +02:00
Patrick Gansterer
6a3636d8cb
Move code from localize_input gem into Foodsoft
2022-05-27 17:24:57 +02:00
kidhab
7574f4eb07
Add validation of more article fields (PR #917 )
...
If one adds a some text that is longer than 255 characters into these articles fields the browser shows an unspecific error messages. With this validation an understandable message will be shown.
2022-01-26 09:22:41 +01:00
Patrick Gansterer
ea2862fdef
Run rubocop --fix-layout and remove encoding comments
2021-03-02 09:12:19 +01:00
wvengen
ed9192c47f
API v1 order_articles endpoints
2021-02-17 17:07:39 +01:00
Tom Carchrae
d70c3a9bf1
allow 1 char unit, eg L or g
2019-03-26 18:58:36 +00:00
Patrick Gansterer
abe847c0ee
Add and inherit from ApplicationRecord to match Rails 5.0 style
2019-01-15 04:40:05 +01:00
Tom Carchrae
7e88798778
big speedup in syncing via caching/reducing queries ( #610 )
2019-01-15 02:56:21 +01:00
Patrick Gansterer
2d4891bf1d
Remove code-duplication of artice price calculation
2017-10-08 12:20:54 +02:00
wvengen
c30ec67548
Allow synchronising units when uploading
2015-04-11 02:52:57 +02:00
wvengen
07ba6f0535
Import multiple spreadsheet formats. Make upload work like sync.
2015-04-11 02:52:57 +02:00
wvengen
118886344a
Use boolean comparators where it makes sense
2015-01-14 21:17:00 +01:00
wvengen
1b9b81fa75
Make sync work when unit has no name
...
(closes foodcoops#337)
Conflicts:
app/models/article.rb
2015-01-02 23:20:36 +01:00
wvengen
0e1cde9e2b
more extensive database seeds (in two languages) (closes foodcoops#277)
2014-09-29 17:26:27 +02:00
wvengen
8473f16091
query performance improvements
2014-09-02 12:58:32 +02:00
wvengen
647b7f0430
allow to synchronize all articles of a shared supplier
2014-09-02 12:58:31 +02:00
wvengen
3918e22214
synchronize price on two decimal places only
2014-09-02 12:58:31 +02:00
wvengen
a43020463d
normalize article and category attributes (closes foodcoops#294)
2014-06-23 17:51:19 +02:00
wvengen
7c2ecd8658
add some model api docs
2014-06-23 17:51:19 +02:00
wvengen
c25d4d3f4f
use ruby-units for unit parsing ( closes foodcoops/foodsoft#200 )
...
Conflicts:
Gemfile
Gemfile.lock
2014-05-13 17:01:25 +02:00
wvengen
7841245795
migrate to Rails 4.0 (closes foodcoops#214)
...
Conflicts:
Gemfile.lock
2014-02-24 12:46:28 +01:00
wvengen
2de4a2a3a0
Merge pull request #256 from wvengen/feature-partial_shared_sync
...
Small change to allow non-shared articles with shared suppliers
2014-02-07 11:24:33 +01:00
wvengen
4bfd7fa6f8
fix database sync when value is nil
2014-02-03 15:32:53 +01:00
wvengen
49e563af89
allow non-shared articles to be part of a shared supplier using a blank order number
2014-01-24 22:10:00 +01:00
wvengen
588898d7b0
do not error when calling shared_article on non-shared article
2013-11-13 23:20:48 +01:00
wvengen
c7f28a3b5c
use plain Ruby memoization to fix deprecation ( closes #121 )
2013-09-18 22:46:58 +02:00
Benjamin Meichsner
79d1c5a66d
Allow article price equal to zero. Closes #111
2013-04-10 10:51:36 +02:00
wvengen
75a1051668
finish articles i18n, controller+model
2013-03-22 00:59:42 +01:00
bennibu
28343fc124
Merge pull request #99 from balkansalat/rails3-fix-stock-ordering-2
...
Prevent sold-out articles from being removed from stock order when editing
2013-03-17 11:50:56 -07:00
Benjamin Meichsner
59de2e42a9
Fixed showing deleted articles when asking for available articles.
2013-03-17 18:36:34 +01:00
Benjamin Meichsner
07581b7ecf
Removed acts_as_paranoid. Implemented own version.
2013-03-16 17:57:38 +01:00
Julius
6aa0e0b736
Rename and comment new functions for fixing stock ordering
2013-03-15 08:50:55 +01:00
Julius
8d0761a6c8
Merge branch 'rails3-fix-stock-ordering' into rails3-fix-stock-ordering-2
2013-03-14 21:14:42 +01:00
Benjamin Meichsner
c18fb20115
Ensure to get also deleted entries in belongs_to assoc.
2013-03-10 19:39:59 +01:00
Robert Waltemath
63d8a3a1a6
Do not exclude ordered articles (with zero quantity) when editing orders.
2013-03-07 20:43:02 +01:00
benni
fc1c173718
Fixed articles module.
2012-10-28 18:03:50 +01:00
benni
ec2e761e7f
Fixed multi coop routing and changed config accessors.
2012-08-24 19:52:38 +02:00
benni
4a8e286d98
Fixed encoding issues with ruby > 1.9.2..
2012-04-16 08:49:54 +02:00
benni
5bf6503a8f
Included new localize_input gem.
2011-05-20 00:19:58 +02:00
benni
eab16e337e
Updated router. Temporarly replaced routing filter with rails internal.
2011-05-11 12:27:58 +02:00
Benjamin Meichsner
42d85c63be
Allow to have equal article and stockarticle.
...
* Modified validation to allow the same name.
2009-10-12 14:42:31 +02:00
Benjamin Meichsner
e75a42d509
Merge branch 'wiki'
2009-08-15 17:24:08 +02:00
Benjamin Meichsner
5e1fc73c29
Avoid creating of duplicate articles. (Tests on article.name) Closes #10
2009-08-12 12:33:07 +02:00
Benjamin Meichsner
d848831fea
Implemented stats for ordergroups on startpage. Annotated models.
2009-08-01 13:41:22 +02:00
Benjamin Meichsner
709425855e
Added validation for unit_quantity and localization for article attributes.
2009-07-21 15:09:55 +02:00
Benjamin Meichsner
8b8a7c08cd
Fixed bug in ArticlePrice history. Closes #12
2009-05-13 12:52:35 +02:00
Benjamin Meichsner
ffc3adf907
Second (last) part of multiple foodcoop installation.
...
* When before_filter select_foodcoop is activated,
the database and configs will be loaded on each request.
* Replaced APP_CONFIG with new Foodsoft.config method.
2009-03-24 17:25:33 +01:00
Benjamin Meichsner
951d19db6a
Introduced StockTaking. TODO: Dry up the stockit/stock_takings/deliveries controllers/views!
2009-02-12 18:32:20 +01:00
Benjamin Meichsner
325d47b22f
Changed behaviour of acts_as_paraniod. Finder wrapper removed an replaced by simple named_scope 'without_deleted'.
2009-02-11 15:23:59 +01:00