Inventory valuation report wont show Items whose quantity is 1 and the units of measure for that item is set to use "User Quantity Decimals" decimal places option. The "User Quantity Decimals" option has a value of -1 thus below MYSQL condition will result to zero:

SELECT ROUND(1, -1);

Result: 0

I would propose a condition to check negative values as shown below:
File: rep301.php
Function: getTransactions($category, $location, $date)...

HAVING ROUND(SUM(move.qty), IF(units.decimals>0,units.decimals,0)) != 0

When you add an item with editable description to the inventory location transfer form, the new line description field comes as a inputbox instead of dropdown making it hard to select another item.
Fix:

In transfers.php file,

add

unset($_POST['stock_id']);

to the handle_new_item() function

function handle_new_item()
{
    if (!isset($_POST['std_cost']))
           $_POST['std_cost'] = 0;
    add_to_order($_SESSION['transfer_items'], $_POST['stock_id'], input_num('qty'), $_POST['std_cost']);
        unset($_POST['stock_id']);
    line_start_focus();
}

True... Does it get into the core?

Any Updates?

Noted permission for Inventory Purchasing Report is misplaced. Please change permission for  Inventory Purchasing Report from 'SA_SALESANALYTIC' to 'SA_SUPPLIERANALYTIC' or something relevant.

Sorry, I meant the idea used in Foreign Item Codes which is a secondary product code created from the primary StockID. This Product codes can be used to map product variances or cases as specified by @ccmacachor

I agree with @aleifuuwork, this feature is desirable. I have modified the relevant files to hide reports menus that are not authorized.

In reporting/includes/reports_classes.inc file:
Change report Class to include $access variable like this:

class Report
{
    var $id;
    var $name;
    var $ar_params;
    var $controls;
    var $access;
    
    function __construct($id, $name, $ar_params = null, $access = null)
    {
        $this->id = $id;
        $this->name = $name;
        if ($ar_params) $this->set_controls($ar_params);
                $this->access = $access;
    }
    
    function set_controls($ar_params) {
        $this->controls = $ar_params;
    }
    
    function get_controls() {
        return $this->controls;
    }
    
}

In reports_classes.inc file line 83 getDisplay function, add:

if($report->access != null && !$_SESSION["wa_current_user"]->can_access($report->access) && $_SESSION["wa_current_user"]->hide_inaccessible_menu_items())
                                continue;

Finally modify each $reports->addReport call in reporting/reports_main.php to include the $access variable.
e.g Customer Balances report:

$reports->addReport(RC_CUSTOMER, 101, _('Customer &Balances'),
    array(    _('Start Date') => 'DATEBEGIN',
            _('End Date') => 'DATEENDM',
            _('Customer') => 'CUSTOMERS_NO_FILTER',
            _('Show Balance') => 'YES_NO',
            _('Currency Filter') => 'CURRENCY',
            _('Suppress Zeros') => 'YES_NO',
            _('Comments') => 'TEXTBOX',
            _('Orientation') => 'ORIENTATION',
            _('Destination') => 'DESTINATION'),'SA_CUSTPAYMREP');

Edited, Also modify addReport() function in reports_classes.inc file like this:

function addReport($class, $id, $rep_name, $params=null,$access=null)
    {
        unset($this->ar_reports[$class][$id]); // unset std report if any
        $this->ar_reports[$class][$id] = new Report($id, $rep_name, $params, $access);
    }

This solution will allow for backward compatibility especially for extensions that implement reports.
If this solution is acceptable to the core, I will modify the whole reports_main.php file to affect all reports.

I have experienced the same error. As @Cambell said, there are some cases where className may not be a string e.g an SVGSVGElement. This is happening to me when am am developing a theme that uses SVG Elements.
I suggest change of varriable "found[k].className" to "found[k].getAttribute('class')" as shown below:

Line 164 change from:

