Author Topic: Project Announcement  (Read 3327 times)

0 Members and 1 Guest are viewing this topic.

John Spikowski

  • Posts: 57
Re: Project Announcement
« Reply #15 on: October 26, 2021, 08:49:55 pm »
One feature Sage 100 offers with customizer is to add new fields (UDF) and tables (UDT). OS-ERP offers a similar feature and done with extensions. This extension (showing customer added fields only - hooks contains the code for the complete extension) is an example of how to extend a data entry screen. This allows extending OS-ERP but still have a default release candidate. Like 100, extensions are enabled by company and role.

Original Customer Maintenance


 
Customer - Added Fields




Add_Customers.php
Code: PHP
  1. <?php
  2. /**********************************************************************
  3.     Copyright (C) FrontAccounting, LLC.
  4.         Released under the terms of the GNU General Public License, GPL,
  5.         as published by the Free Software Foundation, either version 3
  6.         of the License, or (at your option) any later version.
  7.     This program is distributed in the hope that it will be useful,
  8.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  9.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10.     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
  11. ***********************************************************************/
  12. $page_security = 'SA_CUSTOMER';
  13. $path_to_root = "../../..";
  14.  
  15. include_once($path_to_root . "/includes/db_pager.inc");
  16. include_once($path_to_root . "/includes/session.inc");
  17. $js = "";
  18. if (user_use_date_picker())
  19.         $js .= get_js_date_picker();
  20.        
  21. page(_($help_context = "Customer Additional Information"), false, false, "", $js);
  22.  
  23. include_once($path_to_root . "/includes/date_functions.inc");
  24. include_once($path_to_root . "/includes/banking.inc");
  25. include_once($path_to_root . "/includes/ui.inc");
  26. include_once($path_to_root . "/includes/ui/contacts_view.inc");
  27. include_once($path_to_root . "/modules/additional_fields/includes/ui/additional_cust_info_ui.inc");
  28. include_once($path_to_root . "/sales/includes/db/customers_db.inc");
  29. include_once($path_to_root . "/sales/includes/db/credit_status_db.inc");
  30. include_once($path_to_root . "/modules/additional_fields/includes/addfields_db.inc");
  31.  
  32. if (isset($_GET['debtor_no']))
  33. {
  34.         $_POST['customer_id'] = $_GET['debtor_no'];
  35. }
  36.  
  37. $selected_id = get_post('customer_id','');
  38. //--------------------------------------------------------------------------------------------
  39.  
  40. function customer_settings($selected_id)
  41. {
  42.         global $page_nested;
  43.        
  44.         if ($selected_id)
  45.         {
  46.                 $myrow = get_customer($selected_id);
  47.  
  48.                 $_POST['CustName'] = $myrow["name"];
  49.                 $_POST['cust_ref'] = $myrow["debtor_ref"];
  50.                 $_POST['address']  = $myrow["address"];
  51.                 $_POST['tax_id']  = $myrow["tax_id"];
  52.                 $_POST['sales_type'] = $myrow["sales_type"];
  53.                 $_POST['curr_code']  = $myrow["curr_code"];
  54.                 $_POST['credit_status']  = $myrow["credit_status"];
  55.                 $_POST['payment_terms']  = $myrow["payment_terms"];
  56.                 $_POST['discount']  = percent_format($myrow["discount"] * 100);
  57.                 $_POST['pymt_discount']  = percent_format($myrow["pymt_discount"] * 100);
  58.                 $_POST['credit_limit']  = price_format($myrow["credit_limit"]);
  59.                 $_POST['notes']  = $myrow["notes"];
  60.                 $_POST['inactive'] = $myrow["inactive"];
  61.  
  62.                 $myrow2 = get_customer_additional_info($selected_id);
  63.                 $_POST['customer_id'] = $myrow2["cust_debtor_no"];
  64.                 $_POST['cust_city']  = $myrow2["cust_city"];
  65.                 $_POST['cust_department']  = $myrow2["cust_department"];
  66.                 $_POST['cust_country']  = $myrow2["cust_country"];
  67.                 $_POST['cust_postcode']  = $myrow2["cust_postcode"];
  68.                 $_POST['cust_doc_type']  = $myrow2["cust_doc_type"];
  69.                 $_POST['cust_valid_digit']  = $myrow2["cust_valid_digit"];
  70.                 $_POST['cust_start_date']  = sql2date($myrow2["cust_start_date"]);
  71.                 $_POST['cust_sector']  = $myrow2["cust_sector"];
  72.                 $_POST['cust_class']  = $myrow2["cust_class"];
  73.                 $_POST['cust_custom_one']  = $myrow2["cust_custom_one"];
  74.                 $_POST['cust_custom_two']  = $myrow2["cust_custom_two"];
  75.                 $_POST['cust_custom_three']  = $myrow2["cust_custom_three"];
  76.                 $_POST['cust_custom_four']  = $myrow2["cust_custom_four"];
  77.  
  78.         }
  79.  
  80.         start_outer_table(TABLESTYLE2);
  81.  
  82.         table_section(1);
  83.  
  84.         table_section_title(_("Name and Address"));
  85.  
  86.         label_row(_("Customer Name:"),$_POST['CustName']);
  87.         label_row(_("Customer Short Name:"),$_POST['cust_ref']);
  88.         readonly_textarea_row(_("Address:<br>\n(Read Only)"), 'address', $_POST['address'], 35, 5);
  89.         city_list_row(_("City:"), 'cust_city', null, false, _("Select City"));
  90.         departments_list_row(_("State/Department:"), 'cust_department', null, false, _("Select Department"));
  91.         country_list_row(_("Country:"), 'cust_country', null, false, _("Select Country"));
  92.         text_row(_("Postcode:"), 'cust_postcode', null, 10, 10);
  93.         label_row(_("GSTNo:"),$_POST['tax_id']);
  94.         text_row(_("Validation Digit:"), 'cust_valid_digit', null, 1, 1);
  95.         document_types_list_row(_("Type of Document:"), 'cust_doc_type', null, false, _("Select Document Type"));
  96.         customer_class_list_row(_("Customer Class:"), 'cust_class', null, false, _("Select Class"));
  97.         $currency_name = get_currency($myrow["curr_code"]);
  98.         label_row(_("New Customer's Currency:"), $currency_name['currency']);
  99.         $sales_type_name = get_sales_type_name($myrow["sales_type"]);
  100.         label_row(_("Sales Type/Price List:"), $sales_type_name);
  101.         date_row(_("Customer Since") . ":", 'cust_start_date', '', true);
  102.         label_row(_("Customer Status:"),($myrow['inactive']==1 ? _("Inactive") : _("Active")), -1);
  103.  
  104.         table_section(2);
  105.  
  106.         table_section_title(_("Sales"));
  107.         label_row(_("Discount Percent:"),$_POST['discount']);
  108.         label_row(_("Prompt Payment Discount Percent:"),$_POST['pymt_discount']);
  109.         label_row(_("Credit Limit:"),$_POST['credit_limit']);
  110.         $payment_terms_name = get_payment_terms($myrow["payment_terms"]);
  111.         label_row(_("Payment Terms:"), $payment_terms_name['terms']);
  112.         $credit_status_name = get_credit_status($myrow["credit_status"]);
  113.         label_row(_("New Credit Status:"), $credit_status_name['reason_description']);
  114.         readonly_textarea_row(_("General Notes: (Read Only)"), 'notes', null, 35, 5);
  115.  
  116.         table_section_title(_("Additional Information"));
  117.  
  118.         text_row(get_cust_custom_labels_name(1).':', 'cust_custom_one', null, 40, 255);
  119.         text_row(get_cust_custom_labels_name(2).':', 'cust_custom_two', null, 40, 255);
  120.         text_row(get_cust_custom_labels_name(3).':', 'cust_custom_three', null, 40, 255);
  121.         text_row(get_cust_custom_labels_name(4).':', 'cust_custom_four', null, 40, 255);
  122.         sectors_list_row(_("Sector:"), 'cust_sector', null, false, _("Select Sector"));
  123.        
  124.         end_outer_table(1);
  125.  
  126.         div_start('controls');
  127.        
  128.         if (!$selected_id)
  129.         {
  130.                 display_heading(_('Select a Customer'));
  131.         }
  132.         else
  133.         {
  134.                 submit_center_first('submit', _("Update Customer and Additional Infomation"),
  135.                   _('Update customer data and Additional Infomation'), $page_nested ? true : 'default');
  136.                 submit_center_last('delete', _("Delete Customer Additional Information"),
  137.                   _('Delete customer and Additional Infomation data'), true);
  138.         }
  139.         div_end();
  140. }
  141.  
  142. if (isset($_POST['submit']))
  143. {
  144.  
  145.         if ($selected_id)
  146.         {
  147.                 $add_cust_info_exists = db_query("SELECT cust_debtor_no FROM ".TB_PREF."addfields_cust where cust_debtor_no = '$selected_id' LIMIT 1");
  148.                 if(db_fetch($add_cust_info_exists))
  149.                         {
  150.                         update_customer_additional_info($_POST['customer_id'],
  151.                         $_POST['cust_city'], $_POST['cust_department'],
  152.                                 $_POST['cust_country'], $_POST['cust_postcode'],
  153.                                 $_POST['cust_doc_type'], $_POST['cust_valid_digit'],
  154.                                 $_POST['cust_start_date'], $_POST['cust_sector'],
  155.                                 $_POST['cust_class'], $_POST['cust_custom_one'],
  156.                                 $_POST['cust_custom_two'], $_POST['cust_custom_three'],
  157.                                 $_POST['cust_custom_four']);
  158.                     }
  159.                     else
  160.                     {
  161.                         add_customer_additional_info($_POST['customer_id'],
  162.                         $_POST['cust_city'], $_POST['cust_department'],
  163.                                 $_POST['cust_country'], $_POST['cust_postcode'],
  164.                                 $_POST['cust_doc_type'], $_POST['cust_valid_digit'],
  165.                                 $_POST['cust_start_date'], $_POST['cust_sector'],
  166.                                 $_POST['cust_class'], $_POST['cust_custom_one'],
  167.                                 $_POST['cust_custom_two'], $_POST['cust_custom_three'],
  168.                                 $_POST['cust_custom_four']);
  169.                     }
  170.  
  171.                 $Ajax->activate('customer_id'); // in case of status change
  172.                 display_notification(_("Customer additional information has been updated."));
  173.         }
  174. }
  175. elseif (isset($_POST['delete']))
  176. {
  177.                 delete_customer_additional_info($selected_id);
  178.                 display_notification(_("Selected Customer Additional Infomation has been deleted."));
  179.                 $Ajax->activate('_page_body');
  180. }
  181. //--------------------------------------------------------------------------------------------
  182.  
  183. start_form();
  184.  
  185. if (db_has_customers())
  186. {
  187.         start_table(TABLESTYLE_NOBORDER);
  188.         start_row();
  189.         customer_list_cells(_("Select a customer: "), 'customer_id', null, _('Select a customer'), true, check_value('show_inactive'));
  190.         check_cells(_("Show inactive:"), 'show_inactive', null, true);
  191.         end_row();
  192.         end_table();
  193.  
  194.         if (get_post('_show_inactive_update')) {
  195.                 $Ajax->activate('customer_id');
  196.                 set_focus('customer_id');
  197.         }
  198. }
  199. else
  200. {
  201.         hidden('customer_id');
  202. }
  203. if ($selected_id)
  204.         customer_settings($selected_id);
  205.  
  206. end_form();
  207. end_page();
  208.  

