Mini Business software w/o accounting functions - Jounal with issues and progress

fenixsz

New Member
Hey fellas,

I have one project with Fabrik behind - http://drivecalc.com/. Currently, I am trying to make mini ERP system :) for small business owners which have 1 or 2-3 mini shops :). It will be provided for free on my blog packaged with akeba backup and kickstart install. I am financial controller and I love the J 2.5 and Fabrik capabilities of giving control on any field on different user groups. Every operation will be approved by manager group. Most of small business owners use excel for the main part, which I hate a lot from my 7 year old extensive love-hate relationship! I will not give support on my project, but instead will point Fabrik and Joomla communities for any help owners might have.

Ok, so here is my current database structure:

- Inventory movement table - main table +&- move types
- Invoice table
- Order table for incoming products
- Write off products table
- Customer table
- Customer group table
- Products table
- Products group table
- Price list of products table
- Trade discounts table - discounts per customer group per product group :)

Currently I am testing the main obstacles, which I define in the beginning. From my point of view, invoices will be the hardest thing in the project.

Structure of Invoices:

Invoice Header - Invoice number and db join on customer with calc fields for customer details.

I think I will did it easy with calc elements like this one:

Code:
$db =& JFactory::getDBO();
$fieldid = $db->Quote('{table___field_id}');
$db->setQuery("SELECT field FROM table WHERE id = $fieldid");
$result = $db->loadResult();
return $result;
Invoice Body section with items: repeated joined group from inventory movement table

Here I think of doing it using repeated group with:
- db join on product
- field with quantities of products
- calc field which will extract main prices
- calc field which will extract main trade discounts based on product groups and customer group
- calc field from above 2 fields main price*(1-trade discounts)
- calc total - main price*(1-trade discounts)*quantities field

Currently I am stuck with that, because I should define in .js group numbers.

I am trying to use following code, which I found from another thread:

Code:
 var total = 0;
 $('group11').getElements('input[id^=join___12___tan_move_table___productid]').each(
   function(i){
    total += i.getValue().toInt();
   }
 );
I pit in in /components/com_fabrik/js/11.js and it load it, but I am making something wrong.


Invoice Footer

Another challenge will be to sum Totals here
- calc field with totals from repeated groups
- VAT checkbox
- Calc VAT field wich will use if element on VAT checkbox
- calc field with total + VAT



Thanks for reading, I will be glad for any help and recommendations.
 
This article should be deserving and put it on the wiki.
I learned how to use a table join and calculate the it's child table.
thank you :):):)
 
Hi

Whilst not actually answering your question directly I have a package that does something similar.

You should be able to install it via Joomla's component installer, and then in Fabrik's admin you should be able to toggle between your existing lists/forms etc and that of the packages.

This is all pretty much work in progress so I suggest installing on a test site.
 

Attachments

  • pkg_invoice_0.1.zip
    203.1 KB · Views: 511
Hi rob,

I had update my install from latest github.

From your package. I first I have error with invoices_8_repeat:

Code:
getData:Table 'avtoserv_sklad.inv_invoices_8_repeat' doesn't exist SQL=SELECT SQL_CALC_FOUND_ROWS DISTINCT

I remove invoice_8_repeat group by and tweek one error on joins on same list. Now I can see it. Thanks for the package it is useful for the database structure design.

This is the group which is repeated in the invoice
http://skladova-programa.tanev.eu/inventory/form/6/0

Here calc join element from price table is working right. And I have price, quantities and totals field which is working nice ;D.


But when I add it in Invoice repeat group, there are issues:

http://skladova-programa.tanev.eu/invoices/form/11/0

It is calculated on save, which something good, but not on the editing.

Another question I have:

How I could calculate my totals from Repeated group. Currently field: Total Before VAT.

Fabrik 3.0 Rocks! :cool:
 
I want to test this package.
Which version of Fabrik and Jooomla must use to test and install the plugin?

Best Regards
 
I installed pkg_invoice on fabrik 3.0.9 and Joomla 2.5.9. I installed and enabled element user and element usergroup plugins too. But when i want to open most ot elements from this package I get a error:

Fatal error: Access level to PlgFabrik_ElementUser::getJoinValueColumn() must be public (as in class plgFabrik_ElementDatabasejoin) in Unknown on line 0.

These elements are with public privileges.
What else should I do to fix this error?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top