Not sure whether you did this too, but to make it worthwhile, all the 'comment' and 'memo' fields in the various tables need to be expanded to eg. mediumtext at least (from tinytext - <255 characters).

It was also written for an older version of FA, so the module doesn't work on the latest framework. Most of the work to upgrade it would be making it consistent with FA, not zen cart (which hasn't changed that much).

I updated it to oscommerce, but didn't get further than basic testing.

Hi Guys
When I make an invoice and choose a dimension, I can't find the dimension field updates on the 0_debtor_trans table. Is this where it should go?
Or elsewhere?
Right now, it's leaving the dimension set at 0 regardless of what I enter.
Thanks
Pete

Yep that's what I did tclim, but see above, I'm getting the password error:
Fatal error: Uncaught exception 'Exception' with message 'Invalid User ID or Password!!!
for demo@anterp.com
password1
I think

tclim wrote:

Hi p2409,

  Can you try this, open a new firefox browser, enter the soap url as

  http://localhost/FA234/api/soap.php?wsdl

   Did you see any soap webservice is up and running?

The problem is 'missing ..//lib/Ldap.php' file...

A hint maybe, I commented out the include of Ldap.php (I think my php has LDAP compiled in), then I get a screen that looks like HTML (but not rendered as such), in the errors then I see demo@anterp.com/password password failure.

Quick question tclim:
When attempting to run soap-test.php, I'm getting:
XML error parsing WSDL from http://localhost/FA234/api/soap.php?wsdl on line 2: Invalid document end
and a list of debug/error information.

Any ideas what might be wrong?
Thanks
pete

tclim wrote:

Hi Excellence/Itronics,

   Thanks you for your testing on the WebService API and great to hear that you have tested and verify it work fine.  This webservice API can be extended and share among others members in FA. Nice !!!

Cheers,

  tclim

Tclim thanks for kicking off the soap API. We can now get started on building more interfaces. An effective soap interface requires rigorous naming standards ie use of words get/set and spelling of entities. Are you working to a standard or is this something you havent thought about yet?

Your question is vast, so youre unlikely to be handheld through this, but as a starting point, check out the code in th 'import multi journal entry' module for examples of how to update the ledger with code. This code does not run anymore in the current version, but the logic and all the calls (except for add bank account transaction) are the same. (I have sent an updated import any transaction module to the site owners which willll hopefully appear to download soon)

34

(2 replies, posted in FA Modifications)

AndrewE wrote:

Can anyone recommend a development environment or debugger to use for debugging the PHP code?

Hi Andrew.
I use Netbeans (Mac version) with xdebug which works really well, and is free.

Hi Guys

Mucking about modules at the moment, and have just written a versatile function to calculate start/end dates of quarters. With some adjustment to fit naming standards etc. it might be useful to include in date_functions.inc at some point. Hope someone finds it useful!
Pete

/**
 * Get last quarter start and end dates for today. Eg. 13/12/2010 = 1/10/2009, 31/12/2009
 * @param array $qtr_dates Referenced array of quarter dates (0=start, 1=end)
 * @param int $num_qtrs How many quarters back/forward (default 0 = this quarter)
 */
function get_quarter_dates(&$qtr_dates, $num_qtrs = 0) {
    // work out the last quarter dates, and store in the qtr_dates array
    include_once($path_to_root . "/includes/date_functions.inc");
    // 1. Get current month (number)
    $this_month = date('m');
    //$this_month = 1; TEST
    // 2. Calculate the start month for this quarter.
    $this_qtr = intval(($this_month - 1)/3) * 3 + 1;
    // 3. Subtract 3 months from this quarter start date to get last quarter
    $qtr_dates[0] = add_months(__date(date('Y'),$this_qtr,01),$num_qtrs*3);
    // 4. Add two months and get last day of that month for end of last quarter.
    $qtr_dates[1] = end_month((add_months($qtr_dates[0],2)));
}

36

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

Janusz do you mean when running 'Access Setup'?
I did that, but it doesn't appear to change the variable (to false or true when selected).

rodw wrote:

A vote for this from me too for GPL as it would add great value to FA.
Rod

Me too.
Looks great tclim...good luck with it!

38

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

Thanks Janusz.

I've create hook.php, the import_transactions.php file and a config text file as you describe.
I can install the module OK, but found that that to see the new menu item I had to manually edit

company/0/installed_extensions.php
to set

active=>'true'

How do I make sure this is set during the install process?
Thanks
Pete

39

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

Hi Guys
Think I lost the last post I tried to make on this: apologies if it's a duplicate)

I have updated/extended the import_multijournalentries module and it also now works in 2.34

I'm trying to work out how to package it up as a module.

Do I need to :
- create/complete _init directory
- manually edit installed_modules (/modules directory)
- create a hooks.php file

