├── src ├── MapperInterface.php ├── Tax │ ├── TaxCollection.php │ ├── TaxEntity.php │ ├── TaxCode │ │ ├── TaxCodeParser.php │ │ └── TaxCodeEntity.php │ └── TaxAuthority │ │ └── TaxAuthorityEntity.php ├── MapperToSage50Interface.php ├── MapperFromSage50Interface.php ├── RepositoryInterface.php ├── MapperEventsInterface.php ├── Exception │ ├── InvalidMapperException.php │ └── InvalidRepositoryException.php ├── SalesOrder │ ├── Item │ │ ├── ItemRepository.php │ │ └── ItemEntity.php │ ├── SalesOrderRepository.php │ ├── SalesOrderSync.php │ ├── TotalTaxes │ │ └── TotalTaxesEntity.php │ ├── ItemTax │ │ └── ItemTaxEntity.php │ └── SalesOrderBuilder.php ├── SyncInterface.php ├── SyncFromSage50Interface.php ├── Annotation.php ├── JournalEntry │ ├── JournalEntryRepository.php │ └── JournalEntryEntity.php ├── SyncToSage50Interface.php ├── Customer │ ├── CustomerRepository.php │ ├── CustomerSync.php │ └── AdditionalInfo │ │ └── AdditionalInfoEntity.php ├── LocationInventory │ ├── LocationInventoryRepository.php │ └── LocationInventoryEntity.php ├── Sync.php ├── NextPrimaryKey │ ├── NextPrimaryKeyRepository.php │ └── NextPrimaryKeyEntity.php ├── Doctrine │ ├── DoctrineRuntime.php │ ├── GenerateEntitiesCommand.php │ ├── Doctrine.php │ └── GenerateEntityCommand.php ├── Invoice │ ├── InvoiceRepository.php │ ├── InvoiceSync.php │ ├── InvoiceLookup │ │ ├── TotalTaxes │ │ │ └── TotalTaxesEntity.php │ │ ├── ItemTax │ │ │ └── ItemTaxEntity.php │ │ ├── Item │ │ │ └── ItemEntity.php │ │ └── InvoiceLookupEntity.php │ └── Item │ │ └── ItemEntity.php ├── Sage50.php ├── ArrayCollection.php ├── Config.php └── Container.php ├── composer.json └── LICENSE /src/MapperInterface.php: -------------------------------------------------------------------------------- 1 | getFileName(); 14 | AnnotationRegistry::registerLoader('class_exists'); 15 | AnnotationRegistry::registerAutoloadNamespace( 16 | "Doctrine\\ORM\\Mapping", 17 | dirname($filename) 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/JournalEntry/JournalEntryRepository.php: -------------------------------------------------------------------------------- 1 | createQueryBuilder('j') 12 | ->orderBy('id', 'DESC') 13 | ->getQuery() 14 | ->getFirstResult(); 15 | 16 | if ($result instanceof JournalEntryEntity) { 17 | return $result->getId() + 1; 18 | } 19 | return 1; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/SyncToSage50Interface.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d') . ' 00:00:00'; 18 | $time = '1899-12-30 ' . $dateTime->format('H:i:s'); 19 | return $this->createQueryBuilder('c') 20 | ->where('c.modificationDate > :date') 21 | ->orWhere('c.modificationDate = :date AND c.modificationTime > :time') 22 | ->setParameter('date', $date) 23 | ->setParameter('time', $time) 24 | ->getQuery() 25 | ->getResult(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "smart/sage50", 3 | "type": "library", 4 | "description": "PHP Library to interact with Sage50 Canadian Edition", 5 | "keywords": ["Sage 50", "Simply Accounting"], 6 | "homepage": "https://github.com/smart-io/php-sage50", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Gabriel Bull", 11 | "email": "me@gabrielbull.com" 12 | } 13 | ], 14 | "require": { 15 | "php": ">=5.6", 16 | "doctrine/orm": ">=2" 17 | }, 18 | "require-dev": { 19 | "phpunit/phpunit": "^7.0", 20 | "vlucas/phpdotenv": "^2.4", 21 | "symfony/console": "^4.0" 22 | }, 23 | "autoload": { 24 | "psr-4": { 25 | "Smart\\Sage50\\": "src" 26 | } 27 | }, 28 | "autoload-dev": { 29 | "psr-4": { 30 | "Smart\\Sage50\\Tests\\": ["test/tests"] 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/SalesOrder/SalesOrderRepository.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d') . ' 00:00:00'; 18 | $time = '1899-12-30 ' . $dateTime->format('H:i:s'); 19 | return $this->createQueryBuilder('s') 20 | ->where('s.modificationDate > :date') 21 | ->orWhere('s.modificationDate = :date AND s.modificationTime > :time') 22 | ->setParameter('date', $date) 23 | ->setParameter('time', $time) 24 | ->getQuery() 25 | ->getResult(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/LocationInventory/LocationInventoryRepository.php: -------------------------------------------------------------------------------- 1 | findBy([ 18 | 'inventoryId' => $inventoryId, 19 | 'inventoryLocationId' => $inventoryLocationId 20 | ]); 21 | if ($locationInventory instanceof LocationInventoryEntity) { 22 | $locationInventory->setQuantityOnSalesOrder($locationInventory->getQuantityOnSalesOrder() + $quantity); 23 | $this->_em->persist($locationInventory); 24 | return $locationInventory->getQuantityOnSalesOrder() + $quantity; 25 | } 26 | return null; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2016-present, Gabriel Bull 2 | Permission is hereby granted, free of charge, to any person obtaining 3 | a copy of this software and associated documentation files (the "Software"), 4 | to deal in the Software without restriction, including without limitation 5 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 6 | and/or sell copies of the Software, and to permit persons to whom the Software 7 | is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included 10 | in all copies or substantial portions of the Software. 11 | 12 | The Software is provided "as is", without warranty of any kind, express or 13 | implied, including but not limited to the warranties of merchantability, 14 | fitness for a particular purpose and noninfringement. In no event shall the 15 | authors or copyright holders X be liable for any claim, damages or other liability, 16 | whether in an action of contract, tort or otherwise, arising from, out of or in 17 | connection with the software or the use or other dealings in the Software. 18 | 19 | Except as contained in this notice, the name of the copyright holders shall 20 | not be used in advertising or otherwise to promote the sale, use or other dealings 21 | in this Software without prior written authorization from the copyright holders. 22 | -------------------------------------------------------------------------------- /src/Sync.php: -------------------------------------------------------------------------------- 1 | entityManager = $entityManager; 30 | } 31 | 32 | /** 33 | * @param MapperInterface $mapper 34 | */ 35 | public function setMapper(MapperInterface $mapper) 36 | { 37 | $this->mapper = $mapper; 38 | } 39 | 40 | /** 41 | * @return MapperInterface $mapper 42 | */ 43 | public function getMapper() 44 | { 45 | return $this->mapper; 46 | } 47 | 48 | /** 49 | * @param RepositoryInterface $repository 50 | */ 51 | public function setRepository(RepositoryInterface $repository) 52 | { 53 | $this->repository = $repository; 54 | } 55 | 56 | /** 57 | * @return RepositoryInterface $repository 58 | */ 59 | public function getRepository() 60 | { 61 | return $this->repository; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/NextPrimaryKey/NextPrimaryKeyRepository.php: -------------------------------------------------------------------------------- 1 | find($id); 16 | if ($nextPrimaryKey instanceof NextPrimaryKeyEntity) { 17 | $nextPrimaryKey->setNextId($nextPrimaryKey->getNextId() + 1); 18 | $this->_em->persist($nextPrimaryKey); 19 | return $nextPrimaryKey->getNextId() + 1; 20 | } 21 | return null; 22 | } 23 | 24 | /** 25 | * @return int|null 26 | */ 27 | public function increaseNextSalesOrderId() 28 | { 29 | return $this->increaseNextId(NextPrimaryKeyEntity::SALE_ORDER_ID); 30 | } 31 | 32 | /** 33 | * @param int $id 34 | * @return int 35 | */ 36 | public function fetchNextId($id) 37 | { 38 | $result = $this->find($id); 39 | if ($result instanceof NextPrimaryKeyEntity) { 40 | return $result->getNextId(); 41 | } 42 | return 1; 43 | } 44 | 45 | /** 46 | * @return int 47 | */ 48 | public function fetchNextSalesOrderId() 49 | { 50 | return $this->fetchNextId(NextPrimaryKeyEntity::SALE_ORDER_ID); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Doctrine/DoctrineRuntime.php: -------------------------------------------------------------------------------- 1 | doctrine = new Doctrine(); 19 | $this->doctrine->setConfig($config); 20 | } 21 | 22 | public function run() 23 | { 24 | $entityManager = null; 25 | if (is_array($_SERVER['argv'])) { 26 | foreach ($_SERVER['argv'] as $key => $value) { 27 | if (substr($value, 0, 5) === '--em=') { 28 | $entityManager = substr($value, 5); 29 | unset($_SERVER['argv'][$key]); 30 | if (is_int($_SERVER['argc'])) { 31 | $_SERVER['argc']--; 32 | } 33 | break; 34 | } 35 | } 36 | } 37 | 38 | $commands = $this->doctrine->getCommands(); 39 | $helperSet = $this->doctrine->getHelperSet($entityManager); 40 | 41 | if (!($helperSet instanceof HelperSet)) { 42 | foreach ($GLOBALS as $helperSetCandidate) { 43 | if ($helperSetCandidate instanceof HelperSet) { 44 | $helperSet = $helperSetCandidate; 45 | break; 46 | } 47 | } 48 | } 49 | 50 | ConsoleRunner::run($helperSet, $commands); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Doctrine/GenerateEntitiesCommand.php: -------------------------------------------------------------------------------- 1 | doctrine = $doctrine; 24 | parent::__construct(); 25 | } 26 | 27 | protected function configure() 28 | { 29 | $this->setName('generate-entities')->setDescription('Generate entities from a database'); 30 | } 31 | 32 | /** 33 | * @param InputInterface $input 34 | * @param OutputInterface $output 35 | * @return void 36 | * @throws \Exception 37 | */ 38 | protected function execute(InputInterface $input, OutputInterface $output) 39 | { 40 | /** @var \Doctrine\DBAL\Driver\PDOConnection $conn */ 41 | $conn = $this->doctrine->getEntityManager()->getConnection()->getWrappedConnection(); 42 | $query = "SHOW TABLES"; 43 | foreach ($conn->query($query) as $row) { 44 | $command = new GenerateEntityCommand($this->doctrine); 45 | $command->setTable($row[0]); 46 | $command->run(new ArrayInput([]), new ConsoleOutput()); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Invoice/InvoiceRepository.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d') . ' 00:00:00'; 18 | $time = '1899-12-30 ' . $dateTime->format('H:i:s'); 19 | return $this->createQueryBuilder('i') 20 | ->where('i.journalType = :type') 21 | ->andWhere('i.modificationDate > :date OR i.modificationDate = :date AND i.modificationTime > :time') 22 | ->setParameter('date', $date) 23 | ->setParameter('time', $time) 24 | ->setParameter('type', InvoiceEntity::JOURNAL_TYPE_SALES_ORDERS_AND_QUOTES) 25 | ->getQuery() 26 | ->getResult(); 27 | } 28 | 29 | /** 30 | * @param DateTime $dateTime 31 | * @param int $offset 32 | * @param int $limit 33 | * @return InvoiceEntity[] 34 | */ 35 | public function fetchSince(DateTime $dateTime, $offset, $limit) 36 | { 37 | $date = $dateTime->format('Y-m-d') . ' 00:00:00'; 38 | $time = '1899-12-30 ' . $dateTime->format('H:i:s'); 39 | return $this->createQueryBuilder('i') 40 | ->where('i.journalType = :type') 41 | ->andWhere('i.modificationDate > :date OR i.modificationDate = :date AND i.modificationTime > :time') 42 | ->setMaxResults($limit) 43 | ->setFirstResult($offset) 44 | ->setParameter('date', $date) 45 | ->setParameter('time', $time) 46 | ->setParameter('type', InvoiceEntity::JOURNAL_TYPE_SALES_ORDERS_AND_QUOTES) 47 | ->getQuery() 48 | ->getResult(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Sage50.php: -------------------------------------------------------------------------------- 1 | config = new Config($config); 27 | } elseif ($config instanceof Config) { 28 | $this->config = $config; 29 | } else { 30 | throw new \InvalidArgumentException; 31 | } 32 | (new Annotation())->setup(); 33 | } 34 | 35 | /** 36 | * @return EntityManagerInterface 37 | */ 38 | public function getEntityManager() 39 | { 40 | if (null === $this->entityManager) { 41 | $doctrine = new Doctrine(); 42 | $doctrine->setConfig($this->config); 43 | $this->entityManager = $doctrine->getEntityManager(); 44 | } 45 | return $this->entityManager; 46 | } 47 | 48 | /** 49 | * @param EntityManagerInterface $entityManager 50 | * @return $this 51 | */ 52 | public function setEntityManager(EntityManagerInterface $entityManager) 53 | { 54 | $this->entityManager = $entityManager; 55 | return $this; 56 | } 57 | 58 | /** 59 | * @return Config 60 | */ 61 | public function getConfig() 62 | { 63 | return $this->config; 64 | } 65 | 66 | /** 67 | * @param Config $config 68 | * @return $this 69 | */ 70 | public function setConfig(Config $config) 71 | { 72 | $this->config = $config; 73 | return $this; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/SalesOrder/SalesOrderSync.php: -------------------------------------------------------------------------------- 1 | getMapper(); 17 | if (null === $mapper || !($mapper instanceof MapperFromSage50Interface)) { 18 | throw new InvalidMapperException(); 19 | } 20 | /** @var SalesOrderRepository $repository */ 21 | $repository = $this->entityManager->getRepository('Smart\\Sage50\\SalesOrder\\SalesOrderEntity'); 22 | $items = $repository->fetchAllSince($dateTime); 23 | foreach ($items as $item) { 24 | $mappedItem = $mapper->mapFromSage50($item); 25 | if ($mapper instanceof MapperEventsInterface) { 26 | $mapper->onItemComplete($mappedItem); 27 | } 28 | } 29 | if ($this->mapper instanceof MapperEventsInterface) { 30 | $this->mapper->onComplete(); 31 | } 32 | } 33 | 34 | public function syncToSage50(DateTime $dateTime) 35 | { 36 | $mapper = $this->getMapper(); 37 | if (null === $mapper || !($mapper instanceof MapperToSage50Interface)) { 38 | throw new InvalidMapperException(); 39 | } 40 | 41 | $repository = $this->getRepository(); 42 | if (!$repository || !($repository instanceof RepositoryInterface)) { 43 | throw new InvalidRepositoryException(); 44 | } 45 | $items = $repository->fetchAllSince($dateTime); 46 | foreach ($items as $item) { 47 | $mappedItem = $mapper->mapToSage50($item); 48 | if ($mapper instanceof MapperEventsInterface) { 49 | $mapper->onItemComplete($mappedItem); 50 | } 51 | } 52 | if ($mapper instanceof MapperEventsInterface) { 53 | $mapper->onComplete(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Customer/CustomerSync.php: -------------------------------------------------------------------------------- 1 | getMapper(); 21 | if (null === $mapper || !($mapper instanceof MapperFromSage50Interface)) { 22 | throw new InvalidMapperException(); 23 | } 24 | /** @var CustomerRepository $repository */ 25 | $repository = $this->entityManager->getRepository('Smart\\Sage50\\Customer\\CustomerEntity'); 26 | $items = $repository->fetchAllSince($dateTime); 27 | foreach ($items as $item) { 28 | $mappedItem = $mapper->mapFromSage50($item); 29 | if ($mapper instanceof MapperEventsInterface) { 30 | $mapper->onItemComplete($mappedItem); 31 | } 32 | } 33 | if ($mapper instanceof MapperEventsInterface) { 34 | $mapper->onComplete(); 35 | } 36 | } 37 | 38 | public function syncToSage50(DateTime $dateTime) 39 | { 40 | $mapper = $this->getMapper(); 41 | if (null === $mapper || !($mapper instanceof MapperToSage50Interface)) { 42 | throw new InvalidMapperException(); 43 | } 44 | 45 | $repository = $this->getRepository(); 46 | if (!$repository || !($repository instanceof RepositoryInterface)) { 47 | throw new InvalidRepositoryException(); 48 | } 49 | $items = $repository->fetchAllSince($dateTime); 50 | foreach ($items as $item) { 51 | $mappedItem = $mapper->mapToSage50($item); 52 | if ($mapper instanceof MapperEventsInterface) { 53 | $mapper->onItemComplete($mappedItem); 54 | } 55 | } 56 | if ($mapper instanceof MapperEventsInterface) { 57 | $mapper->onComplete(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Invoice/InvoiceSync.php: -------------------------------------------------------------------------------- 1 | getMapper(); 17 | if (null === $mapper || !($mapper instanceof MapperFromSage50Interface)) { 18 | throw new InvalidMapperException(); 19 | } 20 | /** @var InvoiceRepository $repository */ 21 | $repository = $this->entityManager->getRepository('Smart\\Sage50\\Invoice\\InvoiceEntity'); 22 | $offset = 0; 23 | 24 | while (true) { 25 | $items = $repository->fetchSince($dateTime, $offset, $limit !== null && $limit < 100 ? $limit : 100); 26 | if (!count($items)) { 27 | break; 28 | } 29 | foreach ($items as $item) { 30 | $mappedItem = $mapper->mapFromSage50($item); 31 | if ($mapper instanceof MapperEventsInterface) { 32 | $mapper->onItemComplete($mappedItem); 33 | } 34 | } 35 | $offset += 100; 36 | if ($limit !== null && $offset >= $limit) { 37 | break; 38 | } 39 | } 40 | if ($this->mapper instanceof MapperEventsInterface) { 41 | $this->mapper->onComplete(); 42 | } 43 | } 44 | 45 | public function syncToSage50(DateTime $dateTime) 46 | { 47 | $mapper = $this->getMapper(); 48 | if (null === $mapper || !($mapper instanceof MapperToSage50Interface)) { 49 | throw new InvalidMapperException(); 50 | } 51 | 52 | $repository = $this->getRepository(); 53 | if (!$repository || !($repository instanceof RepositoryInterface)) { 54 | throw new InvalidRepositoryException(); 55 | } 56 | $items = $repository->fetchAllSince($dateTime); 57 | foreach ($items as $item) { 58 | $mappedItem = $mapper->mapToSage50($item); 59 | if ($mapper instanceof MapperEventsInterface) { 60 | $mapper->onItemComplete($mappedItem); 61 | } 62 | } 63 | if ($mapper instanceof MapperEventsInterface) { 64 | $mapper->onComplete(); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Tax/TaxEntity.php: -------------------------------------------------------------------------------- 1 | taxCode; 41 | } 42 | 43 | /** 44 | * @param TaxCodeEntity $taxCode 45 | * @return $this 46 | */ 47 | public function setTaxCode(TaxCodeEntity $taxCode) 48 | { 49 | $this->taxCode = $taxCode; 50 | return $this; 51 | } 52 | 53 | /** 54 | * @return TaxAuthorityEntity 55 | */ 56 | public function getTaxAuthority() 57 | { 58 | return $this->taxAuthority; 59 | } 60 | 61 | /** 62 | * @param TaxAuthorityEntity $taxAuthority 63 | * @return $this 64 | */ 65 | public function setTaxAuthority(TaxAuthorityEntity $taxAuthority) 66 | { 67 | $this->taxAuthority = $taxAuthority; 68 | return $this; 69 | } 70 | 71 | /** 72 | * @return string 73 | */ 74 | public function getName() 75 | { 76 | return $this->name; 77 | } 78 | 79 | /** 80 | * @param string $name 81 | * @return $this 82 | */ 83 | public function setName($name) 84 | { 85 | $this->name = $name; 86 | return $this; 87 | } 88 | 89 | /** 90 | * @return string 91 | */ 92 | public function getRate() 93 | { 94 | return $this->rate; 95 | } 96 | 97 | /** 98 | * @param string $rate 99 | * @return $this 100 | */ 101 | public function setRate($rate) 102 | { 103 | $this->rate = $rate; 104 | return $this; 105 | } 106 | 107 | /** 108 | * @return boolean 109 | */ 110 | public function isCompound() 111 | { 112 | return $this->isCompound; 113 | } 114 | 115 | /** 116 | * @param boolean $isCompound 117 | * @return $this 118 | */ 119 | public function setIsCompound($isCompound) 120 | { 121 | $this->isCompound = $isCompound; 122 | return $this; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/Tax/TaxCode/TaxCodeParser.php: -------------------------------------------------------------------------------- 1 | getDescriptionEnglish(); 20 | 21 | $remainingDescription = null; 22 | if (substr(strrev($description), 0, 1) !== '%') { 23 | $remainingDescription = explode('%', strrev($description), 2); 24 | $remainingDescription = strrev($remainingDescription[0]); 25 | } 26 | 27 | preg_match_all("/([^%]*%)/", $description, $matches); 28 | if (is_array($matches[0])) { 29 | foreach ($matches[0] as $key => $part) { 30 | $taxArray = $this->parseTaxCodePart( 31 | $part, 32 | (isset($matches[0][$key + 1]) ? $matches[0][$key + 1] : $remainingDescription) 33 | ); 34 | if ($taxArray) { 35 | $tax = new TaxEntity(); 36 | $tax->setTaxCode($taxCode); 37 | $tax->setName($taxArray['name']); 38 | $tax->setRate($taxArray['rate']); 39 | $tax->setIsCompound($taxArray['isCompound']); 40 | $taxes->add($tax); 41 | } 42 | } 43 | } 44 | 45 | return $taxes; 46 | } 47 | 48 | /** 49 | * @param string $taxCodePart 50 | * @param null|string $nextTaxCodePart 51 | * @return array|null 52 | */ 53 | private function parseTaxCodePart($taxCodePart, $nextTaxCodePart = null) 54 | { 55 | $isCompound = $this->checkIfPreviousPartIsCompound($nextTaxCodePart); 56 | 57 | preg_match("/([\\w]*)[ @]* ([\\d\\.]*)%/", $taxCodePart, $parts); 58 | if (isset($parts[1]) && isset($parts[2])) { 59 | $name = trim($parts[1]); 60 | $rate = bcdiv(trim($parts[2]), 100, 5); 61 | 62 | return [ 63 | 'name' => $name, 64 | 'rate' => $rate, 65 | 'isCompound' => $isCompound 66 | ]; 67 | } 68 | 69 | return null; 70 | } 71 | 72 | /** 73 | * @param string $nextTaxCodePart 74 | * @return boolean 75 | */ 76 | private function checkIfPreviousPartIsCompound($nextTaxCodePart) 77 | { 78 | if (strpos($nextTaxCodePart, '%') !== false) { 79 | return (boolean)preg_match("/.*" . self::COMPOUND_STRING . ".*%.*/", $nextTaxCodePart); 80 | } 81 | return stripos($nextTaxCodePart, self::COMPOUND_STRING) !== false; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/ArrayCollection.php: -------------------------------------------------------------------------------- 1 | elements = $elements; 24 | } 25 | 26 | /** 27 | * @return array 28 | */ 29 | public function toArray() 30 | { 31 | return $this->elements; 32 | } 33 | 34 | /** 35 | * @return array 36 | */ 37 | public function jsonSerialize() 38 | { 39 | return $this->elements; 40 | } 41 | 42 | /** 43 | * @param string $offset 44 | * @return bool 45 | */ 46 | public function offsetExists($offset) 47 | { 48 | return isset($this->elements[$offset]) || array_key_exists($offset, $this->elements); 49 | } 50 | 51 | /** 52 | * @param string $offset 53 | * @return mixed 54 | */ 55 | public function offsetGet($offset) 56 | { 57 | return $this->get($offset); 58 | } 59 | 60 | /** 61 | * @param string $offset 62 | * @param mixed $value 63 | */ 64 | public function offsetSet($offset, $value) 65 | { 66 | $this->set($offset, $value); 67 | } 68 | 69 | /** 70 | * @param string $offset 71 | * @return null 72 | */ 73 | public function offsetUnset($offset) 74 | { 75 | return $this->remove($offset); 76 | } 77 | 78 | /** 79 | * @return int 80 | */ 81 | public function count() 82 | { 83 | return count($this->elements); 84 | } 85 | 86 | /** 87 | * @return ArrayIterator 88 | */ 89 | public function getIterator() 90 | { 91 | return new ArrayIterator($this->elements); 92 | } 93 | 94 | /** 95 | * @param string $key 96 | * @return null|mixed 97 | */ 98 | public function get($key) 99 | { 100 | if (isset($this->elements[$key])) { 101 | return $this->elements[$key]; 102 | } 103 | return null; 104 | } 105 | 106 | /** 107 | * @param string $key 108 | * @param mixed $value 109 | */ 110 | public function set($key, $value) 111 | { 112 | $this->elements[$key] = $value; 113 | } 114 | 115 | /** 116 | * @param mixed $value 117 | * @return bool 118 | */ 119 | public function add($value) 120 | { 121 | $this->elements[] = $value; 122 | return true; 123 | } 124 | 125 | /** 126 | * @param string $key 127 | * @return null|mixed 128 | */ 129 | public function remove($key) 130 | { 131 | if (isset($this->elements[$key]) || array_key_exists($key, $this->elements)) { 132 | $removed = $this->elements[$key]; 133 | unset($this->elements[$key]); 134 | 135 | return $removed; 136 | } 137 | return null; 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/SalesOrder/TotalTaxes/TotalTaxesEntity.php: -------------------------------------------------------------------------------- 1 | salesOrderId; 55 | } 56 | 57 | /** 58 | * @param int $salesOrderId 59 | * @return $this 60 | */ 61 | public function setSalesOrderId($salesOrderId) 62 | { 63 | $this->salesOrderId = $salesOrderId; 64 | return $this; 65 | } 66 | 67 | /** 68 | * @return SalesOrderEntity 69 | */ 70 | public function getSalesOrder() 71 | { 72 | return $this->salesOrder; 73 | } 74 | 75 | /** 76 | * @param SalesOrderEntity $salesOrder 77 | * @return $this 78 | */ 79 | public function setSalesOrder(SalesOrderEntity $salesOrder) 80 | { 81 | $this->salesOrder = $salesOrder; 82 | return $this; 83 | } 84 | 85 | /** 86 | * @return int 87 | */ 88 | public function getTaxId() 89 | { 90 | return $this->taxId; 91 | } 92 | 93 | /** 94 | * @param int $taxId 95 | * @return $this 96 | */ 97 | public function setTaxId($taxId) 98 | { 99 | $this->taxId = $taxId; 100 | return $this; 101 | } 102 | 103 | /** 104 | * @return float 105 | */ 106 | public function getTaxAmount() 107 | { 108 | return $this->taxAmount; 109 | } 110 | 111 | /** 112 | * @param float $taxAmount 113 | * @return $this 114 | */ 115 | public function setTaxAmount($taxAmount) 116 | { 117 | $this->taxAmount = $taxAmount; 118 | return $this; 119 | } 120 | 121 | /** 122 | * @return float 123 | */ 124 | public function getNonRefundableTaxAmount() 125 | { 126 | return $this->nonRefundableTaxAmount; 127 | } 128 | 129 | /** 130 | * @param float $nonRefundableTaxAmount 131 | * @return $this 132 | */ 133 | public function setNonRefundableTaxAmount($nonRefundableTaxAmount) 134 | { 135 | $this->nonRefundableTaxAmount = $nonRefundableTaxAmount; 136 | return $this; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /src/Invoice/InvoiceLookup/TotalTaxes/TotalTaxesEntity.php: -------------------------------------------------------------------------------- 1 | invoiceId; 63 | } 64 | 65 | /** 66 | * @param int $invoiceId 67 | * @return $this 68 | */ 69 | public function setInvoiceId($invoiceId) 70 | { 71 | $this->invoiceId = $invoiceId; 72 | return $this; 73 | } 74 | 75 | /** 76 | * @return InvoiceEntity 77 | */ 78 | public function getInvoice() 79 | { 80 | return $this->invoice; 81 | } 82 | 83 | /** 84 | * @param InvoiceEntity $invoice 85 | */ 86 | public function setInvoice( $invoice ) 87 | { 88 | $this->invoice = $invoice; 89 | } 90 | 91 | /** 92 | * @return InvoiceLookupEntity 93 | */ 94 | public function getInvoiceLookup() 95 | { 96 | return $this->invoiceLookup; 97 | } 98 | 99 | /** 100 | * @param InvoiceLookupEntity $invoiceLookup 101 | */ 102 | public function setInvoiceLookup( $invoiceLookup ) 103 | { 104 | $this->invoiceLookup = $invoiceLookup; 105 | } 106 | 107 | /** 108 | * @return int 109 | */ 110 | public function getTaxId() 111 | { 112 | return $this->taxId; 113 | } 114 | 115 | /** 116 | * @param int $taxId 117 | * @return $this 118 | */ 119 | public function setTaxId($taxId) 120 | { 121 | $this->taxId = $taxId; 122 | return $this; 123 | } 124 | 125 | /** 126 | * @return float 127 | */ 128 | public function getTaxAmount() 129 | { 130 | return $this->taxAmount; 131 | } 132 | 133 | /** 134 | * @param float $taxAmount 135 | * @return $this 136 | */ 137 | public function setTaxAmount($taxAmount) 138 | { 139 | $this->taxAmount = $taxAmount; 140 | 141 | return $this; 142 | } 143 | 144 | /** 145 | * @return float 146 | */ 147 | public function getNonRefundableTaxAmount() 148 | { 149 | return $this->nonRefundableTaxAmount; 150 | } 151 | 152 | /** 153 | * @param float $nonRefundableTaxAmount 154 | * @return $this 155 | */ 156 | public function setNonRefundableTaxAmount($nonRefundableTaxAmount) 157 | { 158 | $this->nonRefundableTaxAmount = $nonRefundableTaxAmount; 159 | return $this; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /src/Config.php: -------------------------------------------------------------------------------- 1 | set($parameters); 44 | } 45 | } 46 | 47 | /** 48 | * @param array $parameters 49 | */ 50 | public function set(array $parameters) 51 | { 52 | foreach ($parameters as $key => $value) { 53 | switch ($key) { 54 | case 'host': 55 | $this->setHost($value); 56 | break; 57 | case 'port': 58 | $this->setPort($value); 59 | break; 60 | case 'dbname': 61 | $this->setDbname($value); 62 | break; 63 | case 'user': 64 | $this->setUser($value); 65 | break; 66 | case 'password': 67 | $this->setPassword($value); 68 | break; 69 | } 70 | } 71 | } 72 | 73 | /** 74 | * @return string 75 | */ 76 | public function getHost() 77 | { 78 | return $this->host; 79 | } 80 | 81 | /** 82 | * @param string $host 83 | * @return $this 84 | */ 85 | public function setHost($host) 86 | { 87 | $this->host = $host; 88 | return $this; 89 | } 90 | 91 | /** 92 | * @return string 93 | */ 94 | public function getPort() 95 | { 96 | return $this->port; 97 | } 98 | 99 | /** 100 | * @param string $port 101 | * @return $this 102 | */ 103 | public function setPort($port) 104 | { 105 | $this->port = $port; 106 | return $this; 107 | } 108 | 109 | /** 110 | * @return string 111 | */ 112 | public function getDbname() 113 | { 114 | return $this->dbname; 115 | } 116 | 117 | /** 118 | * @param string $dbname 119 | * @return $this 120 | */ 121 | public function setDbname($dbname) 122 | { 123 | $this->dbname = $dbname; 124 | return $this; 125 | } 126 | 127 | /** 128 | * @return string 129 | */ 130 | public function getUser() 131 | { 132 | return $this->user; 133 | } 134 | 135 | /** 136 | * @param string $user 137 | * @return $this 138 | */ 139 | public function setUser($user) 140 | { 141 | $this->user = $user; 142 | return $this; 143 | } 144 | 145 | /** 146 | * @return string 147 | */ 148 | public function getPassword() 149 | { 150 | return $this->password; 151 | } 152 | 153 | /** 154 | * @param string $password 155 | * @return $this 156 | */ 157 | public function setPassword($password) 158 | { 159 | $this->password = $password; 160 | return $this; 161 | } 162 | 163 | /** 164 | * @return bool 165 | */ 166 | public function isDev() 167 | { 168 | return $this->isDev; 169 | } 170 | 171 | /** 172 | * @param bool $isDev 173 | * @return $this 174 | */ 175 | public function setIsDev($isDev) 176 | { 177 | $this->isDev = $isDev; 178 | return $this; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/Invoice/InvoiceLookup/ItemTax/ItemTaxEntity.php: -------------------------------------------------------------------------------- 1 | invoiceId; 71 | } 72 | 73 | /** 74 | * @param int $invoiceId 75 | * @return $this 76 | */ 77 | public function setInvoiceId($invoiceId) 78 | { 79 | $this->invoiceId = $invoiceId; 80 | return $this; 81 | } 82 | 83 | /** 84 | * @return int 85 | */ 86 | public function getItemId() 87 | { 88 | return $this->itemId; 89 | } 90 | 91 | /** 92 | * @param int $itemId 93 | * @return $this 94 | */ 95 | public function setItemId($itemId) 96 | { 97 | $this->itemId = $itemId; 98 | return $this; 99 | } 100 | 101 | /** 102 | * @return ItemEntity 103 | */ 104 | public function getItem() 105 | { 106 | return $this->item; 107 | } 108 | 109 | /** 110 | * @param ItemEntity $item 111 | * @return $this 112 | */ 113 | public function setItem(ItemEntity $item) 114 | { 115 | $this->item = $item; 116 | return $this; 117 | } 118 | 119 | /** 120 | * @return int 121 | */ 122 | public function getTaxId() 123 | { 124 | return $this->taxId; 125 | } 126 | 127 | /** 128 | * @param int $taxId 129 | * @return $this 130 | */ 131 | public function setTaxId($taxId) 132 | { 133 | $this->taxId = $taxId; 134 | return $this; 135 | } 136 | 137 | /** 138 | * @return boolean 139 | */ 140 | public function isTaxExempt() 141 | { 142 | return $this->isTaxExempt; 143 | } 144 | 145 | /** 146 | * @param boolean $isTaxExempt 147 | * @return $this 148 | */ 149 | public function setIsTaxExempt($isTaxExempt) 150 | { 151 | $this->isTaxExempt = $isTaxExempt; 152 | return $this; 153 | } 154 | 155 | /** 156 | * @return float 157 | */ 158 | public function getTaxAmount() 159 | { 160 | return $this->taxAmount; 161 | } 162 | 163 | /** 164 | * @param float $taxAmount 165 | * @return $this 166 | */ 167 | public function setTaxAmount($taxAmount) 168 | { 169 | $this->taxAmount = $taxAmount; 170 | return $this; 171 | } 172 | 173 | /** 174 | * @return int 175 | */ 176 | public function getDepartmentId() 177 | { 178 | return $this->departmentId; 179 | } 180 | 181 | /** 182 | * @param int $departmentId 183 | * @return $this 184 | */ 185 | public function setDepartmentId($departmentId) 186 | { 187 | $this->departmentId = $departmentId; 188 | return $this; 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /src/NextPrimaryKey/NextPrimaryKeyEntity.php: -------------------------------------------------------------------------------- 1 | setModificationDate(new DateTime(date('Y-m-d 00:00:00'))); 57 | $this->setModificationTime(new DateTime(date('1899-12-30 H:i:s'))); 58 | } 59 | 60 | /** 61 | * @return int 62 | */ 63 | public function getId() 64 | { 65 | return $this->id; 66 | } 67 | 68 | /** 69 | * @param int $id 70 | * @return $this 71 | */ 72 | public function setId($id) 73 | { 74 | $this->id = $id; 75 | return $this; 76 | } 77 | 78 | /** 79 | * @return DateTime 80 | */ 81 | public function getModificationDate() 82 | { 83 | return $this->modificationDate; 84 | } 85 | 86 | /** 87 | * @param DateTime $modificationDate 88 | * @return $this 89 | */ 90 | public function setModificationDate(DateTime $modificationDate) 91 | { 92 | $this->modificationDate = $modificationDate; 93 | return $this; 94 | } 95 | 96 | /** 97 | * @return DateTime 98 | */ 99 | public function getModificationTime() 100 | { 101 | return $this->modificationTime; 102 | } 103 | 104 | /** 105 | * @param DateTime $modificationTime 106 | * @return $this 107 | */ 108 | public function setModificationTime(DateTime $modificationTime) 109 | { 110 | $this->modificationTime = $modificationTime; 111 | return $this; 112 | } 113 | 114 | /** 115 | * @return DateTime 116 | */ 117 | public function getModificationDatetime() 118 | { 119 | return new DateTime($this->modificationDate->format('Y-m-d') . ' ' . $this->modificationTime->format('H:i:s')); 120 | } 121 | 122 | /** 123 | * @return string 124 | */ 125 | public function getCreatedByUsername() 126 | { 127 | return $this->createdByUsername; 128 | } 129 | 130 | /** 131 | * @param string $createdByUsername 132 | * @return $this 133 | */ 134 | public function setCreatedByUsername($createdByUsername) 135 | { 136 | $this->createdByUsername = $createdByUsername; 137 | return $this; 138 | } 139 | 140 | /** 141 | * @return string 142 | */ 143 | public function getCreatedByOrg() 144 | { 145 | return $this->createdByOrg; 146 | } 147 | 148 | /** 149 | * @param string $createdByOrg 150 | * @return $this 151 | */ 152 | public function setCreatedByOrg($createdByOrg) 153 | { 154 | $this->createdByOrg = $createdByOrg; 155 | return $this; 156 | } 157 | 158 | /** 159 | * @return int 160 | */ 161 | public function getNextId() 162 | { 163 | return $this->nextId; 164 | } 165 | 166 | /** 167 | * @param int $nextId 168 | * @return $this 169 | */ 170 | public function setNextId($nextId) 171 | { 172 | $this->nextId = $nextId; 173 | return $this; 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /src/SalesOrder/ItemTax/ItemTaxEntity.php: -------------------------------------------------------------------------------- 1 | salesOrderId; 71 | } 72 | 73 | /** 74 | * @param int $salesOrderId 75 | * @return $this 76 | */ 77 | public function setSalesOrderId($salesOrderId) 78 | { 79 | $this->salesOrderId = $salesOrderId; 80 | return $this; 81 | } 82 | 83 | /** 84 | * @return int 85 | */ 86 | public function getItemId() 87 | { 88 | return $this->itemId; 89 | } 90 | 91 | /** 92 | * @param int $itemId 93 | * @return $this 94 | */ 95 | public function setItemId($itemId) 96 | { 97 | $this->itemId = $itemId; 98 | return $this; 99 | } 100 | 101 | /** 102 | * @return ItemEntity 103 | */ 104 | public function getItem() 105 | { 106 | return $this->item; 107 | } 108 | 109 | /** 110 | * @param ItemEntity $item 111 | * @return $this 112 | */ 113 | public function setItem($item) 114 | { 115 | $this->item = $item; 116 | return $this; 117 | } 118 | 119 | /** 120 | * @return int 121 | */ 122 | public function getTaxId() 123 | { 124 | return $this->taxId; 125 | } 126 | 127 | /** 128 | * @param int $taxId 129 | * @return $this 130 | */ 131 | public function setTaxId($taxId) 132 | { 133 | $this->taxId = $taxId; 134 | return $this; 135 | } 136 | 137 | /** 138 | * @return boolean 139 | */ 140 | public function isTaxExempt() 141 | { 142 | return $this->isTaxExempt; 143 | } 144 | 145 | /** 146 | * @param boolean $isTaxExempt 147 | * @return $this 148 | */ 149 | public function setIsTaxExempt($isTaxExempt) 150 | { 151 | $this->isTaxExempt = $isTaxExempt; 152 | return $this; 153 | } 154 | 155 | /** 156 | * @return boolean 157 | */ 158 | public function isUsingTaxAmount() 159 | { 160 | return $this->isUsingTaxAmount; 161 | } 162 | 163 | /** 164 | * @param boolean $isUsingTaxAmount 165 | * @return $this 166 | */ 167 | public function setIsUsingTaxAmount($isUsingTaxAmount) 168 | { 169 | $this->isUsingTaxAmount = $isUsingTaxAmount; 170 | return $this; 171 | } 172 | 173 | /** 174 | * @return float 175 | */ 176 | public function getTaxAmount() 177 | { 178 | return $this->taxAmount; 179 | } 180 | 181 | /** 182 | * @param float $taxAmount 183 | * @return $this 184 | */ 185 | public function setTaxAmount($taxAmount) 186 | { 187 | $this->taxAmount = $taxAmount; 188 | return $this; 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /src/Doctrine/Doctrine.php: -------------------------------------------------------------------------------- 1 | config; 50 | } 51 | 52 | /** 53 | * @param Config $config 54 | * @return $this 55 | */ 56 | public function setConfig(Config $config) 57 | { 58 | $this->config = $config; 59 | return $this; 60 | } 61 | 62 | /** 63 | * {@inheritdoc} 64 | */ 65 | protected function getService($name) 66 | { 67 | return $this->getEntityManager($name); 68 | } 69 | 70 | /** 71 | * {@inheritdoc} 72 | */ 73 | protected function resetService($name) 74 | { 75 | return null; 76 | } 77 | 78 | /** 79 | * {@inheritdoc} 80 | */ 81 | public function getAliasNamespace($alias) 82 | { 83 | /** @var EntityManager $entityManager */ 84 | foreach ([$this->entityManager] as $entityManager) { 85 | try { 86 | return $entityManager->getConfiguration()->getEntityNamespace($alias); 87 | } catch (ORMException $e) { 88 | } 89 | } 90 | 91 | throw ORMException::unknownEntityNamespace($alias); 92 | } 93 | 94 | private function addDefaultCommands() 95 | { 96 | $this->commands = [ 97 | new GenerateEntitiesCommand($this), 98 | new GenerateEntityCommand($this), 99 | ]; 100 | } 101 | 102 | /** 103 | * @param DoctrineCommand $command 104 | * @return $this 105 | */ 106 | public function addCommand(DoctrineCommand $command) 107 | { 108 | if (null === $this->commands) { 109 | $this->addDefaultCommands(); 110 | } 111 | $this->commands[] = $command; 112 | return $this; 113 | } 114 | 115 | /** 116 | * @return array 117 | */ 118 | public function getCommands() 119 | { 120 | if (null === $this->commands) { 121 | $this->addDefaultCommands(); 122 | } 123 | return $this->commands; 124 | } 125 | 126 | /** 127 | * @return HelperSet 128 | */ 129 | public function getHelperSet() 130 | { 131 | if (null === $this->helperSet) { 132 | $this->helperSet = ConsoleRunner::createHelperSet($this->getEntityManager()); 133 | } 134 | return $this->helperSet; 135 | } 136 | 137 | /** 138 | * @param EntityManager $entityManager 139 | * @return $this 140 | */ 141 | public function setEntityManager(EntityManager $entityManager) 142 | { 143 | $this->entityManager = $entityManager; 144 | return $this; 145 | } 146 | 147 | /** 148 | * @return EntityManager|null 149 | */ 150 | public function getEntityManager() 151 | { 152 | if (isset($this->entityManager)) { 153 | return $this->entityManager; 154 | } 155 | return $this->entityManager = $this->createEntityManager(); 156 | } 157 | 158 | /** 159 | * @return EntityManager|null 160 | * @throws Exception 161 | */ 162 | public function createEntityManager() 163 | { 164 | $dbParams = [ 165 | 'driver' => 'pdo_mysql', 166 | 'host' => $this->getConfig()->getHost(), 167 | 'user' => $this->getConfig()->getUser(), 168 | 'password' => $this->getConfig()->getPassword(), 169 | 'dbname' => $this->getConfig()->getDbname(), 170 | 'charset' => 'utf8', 171 | ]; 172 | 173 | if ($this->getConfig()->getPort()) { 174 | $dbParams['port'] = $this->getConfig()->getPort(); 175 | } 176 | 177 | $isDevMode = $this->getConfig()->isDev(); 178 | $doctrineConfig = Setup::createConfiguration($isDevMode, null, new ArrayCache()); 179 | $doctrineConfig->setAutoGenerateProxyClasses(true); 180 | 181 | $doctrineConfig->setMetadataDriverImpl( 182 | new AnnotationDriver(new AnnotationReader(), [realpath(__DIR__ . '/../')]) 183 | ); 184 | 185 | return EntityManager::create($dbParams, $doctrineConfig); 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /src/SalesOrder/SalesOrderBuilder.php: -------------------------------------------------------------------------------- 1 | entityManager = $entityManager; 57 | $this->nextPrimaryKeyRepository = $this->entityManager->getRepository( 58 | 'Smart\\Sage50\\NextPrimaryKey\\NextPrimaryKeyEntity' 59 | ); 60 | $this->journalEntryRepository = $this->entityManager->getRepository( 61 | 'Smart\\Sage50\\JournalEntry\\JournalEntryEntity' 62 | ); 63 | $this->locationInventoryRepository = $this->entityManager->getRepository( 64 | 'Smart\\Sage50\\LocationInventory\\LocationInventoryEntity' 65 | ); 66 | } 67 | 68 | /** 69 | * @param SalesOrderEntity $salesOrder 70 | * @param TaxCollection[] $taxCollections 71 | */ 72 | public function createSalesOrder(SalesOrderEntity $salesOrder, array $taxCollections = null) 73 | { 74 | if (null !== $taxCollections) { 75 | $this->taxCollections = $taxCollections; 76 | } 77 | $this->addSalesOrder($salesOrder); 78 | } 79 | 80 | /** 81 | * @param SalesOrderEntity $salesOrder 82 | */ 83 | protected function addSalesOrder(SalesOrderEntity $salesOrder) 84 | { 85 | $this->salesOrder = $salesOrder; 86 | $this->salesOrder->setId($this->nextPrimaryKeyRepository->fetchNextSalesOrderId()); 87 | $this->salesOrder->setNextId($this->journalEntryRepository->fetchNextJournalEntryId()); 88 | } 89 | 90 | protected function persistSalesOrder() 91 | { 92 | $this->entityManager->persist($this->salesOrder); 93 | $this->entityManager->flush($this->salesOrder); 94 | 95 | foreach ($this->items as $itemArray) { 96 | /** @var ItemEntity $item */ 97 | $item = $itemArray['item']; 98 | /** @var ItemTaxEntity[] $itemTaxes */ 99 | $itemTaxes = $itemArray['itemTaxes']; 100 | 101 | $item->setSalesOrderId($this->salesOrder->getId()); 102 | $this->entityManager->persist($item); 103 | foreach ($itemTaxes as $itemTax) { 104 | $itemTax->setSalesOrderId($this->salesOrder->getId()); 105 | $this->entityManager->persist($itemTax); 106 | } 107 | $this->increaseInventoryOnSalesOrder($item); 108 | } 109 | 110 | $this->nextPrimaryKeyRepository->increaseNextSalesOrderId(); 111 | $this->entityManager->flush(); 112 | } 113 | 114 | /** 115 | * @param ItemEntity $item 116 | */ 117 | protected function increaseInventoryOnSalesOrder(ItemEntity $item) 118 | { 119 | $this->locationInventoryRepository->increaseInventoryOnSalesOrder( 120 | $item->getInventoryId(), 121 | $item->getInventoryLocationId(), 122 | $item->getQuantityOrdered() 123 | ); 124 | } 125 | 126 | /** 127 | * @param ItemEntity $item 128 | * @param TaxCollection[] $taxCollections 129 | */ 130 | public function addItem(ItemEntity $item, array $taxCollections = null) 131 | { 132 | $this->items[spl_object_hash($item)] = [ 133 | 'item' => $item, 134 | 'itemTaxes' => [], 135 | ]; 136 | 137 | $item->setSalesOrderItemId(count($this->items)); 138 | 139 | if (null === $taxCollections && null !== $this->taxCollections) { 140 | $taxCollections = $this->taxCollections; 141 | } 142 | 143 | if (null !== $taxCollections) { 144 | foreach ($taxCollections as $taxCollection) { 145 | $this->addItemTax($taxCollection, $item, new ItemTaxEntity); 146 | } 147 | } 148 | } 149 | 150 | /** 151 | * @param TaxCollection $taxCollection 152 | * @param ItemEntity $item 153 | * @param ItemTaxEntity $itemTax 154 | */ 155 | public function addItemTax(TaxCollection $taxCollection, ItemEntity $item, ItemTaxEntity $itemTax) 156 | { 157 | $taxId = null; 158 | $totalTaxAmount = 0; 159 | /** @var TaxEntity $taxEntity */ 160 | foreach ($taxCollection as $taxEntity) { 161 | $taxId = $taxEntity->getTaxCode()->getTaxId(); 162 | if ($taxEntity->isCompound()) { 163 | $taxAmount = bcmul($item->getAmount() + $totalTaxAmount, $taxEntity->getRate(), 2); 164 | } else { 165 | $taxAmount = bcmul($item->getAmount(), $taxEntity->getRate(), 2); 166 | } 167 | $totalTaxAmount = bcadd($totalTaxAmount, $taxAmount, 2); 168 | } 169 | if (null !== $taxId) { 170 | $itemTax->setTaxId($taxId); 171 | $itemTax->setSalesOrderItemId($item->getSalesOrderItemId()); 172 | $itemTax->setTaxAmount($totalTaxAmount); 173 | $this->items[spl_object_hash($item)]['itemTaxes'][spl_object_hash($itemTax)] = $itemTax; 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /src/Container.php: -------------------------------------------------------------------------------- 1 | customerSync) { 68 | $this->customerSync = new CustomerSync($this->getEntityManager()); 69 | } 70 | return $this->customerSync; 71 | } 72 | 73 | /** 74 | * @param CustomerSync $customerSync 75 | * @return $this 76 | */ 77 | public function setCustomerSync(CustomerSync $customerSync) 78 | { 79 | $this->customerSync = $customerSync; 80 | return $this; 81 | } 82 | 83 | /** 84 | * @return CustomerRepository 85 | */ 86 | public function getCustomerRepository() 87 | { 88 | if (null === $this->customerRepository) { 89 | $this->customerRepository = $this->getEntityManager()->getRepository( 90 | 'Smart\\Sage50\\Customer\\CustomerEntity' 91 | ); 92 | } 93 | return $this->customerRepository; 94 | } 95 | 96 | /** 97 | * @param CustomerRepository $customerRepository 98 | * @return $this 99 | */ 100 | public function setCustomerRepository(CustomerRepository $customerRepository) 101 | { 102 | $this->customerRepository = $customerRepository; 103 | return $this; 104 | } 105 | 106 | /** 107 | * @return InvoiceSync 108 | */ 109 | public function getInvoiceSync() 110 | { 111 | if (null === $this->invoiceSync) { 112 | $this->invoiceSync = new InvoiceSync($this->getEntityManager()); 113 | } 114 | return $this->invoiceSync; 115 | } 116 | 117 | /** 118 | * @param InvoiceSync $invoiceSync 119 | * @return $this 120 | */ 121 | public function setInvoiceSync(InvoiceSync $invoiceSync) 122 | { 123 | $this->invoiceSync = $invoiceSync; 124 | return $this; 125 | } 126 | 127 | /** 128 | * @return InvoiceRepository 129 | */ 130 | public function getInvoiceRepository() 131 | { 132 | if (null === $this->invoiceRepository) { 133 | $this->invoiceRepository = $this->getEntityManager()->getRepository( 134 | 'Smart\\Sage50\\Invoice\\InvoiceEntity' 135 | ); 136 | } 137 | return $this->invoiceRepository; 138 | } 139 | 140 | /** 141 | * @param InvoiceRepository $invoiceRepository 142 | * @return $this 143 | */ 144 | public function setInvoiceRepository(InvoiceRepository $invoiceRepository) 145 | { 146 | $this->invoiceRepository = $invoiceRepository; 147 | return $this; 148 | } 149 | 150 | /** 151 | * @return SalesOrderBuilder 152 | */ 153 | public function getSalesOrderBuilder() 154 | { 155 | if (null === $this->salesOrderBuilder) { 156 | $this->salesOrderBuilder = new SalesOrderBuilder($this->getEntityManager()); 157 | } 158 | return $this->salesOrderBuilder; 159 | } 160 | 161 | /** 162 | * @param SalesOrderBuilder $salesOrderBuilder 163 | * @return $this 164 | */ 165 | public function setSalesOrderBuilder(SalesOrderBuilder $salesOrderBuilder) 166 | { 167 | $this->salesOrderBuilder = $salesOrderBuilder; 168 | return $this; 169 | } 170 | 171 | /** 172 | * @return SalesOrderSync 173 | */ 174 | public function getSalesOrderSync() 175 | { 176 | if (null === $this->salesOrderSync) { 177 | $this->salesOrderSync = new SalesOrderSync($this->getEntityManager()); 178 | } 179 | return $this->salesOrderSync; 180 | } 181 | 182 | /** 183 | * @param SalesOrderSync $salesOrderSync 184 | * @return $this 185 | */ 186 | public function setSalesOrderSync(SalesOrderSync $salesOrderSync) 187 | { 188 | $this->salesOrderSync = $salesOrderSync; 189 | return $this; 190 | } 191 | 192 | /** 193 | * @return SalesOrderRepository 194 | */ 195 | public function getSalesOrderRepository() 196 | { 197 | if (null === $this->salesOrderRepository) { 198 | $this->salesOrderRepository = $this->getEntityManager()->getRepository( 199 | 'Smart\\Sage50\\SalesOrder\\SalesOrderEntity' 200 | ); 201 | } 202 | return $this->salesOrderRepository; 203 | } 204 | 205 | /** 206 | * @param SalesOrderRepository $salesOrderRepository 207 | * @return $this 208 | */ 209 | public function setSalesOrderRepository(SalesOrderRepository $salesOrderRepository) 210 | { 211 | $this->salesOrderRepository = $salesOrderRepository; 212 | return $this; 213 | } 214 | 215 | /** 216 | * @return SalesOrderItemRepository 217 | */ 218 | public function getSalesOrderItemRepository() 219 | { 220 | if (null === $this->salesOrderItemRepository) { 221 | $this->salesOrderItemRepository = $this->getEntityManager()->getRepository( 222 | 'Smart\\Sage50\\SalesOrder\\Item\\ItemEntity' 223 | ); 224 | } 225 | return $this->salesOrderItemRepository; 226 | } 227 | 228 | /** 229 | * @param SalesOrderItemRepository $salesOrderItemRepository 230 | * @return $this 231 | */ 232 | public function setSalesOrderItemRepository(SalesOrderItemRepository $salesOrderItemRepository) 233 | { 234 | $this->salesOrderItemRepository = $salesOrderItemRepository; 235 | return $this; 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /src/Doctrine/GenerateEntityCommand.php: -------------------------------------------------------------------------------- 1 | srcDir = dirname(__DIR__); 40 | $this->question = new QuestionHelper(); 41 | $this->doctrine = $doctrine; 42 | parent::__construct(); 43 | } 44 | 45 | /** 46 | * @var string 47 | */ 48 | private $table; 49 | 50 | protected function configure() 51 | { 52 | $this->setName('generate-entity')->setDescription('Generate entity from a table'); 53 | } 54 | 55 | /** 56 | * @param InputInterface $input 57 | * @param OutputInterface $output 58 | * @return void 59 | * @throws \Exception 60 | */ 61 | protected function execute(InputInterface $input, OutputInterface $output) 62 | { 63 | if (!$table = $this->getTable()) { 64 | $question = new Question('Table name: '); 65 | $table = strtolower($this->question->ask($input, $output, $question)); 66 | } 67 | 68 | $words = explode('_', $table); 69 | $entity = ''; 70 | foreach ($words as $word) { 71 | if (substr($word, -1) === 's') { 72 | $word = substr($word, 0, -1); 73 | } 74 | $entity .= ucfirst($word); 75 | } 76 | $entity = $entity . '/' . $entity . 'Entity'; 77 | 78 | $directory = trim(dirname($entity), '/'); 79 | $entity = str_replace('.php', null, basename($entity)); 80 | 81 | $dirPath = $this->srcDir . DIRECTORY_SEPARATOR . $directory; 82 | 83 | if (file_exists($dirPath . DIRECTORY_SEPARATOR . $entity . '.php')) { 84 | $output->write('[ Failed: Entity ' . $directory . DIRECTORY_SEPARATOR . $entity . ' already exists ]', true); 85 | return; 86 | } 87 | 88 | if (!is_dir($dirPath)) { 89 | mkdir($dirPath, 0777, true); 90 | } 91 | 92 | // Execute doctrine command 93 | $fileListBefore = scandir($dirPath); 94 | $filter = str_replace(' ', '', ucwords(str_replace('_', ' ', $table))); 95 | $command = new ConvertMappingCommand(); 96 | 97 | $helperSet = new HelperSet(array( 98 | 'db' => new ConnectionHelper($this->doctrine->getEntityManager()->getConnection()), 99 | 'em' => new EntityManagerHelper($this->doctrine->getEntityManager()) 100 | )); 101 | 102 | $command->setHelperSet($helperSet); 103 | 104 | $this->doctrine->getEntityManager()->getConfiguration()->setFilterSchemaAssetsExpression('/^' . $table . '$/i'); 105 | 106 | $command->run(new ArrayInput([ 107 | 'to-type' => 'annotation', 108 | 'dest-path' => $this->srcDir . "/{$directory}", 109 | '--from-database' => true, 110 | '--filter' => $filter 111 | ]), new ConsoleOutput()); 112 | 113 | $fileListAfter = scandir($dirPath); 114 | 115 | // Move file to right location 116 | $file = current(array_diff($fileListAfter, $fileListBefore)); 117 | if (!$file) { 118 | throw new \Exception('No entity generated'); 119 | } 120 | $filePath = $dirPath . DIRECTORY_SEPARATOR . $file; 121 | 122 | rename($filePath, $dirPath . DIRECTORY_SEPARATOR . $entity . '.php'); 123 | $filePath = $dirPath . DIRECTORY_SEPARATOR . $entity . '.php'; 124 | 125 | $fileContent = file_get_contents($filePath); 126 | 127 | // Fix classes and namespace 128 | $fileContent = str_replace('getNamespace(), '\\/') . '\\' . str_replace('/', '\\', trim($directory, '\\/')) . ';' . PHP_EOL . 'use DateTime;' . PHP_EOL . PHP_EOL . trim($fileContent); 156 | 157 | // Fix enums 158 | /** @var \Doctrine\DBAL\Driver\PDOConnection $conn */ 159 | $conn = $this->doctrine->getEntityManager()->getConnection()->getWrappedConnection(); 160 | $query = "SHOW COLUMNS FROM `{$table}`"; 161 | foreach ($conn->query($query) as $row) { 162 | if (substr($row['Type'], 0, 4) === 'enum') { 163 | $definition = 'columnDefinition="ENUM' . substr($row['Type'], 4) . '"'; 164 | $fileContent = str_replace('name="' . $row['Field'] . '", type="string"', 'name="' . $row['Field'] . '", type="string", ' . $definition, $fileContent); 165 | } 166 | } 167 | 168 | // Save changes 169 | file_put_contents($filePath, $fileContent .PHP_EOL); 170 | 171 | $output->write('[ Success: Created entity ' . $directory . DIRECTORY_SEPARATOR . $entity . ' ]', true); 172 | } 173 | 174 | /** 175 | * @return string 176 | */ 177 | public function getTable() 178 | { 179 | return $this->table; 180 | } 181 | 182 | /** 183 | * @param string $table 184 | * @return $this 185 | */ 186 | public function setTable($table) 187 | { 188 | $this->table = $table; 189 | return $this; 190 | } 191 | 192 | public function getNamespace() 193 | { 194 | $className = str_replace('\\', '/', get_class($this)); 195 | return str_replace('/', '\\', dirname(dirname($className))); 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /src/Customer/AdditionalInfo/AdditionalInfoEntity.php: -------------------------------------------------------------------------------- 1 | customerId; 119 | } 120 | 121 | /** 122 | * @param $customerId 123 | */ 124 | public function setCustomerId($customerId) 125 | { 126 | $this->customerId = $customerId; 127 | } 128 | 129 | /** 130 | * @return CustomerEntity 131 | */ 132 | public function getCustomer() 133 | { 134 | return $this->customer; 135 | } 136 | 137 | /** 138 | * @param $customer 139 | */ 140 | public function setCustomer($customer) 141 | { 142 | $this->customer = $customer; 143 | } 144 | 145 | /** 146 | * @return DateTime 147 | */ 148 | public function getModificationDate() 149 | { 150 | return $this->modificationDate; 151 | } 152 | 153 | /** 154 | * @param $modificationDate 155 | */ 156 | public function setModificationDate($modificationDate) 157 | { 158 | $this->modificationDate = $modificationDate; 159 | } 160 | 161 | /** 162 | * @return DateTime 163 | */ 164 | public function getModificationTime() 165 | { 166 | return $this->modificationTime; 167 | } 168 | 169 | /** 170 | * @param $modificationTime 171 | */ 172 | public function setModificationTime($modificationTime) 173 | { 174 | $this->modificationTime = $modificationTime; 175 | } 176 | 177 | /** 178 | * @return string 179 | */ 180 | public function getCreatedByUsername() 181 | { 182 | return $this->createdByUsername; 183 | } 184 | 185 | /** 186 | * @param $createdByUsername 187 | */ 188 | public function setCreatedByUsername($createdByUsername) 189 | { 190 | $this->createdByUsername = $createdByUsername; 191 | } 192 | 193 | /** 194 | * @return string 195 | */ 196 | public function getCreatedByOrg() 197 | { 198 | return $this->createdByOrg; 199 | } 200 | 201 | /** 202 | * @param $createdByOrg 203 | */ 204 | public function setCreatedByOrg($createdByOrg) 205 | { 206 | $this->createdByOrg = $createdByOrg; 207 | } 208 | 209 | /** 210 | * @return string 211 | */ 212 | public function getField1() 213 | { 214 | return $this->field1; 215 | } 216 | 217 | /** 218 | * @param $field1 219 | */ 220 | public function setField1($field1) 221 | { 222 | $this->field1 = $field1; 223 | } 224 | 225 | /** 226 | * @return string 227 | */ 228 | public function getField2() 229 | { 230 | return $this->field2; 231 | } 232 | 233 | /** 234 | * @param $field2 235 | */ 236 | public function setField2($field2) 237 | { 238 | $this->field2 = $field2; 239 | } 240 | 241 | /** 242 | * @return string 243 | */ 244 | public function getField3() 245 | { 246 | return $this->field3; 247 | } 248 | 249 | /** 250 | * @param $field3 251 | */ 252 | public function setField3($field3) 253 | { 254 | $this->field3 = $field3; 255 | } 256 | 257 | /** 258 | * @return string 259 | */ 260 | public function getField4() 261 | { 262 | return $this->field4; 263 | } 264 | 265 | /** 266 | * @param $field4 267 | */ 268 | public function setField4($field4) 269 | { 270 | $this->field4 = $field4; 271 | } 272 | 273 | /** 274 | * @return string 275 | */ 276 | public function getField5() 277 | { 278 | return $this->field5; 279 | } 280 | 281 | /** 282 | * @param $field5 283 | */ 284 | public function setField5($field5) 285 | { 286 | $this->field5 = $field5; 287 | } 288 | 289 | /** 290 | * @return bool 291 | */ 292 | public function isShowField1() 293 | { 294 | return $this->showField1; 295 | } 296 | 297 | /** 298 | * @param $showField1 299 | */ 300 | public function setShowField1($showField1) 301 | { 302 | $this->showField1 = $showField1; 303 | } 304 | 305 | /** 306 | * @return bool 307 | */ 308 | public function isShowField2() 309 | { 310 | return $this->showField2; 311 | } 312 | 313 | /** 314 | * @param $showField2 315 | */ 316 | public function setShowField2($showField2) 317 | { 318 | $this->showField2 = $showField2; 319 | } 320 | 321 | /** 322 | * @return bool 323 | */ 324 | public function isShowField3() 325 | { 326 | return $this->showField3; 327 | } 328 | 329 | /** 330 | * @param $showField3 331 | */ 332 | public function setShowField3($showField3) 333 | { 334 | $this->showField3 = $showField3; 335 | } 336 | 337 | /** 338 | * @return bool 339 | */ 340 | public function isShowField4() 341 | { 342 | return $this->showField4; 343 | } 344 | 345 | /** 346 | * @param $showField4 347 | */ 348 | public function setShowField4($showField4) 349 | { 350 | $this->showField4 = $showField4; 351 | } 352 | 353 | /** 354 | * @return bool 355 | */ 356 | public function isShowField5() 357 | { 358 | return $this->showField5; 359 | } 360 | 361 | /** 362 | * @param $showField5 363 | */ 364 | public function setShowField5($showField5) 365 | { 366 | $this->showField5 = $showField5; 367 | } 368 | } 369 | -------------------------------------------------------------------------------- /src/Tax/TaxCode/TaxCodeEntity.php: -------------------------------------------------------------------------------- 1 | setModificationDate(new DateTime(date('Y-m-d 00:00:00'))); 109 | $this->setModificationTime(new DateTime(date('1899-12-30 H:i:s'))); 110 | } 111 | 112 | /** 113 | * @return int 114 | */ 115 | public function getTaxId() 116 | { 117 | return $this->taxId; 118 | } 119 | 120 | /** 121 | * @param int $taxId 122 | * @return $this 123 | */ 124 | public function setTaxId($taxId) 125 | { 126 | $this->taxId = $taxId; 127 | return $this; 128 | } 129 | 130 | /** 131 | * @return DateTime 132 | */ 133 | public function getModificationDate() 134 | { 135 | return $this->modificationDate; 136 | } 137 | 138 | /** 139 | * @param DateTime $modificationDate 140 | * @return $this 141 | */ 142 | public function setModificationDate(DateTime $modificationDate) 143 | { 144 | $this->modificationDate = $modificationDate; 145 | return $this; 146 | } 147 | 148 | /** 149 | * @return DateTime 150 | */ 151 | public function getModificationTime() 152 | { 153 | return $this->modificationTime; 154 | } 155 | 156 | /** 157 | * @param DateTime $modificationTime 158 | * @return $this 159 | */ 160 | public function setModificationTime(DateTime $modificationTime) 161 | { 162 | $this->modificationTime = $modificationTime; 163 | return $this; 164 | } 165 | 166 | /** 167 | * @return DateTime 168 | */ 169 | public function getModificationDatetime() 170 | { 171 | return new DateTime($this->modificationDate->format('Y-m-d') . ' ' . $this->modificationTime->format('H:i:s')); 172 | } 173 | 174 | /** 175 | * @return string 176 | */ 177 | public function getCreatedByUsername() 178 | { 179 | return $this->createdByUsername; 180 | } 181 | 182 | /** 183 | * @param string $createdByUsername 184 | * @return $this 185 | */ 186 | public function setCreatedByUsername($createdByUsername) 187 | { 188 | $this->createdByUsername = $createdByUsername; 189 | return $this; 190 | } 191 | 192 | /** 193 | * @return string 194 | */ 195 | public function getCreatedByOrg() 196 | { 197 | return $this->createdByOrg; 198 | } 199 | 200 | /** 201 | * @param string $createdByOrg 202 | * @return $this 203 | */ 204 | public function setCreatedByOrg($createdByOrg) 205 | { 206 | $this->createdByOrg = $createdByOrg; 207 | return $this; 208 | } 209 | 210 | /** 211 | * @return string 212 | */ 213 | public function getCode() 214 | { 215 | return $this->code; 216 | } 217 | 218 | /** 219 | * @param string $code 220 | * @return $this 221 | */ 222 | public function setCode($code) 223 | { 224 | $this->code = $code; 225 | return $this; 226 | } 227 | 228 | /** 229 | * @return string 230 | */ 231 | public function getDescriptionEnglish() 232 | { 233 | return $this->descriptionEnglish; 234 | } 235 | 236 | /** 237 | * @param string $descriptionEnglish 238 | * @return $this 239 | */ 240 | public function setDescriptionEnglish($descriptionEnglish) 241 | { 242 | $this->descriptionEnglish = $descriptionEnglish; 243 | return $this; 244 | } 245 | 246 | /** 247 | * @return boolean 248 | */ 249 | public function isUsed() 250 | { 251 | return $this->isUsed; 252 | } 253 | 254 | /** 255 | * @param boolean $isUsed 256 | * @return $this 257 | */ 258 | public function setIsUsed($isUsed) 259 | { 260 | $this->isUsed = $isUsed; 261 | return $this; 262 | } 263 | 264 | /** 265 | * @return boolean 266 | */ 267 | public function isNonStandard() 268 | { 269 | return $this->isNonStandard; 270 | } 271 | 272 | /** 273 | * @param boolean $isNonStandard 274 | * @return $this 275 | */ 276 | public function setIsNonStandard($isNonStandard) 277 | { 278 | $this->isNonStandard = $isNonStandard; 279 | return $this; 280 | } 281 | 282 | /** 283 | * @return int 284 | */ 285 | public function getFirstRevisionId() 286 | { 287 | return $this->firstRevisionId; 288 | } 289 | 290 | /** 291 | * @param int $firstRevisionId 292 | * @return $this 293 | */ 294 | public function setFirstRevisionId($firstRevisionId) 295 | { 296 | $this->firstRevisionId = $firstRevisionId; 297 | return $this; 298 | } 299 | 300 | /** 301 | * @return int 302 | */ 303 | public function getLastRevisionId() 304 | { 305 | return $this->lastRevisionId; 306 | } 307 | 308 | /** 309 | * @param int $lastRevisionId 310 | * @return $this 311 | */ 312 | public function setLastRevisionId($lastRevisionId) 313 | { 314 | $this->lastRevisionId = $lastRevisionId; 315 | return $this; 316 | } 317 | 318 | /** 319 | * @return int 320 | */ 321 | public function getUseForJournal() 322 | { 323 | return $this->useForJournal; 324 | } 325 | 326 | /** 327 | * @param int $useForJournal 328 | * @return $this 329 | */ 330 | public function setUseForJournal($useForJournal) 331 | { 332 | $this->useForJournal = $useForJournal; 333 | return $this; 334 | } 335 | 336 | /** 337 | * @return int 338 | */ 339 | public function getLineNumber() 340 | { 341 | return $this->lineNumber; 342 | } 343 | 344 | /** 345 | * @param int $lineNumber 346 | * @return $this 347 | */ 348 | public function setLineNumber($lineNumber) 349 | { 350 | $this->lineNumber = $lineNumber; 351 | return $this; 352 | } 353 | 354 | /** 355 | * @return string 356 | */ 357 | public function getDescriptionFrench() 358 | { 359 | return $this->descriptionFrench; 360 | } 361 | 362 | /** 363 | * @param string $descriptionFrench 364 | * @return $this 365 | */ 366 | public function setDescriptionFrench($descriptionFrench) 367 | { 368 | $this->descriptionFrench = $descriptionFrench; 369 | return $this; 370 | } 371 | } 372 | -------------------------------------------------------------------------------- /src/LocationInventory/LocationInventoryEntity.php: -------------------------------------------------------------------------------- 1 | setModificationDate(new DateTime(date('Y-m-d 00:00:00'))); 111 | $this->setModificationTime(new DateTime(date('1899-12-30 H:i:s'))); 112 | } 113 | 114 | /** 115 | * @return int 116 | */ 117 | public function getInventoryId() 118 | { 119 | return $this->inventoryId; 120 | } 121 | 122 | /** 123 | * @param int $inventoryId 124 | * @return $this 125 | */ 126 | public function setInventoryId($inventoryId) 127 | { 128 | $this->inventoryId = $inventoryId; 129 | return $this; 130 | } 131 | 132 | /** 133 | * @return int 134 | */ 135 | public function getInventoryLocationId() 136 | { 137 | return $this->inventoryLocationId; 138 | } 139 | 140 | /** 141 | * @param int $inventoryLocationId 142 | * @return $this 143 | */ 144 | public function setInventoryLocationId($inventoryLocationId) 145 | { 146 | $this->inventoryLocationId = $inventoryLocationId; 147 | return $this; 148 | } 149 | 150 | /** 151 | * @return DateTime 152 | */ 153 | public function getModificationDate() 154 | { 155 | return $this->modificationDate; 156 | } 157 | 158 | /** 159 | * @param DateTime $modificationDate 160 | * @return $this 161 | */ 162 | public function setModificationDate(DateTime $modificationDate) 163 | { 164 | $this->modificationDate = $modificationDate; 165 | return $this; 166 | } 167 | 168 | /** 169 | * @return DateTime 170 | */ 171 | public function getModificationTime() 172 | { 173 | return $this->modificationTime; 174 | } 175 | 176 | /** 177 | * @param DateTime $modificationTime 178 | * @return $this 179 | */ 180 | public function setModificationTime(DateTime $modificationTime) 181 | { 182 | $this->modificationTime = $modificationTime; 183 | return $this; 184 | } 185 | 186 | /** 187 | * @return DateTime 188 | */ 189 | public function getModificationDatetime() 190 | { 191 | return new DateTime($this->modificationDate->format('Y-m-d') . ' ' . $this->modificationTime->format('H:i:s')); 192 | } 193 | 194 | /** 195 | * @return string 196 | */ 197 | public function getCreatedByUsername() 198 | { 199 | return $this->createdByUsername; 200 | } 201 | 202 | /** 203 | * @param string $createdByUsername 204 | * @return $this 205 | */ 206 | public function setCreatedByUsername($createdByUsername) 207 | { 208 | $this->createdByUsername = $createdByUsername; 209 | return $this; 210 | } 211 | 212 | /** 213 | * @return string 214 | */ 215 | public function getCreatedByOrg() 216 | { 217 | return $this->createdByOrg; 218 | } 219 | 220 | /** 221 | * @param string $createdByOrg 222 | * @return $this 223 | */ 224 | public function setCreatedByOrg($createdByOrg) 225 | { 226 | $this->createdByOrg = $createdByOrg; 227 | return $this; 228 | } 229 | 230 | /** 231 | * @return float 232 | */ 233 | public function getItemsInStockQuantity() 234 | { 235 | return $this->itemsInStockQuantity; 236 | } 237 | 238 | /** 239 | * @param float $itemsInStockQuantity 240 | * @return $this 241 | */ 242 | public function setItemsInStockQuantity($itemsInStockQuantity) 243 | { 244 | $this->itemsInStockQuantity = $itemsInStockQuantity; 245 | return $this; 246 | } 247 | 248 | /** 249 | * @return float 250 | */ 251 | public function getItemsInStockCost() 252 | { 253 | return $this->itemsInStockCost; 254 | } 255 | 256 | /** 257 | * @param float $itemsInStockCost 258 | * @return $this 259 | */ 260 | public function setItemsInStockCost($itemsInStockCost) 261 | { 262 | $this->itemsInStockCost = $itemsInStockCost; 263 | return $this; 264 | } 265 | 266 | /** 267 | * @return float 268 | */ 269 | public function getOrderPoint() 270 | { 271 | return $this->orderPoint; 272 | } 273 | 274 | /** 275 | * @param float $orderPoint 276 | * @return $this 277 | */ 278 | public function setOrderPoint($orderPoint) 279 | { 280 | $this->orderPoint = $orderPoint; 281 | return $this; 282 | } 283 | 284 | /** 285 | * @return float 286 | */ 287 | public function getLastUnitSellingPrice() 288 | { 289 | return $this->lastUnitSellingPrice; 290 | } 291 | 292 | /** 293 | * @param float $lastUnitSellingPrice 294 | * @return $this 295 | */ 296 | public function setLastUnitSellingPrice($lastUnitSellingPrice) 297 | { 298 | $this->lastUnitSellingPrice = $lastUnitSellingPrice; 299 | return $this; 300 | } 301 | 302 | /** 303 | * @return float 304 | */ 305 | public function getQuantityOnPurchaseOrder() 306 | { 307 | return $this->quantityOnPurchaseOrder; 308 | } 309 | 310 | /** 311 | * @param float $quantityOnPurchaseOrder 312 | * @return $this 313 | */ 314 | public function setQuantityOnPurchaseOrder($quantityOnPurchaseOrder) 315 | { 316 | $this->quantityOnPurchaseOrder = $quantityOnPurchaseOrder; 317 | return $this; 318 | } 319 | 320 | /** 321 | * @return float 322 | */ 323 | public function getLastPurchaseUnitPrice() 324 | { 325 | return $this->lastPurchaseUnitPrice; 326 | } 327 | 328 | /** 329 | * @param float $lastPurchaseUnitPrice 330 | * @return $this 331 | */ 332 | public function setLastPurchaseUnitPrice($lastPurchaseUnitPrice) 333 | { 334 | $this->lastPurchaseUnitPrice = $lastPurchaseUnitPrice; 335 | return $this; 336 | } 337 | 338 | /** 339 | * @return float 340 | */ 341 | public function getQuantityOnSalesOrder() 342 | { 343 | return $this->quantityOnSalesOrder; 344 | } 345 | 346 | /** 347 | * @param float $quantityOnSalesOrder 348 | * @return $this 349 | */ 350 | public function setQuantityOnSalesOrder($quantityOnSalesOrder) 351 | { 352 | $this->quantityOnSalesOrder = $quantityOnSalesOrder; 353 | return $this; 354 | } 355 | 356 | /** 357 | * @return float 358 | */ 359 | public function getHistoricalItemsInStockQuantity() 360 | { 361 | return $this->historicalItemsInStockQuantity; 362 | } 363 | 364 | /** 365 | * @param float $historicalItemsInStockQuantity 366 | * @return $this 367 | */ 368 | public function setHistoricalItemsInStockQuantity($historicalItemsInStockQuantity) 369 | { 370 | $this->historicalItemsInStockQuantity = $historicalItemsInStockQuantity; 371 | return $this; 372 | } 373 | 374 | /** 375 | * @return float 376 | */ 377 | public function getHistoricalItemsInStockCost() 378 | { 379 | return $this->historicalItemsInStockCost; 380 | } 381 | 382 | /** 383 | * @param float $historicalItemsInStockCost 384 | * @return $this 385 | */ 386 | public function setHistoricalItemsInStockCost($historicalItemsInStockCost) 387 | { 388 | $this->historicalItemsInStockCost = $historicalItemsInStockCost; 389 | return $this; 390 | } 391 | } 392 | -------------------------------------------------------------------------------- /src/Invoice/Item/ItemEntity.php: -------------------------------------------------------------------------------- 1 | invoiceId; 169 | } 170 | 171 | /** 172 | * @param int $invoiceId 173 | */ 174 | public function setInvoiceId($invoiceId) 175 | { 176 | $this->invoiceId = $invoiceId; 177 | } 178 | 179 | /** 180 | * @return InvoiceEntity 181 | */ 182 | public function getInvoice() { 183 | return $this->invoice; 184 | } 185 | 186 | /** 187 | * @param InvoiceEntity $invoice 188 | */ 189 | public function setInvoice(InvoiceEntity $invoice) 190 | { 191 | $this->invoice = $invoice; 192 | } 193 | 194 | /** 195 | * @return int 196 | */ 197 | public function getId() 198 | { 199 | return $this->id; 200 | } 201 | 202 | /** 203 | * @param int $id 204 | */ 205 | public function setId($id) 206 | { 207 | $this->id = $id; 208 | } 209 | 210 | /** 211 | * @return string 212 | */ 213 | public function getSourceDescription() 214 | { 215 | return $this->sourceDescription; 216 | } 217 | 218 | /** 219 | * @param string $sourceDescription 220 | */ 221 | public function setSourceDescription($sourceDescription) 222 | { 223 | $this->sourceDescription = $sourceDescription; 224 | } 225 | 226 | /** 227 | * @return int 228 | */ 229 | public function getInventoryId() 230 | { 231 | return $this->inventoryId; 232 | } 233 | 234 | /** 235 | * @param int $inventoryId 236 | */ 237 | public function setInventoryId($inventoryId) 238 | { 239 | $this->inventoryId = $inventoryId; 240 | } 241 | 242 | /** 243 | * @return int 244 | */ 245 | public function getAccountId() 246 | { 247 | return $this->accountId; 248 | } 249 | 250 | /** 251 | * @param int $accountId 252 | */ 253 | public function setAccountId($accountId) 254 | { 255 | $this->accountId = $accountId; 256 | } 257 | 258 | /** 259 | * @return float 260 | */ 261 | public function getQuantitySold() 262 | { 263 | return $this->quantitySold; 264 | } 265 | 266 | /** 267 | * @param float $quantitySold 268 | */ 269 | public function setQuantitySold($quantitySold) 270 | { 271 | $this->quantitySold = $quantitySold; 272 | } 273 | 274 | /** 275 | * @return float 276 | */ 277 | public function getPrice() 278 | { 279 | return $this->price; 280 | } 281 | 282 | /** 283 | * @param float $price 284 | */ 285 | public function setPrice($price) 286 | { 287 | $this->price = $price; 288 | } 289 | 290 | /** 291 | * @return float 292 | */ 293 | public function getAmount() 294 | { 295 | return $this->amount; 296 | } 297 | 298 | /** 299 | * @param float $amount 300 | */ 301 | public function setAmount($amount) 302 | { 303 | $this->amount = $amount; 304 | } 305 | 306 | /** 307 | * @return float 308 | */ 309 | public function getCost() 310 | { 311 | return $this->cost; 312 | } 313 | 314 | /** 315 | * @param float $cost 316 | */ 317 | public function setCost($cost) 318 | { 319 | $this->cost = $cost; 320 | } 321 | 322 | /** 323 | * @return float 324 | */ 325 | public function getRevenue() 326 | { 327 | return $this->revenue; 328 | } 329 | 330 | /** 331 | * @param float $revenue 332 | */ 333 | public function setRevenue($revenue) 334 | { 335 | $this->revenue = $revenue; 336 | } 337 | 338 | /** 339 | * @return boolean 340 | */ 341 | public function isAssemblyComponentsLine() 342 | { 343 | return $this->assemblyComponentsLine; 344 | } 345 | 346 | /** 347 | * @param boolean $assemblyComponentsLine 348 | */ 349 | public function setAssemblyComponentsLine($assemblyComponentsLine) 350 | { 351 | $this->assemblyComponentsLine = $assemblyComponentsLine; 352 | } 353 | 354 | /** 355 | * @return boolean 356 | */ 357 | public function isVarianceLine() 358 | { 359 | return $this->varianceLine; 360 | } 361 | 362 | /** 363 | * @param boolean $varianceLine 364 | */ 365 | public function setVarianceLine($varianceLine) 366 | { 367 | $this->varianceLine = $varianceLine; 368 | } 369 | 370 | /** 371 | * @return boolean 372 | */ 373 | public function isReversal() 374 | { 375 | return $this->isReversal; 376 | } 377 | 378 | /** 379 | * @param boolean $isReversal 380 | */ 381 | public function setIsReversal($isReversal) 382 | { 383 | $this->isReversal = $isReversal; 384 | } 385 | 386 | /** 387 | * @return boolean 388 | */ 389 | public function isServiceItem() 390 | { 391 | return $this->isServiceItem; 392 | } 393 | 394 | /** 395 | * @param boolean $isServiceItem 396 | */ 397 | public function setIsServiceItem($isServiceItem) 398 | { 399 | $this->isServiceItem = $isServiceItem; 400 | } 401 | 402 | /** 403 | * @return int 404 | */ 405 | public function getAccountDepartmentId() 406 | { 407 | return $this->accountDepartmentId; 408 | } 409 | 410 | /** 411 | * @param int $accountDepartmentId 412 | */ 413 | public function setAccountDepartmentId($accountDepartmentId) 414 | { 415 | $this->accountDepartmentId = $accountDepartmentId; 416 | } 417 | 418 | /** 419 | * @return int 420 | */ 421 | public function getInventoryLocationId() 422 | { 423 | return $this->inventoryLocationId; 424 | } 425 | 426 | /** 427 | * @param int $inventoryLocationId 428 | */ 429 | public function setInventoryLocationId($inventoryLocationId) 430 | { 431 | $this->inventoryLocationId = $inventoryLocationId; 432 | } 433 | 434 | /** 435 | * @return boolean 436 | */ 437 | public function isDefaultPrice() 438 | { 439 | return $this->isDefaultPrice; 440 | } 441 | 442 | /** 443 | * @param boolean $isDefaultPrice 444 | */ 445 | public function setIsDefaultPrice($isDefaultPrice) 446 | { 447 | $this->isDefaultPrice = $isDefaultPrice; 448 | } 449 | 450 | /** 451 | * @return int 452 | */ 453 | public function getPriceListId() 454 | { 455 | return $this->priceListId; 456 | } 457 | 458 | /** 459 | * @param int $priceListId 460 | */ 461 | public function setPriceListId($priceListId) 462 | { 463 | $this->priceListId = $priceListId; 464 | } 465 | 466 | /** 467 | * @return float 468 | */ 469 | public function getItemBasePrice() 470 | { 471 | return $this->itemBasePrice; 472 | } 473 | 474 | /** 475 | * @param float $itemBasePrice 476 | */ 477 | public function setItemBasePrice($itemBasePrice) 478 | { 479 | $this->itemBasePrice = $itemBasePrice; 480 | } 481 | 482 | /** 483 | * @return float 484 | */ 485 | public function getLineDiscountPercentage() 486 | { 487 | return $this->lineDiscountPercentage; 488 | } 489 | 490 | /** 491 | * @param float $lineDiscountPercentage 492 | */ 493 | public function setLineDiscountPercentage($lineDiscountPercentage) 494 | { 495 | $this->lineDiscountPercentage = $lineDiscountPercentage; 496 | } 497 | 498 | /** 499 | * @return boolean 500 | */ 501 | public function isDefaultBasePrice() 502 | { 503 | return $this->isDefaultBasePrice; 504 | } 505 | 506 | /** 507 | * @param boolean $isDefaultBasePrice 508 | */ 509 | public function setIsDefaultBasePrice($isDefaultBasePrice) 510 | { 511 | $this->isDefaultBasePrice = $isDefaultBasePrice; 512 | } 513 | 514 | /** 515 | * @return boolean 516 | */ 517 | public function isDeleted() 518 | { 519 | return $this->isDeleted; 520 | } 521 | 522 | /** 523 | * @param boolean $isDeleted 524 | */ 525 | public function setIsDeleted($isDeleted) 526 | { 527 | $this->isDeleted = $isDeleted; 528 | } 529 | 530 | /** 531 | * @return boolean 532 | */ 533 | public function isVendorInventory() 534 | { 535 | return $this->isVendorInventory; 536 | } 537 | 538 | /** 539 | * @param boolean $isVendorInventory 540 | */ 541 | public function setIsVendorInventory($isVendorInventory) 542 | { 543 | $this->isVendorInventory = $isVendorInventory; 544 | } 545 | } 546 | -------------------------------------------------------------------------------- /src/Tax/TaxAuthority/TaxAuthorityEntity.php: -------------------------------------------------------------------------------- 1 | setModificationDate(new DateTime(date('Y-m-d 00:00:00'))); 135 | $this->setModificationTime(new DateTime(date('1899-12-30 H:i:s'))); 136 | } 137 | 138 | /** 139 | * @return int 140 | */ 141 | public function getId() 142 | { 143 | return $this->id; 144 | } 145 | 146 | /** 147 | * @param int $id 148 | * @return $this 149 | */ 150 | public function setId($id) 151 | { 152 | $this->id = $id; 153 | return $this; 154 | } 155 | 156 | /** 157 | * @return DateTime 158 | */ 159 | public function getModificationDate() 160 | { 161 | return $this->modificationDate; 162 | } 163 | 164 | /** 165 | * @param DateTime $modificationDate 166 | * @return $this 167 | */ 168 | public function setModificationDate(DateTime $modificationDate) 169 | { 170 | $this->modificationDate = $modificationDate; 171 | return $this; 172 | } 173 | 174 | /** 175 | * @return DateTime 176 | */ 177 | public function getModificationTime() 178 | { 179 | return $this->modificationTime; 180 | } 181 | 182 | /** 183 | * @param DateTime $modificationTime 184 | * @return $this 185 | */ 186 | public function setModificationTime(DateTime $modificationTime) 187 | { 188 | $this->modificationTime = $modificationTime; 189 | return $this; 190 | } 191 | 192 | /** 193 | * @return DateTime 194 | */ 195 | public function getModificationDatetime() 196 | { 197 | return new DateTime($this->modificationDate->format('Y-m-d') . ' ' . $this->modificationTime->format('H:i:s')); 198 | } 199 | 200 | /** 201 | * @return string 202 | */ 203 | public function getCreatedByUsername() 204 | { 205 | return $this->createdByUsername; 206 | } 207 | 208 | /** 209 | * @param string $createdByUsername 210 | * @return $this 211 | */ 212 | public function setCreatedByUsername($createdByUsername) 213 | { 214 | $this->createdByUsername = $createdByUsername; 215 | return $this; 216 | } 217 | 218 | /** 219 | * @return string 220 | */ 221 | public function getCreatedByOrg() 222 | { 223 | return $this->createdByOrg; 224 | } 225 | 226 | /** 227 | * @param string $createdByOrg 228 | * @return $this 229 | */ 230 | public function setCreatedByOrg($createdByOrg) 231 | { 232 | $this->createdByOrg = $createdByOrg; 233 | return $this; 234 | } 235 | 236 | /** 237 | * @return string 238 | */ 239 | public function getNameEnglish() 240 | { 241 | return $this->nameEnglish; 242 | } 243 | 244 | /** 245 | * @param string $nameEnglish 246 | * @return $this 247 | */ 248 | public function setNameEnglish($nameEnglish) 249 | { 250 | $this->nameEnglish = $nameEnglish; 251 | return $this; 252 | } 253 | 254 | /** 255 | * @return string 256 | */ 257 | public function getCompanyTaxId() 258 | { 259 | return $this->companyTaxId; 260 | } 261 | 262 | /** 263 | * @param string $companyTaxId 264 | * @return $this 265 | */ 266 | public function setCompanyTaxId($companyTaxId) 267 | { 268 | $this->companyTaxId = $companyTaxId; 269 | return $this; 270 | } 271 | 272 | /** 273 | * @return int 274 | */ 275 | public function getCollectedTaxAccount() 276 | { 277 | return $this->collectedTaxAccount; 278 | } 279 | 280 | /** 281 | * @param int $collectedTaxAccount 282 | * @return $this 283 | */ 284 | public function setCollectedTaxAccount($collectedTaxAccount) 285 | { 286 | $this->collectedTaxAccount = $collectedTaxAccount; 287 | return $this; 288 | } 289 | 290 | /** 291 | * @return boolean 292 | */ 293 | public function isTaxable() 294 | { 295 | return $this->isTaxable; 296 | } 297 | 298 | /** 299 | * @param boolean $isTaxable 300 | * @return $this 301 | */ 302 | public function setIsTaxable($isTaxable) 303 | { 304 | $this->isTaxable = $isTaxable; 305 | return $this; 306 | } 307 | 308 | /** 309 | * @return boolean 310 | */ 311 | public function isExempt() 312 | { 313 | return $this->isExempt; 314 | } 315 | 316 | /** 317 | * @param boolean $isExempt 318 | * @return $this 319 | */ 320 | public function setIsExempt($isExempt) 321 | { 322 | $this->isExempt = $isExempt; 323 | return $this; 324 | } 325 | 326 | /** 327 | * @return boolean 328 | */ 329 | public function isTrackable() 330 | { 331 | return $this->isTrackable; 332 | } 333 | 334 | /** 335 | * @param boolean $isTrackable 336 | * @return $this 337 | */ 338 | public function setIsTrackable($isTrackable) 339 | { 340 | $this->isTrackable = $isTrackable; 341 | return $this; 342 | } 343 | 344 | /** 345 | * @return int 346 | */ 347 | public function getPaidTaxAccount() 348 | { 349 | return $this->paidTaxAccount; 350 | } 351 | 352 | /** 353 | * @param int $paidTaxAccount 354 | * @return $this 355 | */ 356 | public function setPaidTaxAccount($paidTaxAccount) 357 | { 358 | $this->paidTaxAccount = $paidTaxAccount; 359 | return $this; 360 | } 361 | 362 | /** 363 | * @return int 364 | */ 365 | public function getIsPaidTaxReported() 366 | { 367 | return $this->isPaidTaxReported; 368 | } 369 | 370 | /** 371 | * @param int $isPaidTaxReported 372 | * @return $this 373 | */ 374 | public function setIsPaidTaxReported($isPaidTaxReported) 375 | { 376 | $this->isPaidTaxReported = $isPaidTaxReported; 377 | return $this; 378 | } 379 | 380 | /** 381 | * @return int 382 | */ 383 | public function getTaxReportMonths() 384 | { 385 | return $this->taxReportMonths; 386 | } 387 | 388 | /** 389 | * @param int $taxReportMonths 390 | * @return $this 391 | */ 392 | public function setTaxReportMonths($taxReportMonths) 393 | { 394 | $this->taxReportMonths = $taxReportMonths; 395 | return $this; 396 | } 397 | 398 | /** 399 | * @return int 400 | */ 401 | public function getFirstRevisionId() 402 | { 403 | return $this->firstRevisionId; 404 | } 405 | 406 | /** 407 | * @param int $firstRevisionId 408 | * @return $this 409 | */ 410 | public function setFirstRevisionId($firstRevisionId) 411 | { 412 | $this->firstRevisionId = $firstRevisionId; 413 | return $this; 414 | } 415 | 416 | /** 417 | * @return int 418 | */ 419 | public function getLastRevisionId() 420 | { 421 | return $this->lastRevisionId; 422 | } 423 | 424 | /** 425 | * @param int $lastRevisionId 426 | * @return $this 427 | */ 428 | public function setLastRevisionId($lastRevisionId) 429 | { 430 | $this->lastRevisionId = $lastRevisionId; 431 | return $this; 432 | } 433 | 434 | /** 435 | * @return int 436 | */ 437 | public function getCollectedTaxDepartementId() 438 | { 439 | return $this->collectedTaxDepartementId; 440 | } 441 | 442 | /** 443 | * @param int $collectedTaxDepartementId 444 | * @return $this 445 | */ 446 | public function setCollectedTaxDepartementId($collectedTaxDepartementId) 447 | { 448 | $this->collectedTaxDepartementId = $collectedTaxDepartementId; 449 | return $this; 450 | } 451 | 452 | /** 453 | * @return int 454 | */ 455 | public function getPaidTaxDepartementId() 456 | { 457 | return $this->paidTaxDepartementId; 458 | } 459 | 460 | /** 461 | * @param int $paidTaxDepartementId 462 | * @return $this 463 | */ 464 | public function setPaidTaxDepartementId($paidTaxDepartementId) 465 | { 466 | $this->paidTaxDepartementId = $paidTaxDepartementId; 467 | return $this; 468 | } 469 | 470 | /** 471 | * @return string 472 | */ 473 | public function getNameFrench() 474 | { 475 | return $this->nameFrench; 476 | } 477 | 478 | /** 479 | * @param string $nameFrench 480 | * @return $this 481 | */ 482 | public function setNameFrench($nameFrench) 483 | { 484 | $this->nameFrench = $nameFrench; 485 | return $this; 486 | } 487 | } 488 | -------------------------------------------------------------------------------- /src/Invoice/InvoiceLookup/Item/ItemEntity.php: -------------------------------------------------------------------------------- 1 | invoiceId; 186 | } 187 | 188 | /** 189 | * @param int $invoiceId 190 | * @return $this 191 | */ 192 | public function setInvoiceId($invoiceId) 193 | { 194 | $this->invoiceId = $invoiceId; 195 | return $this; 196 | } 197 | 198 | /** 199 | * @return InvoiceEntity 200 | */ 201 | public function getInvoice() { 202 | return $this->invoice; 203 | } 204 | 205 | /** 206 | * @param InvoiceEntity $invoice 207 | */ 208 | public function setInvoice(InvoiceEntity $invoice) 209 | { 210 | $this->invoice = $invoice; 211 | } 212 | 213 | /** 214 | * @return InvoiceLookupEntity 215 | */ 216 | public function getInvoiceLookup() 217 | { 218 | return $this->invoiceLookup; 219 | } 220 | 221 | /** 222 | * @param InvoiceLookupEntity $invoiceLookup 223 | */ 224 | public function setInvoiceLookup(InvoiceLookupEntity $invoiceLookup) 225 | { 226 | $this->invoiceLookup = $invoiceLookup; 227 | } 228 | 229 | /** 230 | * @return int 231 | */ 232 | public function getId() 233 | { 234 | return $this->id; 235 | } 236 | 237 | /** 238 | * @param int $id 239 | * @return $this 240 | */ 241 | public function setId($id) 242 | { 243 | $this->id = $id; 244 | return $this; 245 | } 246 | 247 | /** 248 | * @return ItemTaxEntity[] 249 | */ 250 | public function getTaxes() 251 | { 252 | return $this->taxes; 253 | } 254 | 255 | /** 256 | * @param ItemTaxEntity[] $taxes 257 | */ 258 | public function setTaxes($taxes) 259 | { 260 | $this->taxes = $taxes; 261 | } 262 | 263 | /** 264 | * @return string 265 | */ 266 | public function getItemNumber() 267 | { 268 | return $this->itemNumber; 269 | } 270 | 271 | /** 272 | * @param string $itemNumber 273 | * @return $this 274 | */ 275 | public function setItemNumber($itemNumber) 276 | { 277 | $this->itemNumber = $itemNumber; 278 | return $this; 279 | } 280 | 281 | /** 282 | * @return string 283 | */ 284 | public function getUnit() 285 | { 286 | return $this->unit; 287 | } 288 | 289 | /** 290 | * @param string $unit 291 | * @return $this 292 | */ 293 | public function setUnit($unit) 294 | { 295 | $this->unit = $unit; 296 | return $this; 297 | } 298 | 299 | /** 300 | * @return int 301 | */ 302 | public function getUnitType() 303 | { 304 | return $this->unitType; 305 | } 306 | 307 | /** 308 | * @param int $unitType 309 | * @return $this 310 | */ 311 | public function setUnitType($unitType) 312 | { 313 | $this->unitType = $unitType; 314 | return $this; 315 | } 316 | 317 | /** 318 | * @return string 319 | */ 320 | public function getItemDescription() 321 | { 322 | return $this->itemDescription; 323 | } 324 | 325 | /** 326 | * @param string $itemDescription 327 | * @return $this 328 | */ 329 | public function setItemDescription($itemDescription) 330 | { 331 | $this->itemDescription = $itemDescription; 332 | return $this; 333 | } 334 | 335 | /** 336 | * @return float 337 | */ 338 | public function getSubtotalAmount() 339 | { 340 | return $this->subtotalAmount; 341 | } 342 | 343 | /** 344 | * @param float $subtotalAmount 345 | * @return $this 346 | */ 347 | public function setSubtotalAmount($subtotalAmount) 348 | { 349 | $this->subtotalAmount = $subtotalAmount; 350 | return $this; 351 | } 352 | 353 | /** 354 | * @return float 355 | */ 356 | public function getQuantityOrdered() 357 | { 358 | return $this->quantityOrdered; 359 | } 360 | 361 | /** 362 | * @param float $quantityOrdered 363 | * @return $this 364 | */ 365 | public function setQuantityOrdered($quantityOrdered) 366 | { 367 | $this->quantityOrdered = $quantityOrdered; 368 | return $this; 369 | } 370 | 371 | /** 372 | * @return float 373 | */ 374 | public function getQuantityBackOrder() 375 | { 376 | return $this->quantityBackOrder; 377 | } 378 | 379 | /** 380 | * @param float $quantityBackOrder 381 | * @return $this 382 | */ 383 | public function setQuantityBackOrder($quantityBackOrder) 384 | { 385 | $this->quantityBackOrder = $quantityBackOrder; 386 | return $this; 387 | } 388 | 389 | /** 390 | * @return float 391 | */ 392 | public function getItemPrice() 393 | { 394 | return $this->itemPrice; 395 | } 396 | 397 | /** 398 | * @param float $itemPrice 399 | * @return $this 400 | */ 401 | public function setItemPrice($itemPrice) 402 | { 403 | $this->itemPrice = $itemPrice; 404 | return $this; 405 | } 406 | 407 | /** 408 | * @return float 409 | */ 410 | public function getDutyPercentage() 411 | { 412 | return $this->dutyPercentage; 413 | } 414 | 415 | /** 416 | * @param float $dutyPercentage 417 | * @return $this 418 | */ 419 | public function setDutyPercentage($dutyPercentage) 420 | { 421 | $this->dutyPercentage = $dutyPercentage; 422 | return $this; 423 | } 424 | 425 | /** 426 | * @return float 427 | */ 428 | public function getDutyAmount() 429 | { 430 | return $this->dutyAmount; 431 | } 432 | 433 | /** 434 | * @param float $dutyAmount 435 | * @return $this 436 | */ 437 | public function setDutyAmount($dutyAmount) 438 | { 439 | $this->dutyAmount = $dutyAmount; 440 | return $this; 441 | } 442 | 443 | /** 444 | * @return boolean 445 | */ 446 | public function isFreightItem() 447 | { 448 | return $this->isFreightItem; 449 | } 450 | 451 | /** 452 | * @param boolean $isFreightItem 453 | * @return $this 454 | */ 455 | public function setIsFreightItem($isFreightItem) 456 | { 457 | $this->isFreightItem = $isFreightItem; 458 | return $this; 459 | } 460 | 461 | /** 462 | * @return int 463 | */ 464 | public function getTaxCodeId() 465 | { 466 | return $this->taxCodeId; 467 | } 468 | 469 | /** 470 | * @param int $taxCodeId 471 | * @return $this 472 | */ 473 | public function setTaxCodeId($taxCodeId) 474 | { 475 | $this->taxCodeId = $taxCodeId; 476 | return $this; 477 | } 478 | 479 | /** 480 | * @return int 481 | */ 482 | public function getTaxRevision() 483 | { 484 | return $this->taxRevision; 485 | } 486 | 487 | /** 488 | * @param int $taxRevision 489 | * @return $this 490 | */ 491 | public function setTaxRevision($taxRevision) 492 | { 493 | $this->taxRevision = $taxRevision; 494 | return $this; 495 | } 496 | 497 | /** 498 | * @return float 499 | */ 500 | public function getTaxAmount() 501 | { 502 | return $this->taxAmount; 503 | } 504 | 505 | /** 506 | * @param float $taxAmount 507 | * @return $this 508 | */ 509 | public function setTaxAmount($taxAmount) 510 | { 511 | $this->taxAmount = $taxAmount; 512 | return $this; 513 | } 514 | 515 | /** 516 | * @return boolean 517 | */ 518 | public function isTimeSlipItem() 519 | { 520 | return $this->isTimeSlipItem; 521 | } 522 | 523 | /** 524 | * @param boolean $isTimeSlipItem 525 | * @return $this 526 | */ 527 | public function setIsTimeSlipItem($isTimeSlipItem) 528 | { 529 | $this->isTimeSlipItem = $isTimeSlipItem; 530 | return $this; 531 | } 532 | 533 | /** 534 | * @return float 535 | */ 536 | public function getItemBasePrice() 537 | { 538 | return $this->itemBasePrice; 539 | } 540 | 541 | /** 542 | * @param float $itemBasePrice 543 | * @return $this 544 | */ 545 | public function setItemBasePrice($itemBasePrice) 546 | { 547 | $this->itemBasePrice = $itemBasePrice; 548 | return $this; 549 | } 550 | 551 | /** 552 | * @return float 553 | */ 554 | public function getLineDiscountPercentage() 555 | { 556 | return $this->lineDiscountPercentage; 557 | } 558 | 559 | /** 560 | * @param float $lineDiscountPercentage 561 | * @return $this 562 | */ 563 | public function setLineDiscountPercentage($lineDiscountPercentage) 564 | { 565 | $this->lineDiscountPercentage = $lineDiscountPercentage; 566 | return $this; 567 | } 568 | 569 | /** 570 | * @return float 571 | */ 572 | public function getVendorRelationship() 573 | { 574 | return $this->vendorRelationship; 575 | } 576 | 577 | /** 578 | * @param float $vendorRelationship 579 | * @return $this 580 | */ 581 | public function setVendorRelationship($vendorRelationship) 582 | { 583 | $this->vendorRelationship = $vendorRelationship; 584 | return $this; 585 | } 586 | 587 | /** 588 | * @return boolean 589 | */ 590 | public function isVendorToStock() 591 | { 592 | return $this->isVendorToStock; 593 | } 594 | 595 | /** 596 | * @param boolean $isVendorToStock 597 | * @return $this 598 | */ 599 | public function setIsVendorToStock($isVendorToStock) 600 | { 601 | $this->isVendorToStock = $isVendorToStock; 602 | return $this; 603 | } 604 | 605 | /** 606 | * @return boolean 607 | */ 608 | public function isDefaultDescriptionUsed() 609 | { 610 | return $this->isDefaultDescriptionUsed; 611 | } 612 | 613 | /** 614 | * @param boolean $isDefaultDescriptionUsed 615 | * @return $this 616 | */ 617 | public function setIsDefaultDescriptionUsed($isDefaultDescriptionUsed) 618 | { 619 | $this->isDefaultDescriptionUsed = $isDefaultDescriptionUsed; 620 | return $this; 621 | } 622 | } 623 | -------------------------------------------------------------------------------- /src/JournalEntry/JournalEntryEntity.php: -------------------------------------------------------------------------------- 1 | setModificationDate(new DateTime(date('Y-m-d 00:00:00'))); 153 | $this->setModificationTime(new DateTime(date('1899-12-30 H:i:s'))); 154 | } 155 | 156 | /** 157 | * @return int 158 | */ 159 | public function getId() 160 | { 161 | return $this->id; 162 | } 163 | 164 | /** 165 | * @param int $id 166 | * @return $this 167 | */ 168 | public function setId($id) 169 | { 170 | $this->id = $id; 171 | return $this; 172 | } 173 | 174 | /** 175 | * @return DateTime 176 | */ 177 | public function getModificationDate() 178 | { 179 | return $this->modificationDate; 180 | } 181 | 182 | /** 183 | * @param DateTime $modificationDate 184 | * @return $this 185 | */ 186 | public function setModificationDate(DateTime $modificationDate) 187 | { 188 | $this->modificationDate = $modificationDate; 189 | return $this; 190 | } 191 | 192 | /** 193 | * @return DateTime 194 | */ 195 | public function getModificationTime() 196 | { 197 | return $this->modificationTime; 198 | } 199 | 200 | /** 201 | * @param DateTime $modificationTime 202 | * @return $this 203 | */ 204 | public function setModificationTime(DateTime $modificationTime) 205 | { 206 | $this->modificationTime = $modificationTime; 207 | return $this; 208 | } 209 | 210 | /** 211 | * @return DateTime 212 | */ 213 | public function getModificationDatetime() 214 | { 215 | return new DateTime($this->modificationDate->format('Y-m-d') . ' ' . $this->modificationTime->format('H:i:s')); 216 | } 217 | 218 | /** 219 | * @return string 220 | */ 221 | public function getCreatedByUsername() 222 | { 223 | return $this->createdByUsername; 224 | } 225 | 226 | /** 227 | * @param string $createdByUsername 228 | * @return $this 229 | */ 230 | public function setCreatedByUsername($createdByUsername) 231 | { 232 | $this->createdByUsername = $createdByUsername; 233 | return $this; 234 | } 235 | 236 | /** 237 | * @return string 238 | */ 239 | public function getCreatedByOrg() 240 | { 241 | return $this->createdByOrg; 242 | } 243 | 244 | /** 245 | * @param string $createdByOrg 246 | * @return $this 247 | */ 248 | public function setCreatedByOrg($createdByOrg) 249 | { 250 | $this->createdByOrg = $createdByOrg; 251 | return $this; 252 | } 253 | 254 | /** 255 | * @return DateTime 256 | */ 257 | public function getJournalDate() 258 | { 259 | return $this->journalDate; 260 | } 261 | 262 | /** 263 | * @param DateTime $journalDate 264 | * @return $this 265 | */ 266 | public function setJournalDate(DateTime $journalDate) 267 | { 268 | $this->journalDate = $journalDate; 269 | return $this; 270 | } 271 | 272 | /** 273 | * @return int 274 | */ 275 | public function getModuleTag() 276 | { 277 | return $this->moduleTag; 278 | } 279 | 280 | /** 281 | * @param int $moduleTag 282 | * @return $this 283 | */ 284 | public function setModuleTag($moduleTag) 285 | { 286 | $this->moduleTag = $moduleTag; 287 | return $this; 288 | } 289 | 290 | /** 291 | * @return int 292 | */ 293 | public function getJournalEntryType() 294 | { 295 | return $this->journalEntryType; 296 | } 297 | 298 | /** 299 | * @param int $journalEntryType 300 | * @return $this 301 | */ 302 | public function setJournalEntryType($journalEntryType) 303 | { 304 | $this->journalEntryType = $journalEntryType; 305 | return $this; 306 | } 307 | 308 | /** 309 | * @return string 310 | */ 311 | public function getSourceDescription() 312 | { 313 | return $this->sourceDescription; 314 | } 315 | 316 | /** 317 | * @param string $sourceDescription 318 | * @return $this 319 | */ 320 | public function setSourceDescription($sourceDescription) 321 | { 322 | $this->sourceDescription = $sourceDescription; 323 | return $this; 324 | } 325 | 326 | /** 327 | * @return string 328 | */ 329 | public function getCommentDescription() 330 | { 331 | return $this->commentDescription; 332 | } 333 | 334 | /** 335 | * @param string $commentDescription 336 | * @return $this 337 | */ 338 | public function setCommentDescription($commentDescription) 339 | { 340 | $this->commentDescription = $commentDescription; 341 | return $this; 342 | } 343 | 344 | /** 345 | * @return int 346 | */ 347 | public function getCurrencyId() 348 | { 349 | return $this->currencyId; 350 | } 351 | 352 | /** 353 | * @param int $currencyId 354 | * @return $this 355 | */ 356 | public function setCurrencyId($currencyId) 357 | { 358 | $this->currencyId = $currencyId; 359 | return $this; 360 | } 361 | 362 | /** 363 | * @return float 364 | */ 365 | public function getExchangeRate() 366 | { 367 | return $this->exchangeRate; 368 | } 369 | 370 | /** 371 | * @param float $exchangeRate 372 | * @return $this 373 | */ 374 | public function setExchangeRate($exchangeRate) 375 | { 376 | $this->exchangeRate = $exchangeRate; 377 | return $this; 378 | } 379 | 380 | /** 381 | * @return int 382 | */ 383 | public function getRecordId() 384 | { 385 | return $this->recordId; 386 | } 387 | 388 | /** 389 | * @param int $recordId 390 | * @return $this 391 | */ 392 | public function setRecordId($recordId) 393 | { 394 | $this->recordId = $recordId; 395 | return $this; 396 | } 397 | 398 | /** 399 | * @return int 400 | */ 401 | public function getPaymentType() 402 | { 403 | return $this->paymentType; 404 | } 405 | 406 | /** 407 | * @param int $paymentType 408 | * @return $this 409 | */ 410 | public function setPaymentType($paymentType) 411 | { 412 | $this->paymentType = $paymentType; 413 | return $this; 414 | } 415 | 416 | /** 417 | * @return string 418 | */ 419 | public function getAdditionalTransactionComment() 420 | { 421 | return $this->additionalTransactionComment; 422 | } 423 | 424 | /** 425 | * @param string $additionalTransactionComment 426 | * @return $this 427 | */ 428 | public function setAdditionalTransactionComment($additionalTransactionComment) 429 | { 430 | $this->additionalTransactionComment = $additionalTransactionComment; 431 | return $this; 432 | } 433 | 434 | /** 435 | * @return DateTime 436 | */ 437 | public function getAdditionalTransactionDate() 438 | { 439 | return $this->additionalTransactionDate; 440 | } 441 | 442 | /** 443 | * @param DateTime $additionalTransactionDate 444 | * @return $this 445 | */ 446 | public function setAdditionalTransactionDate(DateTime $additionalTransactionDate) 447 | { 448 | $this->additionalTransactionDate = $additionalTransactionDate; 449 | return $this; 450 | } 451 | 452 | /** 453 | * @return boolean 454 | */ 455 | public function isExported() 456 | { 457 | return $this->isExported; 458 | } 459 | 460 | /** 461 | * @param boolean $isExported 462 | * @return $this 463 | */ 464 | public function setIsExported($isExported) 465 | { 466 | $this->isExported = $isExported; 467 | return $this; 468 | } 469 | 470 | /** 471 | * @return int 472 | */ 473 | public function getCompanyId() 474 | { 475 | return $this->companyId; 476 | } 477 | 478 | /** 479 | * @param int $companyId 480 | * @return $this 481 | */ 482 | public function setCompanyId($companyId) 483 | { 484 | $this->companyId = $companyId; 485 | return $this; 486 | } 487 | 488 | /** 489 | * @return boolean 490 | */ 491 | public function isPostedByAccountantEdition() 492 | { 493 | return $this->isPostedByAccountantEdition; 494 | } 495 | 496 | /** 497 | * @param boolean $isPostedByAccountantEdition 498 | * @return $this 499 | */ 500 | public function setIsPostedByAccountantEdition($isPostedByAccountantEdition) 501 | { 502 | $this->isPostedByAccountantEdition = $isPostedByAccountantEdition; 503 | return $this; 504 | } 505 | 506 | /** 507 | * @return boolean 508 | */ 509 | public function isImportedFromAccountantEdition() 510 | { 511 | return $this->isImportedFromAccountantEdition; 512 | } 513 | 514 | /** 515 | * @param boolean $isImportedFromAccountantEdition 516 | * @return $this 517 | */ 518 | public function setIsImportedFromAccountantEdition($isImportedFromAccountantEdition) 519 | { 520 | $this->isImportedFromAccountantEdition = $isImportedFromAccountantEdition; 521 | return $this; 522 | } 523 | 524 | /** 525 | * @return boolean 526 | */ 527 | public function isPostedAfterYearEnd() 528 | { 529 | return $this->isPostedAfterYearEnd; 530 | } 531 | 532 | /** 533 | * @param boolean $isPostedAfterYearEnd 534 | * @return $this 535 | */ 536 | public function setIsPostedAfterYearEnd($isPostedAfterYearEnd) 537 | { 538 | $this->isPostedAfterYearEnd = $isPostedAfterYearEnd; 539 | return $this; 540 | } 541 | 542 | /** 543 | * @return boolean 544 | */ 545 | public function isPostedBeforeYearStart() 546 | { 547 | return $this->isPostedBeforeYearStart; 548 | } 549 | 550 | /** 551 | * @param boolean $isPostedBeforeYearStart 552 | * @return $this 553 | */ 554 | public function setIsPostedBeforeYearStart($isPostedBeforeYearStart) 555 | { 556 | $this->isPostedBeforeYearStart = $isPostedBeforeYearStart; 557 | return $this; 558 | } 559 | } 560 | -------------------------------------------------------------------------------- /src/SalesOrder/Item/ItemEntity.php: -------------------------------------------------------------------------------- 1 | salesOrderId; 189 | } 190 | 191 | /** 192 | * @param int $salesOrderId 193 | * @return $this 194 | */ 195 | public function setSalesOrderId($salesOrderId) 196 | { 197 | $this->salesOrderId = $salesOrderId; 198 | return $this; 199 | } 200 | 201 | /** 202 | * @return int 203 | */ 204 | public function getId() 205 | { 206 | return $this->id; 207 | } 208 | 209 | /** 210 | * @param int $id 211 | * @return $this 212 | */ 213 | public function setId($id) 214 | { 215 | $this->id = $id; 216 | return $this; 217 | } 218 | 219 | /** 220 | * @return SalesOrderEntity 221 | */ 222 | public function getSalesOrder() 223 | { 224 | return $this->salesOrder; 225 | } 226 | 227 | /** 228 | * @param SalesOrderEntity $salesOrder 229 | * @return $this 230 | */ 231 | public function setSalesOrder($salesOrder) 232 | { 233 | $this->salesOrder = $salesOrder; 234 | return $this; 235 | } 236 | 237 | /** 238 | * @return ItemTaxEntity[] 239 | */ 240 | public function getTaxes() 241 | { 242 | return $this->taxes; 243 | } 244 | 245 | /** 246 | * @param ItemTaxEntity[] $taxes 247 | */ 248 | public function setTaxes($taxes) 249 | { 250 | $this->taxes = $taxes; 251 | } 252 | 253 | /** 254 | * @return int 255 | */ 256 | public function getInventoryId() 257 | { 258 | return $this->inventoryId; 259 | } 260 | 261 | /** 262 | * @param int $inventoryId 263 | * @return $this 264 | */ 265 | public function setInventoryId($inventoryId) 266 | { 267 | $this->inventoryId = $inventoryId; 268 | return $this; 269 | } 270 | 271 | /** 272 | * @return string 273 | */ 274 | public function getItemNumber() 275 | { 276 | return $this->itemNumber; 277 | } 278 | 279 | /** 280 | * @param string $itemNumber 281 | * @return $this 282 | */ 283 | public function setItemNumber($itemNumber) 284 | { 285 | $this->itemNumber = $itemNumber; 286 | return $this; 287 | } 288 | 289 | /** 290 | * @return float 291 | */ 292 | public function getQuantityReceived() 293 | { 294 | return $this->quantityReceived; 295 | } 296 | 297 | /** 298 | * @param float $quantityReceived 299 | * @return $this 300 | */ 301 | public function setQuantityReceived($quantityReceived) 302 | { 303 | $this->quantityReceived = $quantityReceived; 304 | return $this; 305 | } 306 | 307 | /** 308 | * @return float 309 | */ 310 | public function getQuantityOrdered() 311 | { 312 | return $this->quantityOrdered; 313 | } 314 | 315 | /** 316 | * @param float $quantityOrdered 317 | * @return $this 318 | */ 319 | public function setQuantityOrdered($quantityOrdered) 320 | { 321 | $this->quantityOrdered = $quantityOrdered; 322 | return $this; 323 | } 324 | 325 | /** 326 | * @return float 327 | */ 328 | public function getQuantityBackOrder() 329 | { 330 | return $this->quantityBackOrder; 331 | } 332 | 333 | /** 334 | * @param float $quantityBackOrder 335 | * @return $this 336 | */ 337 | public function setQuantityBackOrder($quantityBackOrder) 338 | { 339 | $this->quantityBackOrder = $quantityBackOrder; 340 | return $this; 341 | } 342 | 343 | /** 344 | * @return string 345 | */ 346 | public function getUnit() 347 | { 348 | return $this->unit; 349 | } 350 | 351 | /** 352 | * @param string $unit 353 | * @return $this 354 | */ 355 | public function setUnit($unit) 356 | { 357 | $this->unit = $unit; 358 | return $this; 359 | } 360 | 361 | /** 362 | * @return int 363 | */ 364 | public function getUnitType() 365 | { 366 | return $this->unitType; 367 | } 368 | 369 | /** 370 | * @param int $unitType 371 | * @return $this 372 | */ 373 | public function setUnitType($unitType) 374 | { 375 | $this->unitType = $unitType; 376 | return $this; 377 | } 378 | 379 | /** 380 | * @return string 381 | */ 382 | public function getItemDescription() 383 | { 384 | return $this->itemDescription; 385 | } 386 | 387 | /** 388 | * @param string $itemDescription 389 | * @return $this 390 | */ 391 | public function setItemDescription($itemDescription) 392 | { 393 | $this->itemDescription = $itemDescription; 394 | return $this; 395 | } 396 | 397 | /** 398 | * @return float 399 | */ 400 | public function getItemPrice() 401 | { 402 | return $this->itemPrice; 403 | } 404 | 405 | /** 406 | * @param float $itemPrice 407 | * @return $this 408 | */ 409 | public function setItemPrice($itemPrice) 410 | { 411 | $this->itemPrice = $itemPrice; 412 | return $this; 413 | } 414 | 415 | /** 416 | * @return int 417 | */ 418 | public function getTaxCodeId() 419 | { 420 | return $this->taxCodeId; 421 | } 422 | 423 | /** 424 | * @param int $taxCodeId 425 | * @return $this 426 | */ 427 | public function setTaxCodeId($taxCodeId) 428 | { 429 | $this->taxCodeId = $taxCodeId; 430 | return $this; 431 | } 432 | 433 | /** 434 | * @return int 435 | */ 436 | public function getTaxRevision() 437 | { 438 | return $this->taxRevision; 439 | } 440 | 441 | /** 442 | * @param int $taxRevision 443 | * @return $this 444 | */ 445 | public function setTaxRevision($taxRevision) 446 | { 447 | $this->taxRevision = $taxRevision; 448 | return $this; 449 | } 450 | 451 | /** 452 | * @return boolean 453 | */ 454 | public function isFreightLine() 455 | { 456 | return $this->isFreightLine; 457 | } 458 | 459 | /** 460 | * @param boolean $isFreightLine 461 | * @return $this 462 | */ 463 | public function setFreightLine($isFreightLine) 464 | { 465 | $this->isFreightLine = $isFreightLine; 466 | return $this; 467 | } 468 | 469 | /** 470 | * @return float 471 | */ 472 | public function getAmount() 473 | { 474 | return $this->amount; 475 | } 476 | 477 | /** 478 | * @param float $amount 479 | * @return $this 480 | */ 481 | public function setAmount($amount) 482 | { 483 | $this->amount = $amount; 484 | return $this; 485 | } 486 | 487 | /** 488 | * @return int 489 | */ 490 | public function getAccountId() 491 | { 492 | return $this->accountId; 493 | } 494 | 495 | /** 496 | * @param int $accountId 497 | * @return $this 498 | */ 499 | public function setAccountId($accountId) 500 | { 501 | $this->accountId = $accountId; 502 | return $this; 503 | } 504 | 505 | /** 506 | * @return boolean 507 | */ 508 | public function isInventoryItem() 509 | { 510 | return $this->isInventoryItem; 511 | } 512 | 513 | /** 514 | * @param boolean $isInventoryItem 515 | * @return $this 516 | */ 517 | public function setIsInventoryItem($isInventoryItem) 518 | { 519 | $this->isInventoryItem = $isInventoryItem; 520 | return $this; 521 | } 522 | 523 | /** 524 | * @return int 525 | */ 526 | public function getAccountDepartmentId() 527 | { 528 | return $this->accountDepartmentId; 529 | } 530 | 531 | /** 532 | * @param int $accountDepartmentId 533 | * @return $this 534 | */ 535 | public function setAccountDepartmentId($accountDepartmentId) 536 | { 537 | $this->accountDepartmentId = $accountDepartmentId; 538 | return $this; 539 | } 540 | 541 | /** 542 | * @return int 543 | */ 544 | public function getInventoryLocationId() 545 | { 546 | return $this->inventoryLocationId; 547 | } 548 | 549 | /** 550 | * @param int $inventoryLocationId 551 | * @return $this 552 | */ 553 | public function setInventoryLocationId($inventoryLocationId) 554 | { 555 | $this->inventoryLocationId = $inventoryLocationId; 556 | return $this; 557 | } 558 | 559 | /** 560 | * @return boolean 561 | */ 562 | public function isDefaultPrice() 563 | { 564 | return $this->isDefaultPrice; 565 | } 566 | 567 | /** 568 | * @param boolean $isDefaultPrice 569 | * @return $this 570 | */ 571 | public function setIsDefaultPrice($isDefaultPrice) 572 | { 573 | $this->isDefaultPrice = $isDefaultPrice; 574 | return $this; 575 | } 576 | 577 | /** 578 | * @return int 579 | */ 580 | public function getPriceListId() 581 | { 582 | return $this->priceListId; 583 | } 584 | 585 | /** 586 | * @param int $priceListId 587 | * @return $this 588 | */ 589 | public function setPriceListId($priceListId) 590 | { 591 | $this->priceListId = $priceListId; 592 | return $this; 593 | } 594 | 595 | /** 596 | * @return float 597 | */ 598 | public function getItemBasePrice() 599 | { 600 | return $this->itemBasePrice; 601 | } 602 | 603 | /** 604 | * @param float $itemBasePrice 605 | * @return $this 606 | */ 607 | public function setItemBasePrice($itemBasePrice) 608 | { 609 | $this->itemBasePrice = $itemBasePrice; 610 | return $this; 611 | } 612 | 613 | /** 614 | * @return float 615 | */ 616 | public function getLineDiscountPercentage() 617 | { 618 | return $this->lineDiscountPercentage; 619 | } 620 | 621 | /** 622 | * @param float $lineDiscountPercentage 623 | * @return $this 624 | */ 625 | public function setLineDiscountPercentage($lineDiscountPercentage) 626 | { 627 | $this->lineDiscountPercentage = $lineDiscountPercentage; 628 | return $this; 629 | } 630 | 631 | /** 632 | * @return boolean 633 | */ 634 | public function isDefaultBasePrice() 635 | { 636 | return $this->isDefaultBasePrice; 637 | } 638 | 639 | /** 640 | * @param boolean $isDefaultBasePrice 641 | * @return $this 642 | */ 643 | public function setIsDefaultBasePrice($isDefaultBasePrice) 644 | { 645 | $this->isDefaultBasePrice = $isDefaultBasePrice; 646 | return $this; 647 | } 648 | } 649 | -------------------------------------------------------------------------------- /src/Invoice/InvoiceLookup/InvoiceLookupEntity.php: -------------------------------------------------------------------------------- 1 | invoiceId; 248 | } 249 | 250 | /** 251 | * @param int $invoiceId 252 | * @return $this 253 | */ 254 | public function setInvoiceId($invoiceId) 255 | { 256 | $this->invoiceId = $invoiceId; 257 | return $this; 258 | } 259 | 260 | /** 261 | * @return InvoiceEntity 262 | */ 263 | public function getInvoice() 264 | { 265 | return $this->invoice; 266 | } 267 | 268 | /** 269 | * @param InvoiceEntity $invoice 270 | */ 271 | public function setInvoice($invoice) 272 | { 273 | $this->invoice = $invoice; 274 | } 275 | 276 | /** 277 | * @return ItemEntity[] 278 | */ 279 | public function getItems() 280 | { 281 | return $this->items; 282 | } 283 | 284 | /** 285 | * @param ItemEntity[] $items 286 | * @return $this 287 | */ 288 | public function setItems($items) 289 | { 290 | $this->items = $items; 291 | return $this; 292 | } 293 | 294 | /** 295 | * @return TotalTaxesEntity[] 296 | */ 297 | public function getTotalTaxes() 298 | { 299 | return $this->totalTaxes; 300 | } 301 | 302 | /** 303 | * @param TotalTaxesEntity[] $totalTaxes 304 | */ 305 | public function setTotalTaxes($totalTaxes) 306 | { 307 | $this->totalTaxes = $totalTaxes; 308 | } 309 | 310 | /** 311 | * @return string 312 | */ 313 | public function getCustomerName() 314 | { 315 | return $this->customerName; 316 | } 317 | 318 | /** 319 | * @param string $customerName 320 | * @return $this 321 | */ 322 | public function setCustomerName($customerName) 323 | { 324 | $this->customerName = $customerName; 325 | return $this; 326 | } 327 | 328 | /** 329 | * @return string 330 | */ 331 | public function getBillingAddress1() 332 | { 333 | return $this->billingAddress1; 334 | } 335 | 336 | /** 337 | * @param string $billingAddress1 338 | * @return $this 339 | */ 340 | public function setBillingAddress1($billingAddress1) 341 | { 342 | $this->billingAddress1 = $billingAddress1; 343 | return $this; 344 | } 345 | 346 | /** 347 | * @return string 348 | */ 349 | public function getBillingAddress2() 350 | { 351 | return $this->billingAddress2; 352 | } 353 | 354 | /** 355 | * @param string $billingAddress2 356 | * @return $this 357 | */ 358 | public function setBillingAddress2($billingAddress2) 359 | { 360 | $this->billingAddress2 = $billingAddress2; 361 | return $this; 362 | } 363 | 364 | /** 365 | * @return string 366 | */ 367 | public function getBillingAddress3() 368 | { 369 | return $this->billingAddress3; 370 | } 371 | 372 | /** 373 | * @param string $billingAddress3 374 | * @return $this 375 | */ 376 | public function setBillingAddress3($billingAddress3) 377 | { 378 | $this->billingAddress3 = $billingAddress3; 379 | return $this; 380 | } 381 | 382 | /** 383 | * @return string 384 | */ 385 | public function getBillingAddress4() 386 | { 387 | return $this->billingAddress4; 388 | } 389 | 390 | /** 391 | * @param string $billingAddress4 392 | * @return $this 393 | */ 394 | public function setBillingAddress4($billingAddress4) 395 | { 396 | $this->billingAddress4 = $billingAddress4; 397 | return $this; 398 | } 399 | 400 | /** 401 | * @return string 402 | */ 403 | public function getBillingAddress5() 404 | { 405 | return $this->billingAddress5; 406 | } 407 | 408 | /** 409 | * @param string $billingAddress5 410 | * @return $this 411 | */ 412 | public function setBillingAddress5($billingAddress5) 413 | { 414 | $this->billingAddress5 = $billingAddress5; 415 | return $this; 416 | } 417 | 418 | /** 419 | * @return string 420 | */ 421 | public function getShippingAddress1() 422 | { 423 | return $this->shippingAddress1; 424 | } 425 | 426 | /** 427 | * @param string $shippingAddress1 428 | * @return $this 429 | */ 430 | public function setShippingAddress1($shippingAddress1) 431 | { 432 | $this->shippingAddress1 = $shippingAddress1; 433 | return $this; 434 | } 435 | 436 | /** 437 | * @return string 438 | */ 439 | public function getShippingAddress2() 440 | { 441 | return $this->shippingAddress2; 442 | } 443 | 444 | /** 445 | * @param string $shippingAddress2 446 | * @return $this 447 | */ 448 | public function setShippingAddress2($shippingAddress2) 449 | { 450 | $this->shippingAddress2 = $shippingAddress2; 451 | return $this; 452 | } 453 | 454 | /** 455 | * @return string 456 | */ 457 | public function getShippingAddress3() 458 | { 459 | return $this->shippingAddress3; 460 | } 461 | 462 | /** 463 | * @param string $shippingAddress3 464 | * @return $this 465 | */ 466 | public function setShippingAddress3($shippingAddress3) 467 | { 468 | $this->shippingAddress3 = $shippingAddress3; 469 | return $this; 470 | } 471 | 472 | /** 473 | * @return string 474 | */ 475 | public function getShippingAddress4() 476 | { 477 | return $this->shippingAddress4; 478 | } 479 | 480 | /** 481 | * @param string $shippingAddress4 482 | * @return $this 483 | */ 484 | public function setShippingAddress4($shippingAddress4) 485 | { 486 | $this->shippingAddress4 = $shippingAddress4; 487 | return $this; 488 | } 489 | 490 | /** 491 | * @return string 492 | */ 493 | public function getShippingAddress5() 494 | { 495 | return $this->shippingAddress5; 496 | } 497 | 498 | /** 499 | * @param string $shippingAddress5 500 | * @return $this 501 | */ 502 | public function setShippingAddress5($shippingAddress5) 503 | { 504 | $this->shippingAddress5 = $shippingAddress5; 505 | return $this; 506 | } 507 | 508 | /** 509 | * @return string 510 | */ 511 | public function getShippingAddress6() 512 | { 513 | return $this->shippingAddress6; 514 | } 515 | 516 | /** 517 | * @param string $shippingAddress6 518 | * @return $this 519 | */ 520 | public function setShippingAddress6($shippingAddress6) 521 | { 522 | $this->shippingAddress6 = $shippingAddress6; 523 | return $this; 524 | } 525 | 526 | /** 527 | * @return float 528 | */ 529 | public function getTotalAmount() 530 | { 531 | return $this->totalAmount; 532 | } 533 | 534 | /** 535 | * @param float $totalAmount 536 | * @return $this 537 | */ 538 | public function setTotalAmount($totalAmount) 539 | { 540 | $this->totalAmount = $totalAmount; 541 | return $this; 542 | } 543 | 544 | /** 545 | * @return int 546 | */ 547 | public function getTimeSlipSortMethod() 548 | { 549 | return $this->timeSlipSortMethod; 550 | } 551 | 552 | /** 553 | * @param int $timeSlipSortMethod 554 | * @return $this 555 | */ 556 | public function setTimeSlipSortMethod($timeSlipSortMethod) 557 | { 558 | $this->timeSlipSortMethod = $timeSlipSortMethod; 559 | return $this; 560 | } 561 | 562 | /** 563 | * @return DateTime 564 | */ 565 | public function getTimeSlipConsolidationStartDate() 566 | { 567 | return $this->timeSlipConsolidationStartDate; 568 | } 569 | 570 | /** 571 | * @param DateTime $timeSlipConsolidationStartDate 572 | * @return $this 573 | */ 574 | public function setTimeSlipConsolidationStartDate(DateTime $timeSlipConsolidationStartDate) 575 | { 576 | $this->timeSlipConsolidationStartDate = $timeSlipConsolidationStartDate; 577 | return $this; 578 | } 579 | 580 | /** 581 | * @return DateTime 582 | */ 583 | public function getTimeSlipConsolidationEndDate() 584 | { 585 | return $this->timeSlipConsolidationEndDate; 586 | } 587 | 588 | /** 589 | * @param DateTime $timeSlipConsolidationEndDate 590 | * @return $this 591 | */ 592 | public function setTimeSlipConsolidationEndDate(DateTime $timeSlipConsolidationEndDate) 593 | { 594 | $this->timeSlipConsolidationEndDate = $timeSlipConsolidationEndDate; 595 | return $this; 596 | } 597 | 598 | /** 599 | * @return string 600 | */ 601 | public function getOrderNumber() 602 | { 603 | return $this->orderNumber; 604 | } 605 | 606 | /** 607 | * @param string $orderNumber 608 | * @return $this 609 | */ 610 | public function setOrderNumber($orderNumber) 611 | { 612 | $this->orderNumber = $orderNumber; 613 | return $this; 614 | } 615 | 616 | /** 617 | * @return string 618 | */ 619 | public function getShipperName() 620 | { 621 | return $this->shipperName; 622 | } 623 | 624 | /** 625 | * @param string $shipperName 626 | * @return $this 627 | */ 628 | public function setShipperName($shipperName) 629 | { 630 | $this->shipperName = $shipperName; 631 | return $this; 632 | } 633 | 634 | /** 635 | * @return string 636 | */ 637 | public function getTrackingNumber() 638 | { 639 | return $this->trackingNumber; 640 | } 641 | 642 | /** 643 | * @param string $trackingNumber 644 | * @return $this 645 | */ 646 | public function setTrackingNumber($trackingNumber) 647 | { 648 | $this->trackingNumber = $trackingNumber; 649 | return $this; 650 | } 651 | 652 | /** 653 | * @return int 654 | */ 655 | public function getAccountId() 656 | { 657 | return $this->accountId; 658 | } 659 | 660 | /** 661 | * @param int $accountId 662 | * @return $this 663 | */ 664 | public function setAccountId($accountId) 665 | { 666 | $this->accountId = $accountId; 667 | return $this; 668 | } 669 | 670 | /** 671 | * @return boolean 672 | */ 673 | public function isProjectAllocationByAmount() 674 | { 675 | return $this->projectAllocationByAmount; 676 | } 677 | 678 | /** 679 | * @param boolean $projectAllocationByAmount 680 | * @return $this 681 | */ 682 | public function setProjectAllocationByAmount($projectAllocationByAmount) 683 | { 684 | $this->projectAllocationByAmount = $projectAllocationByAmount; 685 | return $this; 686 | } 687 | 688 | /** 689 | * @return boolean 690 | */ 691 | public function isLegacyData() 692 | { 693 | return $this->isLegacyData; 694 | } 695 | 696 | /** 697 | * @param boolean $isLegacyData 698 | * 699 | * @return $this 700 | */ 701 | public function setIsLegacyData($isLegacyData) 702 | { 703 | $this->isLegacyData = $isLegacyData; 704 | return $this; 705 | } 706 | 707 | /** 708 | * @return boolean 709 | */ 710 | public function isDeleted() 711 | { 712 | return $this->isDeleted; 713 | } 714 | 715 | /** 716 | * @param boolean $isDeleted 717 | * 718 | * @return $this 719 | */ 720 | public function setIsDeleted($isDeleted) 721 | { 722 | $this->isDeleted = $isDeleted; 723 | return $this; 724 | } 725 | 726 | /** 727 | * @return boolean 728 | */ 729 | public function isNotArrived() 730 | { 731 | return $this->isNotArrived; 732 | } 733 | 734 | /** 735 | * @param boolean $isNotArrived 736 | * @return $this 737 | */ 738 | public function setIsNotArrived($isNotArrived) 739 | { 740 | $this->isNotArrived = $isNotArrived; 741 | return $this; 742 | } 743 | 744 | /** 745 | * @return boolean 746 | */ 747 | public function isFromSalesOrder() 748 | { 749 | return $this->isFromSalesOrder; 750 | } 751 | 752 | /** 753 | * @param boolean $isFromSalesOrder 754 | * @return $this 755 | */ 756 | public function setIsFromSalesOrder($isFromSalesOrder) 757 | { 758 | $this->isFromSalesOrder = $isFromSalesOrder; 759 | return $this; 760 | } 761 | 762 | /** 763 | * @return int 764 | */ 765 | public function getAccountDepartmentId() 766 | { 767 | return $this->accountDepartmentId; 768 | } 769 | 770 | /** 771 | * @param int $accountDepartmentId 772 | * @return $this 773 | */ 774 | public function setAccountDepartmentId($accountDepartmentId) 775 | { 776 | $this->accountDepartmentId = $accountDepartmentId; 777 | return $this; 778 | } 779 | 780 | /** 781 | * @return boolean 782 | */ 783 | public function isProjectAllocationForEntireTransaction() 784 | { 785 | return $this->isProjectAllocationForEntireTransaction; 786 | } 787 | 788 | /** 789 | * @param boolean $isProjectAllocationForEntireTransaction 790 | * 791 | * @return $this 792 | */ 793 | public function setIsProjectAllocationForEntireTransaction($isProjectAllocationForEntireTransaction) 794 | { 795 | $this->isProjectAllocationForEntireTransaction = $isProjectAllocationForEntireTransaction; 796 | return $this; 797 | } 798 | 799 | /** 800 | * @return int 801 | */ 802 | public function getTemplateType() 803 | { 804 | return $this->templateType; 805 | } 806 | 807 | /** 808 | * @param int $templateType 809 | * @return $this 810 | */ 811 | public function setTemplateType($templateType) 812 | { 813 | $this->templateType = $templateType; 814 | return $this; 815 | } 816 | 817 | /** 818 | * @return int 819 | */ 820 | public function getShippingAddressId() 821 | { 822 | return $this->shippingAddressId; 823 | } 824 | 825 | /** 826 | * @param int $shippingAddressId 827 | * @return $this 828 | */ 829 | public function setShippingAddressId($shippingAddressId) 830 | { 831 | $this->shippingAddressId = $shippingAddressId; 832 | return $this; 833 | } 834 | 835 | /** 836 | * @return DateTime 837 | */ 838 | public function getShipDate() 839 | { 840 | return $this->shipDate; 841 | } 842 | 843 | /** 844 | * @param DateTime $shipDate 845 | * @return $this 846 | */ 847 | public function setShipDate(DateTime $shipDate) 848 | { 849 | $this->shipDate = $shipDate; 850 | 851 | return $this; 852 | } 853 | 854 | /** 855 | * @return int 856 | */ 857 | public function getPreferredLanguage() 858 | { 859 | return $this->preferredLanguage; 860 | } 861 | 862 | /** 863 | * @param int $preferredLanguage 864 | * @return $this 865 | */ 866 | public function setPreferredLanguage($preferredLanguage) 867 | { 868 | $this->preferredLanguage = $preferredLanguage; 869 | return $this; 870 | } 871 | 872 | /** 873 | * @return boolean 874 | */ 875 | public function isVendorInventory() 876 | { 877 | return $this->isVendorInventory; 878 | } 879 | 880 | /** 881 | * @param boolean $isVendorInventory 882 | * @return $this 883 | */ 884 | public function setIsVendorInventory($isVendorInventory) 885 | { 886 | $this->isVendorInventory = $isVendorInventory; 887 | return $this; 888 | } 889 | 890 | /** 891 | * @return int 892 | */ 893 | public function getProjectId() 894 | { 895 | return $this->projectId; 896 | } 897 | 898 | /** 899 | * @param int $projectId 900 | * @return $this 901 | */ 902 | public function setProjectId($projectId) 903 | { 904 | $this->projectId = $projectId; 905 | return $this; 906 | } 907 | } 908 | --------------------------------------------------------------------------------