Skip to content

Commit 6244c3a

Browse files
authored
Merge pull request #36 from ezoterik/feature
SellReceipt: Добавлена возможность указывать поле related_receipt_id
2 parents 745a141 + 38a9567 commit 6244c3a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/Mappers/Receipts/SellReceiptMapper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ public function objectToJson(SellReceipt $receipt): array
3131
$output['id'] = $receipt->id;
3232
}
3333

34+
if ($receipt->related_receipt_id) {
35+
$output['related_receipt_id'] = $receipt->related_receipt_id;
36+
}
37+
3438
return $output;
3539
}
3640
}

src/Models/Receipts/SellReceipt.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class SellReceipt
3333
* @var string|null
3434
*/
3535
public $id;
36+
/** @var string $related_receipt_id */
37+
public $related_receipt_id;
3638

3739
public function __construct(
3840
string $cashier_name,
@@ -44,7 +46,8 @@ public function __construct(
4446
string $header = '',
4547
string $footer = '',
4648
string $barcode = '',
47-
string $id = ''
49+
string $id = '',
50+
string $related_receipt_id = ''
4851
) {
4952
$this->id = $id;
5053
$this->cashier_name = $cashier_name;
@@ -56,5 +59,6 @@ public function __construct(
5659
$this->header = $header;
5760
$this->footer = $footer;
5861
$this->barcode = $barcode;
62+
$this->related_receipt_id = $related_receipt_id;
5963
}
6064
}

0 commit comments

Comments
 (0)