Db0034: Fix for a stored proc
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Swarmops.Database
|
||||
/// </summary>
|
||||
public static int DbVersionExpected
|
||||
{
|
||||
get { return 33; }
|
||||
get { return 34; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,4 +30,5 @@
|
||||
0030 - Added flexibility for Resolver classes for OutboundComms [RF]
|
||||
0031 - Added foreign ID tables, procs for transactions, to track blockchain [RF]
|
||||
0032 - Added native currency to transaction rows, for multi-currency accounting [RF]
|
||||
0033 - Added transaction row identity return, necessary for 0032 [RF]
|
||||
0033 - Added transaction row identity return, necessary for 0032 [RF]
|
||||
0034 - Fix for SetFinancialTransactionRowNativeCurrency
|
||||
@@ -0,0 +1,31 @@
|
||||
DROP procedure IF EXISTS `SetFinancialTransactionRowNativeCurrency`
|
||||
|
||||
|
||||
#
|
||||
|
||||
|
||||
CREATE PROCEDURE `SetFinancialTransactionRowNativeCurrency`(
|
||||
IN financialTransactionRowId INT,
|
||||
IN currencyId INT,
|
||||
IN nativeAmountCents BIGINT
|
||||
)
|
||||
BEGIN
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM FinancialTransactionRowsNativeCurrency
|
||||
WHERE FinancialTransactionRowsNativeCurrency.FinancialTransactionRowId=financialTransactionRowId)
|
||||
THEN
|
||||
|
||||
INSERT INTO FinancialTransactionRowsNativeCurrency (FinancialTransactionRowId,CurrencyId,NativeAmountCents)
|
||||
VALUES (financialTransactionRowId,currencyId,nativeAmountCents);
|
||||
|
||||
ELSE
|
||||
|
||||
UPDATE FinancialTransactionRowsNativeCurrency
|
||||
SET FinancialTransactionRowsNativeCurrency.CurrencyId=currencyId,
|
||||
FinancialTransactionRowsNativeCurrency.NativeAmountCents=nativeAmountCents
|
||||
WHERE FinancialTransactionRowsNativeCurrency.FinancialTransactionRowId=
|
||||
financialTransactionRowId;
|
||||
|
||||
END IF;
|
||||
|
||||
END
|
||||
Reference in New Issue
Block a user