51

(2 replies, posted in Accounts Receivable)

Solution 1 seems good. Let me try it.
Thanks

Hello,
I am in a practical situation with one User. They Send Delivery Notes during the month and then Create Invoices by Month End.
Sometimes the Delivery Note is not accepted due to Quality or any other issue and the Stock is returned at a later date may by after week before the month end.

Now one way is to Void the Delivery Note created earlier but this will delete the Activity from the Stock Movement.

I want to maintain the activity to keep record of the DN Issued and then Stock Retruned against DN (Not Invoiced)

Any Idea how to do this in FA?

I also have the same situation.
For that I have added a Field in the Customer Setup as Related Supplier.
Now I need to have a merged Ledger to show both Transactions in one ledger.

Suggestions are needed to design this ledger.

Is this translation function _($text) a PHP's internal function?

You can refere to this article https://pakerp.com/blog/transactions-af … rage-cost/

There is very unlike situation in FA. When we make a Located Transfer to anther warehous then it shall not have any impact on Average Cost. Similary when that Location Transfer is voided then again it shall not hit the Average Cost but unfortunately it is not the case.

Such issues may turn the Average Cost to negative but FA doesn't maintain the Log of why the Average Cost is Affected and through which transaction.

In PakERP.com we maintain a log.

You can upload the zip file to your google Drive and then share the link with access rights.

I will give a try

Any void attempt shall smartly check if the transaction exists partially in database then it shall execute Void instead of showing the message that this transaction doesn't exists.

Anyway I did some modification to ensure force void if such situation occurs.

In admin/db/voiding_db.inc I modified code as below

case ST_BANKDEPOSIT : // it's a deposit
        case ST_BANKTRANSFER : // it's a transfer
            if (!check_void_bank_trans($type, $type_no))
                return _('This transaction cannot be voided because the operation would decrease account balance below allowed limit in some point of account history.');
                case ST_BANKPAYMENT : // it's a payment
            if (!exists_bank_trans($type, $type_no) && !exists_gl_trans($type, $type_no)) //modified by faisal
                return _('Selected transaction does not exists.');
            void_bank_trans($type, $type_no);
            break;

Also in admin/void_transaction.php

    case ST_BANKPAYMENT : // it's a payment
        case ST_BANKDEPOSIT : // it's a deposit
        case ST_BANKTRANSFER : // it's a transfer
            if (!exists_bank_trans($type, $type_no) && !exists_gl_trans($type, $type_no)) //modified by faisal
                return false;
            break;

Today one of my client did one Bank Payment Entry.
The Entry was half passed.
It created the GL Transaction but didn't create the Bank Transaction.
Hence the Transaction is reflecting in Ledgers and Journal Inquiry but Not in Others
And If We want to void it then it is also not available to void.
Attached is the Screen Shot.

1. Why this happens? It happened one time earlier also with Stock Adjustments.
2. How to handle this situation?

I just enabled the edit icon in customer inquiry page.

Even on editing the Non Free Credit Note, the allocation persists

Credit notes that are recorded irrespective of Sales Invoice / Sales Order

In FA the Free Hand Credit Notes are Editable but not the Non Free.

I just tried to allow the code to accept Editing for Non Free Credit Notes. I found that if working OK.

I am not sure Why it was set to disable. Any Idea?

64

(5 replies, posted in Development)

In order to get GridPHP work in FA as expected I needed to comment out following line in session.inc

html_cleanup($_GET);
html_cleanup($_POST);
// html_cleanup($_REQUEST);
html_cleanup($_SERVER);

What could be the adverse affect of this?

Hello,

In customer_invoice.php the following code is ineffective I think or may be I am not able to find the way how it works.

if (isset($_POST['_InvoiceDate_changed'])) {
    $_POST['due_date'] = get_invoice_duedate($_SESSION['Items']->payment, $_POST['InvoiceDate']);
    $Ajax->activate('due_date');
}

Reason of checking this code is that I am facing problem that when I am changing the Invoice Date then It is not changing the Due date. How shall I expect this to work?

You don't need to add a field rather you can define a new account in Chart of Accounts name Cash

67

(5 replies, posted in Development)

Hello all,
I was able to integrate this.
Download gridphp.com and add it to the root folder of FA.

Copy the following code in the page where you want to show the Grid and set the $path_to_root with respect to the location of file.

<?php
/**
 * PHP Grid Component
 *
 * @author Abu Ghufran <gridphp@gmail.com> - http://www.phpgrid.org
 * @version 2.0.0
 * @license: see license.txt included in package
 */
 $page_security = 'SA_OPEN';
 $path_to_root="../..";
 include($path_to_root . "/includes/session.inc");

