4,526

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

Nice catch. When a class extends another and attempts to override a parent method (function), it should maintain the same number of arguments or the parent method should have default values for missing arguments in the overriding methods.

For a start, try the following in the file /modules/textcart/includes/textcart_manager.inc:
Change lines 703 and 733:

  function item_to_text($item) {

to be

  function item_to_text($item, $user_price_dec) {

4,527

(3 replies, posted in Installation)

Stands corrected - that's what happens when typing in BBCode....

4,528

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

I have patched the files needed to incorporate the latest FA v2.3.22+. Kindly verify the commits in my FA repo.

Synched textcart patched file inventory/transfers.php with core
elax textcart patched files updated to latest in core (sales, inventory, purchasing)

4,529

(10 replies, posted in Report Bugs here)

This might have something to do with new value computation being based on average costs (changes made in Aug/Sep 2014)  which can be 0 if no input costs were available such as in opening balances or in/out rates.

4,530

(48 replies, posted in Setup)

The current unstable FA 2.4 snapshot will install with some errors and will need fixes to the includes/current_user.inc attached herein.

--- includes/current_user.inc Mon Jan 19 16:57:39 2015
+++ includes/current_user.inc Wed Jan 21 03:15:25 2015
@@ -448,17 +448,26 @@
 
 function user_price_dec()
 {
- return $_SESSION["wa_current_user"]->prefs->price_dec();
+  global $SysPrefs;
+
+ return isset($_SESSION["wa_current_user"]) ? 
+   $_SESSION["wa_current_user"]->prefs->price_dec() : $SysPrefs->prices_dec;
 }
 
 function user_exrate_dec()
 {
- return $_SESSION["wa_current_user"]->prefs->exrate_dec();
+  global $SysPrefs;
+
+ return isset($_SESSION["wa_current_user"]) ? 
+   $_SESSION["wa_current_user"]->prefs->exrate_dec() : $SysPrefs->rates_dec;
 }
 
 function user_percent_dec()
 {
- return $_SESSION["wa_current_user"]->prefs->percent_dec();
+  global $SysPrefs;
+
+ return isset($_SESSION["wa_current_user"]) ? 
+   $_SESSION["wa_current_user"]->prefs->percent_dec() : $SysPrefs->percent_dec;
 }
 
 function user_show_gl_info()
@@ -481,15 +490,36 @@
 
 function user_date_display()
 {
-  global $SysPrefs;
-
- return isset($_SESSION["wa_current_user"]) ?
-   $_SESSION["wa_current_user"]->prefs->date_display() : $SysPres->dflt_date_sep;
+ $fmt ='m/d/Y';
+ if (isset($_SESSION["wa_current_user"])) {
+  $fmt = $_SESSION["wa_current_user"]->prefs->date_display();
+ } else {
+  $sep = user_date_sep();
+  $user_date_fmt = user_date_format();
+  switch ($user_date_fmt) {
+   case 0:
+    $fmt = "m".$sep."d".$sep."Y"; break;
+   case 1:
+    $fmt = "d".$sep."m".$sep."Y"; break;
+   case 2:
+    $fmt = "Y".$sep."m".$sep."d"; break;
+   case 3:
+    $fmt = "M".$sep."j".$sep."Y"; break;
+   case 4:
+    $fmt = "j".$sep."M".$sep."Y"; break;
+   default:
+    $fmt = "Y".$sep."M".$sep."j";
+  }
+ }
+ return $fmt;
 }
 
 function user_date_sep()
 {
- return $_SESSION["wa_current_user"]->prefs->date_sep();
+  global $SysPrefs;
+
+ return isset($_SESSION["wa_current_user"]) ?
+   $_SESSION["wa_current_user"]->prefs->date_sep() : $SysPrefs->dflt_date_sep;
 }
 
 function user_tho_sep()

SysPrefs is wrongly spelt as $SysPres one instance above. The switch case may be converted to an array whose index can choose the format string.

4,531

(22 replies, posted in Reporting)

The method End() in class FrontReport in includes/excel_report.inc file is the one that writes the excel sheet and then it is sent to the browser with headers for download to a unique filename in lines 30 to 42 of reporting/prn_redirect.php:

if (isset($_GET['xls']))
{
    $filename = $_GET['filename'];
    $unique_name = preg_replace('/[^0-9a-z.]/i', '', $_GET['unique']);
    $path =  company_path(). '/pdf_files/';
    header("Content-type: application/vnd.ms-excel");
    header("Content-Disposition: attachment; filename=$filename" );
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
    header("Pragma: public");
    echo file_get_contents($path.$unique_name);
    exit();
}

Try it under PHP 5.3.x first - possibly in xampp 1.7.3 or so and see if we can locate and php version specific issue. Works okay from my end though.

Attached is the screenshot from XAMPP v1.7.3 / PHP 5.3.1 / MySQL 5.1.41.

Do you want to try just billing the customer for labour charges alone?

Otherwise you will have to hack the two reports into one by making a union of the two sqls with appropriate column name aliases synched.

4,533

(22 replies, posted in Reporting)

Look at one of the code recent fixes in FA v2.4 - all tables were converted elegantly to InnoDB. Otherwise export the data alone out, drop the database and create a new one, import the schema with the appropriate collation and import the data back.

4,534

(3 replies, posted in Installation)

Execute the following commands as root (sudo):

BASEDIR=/var/www/html
chown -R www-data:www-data ${BASEDIR}
find ${BASEDIR} -type f -exec chmod 644 \{\} \;
find ${BASEDIR} -type d -exec chmod 755 \{\} \;

Make sure that no config.php or config_db.php file exists to start with.

4,535

(22 replies, posted in Reporting)

Which version of FA are you using. What are your client and server platforms and versions of php/mysql used? What collation is your database on? You might be getting utf-8 and latin1 mixed up.

4,536

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

And possibly their content as well. Any reason for rejection of hook patch?

4,537

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

Doesn't the pkg install the various files to patch the FA? If so, the textcart documentation in the wiki may need updation.

I have just updated in my GitHub repo with the new rep_email_customers extension from it's official Git repo.

It is however not yet in the offical pkg repo.

Anyone tested it?

4,539

(21 replies, posted in Setup)

Lookup the reference code at lines 191 to 212 in reporting/includes/header2.inc:

        // Footer
        $this->Font('italic');
        $this->row = $iline7 - $this->lineHeight - 6;

        foreach ($Footer as $line => $txt)
        {
            if (!is_numeric($line))    // title => link
            {
                $this->fontSize -= 2;
                $this->TextWrap($ccol, $this->row, $right - $ccol, $line, 'C');
                $this->row -= $this->lineHeight;
                $this->SetTextColor(0, 0, 255);
                $this->TextWrap($ccol, $this->row, $right - $ccol, $txt, 'C');
                $this->SetTextColor(0, 0, 0);
                $this->addLink($txt, $ccol, $this->row, $this->pageWidth - $this->rightMargin, $this->row + $this->lineHeight);
                $this->fontSize += 2;
            }
            else
                $this->TextWrap($ccol, $this->row, $right - $ccol, $txt, 'C');
            $this->row -= $this->lineHeight;

        }

For a specific company you can place an override in the company/#/reporting/reporting/includes/header2.inc file for which you may use the original reporting/includes/header2.inc as a template to start with.

Actually, according to the wiki, the Direct Invoice is the one that combines Sales Order, Delivery and Invoicing into one step. Direct Delivery just bunches the Sales Order and Delivery together.

4,540

(21 replies, posted in Setup)

Generally in any ERP (as opposed to normal accounting software), a certain workflow is standard - delivery and invoicing are separate functions and need to be done by different entities (roles - same person can don several roles).

The Direct Delivery has been made available for such simple situations as yours and to simulate functionality of normal accounting software for new users to gain traction quickly in familiar operations. In actuality, the Invoicing and all GL entries are made as if a Sales Order was generated and then Invoiced and then Delivered in the Direct Invoice! In the case of Direct Delivery only the Sales Order and Delivery are bunched together.

Limiting invoicing items to 10 or any other hardcoded number is not advisable for the form elements as paging is done on printing only and it is best left to the user's choice depending on how much text is desired to be input for printing at the end of the items. If however your terms and conditions is a fixed text display, you may want to place it in small font and possibly in the invoice footer.

4,541

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

Compare your module files with those in my GitHub repo. There was a commit I made on 2013-11-08 there that has not yet been assimilated into the official packages. It pertains to the file  modules/textcart/purchasing/po_entry_items.php.

Replace line 532

$textcart_mgr->tab_display('', &$_SESSION['PO'], "display_order_in_tab");

with

$textcart_mgr->tab_display('', $_SESSION['PO'], "display_order_in_tab");

4,542

(48 replies, posted in Setup)

Today's developments in FA v2.4:

The config.default.php in FA 2.4 will now be holding all the defaults and only changes in the variable values need to be stored in the config.php unlike the monolithic config.php in earlier versions.

4,543

(21 replies, posted in Setup)

Delivery is part of the Sales (orders) tab. The Access Roles permissions page for Sales tab functions has only the following feature roles:

Sales configuration:    
Sales types    
Sales prices edition    
Sales staff maintenance    
Sales areas maintenance    
Sales groups changes    
Sales templates    
Recurrent invoices definitions

All Direct Sales Delivery have the Sales Orders and Invoicing done automatically in the background and hence choosing to disable them (other than in the menu items) would lead to unknown configuration state. Just do not use them then.

If in the file, applications/customers.php, you comment out lines 19 and 20 you will find the Sales Quotation Menu link missing in the Sales tab in FA.

Look at the version.php file - the official repo is listed there. You can override it with your own values for the same variables in config.php. Search the forum for how to run your own pkg repo. @garrapato led such a discussion once.

4,545

(21 replies, posted in Setup)

Is that needed even for Sales => Direct Delivery?

4,546

(5 replies, posted in Reporting)

Alann Toh from Malaysia made a few requests that may be nice if added to the FA core:

  • In reports, I would like to have page numbering x of y pages instead of only page x

  • would also like to add Attn : contact_name auto derived from branch_person / contact_name and editable during invoice input by having a text box

  • A discount textboxt at direct invoice before shipping

On checking out the PDF generation classes and the bridge functions between the older FPDI and the new TCPDF, we find that the Header3() method in excel_report.inc and pdf_report.inc (that uses the Total Number of Pages in PDF data is not used in any of the reports.

Other features of the Info() method in these files too don't go beyond using the first 4 arguments in the report files whereas, the $companylogoenable$footerenable and $footertext arguments provide for additional functionality that obviates the need for repetitive coding in the reports. The excel_report.inc defines 7 arguments in the Info() method whereas it's counterpart in the pdf_report.inc additionally defines the three arguments listed earlier.

These may well be some of FrontAccounting's best kept secrets!

Attached is one way to address Alann's first request.

The second issue notes: The contact_name issue is in flux at the moment since all such info are being collimated into the crm_persons table and some reports still reference the old one though the standard forms now avoid it. It will require custom coding and maintaining it as fixes to the core code arrives will need to be taken care of unless assimilated into the core. The Invoice memo form field is the best alternative for now.

The third request fix: A discount Text box during Invoice Input can be implemented by invoicing a dummy service item (Discounts Offered) of editable description and stating amount (negative) at use time. Otherwise, provide the discount at payment allocation time.

The current stable version 2.3 will only get critical fixes backported as the devs policy which is justified, as resources are best spent on newer versions.

I have just committed a mod into the FAMods folder in my GitHub Repo to enable the display of Customer Purchase Order need in the Sales => Direct Delivery form. This uses the Non Field DB Data functionality I have backported - function parse_notes_params().

Place a space separated entry PO#1 in the cust_branch table's notes field that is space separated for customers who have stated that they must get deliveries (and subsequent invoicing) only for purchase orders they have originated.

4,548

(1 replies, posted in Installation)

@phoanglong: Welcome to the FA community and helping adoption by Vietnamese users.

Take the sql/en_US-new.sq file and copy it as vn_VN.sql and make changes to it to suit Vietnamese Chart of accounts - if you use NotePad++ for editing, use Encoding => Encode in UTF-8 without BOM.

For your reference, the various CoA's are in my GitHub Repo and the language translations are also there.

The template for translations is in lang/new_language_template folder.

Copy the empty.po file as vn_VN.po and edit it using PoEdit or just NotePad++. Compile it with msgfmt:

msgfmt vn_VN.po -o vn_VN.mo

4,549

(21 replies, posted in Setup)

Use Sales => Direct Invoice

@joe: It would require a hack to PunBB to get it done - nice suggestion for a quick link.