Skip to main content

Overview

Simple Invoice includes built-in support for 32 international currencies. The currency system manages symbols, formatting, precision, and separators for proper display of monetary values.

Database Schema

Currencies are stored in the currencies table:
CREATE TABLE IF NOT EXISTS `currencies` (
  `id` int(10) unsigned NOT NULL,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `symbol` varchar(255) NOT NULL,
  `precision` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `thousand_separator` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `decimal_separator` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `code` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;

Currency Fields

id
integer
Unique identifier for the currency (1-32)
name
string
Full currency name (e.g., “US Dollar”, “Euro”)
symbol
string
Currency symbol displayed on invoices (e.g., ”$”, ”€”, ”£”)
precision
string
Number of decimal places (typically “2” for cents, “0” for currencies without subunits)
thousand_separator
string
Character used to separate thousands (e.g., ”,” or ”.” or ”’”)
decimal_separator
string
Character used for decimal point (e.g., ”.” or ”,”)
code
string
ISO 4217 currency code (e.g., “USD”, “EUR”, “GBP”)

Supported Currencies

Simple Invoice includes 32 pre-configured currencies:
IDCurrencySymbolCodeFormat
1US Dollar$USD1,000.00
9Canadian DollarC$CAD1,000.00
18Quetzal GuatemaltecoQGTQ1,000.00
20Real BrasileñoR$BRL1.000,00
23Peso Argentino$ARS1.000,00
28Peso Mexicano$MXN1,000.00
30Peso Colombiano$COP1.000,00
IDCurrencySymbolCodeFormat
2Libra Esterlina£GBP1,000.00
3EuroEUR1.000,00
5Danish KronekrDKK1.000,00
7Swedish KronakrSEK1.000,00
14Norske KronerkrNOK1.000,00
17Swiss FrancCHFCHF1’000.00
IDCurrencySymbolCodeFormat
10Philippine PesoPPHP1,000.00
11Indian RupeeRs.INR1,000.00
12Australian Dollar$AUD1,000.00
13Singapore DollarSGDSGD1,000.00
15New Zealand Dollar$NZD1,000.00
16Vietnamese DongVNDVND1.000
19Malaysian RinggitRMMYR1,000.00
21Thai BahtTHBTHB1,000.00
26Hong Kong Dollar$HKD1,000.00
27Indonesian RupiahRpIDR1,000.00
32Chinese RenminbiRMBCNY1,000.00
IDCurrencySymbolCodeFormat
4South African RandRZAR1.000,00
6Israeli ShekelNISILS1,000.00
8Kenyan ShillingKShKES1,000.00
22Nigerian NairaNGNNGN1,000.00
24Bangladeshi TakaTkBDT1,000.00
25United Arab Emirates DirhamDHAED1,000.00
29Egyptian Pound£EGP1,000.00
31West African FrancCFAXOF1,000.00

Selecting Currency

The company currency is selected in the company profile configuration. The system queries available currencies and populates a dropdown:
<select class='form-control input-sm' name="moneda" required>
  <?php 
    $sql="select name, symbol from currencies group by symbol order by name";
    $query=mysqli_query($con,$sql);
    while($rw=mysqli_fetch_array($query)){
      $simbolo=$rw['symbol'];
      $moneda=$rw['name'];
      if ($row['moneda']==$simbolo){
        $selected="selected";
      } else {
        $selected="";
      }
      ?>
      <option value="<?php echo $simbolo;?>" <?php echo $selected;?>>
        <?php echo ($simbolo);?>
      </option>
      <?php
    }
  ?>
</select>
The currency symbol is stored in the perfil.moneda field (up to 6 characters). This symbol is then used throughout the application to display prices.

Currency Formatting Examples

Different currencies use different formatting conventions:

US Dollar Format

('US Dollar', '$', '2', ',', '.', 'USD')
Display: $1,234.56

Euro Format

('Euro', '€', '2', '.', ',', 'EUR')
Display: €1.234,56

Swiss Franc Format

('Swiss Franc', 'CHF ', '2', "'", '.', 'CHF')
Display: CHF 1’234.56

Vietnamese Dong Format

('Vietnamese Dong', 'VND ', '0', '.', ',', 'VND')
Display: VND 1.234 (no decimal places)

Adding Custom Currencies

To add a new currency to the system:
1

Insert Currency Record

Add a new record to the currencies table:
INSERT INTO `currencies` 
  (`id`, `name`, `symbol`, `precision`, `thousand_separator`, `decimal_separator`, `code`) 
VALUES 
  (33, 'Japanese Yen', '¥', '0', ',', '.', 'JPY');
2

Configure Formatting

  • Set precision to “0” for currencies without cents/pence
  • Set precision to “2” for most major currencies
  • Set precision to “3” for currencies like Kuwaiti Dinar
3

Select in Profile

The new currency will automatically appear in the company profile currency dropdown

Currency Data Structure

Here are some real examples from the database:
INSERT INTO `currencies` VALUES
(1, 'US Dollar', '$', '2', ',', '.', 'USD'),
(3, 'Euro', '€', '2', '.', ',', 'EUR'),
(11, 'Indian Rupee', 'Rs. ', '2', ',', '.', 'INR'),
(16, 'Vietnamese Dong', 'VND ', '0', '.', ',', 'VND'),
(17, 'Swiss Franc', 'CHF ', '2', "'", '.', 'CHF'),
(20, 'Real Brasileño', 'R$', '2', '.', ',', 'BRL'),
(28, 'Peso Mexicano', '$', '2', ',', '.', 'MXN'),
(32, 'Chinese Renminbi', 'RMB ', '2', ',', '.', 'CNY');

Currency Query

To retrieve all currencies ordered by name:
$sql = "select name, symbol from currencies group by symbol order by name";
$query = mysqli_query($con, $sql);
while($rw = mysqli_fetch_array($query)){
  $symbol = $rw['symbol'];
  $name = $rw['name'];
  // Display or process currency
}

Best Practices

Precision

Use “2” for most currencies, “0” for currencies without decimal subunits (like Japanese Yen or Vietnamese Dong)

Separators

Respect regional conventions:
  • US/UK: comma for thousands, dot for decimal (1,000.00)
  • EU: dot for thousands, comma for decimal (1.000,00)

Symbols

Include trailing space for multi-character symbols (e.g., “CHF ”, “RMB ”) for proper display formatting

ISO Codes

Always use standard ISO 4217 currency codes for the code field
Changing the currency after creating invoices may cause display inconsistencies. Set your currency before generating invoices.

Build docs developers (and LLMs) love