4,351

(8 replies, posted in Modules Add-on's)

@tm: That's a fine way to tolerate old habits. Thanks. Committed in my GitHub Repo.

4,352

(3 replies, posted in Setup)

First of all the UK Chart of Accounts is broken if taken from the official pkg repo. After installing it from there, just update the en_GB-general.sql file from my GitHub Repo. Just upload the said sql file overwriting the one in the sql folder and then create your UK company. Let your default company be created with the en_US-new.sql and your actual company be created with the new UK sql file.

When entering your items, just choose Tax Exempt for now. When you get to qualify for VAT, then change the settings to Tax in the items. All the old invoices will remain in their Non Tax state.

4,353

(8 replies, posted in Modules Add-on's)

Committed the fix to the extension's files in my GitHub repo.

4,354

(1 replies, posted in Items and Inventory)

Look at what broke in modifying the report - use a diff tool like say WinMerge - mostly syntax errors, missing variables/objects, missing arguments, scope, etc. Check the apache error logs and the FA error logs as well.

Yes, #_debtors_master table's pymt_discount field is only displayed in the Customer Payment Form in FA currently.

4,356

(8 replies, posted in Modules Add-on's)

There are quite a few placed where D is hard coded in the core and in the extension files.

A brief history of mb_flag changes:

2014-09-12: Removed redundant mb_flag 'A'.
2009-05-18: Added mb_flag 'M' in demand checks
2009-05-17: Removed obsolete 'K' mb_flag checks.

Extensions having mb_flag and referencing 'D' or 'S':

Extensions/api/sync_db.inc : Lines 393, 418, 1069, 1109, 1152 => D
Extensions/import_items/import_items.php : Line 246 => S
Extensions/import_items/readme.txt : Line 111, 163 => S

Core files having mb_flag and referencing 'D' or 'S':

includes/data_checks.inc : Line 333 => D
includes/manufacturing.inc : Line 27 => D
includes/db/inventory_db.inc : Line 114 => D
includes/ui/ui_lists.inc : Lines 915, 924 => D
manufacturing/work_order_add_finished.php : Line 139 => D
reporting/rep301.php : Line 113 => D
reporting/rep307.php : Line 40 => D
reporting/rep308.php : Line 70 => D

4,357

(0 replies, posted in Setup)

When trying to do an import of items, several tables are involved.  To help understand the process, the Wiki now has the ERD for it and is attached herein as well.

The suppliers_uom is a plain text box in the FA Web UI and overrides the #_stock_master.units if present.

4,358

(8 replies, posted in Modules Add-on's)

@joe: Shall we change the core - what of the community and existing users data?

The file includes/manufacturing.inc had the acceptable values of the $mb_flag variable / mb_flag field:
M => Manufactured
B => Purchased or Bought
D => Services - do not know the rationale for this assignment. Possibly DeStocked or Discard Inventory.

The extensions file modules/import_items/import_items.php lines 246-247:

if ($mb_flag != "S") {
    $sql = "INSERT INTO ".TB_PREF."loc_stock (loc_code, stock_id) VALUES ('{$_POST['location']}', '$id')";

Should we change the D => S in the core file includes/manufacturing.inc or S => D in the extension file import_items.php ?

If only the 32% display on the label side is erroneous, it can be just clubbed together into a string like "All VAT" if the sum of the taxes is correctly displayed on the right hand side in the summary.

4,361

(0 replies, posted in Modules Add-on's)

When importing items into the bom table (type=BOM), if the stock_id exists, then all records with same combination of parent/component will get updated with values from their last UPDATE statement.

Attached is the table schema and the relevant code fragment.

Just check to see the number of database queries you need to display the average page. Placing frequently used menus that do not change often into the database can cause problems when the db hangs or gets bogged down with too many requests - practically on every page refresh or re-construct.

The very appeal of the standard FA menus is it's familiarity and ability to see all links on one page without clicking on any dropdown menus.

Check if your choice of default theme allows you to use FA in an intranet not connected to the internet.

Then let it be like that except that a constant string can be defined for now as '999' and used in the function Achieve();
Lines 137 to 147 in reporting/rep707.php:

function Achieve($d1, $d2)
{
    if ($d1 == 0 && $d2 == 0)
        return 0;
    elseif ($d2 == 0)
        return 999;
    $ret = ($d1 / $d2 * 100.0);
    if ($ret > 999)
        $ret = 999;
    return $ret;
}

can be

define('OUT_OF_RANGE', 999);

function Achieve($d1, $d2)
{
    if ($d1 == 0 && $d2 == 0)
        return 0;
    elseif ($d2 == 0)
        return OUT_OF_RANGE;
    $ret = ($d1 / $d2 * 100.0);
    if ($ret > OUT_OF_RANGE)
        $ret = OUT_OF_RANGE;
    return $ret;
}

The define can be placed into the file that contains the other constants.

The said function Achieve() is duplicated in gl/inquiry/profit_loss.php.

In reporting/includes/excel_report.inc we find that 9999999 is used to represent "infinity".

In includes/ui/ui_view.inc, the value 999999999999 is used to represent "infinity".

In includes/date_functions.inc, the value 9999 is used to represent the max year.

In admin/view_print_transaction.php and admin/void_transaction.php, the value 999999 is used to represent the max ToTransNo.

Where in the wiki should we indicate this fact. Should a translatable string be used in FA 2.4?

The mere presence of the file company/#/reporting/includes/header2.inc does not ensure that it will be used in reports. It is necessary for the appropriate company/#/reporting/repXXX.php file to be present for it to apply to it.

When the denominator is 0, the percentage is shown a 999% for achieved %.

Attached is the screenshot.

Is this the intended denotation for error or out of range values?

Lines 44 to 47 of reporting/includes/header2.inc:

        $this->SetDrawColor(205, 205, 205);
        $this->Line($iline1, 3);
        $this->SetDrawColor(128, 128, 128);
        $this->Line($iline1);

control that line color and thickness (height).

You can leverage the Non Field DB Data functionality for this purpose but will have to manually update the old price in the item's long_description field with something like "OldPrice#31.23" as part of it in a space separated manner.

Alternatively, you can have a new price history table and make an extension for it in FA.

Extending the core FA tables will render upgrades untenable and make it only manually upgradeable.

You might want to refer this link:

function hex2rgb($hex) {
   $hex = str_replace("#", "", $hex);

   if(strlen($hex) == 3) {
      $r = hexdec(substr($hex,0,1).substr($hex,0,1));
      $g = hexdec(substr($hex,1,1).substr($hex,1,1));
      $b = hexdec(substr($hex,2,1).substr($hex,2,1));
   } else {
      $r = hexdec(substr($hex,0,2));
      $g = hexdec(substr($hex,2,2));
      $b = hexdec(substr($hex,4,2));
   }
   $rgb = array($r, $g, $b);
   //return implode(",", $rgb); // returns the rgb values separated by commas
   return $rgb; // returns an array with the rgb values
}

Replace 4 with 3 or 2 in the first and last lines of Lines 149 to 152 in reporting/includes/header2.inc:

        $this->fontSize -= 4;
        $this->Text($ccol, $Addr1['title'], $icol);
        $this->Text($mcol, $Addr2['title']);
        $this->fontSize += 4;

4,371

(65 replies, posted in Setup)

Actually quite a few POS / Billing systems exist as FOSS: phpPointOfSale (now OpenSourcePOS) at SourceForge and SimpleInvoices at GitHub should be nice replacements using PHP/MySQL.

4,372

(4 replies, posted in Reporting)

Do you want to cocatenate the line memo with the transaction memo? Would that not exceed the space for line items in reports?

4,373

(65 replies, posted in Setup)

@ahrtgnbn: nice decision

@instance: Your existing system is more a Point of Sale than an Accounting System and their developers have simplified operations by restricting it to Direct Sales and Purchase Invoices. Since it has hooks, you may want to make use of it to classify customers for appropriate decisions / reporting leveraging external tables. Not tying up the db directly between the two may alleviate non-high availability issues.

Fixes of a non critical nature will only go into FA v2.4 (dev policy) and they will need to be backported manually - my FAMods is a small step in that direction. Each developer will have their own private repository with their real fixes and only some would sync it to the public one. I cannot have multiple repos as maintaining them is a nightmare and would not benefit from peer review and hence GitHub and the FA Wiki (need to make one in MediaWiki when time permits). This decision may have ruffled a few feathers initially but now over 40 forks of it have  proved a tremendous vote of confidence.

The proper way would be to correct the offending line in the dashboard theme / extension where the $result originated - not to call the function if it was false!

4,375

(2 replies, posted in Reporting)

So the missing 8th parameter (PARAM_7) will not throw errors. Hence, a backport will be "correct", but is not deemed to be necessary. Backporting will help minimize the differences between files in FA 2.4 and 2.3 to make for easier porting forward of fixes in FA 2.3 to 2.4.