@@ -22,15 +22,17 @@ trait ItemPrice
22
22
* @param $value
23
23
* @param int $priceBase
24
24
* @param string $priceBaseUnit
25
+ * @param int $decimals
26
+ * @param string $format
25
27
* @return array
26
28
*/
27
- public static function addPRISegment ($ qualifier , $ value , $ priceBase = 1 , $ priceBaseUnit = 'PCE ' )
29
+ public static function addPRISegment ($ qualifier , $ value , $ priceBase = 1 , $ priceBaseUnit = 'PCE ' , $ decimals = 2 , $ format = EdiFactNumber:: DECIMAL_COMMA )
28
30
{
29
31
return [
30
32
'PRI ' ,
31
33
[
32
34
$ qualifier ,
33
- EdiFactNumber::convert ($ value ),
35
+ EdiFactNumber::convert ($ value, $ decimals , $ format ),
34
36
'' ,
35
37
'' ,
36
38
(string )$ priceBase ,
@@ -49,11 +51,13 @@ public function getGrossPrice()
49
51
50
52
/**
51
53
* @param string $grossPrice
54
+ * @param string $format
55
+ * @param int $decimals
52
56
* @return $this
53
57
*/
54
- public function setGrossPrice ($ grossPrice )
58
+ public function setGrossPrice ($ grossPrice, $ format = EdiFactNumber:: DECIMAL_COMMA , $ decimals = 2 )
55
59
{
56
- $ this ->grossPrice = self ::addPRISegment ('AAB ' , $ grossPrice );
60
+ $ this ->grossPrice = self ::addPRISegment ('AAB ' , $ grossPrice, 1 , ' PCE ' , $ decimals , $ format );
57
61
$ this ->addKeyToCompose ('grossPrice ' );
58
62
59
63
return $ this ;
@@ -69,11 +73,13 @@ public function getNetPrice()
69
73
70
74
/**
71
75
* @param string $netPrice
76
+ * @param string $format
77
+ * @param int $decimals
72
78
* @return $this
73
79
*/
74
- public function setNetPrice ($ netPrice )
80
+ public function setNetPrice ($ netPrice, $ format = EdiFactNumber:: DECIMAL_COMMA , $ decimals = 2 )
75
81
{
76
- $ this ->netPrice = self ::addPRISegment ('AAA ' , $ netPrice );
82
+ $ this ->netPrice = self ::addPRISegment ('AAA ' , $ netPrice, 1 , ' PCE ' , $ decimals , $ format );
77
83
$ this ->addKeyToCompose ('netPrice ' );
78
84
79
85
return $ this ;
0 commit comments