Difference between revisions of "How to referece xml rounding"
Asp-luqman (talk | contribs) (→Instalasi) |
Asp-luqman (talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 10: | Line 10: | ||
==<p> Instalasi <p>== | ==<p> Instalasi <p>== | ||
− | 1. | + | 1. Tambah Format.xml |
+ | |||
<Number name="amounttwodigitInform" | <Number name="amounttwodigitInform" | ||
decimal="." grouping="," formatOutput="#,##0.00" formatInternal="#0.00" /> | decimal="." grouping="," formatOutput="#,##0.00" formatInternal="#0.00" /> | ||
Line 25: | Line 26: | ||
di file Format.xml lokasi infinite/config | di file Format.xml lokasi infinite/config | ||
+ | |||
+ | 2. Tambah BigDecimalDomainType.java | ||
+ | |||
+ | public static class Amounttwodigit extends BigDecimalDomainType { | ||
+ | public String getFormatId() { | ||
+ | return "amounttwodigit"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | [[image:BigDecimalDomainTypeconfig.png|600px]]</p> | ||
+ | |||
+ | |||
+ | di file BigDecimalDomainType.java lokasi infinite/src/org/openbravo/base/model/domaintype | ||
+ | |||
+ | |||
+ | 3. Tambah NumberUIDefinition.java | ||
+ | |||
+ | public static class AmounttwodigitUIDefinition extends NumberUIDefinition { | ||
+ | public String getParentType() { | ||
+ | return "float"; | ||
+ | } | ||
+ | |||
+ | public String getFormat() { | ||
+ | return "amounttwodigitEdition"; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | [[image:NumberUIDefinitionconfig.png|600px]]</p> | ||
+ | |||
+ | |||
+ | di file NumberUIDefinition.java lokasi infinite/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference | ||
+ | |||
+ | 4. Setup Reference | ||
+ | |||
+ | * Header | ||
+ | [[image:Setup_ReferencHeaderAmounttwodigitconfig.png|600px]]</p> | ||
+ | |||
+ | |||
+ | Module | ||
+ | Core - 3.0.33196 | ||
+ | |||
+ | Name | ||
+ | Amounttwodigit | ||
+ | |||
+ | Base Reference di cek list | ||
+ | |||
+ | |||
+ | Model Implementation | ||
+ | org.openbravo.base.model.domaintype.BigDecimalDomainType$Amounttwodigit | ||
+ | |||
+ | WAD Implementation | ||
+ | org.openbravo.wad.controls.WADAmounttwodigit | ||
+ | |||
+ | |||
+ | Runtime UI Implementation | ||
+ | org.openbravo.reference.ui.UIAmounttwodigit | ||
+ | |||
+ | * Line User Interface Definition | ||
+ | [[image:Setup_ReferencLineAmounttwodigitconfig.png|600px]]</p> | ||
+ | |||
+ | Implementation class name | ||
+ | org.openbravo.client.kernel.reference.NumberUIDefinition$AmounttwodigitUIDefinition | ||
+ | |||
+ | |||
+ | finis |
Latest revision as of 07:40, 16 February 2023
Introduction
Pembuata Reference baru untuk menambah pilihan saat mendifine colom agar tampilan bisa disesuaikan. untuk case ini saya akan menambah reference untuk merounding dua di belakang koma.
Fitur
- Dapat merounding 2 digit di belakang koma
Instalasi
1. Tambah Format.xml
<Number name="amounttwodigitInform" decimal="." grouping="," formatOutput="#,##0.00" formatInternal="#0.00" /> <Number name="amounttwodigitRelation" decimal="." grouping="," formatOutput="#,##0.00" formatInternal="#0.00" /> <Number name="amounttwodigitEdition" decimal="." grouping="," formatOutput="#0.00" formatInternal="#0.00" /> <Number name="amounttwodigitExcel" decimal="." grouping="," formatOutput="#,##0.00" formatInternal="#0.00" />
di file Format.xml lokasi infinite/config
2. Tambah BigDecimalDomainType.java
public static class Amounttwodigit extends BigDecimalDomainType { public String getFormatId() { return "amounttwodigit"; } }
di file BigDecimalDomainType.java lokasi infinite/src/org/openbravo/base/model/domaintype
3. Tambah NumberUIDefinition.java
public static class AmounttwodigitUIDefinition extends NumberUIDefinition { public String getParentType() { return "float"; }
public String getFormat() { return "amounttwodigitEdition"; } }
di file NumberUIDefinition.java lokasi infinite/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference
4. Setup Reference
- Header
Module
Core - 3.0.33196
Name Amounttwodigit
Base Reference di cek list
Model Implementation
org.openbravo.base.model.domaintype.BigDecimalDomainType$Amounttwodigit
WAD Implementation org.openbravo.wad.controls.WADAmounttwodigit
Runtime UI Implementation
org.openbravo.reference.ui.UIAmounttwodigit
- Line User Interface Definition
Implementation class name org.openbravo.client.kernel.reference.NumberUIDefinition$AmounttwodigitUIDefinition
finis