bernhardbln / opensourcecashregister Goto Github PK
View Code? Open in Web Editor NEWAn open source cash register written in Java
An open source cash register written in Java
== Current state ==
Currently, an entity bean of type AbstractPersistentObjectWithContinuance does not check the consistency of its history.
== Definition of Consistency ==
The natural key consists of the validFrom date (which is immutable) and one or several attributes of the actual bean. Those attributes (let's call them "natural object key") are as well expected to be immutable.
A consistent history would be like this:
|| '''natural object key''' || '''validFrom''' || '''validTo''' ||
|| '''object1''' || null || 01.05.2010 ||
|| object1 || 02.05.2010 || 01.09.2010 ||
|| object1 || 05.10.2010 || null ||
|| '''object2''' || 01.01.2010 || 01.09.2011 ||
|| object2 || 05.10.2011 || null ||
An inconsistent history would be like that:
|| object1 || 01.01.2010 || 01.12.2010 ||
|| object1 || 01.05.2010 || 01.09.2010 ||
|| object1 || null || 01.05.2010 ||
|| object1 || null || 01.09.2010 ||
|| object1 || 01.05.2010 || null ||
|| object1 || 01.09.2010 || null ||
== What is to be done? ==
The following rules need to be checked by the entity bean or directly by the database. With "the same object" we mean "having the same natural object key", not considering the validFrom date.
Income, spendings, money lost, VAT, ...
'''-> Split into sub tasks!'''
At the beginning, the cash register will be loaded with a certain amount of change.
Every then and now, one of the following things will happen:
There should be a functionality which shows how much money is in the register, and how this splits into change money (not containing VAT) and income (containing different VAT). Further more, there should be a functionality to load/unload change and to take out income in order to bring it to the bank.
The history should look like this:
{{{
Init - put 100 EUR of change into the drawer
(selling 10 espressi for (total) 10,70 EUR, including 7% vat, and 10 cappuccini for 23,80 EUR, incl. 19% vat)
Check - in the drawer we have:
In order to avoid confusion, we only allow those options:
Now we take out 23,80 EUR (20 EUR + 3,80 EUR VAT) and add 50 EUR of change.
Check - in the drawer we have:
(We sell another 10 espressi for 10,70 EUR and another 10 cappuccini for 23,80 EUR, with same vat as above)
Check - in the drawer we have:
}}}
This can be achieved by keeping booking records for each bill and each cash load/unload. The current amount of money in the drawer would be equal to {{{select sum(grossAmount) from bookings where bookingArchived=false}}}.
At the end of the year, one probably wants to archive all booking records from that year and create a single transfer record "sum of all records of year xxxx".
The money in the drawer might be counted every evening after the shop gets closed, and in case money gets lost or additional money appears, there should be a way to register that. It should be booked as "lost money" / "extra money", together with the current user, but it should be booked against the change money, as the tax office is not going to give up claims on the vat just because someone dropped a coin somewhere.
Save a password in the db which is used to zip, encrypt and export the database into the file system (for example into a dropbox folder)
Open the cash register as a user, enter current amount of change in the register.
Close the cash register - enter current amount.
Display receipt: opening amount, closing amount, income, spendings, money taken out and brought to bank, expected closing amount, missing amount.
In Bill and AbstractSalesItem, there is a reference to a taxInfo.
Check which Hibernate cascade types are actually needed and make sense.
-> UTF8-issue in mysql?
See DataStorageTest or MoneyFormatterTest. Maybe the formatter shouldn't be in the money class as well?
Currently uses Locale to determine currency.
Better make this a setting that is saved in the DB and can be changed by the user.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.