if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {

To

if (found[k].getAttribute("class") != null && found[k].getAttribute("class").match(new RegExp('\\b'+className+'\\b'))) { 

Please consider this fix

Foreign Item Codes would be the feature to use here only if the foreign code gets saved in the db on transactional basis.
Maybe Admins should consider this modification since it can be applied in other areas too

As I noted earlier, this fix will still throw an error when you have purchase orders on the supplier payment form. I still stand with the fix I provided. It will cater for all scenarios for both customer and supplier payments.

@joe, you have been so quiet at this issue. Atleast let me know if this desirable or not. Users who are not supposed to access items add/edit are able to access it since they require the search popup.

Please reply on this.

12

(6 replies, posted in Setup)

Frontaccounting really needs a review for add, edit, list and view permissions. The Administrators should guide us on the roadmap they are taking on this issue and how we can help

Might you have allocated the payments while entering customer payments. If so, then you would not need to go back to allocations.

This line of code was modified a while ago in this topic:frontaccounting.com/punbb/viewtopic.php?id=8672
This code however throws an error on journal entries (As mentioned above), Prepaid sales Orders and purchase orders. To rectify all these I have modified the code as below:

if ($_SESSION['alloc']->person_type == PT_CUSTOMER) {
            if ($_SESSION['alloc']->allocs[$counter]->type == ST_SALESORDER)
                $trans = get_sales_order_header($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);
            else if($_SESSION['alloc']->allocs[$counter]->type == ST_JOURNAL){
                            $trans['debtor_no'] = db_num_rows(get_gl_transactions($_SESSION['alloc']->allocs[$counter]->date_, $_SESSION['alloc']->allocs[$counter]->date_, $_SESSION['alloc']->allocs[$counter]->type_no,null, 0, 0, $_SESSION['alloc']->allocs[$counter]->type,null,null, PT_CUSTOMER, $_SESSION['alloc']->person_id))?$_SESSION['alloc']->person_id:0;
                        } else
                $trans = get_customer_trans($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);

            if ($trans['debtor_no'] != $_SESSION['alloc']->person_id) {
                display_error(_("Allocated transaction allocated is not related to company selected."));
                set_focus('amount'.$counter);
                return false;
            }
        } elseif ($_SESSION['alloc']->person_type == PT_SUPPLIER) {
            if ($_SESSION['alloc']->allocs[$counter]->type == ST_PURCHORDER)
                $trans['supplier_id'] = $_SESSION['alloc']->person_id;
            else if($_SESSION['alloc']->allocs[$counter]->type == ST_JOURNAL){
                            $trans['supplier_id'] = db_num_rows(get_gl_transactions($_SESSION['alloc']->allocs[$counter]->date_, $_SESSION['alloc']->allocs[$counter]->date_, $_SESSION['alloc']->allocs[$counter]->type_no,null, 0, 0, $_SESSION['alloc']->allocs[$counter]->type,null,null, PT_SUPPLIER, $_SESSION['alloc']->person_id))?$_SESSION['alloc']->person_id:0;
                        } else 
                            $trans = get_supp_trans($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);
            if ($trans['supplier_id'] != $_SESSION['alloc']->person_id) {
                display_error(_("Allocated transaction allocated is not related to company selected."));
                set_focus('amount'.$counter);
                return false;
            }
        }

@Administrators please re-look into this issue because this bug is serious

@joe what is your take here? I consider this a small modification that would not cause much trouble

A feature to restrict users, with no sales pricing edition permissions, from editing prices while creating a Sales Order/Delivery /Invoice is admirable. Here is the code:

File: sales/includes/ui/sales_order_ui.inc
Change function sales_order_item_controls as follows:

if (list_updated('stock_id')) {            
            $Ajax->activate('price');
            $Ajax->activate('units');
            $Ajax->activate('qty');
            $Ajax->activate('line_total');
            $Ajax->activate('price_lbl');
            $Ajax->activate('Disc_lbl');
        }
label_cell($units, '', 'units');

        if($_SESSION["wa_current_user"]->can_access('SA_SALESPRICE')){
            amount_cells(null, 'price');
            small_amount_cells(null, 'Disc', percent_format($_POST['Disc']), null, null, user_percent_dec());
        } else {
            amount_cell(input_num('price'),false,'','price_lbl');
            hidden("price",$_POST['price']);
            
            amount_cell(input_num('Disc'),false,'','Disc_lbl');
            hidden("Disc",$_POST['Disc']);
        }

@joe what do you say here?

And also for void_journal_trans. Or basically all transactions that can be voided and don't have this hook

Since other transactions have a prevoid hook, It would be usefull to extension developers to have a pre_void hook for bank_transactions also.

I would suggest putting below line before

void_bank_trans($type, $type_no);

(line 41) of admin/db/voiding_db.inc file:

hook_db_prevoid($type, $type_no);

20

(6 replies, posted in Setup)

Yes, I agree with you. The problem now is how do we go about it? Do we require the Administrator to do the bulk modifications of all the roles or do we handle each case as it arises.

Hello,
FA requires one to have ADD/EDIT ITEMS Permissions for one to access the "search ITEMS popup" e.g in Direct Invoice. This gives a lot of power to users who's only role is to create Sales Orders or Quotations in the system. I don't want want to give this users ADD/EDIT ITEMS permissions but i still want them to be able to search items with the popup.

I suggest we change the role required to an existing role such as "Items analytical reports and inquiries" or we create a new role all together.

In inventory/inquiry/stock_list.php Line 17:
change

$page_security = "SA_ITEM";

to

$page_security = "SA_ITEMSVALREP";

22

(6 replies, posted in Setup)

I appreciate your response though I really needed this in the core project.

Someone Please

Will appreciate.
Thank you.

Hey there.. Have you found some time on this