Topic: Requisition Module Not Working

Hi all,

I'm relatively new to FrontAccounting and am looking at it for accounting for a small non-profit organization I'm involved with.  I downloaded and installed it successfully.  I also downloaded the Requisitions Module through the Install/Activate Extensions screen but it seems to not work.  When I click on Requisition Entries, I get the following message:

DATABASE ERROR : could not get all requisitions
error code : 1146
error message : Table 'front.0_requisitions' doesn't exist
sql that failed was : SELECT * FROM 0_requisitions WHERE (completed = 0) AND !inactive

Clicking Requisition Allocations gives this error:

DATABASE ERROR : could not get all requisition_details
error code : 1146
error message : Table 'front.0_requisition_details' doesn't exist
sql that failed was : SELECT * FROM 0_item_codes ic INNER JOIN 0_requisition_details rd ON ic.item_code = rd.item_code INNER JOIN 0_requisitions r ON rd.requisition_id = r.requisition_id LEFT JOIN 0_suppliers s ON rd.supplier_id = s.supplier_id WHERE (r.completed = 1) AND (rd.lpo_id = 0) ORDER BY r.requisition_id

Does anyone know how to fix the error and get the Requisitions Module operational?

Thanks in advance!

Re: Requisition Module Not Working

Please send a link to the tar.gz file of the requisition module. I caould not find it on the FA site nor at this forum post

It appears that the module needs the two tables to be created first.

Re: Requisition Module Not Working

I don't have a link to the tar.gz file.  I installed the module by logging into FA, then going to the Setup tab and choosing Install/Activate Extensions.  Is there some way to find this file?

Re: Requisition Module Not Working

You will find it all in a folder called _cache in the modules folder.

5 (edited by apmuthu 12/13/2012 07:57:57 pm)

Re: Requisition Module Not Working

The original FA requisitions-2.3.3-7.pkg is at:
http://anonymous:password@repo.frontaccounting.eu/2.3/extensions/requisitions-2.3.3-7.pkg

Made corrections (as detailed in the forum post) to the extension and bundled it as a normal tar file - just add the modified debian sauce and place it for download at the repo.frontaccounting.eu site.

The corrections are in the hooks.php, sql/update.sql and _init/config files.
It still cannot work properly - anyone got it to work?

What should the installed_extensions array be for such a module?

Post's attachments

requisitions-2.3.13-1.tar.gz 9.9 kb, 7 downloads since 2012-12-13 

You don't have the permssions to download the attachments of this post.

Re: Requisition Module Not Working

I have fixed a couple of issues in Requsitions module and the package in repository has been updated. Now all the functionality implemented by Dennis Gichangi should work right, also some small changes were made in the code which should result in a little better user experience.

Unfortunately there was also installation bug found in core FA, which results in non intialized database after installation. The bug was already fixed in Hg repository, but the new minor FA version is not planned until next year. Therefore to make use of the new module version  you have to do following steps:
. make backup of your company database
. uninstall requisition module in Create/Install Extension page
. install it again from the repo (on the same page)
. read module description - you will find important warnings here
. open your company database in phpmyadmin and import /modules/requisitions/sql/update.sql file.

Now the requisition module should be usable. Keep in mind there is a little non-standard interface implemented by author.
Entering requisition is not complete until you select Details link, enter a couple of requisition lines and select Complete link finally.

Janusz

Re: Requisition Module Not Working

@Janusz

The empty.po (and other language files possibly) have your dev machine path set like

#: /home/janusz/FA/fa_stable/Repo/srcs/2.3/requisitions/_devel/../hooks.php:16 

Very extensive work indeed. Congrats.

Re: Requisition Module Not Working

Thanks. The path will almost always differ from the real path. Those are only handy comments for translators, to recognise context of the translated text.
Janusz

Re: Requisition Module Not Working

What is the script you use to get the gettext to do the job?

Re: Requisition Module Not Working

This is just a couple of calls to xgettext/msgfmt. Something like:

#!/bin/bash
LANG=pl_PL
MAINVER=0

MAINDIR=`pwd`/..
LANGDIR=$MAINDIR/lang/$LANG/LC_MESSAGES
TPL=lang/new_language_template/LC_MESSAGES/empty
GTEXEC="xgettext  -d empty --language=PHP  --from-code=ISO-8859-1 -p $MAINDIR/lang/new_language_template/LC_MESSAGES "
cp header.po $MAINDIR/$TPL.po

ROOTDIR=../../../..
cd $MAINDIR

