Found it. It was a permission issue as pointed out here. I asked my hosting provider to fix the permission issue and voilà! - problem gone

Hi all,

I installed FA  version 2.4.8 on my local machine (Ubuntu with LAMP) and everything was fine. I transferred it online to my shared hosting account and i get the following errors:


session_start(): open(/var/php_sessions/sess_mcol7rah9p8ucts7rrnhkm1a8kl0im66, O_RDWR) failed: No such file or directory (2) in file: ***/includes/session.inc at line 31
session_start(): Failed to read session data: files (path: /var/php_sessions) in file: ***/session.inc at line 31
session_regenerate_id(): Cannot regenerate session id - session is not active in file: ***/includes/session.inc at line 85
session_start(): open(/var/php_sessions/sess_ds1qt79vl694e7lcknhr38vjvvitubm8, O_RDWR) failed: No such file or directory (2) in file: ***/includes/session.inc at line 92
session_start(): Failed to read session data: files (path: /var/php_sessions) in file: ***/includes/session.inc at line 92

I read that I had to set session.auto_start=0 but that hasn't helped.

I have WordPress installed on the same hosting account but it works fine - no session issue.

How do I fix this please?

Thanks in advance.

3

(6 replies, posted in Setup)

I'm still not answered. If a user enters a transaction like customer payment, they can edit that transaction later. That is what I want to prevent.

Setup > Access Setup > Edit other users transactions helps block users from editing other users transactions. But how can I prevent a user from editing their own transactions (like customer payments)?

Please help, I really need this.

Hi all,

How does "Allocate Customer Payments or Credit Notes" affect our books, more specifically trial balance, P&L, balance sheet?

Also I see  "credit this" icon on the transaction page on the right side of invoices. What effect does it have on our books when we credit a sale invoice?

Thanks.

Bonjour all,

I have different work centers and each has specific locations raw materials are taken from. For instance, to produce Item A from Work Center 1, components (raw materials) are taken from Location 1.

To produce the same Item A from Work Center 2, components (raw materials) are taken from Location 2.

In setting up Bill of materials for Item A, I notice I have to select the Location (the source of raw materials).  How do I set up Bill of Materials for item A? Can I have more than one Bill of materials for one manufactured item?

Advanced thanks.

hi all,

there is Edit other users transactions which is very helpful. However, I want limit some users from editing their own transactions as well. How do I go about that?

Thanks in advance.

Hi all,

From yesterday, I noticed that some pages gave

Forbidden

You don't have permission to access /admin/users.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

According to my Hosting company, they've upgraded their systems and going forward, all URLs that end with a ? are forbidden.

There are very many such pages in FA, not only /admin/users.php?. For instance, in SETUP, all the links end with ? except Attach Documents

What can I do about it? Can .htaccess help and how?

Advance thanks.

For Bank Account Transfers, the solution is similar to the others: we update the ref before the check_reference() runs. The file to edit is gl/bank_transfer.php


    /////////////// update ref 
    $_POST['ref'] = $Refs->get_next(ST_BANKTRANSFER, null, $_POST['DatePaid']);
    if (!check_reference($_POST['ref'], ST_BANKTRANSFER, $trans_no)) {
        set_focus('ref');
        return false;
    }

Solution for Bank Payments also as follows:

We update $_POST['ref'] just before check_reference() function runs. We do that by adding one line of code to gl/gl_bank.php

    //// Update $_POST['ref'] before check_reference()
    $_POST['ref'] = $Refs->get_next($_SESSION['pay_items']->trans_type, null, $_POST['date_']);
    if (!check_reference($_POST['ref'], $_SESSION['pay_items']->trans_type, $_SESSION['pay_items']->order_id))
    {
        set_focus('ref');
        $input_error = 1;
    }

Just got a solution for customer payment.

In the can_process() function in sales/customer_payments.php, I update $_POST['ref'] with the next available ref before check_reference() runs. That means, if the ref on the form is used, the next available will be chosen and the problem of used ref will never occur again.

I'm particularly happy that no warning message is displayed on the form to the user. That's exactly how I wanted it.

The code is as below:

    ////////// setting  $_POST['ref'] to the next available ref
    $_POST['ref'] = $Refs->get_next(ST_CUSTPAYMENT, null, array('customer' => get_post('customer_id'), 'date' => get_post('DateBanked')));
    if (!check_reference($_POST['ref'], ST_CUSTPAYMENT, @$_POST['trans_no'])) {
        set_focus('ref');
        return false;
    }

Starting with customer payment, any help?

Just installed it - FA 2.4.3 - but  the same problem. Sales order is OK but not customer payments, bank payments, bank transfers, location transfers, inventory adjustments.

davidkumi wrote:
unset($_POST['ref']); // force refresh reference
display_error(_("The reference number field has been increased. Please save the document again."));
//$_POST['ref'] = $_SESSION['Items']->reference = $ref;
//$Ajax->activate('ref');

