Skip to content

Commit

Permalink
Merge pull request #2 from alex-kub/task_2912
Browse files Browse the repository at this point in the history
Добавление поля LineAttribute
  • Loading branch information
ilgiz-badamshin authored Apr 1, 2022
2 parents 206e843 + 110ed50 commit feb174f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/data_objects/Line.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Platron\Starrys\data_objects;

use Platron\Starrys\handbooks\AgentModes;
use Platron\Starrys\handbooks\LineAttributeTypes;
use Platron\Starrys\handbooks\PayAttributeTypes;
use Platron\Starrys\handbooks\Taxes;

Expand All @@ -15,6 +16,8 @@ class Line extends BaseDataObject{
/** @var int */
protected $PayAttribute;
/** @var int */
protected $LineAttribute;
/** @var int */
protected $TaxId;
/** @var string */
protected $Description;
Expand Down Expand Up @@ -54,6 +57,15 @@ public function addPayAttribute(PayAttributeTypes $payAttributeType){
$this->PayAttribute = $payAttributeType->getValue();
}

/**
* Признак предмета расчёта.
* @param LineAttributeTypes $lineAttributeType
*/
public function addLineAttribute(LineAttributeTypes $lineAttributeType)
{
$this->LineAttribute = $lineAttributeType->getValue();
}

/**
* @param $subTotal
*/
Expand Down Expand Up @@ -109,4 +121,5 @@ public function addNomenclatureCode($nomenclatureCode)
{
$this->CGNFloat = $nomenclatureCode;
}

}
23 changes: 23 additions & 0 deletions src/handbooks/LineAttributeTypes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Platron\Starrys\handbooks;

use MyCLabs\Enum\Enum;

class LineAttributeTypes extends Enum
{
const
PRODUCT = 1,
TAX_PRODUCT = 2,
WORK = 3,
SERVICE = 4,
GAMBLING_RATE = 5,
GAMBLING_WINNING = 6,
LOTTERY_TICKET = 7,
LOTTERY_WINNING = 8,
PROVIDING_RID = 9,
PAYMENT = 10,
AGENT_COMMISSION = 11,
COMPOUND = 12,
OTHER = 13;
}
2 changes: 2 additions & 0 deletions tests/integration/ComplexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Platron\Starrys\data_objects\TransferOperatorData;
use Platron\Starrys\handbooks\AgentModes;
use Platron\Starrys\handbooks\DocumentTypes;
use Platron\Starrys\handbooks\LineAttributeTypes;
use Platron\Starrys\handbooks\PayAttributeTypes;
use Platron\Starrys\handbooks\Taxes;
use Platron\Starrys\handbooks\TaxModes;
Expand All @@ -34,6 +35,7 @@ private function createLine()
{
$line = new Line('Test product', 1, 10.00, new Taxes(Taxes::VAT10));
$line->addPayAttribute(new PayAttributeTypes(PayAttributeTypes::FULL_PAID_WITH_GET_PRODUCT));
$line->addLineAttribute(new LineAttributeTypes(LineAttributeTypes::PRODUCT));

$agentData = new AgentData('Test operation', '79050000000');
$line->addAgentData($agentData);
Expand Down

0 comments on commit feb174f

Please sign in to comment.