User talk:Wolfganguhr: Difference between revisions
Wolfganguhr (talk | contribs) No edit summary |
Wolfganguhr (talk | contribs) No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Actual Work == | == Actual Work == | ||
[[ | [[Error Messages and Error Messages]] | ||
[[ | [[Screen scaffolding: controls]] | ||
<value function="assign(a_transaction_amount_n, iif({a_debit_credit_indicator_l}, mul(-1, {a_transaction_amount_n}), {a_transaction_amount_n}))"/> | |||
<field whichfield="column 0" format="#,##0.00;;;"><value function="iif({a_debit_credit_indicator_l}, {a_transaction_amount_n}, | |||
0)"/></field> | |||
<field whichfield="column 1" format="#,##0.00;;;"><value function="iif({a_debit_credit_indicator_l}, 0, {a_transaction_amount_n})"/></field> | |||
Line 17: | Line 18: | ||
[[Error Codes in Openpetra]] | [[Error Codes in Openpetra]] | ||
File:Code-overview.JPG | [[File:Code-overview.JPG]] | ||
https://dev.solidcrp.com/wiki/index.php/Restore_the_Petra_Data_Base | https://dev.solidcrp.com/wiki/index.php/Restore_the_Petra_Data_Base | ||
== Snippets == | |||
The standard target account in petra is the account 9700 which is defined in the a_account_property table and the column a_account_code_c. | |||
The following reallocation rules have been detected: | |||
=== Target Account Codes for the Reallocation === | |||
# If a_ledger.a_ilt_account_flag_l has been set, the target account allways shall be the account ICH_ACCT (Account Code 8500) regardless of the following rules (a_ledger-values are valid for all accounts in the ledger!). | |||
# Otherwise the default value for the target account shall be EARNINGS-BF-ACCT (Account Code 9700) | |||
# The default account value can be overwritten to an other value by an cost centre property which is stored in a_account_property. | |||
[[File:A account property.JPG]] | |||
=== Target Cost Centre Codes for the Reallocation === | |||
# If a_ledger.a_ilt_account_flag_l has been set, the target cost centre of glm shall be used regardless of the following rules. | |||
# If a_ledger.a_branch_processing_l has been set, the target cost centre of glm shall be used regardless of the following rules. | |||
# Otherwise the default value for the target cost centre shall be STANDARD-COST-CENTRE (this is the ledger number followed by "00", so in case of ledger 47 the standard is 4700) | |||
# The default cost centre value can be overwritten to an other value by an cost centre property which is stored in a_account_property. | |||
[[File:A account property.JPG]] | |||
Here instead of STANDARDCC the key SAMECC shall be placed. | |||
=== Getting the correct number of digits === | |||
Actually there is one efficient way to get the information about the maximal precision of a currency. The table a_leder provides the column a_country_code_c. The value in this column shall be used to create a .net [http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx CultureInfo class]. Actually the values are two character codes for example "DE". | |||
try | |||
{ | |||
numberFormatInfo = | |||
new System.Globalization.CultureInfo( | |||
ledger.CountryCode, false).NumberFormat; | |||
} | |||
catch (System.NotSupportedException) | |||
{ | |||
numberFormatInfo = | |||
new System.Globalization.CultureInfo( | |||
String.Empty, false).NumberFormat; | |||
} | |||
If the countryCode is "DE" then the NotSupportedException will be thrown. You really need a code in the syntax <languagecode2>-<country/regioncode2> where the two digits for the language code are based on [http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.name.aspx ISO 639-1 and the regicode is based on ISO 3166]. Then numberFormatInfo.NumberDecimalDigits holds the correct value. | |||
TODO: '''We have to investigate if an automatic conversion of this values may be necessary.''' | |||
''Italic text'' |
Latest revision as of 14:56, 12 Mayıs 2011
Actual Work
Error Messages and Error Messages
<value function="assign(a_transaction_amount_n, iif({a_debit_credit_indicator_l}, mul(-1, {a_transaction_amount_n}), {a_transaction_amount_n}))"/>
<field whichfield="column 0" format="#,##0.00;;;"><value function="iif({a_debit_credit_indicator_l}, {a_transaction_amount_n}, 0)"/></field>
<field whichfield="column 1" format="#,##0.00;;;"><value function="iif({a_debit_credit_indicator_l}, 0, {a_transaction_amount_n})"/></field>
Notes
https://dev.solidcrp.com/wiki/index.php/Restore_the_Petra_Data_Base
Snippets
The standard target account in petra is the account 9700 which is defined in the a_account_property table and the column a_account_code_c.
The following reallocation rules have been detected:
Target Account Codes for the Reallocation
- If a_ledger.a_ilt_account_flag_l has been set, the target account allways shall be the account ICH_ACCT (Account Code 8500) regardless of the following rules (a_ledger-values are valid for all accounts in the ledger!).
- Otherwise the default value for the target account shall be EARNINGS-BF-ACCT (Account Code 9700)
- The default account value can be overwritten to an other value by an cost centre property which is stored in a_account_property.
Target Cost Centre Codes for the Reallocation
- If a_ledger.a_ilt_account_flag_l has been set, the target cost centre of glm shall be used regardless of the following rules.
- If a_ledger.a_branch_processing_l has been set, the target cost centre of glm shall be used regardless of the following rules.
- Otherwise the default value for the target cost centre shall be STANDARD-COST-CENTRE (this is the ledger number followed by "00", so in case of ledger 47 the standard is 4700)
- The default cost centre value can be overwritten to an other value by an cost centre property which is stored in a_account_property.
Here instead of STANDARDCC the key SAMECC shall be placed.
Getting the correct number of digits
Actually there is one efficient way to get the information about the maximal precision of a currency. The table a_leder provides the column a_country_code_c. The value in this column shall be used to create a .net CultureInfo class. Actually the values are two character codes for example "DE".
try { numberFormatInfo = new System.Globalization.CultureInfo( ledger.CountryCode, false).NumberFormat; } catch (System.NotSupportedException) { numberFormatInfo = new System.Globalization.CultureInfo( String.Empty, false).NumberFormat; }
If the countryCode is "DE" then the NotSupportedException will be thrown. You really need a code in the syntax <languagecode2>-<country/regioncode2> where the two digits for the language code are based on ISO 639-1 and the regicode is based on ISO 3166. Then numberFormatInfo.NumberDecimalDigits holds the correct value.
TODO: We have to investigate if an automatic conversion of this values may be necessary. Italic text