Hooks.php
Code: PHP
  1. <?php
  2. /**********************************************************************
  3.         Released under the terms of the GNU General Public License, GPL,
  4.         as published by the Free Software Foundation, either version 3
  5.         of the License, or (at your option) any later version.
  6.         This program is distributed in the hope that it will be useful,
  7.         but WITHOUT ANY WARRANTY; without even the implied warranty of
  8.         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
  9.         See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
  10.  
  11.         ================================================================
  12.         Front Additional Fields
  13.         ================================================================
  14.        
  15. ***********************************************************************/
  16.  
  17. define ('SS_ADDFLD_C', 141<<8);
  18. define ('SS_ADDFLD', 142<<8);
  19. define ('SS_ADDFLD_A', 143<<8);
  20.  
  21. class additional_fields_app extends application {
  22.        
  23.         function __construct() {
  24.                
  25.                 parent::__construct('AddFields', _($this->help_context = 'Additional Fields'));
  26.  
  27.                 $this->add_module(_("Customer Additional Information"));
  28.                 $this->add_lapp_function(0, _("Additional &Customer Information"),
  29.                         "/modules/additional_fields/manage/add_customers.php?", 'SA_CUSTOMER', MENU_ENTRY);
  30.                 $this->add_rapp_function(0, _('Customer Custom Field Labels'),
  31.                         '/modules/additional_fields/manage/cust_customer_labels.php?', 'SA_ADD_FIELDS_CUST_LABELS', MENU_MAINTENANCE);
  32.  
  33.                 $this->add_module(_("Supplier Additional Information"));
  34.                 $this->add_lapp_function(1, _("Additional &Supplier Information"),
  35.                         "/modules/additional_fields/manage/add_suppliers.php?", 'SA_SUPPLIER', MENU_ENTRY);
  36.                 $this->add_rapp_function(1, _('Supplier Custom Field Labels'),
  37.                         '/modules/additional_fields/manage/cust_supplier_labels.php?', 'SA_ADD_FIELDS_SUPP_LABELS', MENU_MAINTENANCE);
  38.  
  39.                 $this->add_module(_("Item Additional Information"));
  40.                 $this->add_lapp_function(2, _("Additional &Item Information"),
  41.                         "/modules/additional_fields/manage/add_items.php?", 'SA_ITEM', MENU_ENTRY);
  42.                 $this->add_rapp_function(2, _('Item Custom Field Labels'),
  43.                         '/modules/additional_fields/manage/cust_item_labels.php?', 'SA_ADD_FIELDS_ITEM_LABELS', MENU_MAINTENANCE);
  44.  
  45.                 $this->add_module(_('Maintenance'));
  46.                 $this->add_lapp_function(3, _('Manage Document Types'),
  47.                         '/modules/additional_fields/manage/document_types.php?', 'SA_ADD_FIELDS_DOC_TYPES', MENU_MAINTENANCE);
  48.                 $this->add_lapp_function(3, _('Manage Beneficiary Classes'),
  49.                         '/modules/additional_fields/manage/customer_class.php?', 'SA_ADD_FIELDS_BEN_CLASSES', MENU_MAINTENANCE);
  50.                 $this->add_lapp_function(3, _('Manage Sectors'),
  51.                         '/modules/additional_fields/manage/sectors_add_info.php?', 'SA_ADD_FIELDS_SECTOR', MENU_MAINTENANCE);
  52.                 $this->add_rapp_function(3, _('Manage Countries'),
  53.                         '/modules/additional_fields/manage/country.php?', 'SA_ADD_FIELDS_COUNTRY', MENU_MAINTENANCE);
  54.                 $this->add_rapp_function(3, _('Manage Departments'),
  55.                         '/modules/additional_fields/manage/department_add_info.php?', 'SA_ADD_FIELDS_DEPARTMENT', MENU_MAINTENANCE);
  56.                 $this->add_rapp_function(3, _('Manage Cities'),
  57.                         '/modules/additional_fields/manage/city_add_info.php?', 'SA_ADD_FIELDS_CITY', MENU_MAINTENANCE);
  58.                 $this->add_extensions();
  59.         }
  60.        
  61. }
  62.  
  63. class hooks_additional_fields extends hooks {
  64.  
  65.         function __construct() {
  66.                 $this->module_name = 'additional_fields';
  67.         }
  68.        
  69.         function install_tabs($app) {
  70.                 $app->add_application(new additional_fields_app);
  71.         }
  72.        
  73.         function install_access() {
  74.                 $security_sections[SS_ADDFLD_C] =  _("Additional Fields Configuration");
  75.                 $security_sections[SS_ADDFLD] =  _("Additional Fields Transactions");
  76.                 $security_sections[SS_ADDFLD_A] =  _("Additional Fields Analytics");
  77.                 $security_areas['SA_ADD_FIELDS_SECTOR'] = array(SS_ADDFLD_C|101, _("AddFields Sector"));
  78.                 $security_areas['SA_ADD_FIELDS_COUNTRY'] = array(SS_ADDFLD_C|102, _("AddFields Country"));
  79.                 $security_areas['SA_ADD_FIELDS_CITY'] = array(SS_ADDFLD_C|103, _("AddFields City"));
  80.                 $security_areas['SA_ADD_FIELDS_DEPARTMENT'] = array(SS_ADDFLD_C|104, _("AddFields Departments"));
  81.                 $security_areas['SA_ADD_FIELDS_BEN_CLASSES'] = array(SS_ADDFLD_C|105, _("AddFields Beneficiary Classes"));
  82.                 $security_areas['SA_ADD_FIELDS_DOC_TYPES'] = array(SS_ADDFLD_C|106, _("AddFields Document Types"));
  83.                 $security_areas['SA_ADD_FIELDS_ITEM_LABELS'] = array(SS_ADDFLD_C|107, _("AddFields Item Custom Field Labels"));
  84.                 $security_areas['SA_ADD_FIELDS_SUPP_LABELS'] = array(SS_ADDFLD_C|108, _("AddFields Supplier Custom Field Labels"));
  85.                 $security_areas['SA_ADD_FIELDS_CUST_LABELS'] = array(SS_ADDFLD_C|109, _("AddFields Customer Custom Field Labels"));
  86.                 return array($security_areas, $security_sections);
  87.         }
  88.  
  89.         function activate_extension($company, $check_only=true) {
  90.                 global $db_connections;
  91.                
  92.                 $updates = array( 'update.sql' => array('frontadd'));
  93.  
  94.                 return $this->update_databases($company, $updates, $check_only);
  95.         }
  96.        
  97.         function deactivate_extension($company, $check_only=true) {
  98.                 global $db_connections;
  99.  
  100.                 $updates = array('remove.sql' => array('frontadd'));
  101.  
  102.                 return $this->update_databases($company, $updates, $check_only);
  103.         }
  104.  
  105. }
  106.  
