From 87d6b416b6f81fbdfea083895a9074e22e90ed34 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 19 Aug 2010 16:14:36 +0000 Subject: [PATCH] View of backup scripts and attachments didn't work Added more memo info in advanced manufacture / Chaitanya Added total debit/credit in gl_trans_view.inc / Chaitanya --- CHANGELOG.txt | 10 ++++++++++ admin/attachments.php | 6 +++--- admin/backups.php | 4 ++-- admin/db/attachments_db.inc | 2 +- gl/view/gl_trans_view.php | 17 ++++++++++++++++- .../includes/db/work_orders_quick_db.inc | 12 +++++++----- 6 files changed, 39 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index de89aef9..f86d0f84 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/admin/attachments.php b/admin/attachments.php index 92008742..30090517 100644 --- a/admin/attachments.php +++ b/admin/attachments.php @@ -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(); diff --git a/admin/backups.php b/admin/backups.php index 4011a2a5..12ab9331 100644 --- a/admin/backups.php +++ b/admin/backups.php @@ -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 "".get_backup_file_combo().""; echo ""; 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?")); diff --git a/admin/db/attachments_db.inc b/admin/db/attachments_db.inc index 499080a2..6ce9960f 100644 --- a/admin/db/attachments_db.inc +++ b/admin/db/attachments_db.inc @@ -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"); diff --git a/gl/view/gl_trans_view.php b/gl/view/gl_trans_view.php index 0264e103..70103026 100644 --- a/gl/view/gl_trans_view.php +++ b/gl/view/gl_trans_view.php @@ -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); diff --git a/manufacturing/includes/db/work_orders_quick_db.inc b/manufacturing/includes/db/work_orders_quick_db.inc index 92b984dd..5dfc8635 100644 --- a/manufacturing/includes/db/work_orders_quick_db.inc +++ b/manufacturing/includes/db/work_orders_quick_db.inc @@ -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); } //-------------------------------------------------------------------------------------- -- 2.30.2