Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shopify Connector Tax ID, Multiple Company Locations, Tax ID export, Company Mapping by Tax ID, Payment Terms Export/Import, Company External ID #27577

Open
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

GediminasGaubys
Copy link
Contributor

@GediminasGaubys GediminasGaubys commented Oct 31, 2024

This pull request does not have a related issue as it's part of the delivery for development agreed directly with @AndreiPanko

Implementation 1 (Customer No. in Shopify Catalogs)

  • New functionality has been added to assign 'Customer No.' in Shopify Catalogs during Customer as Company export.

Implementation 2 (Import of Multiple Company Locations)

  • New functionality has been added that stores all Company Locations during import from Shopify. The first Company Location in the response is marked as 'Default'. To receive all Company Locations instead of one, new Query 'Shpfy GQL CompLocations' has been created. And Locations part has been removed from 'Shpfy GQL Company' query.
  • During the Customer as Company export, new created Shopify Company Location is marked as 'Default'.
  • Additionally Company Locations page was created to be able to see information from Business Central side. Company Locations page can be opened from Shopify Companies and Shopify Company Card pages.

Implementation 3 (Tax ID export and Company/Customer mapping by Tax Id)

  • Tax ID export to Shopify - Added functionality to update Tax Id on Company Creation and Synchronization (new GraphQL 'companyLocationCreateTaxRegistration' created and extended GraphQL 'companyCreate' by including Tax ID). Which Customer field has to be used as Tax Id is determined by field 'Company Tax Id Mapping' value on 'Shopify Shop Card'. There are 2 possible options: 'Registration Number' and 'VAT Registration No.'. Enum is extensible, so that user could add any other option to which fields Tax ID has to be linked (implementation codeunit has to be created and linked to new Enum value).
  • Company/Customer mapping by Tax Id - The logic how Company is linked to customer has to be mapped (by email/phone, by tax id, default company) is defined on 'Company Mapping Type' field on 'Shopify Shop Card' page. The 'Company Mapping Type' enum value has to be linked with implementation codeunits that are doing actual Company/Customer mapping. The changes that has been made:
  1. Interface "Shpfy ICompany Mapping" has been extended by creating new interface 'Shpfy IFind Company Mapping' that has new procedure FindMapping()
  2. Moved Existing Mapping by email/phone logic to implementation codeunit
  3. Added new functionality to implementation codeunit for 'Default Company' selection
  4. Created new implementation codeunit to do mapping by Tax ID
  5. Updated existing code by implementing 'Type testing and casting operators for interfaces - 'is' 'as' '. This functionality identifies if implementation codeunit has new interface 'Shpfy IFind Company Mapping' implemented. If so - 'FindMapping' procedure is executed, if not - mapping using email/phone is used as default option.

Implementation 4 (Company Location Payment Terms Export/Import)

  • Company Location Payment Terms Export - new GraphQL implementation codeunit for 'Shpfy GraphQL Type' has been created which allows to send Payment Terms to Shopify. If mapped value for Customer Payment Terms Code exist in 'Payment Terms Mapping', Shopify Payment Terms ID is exported to Shopify for that Company/Customer.
  • Company Location Payment Terms Import - GraphQL 'Shpfy GQL Company' that retrieves Company information from Shopify has been updated by adding new field 'paymentTermsTemplate'. If During the import the mapping in 'Payment Terms Mapping' exist, the Customer in BC is updated by the Payment Terms from Shopify.

Implementation 5 (Populate External ID during the export customer as a company)

  • Existing GraphQL that creates new Companies in Shopify has been updated by adding new field 'externalId'. The value which is 'Customer No.'

Fixes #26819
Fixes AB#559604

jzaksauskas and others added 29 commits September 30, 2024 16:14
@GediminasGaubys GediminasGaubys requested a review from a team as a code owner October 31, 2024 10:36
@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label Nov 1, 2024
@onbuyuka
Copy link
Contributor

onbuyuka commented Nov 6, 2024

Have you considered upgrade scenarios? What will happen for already imported companies? How will locations sync in that case?

@petemchlk
Copy link
Contributor

@onbuyuka resolved your comments about the naming issues

Regarding upgrade - it updates the locations well when you Sync Companies, but the problem is that update happens only if Company was updated on the date later than Last Synchronization for Shopify Companies. So, if somebody has old version and multiple location existing and had not updated company in Shopify in meantime won't get these updated locations in BC.

Since this is how the Company Sync. worked before is this correct behavior?

@JesperSchulz
Copy link
Contributor

@GediminasGaubys, let's get this one lined up for 2025 wave 1! If you could pull from main, resolve the conflicts and address the remaining feedback, we'll reel this one in 😊

@JesperSchulz
Copy link
Contributor

Also pinging @petemchlk. Let's do this 🥳

@GediminasGaubys
Copy link
Contributor Author

@JesperSchulz Okay, we will check it out!

@GediminasGaubys
Copy link
Contributor Author

@JesperSchulz I resolved the conflicts from the main and addressed the remaining feedback, could you check it out if anything is missing?

onbuyuka
onbuyuka previously approved these changes Feb 14, 2025
@onbuyuka
Copy link
Contributor

@GediminasGaubys you still have conflicts in file Apps/W1/Shopify/app/src/GraphQL/Enums/ShpfyGraphQLType.Enum.al

Enum values need to be adjusted, other than that it looks good!

@GediminasGaubys
Copy link
Contributor Author

GediminasGaubys commented Feb 14, 2025

@onbuyuka I saw that there were 2 new commits in the master, so I fixed those (ShpfyGraphQLType.Enum.al and some id clash).

@onbuyuka onbuyuka linked an issue Feb 17, 2025 that may be closed by this pull request
@github-actions github-actions bot added the linked Issue is linked to a Azure Boards work item label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integration GitHub request for Integration area linked Issue is linked to a Azure Boards work item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Internal] Shopify Contributions
5 participants