diff --git a/dist/pos.apk b/dist/pos.apk index 3a3a458..ecb1edb 100644 Binary files a/dist/pos.apk and b/dist/pos.apk differ diff --git a/src/com/refresh/pos/domain/DateTimeStrategy.java b/src/com/refresh/pos/domain/DateTimeStrategy.java index d55c321..f052a76 100644 --- a/src/com/refresh/pos/domain/DateTimeStrategy.java +++ b/src/com/refresh/pos/domain/DateTimeStrategy.java @@ -4,6 +4,12 @@ import java.util.Calendar; import java.util.Locale; +/** + * A static class, global access for how to handle with date format. + * + * @author Refresh Team + * + */ public class DateTimeStrategy { private static Locale locale; diff --git a/src/com/refresh/pos/domain/LanguageController.java b/src/com/refresh/pos/domain/LanguageController.java index e00c978..996db52 100644 --- a/src/com/refresh/pos/domain/LanguageController.java +++ b/src/com/refresh/pos/domain/LanguageController.java @@ -7,6 +7,12 @@ import com.refresh.pos.techicalservices.Database; import com.refresh.pos.techicalservices.DatabaseContents; +/** + * Saves and loads language preference from database. + * + * @author Refresh Team + * + */ public class LanguageController { private static final String DEFAULT_LANGUAGE = "en"; diff --git a/src/com/refresh/pos/domain/inventory/Inventory.java b/src/com/refresh/pos/domain/inventory/Inventory.java index 8fed990..68d45b8 100644 --- a/src/com/refresh/pos/domain/inventory/Inventory.java +++ b/src/com/refresh/pos/domain/inventory/Inventory.java @@ -5,6 +5,7 @@ /** * This class is service locater for Product Catalog and Stock. + * * @author Refresh Team * */ diff --git a/src/com/refresh/pos/domain/inventory/LineItem.java b/src/com/refresh/pos/domain/inventory/LineItem.java index bff51f0..327d642 100644 --- a/src/com/refresh/pos/domain/inventory/LineItem.java +++ b/src/com/refresh/pos/domain/inventory/LineItem.java @@ -5,6 +5,7 @@ /** * LineItem of Sale. + * * @author Refresh Team * */ diff --git a/src/com/refresh/pos/domain/inventory/Product.java b/src/com/refresh/pos/domain/inventory/Product.java index 545fd23..941dd63 100644 --- a/src/com/refresh/pos/domain/inventory/Product.java +++ b/src/com/refresh/pos/domain/inventory/Product.java @@ -5,6 +5,7 @@ /** * Product or item represents the real product in store. + * * @author Refresh Team * */ diff --git a/src/com/refresh/pos/domain/inventory/ProductCatalog.java b/src/com/refresh/pos/domain/inventory/ProductCatalog.java index a3e37bf..2657099 100644 --- a/src/com/refresh/pos/domain/inventory/ProductCatalog.java +++ b/src/com/refresh/pos/domain/inventory/ProductCatalog.java @@ -4,6 +4,12 @@ import com.refresh.pos.techicalservices.inventory.InventoryDao; +/** + * Book that keeps list of Product. + * + * @author Refresh Team + * + */ public class ProductCatalog { private InventoryDao inventoryDao; diff --git a/src/com/refresh/pos/domain/inventory/ProductLot.java b/src/com/refresh/pos/domain/inventory/ProductLot.java index 203dedc..09cd88b 100644 --- a/src/com/refresh/pos/domain/inventory/ProductLot.java +++ b/src/com/refresh/pos/domain/inventory/ProductLot.java @@ -7,6 +7,7 @@ /** * Lot or bunch of product that import to inventory. + * * @author Refresh Team * */ diff --git a/src/com/refresh/pos/domain/inventory/Stock.java b/src/com/refresh/pos/domain/inventory/Stock.java index a0524ba..927f757 100644 --- a/src/com/refresh/pos/domain/inventory/Stock.java +++ b/src/com/refresh/pos/domain/inventory/Stock.java @@ -4,6 +4,12 @@ import com.refresh.pos.techicalservices.inventory.InventoryDao; +/** + * Import log of ProductLot come in to store. + * + * @author Refresh Team + * + */ public class Stock { private InventoryDao inventoryDao; diff --git a/src/com/refresh/pos/domain/sale/Register.java b/src/com/refresh/pos/domain/sale/Register.java index e93ef23..c611143 100644 --- a/src/com/refresh/pos/domain/sale/Register.java +++ b/src/com/refresh/pos/domain/sale/Register.java @@ -8,6 +8,12 @@ import com.refresh.pos.techicalservices.NoDaoSetException; import com.refresh.pos.techicalservices.sale.SaleDao; +/** + * Handles all Sale processes. + * + * @author Refresh Team + * + */ public class Register { private static Register instance = null; private static SaleDao saleDao = null; diff --git a/src/com/refresh/pos/domain/sale/Sale.java b/src/com/refresh/pos/domain/sale/Sale.java index 6314b99..697d2a0 100644 --- a/src/com/refresh/pos/domain/sale/Sale.java +++ b/src/com/refresh/pos/domain/sale/Sale.java @@ -8,7 +8,12 @@ import com.refresh.pos.domain.inventory.LineItem; import com.refresh.pos.domain.inventory.Product; - +/** + * Sale represents sale operation. + * + * @author Refresh Team + * + */ public class Sale { private final int id; diff --git a/src/com/refresh/pos/domain/sale/SaleLedger.java b/src/com/refresh/pos/domain/sale/SaleLedger.java index 78053f7..f4e0164 100644 --- a/src/com/refresh/pos/domain/sale/SaleLedger.java +++ b/src/com/refresh/pos/domain/sale/SaleLedger.java @@ -6,6 +6,12 @@ import com.refresh.pos.techicalservices.NoDaoSetException; import com.refresh.pos.techicalservices.sale.SaleDao; +/** + * Book that keeps sale record. + * + * @author Refresh Team + * + */ public class SaleLedger { private static SaleLedger instance = null; diff --git a/src/com/refresh/pos/techicalservices/AndroidDatabase.java b/src/com/refresh/pos/techicalservices/AndroidDatabase.java index 24b1695..2064f51 100644 --- a/src/com/refresh/pos/techicalservices/AndroidDatabase.java +++ b/src/com/refresh/pos/techicalservices/AndroidDatabase.java @@ -10,6 +10,13 @@ import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; +/** + * Real database connector, provides all CRUD operation. + * database tables are created here. + * + * @author Refresh Team + * + */ public class AndroidDatabase extends SQLiteOpenHelper implements Database { private static final int DATABASE_VERSION = 1; diff --git a/src/com/refresh/pos/techicalservices/Database.java b/src/com/refresh/pos/techicalservices/Database.java index 87989f7..71981bd 100644 --- a/src/com/refresh/pos/techicalservices/Database.java +++ b/src/com/refresh/pos/techicalservices/Database.java @@ -2,6 +2,12 @@ import java.util.List; +/** + * Interface of CRUD operation. + * + * @author Refresh Team + * + */ public interface Database { public List select(String queryString); public int insert(String tableName, Object content); diff --git a/src/com/refresh/pos/techicalservices/DatabaseContents.java b/src/com/refresh/pos/techicalservices/DatabaseContents.java index d1e0fc1..52a0d47 100644 --- a/src/com/refresh/pos/techicalservices/DatabaseContents.java +++ b/src/com/refresh/pos/techicalservices/DatabaseContents.java @@ -1,5 +1,11 @@ package com.refresh.pos.techicalservices; +/** + * Enum for name of tables in database. + * + * @author Refresh Team + * + */ public enum DatabaseContents { DATABASE("com.refresh.db1"), diff --git a/src/com/refresh/pos/techicalservices/DatabaseExecutor.java b/src/com/refresh/pos/techicalservices/DatabaseExecutor.java index 2930eef..f194db2 100644 --- a/src/com/refresh/pos/techicalservices/DatabaseExecutor.java +++ b/src/com/refresh/pos/techicalservices/DatabaseExecutor.java @@ -1,5 +1,11 @@ package com.refresh.pos.techicalservices; +/** + * Uses to directly access to database. + * + * @author Refresh Team + * + */ public class DatabaseExecutor { private static Database database; diff --git a/src/com/refresh/pos/techicalservices/Demo.java b/src/com/refresh/pos/techicalservices/Demo.java index d8d06e4..cd00524 100644 --- a/src/com/refresh/pos/techicalservices/Demo.java +++ b/src/com/refresh/pos/techicalservices/Demo.java @@ -11,6 +11,12 @@ import com.refresh.pos.domain.inventory.Inventory; import com.refresh.pos.domain.inventory.ProductCatalog; +/** + * Reads a demo products from CSV in res/raw/ + * + * @author Refresh Team + * + */ public class Demo { public static void testProduct(Context context) { diff --git a/src/com/refresh/pos/techicalservices/NoDaoSetException.java b/src/com/refresh/pos/techicalservices/NoDaoSetException.java index 9750f0e..b77438a 100644 --- a/src/com/refresh/pos/techicalservices/NoDaoSetException.java +++ b/src/com/refresh/pos/techicalservices/NoDaoSetException.java @@ -1,5 +1,11 @@ package com.refresh.pos.techicalservices; +/** + * Exception of when trying to getInstance() without inject its DAO. + * + * @author Refresh Team + * + */ public class NoDaoSetException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/com/refresh/pos/techicalservices/inventory/InventoryDao.java b/src/com/refresh/pos/techicalservices/inventory/InventoryDao.java index 46f83ea..cc98e7b 100644 --- a/src/com/refresh/pos/techicalservices/inventory/InventoryDao.java +++ b/src/com/refresh/pos/techicalservices/inventory/InventoryDao.java @@ -5,6 +5,12 @@ import com.refresh.pos.domain.inventory.Product; import com.refresh.pos.domain.inventory.ProductLot; +/** + * DAO for Inventory. + * + * @author Refresh Team + * + */ public interface InventoryDao { int addProduct(Product product); diff --git a/src/com/refresh/pos/techicalservices/inventory/InventoryDaoAndroid.java b/src/com/refresh/pos/techicalservices/inventory/InventoryDaoAndroid.java index 64c268a..06075e2 100644 --- a/src/com/refresh/pos/techicalservices/inventory/InventoryDaoAndroid.java +++ b/src/com/refresh/pos/techicalservices/inventory/InventoryDaoAndroid.java @@ -11,6 +11,12 @@ import com.refresh.pos.techicalservices.Database; import com.refresh.pos.techicalservices.DatabaseContents; +/** + * DAO used by android for Inventory. + * + * @author Refresh Team + * + */ public class InventoryDaoAndroid implements InventoryDao { private Database database; diff --git a/src/com/refresh/pos/techicalservices/sale/SaleDao.java b/src/com/refresh/pos/techicalservices/sale/SaleDao.java index 83c054e..4a082d7 100644 --- a/src/com/refresh/pos/techicalservices/sale/SaleDao.java +++ b/src/com/refresh/pos/techicalservices/sale/SaleDao.java @@ -6,6 +6,12 @@ import com.refresh.pos.domain.inventory.LineItem; import com.refresh.pos.domain.sale.Sale; +/** + * DAO for Sale process. + * + * @author Refresh Team + * + */ public interface SaleDao { Sale initiateSale(String startTime); diff --git a/src/com/refresh/pos/techicalservices/sale/SaleDaoAndroid.java b/src/com/refresh/pos/techicalservices/sale/SaleDaoAndroid.java index 3139905..eddaf6a 100644 --- a/src/com/refresh/pos/techicalservices/sale/SaleDaoAndroid.java +++ b/src/com/refresh/pos/techicalservices/sale/SaleDaoAndroid.java @@ -15,7 +15,12 @@ import com.refresh.pos.techicalservices.DatabaseContents; - +/** + * DAO used by android for Sale process. + * + * @author Refresh Team + * + */ public class SaleDaoAndroid implements SaleDao { Database database; diff --git a/src/com/refresh/pos/ui/MainActivity.java b/src/com/refresh/pos/ui/MainActivity.java index 204d450..b1d793d 100644 --- a/src/com/refresh/pos/ui/MainActivity.java +++ b/src/com/refresh/pos/ui/MainActivity.java @@ -39,6 +39,13 @@ import com.refresh.pos.ui.sale.ReportFragment; import com.refresh.pos.ui.sale.SaleFragment; +/** + * This UI loads 3 main pages (Inventory, Sale, Report) + * Makes the UI flow by slide through pages using ViewPager. + * + * @author Refresh Team + * + */ @SuppressLint("NewApi") public class MainActivity extends FragmentActivity { diff --git a/src/com/refresh/pos/ui/SplashScreenActivity.java b/src/com/refresh/pos/ui/SplashScreenActivity.java index e4836d1..7fbb147 100644 --- a/src/com/refresh/pos/ui/SplashScreenActivity.java +++ b/src/com/refresh/pos/ui/SplashScreenActivity.java @@ -29,7 +29,7 @@ /** * This is the first activity page, core-app and database created here. - * Dependency injection happen here. + * Dependency injection happens here. * * @author Refresh Team * diff --git a/src/com/refresh/pos/ui/component/ButtonAdapter.java b/src/com/refresh/pos/ui/component/ButtonAdapter.java index 5f23d76..3474680 100755 --- a/src/com/refresh/pos/ui/component/ButtonAdapter.java +++ b/src/com/refresh/pos/ui/component/ButtonAdapter.java @@ -8,6 +8,12 @@ import android.view.ViewGroup; import android.widget.SimpleAdapter; +/** + * An adapter for ListView which able to assign a sub-button in each row data. + * + * @author Refresh Team + * + */ public class ButtonAdapter extends SimpleAdapter { private List> data; diff --git a/src/com/refresh/pos/ui/component/UpdatableFragment.java b/src/com/refresh/pos/ui/component/UpdatableFragment.java index 504e016..3bd283b 100644 --- a/src/com/refresh/pos/ui/component/UpdatableFragment.java +++ b/src/com/refresh/pos/ui/component/UpdatableFragment.java @@ -2,6 +2,13 @@ import android.support.v4.app.Fragment; +/** + * Fragment which is able to call update() from other class. + * This is used by Delegation pattern. + * + * @author Refresh Team + * + */ public abstract class UpdatableFragment extends Fragment { public abstract void update(); diff --git a/src/com/refresh/pos/ui/inventory/AddProductDialogFragment.java b/src/com/refresh/pos/ui/inventory/AddProductDialogFragment.java index 6989d10..e36e62c 100644 --- a/src/com/refresh/pos/ui/inventory/AddProductDialogFragment.java +++ b/src/com/refresh/pos/ui/inventory/AddProductDialogFragment.java @@ -21,6 +21,12 @@ import com.refresh.pos.techicalservices.NoDaoSetException; import com.refresh.pos.ui.component.UpdatableFragment; +/** + * A dialog of adding a Product. + * + * @author Refresh Team + * + */ @SuppressLint("ValidFragment") public class AddProductDialogFragment extends DialogFragment { diff --git a/src/com/refresh/pos/ui/inventory/InventoryFragment.java b/src/com/refresh/pos/ui/inventory/InventoryFragment.java index 8e447b2..d4674df 100644 --- a/src/com/refresh/pos/ui/inventory/InventoryFragment.java +++ b/src/com/refresh/pos/ui/inventory/InventoryFragment.java @@ -37,6 +37,13 @@ import com.refresh.pos.ui.component.ButtonAdapter; import com.refresh.pos.ui.component.UpdatableFragment; +/** + * UI for Inventory, shows list of Product in the ProductCatalog. + * Also use for a sale process of adding Product into sale. + * + * @author Refresh Team + * + */ @SuppressLint("ValidFragment") public class InventoryFragment extends UpdatableFragment { diff --git a/src/com/refresh/pos/ui/inventory/ProductDetailActivity.java b/src/com/refresh/pos/ui/inventory/ProductDetailActivity.java index fc80771..7ac3df7 100644 --- a/src/com/refresh/pos/ui/inventory/ProductDetailActivity.java +++ b/src/com/refresh/pos/ui/inventory/ProductDetailActivity.java @@ -36,6 +36,11 @@ import com.refresh.pos.domain.inventory.Stock; import com.refresh.pos.techicalservices.NoDaoSetException; +/** + * UI for shows the datails of each Product. + * @author Refresh Team + * + */ @SuppressLint("NewApi") public class ProductDetailActivity extends Activity { diff --git a/src/com/refresh/pos/ui/sale/EditFragmentDialog.java b/src/com/refresh/pos/ui/sale/EditFragmentDialog.java index 290471c..f18f993 100644 --- a/src/com/refresh/pos/ui/sale/EditFragmentDialog.java +++ b/src/com/refresh/pos/ui/sale/EditFragmentDialog.java @@ -17,6 +17,12 @@ import com.refresh.pos.techicalservices.NoDaoSetException; import com.refresh.pos.ui.component.UpdatableFragment; +/** + * A dialog for edit a LineItem of sale, + * overriding price or set the quantity. + * @author Refresh Team + * + */ @SuppressLint("ValidFragment") public class EditFragmentDialog extends DialogFragment { private Register register; diff --git a/src/com/refresh/pos/ui/sale/EndPaymentFragmentDialog.java b/src/com/refresh/pos/ui/sale/EndPaymentFragmentDialog.java index 4cb55d4..e60c167 100644 --- a/src/com/refresh/pos/ui/sale/EndPaymentFragmentDialog.java +++ b/src/com/refresh/pos/ui/sale/EndPaymentFragmentDialog.java @@ -15,6 +15,11 @@ import com.refresh.pos.techicalservices.NoDaoSetException; import com.refresh.pos.ui.component.UpdatableFragment; +/** + * A dialog shows the total change and confirmation for Sale. + * @author Refresh Team + * + */ @SuppressLint("ValidFragment") public class EndPaymentFragmentDialog extends DialogFragment { diff --git a/src/com/refresh/pos/ui/sale/PaymentFragmentDialog.java b/src/com/refresh/pos/ui/sale/PaymentFragmentDialog.java index 285f6fb..a63d7c5 100644 --- a/src/com/refresh/pos/ui/sale/PaymentFragmentDialog.java +++ b/src/com/refresh/pos/ui/sale/PaymentFragmentDialog.java @@ -14,6 +14,11 @@ import android.widget.TextView; import android.widget.Toast; +/** + * A dialog for input a money for sale. + * @author Refresh Team + * + */ @SuppressLint("ValidFragment") public class PaymentFragmentDialog extends DialogFragment { diff --git a/src/com/refresh/pos/ui/sale/ReportFragment.java b/src/com/refresh/pos/ui/sale/ReportFragment.java index a599767..f59ce2c 100644 --- a/src/com/refresh/pos/ui/sale/ReportFragment.java +++ b/src/com/refresh/pos/ui/sale/ReportFragment.java @@ -30,7 +30,11 @@ import com.refresh.pos.techicalservices.NoDaoSetException; import com.refresh.pos.ui.component.UpdatableFragment; - +/** + * UI for showing sale's record. + * @author Refresh Team + * + */ public class ReportFragment extends UpdatableFragment { private SaleLedger saleLedger; diff --git a/src/com/refresh/pos/ui/sale/SaleDetailActivity.java b/src/com/refresh/pos/ui/sale/SaleDetailActivity.java index 55c087e..145c4f8 100644 --- a/src/com/refresh/pos/ui/sale/SaleDetailActivity.java +++ b/src/com/refresh/pos/ui/sale/SaleDetailActivity.java @@ -22,6 +22,11 @@ import com.refresh.pos.domain.sale.SaleLedger; import com.refresh.pos.techicalservices.NoDaoSetException; +/** + * UI for showing the detail of Sale in the record. + * @author Refresh Team + * + */ public class SaleDetailActivity extends Activity{ private TextView totalBox; diff --git a/src/com/refresh/pos/ui/sale/SaleFragment.java b/src/com/refresh/pos/ui/sale/SaleFragment.java index 9568ce7..3271172 100644 --- a/src/com/refresh/pos/ui/sale/SaleFragment.java +++ b/src/com/refresh/pos/ui/sale/SaleFragment.java @@ -29,6 +29,11 @@ import com.refresh.pos.ui.MainActivity; import com.refresh.pos.ui.component.UpdatableFragment; +/** + * UI for Sale operation. + * @author Refresh Team + * + */ @SuppressLint("ValidFragment") public class SaleFragment extends UpdatableFragment {