4,426

(16 replies, posted in Banking and General Ledger)

@:bobloblian: Your kind of persistence and feedback is what makes FA what it is. The info has been wikied.

@joe: Any logic in this condition needs to be wikied so that when we re-visit it in FA 2.4 we can make better workflows.

Will Tags suffice?

By "#" do you mean id or wildcard "*"?

The complete UK rep107.php and doctext.inc patch with screenshots are attached herein. Please check how you wish to code in the summary tax (or omit it fully) and the correctness of the "included" tax in the line items. Please test for multiple items with different rates of tax in invoices before submitting full patch.

4,430

(16 replies, posted in Banking and General Ledger)

Please provide the before and after sql backups differences so that it can be matched against any other means of inclusion.
Added screenshots on my take.
Removed Wiki inclusion.

Although Credit Card Account used to make payments to suppliers is actually a liability account, it may need to be treated as a checking account (Asset) in FA to be usable.

In view of the recent changes in rep107.php and after synching the white space diffs, I have attached the patch file for this commit. Further changes may need to be done in accommodating the Subtotal, total and other columns to be (6,8) instead of (6,7) and some flag inclusion for switching between the UK and normal invoice report formats.

Attached file has screenshots of 2 different invoices created with the patch that shows what further changes may be necessary.

@joe: Should there be a flag in rep107.php to incorporate this feature?

Also can we move the copyright header from all the FA files and keep them in one single licence file in the webroot?

4,433

(16 replies, posted in Banking and General Ledger)

Wiki-ed it.

4,434

(21 replies, posted in Reporting)

This means that this error pre-existed in FA. In FA v2.4, we must make sure that $customer has some value (even if blank) before arriving at rep107.php since the very same construct "if (!exists_customer_trans(....." precedes the current commit lines of rep107.php in rep110.php and rep113.php and the equivalent "if($myrow['debtor_no'] != $customer) {" instead of the current commit lines will always be sufficient even if not coded so.

@joe: thanks for spotting and correcting it forthwith. I had tested in Windoze that was probably more forgiving of absent variables!

4,435

(0 replies, posted in Reporting)

What is the purpose of $sign in rep107.php - it always has the value of 1 and nowhere does it get changed. Is it to provide an integer value? If so, what use is round2() in which it occurs?

It also appears in rep109.php, rep111.php, rep209.php without declaration in it (hopefully it came from some included file!).

It appears in rep113.php with a constant value of -1 and nowhere does it get changed.

4,436

(21 replies, posted in Reporting)

Have you tried to clear all the cache and close all instances of your browser before trying it?

Take a dump of all variables available while entering rep107.php from each menu link instance and report the difference. It may have something to do with the $currency variable not being defined or defined wrongly - under what set of values I cannot ascertain as it works correctly for me.

4,437

(21 replies, posted in Reporting)

All reports affected by the currency filter commit other than rep108.php get their results from other functions. In FA 2.4, we can consider filtering them in the WHERE clause in the source function's SQL tself.

In rep108.php, the sql is executed inline and can hence be filtered in the WHERE clause itself instead of in the php loop after the fact. The patch below achieves it:

--- reporting/rep108.php    Fri Feb 13 20:23:10 2015
+++ reporting/rep108.php    Fri Feb 13 20:19:18 2015
@@ -86,18 +86,17 @@
    if ($orientation == 'L')
         recalculate_cols($cols);
  
-    $sql = "SELECT debtor_no, name AS DebtorName, address, tax_id, curr_code, curdate() AS tran_date FROM ".TB_PREF."debtors_master";
+    $sql = "SELECT debtor_no, name AS DebtorName, address, tax_id, curr_code, curdate() AS tran_date FROM ".TB_PREF."debtors_master WHERE 1 ";
     if ($customer != ALL_TEXT)
