FA uses hooks. The devs can incorporated one for such email message parameter tweaks, CAPTCHA auth addons, etc., in the base code of FA.
5,702 02/05/2013 01:12:27 am
Topic: No COGS till Year End (10 replies, posted in Items and Inventory)
In Indian Accounting for many small enterprises with just one trusted accountant / owner,
1. whenever there is a purchase it goes into the purchase account,
2. but whenever there is an issue to production / consumption, it is not accounted for till the year end
3. At the year end it is determined as:
Consumption = Opening Stock + Purchases - Closing Stock
This may be an extension of the closed post for Belgian Accounting.
The words Calculated Return need to be changed to Profit (when there is profit) or Loss (when there is a loss) and needs to appear in the appropriate side of the Balance Sheet. This is imperative for such users who wish to migrate from Tally to FA.
5,703 02/04/2013 09:52:01 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
Thank Joe. HG Changeset 3178 did it.
Now in order to leverage it, we need new config variables or sys_prefs entries to switch between
the default (current for backwards compatibility) Comapny Name and Company EMail and
the optional User Real name and User EMail
in determining the mail sender name and Reply-to name.
Sys_prefs would be preferable as they can be set on a per company basis. It should be coded to fall back to the other if one is absent.
5,704 02/04/2013 01:07:53 am
Re: Session Abandoned Error in Windows Server Systems (6 replies, posted in Announcements)
Try the FA v2.3.14 HG Build 3175 available in post 11 of a thread[ here and see if the problem persists.
5,705 02/04/2013 01:05:20 am
Re: Release 2.3.14 (10 replies, posted in Announcements)
FA v2.3.14 Mercurial Build 3175 dated 2013-02-01.
5,706 02/04/2013 12:58:22 am
Re: Mercurial help (6 replies, posted in Accounts Receivable)
GIT repo can also be in a normal ubuntu desktop as well. Can run a Win "Box" on Ubuntu in VMWare / Virtual Box as well or Win Apps in Wine.
5,707 02/04/2013 12:57:00 am
Re: Reset full system (Delete all entries)? (7 replies, posted in Setup)
Mere deletion of data records is insufficient.
The auto_increment counter has to be reset as well if used.
Hence a TRUNCATE command is better suited for purges.
Also, some of the data should not be purges as they may pertain to
permissions,
logical inter-relationships used in code,
drop-down list and other form element choices,
sys_prefs choices.
The recomended way: After FA is setup and tweaked (extensions, languages, roles, prefs) the way you want it. take a backup and use it to restore for purges later on. Remember the passwords as well for the restored state.
5,708 02/04/2013 12:23:53 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
@ed10: thanks for the info.
Since the users.email field is not being used anywhere in the code if acquired using get_user_by_login() (as is done here in line 81 of includes/current_user.inc), the following patch will ensure it's availability in any script that uses it:
--- old/includes/current_user.inc Thu Jan 17 19:16:02 2013
+++ new/includes/current_user.inc Mon Feb 04 05:42:49 2013
@@ -22,6 +22,7 @@
var $loginname;
var $username;
var $name;
+ var $email;
var $company; // user's company
var $pos;
var $access;
@@ -120,6 +121,7 @@
$this->username = $this->loginname;
$this->prefs = new user_prefs($myrow);
$this->user = @$myrow["id"];
+ $this->email = @$myrow["email"];
update_user_visitdate($this->username);
$this->logged = true;
$this->last_act = time();
5,709 02/03/2013 02:10:16 pm
Re: Mercurial help (6 replies, posted in Accounts Receivable)
Safest way is to have your own GIT repo in a local win box. Take a WinMerge2 diff at each change pulled into GIT and upload the diffs alone. Have a set of non-fa-repo code that needs to be matched with changes in their scripts in the fa_repo and then merge carefully. Since such scripts will be only a handful, it might be better off than conflict resolution in HG. By the way IMHO, HG is not very user friendly to the newbie (YMMV). Git is fantastic. GitHub is a fine online store for it.
To make it easier for the community, I place the diffs in the FA Release Announcement posts from time to time. The Wiki has the bash scripts to do a pull and roll up of the bleeding edge HG code. My request for an online HG snapshot enablement in SF has gone unheeded till date.
5,710 02/03/2013 02:03:14 pm
Re: Reset full system (Delete all entries)? (7 replies, posted in Setup)
Beware: Some new tables and data get created / modified when some extensions get installed.
5,711 02/03/2013 02:01:40 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Please check that the logged in user has an email entry in his record in the users table and then see if the $_SESSION["wa_current_user"]->email gets populated.
Unless we try having both Reply-to in header and using the -f parameter with no error, we cannot include the code in the base repo as it has to ensure that existing installs with no postfix and just sendmail will still work.
5,712 02/03/2013 12:02:38 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
What happens if both the headers method and the -f method are used together for Reply-to - does the mail deliver as desired? Make sure the users table has the email of the logged in user and try $_SESSION["wa_current_user"]->email and see if it appears correctly.
The RFC2822 uses CRLF and FA's class.mail.inc uses LF only.
Article 3.6.2 in the RFC2822 states:
..... an optional reply-to field MAY also be
included, which contains the field name "Reply-To" and a
comma-separated list of one or more addresses.from = "From:" mailbox-list CRLF
sender = "Sender:" mailbox CRLF
reply-to = "Reply-To:" address-list CRLF
.....
Maybe some non compliant versions of Postfix may need the additional parameters like -f.....
Caveat - in some mail systems:
It turns out that a internet/dos style newline (\r\n) in the headers were converted to \r\r\n (ie: something mindlessly replaced all \n with \r\n without seeing if \n was already preceded by \r)
_________________________
[size=8]Composed/Posted with WYSIWYG BBCode Editor[/size]
5,713 02/02/2013 05:34:32 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Final solution:
1. Fix the reply to header variable as in Post 20 of this thread.
2. Make sure the real_name field in the users table for the logged in use is populated. Otherwise take the fix from Post 25 in this thread.
5,714 02/02/2013 05:29:53 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Only 2 files use the $_SESSION["wa_current_user"]->loginname variable:
Line 82 in includes/errors.inc:
$user = @$_SESSION["wa_current_user"]->loginname;
and Line 55 in reporting/includes/printer_class.inc:
$ctrl = "H".$server."\nP". substr($_SESSION["wa_current_user"]->loginname,0,31)
It is always the same as $_SESSION["wa_current_user"]->username - would the devs want to standardize?.
5,715 02/02/2013 05:10:12 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
@ed10: While I was documenting the code trace back to where the variables were set, you beat me to it!
You can actually dump the specific session variable:
echo print_r($_SESSION["wa_current_user"], true);
at the location of the send() and see what is the output!
Line 95 in admin/db/users_db.inc in function get_users_by_login():
$sql = "SELECT * FROM ".TB_PREF."users WHERE user_id=".db_escape($user_id);
Hence all fields must be available and in your instance, the real_name field may not have been set, though in the email instance, the username may be okay.
5,716 02/02/2013 05:06:45 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
In includes/session.inc, outside of the class definition, in the function login_timeout() line 402 is:
$_SESSION["wa_current_user"] = new current_user();
Class current_user is defined in includes/current_user.inc, having class variables $loginname, $name and $username all set to empty strings in the constructor at line 42.
current_user::login() method on successful authorisation at line 81:
$myrow = get_user_by_login($loginname);
and sets the current_user class variables
$this->name = $myrow["real_name"];
$this->pos = $myrow["pos"];
$this->loginname = $loginname;
$this->username = $this->loginname;
$this->prefs = new user_prefs($myrow);
$this->user = @$myrow["id"];
If the session variable user is available, ordinarily from the above code, the session variable name should also be available.
When a login timeout occurs, this may not get executed fully and some session variables may get unset (needs to be checked).
Somewhere the session variablenameis getting set to an empty string after having been logged in, if it is empty.
Hence check by replacing the line 269 in reporting/includes/pdf_report.inc with any of the following:
$this->user = $_SESSION["wa_current_user"]->loginname;
// or
$this->user = $_SESSION["wa_current_user"]->username;
and see what happens!
5,717 02/02/2013 04:39:32 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
The said variable:
$_SESSION["wa_current_user"]->name
appears in:
reporting/includes/pdf_report.inc
reporting/includes/excel_report.inc
admin/db/maintenance_db.inc
themes/aqua/renderer.php
themes/cool/renderer.php
themes/default/renderer.php
A few months ago, some repeating code in all the renderer.php files were siphoned out elsewhere to a single function and at that time the variable may have vanished from being set or when changes to includes/session.inc were made over time.
Therefore while retaining the variable $_SESSION["wa_current_user"]->name in the said files, it may be required to set the field real_name from the users table if the user is logged in - in the includes/session.inc file.
Come to think of it, thereal_namein theuserstable does not seem to be used anywhere! Optional field that may not have any value at all!
5,718 02/02/2013 04:04:20 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Line 269 in reporting/includes/pdf_report.inc, the function Info() sets:
$this->user = $_SESSION["wa_current_user"]->name;
Since it is taken from session variable, and the function Info() is not called anywhere within the FrontReport class at all, it is called by it's instance in each report.
Each report file repXXX.php has some function(s) that make an instance like $rep = new FrontReport(.... followed by $rep->Info($params, $cols, $headers, $aligns); This will set the $user FrontReport class variable
The FrontReport class method End() in lines 993-995 includes:
require_once($path_to_root . "/reporting/includes/class.mail.inc");
mail = new email(str_replace(",", "", $this->company['coy_name']),
$this->company['email']);
This method End() is called at the very end of each repXXX.php file.
All seems fine and hence the syntax to set the $this->user is wrong.
includes/session.inc provides the correct syntax:
$user = $_SESSION["wa_current_user"]->user;
Therefore Line 269 in reporting/includes/pdf_report.inc should be::
$this->user = $_SESSION["wa_current_user"]->user;
5,719 02/02/2013 03:32:43 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Line 47 of reporting/includes/class.mail.inc:
$this->header = "From: $name <$mail>\n";
may be replaced with:
$this->header = "From: $name <$mail>\nReply-to: $name <$mail>\n";
The $add_params variable in the class.mail.inc file remains unused. Quote from the PHP manual for mail():
additional_parameters (optional) : The additional_parameters parameter can be used to pass additional flags as command line options to the program configured to be used when sending mail, as defined by the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.
The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.
The $this-user in the other files may have an issue of scope of being an included file's variable.
5,720 02/02/2013 03:03:54 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
From the PHP mail() manual:
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);
?>
If the $this->user correctly enters the from header variable, it can be made to enter the same value into a $reply-to variable and used as above.
There is a $sender variable that gets populated as well?
Or just use the from header directly for the 'Reply-to' header.
5,721 02/02/2013 09:11:20 am
Re: Function "Payments to supplier": Exchange rate ignored? (2 replies, posted in Accounts Payable)
Exchange Rate is 1 for home currency. Recalculate all the others (done by getting the current exchanges rates and adjusting as required) and create currencies you use but are currently absent ad acquire / fix their exchange rates.
5,722 02/02/2013 09:07:38 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
How did you fix the return path? Was it the addition of a reply-to header in the script or in the class.mail.inc ?
$this->user is the currently logged in user whose email should be in the users table.
5,723 02/01/2013 07:40:06 am
Re: email of quotes (38 replies, posted in Accounts Receivable)
It is possible that the comma may be a delimiter somewhere and may need to be stripped out of the Name. Also was checking for consistency and alternatives to the existing mailer like the integration in similar context.
For your specific requirement, you may want to dump the variables just before the send() occurs in both the caller instance and in the class method as well.
5,724 01/31/2013 08:15:20 pm
Re: email of quotes (38 replies, posted in Accounts Receivable)
Anyone integrated PHPMailer in the place of the existing class.mail.inc ? This will enable sending using a relay SMTP server like gmail.
class.mail.inc is called and instantiated only in sales/includes/db/sales_order_db.inc and reporting/includes/pdf_report.inc. Hence such integration with PHPMailer would be easy.
Lines 994-996 in reporting/includes/pdf_report.inc:
$mail = new email(str_replace(",", "", $this->company['coy_name']),
$this->company['email']);
$mail->charset = $this->encoding;
Line 104 in sales/includes/db/sales_order_db.inc:
$mail = new email($company['coy_name'], $company['email']);
The charset is missing and the coy_name is not stripped of commas in the latter case.
The latter should be:
$mail = new email(str_replace(",", "", $this->company['coy_name']), $this->company['email']);
Better still would be to move the stripping of the commas to the class method constructor itself by inserting the following in line 47 of reporting/includes/class.mail.inc:
$name = str_replace(",", "", $name);
and removing the str_replace from both files that use the class.
5,725 01/30/2013 02:24:36 pm
Re: Buttons missing from Sales, Purchase, etc. tables (14 replies, posted in Report Bugs here)
It is possible that your folder permissions failed to allow the webserver process to create the said file. Just create a an empty faillog.php file in the webroot with permissions and ownerships that allow the webserver to write to it.