Mite -> gSales Importer
It's already possible to import tracked times from Mite to gSales, but after some time we noticed that we needed a better solution. Using the existing method is complicated and we needed additional features which required a new interface.
Essentially, we wanted to create Invoices for Customers who have tracked time-entries in the latest month. Some projects should be in a separate Invoice, some could get summarized. And some time tracking entries would get skipped because there already is an
A working Apache-Server with PHP 7 and MySQL.
You can choose between two installation processes — automatic (recommended) or manual.
The automatic installation uses exec to build the required configuration files to keep the system running — it may not work on Windows Server environments. In that case, you would have to use the manual method.
For both methods, you need to clone
git clone https://github.com/freisicht/mite-gsales-importer.git [TARGET FOLDER]
or download this repository first.
Be sure to make the target folder callable for the browser (e.g.
Automatic Installation (click to view)
Requirements before installing:
- Check the access-rights of the folders
- The database should exist beforehand
Open the cloned project in your browser (
mite-gsales-importer/web/index.php), it will open a form where you can input the details for Mite, gSales and the database.
After submitting, it will automatically create configuration-files filled with your information.
/config/app.json file to repeat the process.
Manual Installation (click to view)
Keep an eye for the access-rights for the directories during this whole process, since PHP tries to generate files.
- Create an empty file
/config/app.jsonto stop the automatic installation process.
- Create an empty file
/log/app.logfor the internal logging mechanism (Kann man nicht einfach das Ding direkt mit in die Repo packen?)
/propel.yaml.dist, rename it to
propel.yamland adjust the database connection information accordingly. Create the database if it does not exist yet.
- Repeat the process for
After these steps, we need to install the Composer dependencies and let them do their work! Open the terminal and navigate to the repository folder and follow these last steps:
Install the composer dependencies
- if you have installed composer, you can run
php composer.phar install
Sometimes the php-executable is not just
php, in that case you should look up your php executable and replace it with
Install database and create model-files with Propel
vendor/bin/propel convert-conf— Converts the
propel.yamlfile into a php file
vendor/bin/propel migration:diff— creates a migration file that will modify the database
vendor/bin/propel migration:migrate— applies the migration file (at that point your database should be good to go)
vendor/bin/propel model:build— builds the model-files for PHP
php composer.phar dump-autoload— builds the autoload-file, same composer rules apply for this command
We recommend using some kind of authentication process (e.g. simple http auth) to prevent unauthorized usage.
Before you import your Mite-Trackings, you will be able to
- connect gSales- and Mite-Customers
- mark Customers or Mite-Projects which will get skipped in the process
- manage which Projects will be in a collective / separate Invoice
After the configuration you can initiate the import process by choosing a date-range. This will bring up an overview of Customers which have tracked entries in that range. You can exclude Customers or projects one last time before clicking "import" and let the importer do its magic.
Congrats - You converted your Mite times into gSales invoices in no-time! Be sure to review the generated Invoices before sending them out, you can never know if there are any (human) errors.