-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from Komtet/feature/correction_check_v2_change…
…s#KK-1959 правки по чеку коррекции v2
- Loading branch information
Showing
5 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ komtet-kassa-python-sdk | |
email = '[email protected]' # E-Mail пользователя для отправки электронного чека | ||
phone = '+79992400041' # Телефон пользователя | ||
name = 'Иванов Иван' # Имя пользователя | ||
inn = '516954782202' # Инн пользователя | ||
inn = '5834041042' # Инн пользователя | ||
check.set_client(email=email, phone=phone, name=name, inn=inn) | ||
|
@@ -238,7 +238,7 @@ komtet-kassa-python-sdk | |
# intent = Intent.SELL_RETURN_CORRECTION # Коррекция возврата прихода | ||
# intent = Intent.BUY_RETURN_CORRECTION # Коррекция возврата расхода | ||
check = CorrectionCheck(oid, intent, sno) | ||
check = CorrectionCheck(oid, intent) | ||
# Установка данных компании | ||
check.set_company(payment_address=payment_address, tax_system=tax_system) | ||
|
@@ -256,14 +256,13 @@ komtet-kassa-python-sdk | |
# Установка данных коррекции | ||
check.set_correction_info(correction_type, | ||
'2017-09-28', # Дата документа коррекции в формате 'yyyy-mm-dd' | ||
'K11', # Номер документа коррекции | ||
'Отключение электричества' # Описание коррекции | ||
'31.03.2022', # Дата документа коррекции в формате 'dd.mm.yyyy' | ||
'K11', # Номер документа коррекции | ||
) | ||
# Создаём позицию коррекции | ||
position = Position(name='Товар', price=10, quantity=5, total=50, | ||
measure=measure_type, payment_method=payment_method, | ||
measure=measure, payment_method=payment_method, | ||
payment_object=payment_object, vat=vat_rate) | ||
# Добавляем позицию коррекции | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,7 @@ def test_check(self): | |
check.set_client(email='[email protected]', phone='+79992410085', | ||
name='Иванов Иван', inn='516974792202') | ||
check.add_payment(50) | ||
check.set_correction_info(CorrectionType.INSTRUCTION, '2017-09-28', 'K11', | ||
'Отключение электричества') | ||
check.set_correction_info(CorrectionType.INSTRUCTION, '2017-09-28', 'K11') | ||
position = Position(name='Товар', price=10, quantity=5, total=50, | ||
measure=MesureTypes.PIECE, payment_method=PaymentMethod.FULL_PAYMENT, | ||
payment_object=PaymentObject.PRODUCT, vat=VatRate.RATE_NO) | ||
|
@@ -30,8 +29,7 @@ def test_check(self): | |
'correction_info': { | ||
'type': 'instruction', | ||
'base_date': '2017-09-28', | ||
'base_number': 'K11', | ||
'base_name': 'Отключение электричества' | ||
'base_number': 'K11' | ||
}, | ||
'company': { | ||
'payment_address': 'ул. им Дедушки на деревне д.5', | ||
|
@@ -69,6 +67,28 @@ def test_check(self): | |
for key, value in check: | ||
self.assertEqual(expected[key], value) | ||
|
||
def test_correction_info(self): | ||
''' | ||
Тест информации о коррекции | ||
''' | ||
check = CorrectionCheck(3, Intent.SELL_CORRECTION) | ||
check.set_correction_info(CorrectionType.SELF, '2017-09-28', 'K11') | ||
|
||
self.assertEqual(check['correction_info']['type'], 'self') | ||
self.assertEqual(check['correction_info']['base_date'], '2017-09-28') | ||
self.assertEqual(check['correction_info']['base_number'], 'K11') | ||
|
||
def test_correction_info_without_base_number(self): | ||
''' | ||
Тест информации о коррекции без номера документа основания для коррекции | ||
''' | ||
check = CorrectionCheck(3, Intent.SELL_CORRECTION) | ||
check.set_correction_info(CorrectionType.INSTRUCTION, '2022-09-28') | ||
|
||
self.assertEqual(check['correction_info']['type'], 'instruction') | ||
self.assertEqual(check['correction_info']['base_date'], '2022-09-28') | ||
|
||
|
||
def test_additional_user_props(self): | ||
''' | ||
Тест дополнительных параметров чека | ||
|