$GTEXEC -k_ -n -j *.php
$GTEXEC -k_ -n -j includes/db/*.inc
$GTEXEC -k_ -n -j includes/*.*
$GTEXEC -k_ -n -j $ROOTDIR/themes/default/renderer.php

11 (edited by apmuthu 01/18/2013 02:11:50 pm)

Re: Requisition Module Not Working

Thanks Januz.

I have standardised the method of generation of [both main and install empty.po files with:

#!/bin/bash

mkdir -p /tmp/fagettext
cd /tmp/fagettext

FAVERSION="2.3.14"
FRONTACFILE=frontaccounting-$FAVERSION.tar.gz

wget https:/sourceforge.net/projects/frontaccounting/files/FrontAccounting-2.3/$FAVERSION/$FRONTACFILE
tar -xzf $FRONTACFILE
rm -f $FRONTACFILE

MAINDIR=`pwd`/frontaccounting

cd $MAINDIR

# Generate the main empty.po file

TPL=lang/new_language_template/LC_MESSAGES/empty
GTEXEC="xgettext  -d empty --language=PHP  --from-code=ISO-8859-1 \
                  -p $MAINDIR/lang/new_language_template/LC_MESSAGES "

# Backup the old main empty.po
mv $MAINDIR/$TPL.po $MAINDIR/$TPL.po.org

# Generate main header as well
$GTEXEC -k_ -n *.php

# set the charset
sed -i 's/charset=CHARSET/charset=ISO-8859-1/g' $MAINDIR/$TPL.po


mv install ..

$GTEXEC -k_ -n -j */*.php
$GTEXEC -k_ -n -j */*/*.php
$GTEXEC -k_ -n -j */*/*/*.php
$GTEXEC -k_ -n -j */*.inc
$GTEXEC -k_ -n -j */*/*.inc
$GTEXEC -k_ -n -j */*/*/*.inc

mv ../install .

# Generate the install empty.po file

ITPL=install/lang/new_language_template/LC_MESSAGES/empty
GTEXEC="xgettext  -d empty --language=PHP  --from-code=ISO-8859-1 \
                  -p $MAINDIR/install/lang/new_language_template/LC_MESSAGES "

# Backup the old install empty.po
mv $MAINDIR/$ITPL.po $MAINDIR/$ITPL.po.org

# Generate install header as well
$GTEXEC -k_ -n install/*.php

# set the charset
sed -i 's/charset=CHARSET/charset=ISO-8859-1/g' $MAINDIR/$ITPL.po

$GTEXEC -k_ -n -j install/*.inc
$GTEXEC -k_ -n -j includes/system_tests.inc
$GTEXEC -k_ -n -j includes/packages.inc

cd $MAINDIR
tar -czf ../../fac_empty_po.tar.gz $TPL.po $ITPL.po
cd ../..
rm -rf fagettext

echo "fac_empty_po.tar.gz created"

Have Wikied it as well.

Attached are the empty.po files taken from the gettext of the FA v2.3.14 code.

Post's attachments

fac_empty_po.tar.gz 57.4 kb, 2 downloads since 2013-01-18 

You don't have the permssions to download the attachments of this post.

Re: Requisition Module Not Working

Setup / Install/activate extensions / select your company / deactivate Requisitions / Update
then activate Requisitions again & problem solved!

Rene

DotNM wrote:

Hi all,

I'm relatively new to FrontAccounting and am looking at it for accounting for a small non-profit organization I'm involved with.  I downloaded and installed it successfully.  I also downloaded the Requisitions Module through the Install/Activate Extensions screen but it seems to not work.  When I click on Requisition Entries, I get the following message:

DATABASE ERROR : could not get all requisitions
error code : 1146
error message : Table 'front.0_requisitions' doesn't exist
sql that failed was : SELECT * FROM 0_requisitions WHERE (completed = 0) AND !inactive

Clicking Requisition Allocations gives this error:

DATABASE ERROR : could not get all requisition_details
error code : 1146
error message : Table 'front.0_requisition_details' doesn't exist
sql that failed was : SELECT * FROM 0_item_codes ic INNER JOIN 0_requisition_details rd ON ic.item_code = rd.item_code INNER JOIN 0_requisitions r ON rd.requisition_id = r.requisition_id LEFT JOIN 0_suppliers s ON rd.supplier_id = s.supplier_id WHERE (r.completed = 1) AND (rd.lpo_id = 0) ORDER BY r.requisition_id

Does anyone know how to fix the error and get the Requisitions Module operational?

Thanks in advance!