Is there a description anywhere, or can you recommend a complete module that does what's required for me to copy?
Thanks
Pete

I agree Rod, the second layout makes alot more sense to customers. Not sure if there's any additional FA processing you may need to do to get it like that though, or if it's inherent in the way FA works.

A suggestion: delete the contents of the js_cache directory under the company/x directory. I think this is OK to do (can the itronics/joe confirm?)

GarySmith wrote:

There are a few other quirks once you get down to the details but the trick is to start with the payment  and not the invoice.

Hope that makes sense.

PS. Australian GST is almost identical to UK VAT.

Gary that's exactly what I'm doing (in Aus). The UK VAT and GST systems are almost exactly the same, and for now, I'm pulling (via SQL and PHP scripts) the CASH transactions only as you describe.
These then get summed up for reporting on BAS.

By the way, a tip I found useful was to use the secondary code of the chart table to be the correct BAS item number. So, for instance, Office Expenses has G11 as its secondary ledger code. This helps when summarising.
(G11 means Non-capital purchases on the BAS statement).
My dream is to create a BAS report straight out of FA. This report would have a setup screen that allows you allocate each account to its relevant BAS report component.
The actual quarter-close transactions ie. paying your BAS etc. are being handled manually at the moment as its a bit difficult to get FA to 'code' a set of transactions, but this could be done too.

By the way, I also use e-record, and have written a script that takes the e-record transactions and turns them into the format required by 'Import Multijournal Transactions'. I can then import all my payments/deposits straight into FA. I've rewritten the Multijournal Transactions screens for FA 2.34 and will post soon. If anyone's interested in the (basic) e-record data translator, let me know in this post.

Pete

OK guys I've updated this module for FA234 and rewritten the logic to make it a bit clearer and reduce duplicated code. I've also very heavily commented almost all lines in it to make it clearer for people wanting to understand what's going on. It's probably more useful as a guide to FA internals rather than a useful import facility. I've got a strange issue (maybe just a Mac thing) where fgetcsv triggers EOF during the last record which is weird (I had to add an extra blank line to deal with it). When I've sorted it, I'll send it through.

Hi Wyxa
Sounds a bit obvious I know: are you sure you're in company 0?

45

(13 replies, posted in Banking and General Ledger)

IAS 21 says record the liability in your home ('functional') currency at the start date, then make P&L adjustments based on gain/loss. The original liability account should be untouched. FA handles it this way.

"IAS 21, The Effect of Changes in Foreign Exchange Rates requires recognition of foreign exchange differences as income or expense in the period in which they arise"

Given this, AP and AR are unchanged. Changes are reflected only in the P&L on forex.

Restating the original loan after a currency change is not done according to IAS 21 ie. your option b) is not appropriate if I've worked out the question you're trying to ask.

You need to acquaint yourself with the concept of double entry accounting, and drop the idea that a credit means an increase: an increase in bank account is always a Debit as it's on the Asset side of the equation. Lots of weblinks out there will help.

47

(13 replies, posted in Banking and General Ledger)

You have made a profit on forex, so you need to enter a balance day adjustment using a normal journal transaction :

CR a P&L account called something like 'Profit/Loss on Forex' or 'Profit and Loss on Forex Loan USD-EUR' if you need to be more specific.

DR an Asset account usually called something 'Retained profits on Forex' or 'Retained profits on forex loans' ('Retained' is the usual name for profit/losses brought to balance sheet in Australia, I think it's the same in Europe too. You may want to check a public company annual report for the right terminology).

You don't need to touch your original loan account: it's in USD so is unchanged in value in this currency.

This is the standard way of handling P&L on Forex changes - make balance day adjustments for all your revaluations (you may even need to to do this for things like debtors  and A/P, not sure about your jurisdiction).

Hope that helps.

48

(7 replies, posted in Setup)

If you are using Firefox and using a Mac, the 'Firefox PDF Plugin' for Mac OSX works well.

49

(13 replies, posted in Banking and General Ledger)

Loans have no affect on profit and loss so this question makes no sense. They are balance sheet items.

For a foreign currency loan you would set up a bank account in that currency.

To set up the loan you makie a journal entry where you:
a) DR the bank account receiving the cash.
b) CR a 'Loan' liabilities account.

As you pay off the loan, you make more journal entries: CR the bank account as the balance decreases and DR the liability loan account to decrease it.

I installed this module, but there are numerous incompatibilities with ver 2.2/2.3 I believe.

One question though before I keep delving into the code:

add_bank_transaction was a function in earlier versions of code, but doesn't look like it's in 2.2 or 2.3.

Is there a replacement (write_bank_transaction perhaps, although that's not used anywhere)?

Another question: has the framework for extensions changed significantly in recent (ie. 2.2+) versions, or is it basically the same?

Thanks guys
Pete