chore: import enterprise addons 19.0 bulk snapshot

This commit is contained in:
1b-agent committed 2026-09-16 10:13:08 +00:00
commit ca4af030d3
39951 files changed
+15570005

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import common
from . import test_live
from . import test_mocked
+228
View File
@@ -0,0 +1,228 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import os
import json
from unittest import mock
import contextlib
import requests
import logging
import time
from odoo import Command, fields
from odoo.tools.misc import file_open
from odoo.addons.account.tests.test_account_move_send import TestAccountMoveSendCommon
from odoo.addons.base.models.ir_cron import IrCron
_logger = logging.getLogger(__name__)
class TestKeEdiCommon(TestAccountMoveSendCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.is_live_test = False
cls.parent_cmc_key = os.getenv('KE_PARENT_CMC_KEY', 'cmc_key')
cls.branch_cmc_key = os.getenv('KE_BRANCH_CMC_KEY', 'cmc_key')
cls.company_data['company'].write({
'vat': 'P052112956W',
'l10n_ke_branch_code': '00',
'l10n_ke_server_mode': 'test',
'l10n_ke_oscu_cmc_key': cls.parent_cmc_key,
'l10n_ke_oscu_user_agreement': True,
})
# 20 * (seconds since epoch) modulo 2^31-1 is a pretty good initializer that leaves space for 20 invoices
# and also happens to fit in an int32. Note that 2^31 - 1 is a prime number! ;)
cls.sale_sequence_number = (int(time.time()) * 10) % (2**31 - 1)
cls.partner_a.write({
'name': 'Ralph Jr',
'street': 'The Cucumber Lounge',
'city': 'Vineland',
'zip': '00500',
'country_id': cls.env.ref('base.ke').id,
'vat': 'A000123456F',
})
cls.standard_rate_sales_tax = cls.env['account.chart.template'].ref('ST16')
cls.standard_rate_purchase_tax = cls.env['account.chart.template'].ref('PT16')
cls.reduced_rate_sales_tax = cls.env['account.chart.template'].ref('ST8')
cls.reduced_rate_purchase_tax = cls.env['account.chart.template'].ref('PT8')
cls.product_service = cls.env['product.product'].create([{
'name': 'Fiscal Optimization Consultancy',
'type': 'service',
'taxes_id': [Command.set(cls.standard_rate_sales_tax.ids)],
'supplier_taxes_id': [Command.set(cls.standard_rate_purchase_tax.ids)],
'standard_price': 100.0,
'l10n_ke_product_type_code': '3',
'l10n_ke_origin_country_id': cls.env.ref('base.ke').id,
'unspsc_code_id': cls.env['product.unspsc.code'].search([
('code', '=', '81121500'),
], limit=1).id,
'l10n_ke_packaging_unit_id': cls.env.ref('l10n_ke_edi_oscu.code_17_OU').id,
'l10n_ke_packaging_quantity': 1,
}])
currency_eur = cls.env.ref('base.EUR')
currency_eur.active = True
cls.env['res.currency.rate'].create({
'name': fields.Date.today(),
'currency_id': currency_eur.id,
'company_id': cls.company_data['company'].id,
'inverse_company_rate': '100.00',
})
cls.excise_tax = cls.env['account.tax'].create({
'name': 'Excise tax',
'amount_type': 'percent',
'amount': 30.0,
'country_id': cls.company_data['company'].account_fiscal_country_id.id,
'tax_exigibility': 'on_invoice',
'price_include_override': 'tax_included',
'include_base_amount': True,
'invoice_repartition_line_ids': [
Command.create({'repartition_type': 'base'}),
Command.create({
'repartition_type': 'tax',
'account_id': cls.company_data['default_account_tax_sale'].id,
}),
],
'refund_repartition_line_ids': [
Command.create({'repartition_type': 'base'}),
Command.create({
'repartition_type': 'tax',
'account_id': cls.company_data['default_account_tax_sale'].id,
}),
],
})
def _test_create_branches(self):
parent = self.company_data['company']
parent.action_l10n_ke_create_branches()
branches = self.env['res.company'].search([('parent_id', '=', parent.id)])
self.assertTrue(branches[0].name.startswith('KAKAMEGA'))
self.assertTrue(branches[1].name.startswith('MOMBASA'))
expected_branches = [
{
'vat': 'P052112956W',
'l10n_ke_branch_code': '02',
},
{
'vat': 'P052112956W',
'l10n_ke_branch_code': '01',
},
]
self.assertRecordValues(branches, expected_branches)
for branch in branches:
branch.write({'country_id': self.env.ref('base.ke')})
(self.product_a | self.product_b).with_company(branch).write({'standard_price': 30})
@contextlib.contextmanager
def patch_session(self, responses):
""" Patch requests.Session in l10n_ke_edi_oscu/models/company.py """
def replace_ignore(dict_to_replace):
""" Replace `___ignore___` in the expected request JSONs by unittest.mock.ANY,
which is equal to everything. """
for k, v in dict_to_replace.items():
if v == '___ignore___':
dict_to_replace[k] = mock.ANY
return dict_to_replace
self.maxDiff = None
test_case = self
json_module = json
responses = iter(responses)
class MockedSession:
def __init__(self):
self.headers = {}
def post(self, url, json=None, timeout=None):
expected_service, expected_request_filename, response_filename = next(responses)
_, _, service = url.rpartition('/')
test_case.assertEqual(service, expected_service)
stock_services = (
'insertStockIO',
'saveStockMaster',
'selectImportItemList',
'selectItemList',
'updateImportItem',
)
module = 'l10n_ke_edi_oscu_stock' if service in stock_services else 'l10n_ke_edi_oscu'
with file_open(f'{module}/tests/expected_requests/{expected_request_filename}.json', 'rb') as expected_request_file:
try:
test_case.assertEqual(json_module.loads(expected_request_file.read(), object_hook=replace_ignore), json)
except AssertionError:
_logger.error('Unexpected request JSON for service %s', service)
raise
mock_response = mock.Mock(spec=requests.Response)
mock_response.status_code = 200
mock_response.headers = ''
with file_open(f'{module}/tests/mocked_responses/{response_filename}.json', 'rb') as response_file:
mock_response.content = response_file.read()
mock_response.text = mock_response.content.decode()
mock_response.json.side_effect = lambda: json_module.loads(mock_response.content)
return mock_response
with mock.patch('odoo.addons.l10n_ke_edi_oscu.models.res_company.requests.Session', side_effect=MockedSession, autospec=True) as mock_session:
yield mock_session
try:
next(responses)
except StopIteration:
pass
else:
test_case.fail('Not all expected calls were made!')
@contextlib.contextmanager
def patch_cron_trigger(self):
""" Decorator for patching ir.cron.trigger so that the cron gets run right after this context manager's exit. """
crons_to_trigger = []
def mock_trigger(cron, at=None):
crons_to_trigger.append(cron)
with mock.patch.object(IrCron, '_trigger', side_effect=mock_trigger, autospec=True) as mocked_trigger:
yield mocked_trigger
# Run cron as current user (not superuser) to limit ourselves to the test company
self.env.invalidate_all()
self.env['ir.cron'].union(*crons_to_trigger).ir_actions_server_id.run()
def create_reversal(self, invoice, is_modify=False):
""" Create a credit note that reverses an invoice. """
wizard_vals = {'journal_id': invoice.journal_id.id}
wizard_reverse = self.env['account.move.reversal'].with_context(active_ids=invoice.ids, active_model='account.move').create(wizard_vals)
wizard_reverse.write({
'reason': 'Return',
'l10n_ke_reason_code_id': self.env.ref('l10n_ke_edi_oscu.code_32_06').id,
})
wizard_reverse.reverse_moves(is_modify=is_modify)
return wizard_reverse.new_move_ids
@classmethod
@contextlib.contextmanager
def set_invoice_number(cls, invoice):
if not invoice.is_sale_document():
raise NotImplementedError('`set_invoice_number` is only needed for out_invoice / out_refund!')
sequence = invoice._l10n_ke_get_invoice_sequence()
sequence.number_next_actual = cls.sale_sequence_number
try:
yield
finally:
cls.sale_sequence_number = sequence.number_next
@@ -0,0 +1,3 @@
{
"lastReqDt": "___ignore___"
}
@@ -0,0 +1,3 @@
{
"custmTin": "A000123456F"
}
@@ -0,0 +1,3 @@
{
"lastReqDt": "___ignore___"
}
@@ -0,0 +1,3 @@
{
"invcNo": "___ignore___"
}
@@ -0,0 +1,3 @@
{
"lastReqDt": "___ignore___"
}
@@ -0,0 +1,12 @@
{
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"custNo": "___ignore___",
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya",
"email": "partner_a@tsointsoin",
"useYn": "Y"
}
@@ -0,0 +1,10 @@
{
"isrccCd": false,
"isrccNm": false,
"isrcRt": 0.0,
"useYn": "Y",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___"
}
@@ -0,0 +1,18 @@
{
"itemCd": "___ignore___",
"itemClsCd": "81121500",
"itemTyCd": "3",
"itemNm": "Fiscal Optimization Consultancy",
"orgnNatCd": "KE",
"pkgUnitCd": "OU",
"qtyUnitCd": "U",
"taxTyCd": "B",
"bcd": null,
"dftPrc": 100.0,
"isrcAplcbYn": "N",
"useYn": "Y",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___"
}
@@ -0,0 +1,18 @@
{
"itemCd": "___ignore___",
"itemClsCd": "52161557",
"itemTyCd": "2",
"itemNm": "Zaxxon machine",
"orgnNatCd": "BE",
"pkgUnitCd": "SK",
"qtyUnitCd": "U",
"taxTyCd": "B",
"bcd": null,
"dftPrc": 30.0,
"isrcAplcbYn": "N",
"useYn": "Y",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___"
}
@@ -0,0 +1,18 @@
{
"itemCd": "___ignore___",
"itemClsCd": "30171613",
"itemTyCd": "1",
"itemNm": "Windowpane",
"orgnNatCd": "BE",
"pkgUnitCd": "CR",
"qtyUnitCd": "DZ",
"taxTyCd": "E",
"bcd": null,
"dftPrc": 30.0,
"isrcAplcbYn": "N",
"useYn": "Y",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___"
}
@@ -0,0 +1,18 @@
{
"itemCd": "___ignore___",
"itemClsCd": "25181700",
"itemTyCd": "1",
"itemNm": "Bottom loading adaptor AL handle",
"orgnNatCd": "NL",
"pkgUnitCd": "CR",
"qtyUnitCd": "U",
"taxTyCd": "B",
"bcd": null,
"dftPrc": 500.0,
"isrcAplcbYn": "N",
"useYn": "Y",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___"
}
@@ -0,0 +1,62 @@
{
"spplrTin": "A000123456F",
"spplrNm": "Ralph Jr",
"spplrBhfId": "00",
"spplrInvcNo": "123",
"pmtTyCd": "01",
"totItemCnt": 1,
"taxblAmtA": 0,
"taxRtA": 0,
"taxAmtA": 0,
"taxblAmtB": 17499,
"taxRtB": 16,
"taxAmtB": 2799.84,
"taxblAmtC": 0,
"taxRtC": 0,
"taxAmtC": 0,
"taxblAmtD": 0,
"taxRtD": 0,
"taxAmtD": 0,
"taxblAmtE": 0,
"taxRtE": 8,
"taxAmtE": 0,
"totTaxblAmt": 17499,
"totTaxAmt": 2799.84,
"totAmt": 20298.84,
"invcNo": "___ignore___",
"orgInvcNo": 0,
"regTyCd": "A",
"pchsTyCd": "N",
"pchsSttsCd": "02",
"pchsDt": "20231212",
"cfmDt": "20240415030000",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "81121500",
"itemNm": "Fiscal Optimization Consultancy",
"bcd": null,
"pkgUnitCd": "OU",
"pkg": 1,
"qtyUnitCd": "U",
"qty": 1,
"prc": 17499,
"splyAmt": 17499,
"dcRt": 0,
"dcAmt": 0,
"taxTyCd": "B",
"taxblAmt": 17499,
"taxAmt": 2799.84,
"totAmt": 20298.84,
"spplrItemCd": "JP2CRU00000001",
"supplrItemNm": "Fiscal Optimization Consultancy",
"spplrItemClsCd": "81121500"
}
],
"rcptTyCd": "P"
}
@@ -0,0 +1,84 @@
{
"spplrTin": "A000123456F",
"spplrNm": "Ralph Jr",
"spplrBhfId": "00",
"spplrInvcNo": "123",
"pmtTyCd": "01",
"totItemCnt": 2,
"taxblAmtA": 0,
"taxRtA": 0,
"taxAmtA": 0,
"taxblAmtB": 17499,
"taxRtB": 16,
"taxAmtB": 2799.84,
"taxblAmtC": 0,
"taxRtC": 0,
"taxAmtC": 0,
"taxblAmtD": 0,
"taxRtD": 0,
"taxAmtD": 0,
"taxblAmtE": 0,
"taxRtE": 8,
"taxAmtE": 0,
"totTaxblAmt": 17499,
"totTaxAmt": 2799.84,
"totAmt": 20298.84,
"invcNo": "___ignore___",
"orgInvcNo": 0,
"regTyCd": "A",
"pchsTyCd": "N",
"pchsSttsCd": "02",
"pchsDt": "20231212",
"cfmDt": "20240415030000",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"itemList": [
{
"itemSeq": 1,
"itemClsCd": "52161557",
"itemNm": "Zaxxon machine",
"pkgUnitCd": "CR",
"bcd": null,
"pkg": 0,
"qtyUnitCd": "U",
"qty": 1,
"prc": 17499,
"splyAmt": 17499,
"dcRt": 0,
"dcAmt": 0,
"taxblAmt": 17499,
"taxTyCd": "B",
"taxAmt": 2799.84,
"totAmt": 20298.84,
"itemCd": "___ignore___",
"spplrItemCd": "JP2CRU00000001",
"supplrItemNm": "Zaxxon machine",
"spplrItemClsCd": "52161557"
},
{
"itemSeq": 2,
"itemClsCd": "30171613",
"itemNm": "window pane",
"pkgUnitCd": "CR",
"bcd": null,
"pkg": 0,
"qtyUnitCd": "ST",
"qty": 12,
"prc": 5000,
"splyAmt": 60000,
"dcRt": 10,
"dcAmt": 6000,
"taxTyCd": "E",
"taxblAmt": 54000,
"taxAmt": 4320.0,
"totAmt": 58320.0,
"itemCd": "___ignore___",
"spplrItemCd": "DE2CRST0000001",
"supplrItemNm": "window pane",
"spplrItemClsCd": "30171613"
}
],
"rcptTyCd": "P"
}
@@ -0,0 +1,57 @@
{
"invcNo": "1",
"trdInvcNo": "___ignore___",
"orgInvcNo": 0,
"cfmDt": "20240415030000",
"pmtTyCd": "05",
"rcptTyCd": "P",
"taxblAmtA": 0.0,
"taxblAmtB": 0.0,
"taxblAmtC": 1000.0,
"taxblAmtD": 0.0,
"taxblAmtE": 0.0,
"taxAmtA": 0.0,
"taxAmtB": 0.0,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 0.0,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 1000.0,
"totTaxAmt": 0.0,
"totAmt": 1000.0,
"totItemCnt": 1,
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "25181700",
"itemNm": "___ignore___",
"pkgUnitCd": "CR",
"pkg": 2.0,
"qtyUnitCd": "U",
"qty": 2.0,
"prc": 500.0,
"splyAmt": 1000.0,
"dcRt": 0.0,
"dcAmt": 0.0,
"taxTyCd": "C",
"taxblAmt": 1000.0,
"taxAmt": 0.0,
"totAmt": 1000.0
}
],
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"spplrTin": "NL800672835",
"spplrNm": "OPW Fluid Transfer Group EU B.V",
"regTyCd": "M",
"pchsTyCd": "N",
"pchsSttsCd": "02",
"pchsDt": "20240415"
}
@@ -0,0 +1,63 @@
{
"invcNo": "___ignore___",
"trdInvcNo": "___ignore___",
"orgInvcNo": "___ignore___",
"cfmDt": "20240415030000",
"pmtTyCd": "",
"rcptTyCd": "R",
"taxblAmtA": 0.0,
"taxblAmtB": 0.9,
"taxblAmtC": 0.0,
"taxblAmtD": 0.0,
"taxblAmtE": 0.0,
"taxAmtA": 0.0,
"taxAmtB": 0.14,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 0.0,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 0.9,
"totTaxAmt": 0.14,
"totAmt": 1.04,
"totItemCnt": 1,
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "81121500",
"itemNm": "Fiscal Optimization Consultancy",
"pkgUnitCd": "OU",
"pkg": 1.0,
"qtyUnitCd": "U",
"qty": 1.0,
"prc": 1.0,
"splyAmt": 1.0,
"dcRt": 10.0,
"dcAmt": 0.1,
"taxTyCd": "B",
"taxblAmt": 0.9,
"taxAmt": 0.14,
"totAmt": 1.04
}
],
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"salesSttsCd": "02",
"salesDt": "20240415",
"prchrAcptcYn": "Y",
"receipt": {
"custTin": "A000123456F",
"rcptPbctDt": "20240415030000",
"prchrAcptcYn": "N",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya"
},
"rfdRsnCd": "06"
}
@@ -0,0 +1,81 @@
{
"invcNo": "___ignore___",
"trdInvcNo": "___ignore___",
"orgInvcNo": "___ignore___",
"cfmDt": "20240415030000",
"pmtTyCd": "",
"rcptTyCd": "R",
"taxblAmtA": 0.0,
"taxblAmtB": 900.0,
"taxblAmtC": 0.0,
"taxblAmtD": 0.0,
"taxblAmtE": 200.0,
"taxAmtA": 0.0,
"taxAmtB": 144.0,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 16.0,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 1100.0,
"totTaxAmt": 160.0,
"totAmt": 1260.0,
"totItemCnt": 2,
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "52161557",
"itemNm": "Zaxxon machine",
"pkgUnitCd": "SK",
"pkg": 0.2,
"qtyUnitCd": "U",
"qty": 1.0,
"prc": 1000.0,
"splyAmt": 1000.0,
"dcRt": 10.0,
"dcAmt": 100.0,
"taxTyCd": "B",
"taxblAmt": 900.0,
"taxAmt": 144.0,
"totAmt": 1044.0
},
{
"itemSeq": 2,
"itemCd": "___ignore___",
"itemClsCd": "30171613",
"itemNm": "Windowpane",
"pkgUnitCd": "CR",
"pkg": 1.0,
"qtyUnitCd": "DZ",
"qty": 1.0,
"prc": 200.0,
"splyAmt": 200.0,
"dcRt": 0.0,
"dcAmt": 0.0,
"taxTyCd": "E",
"taxblAmt": 200.0,
"taxAmt": 16.0,
"totAmt": 216.0
}
],
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"salesSttsCd": "02",
"salesDt": "20240415",
"prchrAcptcYn": "Y",
"receipt": {
"custTin": "A000123456F",
"rcptPbctDt": "20240415030000",
"prchrAcptcYn": "N",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya"
},
"rfdRsnCd": "06"
}
@@ -0,0 +1,62 @@
{
"invcNo": "___ignore___",
"trdInvcNo": "___ignore___",
"orgInvcNo": 0,
"cfmDt": "20240415030000",
"pmtTyCd": "",
"rcptTyCd": "S",
"taxblAmtA": 0.0,
"taxblAmtB": 0.9,
"taxblAmtC": 0.0,
"taxblAmtD": 0.0,
"taxblAmtE": 0.0,
"taxAmtA": 0.0,
"taxAmtB": 0.14,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 0.0,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 0.9,
"totTaxAmt": 0.14,
"totAmt": 1.04,
"totItemCnt": 1,
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "81121500",
"itemNm": "Fiscal Optimization Consultancy",
"pkgUnitCd": "OU",
"pkg": 1.0,
"qtyUnitCd": "U",
"qty": 1.0,
"prc": 1.0,
"splyAmt": 1.0,
"dcRt": 10.0,
"dcAmt": 0.1,
"taxTyCd": "B",
"taxblAmt": 0.9,
"taxAmt": 0.14,
"totAmt": 1.04
}
],
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"salesSttsCd": "02",
"salesDt": "20240128",
"prchrAcptcYn": "Y",
"receipt": {
"custTin": "A000123456F",
"rcptPbctDt": "20240415030000",
"prchrAcptcYn": "N",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya"
}
}
@@ -0,0 +1,80 @@
{
"invcNo": "___ignore___",
"trdInvcNo": "___ignore___",
"orgInvcNo": 0,
"cfmDt": "20240415030000",
"pmtTyCd": "",
"rcptTyCd": "S",
"taxblAmtA": 0.0,
"taxblAmtB": 900.0,
"taxblAmtC": 0.0,
"taxblAmtD": 0.0,
"taxblAmtE": 200.0,
"taxAmtA": 0.0,
"taxAmtB": 144.0,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 16.0,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 1100.0,
"totTaxAmt": 160.0,
"totAmt": 1260.0,
"totItemCnt": 2,
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "52161557",
"itemNm": "Zaxxon machine",
"pkgUnitCd": "SK",
"pkg": 0.2,
"qtyUnitCd": "U",
"qty": 1.0,
"prc": 1000.0,
"splyAmt": 1000.0,
"dcRt": 10.0,
"dcAmt": 100.0,
"taxTyCd": "B",
"taxblAmt": 900.0,
"taxAmt": 144.0,
"totAmt": 1044.0
},
{
"itemSeq": 2,
"itemCd": "___ignore___",
"itemClsCd": "30171613",
"itemNm": "Windowpane",
"pkgUnitCd": "CR",
"pkg": 1.0,
"qtyUnitCd": "DZ",
"qty": 1.0,
"prc": 200.0,
"splyAmt": 200.0,
"dcRt": 0.0,
"dcAmt": 0.0,
"taxTyCd": "E",
"taxblAmt": 200.0,
"taxAmt": 16.0,
"totAmt": 216.0
}
],
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"salesSttsCd": "02",
"salesDt": "20240128",
"prchrAcptcYn": "Y",
"receipt": {
"custTin": "A000123456F",
"rcptPbctDt": "20240415030000",
"prchrAcptcYn": "N",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya"
}
}
@@ -0,0 +1,80 @@
{
"invcNo": "___ignore___",
"trdInvcNo": "___ignore___",
"orgInvcNo": 0,
"cfmDt": "20240415030000",
"pmtTyCd": "",
"rcptTyCd": "S",
"taxblAmtA": 0.0,
"taxblAmtB": 1800.0,
"taxblAmtC": 0.0,
"taxblAmtD": 0.0,
"taxblAmtE": 360.0,
"taxAmtA": 0.0,
"taxAmtB": 288.0,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 28.8,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 2160.0,
"totTaxAmt": 316.8,
"totAmt": 2476.8,
"totItemCnt": 2,
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "52161557",
"itemNm": "Zaxxon machine",
"pkgUnitCd": "SK",
"pkg": 0.4,
"qtyUnitCd": "U",
"qty": 2.0,
"prc": 1000.0,
"splyAmt": 2000.0,
"dcRt": 10.0,
"dcAmt": 200.0,
"taxTyCd": "B",
"taxblAmt": 1800.0,
"taxAmt": 288.0,
"totAmt": 2088.0
},
{
"itemSeq": 2,
"itemCd": "___ignore___",
"itemClsCd": "30171613",
"itemNm": "Windowpane",
"pkgUnitCd": "CR",
"pkg": 2.0,
"qtyUnitCd": "DZ",
"qty": 2.0,
"prc": 200.0,
"splyAmt": 400.0,
"dcRt": 10.0,
"dcAmt": 40.0,
"taxTyCd": "E",
"taxblAmt": 360.0,
"taxAmt": 28.8,
"totAmt": 388.8
}
],
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"salesSttsCd": "02",
"salesDt": "20240128",
"prchrAcptcYn": "Y",
"receipt": {
"custTin": "A000123456F",
"rcptPbctDt": "20240415030000",
"prchrAcptcYn": "N",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya"
}
}
@@ -0,0 +1,62 @@
{
"invcNo": "___ignore___",
"trdInvcNo": "___ignore___",
"orgInvcNo": 0,
"cfmDt": "20240415030000",
"pmtTyCd": "",
"rcptTyCd": "S",
"taxblAmtA": 0.0,
"taxblAmtB": 200000.0,
"taxblAmtC": 0.0,
"taxblAmtD": 0.0,
"taxblAmtE": 0.0,
"taxAmtA": 0.0,
"taxAmtB": 32000.0,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 0.0,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 200000.0,
"totTaxAmt": 72000.0,
"totAmt": 272000.0,
"totItemCnt": 1,
"itemList": [
{
"itemSeq": 1,
"itemCd": "___ignore___",
"itemClsCd": "81121500",
"itemNm": "Fiscal Optimization Consultancy",
"pkgUnitCd": "OU",
"pkg": 2.0,
"qtyUnitCd": "U",
"qty": 2.0,
"prc": 100000.0,
"splyAmt": 200000.0,
"dcRt": 0.0,
"dcAmt": 0.0,
"taxTyCd": "B",
"taxblAmt": 200000.0,
"taxAmt": 32000.0,
"totAmt": 232000.0
}
],
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___",
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"salesSttsCd": "02",
"salesDt": "20240415",
"prchrAcptcYn": "Y",
"receipt": {
"custTin": "A000123456F",
"rcptPbctDt": "20240415030000",
"prchrAcptcYn": "N",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya"
}
}
@@ -0,0 +1,10 @@
{
"userId": "___ignore___",
"userNm": "accountman",
"pwd": "test",
"useYn": "Y",
"regrId": "___ignore___",
"regrNm": "___ignore___",
"modrId": "___ignore___",
"modrNm": "___ignore___"
}
@@ -0,0 +1,51 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240429120433",
"data": {
"bhfList": [
{
"tin": "P052112956W",
"bhfId": "00",
"bhfNm": "Headquarter",
"bhfSttsCd": "01",
"prvncNm": "Nairobi",
"dstrtNm": "Westlands District",
"sctrNm": "Westlands",
"locDesc": null,
"mgrNm": "ODOO KE LTD",
"mgrTelNo": "0797790885",
"mgrEmail": "[email protected]",
"hqYn": "Y"
},
{
"tin": "P052112956W",
"bhfId": "01",
"bhfNm": "MOMBASA (Mock)",
"bhfSttsCd": "01",
"prvncNm": "Mombasa",
"dstrtNm": "Mombasa North District",
"sctrNm": "Ganjoni",
"locDesc": "A",
"mgrNm": "A",
"mgrTelNo": "0711111111",
"mgrEmail": "[email protected]",
"hqYn": "N"
},
{
"tin": "P052112956W",
"bhfId": "02",
"bhfNm": "KAKAMEGA (Mock)",
"bhfSttsCd": "01",
"prvncNm": "Kakamega",
"dstrtNm": "Kakamega East District",
"sctrNm": "Kakamega East",
"locDesc": "A",
"mgrNm": "A",
"mgrTelNo": "0700000000",
"mgrEmail": "[email protected]",
"hqYn": "N"
}
]
}
}
@@ -0,0 +1,131 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240424114721",
"data": {
"clsList": [
{
"cdCls": "04",
"cdClsNm": "Taxation Type",
"cdClsDesc": null,
"useYn": "Y",
"userDfnNm1": "Tax Rate",
"userDfnNm2": null,
"userDfnNm3": null,
"dtlList": [
{
"cd": "A",
"cdNm": "A-Exempt",
"cdDesc": "A-Exempt",
"useYn": "Y",
"srtOrd": 1,
"userDfnCd1": "0",
"userDfnCd2": "A-EX",
"userDfnCd3": null
},
{
"cd": "B",
"cdNm": "B-VAT 16%",
"cdDesc": "B-VAT 16%",
"useYn": "Y",
"srtOrd": 2,
"userDfnCd1": "16",
"userDfnCd2": "B-16%",
"userDfnCd3": null
},
{
"cd": "C",
"cdNm": "C-Zero Rated",
"cdDesc": "C-Zero Rated",
"useYn": "Y",
"srtOrd": 3,
"userDfnCd1": "0",
"userDfnCd2": "TAX C",
"userDfnCd3": null
},
{
"cd": "E",
"cdNm": "E-VAT 8%",
"cdDesc": "E-VAT 8%",
"useYn": "Y",
"srtOrd": 4,
"userDfnCd1": "8",
"userDfnCd2": "E-8%",
"userDfnCd3": null
},
{
"cd": "D",
"cdNm": "D-Non VAT",
"cdDesc": "D-Non VAT",
"useYn": "Y",
"srtOrd": 5,
"userDfnCd1": "0",
"userDfnCd2": "TAX D",
"userDfnCd3": null
}
]
},
{
"cdCls": "45",
"cdClsNm": "Tax Office",
"cdClsDesc": null,
"useYn": "Y",
"userDfnNm1": null,
"userDfnNm2": null,
"userDfnNm3": null,
"dtlList": [
{
"cd": "501",
"cdNm": "HQ",
"cdDesc": null,
"useYn": "N",
"srtOrd": 1,
"userDfnCd1": null,
"userDfnCd2": null,
"userDfnCd3": null
},
{
"cd": "52",
"cdNm": "Head Quarters",
"cdDesc": null,
"useYn": "Y",
"srtOrd": 2,
"userDfnCd1": null,
"userDfnCd2": null,
"userDfnCd3": null
},
{
"cd": "30",
"cdNm": "Nairobi Station 1",
"cdDesc": null,
"useYn": "N",
"srtOrd": 3,
"userDfnCd1": null,
"userDfnCd2": null,
"userDfnCd3": null
},
{
"cd": "18",
"cdNm": "KITUI",
"cdDesc": null,
"useYn": "Y",
"srtOrd": 4,
"userDfnCd1": null,
"userDfnCd2": null,
"userDfnCd3": null
},
{
"cd": "37",
"cdNm": "SAMBURU",
"cdDesc": null,
"useYn": "Y",
"srtOrd": 5,
"userDfnCd1": null,
"userDfnCd2": null,
"userDfnCd3": null
}
]
}
]
}
}
@@ -0,0 +1,6 @@
{
"resultCd": "001",
"resultMsg": "There is no search result",
"resultDt": "20240507154417",
"data": null
}
@@ -0,0 +1,75 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240415000000",
"data": {
"salesList": [
{
"invcNo": 2,
"orgInvcNo": 0,
"cfmDt": "20240415030000",
"pmtTyCd": "",
"rcptTyCd": "S",
"taxblAmtA": 0.0,
"taxblAmtB": 0.9,
"taxblAmtC": 0.0,
"taxblAmtD": 0.0,
"taxblAmtE": 0.0,
"taxAmtA": 0.0,
"taxAmtB": 0.14,
"taxAmtC": 0.0,
"taxAmtD": 0.0,
"taxAmtE": 0.0,
"taxRtA": 0.0,
"taxRtB": 16.0,
"taxRtC": 0.0,
"taxRtD": 0.0,
"taxRtE": 8.0,
"totTaxblAmt": 0.9,
"totTaxAmt": 0.14,
"totAmt": 1.04,
"totItemCnt": 1,
"itemList": [
{
"itemSeq": 1,
"itemCd": false,
"itemClsCd": "81121500",
"itemNm": "Fiscal Optimization Consultancy",
"pkgUnitCd": "OU",
"pkg": 1.0,
"qtyUnitCd": "U",
"qty": 1.0,
"prc": 1.0,
"splyAmt": 1.0,
"dcRt": 10.0,
"dcAmt": 0.1,
"taxTyCd": "B",
"taxblAmt": 0.9,
"taxAmt": 0.14,
"totAmt": 1.04
}
],
"regrId": "2",
"regrNm": "Ralph Jr",
"modrId": null,
"modrNm": null,
"custTin": "A000123456F",
"custNm": "Ralph Jr",
"salesSttsCd": "02",
"salesDt": "20240128",
"prchrAcptcYn": "Y",
"receipt": {
"custTin": "A000123456F",
"rcptPbctDt": "20240415030000",
"prchrAcptcYn": "N",
"adrs": "The Cucumber Lounge, Vineland 00500, Kenya",
"curRcptNo": 169,
"totRcptNo": 169,
"intrlData": "GRKJVWYCFBPTYQ225X2UEYONVE",
"rcptSign": "123456789ODOOGR3",
"sdcDateTime": "2024-04-15 15:30:39.0"
}
}
]
}
}
@@ -0,0 +1,17 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240507155015",
"data": {
"noticeList": [
{
"noticeNo": 26,
"title": "Tester",
"cont": "Tester",
"dtlUrl": "http://HOST_IP:PORT/common/link/ebm/receipt/indexEbmNotice?noticeNo=26",
"regrNm": "Admin",
"regDt": "20240429204227"
}
]
}
}
@@ -0,0 +1,63 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240415000000",
"data": {
"saleList": [
{
"spplrTin": "A000123456F",
"spplrNm": "Ralph Jr",
"spplrBhfId": "00",
"spplrInvcNo": "123",
"spplrSdcId": "KRACU0000054321",
"spplrMrcNo": "KRA00000001",
"rcptTyCd": "S",
"pmtTyCd": "01",
"cfmDt": "2023-12-12 15:36:25",
"salesDt": "20231212",
"stockRlsDt": null,
"totItemCnt": 1,
"taxblAmtA": 0,
"taxblAmtB": 17499,
"taxblAmtC": 0,
"taxblAmtD": 0,
"taxblAmtE": 0,
"taxRtA": 0,
"taxRtB": 16,
"taxRtC": 0,
"taxRtD": 0,
"taxRtE": 8,
"taxAmtA": 0,
"taxAmtB": 2799.84,
"taxAmtC": 0,
"taxAmtD": 0,
"taxAmtE": 0,
"totTaxblAmt": 17499,
"totTaxAmt": 2799.84,
"totAmt": 20298.84,
"remark": null,
"itemList": [
{
"itemSeq": 1,
"itemCd": "JP2CRU00000001",
"itemClsCd": "81121500",
"itemNm": "Fiscal Optimization Consultancy",
"bcd": null,
"pkgUnitCd": "OU",
"pkg": 1,
"qtyUnitCd": "U",
"qty": 1,
"prc": 17499,
"splyAmt": 17499,
"dcRt": 0,
"dcAmt": 0,
"taxTyCd": "B",
"taxblAmt": 17499,
"taxAmt": 2799.84,
"totAmt": 20298.84
}
]
}
]
}
}
@@ -0,0 +1,82 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240415000000",
"data": {
"saleList": [
{
"spplrTin": "A000123456F",
"spplrNm": "Ralph Jr",
"spplrBhfId": "00",
"spplrInvcNo": "123",
"spplrSdcId": "KRACU0000054321",
"spplrMrcNo": "KRA00000001",
"rcptTyCd": "S",
"pmtTyCd": "01",
"cfmDt": "2023-12-12 15:36:25",
"salesDt": "20231212",
"stockRlsDt": null,
"totItemCnt": 2,
"taxblAmtA": 0,
"taxblAmtB": 17499,
"taxblAmtC": 0,
"taxblAmtD": 0,
"taxblAmtE": 0,
"taxRtA": 0,
"taxRtB": 16,
"taxRtC": 0,
"taxRtD": 0,
"taxRtE": 8,
"taxAmtA": 0,
"taxAmtB": 2799.84,
"taxAmtC": 0,
"taxAmtD": 0,
"taxAmtE": 0,
"totTaxblAmt": 17499,
"totTaxAmt": 2799.84,
"totAmt": 20298.84,
"remark": null,
"itemList": [
{
"itemSeq": 1,
"itemCd": "JP2CRU00000001",
"itemClsCd": "52161557",
"itemNm": "Zaxxon machine",
"bcd": null,
"pkgUnitCd": "CR",
"pkg": 0,
"qtyUnitCd": "U",
"qty": 1,
"prc": 17499,
"splyAmt": 17499,
"dcRt": 0,
"dcAmt": 0,
"taxTyCd": "B",
"taxblAmt": 17499,
"taxAmt": 2799.84,
"totAmt": 20298.84
},
{
"itemSeq": 2,
"itemCd": "DE2CRST0000001",
"itemClsCd": "30171613",
"itemNm": "window pane",
"bcd": null,
"pkgUnitCd": "CR",
"pkg": 0,
"qtyUnitCd": "ST",
"qty": 12,
"prc": 5000,
"splyAmt": 60000,
"dcRt": 10,
"dcAmt": 6000,
"taxTyCd": "E",
"taxblAmt": 54000,
"taxAmt": 4320.0,
"totAmt": 58320.0
}
]
}
]
}
}
@@ -0,0 +1,480 @@
{
"resultCd":"000",
"resultMsg":"Successful",
"resultDt":"20240226173350",
"data":{
"saleList":[
{
"spplrTin":"P000600883U",
"spplrNm":"Bollore Transport & Logistics Kenya Limited",
"spplrBhfId":"00",
"spplrInvcNo":126,
"spplrSdcId":"KRACU0100000092",
"spplrMrcNo":"KRA00000320",
"rcptTyCd":"S",
"pmtTyCd":"01",
"cfmDt":"2023-12-20 15:36:16",
"salesDt":"20231220",
"stockRlsDt":null,
"totItemCnt":2,
"taxblAmtA":6000,
"taxblAmtB":0,
"taxblAmtC":4000,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":0,
"taxRtC":0,
"taxRtD":0,
"taxRtE":0,
"taxAmtA":0,
"taxAmtB":0,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":10000,
"totTaxAmt":0,
"totAmt":10000,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"BI2CTNKGX0000002",
"itemClsCd":"9901111100",
"itemNm":"Maize-Zero rated",
"bcd":null,
"pkgUnitCd":"CTN",
"pkg":0,
"qtyUnitCd":"KG",
"qty":20,
"prc":200,
"splyAmt":4000,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"C",
"taxblAmt":4000,
"taxAmt":0,
"totAmt":4000
},
{
"itemSeq":2,
"itemCd":"BB2BLXU0000003",
"itemClsCd":"31162905",
"itemNm":"Book- Exempt",
"bcd":null,
"pkgUnitCd":"BL",
"pkg":0,
"qtyUnitCd":"U",
"qty":30,
"prc":200,
"splyAmt":6000,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"A",
"taxblAmt":6000,
"taxAmt":0,
"totAmt":6000
}
]
},
{
"spplrTin":"P000600883U",
"spplrNm":"Bollore Transport & Logistics Kenya Limited",
"spplrBhfId":"00",
"spplrInvcNo":127,
"spplrSdcId":"KRACU0100000092",
"spplrMrcNo":"KRA00000320",
"rcptTyCd":"S",
"pmtTyCd":"01",
"cfmDt":"2023-12-20 15:36:25",
"salesDt":"20231220",
"stockRlsDt":null,
"totItemCnt":2,
"taxblAmtA":0,
"taxblAmtB":10500,
"taxblAmtC":0,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":16,
"taxRtC":0,
"taxRtD":0,
"taxRtE":0,
"taxAmtA":0,
"taxAmtB":1448.28,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":10500,
"totTaxAmt":1448.28,
"totAmt":10500,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"BR2CTXU0000003",
"itemClsCd":"50591922",
"itemNm":"Sugar-16%",
"bcd":null,
"pkgUnitCd":"CT",
"pkg":0,
"qtyUnitCd":"U",
"qty":12,
"prc":500,
"splyAmt":6000,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":6000,
"taxAmt":827.59,
"totAmt":6000
},
{
"itemSeq":2,
"itemCd":"AL2CTXU0000002",
"itemClsCd":"31161503",
"itemNm":"Drill",
"bcd":null,
"pkgUnitCd":"CT",
"pkg":0,
"qtyUnitCd":"U",
"qty":15,
"prc":300,
"splyAmt":4500,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":4500,
"taxAmt":620.69,
"totAmt":4500
}
]
},
{
"spplrTin":"P884256738W",
"spplrNm":"Sirius Cybernetics Corporation",
"spplrBhfId":"00",
"spplrInvcNo":26,
"spplrSdcId":"KRACU5346676758",
"spplrMrcNo": "KRA57683498",
"rcptTyCd":"S",
"pmtTyCd":null,
"cfmDt":"2024-01-09 12:37:48",
"salesDt":"20240109",
"stockRlsDt":null,
"totItemCnt":1,
"taxblAmtA":0,
"taxblAmtB":0.5,
"taxblAmtC":0,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":16,
"taxRtC":0,
"taxRtD":0,
"taxRtE":8,
"taxAmtA":0,
"taxAmtB":0.08,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":0.5,
"totTaxAmt":0.08,
"totAmt":0.58,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"KE2AMU00000000000052",
"itemClsCd":"10101501",
"itemNm":"[CONS_89957] Bolt",
"bcd":null,
"pkgUnitCd":"AM",
"pkg":1,
"qtyUnitCd":"U",
"qty":1,
"prc":0.5,
"splyAmt":0.5,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":0.5,
"taxAmt":0.08,
"totAmt":0.58
}
]
},
{
"spplrTin":"P884256738W",
"spplrNm":"Sirius Cybernetics Corporation",
"spplrBhfId":"00",
"spplrInvcNo":24,
"spplrSdcId":"KRACU5346676758",
"spplrMrcNo": "KRA57683498",
"rcptTyCd":"S",
"pmtTyCd":null,
"cfmDt":"2024-01-09 12:37:48",
"salesDt":"20240109",
"stockRlsDt":null,
"totItemCnt":1,
"taxblAmtA":0,
"taxblAmtB":0.5,
"taxblAmtC":0,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":16,
"taxRtC":0,
"taxRtD":0,
"taxRtE":8,
"taxAmtA":0,
"taxAmtB":0.08,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":0.5,
"totTaxAmt":0.08,
"totAmt":0.58,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"KE2AMU00000000000052",
"itemClsCd":"10101501",
"itemNm":"[CONS_89957] Bolt",
"bcd":null,
"pkgUnitCd":"AM",
"pkg":1,
"qtyUnitCd":"U",
"qty":1,
"prc":0.5,
"splyAmt":0.5,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":0.5,
"taxAmt":0.08,
"totAmt":0.58
}
]
},
{
"spplrTin":"P884256738W",
"spplrNm":"Sirius Cybernetics Corporation",
"spplrBhfId":"00",
"spplrInvcNo":25,
"spplrSdcId":"KRACU5346676758",
"spplrMrcNo": "KRA57683498",
"rcptTyCd":"S",
"pmtTyCd":null,
"cfmDt":"2024-01-09 12:37:48",
"salesDt":"20240109",
"stockRlsDt":null,
"totItemCnt":1,
"taxblAmtA":0,
"taxblAmtB":0.5,
"taxblAmtC":0,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":16,
"taxRtC":0,
"taxRtD":0,
"taxRtE":8,
"taxAmtA":0,
"taxAmtB":0.08,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":0.5,
"totTaxAmt":0.08,
"totAmt":0.58,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"KE2AMU00000000000052",
"itemClsCd":"10101501",
"itemNm":"[CONS_89957] Bolt",
"bcd":null,
"pkgUnitCd":"AM",
"pkg":1,
"qtyUnitCd":"U",
"qty":1,
"prc":0.5,
"splyAmt":0.5,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":0.5,
"taxAmt":0.08,
"totAmt":0.58
}
]
},
{
"spplrTin":"P884256739W",
"spplrNm":"Sirius Cybernetics Corporation",
"spplrBhfId":"02",
"spplrInvcNo":1,
"spplrSdcId":"KRACU5346676759",
"spplrMrcNo": "KRA57683499",
"rcptTyCd":"S",
"pmtTyCd":null,
"cfmDt":"2024-02-02 14:46:17",
"salesDt":"20240202",
"stockRlsDt":null,
"totItemCnt":1,
"taxblAmtA":0,
"taxblAmtB":14700,
"taxblAmtC":0,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":16,
"taxRtC":0,
"taxRtD":0,
"taxRtE":0,
"taxAmtA":0,
"taxAmtB":2352,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":14700,
"totTaxAmt":2352,
"totAmt":17052,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"AD1BEU00000000000016",
"itemClsCd":"10101502",
"itemNm":"[E-COM06] Corner Desk Right Sit",
"bcd":null,
"pkgUnitCd":"BE",
"pkg":100,
"qtyUnitCd":"U",
"qty":100,
"prc":147,
"splyAmt":14700,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":14700,
"taxAmt":2352,
"totAmt":17052
}
]
},
{
"spplrTin":"P884256739W",
"spplrNm":"Sirius Cybernetics Corporation",
"spplrBhfId":"02",
"spplrInvcNo":0,
"spplrSdcId":"KRACU5346676759",
"spplrMrcNo": "KRA57683499",
"rcptTyCd":"S",
"pmtTyCd":null,
"cfmDt":"2024-02-02 14:46:17",
"salesDt":"20240202",
"stockRlsDt":null,
"totItemCnt":1,
"taxblAmtA":0,
"taxblAmtB":14700,
"taxblAmtC":0,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":16,
"taxRtC":0,
"taxRtD":0,
"taxRtE":0,
"taxAmtA":0,
"taxAmtB":2352,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":14700,
"totTaxAmt":2352,
"totAmt":17052,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"AD1BEU00000000000016",
"itemClsCd":"10101502",
"itemNm":"[E-COM06] Corner Desk Right Sit",
"bcd":null,
"pkgUnitCd":"BE",
"pkg":100,
"qtyUnitCd":"U",
"qty":100,
"prc":147,
"splyAmt":14700,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":14700,
"taxAmt":2352,
"totAmt":17052
}
]
},
{
"spplrTin":"P884256738W",
"spplrNm":"Sirius Cybernetics Corporation",
"spplrBhfId":"00",
"spplrInvcNo":70,
"spplrSdcId":"KRACU5346676758",
"spplrMrcNo": "KRA57683498",
"rcptTyCd":"S",
"pmtTyCd":null,
"cfmDt":"2024-02-02 14:11:24",
"salesDt":"20240202",
"stockRlsDt":null,
"totItemCnt":1,
"taxblAmtA":0,
"taxblAmtB":2940,
"taxblAmtC":0,
"taxblAmtD":0,
"taxblAmtE":0,
"taxRtA":0,
"taxRtB":16,
"taxRtC":0,
"taxRtD":0,
"taxRtE":0,
"taxAmtA":0,
"taxAmtB":470.4,
"taxAmtC":0,
"taxAmtD":0,
"taxAmtE":0,
"totTaxblAmt":2940,
"totTaxAmt":470.4,
"totAmt":3410.4,
"remark":null,
"itemList":[
{
"itemSeq":1,
"itemCd":"AD1BEU00000000000016",
"itemClsCd":"10101502",
"itemNm":"[E-COM06] Corner Desk Right Sit",
"bcd":null,
"pkgUnitCd":"BE",
"pkg":20,
"qtyUnitCd":"U",
"qty":20,
"prc":147,
"splyAmt":2940,
"dcRt":0,
"dcAmt":0,
"taxTyCd":"B",
"taxblAmt":2940,
"taxAmt":470.4,
"totAmt":3410.4
}
]
}
]
}
}
@@ -0,0 +1,6 @@
{
"resultCd": "001",
"resultMsg": "There is no search result",
"resultDt": "20240507155823",
"data": null
}
@@ -0,0 +1,33 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240507152128",
"data": {
"itemClsList": [
{
"itemClsCd": "99000000",
"itemClsNm": "VAT Act",
"itemClsLvl": 1,
"taxTyCd": null,
"mjrTgYn": null,
"useYn": "Y"
},
{
"itemClsCd": "99010000",
"itemClsNm": "Goods",
"itemClsLvl": 2,
"taxTyCd": null,
"mjrTgYn": null,
"useYn": "Y"
},
{
"itemClsCd": "80101500",
"itemClsNm": "Business and corporate management consultation services",
"itemClsLvl": 3,
"taxTyCd": null,
"mjrTgYn": null,
"useYn": "Y"
}
]
}
}
@@ -0,0 +1,12 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240415000000",
"data": {
"curRcptNo": 169,
"totRcptNo": 169,
"intrlData": "GRKJVWYCFBPTYQ225X2UEYONVE",
"rcptSign": "123456789ODOOGR3",
"sdcDateTime": "20240415153039"
}
}
@@ -0,0 +1,6 @@
{
"resultCd": "000",
"resultMsg": "Successful",
"resultDt": "20240415000000",
"data": null
}
+221
View File
@@ -0,0 +1,221 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, Command
from odoo.tests import tagged
from odoo.exceptions import UserError
from odoo.addons.l10n_ke_edi_oscu.tests.common import TestKeEdiCommon
class TestKeEdi(TestKeEdiCommon):
def _test_get_items(self):
self.env['ir.config_parameter'].set_param('l10n_ke_oscu.last_fetch_items_request_date', '20180101000000')
with self.assertRaises(UserError):
self.env.company.action_l10n_ke_get_items()
def _test_get_stock_moves(self):
with self.assertRaises(UserError):
self.env.company.action_l10n_ke_get_stock_moves()
def _test_update_codes(self):
self.env['ir.config_parameter'].set_param('l10n_ke_oscu.last_code_request_date', '20180101000000')
self.env['l10n_ke_edi_oscu.code']._cron_get_codes_from_device()
def _test_update_customer(self):
with self.assertRaises(UserError):
self.partner_a.action_l10n_ke_oscu_fetch_bhf_customer()
def _test_update_notices(self):
self.env['ir.config_parameter'].set_param('l10n_ke_oscu.last_notice_request_date', '20180101000000')
with self.enter_registry_test_mode():
self.env.ref('l10n_ke_edi_oscu.ir_cron_fetch_notice').method_direct_trigger()
def _test_update_unspsc_codes(self):
self.env['ir.config_parameter'].set_param('l10n_ke_oscu.last_unspsc_code_request_date', '20180101000000')
with self.enter_registry_test_mode():
self.env.ref('l10n_ke_edi_oscu.ir_cron_fetch_unspsc').method_direct_trigger()
def _test_save_customer(self):
self.partner_a.action_l10n_ke_oscu_register_bhf_customer()
def _test_save_insurance(self):
self.env.company.action_l10n_ke_send_insurance()
def _test_save_item(self):
self.product_service.action_l10n_ke_oscu_save_item()
def _test_save_user(self):
self.env.user.action_l10n_ke_create_branch_user()
def _test_send_invoice_and_credit_note(self):
""" Test that we're able to send an invoice and a credit note """
invoice = self.env['account.move'].create({
'move_type': 'out_invoice',
'partner_id': self.partner_a.id,
'invoice_date': '2024-01-28',
'invoice_line_ids': [Command.create({
'product_id': self.product_service.id,
'discount': 10.0,
})],
})
self.assertFalse(invoice.l10n_ke_validation_message)
invoice.action_post()
send_and_print = self.create_send_and_print(invoice)
self.assertTrue(send_and_print.extra_edi_checkboxes.get('ke_oscu', {}).get('checked'))
with self.set_invoice_number(invoice):
send_and_print.action_send_and_print()
self.assertTrue(invoice.l10n_ke_oscu_invoice_number)
self.assertTrue(invoice.l10n_ke_oscu_receipt_number)
self.assertTrue(invoice.l10n_ke_oscu_internal_data)
credit_note = self.create_reversal(invoice)
self.assertFalse(credit_note.l10n_ke_validation_message)
credit_note.action_post()
send_and_print = self.create_send_and_print(credit_note)
self.assertTrue(send_and_print.extra_edi_checkboxes.get('ke_oscu', {}).get('checked'))
with self.set_invoice_number(credit_note):
send_and_print.action_send_and_print()
self.assertTrue(credit_note.l10n_ke_oscu_invoice_number)
self.assertTrue(credit_note.l10n_ke_oscu_receipt_number)
self.assertTrue(credit_note.l10n_ke_oscu_internal_data)
def _test_send_invoice_complex(self):
""" Test that the invoice JSON generation correctly handles an invoice with:
- a currency (EUR) different from KSh
- an UoM on the invoice line that differs from the UoM on the product
- a round_globally tax setting
- an excise tax included in price, that applies before the VAT, and a withholding tax.
The excise tax amount should appear as part of the base amount, while the withholding tax should not
be reported.
"""
wh_tax = self.env['account.chart.template'].ref('SWT10')
invoice = self.env['account.move'].create({
'move_type': 'out_invoice',
'partner_id': self.partner_a.id,
'invoice_date': fields.Date.today(),
'journal_id': self.company_data['default_journal_sale'].id,
'currency_id': self.env.ref('base.EUR').id,
'invoice_line_ids': [
Command.create({
'product_id': self.product_service.id,
'price_unit': 1300.00, # 1000 base + 300 excise = 1300 EUR.
'quantity': 2,
'tax_ids': [Command.set((self.excise_tax | self.standard_rate_sales_tax | wh_tax).ids)],
})
],
})
self.assertFalse(invoice.l10n_ke_validation_message)
invoice.action_post()
send_and_print = self.create_send_and_print(invoice)
self.assertTrue(send_and_print.extra_edi_checkboxes.get('ke_oscu', {}).get('checked'))
with self.set_invoice_number(invoice):
send_and_print.action_send_and_print()
self.assertTrue(invoice.l10n_ke_oscu_invoice_number)
self.assertTrue(invoice.l10n_ke_oscu_receipt_number)
self.assertTrue(invoice.l10n_ke_oscu_internal_data)
def _test_get_vendor_bill(self):
# Step 1: Get vendor bill
vendor_bill = self.env['account.move']._l10n_ke_oscu_fetch_purchases(self.company_data['company'])
expected_vendor_bill = {
'partner_id': self.partner_a.id,
'move_type': 'in_invoice',
'invoice_date': fields.Date.from_string('2023-12-12'),
}
expected_vendor_bill_lines = [
{
'name': 'Fiscal Optimization Consultancy',
'product_id': self.product_service.id,
'product_uom_id': self.env.ref('uom.product_uom_unit').id,
'quantity': 1,
'tax_ids': [self.standard_rate_purchase_tax.id],
'balance': 17499,
}, {
'name': '16%',
'product_id': None,
'product_uom_id': None,
'quantity': 0,
'tax_ids': [],
'balance': 2799.84,
}, {
'name': False,
'product_id': None,
'product_uom_id': None,
'quantity': 0,
'tax_ids': [],
'balance': -20298.84,
}
]
self.assertInvoiceValues(vendor_bill, expected_vendor_bill_lines, expected_vendor_bill)
return vendor_bill
def _test_confirm_vendor_bill(self, vendor_bill):
# Step 2: send vendor bill confirmation
vendor_bill.l10n_ke_payment_method_id = self.env.ref('l10n_ke_edi_oscu.code_07_05')
self.assertFalse(vendor_bill.l10n_ke_validation_message)
vendor_bill.action_post()
vendor_bill.action_l10n_ke_oscu_confirm_vendor_bill()
self.assertTrue(vendor_bill.l10n_ke_oscu_invoice_number)
@tagged('external', 'external_l10n', 'post_install', '-post_install_l10n', '-at_install', '-standard')
class TestKeEdiLive(TestKeEdi):
@TestKeEdiCommon.setup_country('ke')
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.is_live_test = True
def test_get_items(self):
self._test_get_items()
def test_get_stock_moves(self):
self._test_get_stock_moves()
def test_update_codes(self):
self._test_update_codes()
def test_update_customer(self):
self._test_update_customer()
def test_update_notices(self):
self._test_update_notices()
def test_update_unspsc_codes(self):
self._test_update_unspsc_codes()
def test_save_customer(self):
self._test_save_customer()
def test_save_insurance(self):
self._test_save_insurance()
def test_save_item(self):
self._test_save_item()
def test_save_user(self):
self._test_save_user()
def test_create_branches(self):
self._test_create_branches()
def test_send_invoice_and_credit_note(self):
self._test_send_invoice_and_credit_note()
def test_send_invoice_complex(self):
self._test_send_invoice_complex()
def test_confirm_vendor_bill(self):
# This is mocked because there are no purchases on the test server to retrieve.
with self.patch_session([
('selectTrnsPurchaseSalesList', 'get_purchases', 'get_purchases_1'),
]):
vendor_bill = self._test_get_vendor_bill()
self._test_confirm_vendor_bill(vendor_bill)
+107
View File
@@ -0,0 +1,107 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from freezegun import freeze_time
from odoo.tests import tagged
from odoo.addons.l10n_ke_edi_oscu.tests.test_live import TestKeEdi
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestKeEdiMocked(TestKeEdi):
@classmethod
@TestKeEdi.setup_country('ke')
def setUpClass(cls):
with freeze_time('2024-04-15'):
super().setUpClass()
def test_get_items(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectItemList', 'get_from_last_request', 'get_items'),
]):
self._test_get_items()
def test_get_stock_moves(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectStockMoveList', 'get_from_last_request', 'get_stock_moves'),
]):
self._test_get_stock_moves()
def test_update_codes(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectCodeList', 'get_from_last_request', 'get_codes'),
]):
self._test_update_codes()
def test_update_customer(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectCustomer', 'get_customer', 'get_customer'),
]):
self._test_update_customer()
def test_update_notices(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectNoticeList', 'get_from_last_request', 'get_notices'),
]):
self._test_update_notices()
def test_update_unspsc_codes(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectItemClsList', 'get_from_last_request', 'get_unspsc_codes'),
]):
self._test_update_unspsc_codes()
def test_save_customer(self):
with freeze_time('2024-04-15'), self.patch_session([
('saveBhfCustomer', 'save_customer', 'success'),
]):
self._test_save_customer()
def test_save_insurance(self):
with freeze_time('2024-04-15'), self.patch_session([
('saveBhfInsurance', 'save_insurance', 'success'),
]):
self._test_save_insurance()
def test_save_item(self):
with freeze_time('2024-04-15'), self.patch_session([
('saveItem', 'save_item_0', 'success'),
]):
self._test_save_item()
def test_save_user(self):
with freeze_time('2024-04-15'), self.patch_session([
('saveBhfUser', 'save_user', 'success'),
]):
self._test_save_user()
def test_create_branches(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectBhfList', 'get_branches', 'get_branches'),
]):
self._test_create_branches()
def test_send_invoice_and_credit_note(self):
with freeze_time('2024-04-15'), self.patch_session([
('saveItem', 'save_item_0', 'success'),
('saveTrnsSalesOsdc', 'save_sale_1', 'save_sale_success'),
('selectInvoiceDetails', 'get_invoice_details_1', 'get_invoice_details_success'),
('saveTrnsSalesOsdc', 'save_refund_1', 'save_sale_success'),
]):
self._test_send_invoice_and_credit_note()
def test_send_invoice_complex(self):
with freeze_time('2024-04-15'), self.patch_session([
('saveItem', 'save_item_0', 'success'),
('saveTrnsSalesOsdc', 'save_sale_complex', 'save_sale_success'),
]):
self._test_send_invoice_complex()
def test_confirm_vendor_bill(self):
with freeze_time('2024-04-15'), self.patch_session([
('selectTrnsPurchaseSalesList', 'get_purchases', 'get_purchases_1'),
('saveItem', 'save_item_0', 'success'),
('insertTrnsPurchase', 'save_purchase_1', 'success'),
]):
vendor_bill = self._test_get_vendor_bill()
self._test_confirm_vendor_bill(vendor_bill)