|
From: <dai...@us...> - 2015-05-16 23:38:46
|
Revision: 7301
http://sourceforge.net/p/web-erp/reponame/7301
Author: daintree
Date: 2015-05-16 23:38:43 +0000 (Sat, 16 May 2015)
Log Message:
-----------
added check bank accounts before delete currency;
Modified Paths:
--------------
trunk/Currencies.php
trunk/doc/Change.log
Modified: trunk/Currencies.php
===================================================================
--- trunk/Currencies.php 2015-05-14 14:33:10 UTC (rev 7300)
+++ trunk/Currencies.php 2015-05-16 23:38:43 UTC (rev 7301)
@@ -264,10 +264,19 @@
} elseif ($FunctionalCurrency==$SelectedCurrency){
prnMsg(_('Cannot delete this currency because it is the functional currency of the company'),'warn');
} else {
- //only delete if used in neither customer or supplier, comp prefs, bank trans accounts
- $sql="DELETE FROM currencies WHERE currabrev='" . $SelectedCurrency . "'";
+ $sql= "SELECT COUNT(*) FROM bankaccounts
+ WHERE currcode = '" . $SelectedCurrency . "'";
$result = DB_query($sql);
- prnMsg(_('The currency definition record has been deleted'),'success');
+ $myrow = DB_fetch_row($result);
+ if ($myrow[0] > 0){
+ prnMsg(_('Cannot delete this currency because there are bank accounts that use this currency') .
+ '<br />' . ' ' . _('There are') . ' ' . $myrow[0] . ' ' . _('bank accounts that refer to this currency'),'warn');
+ } else {
+ //only delete if used in neither customer or supplier, comp prefs, bank trans accounts
+ $sql="DELETE FROM currencies WHERE currabrev='" . $SelectedCurrency . "'";
+ $result = DB_query($sql);
+ prnMsg(_('The currency definition record has been deleted'),'success');
+ }
}
}
}
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2015-05-14 14:33:10 UTC (rev 7300)
+++ trunk/doc/Change.log 2015-05-16 23:38:43 UTC (rev 7301)
@@ -1,5 +1,6 @@
webERP Change Log
+17/5/15 Phil: Made currencies delete check first for bank accounts set up using the currency - as reported by Ricard
10/05/15 RChacon: New features: (1) GL account code for an inventory location, so that you can have general ledger transactions of inventory transfers to or from this location; useful for pledged inventory and goods on consignment. (2) Allow Invoicing parameter to allow or deny the availability of a location to be delivered; useful when a location stores compromised good that can not be sold.
08/05/15 RChacon: In DeliveryDetails.php, add $ViewTopic and $BookMark to ManualSalesOrders.html.
07/05/15 RChacon: In CustomerInquiry.php, hide submit button and 'More Info' columns when printing. Add thead tag to enable the table header to be printed at the top of each page.
@@ -7,7 +8,7 @@
04/05/15 Exson: Make PO number searching also in compliance with location authority rules and make default search result as all if users have full location authority.
04/05/15 Exson: Make all option available for users who have authority for all locations and all option available for all stock categories in PO_SelectOSPurchOrder.php.
02/05/15 TeHonu: Added bankaccountusers table in Z_ChangeGLAccountCode.php
-30/04/15 TurboPT: Add Delivery Date in GoodsReceived.php output. Forum feature request by giusba71.
+30/04/15 TurboPT: Add Delivery Date in GoodsReceived.php output. Forum feature request by giusba71.
30/04/15 Exson: Fixed the notice noise in SupplierCredit.php and SupplierInvoice.php.
30/04/15 Exson: Fixed the properties initial bug and tidy code up by fix typo.
26/04/15 Exson: Add adjustment reason to the mail text and fixed the notice noise in StockAdjustments.php.
|