-        $sql .= " WHERE debtor_no = ".db_escape($customer);
-    else
+        $sql .= " AND debtor_no = ".db_escape($customer);
+    if ($currency != ALL_TEXT)
+        $sql .= " AND curr_code = ".db_escape($currency);
+
         $sql .= " ORDER by name";
     $result = db_query($sql, "The customers could not be retrieved");
 
     while ($myrow=db_fetch($result))
     {
-        if ($currency != ALL_TEXT && $myrow['curr_code'] != $currency) {
-            continue;
-        }    
         $date = date('Y-m-d');
 
         $myrow['order_'] = "";

Journal Voucher / Credit / Debit Notes.

If you use the Non Field DB Data method, you do not need any extra field for such features. Refer the wiki for it.

4,440

(21 replies, posted in Reporting)

@joe: Thanks. That was fast and elegant.

For the record:
ALL_TEXT, the blank string constant, is defined in include/types.inc and is included in includes/main.inc which in turn is included in includes/session.inc which is included in all report files.
Hence it may be safely used in all reports.

4,441

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

There is already a README.md file in your GitHub repo. You can take the properly formatted one from mine and extend it to cover the date format aspects and other help info.

4,442

(21 replies, posted in Reporting)

@joe: Whilst incorporating the Currency filter in the appropriate report request forms, plesse try to include Sales Group filter as well. The latter will help manage exceptions easily with the help of temporary groups.

In FA 2.4, we can allow customer branches be part of multiple Sales Groups and possibly include a fallback Sales Group in the Customer record (debtor_master) as well.

4,443

(2 replies, posted in Setup)

Please post as a new topic under relevant head.

Read the FA Wiki and follow this Forum Post.

4,444

(2 replies, posted in Setup)

The default.css for the 3 standard themes - aqua, cool and default - have been tweaked to allow combo select boxes to be displayed in the same straight line as all other fields in line items of forms.

The change envisaged is:

--- themes/aqua/default.css    Sat Nov 22 03:35:19 2014
+++ themes/aqua/default.css    Wed Feb 11 22:14:42 2015
@@ -90,8 +90,12 @@
     padding: 1px 0px;
 }
 
-button img, span {
-    padding: 0px 2px ;
+button img {
+    padding: 0px 2px;
+    vertical-align: middle;
+}
+
+span {
     vertical-align: middle;
 }
 

4,445

(3 replies, posted in FA Modifications)

"personage from Sales Discount" ????

4,446

(21 replies, posted in Reporting)

@joe: The following info will be useful in getting Sales Groups into all pertinent reports:

functions in includes/ui/ui_lists.inc:

sales_groups_list($name, $selected_id=null, $special_option=false)
    used in function sales_groups_list_cells
sales_groups_list_cells($label, $name, $selected_id=null, $special_option=false)
    used in sales_groups_list_row
sales_groups_list_row($label, $name, $selected_id=null, $special_option=false)
    used in sales/manage/customer_branches.php (data entry and updation)
    used in sales/manage/recurrent_invoices.php (selection for recurrent invoice generation)


functions in sales/includes/db/sales_groups_db.inc:

The following 5 functions are used only once in sales/manage/sales_groups.php
add_sales_group($description)
update_sales_group($selected_id, $description)
delete_sales_group($selected_id)
get_sales_groups($show_inactive)
get_sales_group($selected_id)


get_sales_group_name($group_no)
    used in sales/manage/recurrent_invoices.php
    used in sales/create_recurrent_invoices.php

4,447

(21 replies, posted in Reporting)

Hope you have set the Customer Currency correctly. Otherwise, company's currency will be used and it will not be filterable. Currency is used in the payment link generation in pdf_report.inc in it's End() method. I have not been able to ascertain where else the "currency variable taken from the report request form" is used in report generation.

4,448

(21 replies, posted in Reporting)

Customer Branches are by default not classified into any group.
Default Sales Groups available are Small, Medium, Large.
Sales => Sales Groups
You can create USD and EUR Sales Groups and appropriately group the customer branches and then print them by appropriate Group filter.
There is no Group filter currently in the Invoice Printing script - rep107.php - you will have to hack that in.

There is a currency filter in the Invoice Printing Form and even if you choose all the invoices / customers, probably this filter may kick in - please provide feedback on it.

Not even one report request form provides for Sales Groups Filter.

@joe: Please provide Sales Group Filter in all appropriate reports.

4,449

(3 replies, posted in Accounts Receivable)

You can maintain your pricelist in a separate private table and delete the original table in FA called #_prices and create a view of your private table called #_prices where # is the table prefix for the company. The fields in the view must match those in the original table:

CREATE TABLE `0_prices` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `stock_id` varchar(20) NOT NULL DEFAULT '',
  `sales_type_id` int(11) NOT NULL DEFAULT '0',
  `curr_abrev` char(3) NOT NULL DEFAULT '',
  `price` double NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `price` (`stock_id`,`sales_type_id`,`curr_abrev`)
) ENGINE=MyISAM;

Assuming your private table is called myprices and your company prefix is 1, then your sqls necessary to replace the 1_prices table would be:

DROP TABLE `1_prices`;
CREATE VIEW `1_prices` AS
 (SELECT
 id AS id,
 stock_id AS stock_id,
 sales_type_id AS sales_type_id,
 curr_abrev AS curr_abrev,
 price AS price 
 FROM myprices);

Alter the above VIEW's sql to suit your private table's actual field names for the source fields but retain the field aliases as it is.

An example of company/1/reporting/forms/Header2.php usage and it's effect is attached. The wiki has been updated as well.