« Last Edit: October 28, 2021, 02:28:24 am by John Spikowski »

John Spikowski

  • Posts: 57
Re: Project Announcement
« Reply #16 on: October 28, 2021, 02:05:03 am »
I thought I would install OS-ERP (FA) on my main Windows 10 development laptop as it has a static IP on my fiber connection. XAMPP now offers a PHP 8.0.12 version of the install. FA hasn't officially recommended PHP 8 yet and suggests using PHP 7 instead. I decided to try PHP 8 and see if it breaks anything. After getting everything installed I noticed the dashboard graphics weren't working. It seems XAMPP has disabled the GD extension in the php.ini file. Once I enabled the GD extension the graphics worked. So far everything else seems normal. If you plan to try OS-ERP from the OS-ERP Repository I suggest using the XAMPP PHP 7 latest install until the developers give the green light on PHP 8.

I've started on the first OS-ERP specific change which is making Customer Maintenance look more like 100. I'm going to be moving fields from the Additional tab to the main screen. I'm also going to create separate addresses fields rather than using a multi-line text box.
« Last Edit: April 24, 2022, 07:09:14 pm by John Spikowski »

John Spikowski

  • Posts: 57
Re: Project Announcement
« Reply #17 on: December 07, 2021, 11:30:35 pm »
The OS-ERP version is now at 2.4.11.

