Coder Social home page Coder Social logo

masterzydra / bio-manager Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 16.51 MB

A web-based ERP system specifically adapted to the needs of managing certified organic land.

License: MIT License

PHP 99.92% CSS 0.06% JavaScript 0.01% Dockerfile 0.01% Hack 0.01%
recipients suppliers delivery invoice erp erp-application

bio-manager's Introduction

bio-manager's People

Contributors

masterzydra avatar

bio-manager's Issues

Prevent delete and edit operations of used entries

Supplier, etc. can be deleted even if they are assigned to a delivery note, etc.
This should not be possible.

=> Add a check if "object" is used.

Idea: BaseModel calls function "allow[Delete|Edit]" if it is implemented. In this function the checks can be implemented for each entity.

  • Implement logic in base model to call "allow" function and prevent action if return value is false
  • Implement "allow" functions
    • Delivery note
    • Plot
    • Invoice
    • Product
    • Price
    • Supplier
    • Recipient
  • Add message box if entity cannot be edited based on "allowEdit" e.g. for invoice, delivery note

Add support for SQLite

Support SQLite as DB driver

SQLite syntax for creating tables differs from MySQL/MariaDB.

Tasks:

  • Creating tables (#61)
  • Add ResultInterface
  • Add wrapper for SQLite3 PHP class
  • Allow chaining for CreateTableBlueprint functions
  • Rewrite migrations with CreateTableBlueprint
  • Change make:migration command to use CreateTableBlueprint
  • Test all views with production data
  • Update documentation

Use Gateway design pattern to encapsulate database queries

Class to get all fields and methods like findById, ...

find (id) : RecordSet
findWithLastName(String) : RecordSet
update (id, lastname, firstname, numberOfDependents)
insert (lastname, firstname, numberOfDependents)
delete (id)


Add wrapper around the database module, so that the forms themselves do only use the objects e.g. supplier, invoice, delivery note ...
These classes contain the logic to select, update, insert or delete entries.
The classes handle the SQL queries (prepared statements) and additional permission handling.


Permission layer / component:
Idea is to create a component or layer that handles all permissions. So a central configuration for permissions is required.
This component could be made configurable via a form, so every admin can configure permissions as required.
This component has to contain a list of areas (invoice, delivery note, ...) with a set of operations (add, edit, delete, view, ...) for each permission group (admin, maintainer, auditor, ...).
Idea:

  • Form to create groups and manage the users in that group.
  • In the permission configurator each group gets areas with permissions assigned.
  • A user can be in multiple groups.
  • The default for a new group is the denial of all areas. If the requirement is that every user can see the delivery notes, a default group with that permission needs to be created and every user added to it.

Directory structure:

modules/
   dataObjects/
      deliveryNote.php
      supplier.php
      product.php
      ...

Abstract class / interface DataObject
All classes are inherited from this. -> The RecordSet (Array) can contain this objects and can be used for all of them.

Revise and extend doc

Add more details about:

  • the application code
  • the framework
  • the installation of the system
  • How to run the docker image

UI Update

  • Icons: Instead of using text e.g. "edit" an pen icon could be used.
  • Better way than boxes?

Version 2 - Router, Namespaces and new directory structure

Router example: https://steampixel.de/einfaches-und-elegantes-url-routing-mit-php/

Do a complete rebuild with a Laravel like architecture

The framework is fundamentally working. Now all previous logic must be rewritten:

  • Readd entities (plot, supplier, etc.)
  • PDF generation
    • wrapper for TCPDF
      • Uncaught error no. 2 in /var/www/html/ext/TCPDF/tcpdf_autoconfig.php:96 - Message file_exists(): open_basedir restriction in effect. File(/usr/share/doc/php-tcpdf/examples/images/) is not within the allowed path(s): (/var/www/html:/dev/stdout:/tmp)
    • Invoice
      • Add link to index table
      • Use currencyUnit setting
    • Active suppliers
    • Supplier payouts
    • Volume distribution
  • Missing forms:
    • Edit imprint settings
    • Edit invoice settings
  • Show massUnit in delivery note form
  • Permission checks

With release of v2.0.0:

  • Remove branch "refactor"

Formatting table content

Show booleans as "Yes"/"No" instead of 1/0. Align number right in cell.

  • Add logic to table generator function

Fix files using new logic:

  • deliveryNote.php
  • evalDeliveryNote_OpenVolumeDistribution.php
  • overviewForm.php
  • pricing.php
  • showMyDeliveryNote.php

After that

  • Delete formatTableCellRight.js

Unique entries

Check if entry is unique before adding it to table.

  • user
  • supplier
  • setting
  • product
  • pricing
  • plot
  • invoice (not necessary)
  • deliveryNote (not necessary)

Use namespaces

Namespaces are used only inside the system folder for now.
The classes in the Module folder need to be moved to the system folder.

Add function to remove leading spaces on the beginning of each line

Function name: removeLeadingLineSpaces
Useful e.g. PDF rendering so that the HTML and PHP can contain indentations without influencing the rendered result

Changes in render method required:
After getting the rendered HTML, pass it to "removeLeadingLineSpaces" and return result

Schema builder for migrations

This schema builder class should make support for other DB systems easier.

The class generates the SQL depending on the current database connection configuration.

Syntax:

$table = new CreateTableBlueprint();
$table->id();
$table->string('name', 255);
$table->build(); // Return SQL

Fix PSR12 errors and warnings

  • Class name "..." is not in PascalCase format
  • Visibility must be declared on method "..."
  • Visibility must be declared on method "__construct"
  • Line exceeds 120 characters
  • Parenthesis placement

Simplify user creation on installation

V1: If no user exists in the database, link a form to create a user (see init DB Connection).

V2: First user should be created by a seeder in the migration after creating the user table

Small improvements for version 2

v2.0.1

  • Address output in recipients table: Use comma as separator between street and postal code
  • Date output in tables: Format with new format function Format::date() to "dd.mm.yyyy"
  • Volume distribution: Only show plots in plotSelect, that belong to the supplier of the delivery note
  • Translation method "__()": add optional args for placeholders. Basicly add "sprintf" if optional args are passed

Use secure string function to prevent XSS and HTML special characters

  • about.php
  • addDeliveryNote.php
  • addInvoice.php
  • addPlot.php
  • addPricing.php
  • addProduct.php
  • addRecipient.php
  • addSetting.php
  • addSupplier.php
  • addUser.php
  • changePwd.php
  • changeUserPwd.php
  • deleteDeliveryNote.php
  • deleteInvoice.php
  • deletePlot.php
  • deletePricing.php
  • deleteProduct.php
  • deleteRecipient.php
  • deleteSetting.php
  • deleteSupplier.php
  • deleteUser.php
  • deliveryNote.php
  • developerOptions.php
  • editCropVolumeDistribution.php
  • editDeliveryNote.php
  • editImpressum.php
  • editInvoice.php
  • editInvoiceData.php
  • editPlot.php
  • editPricing.php
  • editProduct.php
  • editRecipient.php
  • editSetting.php
  • editSupplier.php
  • editUser.php
  • evalDeliveryNote_OpenVolumeDistribution.php
  • impressum.php
  • index.php
  • invoice.php
  • login.php
  • logout.php
  • plot.php
  • pricing.php
  • product.php
  • recipient.php
  • setting.php
  • showInvoice.php
  • showMyDeliveryNote.php
  • supplier.php
  • user.php

./install:

  • addAdminUser.php

./modules:

  • Mysql.php
  • Mysql_BioManager.php
  • Mysql_preparedStatement.php
  • Mysql_preparedStatement_BioManager.php
  • cache.php
  • dataTable.php
  • dataTable_BioManager.php
  • footer.php
  • formHelper.php
  • header.php
  • header_everyone.php
  • header_user.php
  • invoice.php
  • permissionCheck.php
  • selectBox.php
  • selectBox_BioManager.php
  • stringSecurityHelper.php
  • tableGenerator.php

./templates:

  • deleteForm.php
  • form.php
  • overviewForm.php

Default sort order

Add property of type array that can be used to define the default sort order.
So that the table views, selects, ... are sorted that way.

  • Extend BaseModel to support default sort orders
    If not other order is given via QueryBuilder, use default.
  • Add default order to entities
    • DeliveryNote: year DESC, nr DESC
    • Invoice: year DESC, nr DESC
    • Plot: nr ASC
    • Price
    • Product
    • Recipient
    • Setting: name ASC
    • Supplier: name ASC
    • User: username ASC
    • VolumeDistribution
  • Remove "custom" sort orders from tables views, selects, ...

Wiki in Doc folder

Move Wiki content into a doc folder so that it is directly in the source code

Add activity log

Add logging of user activities in file (one file per day).
After a defined time the old log files will be deleted.

Content of an entry:

  • Time stamp
  • Username
  • Module (Plot, Invoice, ...)
  • Action (Edit, Add, Delete, ...)

As administrator there is a block in the administrator area where the files are listed and can be viewed.

Unique entries when editing

Check if entry is unique before saving changes to table.

  • user
  • supplier
  • setting (not necessary)
  • product
  • pricing
  • plot
  • deliveryNote (not necessary)
  • invoice (With creation of edit page)

Replace all calls of table generation with new generator

Use new table generator in all pages to generate table.
The advantage is the expected simpler realization of an overview template.

  • deliveryNote.php
  • evalDeliveryNote_OpenVolumeDistribution.php
  • invoice.php
  • plot.php
  • pricing.php
  • product.php
  • recipient.php
  • setting.php
  • showMyDeliveryNote.php
  • supplier.php
  • user.php

/templates

  • overviewForm.php

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.