Open source PHP invoice system, FusionInvoice modifications

This is my contribution to FusionInvoice open source invoice system. More to come later on.

[01] Simplified Chinese language pack
I've tried my best to translate as accurate as I could.  Click here to download.

[02] How to migrate Siwapp to FusionInvoice
Step 01:
Prepare four csv with fixed column names on the first row.  I've included the column names in the SQL statements below for your convenience.  For more info, refer here.

Step 02:
Login to phpmyadmin or other DB admin of Siwapp.  Execute these SQLs for data mapping and copy the records to the csv files.
clients.csv
SELECT `name` AS 'client_name', `invoicing_address` AS 'client_address_1', '' AS 'client_address_2',
'Melbourne' AS 'client_city', 'VIC' AS 'client_state', '3000' AS 'client_zip',
'Australia' AS 'client_country', '' AS 'client_phone', '' AS 'client_fax', '' AS 'client_mobile',
`email` AS 'client_email','' AS 'client_web', 1 AS 'client_active'
FROM `customer`

invoices.csv
SELECT 'xxx@yourdomain.com' as 'user_email', `customer_name` as 'client_name',
DATE_FORMAT( `created_at`, "%Y-%l-%d" ) as 'invoice_date_created',
DATE_FORMAT( `due_date`, "%Y-%l-%d" ) as 'invoice_date_due',
`number` as 'invoice_number', `terms` as 'invoice_terms'
FROM `common`
Note: Change user_email to an existing user in FusionInvoice

invoice_items.csv
SELECT c.`number` as 'invoice_number', c.`value` as 'item_tax_rate',
DATE_FORMAT( c.`created_at`, "%Y-%l-%d" ) as 'item_date_added',
p.`reference` as 'item_name', i.`description` as 'item_description',
FORMAT( i.`quantity`, 2 ) as 'item_quantity',
FORMAT( i.unitary_cost, 2 ) as 'item_price'
FROM `common` c, `item` i
LEFT JOIN product p ON i.product_id = p.id
LEFT JOIN (
  SELECT item_tax.item_id, tax.value
  FROM tax, item_tax
  WHERE item_tax.tax_id = tax.id) c ON c.item_id = i.id
WHERE c.id = i.common_id
Note: Change all NULL values to blank in CSV

payments.csv
SELECT c.`number` as 'invoice_number', 'Cash' as 'payment_method', p.`date` as 'payment_date',
p.`amount` as 'payment_amount', p.`notes` as 'payment_note'
FROM `common` c, `payment` p
WHERE c.id = p.invoice_id

Step 03:
Place the 4 CSV files into FusionInvoice <code>uploads/import</code> folder.

Step 04:
Login to FusionInvoice, click Settings and then Import Data.  Click New and finally Import.

2 comments:

  1. Hey man, could you shows Chinese characters in your pdf? Mine only shows lost of codes instead.

    ReplyDelete
    Replies
    1. Sorry mate, there's no pdf in the zip file. Remember to view/convert the files to UTF-8 format in your editing software in order to see Chinese characters

      Delete