-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjednavkaPrijata.php
More file actions
57 lines (52 loc) · 1.41 KB
/
ObjednavkaPrijata.php
File metadata and controls
57 lines (52 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace AbraFlexi\Processor\Plugins;
/**
* Order processing Class
*
* @author vitex
*/
class ObjednavkaPrijata extends \AbraFlexi\Processor\Plugin
{
public $evidence = 'objednavka-prijata';
/**
* Invoice was created
*
* @return boolean operation success
*/
public function create()
{
$this->addStatusMessage(sprintf(
'New Order %s %s was created',
$this->getDataValue('typDokl'),
$this->getDataValue('kod')
) . ' ' . $this->getDataValue('firma')->showAs . ' ' . $this->getDataValue('sumCelkem') . ' ' . $this->getDataValue('mena')->showAs);
return true;
}
/**
* Invoice was updated. What to do now ?
*
* @return boolean Change was processed. Ok remeber it
*/
public function update()
{
$this->addStatusMessage(sprintf('Processing Updated Order %s ', $this->getDataValue('kod')));
return true;
}
/**
* Discover current MetaState
*
* @return int
*/
public function getMetaState()
{
try {
$changes = $this->getChanges();
} catch (\AbraFlexi\Exception $exc) {
$changes = [];
}
if (array_key_exists('poznam', $changes) && strlen($changes['poznam'])) {
$this->metaState = 'NOTE';
}
return is_null($this->metaState) ? $this->operation : $this->metaState;
}
}