How to referece xml rounding

From InfiniteERP Wiki
Revision as of 07:26, 16 February 2023 by Asp-luqman (talk | contribs) (Instalasi)
Jump to: navigation, search

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" />


Formatxmlconfig.png


di file Format.xml lokasi infinite/config

2. Tambah BigDecimalDomainType.java

 public static class Amounttwodigit extends BigDecimalDomainType {
   public String getFormatId() {
     return "amounttwodigit";
   }
 }

BigDecimalDomainTypeconfig.png


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";
   }
 }

NumberUIDefinitionconfig.png


di file NumberUIDefinition.java lokasi infinite/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference