ZATCA - Phase 2 - Error converting value to type 'ForeignCurrency'. position 4959

Hi @Mabaega

Can you please check the error, we are trying to issue invoice

please confirm if this is from our side or related to system error

Error…

Error converting value “1a4b7523-54b9-4921-a441-67a9a0095d39” to type ‘ForeignCurrency’. Path ‘invoiceData.customer.currency’, line 1, position 4950.

Detail Error

Newtonsoft.Json.JsonSerializationException: Error converting value "1a4b7523-54b9-4921-a441-67a9a0095d39" to type 'ForeignCurrency'. Path 'invoiceData.customer.currency', line 1, position 4950.

 ---> System.ArgumentException: Could not cast or convert from System.String to ForeignCurrency.

   at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType)

   at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)

   --- End of inner exception stack trace ---

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)

   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)

   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)

   at HomeController.ProcessData(String data) in D:\MANAGER-EXTENSION\ZatcaExtension\ZatcaExtension\Controllers\HomeController.cs:line 38
1 Like

Thank you for the report. This issue should already be fixed in the latest update v25.11.17.0001.

Moving forward, I will use the Image Custom Field to store the QR Code image. This way, the QR Code will be displayed automatically without relying on custom Themes. However, I am still facing challenges in maintaining compatibility with QR Code Phase I, since some users are using the Extension while others are still relying on Custom Themes to display QR Code Phase I.

Hi @Mabaega

still we have the same issue as per below

I’ve tested it several times, and there haven’t been any issues with invoices in foreign currency.


As additional information, could you please let us know:
– Which edition of Manager you are currently using (desktop, server, or cloud)?
– Whether you are performing this action under a restricted user account?

the customer used EUR and USD Currency.

it is Cloud Edition

Full Access to his compnay

The error is mentioning Foreign Currency

Could you show Foreign Currency setting with this UUID

{FE90D70B-9907-4186-A1DC-7DB0367C60DF}


I think this is a permission issue, but unfortunately I couldn’t find any permission setting related to editing foreign currency.

they were creating invoices with EUR, USD currencies, but after moving to extension this error is come up

It seems this is a user permission issue with API3, where the user can edit directly but fails to retrieve data through API3. @lubos

I don’t have a solution for this yet.
You may need to report the invoice using an account with the administrator role.

I have tried to do it from my user account I got same error ( admin )

Fixed. This was caused by the browser cache not refreshing the extension after it was updated.

1 Like

Thanks @Mabaega

your support is really counted and appreciated