The gl_trans table has the dimensions data that is displayed in the GL view. The function get_gl_trans() in the file gl/includes/db/gl_db_trans.inc is the source of the displayed field contents of which the dimension data is a part - ie., line 50 in gl/iew/gl_trans_view.php:
$result = get_gl_trans($_GET['type_id'], $_GET['trans_no']);
In the case of the Invoice View, the $supp_trans gets passed by reference through line 36 in purchasing/view/view_supp_invoice.php:
read_supp_invoice($trans_no, ST_SUPPINVOICE, $supp_trans);
The function read_supp_invoice() is in purchasing/includes/db/invoice_db.inc and it does not have any dimension data and hence the absence of values in the dimension columns in the Invoice View!
Also, for each sales invoice item line, all entries pertaining to the gl_trans table will get pulled in if it is joined and records taken. Otherwise, the default value of dimension data in the suppliers table get sucked in erroneously if taken from there.
Sample sql taken from the function read_supp_invoice() and modified to join the gl_trans table :
SELECT supp_trans.*, supp_name, gl.dimension_id, gl.dimension2_id
FROM 1_supp_trans supp_trans LEFT JOIN 1_suppliers USING (supplier_id)
LEFT JOIN 1_gl_trans gl ON (supp_trans.type=gl.type AND supp_trans.trans_no=gl.type_no)
WHERE supp_trans.trans_no = 11 AND supp_trans.type = 20;
will erroneously produce multiple records for each line item entry of the sales invoice display.
Hence the Dimension column in the Sales Invoice View should be removed - pictures 07 and 08 in the attachment illustrate it.
Post's attachmentsPO-Dely-Inv-Pay.zip 266 kb, file has never been downloaded.
You don't have the permssions to download the attachments of this post.