I'm working on building a demo company using the MySQL example company Classic Models.

I'm splitting up my open source activities between OS-ERP and the new HTML extension module that will allow substituting NOMADS for a browser interface.

John Spikowski

  • Posts: 57
Re: Project Announcement
« Reply #18 on: March 06, 2022, 03:57:44 pm »
Quote
Congratulations! FrontAccounting has just been recognized with the following awards by SourceForge:
  • Community Leader
  • Community Choice
  • Open Source Excellence
  • SourceForge Favorite

These honors are awarded only to select projects that have reached significant milestones in terms of downloads and user engagement from the SourceForge community.

This is a big achievement, as your project has qualified for these awards out of over 500,000 open source projects on SourceForge. SourceForge sees nearly 30 million users per month looking for, and developing, open source software.

The Open Sage ERP offering is a fork of the FrontAccounting project. I have rebranded it and have maintain a repository updating it with fixes and enhancements from the FA project.

I have install OS-ERP on the Open Sage site if you would like to give it a review and see if it would meet your needs. (I'm still working on building a demo company so feel free to experiment.)

Open Sage ERP Community Demo Install

User Name: demo
Password: demo

This is a community effort like Sage City but no subscriptions or partner fees to pay. OS-ERP is written in PHP which is the most popular scripting language on the planet. The OS-ERP framework is very well done and easy to expand on. Please join the forum and contribute to the project with the skills you have to offer. (accounting, programming, web site expansion, ...)
« Last Edit: April 24, 2022, 07:08:53 pm by John Spikowski »

John Spikowski

  • Posts: 57
Re: Project Announcement
« Reply #19 on: March 20, 2022, 12:12:57 pm »
I'm working on building a demo company using the MySQL Classic Models DB. I have the inventory built. I've attached the Inventory Stock Check Report that will show the items inventory. I was able to get the Supplier (vendor) initial records build. The attached Supplier Trial Balances report that shows the vendors being used in this demo company.

I found a few sites that have pictures of these models which I plan to incorporate with the inventory items.

I setup a Shopify developer sandbox which will use the same inventory. The goal is a seamless integration.

If you would like to help move this along send me an email.
 
« Last Edit: March 22, 2022, 06:12:33 pm by John Spikowski »

John Spikowski

  • Posts: 57
Re: Project Announcement
« Reply #20 on: March 24, 2022, 12:45:11 am »
I have Customers added to the demo company. The MySQL DB contains invoices and payments but no purchases. I'm going to try and generate some sales orders next.