Hi all, I used this solution also for delivery and invoices and it worked. However, I'm struggling with the other forms - customer payments, bank payments, bank transfers, inventory adjustments, location transfers, etc.

Is there one thing we can do to fix them all?

If not, kindly guide me through how to fix the The entered reference is already in use. problem in each. We can start with bank payments.

Thanks.

apmuthu wrote:

When would one want to change the reference the form automatically provides?

In our case, there are different users entering data at the same time. If two or more open the same form, they'll be assigned the same ref. After one saves successfully, the others will encounter The entered reference is already in use..

That is when references need to be changed.

Changing it manually was also not the best for us since instead of manually changing from say 134/2017 to 135/2017, sometimes they'd type funny things like 1352017 or 1355/2017 or 135/2o17.

If it's automatic, none of these problems.

15

(1 replies, posted in Reporting)

Hi all,

I use the dimension module and all customers are in dimensions. I want to display customer balances by dimensions.

I've added

_('Dimension')." " => 'DIMENSIONS1',

to _('Customer &Balances') in reporting/reports_main.php and have modified the reporting/rep101.php in two areas

$dimension = $_POST['PARAM_5'];

and

    
    $sql = "SELECT debtor_no, name, curr_code FROM ".TB_PREF."debtors_master ";
    if ($fromcust != ALL_TEXT)
        $sql .= "WHERE debtor_no=".db_escape($fromcust);
    if ($dimension != 0) 
        $sql .= " AND dimension_id=".$dimension;// I added this line
    $sql .= " ORDER BY name";
    $result = db_query($sql, "The customers could not be retrieved");

When I select a dimension and click display, nothing happens - no pdf report. But if I don't select a dimension on the report page, the pdf report displays fine.

What am I doing wrong?

Thanks in advance.

itronics wrote:

This problem just have been fixed in our repo, the fix will be included in next release.
Thanks.

Janusz

Oh yes, you're right. It works like magic. Just had to comment out those two other lines as below:

unset($_POST['ref']); // force refresh reference
display_error(_("The reference number field has been increased. Please save the document again."));
//$_POST['ref'] = $_SESSION['Items']->reference = $ref;
//$Ajax->activate('ref');

Thank you, thank you, thank you all

itronics wrote:

This problem just have been fixed in our repo, the fix will be included in next release.
Thanks.

Janusz

Still not working. Unset() definitely destroys $_POST['ref'] but does not refresh/change/increase the ref field on the form and clicking Place Order  again doesn't save the order, just displays same error message again.

 $ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today()));

The get_next() function rightly gets the next available ref. So the only thing left to do is to set the value of the ref field on the form to $ref.

How do we set/change/increase/refresh the value of the ref field on the form to $ref?

apmuthu wrote:

@joe: It is better to remove the Reference field from all such forms and save as next available Reference automatically and informing the user of the actual reference it was saved as by reporting it in the "success" message.

Yes, I think that'll be great.

In the interim though, any way I can get the value in the ref field on the form increasing to the next available ref? Or automatically saving with the next available ref if the one displayed is used?

kvvaradha wrote:

@davidkumi, Why don't you try a new installation with recent one. If the new on works, you can compare the code and get solution for the problem .

I just did a new install but still the same 

The entered reference is already in use.The reference number field has been increased. Please save the document again.

But it doesn't increase. My version is FA 2.4.2. Which version are you using which does not have this problem?

boxygen wrote:

@davidkumi you mean that at any point if the system faces the duplicate reference issue, instead of notifying the user it shall just jump to next available reference?

No sir, it notifies the user but does not update/increase the value of the ref field on the form to the next available ref.

So I want achieve one of two things:

  1. Either the user is notified that the ref is used and the ref field on the form is changed to the next available field

  2. Or the user is NOT notified that the ref is used but when saving, it automatically discards the used ref and uses the next available ref

Not working.

If you want to replicate this problem to try, open new sales order in two different browsers. They'll have the same refs. Save one (it'll go through successfully) and then click to save the second and you'll get the error we're discussing on this page.

I still need the help of you all. This is important to me.

Any other idea?

OK, what if I want to use the next available ref to save without prompting the user if the one on the form is already used?

For instance, let's say the ref on the form is 155/2017 but it's already used. Instead of prompting the user that it's used, I want it to automatically pick the next available, say 157/2017 (assuming 156/2017 is also used) and not prompt the user but rather just go ahead and save the order with 157/2017.

How do I do that? How do I skip the prompting and just go on to save with the next available ref?

If a new sales order, refreshing clears all the items added.

The display_error($_POST['ref']); displays the next available ref but the ref field on the form still has the old, used ref

The get_next function correctly gets the next available ref but doesn't update the ref field on the form.

$ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today()));

So the only thing I need now is this: how do I change the used ref number on the form to this new $ref generated by the line of code above?

Thanks.