51

(22 replies, posted in Report Bugs here)

Looking at this Stack Overflow answer I would suggest adding the 'Content-Type: text/plain; charset=UTF-8' header to the 'body' parameter in the call to the mail function.

It seems from this post that support for unicode email addresses in the local part is relatively new. e.g. Postfix supported it in 2014.  It very much depends on what email software your server (or ISP) has installed to support the sending of email.  I suspect that if you use gmail, or google apps for business then you wouldn't have any problems (assuming the content header is set correctly).  Using Postfix for example you would need to ensure that version 3.0 or greater is installed.  In the debian world this would be Debian Stretch.  Wheezy and Jessie are both on Postfix 2.x.  You can find further information on SMTPUTF8 support and links to relevant RFC on the Postfix SMTPUFT8 page.

To be safe, I would suggest that all email addresses in *your* organization use the 128 lowercase ascii characters as required under the old standard.

52

(22 replies, posted in Report Bugs here)

The error suggests that it is your 'from' email address of your company that has issues, not the name or email address that you are sending to.  Do you have the full headers of the email that bounced that you can post?  Possibilities are:

- FA is not correctly encoding the from email address in sent mail.
- The remote email server does not support utf8 (very unlikely).

I have already modified the UI code to delegate rendering to themes.  This means that you can create a fully responsive bootstrap theme.  Adding javascript controls (even using Angular) into this would not be hard.

Here's the demo:

http://demo.saygoweb.com/frontaccounting/

This work is available as a pull-request on FA and is available against 2.4.  I'm not sure that its completely up to date with the latest unstable (now master) - but it would be quite close.

If you're wanting to make 'ui code changes' I suggest that you have a look at the work I've already done.

I've got AngularJS and Angular 2.x, 4.x experience.  Its not clear to me that this would be a good idea in the case of FA.  What code would you be looking to keep from FA?

I think it would be better to keep the existing JsHttpRequest (essentially div swapping) and augment with dynamic components like date picker, typeahead etc where those are desirable.  Incorporating the Bootstrap work would also be a good thing IMO.

If you were to do a complete replacement of JsHttpRequest with Angular I think you'd find the architecture to be very different. 

The views would all be replaced, along with requiring a REST (or some kind of) API for the Angular client to talk too.  That would be a lot of work.

Also, this scale of work would be unlikely to be incorporated into FA.

Likely mysql php vs mysqli.  If you set debug=1 in the config php file you would see the error displayed.  FA 2.4.x supports mysqli which is preferred over mysql in PHP 5.x

56

(14 replies, posted in Report Bugs here)

FYI, the old style constructors (same name as class) started to be deprecated in PHP 5.3.3 (in the case that a namespace was used - which is not used in FA).  The new style __construct was introduced in PHP 5.  The old style is deprecated in PHP 7.

See http://php.net/manual/en/language.oop5.decon.php for more info.

57

(14 replies, posted in Report Bugs here)

The changes were made against 2.4, the unstable branch.  So, are you saying there's a large user base of 2.4 users using php 5.3?  If that's the case simply add that to the Travis test set.

58

(14 replies, posted in Report Bugs here)

PHP 5.3 went end of life nearly 3 years ago.  The Travis Tests are running on PHP 5.4 and are all passing.

If you all were to integrate the test from this PR then you would be able to continually run the tests on Travis against multiple versions of PHP.

There are also additional changes in a subsequent commit.

59

(1 replies, posted in Report Bugs here)

Hi,

The PR queue is getting quite long.  Some of them have been sitting there for over a year now.  Would you all like them included, or closed?

60

(14 replies, posted in Report Bugs here)

I've done a few more php 7 fixes.

https://github.com/cambell-prince/frontaccounting/commit/65957eac3be2fae85088be43466b89d1025e7c31

Or we could merge in the code to delegate the rendering to classes.  That's been available for over a year now.  https://github.com/FrontAccountingERP/FA/pull/8

62

(12 replies, posted in Banking and General Ledger)

The original PR was here: https://github.com/FrontAccountingERP/FA/pull/10 Feb 2016.

63

(12 replies, posted in Banking and General Ledger)

One modification I made to FA was for the Bank Account to always default to the last used for the given Supplier.  I always tend to use the same account per supplier. e.g. Some are Direct Debit from a particular account, some are always via Credit Card.  That practically eliminated incorrect bank account selection in my case.

I had a look at your test site.  The ajax request does result in a 302 redirect to the root '/' which returns a standard apache indexes page. This isn't javascript, so causes the error.

Do you have a .htaccess somewhere in the tree / or /apmuthu or /apmuthu/sales?

Do you or your host have a misconfigured location or directory directive in your apache config.

Does your host use mod-security or something similar?

I can't be sure without actually investigating your server, but I think this is a server configuration issue.

