pointonsoftware / pscore

C++ library for building your business software
GNU Affero General Public License v3.0
1 stars 2 forks source link

Create accounting component #182

Open gbenziv opened 3 years ago

gbenziv commented 3 years ago

Refer to Product Requirement doc for more details

APIs:

entity::TransactionItem
 - SaleID
 - Transaction ID (associated with the sale)
 - Product ID  (deduct inventory)
 - product name  (name during transaction)
 - unit price  (price at the time of transaction)
 - quantity  (deduct inventory)
 - sale price (add product sales)

entity::Transaction (mirror the receipt)
- Transaction number
- Date and Time
- Employee ID
- vector<string> TransactionItemIds
- subtotal
- tax (see below computation)
- discount
- total
- amount paid
- payment type
- change
- customer ID

Tax computation:


Amount of sale (with VAT) | P1,120.00
-- | --
Less: 12% VAT             | 120.00
Total Amount              | 1,000.00
Less: 20% Sales Discount  | 200.00
Total Amount Due          | P800.00
gbenziv commented 3 years ago

Verify that the order of transaction items from POS and sales are the same.

e.g.

POS receipt:

Usb charger       | x2 |  10 |  20
Boneless Chicken  | x1 | 100 | 100
Generic Shampoo   | x1 |  20 | 20

Must be in the same order when retrieving sales:


Usb charger       | x2 |  10 |  20
Boneless Chicken  | x1 | 100 | 100
Generic Shampoo   | x1 |  20 | 20
gbenziv commented 3 years ago

Show product sales per timeline:

product | quantity | total sales

Show total sales per category


Total sales: xxxx
Category 1 | sales
Category 2 | sales
Category 3 | sales
gbenziv commented 3 years ago

provide API for:


struct GraphReport {
    std::string key;
    std::string value;
};

enum class Period {
    YESTERDAY,
    TODAY,
    THIS_WEEK,
    THIS_MONTH,
    THIS_YEAR
};

// Controller
std::vector<GraphReport> getCategorySales(); // x = category name, y = category sales this month
std::vector<GraphReport> getTodaySalesReport();  // Hourly interval
std::vector<Sale> getSales(Period period);
std::vector<Sale> getCustomPeriodSales(string startDate, string endDate);  // dates are inclusive
std::vector<SalesItem> getSaleDetails(std::string transactionID);

// Data
std::vector<Sale> getSales(string startDate, string endDate);  // dates are inclusive
std::vector<SalesItem> getSaleDetails(std::string transactionID);