View of backup scripts and attachments didn't work
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 19 Aug 2010 16:14:36 +0000 (16:14 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 19 Aug 2010 16:14:36 +0000 (16:14 +0000)
Added more memo info in advanced manufacture / Chaitanya
Added total debit/credit in gl_trans_view.inc / Chaitanya

CHANGELOG.txt
admin/attachments.php
admin/backups.php
admin/db/attachments_db.inc
gl/view/gl_trans_view.php
manufacturing/includes/db/work_orders_quick_db.inc

index de89aef99564041d7cae8bdf6dfdd26d478f244d..f86d0f84a24e92fb871a7ac8f59afeccfb69c074 100644 (file)
@@ -19,6 +19,16 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+18-Aug-2010 Joe Hunt
+# View of backup scripts and attachments didn't work
+$ /admin/attachments.php
+  /admin/backups.php
+  /admin/db/attachments_db.inc
+! Added more memo info in advanced manufacture / Chaitanya
+$ /manufacturing/includes/db/work_orders_quick_db.inc
+! Added total debit/credit in gl_trans_view.inc / Chaitanya
+$ /gl/view/gl_trans_view.php
+
 13-Aug-2010 Joe Hunt/infotechaccountant.com
 + Added arabic translation for install wizard (thanks to Hameed, infotechaccountants)
   /install/isession.inc
index 92008742e9bfc3480b1b431b116aeb4a1e91ec10..30090517cdaad37bf38926089c87d3674c338cd1 100644 (file)
@@ -34,9 +34,9 @@ if ($view_id != -1)
                        $type = ($row['filetype']) ? $row['filetype'] : 'application/octet-stream';     
                header("Content-type: ".$type);
                header('Content-Length: '.$row['filesize']);
-               if ($type == 'application/octet-stream')
-                       header('Content-Disposition: attachment; filename='.$row['filename']);
-               else
+               //if ($type == 'application/octet-stream')
+               //      header('Content-Disposition: attachment; filename='.$row['filename']);
+               //else
                                header("Content-Disposition: inline");
                echo file_get_contents(company_path(). "/attachments/".$row['unique_name']);
                exit();
index 4011a2a5423eafddedb376cd8eab233d14ecd99e..12ab9331e9049f01ee9cd6e9d8a9da4ea72d7e48 100644 (file)
@@ -26,7 +26,7 @@ if (get_post('view')) {
                else {
                    header('Content-type: application/octet-stream');
                header('Content-Length: '.filesize($filename));
-                       header("Content-Disposition: inline; filename=$filename");
+                       header("Content-Disposition: inline");
                readfile($filename);
                        exit();
                }
@@ -173,7 +173,7 @@ table_section_title(_("Backup scripts maintenance"));
        echo "<td style='padding-left:20px'align='left'>".get_backup_file_combo()."</td>";
        echo "<td valign='top'>";
        start_table();
-       submit_row('view',_("View Backup"), false, '', '', true);
+       submit_row('view',_("View Backup"), false, '', '', false);
        submit_row('download',_("Download Backup"), false, '', '', false);
        submit_row('restore',_("Restore Backup"), false, '','', 'process');
        submit_js_confirm('restore',_("You are about to restore database from backup file.\nDo you want to continue?"));
index 499080a28c16c2c11a25cd62bc9276b9247e3517..6ce9960f2d1024321c49b50f12626ae7a1f9aa24 100644 (file)
@@ -38,7 +38,7 @@ function update_attachment($selected_id, $filterType, $trans_no, $description,
                $sql .= "filename=".db_escape($filename).",
                unique_name=".db_escape($unique_name).",
                filesize=".db_escape($filesize).",
-               filetype=".db_escape($filetype);
+               filetype=".db_escape($filetype).",";
        }       
        $sql .= "tran_date='$date' WHERE id=".db_escape($selected_id);
        db_query($sql, "Attachment could not be updated");              
index 0264e10369464b97e3b6b88ecc86e77854bca7cf..70103026da85967d4ee3d66bc936a566ac9b4920 100644 (file)
@@ -71,6 +71,7 @@ else
 $k = 0; //row colour counter
 $heading_shown = false;
 
+$credit = $debit = 0;
 while ($myrow = db_fetch($result)) 
 {
        if ($myrow['amount'] == 0) continue;
@@ -94,8 +95,22 @@ while ($myrow = db_fetch($result))
        display_debit_or_credit_cells($myrow['amount']);
        label_cell($myrow['memo_']);
        end_row();
-
+    if ($myrow['amount'] > 0 ) 
+       $debit += $myrow['amount'];
+    else 
+       $credit += $myrow['amount'];
 }
+start_row("class='inquirybg' style='font-weight:bold'");
+label_cell(_("Total"), "colspan=2");
+if ($dim >= 1)
+    label_cell('');
+if ($dim > 1)
+    label_cell('');
+amount_cell($debit);
+amount_cell(-$credit);
+label_cell('');
+end_row();
+
 //end of while loop
 if ($heading_shown)
        end_table(1);
index 92b984dde11d948cc5e266d7aa4c22727f863993..5dfc8635a923b0a2758f0590e79e9e21d060d81b 100644 (file)
@@ -109,7 +109,7 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced
                                $bom_item["loc_code"], $date_, "", -$bom_item["quantity"] * $units_reqd, 0);
                }
                $total_cost += add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $bom_accounts["inventory_account"], 0, 0,
-                       null, -$bom_cost);
+                       $bom_item["quantity"] ." * ".$bom_item["description"], -$bom_cost);
 
        }
        if ($advanced)
@@ -123,8 +123,9 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced
                        $standard_cost = get_standard_cost($item['stock_id']);
                        $issue_cost = $standard_cost * $item['qty_issued'] * $units_reqd / $wo['units_reqd'];
                        $issue = get_stock_gl_code($item['stock_id']);
-                       $total_cost += add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $issue["inventory_account"], 0, 0,
-                               null, -$issue_cost);
+            $stockitem = get_item($item['stock_id']);
+            $total_cost += add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $issue["inventory_account"], 0, 0,
+                _("Issue of")." ".$stockitem["description"], -$issue_cost);                    
                        $issue_total += $issue_cost;
                }
                if ($issue_total != 0)
@@ -169,8 +170,9 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced
                        PT_WORKORDER, WO_LABOUR);
        }
        // debit total components $total_cost
-       add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $item_accounts["inventory_account"],
-               0, 0, null, -$total_cost);
+       $stockitem = get_item($stock_id);
+    add_gl_trans_std_cost(ST_WORKORDER, $woid, $date_, $item_accounts["inventory_account"],
+        0, 0, _("Produced")." ".$units_reqd. " * ".$stockitem["description"], -$total_cost);   
 }
 
 //--------------------------------------------------------------------------------------