You could check your chrome plugins.  Disable them all then re-enable one by one.  Maybe you have a plugin that is interfering with the Javascript on the page.

As a bit of a guess, I'd say that your session timed out.  i.e. you tried to do something on a page that uses  ajax to do the save, however the session was timed out, so you should've been redirected to the login.  It seems that / on your installation isn't where FA is, so you got a standard index page which couldn't be parsed by the JsHTTPRequest javascript code - hence this error.

Try Ctrl-R to reload the page and see if it comes right from there.

67

(2 replies, posted in Wish List)

Something like this in a .htaccess file, assuming you're using Apache.

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/noway.html$
RewriteCond %{REMOTE_ADDR} !=123.45.67.89
RewriteRule $ /noway.html [R=301,L]

or you could add an iptables firewall rule, again if its a linux box.

@Jinkels.  I did my test on the latest 2.4.RC1.  Pretty sure it has the problem I described above.

69

(5 replies, posted in Setup)

See also this thread which has info on configuring mysql to create unique primary keys across separate instances.

It seems to me that if you use the Sales | Customer Payments method it works correctly.  However, if you process a Bank | Deposit, then Sales | Customer Allocation the customer allocation process does not process the foreign currency difference correctly (it gets it backward, and doesn't take the difference between the settled amount and the original invoice amount in AR).

@Jlinkels: Note that you should be doing a Bank Deposit Entry for a customer payment (not a Bank Payment Entry which would be for a supplier).  Given your example, I think that's what you mean - and processing the Bank Deposit then Allocation results in this error.

I think this error still exists in 2.4.x.  I'm running that and have reproduced this error.

@apmuthu. At that line it would be fine, but the use of POST becomes more consistent now that we've had to assign the $_POST['trans_no'] 2 lines above.  This is because we've introduced an ajax refresh into the page which needs the trans_no to be present in a hidden control which is added on line 155 of the patch (line 822 of the real file).  Your patch is not comparing the correct files I think.  It might pay to note that the first commit in the github repo didn't start with the original sales_order_entry.php, it had already been modified prior to the first commit.  Note also that the patch shown is only for that single file.  All the other files are required also.  Particularly the includes/ui/... which have also been modified.

The order of $path_to_root doesn't matter.  But, this is a recurring sales module, not a proposed change to the core sales module.

If you're looking to backport it to 2.3, there's a bit more work to do that than applying a patch.  As I've indicated above, I've got no interest in doing that myself (sorry).

For those interested, here's a link to the patch between sales/sales_order_entry.php and modules/sgw_sales/sales_order_entry.php

apmuthu wrote:

To port it to FA 2.3, what gotchas need to be looked out for? Any FA v2.4 specific dependencies are in place?

The main view is taken from a copy of the sales order module in core.  So that file has been updated to v2.4, and I've modified it further from there.  So, to make it work for v2.3 it is necessary to backport the changes to the v2.3 version of the sales order entry file.

I can't imagine the v2.4 sales order entry working with v2.3 out of the box.  As you point out in your second post, it didn't work for you.

apmuthu wrote:

Can the "vendor" folder in the release be removed and all references to include_once(__DIR__ . '/vendor/autoload.php'); be expanded out or moved to an include-able file since practically everyone uses PHP >= 5. Alternatively include the vendor folder in the git tree.

This is a PSR-4 autoloader (as specified by the PHP Framework Interop Group), via composer.

This is the current best practice method for producing an autoloader, which then does not need any require statements at all (other than of course including the autoloader).

Developers can recreate the vendor folder entirely by doing 'composer install'.  All other users should use the tarball releases supplied, which include all the required files.

apmuthu wrote:

Also please include the file views/view_sales_order.php in the github code tree as it is still referred to in generate_recurring_invoices.php and is available in the release.

Done. Thanks for that.

apmuthu wrote:

References: DataMapper ORMDesignPatterns and Namespaces.

The PHP Design Patterns site is good.  I don't recommend the first link on DataMapper ORM.  IMHO that author has conflated the concepts of Object Model and Data Mapper.  A Data Mapper should be able to persist any model.  An object model should not care how it is persisted.  My DataMapper class would be better named FrontAccountingMySQLDataMapper to be more descriptive.

75

(7 replies, posted in Setup)

To modify the menus in your extension you need to implement the 'install_options' hook.  Here's an example from one of my extensions.

To see all the hooks that are available have a look in includes/hooks.inc in the core.

To modify the icon that you see relating to any menu item you need to do 2 things:

1. Specify the category when creating the menu item.  Each menu item is an instance of the app_function class.  Its constructor takes a $category.

2. The renderer class in the theme has a function that maps category to icon.  function get_icon($category).  You can then use this to map to the icon you want.

The icon image should be within the theme folder.