Additional fix to last commit.
[fa-stable.git] / purchasing / inquiry / supplier_inquiry.php
index c3f54557c665373effdf0278b8e7372f70aa5db6..f316c4122baaa9b23c8beb8d2c6419f63c970c66 100644 (file)
@@ -27,6 +27,7 @@ page(_($help_context = "Supplier Inquiry"), isset($_GET['supplier_id']), false,
 if (isset($_GET['supplier_id'])){
        $_POST['supplier_id'] = $_GET['supplier_id'];
 }
+
 if (isset($_GET['FromDate'])){
        $_POST['TransAfterDate'] = $_GET['FromDate'];
 }
@@ -106,7 +107,6 @@ function systype_name($dummy, $type)
        global $systypes_array;
        return $systypes_array[$type];
 }
-div_end();
 
 function trans_view($trans)
 {
@@ -136,17 +136,10 @@ function credit_link($row)
                        : '';
 }
 
-function fmt_debit($row)
+function fmt_amount($row)
 {
        $value = $row["TotalAmount"];
-       return $value>0 ? price_format($value) : '';
-
-}
-
-function fmt_credit($row)
-{
-       $value = -$row["TotalAmount"];
-       return $value>0 ? price_format($value) : '';
+       return price_format($value);
 }
 
 function prt_link($row)
@@ -163,6 +156,10 @@ function check_overdue($row)
 
 function edit_link($row)
 {
+       global $page_nested;
+
+       if ($page_nested)
+               return '';
        return trans_editor_link($row['type'], $row['trans_no']);
 }
 //------------------------------------------------------------------------------------------------
@@ -178,8 +175,7 @@ $cols = array(
                        _("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'desc'), 
                        _("Due Date") => array('type'=>'date', 'fun'=>'due_date'), 
                        _("Currency") => array('align'=>'center'),
-                       _("Debit") => array('align'=>'right', 'fun'=>'fmt_debit'), 
-                       _("Credit") => array('align'=>'right', 'insert'=>true,'fun'=>'fmt_credit'), 
+                       _("Amount") => array('align'=>'right', 'fun'=>'fmt_amount'), 
                        array('insert'=>true, 'fun'=>'gl_view'),
                        array('insert'=>true, 'fun'=>'credit_link'),
                        array('insert'=>true, 'fun'=>'prt_link'),