From 279d7962a249da9cbc3074360e3a68a23a31145e Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 5 Mar 2010 13:08:28 +0000 Subject: [PATCH] Merged changes from main trunk up to 2.2.7 --- CHANGELOG.txt | 89 ++++++++++++++ admin/backups.php | 2 +- admin/create_coy.php | 13 +- config.default.php | 5 +- gl/gl_journal.php | 4 +- gl/includes/db/gl_db_accounts.inc | 25 ---- gl/includes/db/gl_db_banking.inc | 36 +++--- gl/manage/exchange_rates.php | 9 +- includes/access_levels.inc | 4 +- includes/session.inc | 2 +- includes/ui/ui_lists.inc | 3 +- js/inserts.js | 2 +- .../LC_MESSAGES/empty.po | 4 +- .../db/work_order_produce_items_db.inc | 4 +- .../db/work_order_requirements_db.inc | 4 +- manufacturing/includes/db/work_orders_db.inc | 114 +++++++++++++----- .../includes/db/work_orders_quick_db.inc | 17 +-- manufacturing/work_order_add_finished.php | 13 +- purchasing/includes/db/grn_db.inc | 15 +-- purchasing/includes/ui/po_ui.inc | 7 +- reporting/includes/class.graphic.inc | 19 +-- reporting/includes/doctext.inc | 6 +- reporting/includes/doctext2.inc | 4 +- reporting/includes/pdf_report.inc | 4 +- reporting/includes/reports_classes.inc | 8 +- reporting/rep107.php | 2 +- reporting/rep110.php | 2 +- sales/customer_delivery.php | 4 +- sales/manage/customer_branches.php | 2 +- taxes/tax_calc.inc | 29 +++-- update.html | 6 +- 31 files changed, 296 insertions(+), 162 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0603c2ce..d21ca204 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,95 @@ Legend: ! -> Note $ -> Affected files +05-Mar-2010 Merged changes from main trunk up to 2.2.7 as follows +------------------------------- Release 2.2.7 ---------------------------------- +05-Mar-2010 Joe Hunt +! Release 2.2.7 +! Removed redundant variable $use_new_account_types from config.php +$ config.default.php + update.html +! Removed redundant function get_gl_accounts_all in gl_db_accounts.inc +$ /gl/includes/db/gl_db_accounts.inc + +02-Mar-2010 Joe Hunt +# Bug sending email to a name with commas. Has been replaced with ''. +$ /reporting/includes/pdf_report.inc + +01-Mar-2010 Janusz Dobrowolski +# [0000212] Selecting branch from popup was not working. +$ /sales/manage/customer_branches.php +# [0000213] Date change on journal entry update. +$ /gl/gl_journal.php + +01-Mar-2010 Joe Hunt +! Allow change of password without script in Create/Update Company. +$ /admin/create_coy.php + +28-Feb-2010 Joe Hunt +# Fixed a non esisting voiding of Work Order Advanced and a couple of + bugs in the same operation. And a fix according to Vramak on the forum. + Wiki will be updated on how does the Work Order work +$ /manufacturing/includes/db/work_orders_db.inc + /manufacturing/includes/db/work_orders_quick_db.inc + /manufacturing/includes/db/work_order_produce_items_db.inc + /manufacturing/includes/db/work_order_requirements_db.inc + /purchasing/includes/db/grn_db.inc + +26-Feb-2010 Janusz Dobrowolski +# [0000209],[0000210] Improper quantity/price handling on supplier change. +$ /purchasing/includes/ui/po_ui.inc +# [0000211] Typo in work order legend. +$ /reporting/includes/doctext.inc + /reporting/includes/doctext2.inc +# Restored Esc hot key on cancel buttons. +$ /js/inserts.js + +26-Feb-2010 Joe Hunt +# [0000208] Voiding a work order production does not revert raw material quantities +$ /manufacturing/includes/db/work_order_produce_items_db.inc + +25-Feb-2010 Janusz Dobrowolski +# Fixed bug in quantity input +$ /manufacturing/work_order_add_finished.php + +24-Feb-2010 Joe Hunt +# Tax included calculation problem when more than 1 tax type in a group +$ /taxes/tax_calc.inc +! Small layout fixes +$ /admin/backups.php + /includes/ui/ui_lists.inc + /reporting/rep107.php + /reporting/rep110.php + +22-Feb-2010 Janusz Dobrowolski +# Two smaller fixes in security area codes. +$ /includes/access_levels.inc + +21-Feb-2010 Joe Hunt +# Exchange rate doesn't update table immediately when adding new rate + and no exchange rates there before. +$ /gl/manage/exchange_rates.php +# Bug in exchange variation calculation in certain situations. Again. +$ /gl/includes/db/gl_db_banking.inc + +21-Feb-2010 Janusz Dobrowolski +# Fixed check for language session var. +$ /includes/session.inc + +19-Feb-2010 Joe Hunt/Ary Wibowo +# Bug in exchange variation calculation in certain situations. +$ /gl/includes/gl_db_banking.inc +! Better and cleaner layout in graphics +$ /reporting/includes/class.graphic.inc +! Fixed better layout in customer delivery form +$ /sales/customer_delivery.php + +17-Feb-2010 Joe Hunt +# Missing border layout in report centre +$ /reporting/includes/reports_classes.inc + +---------- End of changes from main trunk 2.2.6-2.2.7 + 01-Mar-2010 Janusz Dobrowolski + Rewrite of FrontReport header API to accept externally defined headers in php and/or pdf form. $ /reporting/includes/class.pdf.inc diff --git a/admin/backups.php b/admin/backups.php index 4bf99a42..9f6efa55 100644 --- a/admin/backups.php +++ b/admin/backups.php @@ -99,7 +99,7 @@ function compress_list_row($label, $name, $value=null) if (function_exists("gzopen")) $ar_comps['gzip'] = "gzip"; - echo "$label"; + echo "$label"; echo array_selector('comp', $value, $ar_comps); echo ""; } diff --git a/admin/create_coy.php b/admin/create_coy.php index 5049a332..29acd007 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -139,6 +139,17 @@ function handle_submit() remove_connection($id); return false; } + } else { + if ($_GET['c'] = 'u') { + $conn = $db_connections[$id]; + if (($db = db_create_db($conn)) == 0) + { + display_error(_("Error connecting to Database: ") . $conn['dbname'] . _(", Please correct it")); + $error = true; + } else { + db_query("UPDATE ".$conn['tbpref']."users set password = '".md5($_POST['admpassword']). "' WHERE user_id = 'admin'"); + } + } } $error = write_config_db($new); if ($error == -1) @@ -306,7 +317,7 @@ function display_company_edit($selected_id) document.forms[0].action='create_coy.php?c=u&ul=1&id=" . $n . "&fn=' + document.forms[0].uploadfile.value } else { - document.forms[0].action='create_coy.php?c=u&id=" . $n . "&fn=' + document.forms[0].uploadfile.value + document.forms[0].action='create_coy.php?c=u&id=" . $n . "' } document.forms[0].submit() } diff --git a/config.default.php b/config.default.php index 3c2e67eb..22ab9cf1 100644 --- a/config.default.php +++ b/config.default.php @@ -56,7 +56,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_ // Main Title $app_title = "FrontAccounting"; // application version - $version = "2.3 CVS (m6)"; + $version = "2.3 CVS (m7)"; // src-data compatibility check. Do not change. $core_version = "2.3"; @@ -212,7 +212,4 @@ if (!defined('ICON_EDIT')) define("ICON_ESCAPE", "escape.png"); } - /* allow using of multi level sub-types when digits are of same length in account types */ - $use_new_account_types = 0; - ?> \ No newline at end of file diff --git a/gl/gl_journal.php b/gl/gl_journal.php index d515b179..035de8ac 100644 --- a/gl/gl_journal.php +++ b/gl/gl_journal.php @@ -118,10 +118,10 @@ function create_cart($type=0, $trans_no=0) } else { $cart->reference = $Refs->get_next(0); $cart->tran_date = new_doc_date(); + if (!is_date_in_fiscalyear($cart->tran_date)) + $cart->tran_date = end_fiscalyear(); $_POST['ref_original'] = -1; } - if (!is_date_in_fiscalyear($cart->tran_date)) - $cart->tran_date = end_fiscalyear(); $_POST['memo_'] = $cart->memo_; $_POST['ref'] = $cart->reference; diff --git a/gl/includes/db/gl_db_accounts.inc b/gl/includes/db/gl_db_accounts.inc index 34bbdaab..a4004d81 100644 --- a/gl/includes/db/gl_db_accounts.inc +++ b/gl/includes/db/gl_db_accounts.inc @@ -50,31 +50,6 @@ function get_gl_accounts($from=null, $to=null, $type=null) return db_query($sql, "could not get gl accounts"); } -function get_gl_accounts_all($balance=-1) -{ - global $use_new_account_types; - - if ($balance == 1) - $where ="WHERE ctype>0 AND ctype<".CL_INCOME; - elseif ($balance == 0) - $where ="WHERE ctype>".CL_EQUITY." OR ctype=0"; // backwards compatibility - $sql = "SELECT ".TB_PREF."chart_master.account_code, ".TB_PREF."chart_master.account_name, ".TB_PREF."chart_master.account_code2, - ".TB_PREF."chart_types.name AS AccountTypeName,".TB_PREF."chart_types.id AS AccountType, - ".TB_PREF."chart_types.parent, ".TB_PREF."chart_class.class_name AS AccountClassName, ".TB_PREF."chart_class.cid AS ClassID, - ".TB_PREF."chart_class.ctype AS ClassType - FROM ".TB_PREF."chart_types INNER JOIN ".TB_PREF."chart_class ON ".TB_PREF."chart_types.class_id=".TB_PREF."chart_class.cid - LEFT JOIN ".TB_PREF."chart_master ON ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id "; - if ($balance != -1) - $sql .= $where; - if (isset($use_new_account_types) && $use_new_account_types == 1) - $sql .= " ORDER BY ".TB_PREF."chart_class.cid, ".TB_PREF."chart_types.id, parent, ".TB_PREF."chart_master.account_code"; - else - $sql .= " ORDER BY ".TB_PREF."chart_class.cid, IF(parent > 0,parent,".TB_PREF."chart_types.id), - IF(parent > 0,".TB_PREF."chart_types.id, parent), ".TB_PREF."chart_master.account_code"; - - return db_query($sql, "could not get gl accounts"); -} - function get_gl_account($code) { $sql = "SELECT * FROM ".TB_PREF."chart_master WHERE account_code=".db_escape($code); diff --git a/gl/includes/db/gl_db_banking.inc b/gl/includes/db/gl_db_banking.inc index afc9e516..cff9e70d 100644 --- a/gl/includes/db/gl_db_banking.inc +++ b/gl/includes/db/gl_db_banking.inc @@ -16,25 +16,25 @@ function add_exchange_variation($trans_type, $trans_no, $date_, $acc_id, $accoun return; if ($date_ == null) $date_ = Today(); - $rate = get_exchange_rate_from_home_currency($currency, $date_); -/* - $result = db_query("SELECT SUM(amount) FROM ".TB_PREF."bank_trans WHERE - bank_act=".db_escape($acc_id)." AND trans_date<='".date2sql($date_)."'", - "Transactions for account $account could not be calculated"); - $row = db_fetch_row($result); - $foreign_amount = $row[0]; + $for_amount = 0; + + // We have to calculate all the currency accounts belonging to the GL account + // upto $date_ and calculate with the exchange rates. And then compare with the GL account balance. + // 2010-02-23 Joe Hunt with help of Ary Wibowo + $sql = "SELECT SUM(bt.amount) AS for_amount, ba.bank_curr_code + FROM ".TB_PREF."bank_trans bt, ".TB_PREF."bank_accounts ba + WHERE ba.id = bt.bank_act AND ba.account_code = ".db_escape($account)." AND bt.trans_date<='".date2sql($date_)."' + GROUP BY ba.bank_curr_code"; + $result = db_query($sql, "Transactions for bank account $acc_id could not be calculated"); + while ($row = db_fetch($result)) + { + if ($row['for_amount'] == 0) + continue; + $rate = get_exchange_rate_from_home_currency($row['bank_curr_code'], $date_); + $for_amount += round2($row['for_amount'] * $rate, user_price_dec()); + } $amount = get_gl_trans_from_to("", $date_, $account); - $diff = $amount - (round2($foreign_amount * $rate, user_price_dec())); -*/ - $result = db_query("SELECT SUM(bt.amount) AS foreign_amount, SUM(gt.amount) AS amount - FROM ".TB_PREF."bank_trans bt, ".TB_PREF."gl_trans gt, ".TB_PREF."bank_accounts ba - WHERE bt.bank_act=".db_escape($acc_id)." AND bt.trans_date<='".date2sql($date_)."' - AND ((bt.amount > 0 AND gt.amount > 0) OR (bt.amount <= 0 AND gt.amount <= 0)) - AND bt.type = gt.type AND bt.trans_no = gt.type_no - AND ba.id = bt.bank_act AND ba.account_code = gt.account", - "Transactions for account $account could not be calculated"); - $row = db_fetch($result); - $diff = $row['amount'] - (round2($row['foreign_amount'] * $rate, user_price_dec())); + $diff = $amount - $for_amount; if ($diff != 0) { if ($trans_type == null) diff --git a/gl/manage/exchange_rates.php b/gl/manage/exchange_rates.php index e50fc5f3..05cbc04e 100644 --- a/gl/manage/exchange_rates.php +++ b/gl/manage/exchange_rates.php @@ -40,7 +40,12 @@ function check_data() set_focus('BuyRate'); return false; } - + if (get_date_exchange_rate($_POST['curr_abrev'], $_POST['date_'])) + { + display_error( _("The exchange rate for the date is already there.")); + set_focus('date_'); + return false; + } return true; } @@ -207,6 +212,8 @@ else br(1); $table->width = "40%"; + if ($table->rec_count == 0) + $table->ready = false; display_db_pager($table); br(1); display_rate_edit(); diff --git a/includes/access_levels.inc b/includes/access_levels.inc index 9c502deb..797f374e 100644 --- a/includes/access_levels.inc +++ b/includes/access_levels.inc @@ -199,7 +199,7 @@ $security_areas =array( 'SA_WORKORDERANALYTIC' => array(SS_MANUF_A|1, _("Work order analytical reports and inquiries")), 'SA_WORKORDERCOST' => array(SS_MANUF_A|2, _("Manufacturing cost inquiry")), - 'SA_MANUFBULKREP' => array(SS_SALES_A|3, _("Work order bulk reports")), + 'SA_MANUFBULKREP' => array(SS_MANUF_A|3, _("Work order bulk reports")), 'SA_BOMREP' => array(SS_MANUF_A|4, _("Bill of materials reports")), // // Dimensions @@ -222,7 +222,7 @@ $security_areas =array( 'SA_CURRENCY' => array(SS_GL_C|6, _("Currencies")), 'SA_BANKACCOUNT' => array(SS_GL_C|7, _("Bank accounts")), 'SA_TAXRATES' => array(SS_GL_C|8, _("Tax rates")), - 'SA_TAXGROUPS' => array(SS_GL_C|8, _("Tax groups")), + 'SA_TAXGROUPS' => array(SS_GL_C|12, _("Tax groups")), 'SA_FISCALYEARS' => array(SS_GL_C|9, _("Fiscal years maintenance")), 'SA_GLSETUP' => array(SS_GL_C|10, _("Company GL setup")), 'SA_GLACCOUNTTAGS' => array(SS_GL_C|11, _("GL Account tags")), diff --git a/includes/session.inc b/includes/session.inc index d8f4af1d..5c5ec42b 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -183,7 +183,7 @@ header("Cache-control: private"); get_text_init(); // Page Initialisation -if (!method_exists($_SESSION['language'], 'set_language')) +if (!isset($_SESSION['language']) || !method_exists($_SESSION['language'], 'set_language')) { $l = array_search_value($dflt_lang, $installed_languages, 'code'); $_SESSION['language'] = new language($l['name'], $l['code'], $l['encoding'], diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 6d24ed62..a5a96b08 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -2048,7 +2048,8 @@ function quick_entries_list($name, $selected_id=null, $type=null, $submit_on_cha function quick_entries_list_cells($label, $name, $selected_id=null, $type, $submit_on_change=false) { if ($label != null) - echo "$label\n"; + echo "$label\n"; + echo ""; echo quick_entries_list($name, $selected_id, $type, $submit_on_change); echo ""; } diff --git a/js/inserts.js b/js/inserts.js index a6365d75..3ed5e314 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -398,7 +398,7 @@ function setHotKeys() { } return stopEv(ev); } - if((ev.ctrlKey && key == 13) || (key == 27 && ev.altKey)) { + if((ev.ctrlKey && key == 13) || key == 27) { _hotkeys.alt = false; // cancel link selection _hotkeys.focus = -1; ev.cancelBubble = true; diff --git a/lang/new_language_template/LC_MESSAGES/empty.po b/lang/new_language_template/LC_MESSAGES/empty.po index ae93a925..d0b822fb 100644 --- a/lang/new_language_template/LC_MESSAGES/empty.po +++ b/lang/new_language_template/LC_MESSAGES/empty.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: FrontAccounting\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-02-16 15:47+0100\n" -"PO-Revision-Date: 2010-02-16 15:48+0100\n" +"POT-Creation-Date: 2010-02-25 17:05+0100\n" +"PO-Revision-Date: 2010-02-25 17:05+0100\n" "Last-Translator: Translation Team \n" "Language-Team: Translators\n" "MIME-Version: 1.0\n" diff --git a/manufacturing/includes/db/work_order_produce_items_db.inc b/manufacturing/includes/db/work_order_produce_items_db.inc index 6f5c001f..b9fd16f0 100644 --- a/manufacturing/includes/db/work_order_produce_items_db.inc +++ b/manufacturing/includes/db/work_order_produce_items_db.inc @@ -42,7 +42,7 @@ function work_order_produce($woid, $ref, $quantity, $date_, $memo_, $close_wo) // ------------------------------------------------------------------------- - work_order_quick_costs($woid, $details["stock_id"], $quantity, $date_, true); + work_order_quick_costs($woid, $details["stock_id"], $quantity, $date_, $id); // ------------------------------------------------------------------------- // insert a +ve stock move for the item being manufactured @@ -107,6 +107,8 @@ function void_work_order_produce($type_no) // deduct the quantity of this production from the parent work order work_order_update_finished_quantity($row["workorder_id"], -$row["quantity"]); + work_order_quick_costs($row['workorder_id'], $row['stock_id'], -$row['quantity'], sql2date($row['date_']), $type_no); + // clear the production record $sql = "UPDATE ".TB_PREF."wo_manufacture SET quantity=0 WHERE id=".db_escape($type_no); db_query($sql, "Cannot void a wo production"); diff --git a/manufacturing/includes/db/work_order_requirements_db.inc b/manufacturing/includes/db/work_order_requirements_db.inc index ba53b5a2..a722c1ed 100644 --- a/manufacturing/includes/db/work_order_requirements_db.inc +++ b/manufacturing/includes/db/work_order_requirements_db.inc @@ -57,10 +57,10 @@ function delete_wo_requirements($woid) //-------------------------------------------------------------------------------------- -function update_wo_requirement_issued($woReqID, $quantity) +function update_wo_requirement_issued($woid, $stock_id, $quantity) { $sql = "UPDATE ".TB_PREF."wo_requirements SET units_issued = units_issued + ".db_escape($quantity)." - WHERE id = ".db_escape($woReqID); + WHERE workorder_id = ".db_escape($woid)." AND stock_id = ".db_escape($stock_id); db_query($sql, "The work requirements issued quantity couldn't be updated"); } diff --git a/manufacturing/includes/db/work_orders_db.inc b/manufacturing/includes/db/work_orders_db.inc index 12f4049f..1271f611 100644 --- a/manufacturing/includes/db/work_orders_db.inc +++ b/manufacturing/includes/db/work_orders_db.inc @@ -28,14 +28,10 @@ function add_material_cost($stock_id, $qty, $date_) $myrow = db_fetch($result); $material_cost = $myrow['material_cost']; $qoh = get_qoh_on_date($stock_id, null, $date_); - /* - if ($qoh + $qty <= 0) - $material_cost = 0; - else - */ if ($qoh < 0) $qoh = 0; - $material_cost = ($qoh * $material_cost + $qty * $m_cost) / ($qoh + $qty); + if ($qoh + $qty != 0) + $material_cost = ($qoh * $material_cost + $qty * $m_cost) / ($qoh + $qty); $material_cost = round2($material_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET material_cost=$material_cost WHERE stock_id=".db_escape($stock_id); @@ -54,14 +50,10 @@ function add_overhead_cost($stock_id, $qty, $date_, $costs) $myrow = db_fetch($result); $overhead_cost = $myrow['overhead_cost']; $qoh = get_qoh_on_date($stock_id, null, $date_); - /* - if ($qoh + $qty <= 0) - $overhead_cost = 0; - else - */ if ($qoh < 0) $qoh = 0; - $overhead_cost = ($qoh * $overhead_cost + $qty * $costs) / ($qoh + $qty); + if ($qoh + $qty != 0) + $overhead_cost = ($qoh * $overhead_cost + $qty * $costs) / ($qoh + $qty); $overhead_cost = round2($overhead_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET overhead_cost=".db_escape($overhead_cost)." WHERE stock_id=".db_escape($stock_id); @@ -80,14 +72,10 @@ function add_labour_cost($stock_id, $qty, $date_, $costs) $myrow = db_fetch($result); $labour_cost = $myrow['labour_cost']; $qoh = get_qoh_on_date($stock_id, null, $date_); - /* - if ($qoh + $qty <= 0) - $labour_cost = 0; - else - */ if ($qoh < 0) $qoh = 0; - $labour_cost = ($qoh * $labour_cost + $qty * $costs) / ($qoh + $qty); + if ($qoh + $qty != 0) + $labour_cost = ($qoh * $labour_cost + $qty * $costs) / ($qoh + $qty); $labour_cost = round2($labour_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET labour_cost=".db_escape($labour_cost)." WHERE stock_id=".db_escape($stock_id); @@ -104,16 +92,12 @@ function add_issue_cost($stock_id, $qty, $date_, $costs) $myrow = db_fetch($result); $material_cost = $myrow['material_cost']; $dec = user_price_dec(); - $material_cost = price_decimal_format($material_cost, $dec); + price_decimal_format($material_cost, $dec); $qoh = get_qoh_on_date($stock_id, null, $date_); - /* - if ($qoh + $qty <= 0) - $material_cost = 0; - else - */ if ($qoh < 0) $qoh = 0; - $material_cost = ($qty * $costs) / ($qoh + $qty); + if ($qoh + $qty != 0) + $material_cost = ($qty * $costs) / ($qoh + $qty); $material_cost = round2($material_cost, $dec); $sql = "UPDATE ".TB_PREF."stock_master SET material_cost=material_cost+" .db_escape($material_cost) @@ -310,13 +294,22 @@ function work_order_update_finished_quantity($woid, $quantity, $force_close=0) function void_work_order($woid) { - $work_order = get_work_order($woid); + begin_transaction(); + $work_order = get_work_order($woid); if (!($work_order["type"] == WO_ADVANCED)) { - begin_transaction(); - - $sql = "UPDATE ".TB_PREF."workorders SET closed=1,units_issued=0 WHERE id = " + $date = sql2date($work_order['date_']); + $qty = $work_order['units_reqd']; + add_material_cost($work_order['stock_id'], -$qty, $date); // remove avg. cost for qty + $cost = get_gl_wo_cost($woid, WO_LABOUR); // get the labour cost and reduce avg cost + if ($cost != 0) + add_labour_cost($work_order['stock_id'], -$qty, $date, $cost); + $cost = get_gl_wo_cost($woid, WO_OVERHEAD); // get the overhead cost and reduce avg cost + if ($cost != 0) + add_overhead_cost($work_order['stock_id'], -$qty, $date, $cost); + + $sql = "UPDATE ".TB_PREF."workorders SET closed=1,units_reqd=0,units_issued=0 WHERE id = " .db_escape($woid); db_query($sql, "The work order couldn't be voided"); @@ -328,13 +321,64 @@ function void_work_order($woid) // clear the requirements units received void_wo_requirements($woid); - - commit_transaction(); } else { // void everything inside the work order : issues, productions, payments + $date = sql2date($work_order['date_']); + add_material_cost($work_order['stock_id'], -$work_order['units_reqd'], $date); // remove avg. cost for qty + $result = get_work_order_productions($woid); // check the produced quantity + $qty = 0; + while ($row = db_fetch($result)) + { + $qty += $row['quantity']; + // clear the production record + $sql = "UPDATE ".TB_PREF."wo_manufacture SET quantity=0 WHERE id=".$$row['id']; + db_query($sql, "Cannot void a wo production"); + + void_stock_move(ST_MANURECEIVE, $row['id']); // and void the stock moves; + } + $result = get_additional_issues($woid); // check the issued quantities + $cost = 0; + $issue_no = 0; + while ($row = db_fetch($result)) + { + $std_cost = get_standard_cost($row['stock_id']); + $icost = $std_cost * $row['qty_issued']; + $cost += $icost; + if ($issue_no == 0) + $issue_no = $row['issue_no']; + // void the actual issue items and their quantities + $sql = "UPDATE ".TB_PREF."wo_issue_items SET qty_issued = 0 WHERE issue_id=" + .db_escape($row['id']); + db_query($sql,"A work order issue item could not be voided"); + } + if ($issue_no != 0) + void_stock_move(ST_MANUISSUE, $issue_no); // and void the stock moves + if ($cost != 0) + add_issue_cost($work_order['stock_id'], -$qty, $date, $cost); + + $cost = get_gl_wo_cost($woid, WO_LABOUR); // get the labour cost and reduce avg cost + if ($cost != 0) + add_labour_cost($work_order['stock_id'], -$qty, $date, $cost); + $cost = get_gl_wo_cost($woid, WO_OVERHEAD); // get the overhead cost and reduce avg cost + if ($cost != 0) + add_overhead_cost($work_order['stock_id'], -$qty, $date, $cost); + + $sql = "UPDATE ".TB_PREF."workorders SET closed=1,units_reqd=0,units_issued=0 WHERE id = " + .db_escape($woid); + db_query($sql, "The work order couldn't be voided"); + + // void all related stock moves + void_stock_move(ST_WORKORDER, $woid); + + // void any related gl trans + void_gl_trans(ST_WORKORDER, $woid, true); + + // clear the requirements units received + void_wo_requirements($woid); } + commit_transaction(); } function get_sql_for_work_orders($outstanding_only, $all_items) @@ -410,5 +454,13 @@ function get_sql_for_where_used() return $sql; } //-------------------------------------------------------------------------------------- +function get_gl_wo_cost($woid, $cost_type) +{ + $cost = 0; + $result = get_gl_wo_cost_trans($woid, $cost_type); + while ($row = db_fetch($result)) + $cost += -$row['amount']; + return $cost; +} ?> \ No newline at end of file diff --git a/manufacturing/includes/db/work_orders_quick_db.inc b/manufacturing/includes/db/work_orders_quick_db.inc index 1b254f75..92b984dd 100644 --- a/manufacturing/includes/db/work_orders_quick_db.inc +++ b/manufacturing/includes/db/work_orders_quick_db.inc @@ -73,7 +73,7 @@ function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type, // ------------------------------------------------------------------------- - work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, false, $costs, $cr_acc, $labour, $cr_lab_acc); + work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, 0, $costs, $cr_acc, $labour, $cr_lab_acc); // ------------------------------------------------------------------------- @@ -87,7 +87,7 @@ function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type, //-------------------------------------------------------------------------------------- -function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced=false, $costs=0, $cr_acc="", $labour=0, $cr_lab_acc="") +function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced=0, $costs=0, $cr_acc="", $labour=0, $cr_lab_acc="") { global $wo_cost_types; $result = get_bom($stock_id); @@ -103,8 +103,9 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced if ($advanced) { + update_wo_requirement_issued($woid, $bom_item['component'], $bom_item["quantity"] * $units_reqd); // insert a -ve stock move for each item - add_stock_move(ST_WORKORDER, $bom_item["component"], $woid, + add_stock_move(ST_MANURECEIVE, $bom_item["component"], $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, @@ -128,15 +129,9 @@ function work_order_quick_costs($woid, $stock_id, $units_reqd, $date_, $advanced } if ($issue_total != 0) add_issue_cost($stock_id, $units_reqd, $date_, $issue_total); - $result = get_gl_wo_cost_trans($woid, WO_LABOUR); - $lcost = 0; - while ($row = db_fetch($result)) - $lcost += -$row['amount']; + $lcost = get_gl_wo_cost($woid, WO_LABOUR); add_labour_cost($stock_id, $units_reqd, $date_, $lcost * $units_reqd / $wo['units_reqd']); - $result = get_gl_wo_cost_trans($woid, WO_OVERHEAD); - $ocost = 0; - while ($row = db_fetch($result)) - $ocost += -$row['amount']; + $ocost = get_gl_wo_cost($woid, WO_OVERHEAD); add_overhead_cost($stock_id, $units_reqd, $date_, $ocost * $units_reqd / $wo['units_reqd']); } // credit additional costs diff --git a/manufacturing/work_order_add_finished.php b/manufacturing/work_order_add_finished.php index a5e03ecb..c23dc93f 100644 --- a/manufacturing/work_order_add_finished.php +++ b/manufacturing/work_order_add_finished.php @@ -117,7 +117,7 @@ function can_process() $wo_details = get_work_order($_POST['selected_id']); $qoh = get_qoh_on_date($wo_details["stock_id"], $wo_details["loc_code"], $_POST['date_']); - if (-$_POST['quantity'] + $qoh < 0) + if (-input_num('quantity') + $qoh < 0) { display_error(_("The unassembling cannot be processed because there is insufficient stock.")); set_focus('quantity'); @@ -135,7 +135,7 @@ function can_process() if ($row['mb_flag'] == 'D') // service, non stock continue; $qoh = get_qoh_on_date($row["stock_id"], $row["loc_code"], $_POST['date_']); - if ($qoh - $row['units_req'] * $_POST['quantity'] < 0) + if ($qoh - $row['units_req'] * input_num('quantity') < 0) { display_error( _("The production cannot be processed because a required item would cause a negative inventory balance :") . " " . $row['stock_id'] . " - " . $row['description']); @@ -164,7 +164,7 @@ if ((isset($_POST['Process']) || isset($_POST['ProcessAndClose'])) && can_proces if ($_POST['ProductionType'] == 0) $_POST['quantity'] = -$_POST['quantity']; - $id = work_order_produce($_POST['selected_id'], $_POST['ref'], $_POST['quantity'], + $id = work_order_produce($_POST['selected_id'], $_POST['ref'], input_num('quantity'), $_POST['date_'], $_POST['memo_'], $close_wo); meta_forward($_SERVER['PHP_SELF'], "AddedID=".$_POST['selected_id']."&date=".$_POST['date_']); @@ -181,10 +181,9 @@ start_form(); hidden('selected_id', $_POST['selected_id']); //hidden('WOReqQuantity', $_POST['WOReqQuantity']); +$dec = get_qty_dec($wo_details["stock_id"]); if (!isset($_POST['quantity']) || $_POST['quantity'] == '') -{ - $_POST['quantity'] = max($wo_details["units_reqd"] - $wo_details["units_issued"], 0); -} + $_POST['quantity'] = qty_format(max($wo_details["units_reqd"] - $wo_details["units_issued"], 0), $wo_details["stock_id"], $dec); start_table($table_style2); br(); @@ -197,7 +196,7 @@ if (!isset($_POST['ProductionType'])) yesno_list_row(_("Type:"), 'ProductionType', $_POST['ProductionType'], _("Produce Finished Items"), _("Return Items to Work Order")); -small_qty_row(_("Quantity:"), 'quantity', null, null, null, get_qty_dec($wo_details["stock_id"])); +small_qty_row(_("Quantity:"), 'quantity', null, null, null, $dec); date_row(_("Date:"), 'date_'); diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index 0b5c0eda..51ebcba5 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -24,7 +24,6 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, { $ex_rate = get_exchange_rate_to_home_currency($currency, $date); $price_in_home_currency = $price / $ex_rate; - //$price_in_home_currency = to_home_currency($price, $currency, $date); } else $price_in_home_currency = $price; @@ -43,17 +42,8 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, if ($adj_only) { if ($qoh > 0) - /* - if ($qoh <= 0) - $material_cost = 0; - else - */ $material_cost = ($qoh * $material_cost + $qty * $price_in_home_currency) / $qoh; } - /* - elseif ($qoh + $qty <= 0) - $material_cost = 0; - */ else { if ($qoh < 0) @@ -61,8 +51,9 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, if ($qoh + $qty > 0) $cost_adjust = true; $qoh = 0; - } - $material_cost = ($qoh * $material_cost + $qty * $price_in_home_currency) / ($qoh + $qty); + } + if ($qoh + $qty != 0) + $material_cost = ($qoh * $material_cost + $qty * $price_in_home_currency) / ($qoh + $qty); } $material_cost = round2($material_cost, $dec); if ($cost_adjust) // new 2010-02-10 diff --git a/purchasing/includes/ui/po_ui.inc b/purchasing/includes/ui/po_ui.inc index 7661fb9a..c862cca2 100644 --- a/purchasing/includes/ui/po_ui.inc +++ b/purchasing/includes/ui/po_ui.inc @@ -104,12 +104,15 @@ function display_po_header(&$order) } if ($order->supplier_id != get_post('supplier_id',-1)) { + $old_supp = $order->supplier_id; get_supplier_details_to_order($order, $_POST['supplier_id']); // supplier default price update foreach ($order->line_items as $line_no=>$item) { $line = &$order->line_items[$line_no]; - $line->price = get_purchase_price ($order->supplier_id, $_POST['stock_id']); - $line->quantity = get_purchase_conversion_factor ($order->supplier_id, $_POST['stock_id']); + $line->price = get_purchase_price ($order->supplier_id, $line->stock_id); + $line->quantity = + $line->quantity/get_purchase_conversion_factor ($old_supp, $line->stock_id) + *get_purchase_conversion_factor ($order->supplier_id, $line->stock_id); } $Ajax->activate('items_table'); } diff --git a/reporting/includes/class.graphic.inc b/reporting/includes/class.graphic.inc index 20022f1b..c1133648 100644 --- a/reporting/includes/class.graphic.inc +++ b/reporting/includes/class.graphic.inc @@ -222,8 +222,8 @@ class graph // Fill background imagefill($this->img, 0, 0, $this->color['background']); //imagefilledrectangle($this->img, 0, 0, $this->width, $this->height, $this->color['background']); - if ($border) - imagerectangle($this->img, 0, 0, $this->width-1, $this->height-1, imagecolorallocate($this->img, 100, 150, 200)); + //if ($border) + // imagerectangle($this->img, 0, 0, $this->width-1, $this->height-1, imagecolorallocate($this->img, 100, 150, 200)); // Draw title if (!empty($this->title)) @@ -396,7 +396,8 @@ class graph imagefilledrectangle($this->img, $x1, $y1, $x2, $y2, $this->color['bars']); $this->_imagestring($this->img, $this->size, ($x2+7), ($y1+2), $this->number_formated($this->y[$i], $this->dec2), $this->color['bars_shadow']); - $this->_imagestring($this->img, $this->size, ($x1 - ((strlen($parameter)*7)+7)), ($y1+2), $parameter, $this->color['axis_values']); + //$this->_imagestring($this->img, $this->size, ($x1 - ((strlen($parameter)*7)+7)), ($y1+2), $parameter, $this->color['axis_values']); + $this->_imagestring($this->img, $this->size, 30, ($y1+2), $parameter, $this->color['axis_values']); } } @@ -811,8 +812,10 @@ class graph { // Office case 1: - $this->color['title'] = imagecolorallocate($this->img, 50, 50, 50); - $this->color['background'] = imagecolorallocate($this->img, 238, 255, 238); + //$this->color['title'] = imagecolorallocate($this->img, 50, 50, 50); + $this->color['title'] = imagecolorallocate($this->img, 40, 70, 130); + //$this->color['background'] = imagecolorallocate($this->img, 238, 255, 238); + $this->color['background'] = imagecolorallocate($this->img, 255, 255, 255); $this->color['axis_values'] = imagecolorallocate($this->img, 50, 50, 50); $this->color['axis_line'] = imagecolorallocate($this->img, 100, 100, 100); $this->color['bg_lines'] = imagecolorallocate($this->img, 220, 220, 220); @@ -893,11 +896,13 @@ class graph // Spring case 3: $this->color['title'] = imagecolorallocate($this->img, 250, 50, 50); - $this->color['background'] = imagecolorallocate($this->img, 250, 250, 220); + //$this->color['background'] = imagecolorallocate($this->img, 250, 250, 220); + $this->color['background'] = imagecolorallocate($this->img, 255, 255, 255); $this->color['axis_values'] = imagecolorallocate($this->img, 50, 150, 50); $this->color['axis_line'] = imagecolorallocate($this->img, 50, 100, 50); $this->color['bg_lines'] = imagecolorallocate($this->img, 200, 224, 180); - $this->color['bg_legend'] = imagecolorallocate($this->img, 230, 230, 200); + //$this->color['bg_legend'] = imagecolorallocate($this->img, 230, 230, 200); + $this->color['bg_legend'] = imagecolorallocate($this->img, 255, 255, 255); if (preg_match("/^(1|2)$/", $this->type)) { diff --git a/reporting/includes/doctext.inc b/reporting/includes/doctext.inc index c76cfed9..db0e8a88 100644 --- a/reporting/includes/doctext.inc +++ b/reporting/includes/doctext.inc @@ -126,10 +126,10 @@ if (isset($header2type) || isset($linetype)) $doc_Invoice_no = ($doctype==ST_CUSTDELIVERY ? _("Delivery Note No.") : ($doctype == ST_CUSTPAYMENT ? _("Receipt No.") : ($doctype == ST_SUPPAYMENT ? _("Remittance No.") : - (($doctype==ST_SALESQUOTE || $doctype==ST_PURCHORDER || $doctype==ST_SALESORDER) ? _("Order no.") : - ($doctype==ST_SALESINVOICE ? _("Invoice No.") : ($doctype==ST_WORKORDER ? _("Word Order No") : _("Credit No."))))))); + (($doctype==ST_SALESQUOTE || $doctype==ST_PURCHORDER || $doctype==ST_SALESORDER) ? _("Order No.") : + ($doctype==ST_SALESINVOICE ? _("Invoice No.") : ($doctype==ST_WORKORDER ? _("Word Order No.") : _("Credit No."))))))); $doc_Delivery_no = _("Delivery Note No."); - $doc_Order_no = _("Order no."); + $doc_Order_no = _("Order No."); } if (isset($linetype)) { diff --git a/reporting/includes/doctext2.inc b/reporting/includes/doctext2.inc index 761f60f7..aa5d3055 100644 --- a/reporting/includes/doctext2.inc +++ b/reporting/includes/doctext2.inc @@ -126,9 +126,9 @@ if (isset($header2type) || isset($linetype)) ($doctype == ST_CUSTPAYMENT ? "Receipt No." : ($doctype == ST_SUPPAYMENT ? "Remittance No." : (($doctype == ST_SALESQUOTE || $doctype==ST_PURCHORDER || $doctype==ST_SALESORDER) ? "Order no." : - ($doctype==ST_SALESINVOICE ? "Invoice No." : ($doctype == ST_WORKORDER ? "Work Order No" : "Credit No.")))))); + ($doctype==ST_SALESINVOICE ? "Invoice No." : ($doctype == ST_WORKORDER ? "Work Order No." : "Credit No.")))))); $doc_Delivery_no = "Delivery Note No."; - $doc_Order_no = "Order no."; + $doc_Order_no = "Order No."; } if (isset($linetype)) { diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index b6962add..414151ba 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -1003,10 +1003,10 @@ class FrontReport extends Cpdf include("includes/doctext.inc"); } require_once($path_to_root . "/reporting/includes/class.mail.inc"); - $mail = new email($this->company['coy_name'], $this->company['email']); + $mail = new email(str_replace(",", "", $this->company['coy_name']), $this->company['email']); if (!isset($myrow['email']) || $myrow['email'] == '') $myrow['email'] = isset($myrow['contact_email']) ? $myrow['contact_email'] : ''; - $to = $myrow['DebtorName'] . " <" . $myrow['email'] . ">"; + $to = str_replace(",", "", $myrow['DebtorName']) . " <" . $myrow['email'] . ">"; $msg = $doc_Dear_Sirs . " " . $myrow['DebtorName'] . ",\n\n" . $doc_AttachedFile . " " . $subject . "\n\n"; if (isset($myrow['dimension_id']) && $myrow['dimension_id'] > 0 && $doctype == ST_SALESINVOICE) // helper for payment links diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index 97bfa0f6..f9fa8696 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -50,7 +50,7 @@ class BoxReports .$_SERVER['PHP_SELF']."?Class=$class_counter'" ." class='menu_option' id='".default_focus()."'" ." onclick='return showClass($class_counter);'$acc[1]>$acc[0]
"; - $st_reports .= "\n"; + $st_reports .= "
" . _("Reports For Class: ") . " $key
\n"; foreach($value as $report) { $acc = access_string($report->name); @@ -62,7 +62,7 @@ class BoxReports $action = $path_to_root.'/reporting/prn_redirect.php'; - $st_params = "
" . _("Reports For Class: ") . " $key
\n" + $st_params = ""; diff --git a/sales/manage/customer_branches.php b/sales/manage/customer_branches.php index 72bb9f29..91c291a0 100644 --- a/sales/manage/customer_branches.php +++ b/sales/manage/customer_branches.php @@ -157,7 +157,7 @@ function del_link($row) { } function select_link($row) { - return button("Select".$row["branch_code"],_("Select"), '', ICON_ADD, 'selector'); + return button("Select".$row["branch_code"], $row["branch_code"], '', ICON_ADD, 'selector'); } start_form(); diff --git a/taxes/tax_calc.inc b/taxes/tax_calc.inc index 1230d8e7..3f54bd22 100644 --- a/taxes/tax_calc.inc +++ b/taxes/tax_calc.inc @@ -162,13 +162,10 @@ function get_tax_for_items($items, $prices, $shipping_cost, $tax_group, $tax_inc { $index = $item_tax['tax_type_id']; if($tax_included==1) {// 2008-11-26 Joe Hunt Taxes are stored without roundings - //$ret_tax_array[$index]['Value'] += round($prices[$i] * $item_tax['rate'] - // / ($item_tax['rate'] + 100), user_price_dec()); - $ret_tax_array[$index]['Value'] += ($prices[$i] * $item_tax['rate'] / ($item_tax['rate'] + 100)); - $ret_tax_array[$index]['Net'] += ($prices[$i] * 100 / ($item_tax['rate'] + 100)); + $nprice = get_tax_free_price_for_item($items[$i], $prices[$i], $tax_group, $tax_included); + $ret_tax_array[$index]['Value'] += ($nprice * $item_tax['rate'] / 100); + $ret_tax_array[$index]['Net'] += $nprice; } else { - //$ret_tax_array[$index]['Value'] += - // round($prices[$i] * $item_tax['rate'] / 100, user_price_dec()); $ret_tax_array[$index]['Value'] += ($prices[$i] * $item_tax['rate'] / 100); $ret_tax_array[$index]['Net'] += $prices[$i]; } @@ -182,18 +179,26 @@ function get_tax_for_items($items, $prices, $shipping_cost, $tax_group, $tax_inc $item_taxes = get_shipping_tax_as_array(); if ($item_taxes != null) { + if ($tax_included == 1) + { + $tax_rate = 0; + foreach ($item_taxes as $item_tax) + { + $index = $item_tax['tax_type_id']; + if(isset($ret_tax_array[$index])) { + $tax_rate += $item_tax['rate']; + } + } + $shipping_net = round2($shipping_cost / (1 + ($tax_rate / 100)), user_price_dec()); + } foreach ($item_taxes as $item_tax) { $index = $item_tax['tax_type_id']; if(isset($ret_tax_array[$index])) { if($tax_included==1) {// 2008-11-26 Joe Hunt Taxes are stored without roundings - //$ret_tax_array[$index]['Value'] += round($shipping_cost * $item_tax['rate'] - // / ($item_tax['rate'] + 100), user_price_dec()); - $ret_tax_array[$index]['Value'] += ($shipping_cost * $item_tax['rate'] / ($item_tax['rate'] + 100)); - $ret_tax_array[$index]['Net'] += ($shipping_cost * 100 / ($item_tax['rate'] + 100)); + $ret_tax_array[$index]['Value'] += ($shipping_net * $item_tax['rate'] / 100); + $ret_tax_array[$index]['Net'] += $shipping_net; } else { - //$ret_tax_array[$index]['Value'] += - // round($shipping_cost * $item_tax['rate'] / 100, user_price_dec()); $ret_tax_array[$index]['Value'] += ($shipping_cost * $item_tax['rate'] / 100); $ret_tax_array[$index]['Net'] += $shipping_cost; } diff --git a/update.html b/update.html index df509509..596ab68d 100644 --- a/update.html +++ b/update.html @@ -18,13 +18,13 @@ these files.
  • Upload all the new files. -
  • Look into the file, config.default.php and compare with your own config.php file. You should update the the following in your config.php:

    • Change the $version in your config.php file, about line 59, from "2.X.X" to "2.2.6".
    • Copy  the 2 lines from config.default file, about line  122:

      $table_style     = "class='tablestyle'";
      $table_style2     = "class='tablestyle2'";

      into config.php about line  122 and replace these 4 lines:

      if (!isset($_SESSION['bordercolor']))
          $_SESSION['bordercolor'] = "#8cacbb";
      $table_style     = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";

      If this is an update from 2.2.3, 2.2.4 , 2.2.5 to 2.2.6 
      you are done and  should ignore the the rest of the items in this note.
    • Copy these 2 lines from config.default.php at the bottom into config.php at the bottom:

      /* allow using of multi level sub-types when digits are of same length in account types */

      $use_new_account_types = 0;
      Change this to 1 if you want to use new multi level sup-types.
    • If this is an update from "2.2.X" to "2.2.5" you are done and  should ignore the the rest of the items in this note.
    • Copy these 2 lines from config.default.php about line 80-82 into config.php about line 80:

      /* Show users online discretetely in the footer */
      $show_users_online = 0;
      Change this to 1 if you want to show users online.
    • Replace the 2 lines about line 110-111 in config.php:

      $table_style     = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";
    • With these 4 lines from config.default.php:

      if (!isset($_SESSION['bordercolor']))
          $_SESSION['bordercolor'] = "#8cacbb";
      $table_style     = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";
    • Remove these 2 lines from config.php about line 176-177:

      /* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */
      $def_app = "orders";
    • Copy these 3 lines from config.default.php about line 113-115

      // defalt dateformats and dateseps indexes used before user login

      $dflt_date_fmt = 0;
      $dflt_date_sep = 0;
    • Copy these 2 lines from config.default.php about line 211-212:

      define("ICON_SUBMIT", "ok.gif");        // new in 2.2
      define("ICON_ESCAPE", "escape.png");    // new in 2.2
    • And paste them into config.php about line 209
    • If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday
      then you  should  set this line in config.php about line  95.
      $date_system = 3;
    • If you want to use FrontAccounting help wiki then set this line in config.php about line 85
      $help_base_url = "http://frontaccounting.net/fawiki?n=Help.";
  • Rename or remove the /install folder (you have already performed the install +
  • Look into the file, config.default.php and compare with your own config.php file. You should update the the following in your config.php:

    • Change the $version in your config.php file, about line 59, from "2.X.X" to "2.2.7".

      if this is an update from 2.2.6 to 2.276 
      you are done and  should ignore the the rest of the items in this note.
    • Copy  the 2 lines from config.default file, about line  122:

      $table_style     = "class='tablestyle'";
      $table_style2     = "class='tablestyle2'";

      into config.php about line  122 and replace these 4 lines:

      if (!isset($_SESSION['bordercolor']))
          $_SESSION['bordercolor'] = "#8cacbb";
      $table_style     = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";
      $table_style2     = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";

      If this is an update from 2.2.3, 2.2.4 , 2.2.5 to 2.2.7 
      you are done and  should ignore the the rest of the items in this note.
    • Copy these 2 lines from config.default.php about line 80-82 into config.php about line 80:

      /* Show users online discretetely in the footer */
      $show_users_online = 0;
      Change this to 1 if you want to show users online.
    • Remove these 2 lines from config.php about line 176-177:

      /* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */
      $def_app = "orders";
    • Copy these 3 lines from config.default.php about line 113-115

      // defalt dateformats and dateseps indexes used before user login

      $dflt_date_fmt = 0;
      $dflt_date_sep = 0;
    • Copy these 2 lines from config.default.php about line 211-212:

      define("ICON_SUBMIT", "ok.gif");        // new in 2.2
      define("ICON_ESCAPE", "escape.png");    // new in 2.2
    • And paste them into config.php about line 209
    • If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday
      then you  should  set this line in config.php about line  95.
      $date_system = 3;
    • If you want to use FrontAccounting help wiki then set this line in config.php about line 85
      $help_base_url = "http://frontaccounting.net/fawiki?n=Help.";
  • Rename or remove the /install folder (you have already performed the install process earlier).
    -
  • You +
  • There are no database changes during a major and minor release. Like from 2.2 to 2.2.1 - 2.2.X .
  • If you are upgrading from an earlier installation you must immediately login on company 0, the first company you created, as admin (called the superadmin). If you use a theme other than the standard 3, @@ -35,7 +35,7 @@ to the 'Setup' tab and run 'Software Upgrade'. Mark the checkbox 'Install' and press 'Upgrade System'.  You must also do this if you upgrade from 2.2 Beta to 2.2 RC. This will -upgrade ALL your companies.
  • If something goes wrong during upgrade, you can enter here again and try 'Force Upgrade', and press 'Upgrade System' again.
  • There are no database changes during a major and minor release. Like from 2.2 to 2.2.1 - 2.2.X .
  • Enter +upgrade ALL your companies.
  • If something goes wrong during upgrade, you can enter here again and try 'Force Upgrade', and press 'Upgrade System' again.
  • Enter 'Setup' tab, 'System and Generel GL Setup'.  Set the correct Accounts for Retained Earnings, Profit/Loss Year and Bank Charge.
  • Enter 'Setup' tab, 'Access Setup'. Check all the roles and change as you -- 2.30.2
  • \n" . "
    \n"; $st_params .= submit('Rep'.$report->id, _("Display: ") . access_string($report->name, true), @@ -99,9 +99,9 @@ class BoxReports } "; - $st .= ""; + $st .= "
    "; $st .= ""; - $st .= ""; + $st .= ""; $st .= ""; $st .= "
    $st_classes$st_reports$st_reports$st_params

    "; diff --git a/reporting/rep107.php b/reporting/rep107.php index 91c7a8d3..d8004652 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -182,7 +182,7 @@ function print_invoices() if ($tax_item['included_in_price']) { $rep->TextCol(3, 7, $doc_Included . " " . $tax_item['tax_type_name'] . - " (" . $tax_item['rate'] . "%) " . $doc_Amount . ":" . $DisplayTax, -2); + " (" . $tax_item['rate'] . "%) " . $doc_Amount . ": " . $DisplayTax, -2); } else { diff --git a/reporting/rep110.php b/reporting/rep110.php index 05bb3048..ca7a27fb 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -177,7 +177,7 @@ function print_deliveries() if ($tax_item['included_in_price']) { $rep->TextCol(3, 7, $doc_Included . " " . $tax_item['tax_type_name'] . - " (" . $tax_item['rate'] . "%) " . $doc_Amount . ":" . $DisplayTax, -2); + " (" . $tax_item['rate'] . "%) " . $doc_Amount . ": " . $DisplayTax, -2); } else { diff --git a/sales/customer_delivery.php b/sales/customer_delivery.php index 82ae32a0..c263ea06 100644 --- a/sales/customer_delivery.php +++ b/sales/customer_delivery.php @@ -377,7 +377,9 @@ start_table("$table_style width=90%"); if (!isset($_POST['due_date']) || !is_date($_POST['due_date'])) { $_POST['due_date'] = get_invoice_duedate($_SESSION['Items']->payment, $_POST['DispatchDate']); } -date_row(_("Invoice Dead-line"), 'due_date', '', null, 0, 0, 0, "class='tableheader2'"); +start_row(); +date_cells(_("Invoice Dead-line"), 'due_date', '', null, 0, 0, 0, "class='tableheader2'"); +end_row(); end_table(); echo "