1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/account_avatax/tests/mocked_refund_1_response.py
2024-12-10 09:04:09 +07:00

409 lines
17 KiB
Python

def generate_response(invoice_line_ids):
assert len(invoice_line_ids) == 1, "the mocked response is for 1 line"
RESPONSE['lines'][0]['lineNumber'] = 'account.move.line,%s' % invoice_line_ids[0].id
return RESPONSE
RESPONSE = {'addresses': [{'boundaryLevel': 'Address',
'city': 'Fremont',
'country': 'US',
'id': 85047347585913,
'latitude': '37.530253',
'line1': '4557 De Silva St',
'line2': '',
'line3': '',
'longitude': '-121.974682',
'postalCode': '94538-2506',
'region': 'CA',
'taxRegionId': 4003562,
'transactionId': 85047347585912},
{'boundaryLevel': 'Address',
'city': 'San Francisco',
'country': 'US',
'id': 85047347585914,
'latitude': '37.71116',
'line1': '250 Executive Park Blvd Ste 3400',
'line2': '',
'line3': '',
'longitude': '-122.391717',
'postalCode': '94134-3349',
'region': 'CA',
'taxRegionId': 4016940,
'transactionId': 85047347585912}],
'adjustmentDescription': 'Create or adjust transaction',
'adjustmentReason': 'Other',
'batchCode': '',
'businessIdentificationNo': 'US12345677',
'code': 'Journal Entry 204',
'companyId': 2765828,
'country': 'US',
'currencyCode': 'USD',
'customerCode': 'Contact 14',
'customerUsageType': '',
'customerVendorCode': 'Contact 14',
'date': '2024-01-24',
'description': '',
'destinationAddressId': 0,
'entityUseCode': '',
'exchangeRate': 1.0,
'exchangeRateCurrencyCode': 'USD',
'exchangeRateEffectiveDate': '2024-01-24',
'exemptNo': '',
'id': 85047347585912,
'isSellerImporterOfRecord': False,
'lines': [{'boundaryOverrideId': 0,
'businessIdentificationNo': 'US12345677',
'costInsuranceFreight': 0.0,
'customerUsageType': '',
'description': 'Office Cleaning Service (SUB) (digital)',
'destinationAddressId': 85047347585913,
'details': [{'addressId': 85047347585914,
'chargedTo': 'Buyer',
'country': 'US',
'countyFIPS': '',
'exemptAmount': 0.0,
'exemptReasonId': 4,
'exemptUnits': 0.0,
'id': 85047347585925,
'inState': True,
'isFee': False,
'isNonPassThru': False,
'jurisCode': '06',
'jurisName': 'CALIFORNIA',
'jurisType': 'STA',
'jurisdictionId': 5000531,
'jurisdictionType': 'State',
'liabilityType': 'Seller',
'nonTaxableAmount': 0.0,
'nonTaxableRuleId': 0,
'nonTaxableType': 'RateRule',
'nonTaxableUnits': 0.0,
'rate': 0.06,
'rateRuleId': 1525706,
'rateSourceId': 3,
'rateType': 'General',
'rateTypeCode': 'G',
'region': 'CA',
'reportingExemptUnits': 0.0,
'reportingNonTaxableUnits': 0.0,
'reportingTax': -2.1,
'reportingTaxCalculated': -2.1,
'reportingTaxableUnits': -35.0,
'serCode': '',
'signatureCode': 'AGAM',
'sourcing': 'Origin',
'stateAssignedNo': '',
'stateFIPS': '',
'tax': -2.1,
'taxAuthorityTypeId': 45,
'taxCalculated': -2.1,
'taxName': 'CA STATE TAX',
'taxOverride': 0.0,
'taxRegionId': 4016940,
'taxSubTypeId': 'S',
'taxType': 'Sales',
'taxTypeGroupId': 'SalesAndUse',
'taxableAmount': -35.0,
'taxableUnits': -35.0,
'transactionId': 85047347585912,
'transactionLineId': 85047347585918,
'unitOfBasis': 'PerCurrencyUnit'},
{'addressId': 85047347585914,
'chargedTo': 'Buyer',
'country': 'US',
'countyFIPS': '',
'exemptAmount': 0.0,
'exemptReasonId': 4,
'exemptUnits': 0.0,
'id': 85047347585926,
'inState': True,
'isFee': False,
'isNonPassThru': False,
'jurisCode': '075',
'jurisName': 'SAN FRANCISCO',
'jurisType': 'CTY',
'jurisdictionId': 275,
'jurisdictionType': 'County',
'liabilityType': 'Seller',
'nonTaxableAmount': 0.0,
'nonTaxableRuleId': 0,
'nonTaxableType': 'RateRule',
'nonTaxableUnits': 0.0,
'rate': 0.0025,
'rateRuleId': 1525710,
'rateSourceId': 3,
'rateType': 'General',
'rateTypeCode': 'G',
'region': 'CA',
'reportingExemptUnits': 0.0,
'reportingNonTaxableUnits': 0.0,
'reportingTax': -0.09,
'reportingTaxCalculated': -0.09,
'reportingTaxableUnits': -35.0,
'serCode': '',
'signatureCode': 'AIUQ',
'sourcing': 'Origin',
'stateAssignedNo': '',
'stateFIPS': '',
'tax': -0.09,
'taxAuthorityTypeId': 45,
'taxCalculated': -0.09,
'taxName': 'CA COUNTY TAX',
'taxOverride': 0.0,
'taxRegionId': 4016940,
'taxSubTypeId': 'S',
'taxType': 'Sales',
'taxTypeGroupId': 'SalesAndUse',
'taxableAmount': -35.0,
'taxableUnits': -35.0,
'transactionId': 85047347585912,
'transactionLineId': 85047347585918,
'unitOfBasis': 'PerCurrencyUnit'},
{'addressId': 85047347585913,
'chargedTo': 'Buyer',
'country': 'US',
'countyFIPS': '',
'exemptAmount': 0.0,
'exemptReasonId': 4,
'exemptUnits': 0.0,
'id': 85047347585927,
'inState': True,
'isFee': False,
'isNonPassThru': False,
'jurisCode': 'EMAK0',
'jurisName': 'ALAMEDA COUNTY DISTRICT TAX SP',
'jurisType': 'STJ',
'jurisdictionId': 2001061409,
'jurisdictionType': 'Special',
'liabilityType': 'Seller',
'nonTaxableAmount': 0.0,
'nonTaxableRuleId': 0,
'nonTaxableType': 'RateRule',
'nonTaxableUnits': 0.0,
'rate': 0.03,
'rateRuleId': 2443976,
'rateSourceId': 3,
'rateType': 'General',
'rateTypeCode': 'G',
'region': 'CA',
'reportingExemptUnits': 0.0,
'reportingNonTaxableUnits': 0.0,
'reportingTax': -1.05,
'reportingTaxCalculated': -1.05,
'reportingTaxableUnits': -35.0,
'serCode': '',
'signatureCode': 'EMAK',
'sourcing': 'Destination',
'stateAssignedNo': '966',
'stateFIPS': '',
'tax': -1.05,
'taxAuthorityTypeId': 45,
'taxCalculated': -1.05,
'taxName': 'CA SPECIAL TAX',
'taxOverride': 0.0,
'taxRegionId': 4003562,
'taxSubTypeId': 'S',
'taxType': 'Sales',
'taxTypeGroupId': 'SalesAndUse',
'taxableAmount': -35.0,
'taxableUnits': -35.0,
'transactionId': 85047347585912,
'transactionLineId': 85047347585918,
'unitOfBasis': 'PerCurrencyUnit'},
{'addressId': 85047347585914,
'chargedTo': 'Buyer',
'country': 'US',
'countyFIPS': '',
'exemptAmount': 0.0,
'exemptReasonId': 4,
'exemptUnits': 0.0,
'id': 85047347585928,
'inState': True,
'isFee': False,
'isNonPassThru': False,
'jurisCode': 'EMTV0',
'jurisName': 'SAN FRANCISCO CO LOCAL TAX SL',
'jurisType': 'STJ',
'jurisdictionId': 2001061792,
'jurisdictionType': 'Special',
'liabilityType': 'Seller',
'nonTaxableAmount': 0.0,
'nonTaxableRuleId': 0,
'nonTaxableType': 'RateRule',
'nonTaxableUnits': 0.0,
'rate': 0.01,
'rateRuleId': 1525730,
'rateSourceId': 3,
'rateType': 'General',
'rateTypeCode': 'G',
'region': 'CA',
'reportingExemptUnits': 0.0,
'reportingNonTaxableUnits': 0.0,
'reportingTax': -0.35,
'reportingTaxCalculated': -0.35,
'reportingTaxableUnits': -35.0,
'serCode': '',
'signatureCode': 'EMTV',
'sourcing': 'Origin',
'stateAssignedNo': '38',
'stateFIPS': '',
'tax': -0.35,
'taxAuthorityTypeId': 45,
'taxCalculated': -0.35,
'taxName': 'CA SPECIAL TAX',
'taxOverride': 0.0,
'taxRegionId': 4016940,
'taxSubTypeId': 'S',
'taxType': 'Sales',
'taxTypeGroupId': 'SalesAndUse',
'taxableAmount': -35.0,
'taxableUnits': -35.0,
'transactionId': 85047347585912,
'transactionLineId': 85047347585918,
'unitOfBasis': 'PerCurrencyUnit'}],
'discountAmount': 0.0,
'discountTypeId': 0,
'entityUseCode': '',
'exemptAmount': 0.0,
'exemptCertId': 0,
'exemptNo': '',
'hsCode': '',
'id': 85047347585918,
'isItemTaxable': True,
'isSSTP': False,
'itemCode': '',
'lineAmount': -35.0,
'lineLocationTypes': [{'documentAddressId': 85047347585914,
'documentLineId': 85047347585918,
'documentLineLocationTypeId': 85047347585920,
'locationTypeCode': 'ShipFrom'},
{'documentAddressId': 85047347585913,
'documentLineId': 85047347585918,
'documentLineLocationTypeId': 85047347585921,
'locationTypeCode': 'ShipTo'}],
'lineNumber': 'account.move.line,552',
'nonPassthroughDetails': [],
'originAddressId': 85047347585914,
'quantity': 1.0,
'ref1': '',
'ref2': '',
'reportingDate': '2024-01-24',
'revAccount': '',
'sourcing': 'Mixed',
'tax': -3.59,
'taxCalculated': -3.59,
'taxCode': 'D0000000',
'taxCodeId': 8570,
'taxDate': '2024-01-24',
'taxEngine': '',
'taxIncluded': False,
'taxOverrideAmount': 0.0,
'taxOverrideReason': '',
'taxOverrideType': 'None',
'taxableAmount': -35.0,
'transactionId': 85047347585912,
'vatCode': '',
'vatNumberTypeId': 0}],
'locationCode': '',
'locationTypes': [{'documentAddressId': 85047347585914,
'documentId': 85047347585912,
'documentLocationTypeId': 85047347585916,
'locationTypeCode': 'ShipFrom'},
{'documentAddressId': 85047347585913,
'documentId': 85047347585912,
'documentLocationTypeId': 85047347585917,
'locationTypeCode': 'ShipTo'}],
'locked': False,
'modifiedDate': '2024-01-24T18:33:27.5394227Z',
'modifiedUserId': 1452151,
'originAddressId': 0,
'paymentDate': '1900-01-01',
'purchaseOrderNo': '',
'reconciled': False,
'referenceCode': '/',
'region': 'CA',
'reportingLocationCode': '',
'salespersonCode': '',
'softwareVersion': '24.1.0.0',
'status': 'Saved',
'summary': [{'country': 'US',
'exemption': 0.0,
'jurisCode': '06',
'jurisName': 'CALIFORNIA',
'jurisType': 'State',
'nonTaxable': 0.0,
'rate': 0.06,
'rateType': 'General',
'region': 'CA',
'stateAssignedNo': '',
'tax': -2.1,
'taxAuthorityType': 45,
'taxCalculated': -2.1,
'taxName': 'CA STATE TAX',
'taxSubType': 'S',
'taxType': 'Sales',
'taxable': -35.0},
{'country': 'US',
'exemption': 0.0,
'jurisCode': '075',
'jurisName': 'SAN FRANCISCO',
'jurisType': 'County',
'nonTaxable': 0.0,
'rate': 0.0025,
'rateType': 'General',
'region': 'CA',
'stateAssignedNo': '',
'tax': -0.09,
'taxAuthorityType': 45,
'taxCalculated': -0.09,
'taxName': 'CA COUNTY TAX',
'taxSubType': 'S',
'taxType': 'Sales',
'taxable': -35.0},
{'country': 'US',
'exemption': 0.0,
'jurisCode': 'EMAK0',
'jurisName': 'ALAMEDA COUNTY DISTRICT TAX SP',
'jurisType': 'Special',
'nonTaxable': 0.0,
'rate': 0.03,
'rateType': 'General',
'region': 'CA',
'stateAssignedNo': '966',
'tax': -1.05,
'taxAuthorityType': 45,
'taxCalculated': -1.05,
'taxName': 'CA SPECIAL TAX',
'taxSubType': 'S',
'taxType': 'Sales',
'taxable': -35.0},
{'country': 'US',
'exemption': 0.0,
'jurisCode': 'EMTV0',
'jurisName': 'SAN FRANCISCO CO LOCAL TAX SL',
'jurisType': 'Special',
'nonTaxable': 0.0,
'rate': 0.01,
'rateType': 'General',
'region': 'CA',
'stateAssignedNo': '38',
'tax': -0.35,
'taxAuthorityType': 45,
'taxCalculated': -0.35,
'taxName': 'CA SPECIAL TAX',
'taxSubType': 'S',
'taxType': 'Sales',
'taxable': -35.0}],
'taxDate': '2024-01-24',
'taxOverrideAmount': 0.0,
'taxOverrideReason': 'Manually changed the tax calculation date',
'taxOverrideType': 'TaxDate',
'totalAmount': -35.0,
'totalDiscount': 0.0,
'totalExempt': 0.0,
'totalTax': -3.59,
'totalTaxCalculated': -3.59,
'totalTaxable': -35.0,
'type': 'ReturnInvoice',
'version': 2}