added basic invoice rendering #97 #93 (#99)

This commit is contained in:
Kevin Papst
2018-01-21 22:50:46 +01:00
committed by GitHub
parent 9a161b8fd9
commit 4cbc5391c0
73 changed files with 2986 additions and 918 deletions

View File

@@ -16,18 +16,22 @@ use App\Entity\Activity;
use App\Entity\Customer;
use App\Entity\Project;
use App\Entity\Timesheet;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
/**
* Defines the sample data to load in the database when running the unit and
* functional tests. Execute this command to load the data:
* functional tests or while development.
*
* $ php bin/console doctrine:fixtures:load
* Execute this command to load the data:
* $ php bin/console doctrine:fixtures:load
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class TimesheetFixtures extends AppFixtures
class TimesheetFixtures extends Fixture
{
use FixturesTrait;
const AMOUNT_TIMESHEET = 5000; // timesheet entries total
const RATE_MIN = 10; // minimum rate for one hour
const RATE_MAX = 80; // maximum rate for one hour
@@ -185,11 +189,11 @@ class TimesheetFixtures extends AppFixtures
$entry = new Customer();
$entry
->setCurrency($this->getRandomCurrency())
->setVat(rand(0, 30))
->setName($customerName . ($visible ? '' : '.'))
->setAddress($this->getRandomLocation())
->setComment($this->getRandomPhrase())
->setVisible($visible)
->setNumber('C0815-42-' . $i)
->setCountry('DE') // TODO randomize country ?
->setTimezone($allTimezones[rand(1, $amountTimezone)]);