Differences From Artifact [8af5b583d1]:

To Artifact [dbc9be8854]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

namespace Garradin\Compta;

use \Garradin\DB;
use \Garradin\Utils;
use \Garradin\UserException;

use KD2\ODSWriter;

class Import
{
	protected $header = [
		'Numéro mouvement',
		'Date',
		'Type de mouvement',




|
|
|
|
<







1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
<?php

namespace Garradin\Compta;

use Garradin\DB;
use Garradin\Utils;
use Garradin\UserException;
use Garradin\Config;


class Import
{
	protected $header = [
		'Numéro mouvement',
		'Date',
		'Type de mouvement',
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
	protected function exportName()
	{
		return sprintf('Export comptabilité - %s - %s', Config::getInstance()->get('nom_asso'), date('Y-m-d'));
	}

	public function toCSV($exercice)
	{
		return Utils::toCSV($this->exportName(), $this->export());
	}

	public function toODS($exercice)
	{
		return Utils::toODS($this->exportName(), $this->export());
	}

	public function fromCSV($path)
	{
		if (!file_exists($path) || !is_readable($path))
		{
			throw new \RuntimeException('Fichier inconnu : '.$path);







|




|







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
	protected function exportName()
	{
		return sprintf('Export comptabilité - %s - %s', Config::getInstance()->get('nom_asso'), date('Y-m-d'));
	}

	public function toCSV($exercice)
	{
		return Utils::toCSV($this->exportName(), $this->export($exercice));
	}

	public function toODS($exercice)
	{
		return Utils::toODS($this->exportName(), $this->export($exercice));
	}

	public function fromCSV($path)
	{
		if (!file_exists($path) || !is_readable($path))
		{
			throw new \RuntimeException('Fichier inconnu : '.$path);