add_css_file($path_to_root."/gridphp/lib/js/themes/redmond/jquery-ui.custom.css");
add_css_file($path_to_root."/gridphp/lib/js/jqgrid/css/ui.jqgrid.css");
add_js_ufile($path_to_root."/gridphp/lib/js/jquery.min.js");
add_js_ufile($path_to_root."/gridphp/lib/js/jqgrid/js/i18n/grid.locale-en.js");
add_js_ufile($path_to_root."/gridphp/lib/js/jqgrid/js/jquery.jqGrid.min.js");
add_js_ufile($path_to_root."/gridphp/lib/js/themes/jquery-ui.custom.min.js");

// include and create object
include_once ($path_to_root."/gridphp/lib/inc/jqgrid_dist.php");

$server = $db_connections[user_company()]['host'];
$user = $db_connections[user_company()]['dbuser'];
$password = $db_connections[user_company()]['dbpassword'];
$database = $db_connections[user_company()]['dbname'];

$db_conf = array(
                    "type"         => 'mysqli',
                    "server"     => $server,
                    "user"         => $user,
                    "password"     => $password,
                    "database"     => $database
                );


$g = new jqgrid($db_conf);

$grid["rowNum"] = 10; // by default 20
$grid["sortname"] = 'id'; // by default sort grid by this field
$grid["caption"] = "Invoice Data"; // caption of grid
$grid["autowidth"] = false; // expand grid to screen width
$grid["multiselect"] = true; // allow you to multi-select through checkboxes
$grid["form"]["position"] = "center";
$grid["shrinkToFit"] = false;

$g->set_options($grid);

$g->set_actions(array(
                        "add"=>true, // allow/disallow add
                        "edit"=>true, // allow/disallow edit
                        "delete"=>true, // allow/disallow delete
                        "view"=>true, // allow/disallow delete
                        "rowactions"=>true, // show/hide row wise edit/del/save option
                        "search" => "advance", // show single/multi field search condition (e.g. simple or advance)
                        "showhidecolumns" => false
                    )
                );

$g->select_command = "SELECT * FROM dimensions where id < 85";

$g->table = "dimensions";

// this db table will be used for add,edit,delete
$g->table = "invheader";

// pass the cooked columns to grid
$g->set_columns($cols);

// generate grid output, with unique grid name as 'list1'
$out = $g->render("list1");
page(_($help_context = "Dimensions"), false);
echo '<div style="margin:10px">';
echo $out;
div_end();
end_page();
?>

68

(5 replies, posted in Development)

Hello
I was trying to integrate gridphp.com in FA.

Facing this error. May be some JS is conflicting. Can anyone help?

https://prnt.sc/1zvrs70

I am using the references as {0001}/{MM}{YY}

It works perfectly but sometimes (not always) the reference is auto updated to Legacy values. For e.g at times I see that the new month is started but it is continuing the sequence of old month. Upon checking the transaction references I found that the pattern was auto set to Legacy.

I tried to debug the issue but since it is not doing all the time I could not catch it.

Any idea how to catch and fix the bug?

I wanted to use the translation function for some quick translations. For e.g. some clients they want to see the word dimensions as cost centers. So instead of changing the text in code or adding a translation file I just want to add some quick translations using the translation function.

Any help is appreciated?

Hello, just curious to know what is the use of these two functions? Can we change the functionality using any module using this hook?

Hello,

In includes/lang/languages.inc at the bottom the conditional definition of function _($text) is there.

I was wondering where is the actual definition of this function.

PHP gettext extension works with php_extension in php.ini.

Create a Direct Delivery as below

https://prnt.sc/1tdjz2u

Create Partial Invoice of the Delivery as Below

https://prnt.sc/1tdk6yi

Now void this newly created invoice and then again create a Invoice for the delivery. You will find the wrong updated qty_done as below

https://prnt.sc/1tdkfp2

Hello, Recently due to some changes in output of EXCHANGE-RATES.ORG the current code is not retrieving Exchange Rate.

Following fix is needed.

/gl/includes/db/gl_db_rates.inc
Line # 240 Replace

$val = getInnerStr($contents, '<span id="ctl00_M_lblToAmount">', '<');
        $val = str_replace (',', '', $val);

with

        $val = getInnerStr($contents, "1 $curr_b = ",$curr_a);

75

(3 replies, posted in Items and Inventory)

Thanks @Braath and @Varadha for your suggestions.

Inventory Valuation Report Served the subject for me. Now my Trial Balance is giving exactly the same value of Inventory as that of Inventory Valuation Report. I had to set $use_costed_values = 1 in config.php. This I tested for any Date.

But now I am facing a very strange issue that I had to dig out after hours.

Here is the Screen shot of the Database.

https://prnt.sc/1qbickh

This is one item's records in stock_moves table which is fetch by Inventory Valuation Report to calculate average cost in the function getAverageCost

Now the below condition is calculating wrong average cost because in one record the standard_cost is ZERO as highlighted in above image.

https://prnt.sc/1qbiflo

What is the purpose of this condition? And I don't know why the standard_cost is set to ZERO for that line in first image?

If I remove this condition my Inventory Valuation is perfect. But I am unable to understand why this condition was applied earlier.

Here is the Screen Shot of Inventory Valuation Report
Any idea?