CORE-POS / IS4C

Cooperative Operational Retail Environment
http://www.core-pos.com
GNU General Public License v2.0
64 stars 44 forks source link

Sales by PLU/UPC restriction #42

Closed pierced closed 12 years ago

pierced commented 12 years ago

Harvest cannot sell alcohol on Sundays before noon and on holidays. We need to be able to restrict the sale of certain items at the PLU/UPC level for calendar date and time.

gohanman commented 12 years ago

Proposed fix: 2ba7f8ba152d98e251d06b5b3ec5fbead4842e14

This adds a new table called dateRestrict. Restrictions can be specified by UPC or department #. Restrictions can also be specified by a specific date (e.g., holiday) or by weekday (1=Sunday, 7=Saturday). The time fields are optional. If they're filled in, the restriction applies during that period. If they're NULL, the restriction applies all day.

For the moment, I'm only checking date restrictions on items that have idEnforced set. Extra lookups on every ring aren't ideal from a performance standpoint.

joelbrock commented 12 years ago

Nicely done! @DonaldGonzalez @pierced I've merged and applied this patch to the testlane. I've populated the dateRestrict table w/ 1 row for now to test. You can test any Wines, today, btwn 12pm and 4pm to see the date restriction in action.

Once it's fully tested i'll merge into lane05 w/ live data. (e.g. No booze sales on sundays b4 noon)

DonaldGonzalez commented 12 years ago

Tested on the test lane and verified that it worked!

I get the message "product cannot be sold right now"

We might want to change that message. What do you think @pierced @dhermann-harvest ?

Also, one more request. From now on can the messages that appear in the messages boxes be capitalized correctly?

It's a minor issue but it just seems more formal.

Thanks @gohanman @joelbrock !

gohanman commented 12 years ago

I just threw something in there as a place holder. We can change the wording however.

Capitalization is a more involved fix just because there's lots of message strings to revise, but it should be possible.

joelbrock commented 12 years ago

added the dateRestrict tbl to replication. updated lane05 with new code.