Canadian Tax with Prestashop - prestashop

i've a problem with ps admin.
I need to insert specific tax for zipcode, ex:
10% on Ontario L7C but i can't insert just L7C cause (correctly) this provide me and error related to format. The problem is that i've tons of exception and zipcodes (https://postal-codes.cybo.com/canada/L7C_caledon-ontario/) but i don't know how to insert it in the field. The documentation say that you can insert single or a range, but how does it works if the zip is alphanumeric?

Related

How can my address column in my orders table reference multiple types of address formats?

I'm doing this in SQLite
The problem is my orders table needs to have an address to deliver to but there are many different address formats around the world so I have a table for each different format.
Examples of formats:
US and similar address - Place name, street address, apt number, city, state, country, zip code
Certain places in Africa - Place name, country, state, neighborhood, landmark, distance from land mark, direction from landmark
There are many other valid delivery address formats.
So my ideas are:
Add null columns to the orders table that reference each address format use a check restraint to confirm there is at least an address.
Have separate tables like order_us_address, order_africa_address
Create a table called master_address_id and then reference that in each address format table so that i can just references that master_address_id in the orders table
What is the best practice here? Is there another option?
A single address table should work fine. I assume you want to hold all the individual address fields so just add them to your table. For any individual address record, a lot of these columns will be null but that’s not an issue.
Then add columns for Mailing Address Lines (up to the maximum number of lines there could be in a mailing address). Based on the logic you presumably know for how to construct a mailing address for each country, populate these mailing address lines appropriately.

Correct framework for different attribute values in Dimension

I am attempting to build a Customer dimension from about 5 of our underlying systems.I have a situation where each system has varying degrees of data quality and as a result I end up with different values for the same attributes across rows.
I need to merge the rows into a single row (as it is the same customer and need to be able to merge and make a golden record)
I am running MS SQL Server 2019.
So my data looks something like this (from source system):
ClientID, PhoneNumber, Address, SourceSystemID
123, 63310042, '123 Test Street, Test Town, 2800,', SAP
123,+61310042,'123 test st, Test town 2800', Netsuite
I am wondering what the best apporach here is because I want to:
ensure that transaction from source system SAP, and Netsuite are shown whenever I view this customer.
I also want the analyse geographical information like. - they are from 'Test Town'

how to fix spelling mistakes in a database have multiple records in that records there are more records

i have a database having country, city, state and hotels in these table country name has multiple identical records for eg mexico is wrongly spelled as maxico and mxico and mexico,other records like usa and united states of america and america these type of records are having mutiple same wrongly spelled states and states has multiple wrong spelled cities but hotels are unique and i want them to set them to there right city and state and country for eg. some hotel is in chicago city Illinois state and country is usa. please help me how can i fix this
you could do an update if you know all the different scenarios that are incorrect
update tbl
set city = 'Mexico'
where city in ('maxico', 'mxico')
Well,you can list all values the country column has,and then check wether the values is right, if it is wrong, just use update clause to fix the wrong value, like below:
update my_table set country = 'Mexico' where country in ('maco', 'xico');
It depends on infrastructure you're running.
If you have access to some ETL tools, they often have DataQuality capabilities, often with databases used in correcting adresses. Those are often paid.
If you are a "private" developer, then you might not want to use paid data, so you can look for open data sources, like https://catalog.data.gov allegheny country addresses.
You can use multitude of algorithms and solutions, ranging from simple distances in word space to neural networks pre-trained to do just that.
This type of data problem is hard. There is no built-in simple way to determine the "right spelling". Many databases have one of two capabilities built in that can help -- either "soundex" algorithms or Levenshtein distance.
What should you do? If you really want to fix this problem, create a table with the misspelled name and the correct value that you want. This table will need to be maintained manually, such as in a spreadsheet. Then use this table when importing data and use only the rectified value.
Better yet, set up a reference table with only the correct names. Create a second table with alternative names, which is maintained as above.

Getting a single value from fixer.io and use it on my website to multiply?

I have a bunch of prices listed on my website, in British Punds. I would like to pull the current currency exchange rate into my website, to convert this value to another currency. It seems that fixer.io gets the data I need, but how do I pull it into my page? I only need 1 value form it.
My page loads the prices from a database, so I guess I need to multiply the database numbers with jQuery when the page is loaded.
Thats not my current issue though. I just want to figure out how to pull a single number, and be able to use it on my page.
Good day.
If you need to get currency rates for British Punds with fixer.io, you can make get request to
GET https://api.fixer.io/latest?base=GBP
And you will get latest foreign exchange reference rates for GBP.
If you don't need all list of currencies you may use something like
GET https://api.fixer.io/latest?symbols=USD,EUR?base=GBP
And you will get exchange rates for USD and EUR with base GBP.
Hope it will help you!

Adding PDF as page to PDF

I'm working on an online bookstore. Obviously when something is bought we send out an invoice. I have a default template that is used to put all the information in (customer data) and of course the information about the bought items.
Now comes a part that might seem confusing. We are going to give discounts as well.
Example: A product is €100 and you get 10% discount. Now you pay just €90 but that missing €10 has to be paid at some point, by the one giving the discounts.
So once a month we send an additional invoice to the companies that gave discounts, with all the discounts they gave, so they know what to pay us.
On the first page of that invoice will be an overview for all orders with the total amount of discount on that order together with taxes and the order number. On the second page there will be a detailed overview of all orders.
I will show what is bought on the order so they can see where the discount came from and the prices are correct.
Now we finally get to the problem. The first page will hold (once again) all the details of the customer, in this case the company. It has the address, name, customer number, invoice number etc. The second page doesn't need this information, so I want to make a new template for that, giving me two template PDFs.
Is it possible to grab the second PDF and insert it into the PDF as a single page? This is all to be done in vb.net.