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:
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:
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.
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;
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();
}
);
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.