Database relations query - asp.net

I have two database tables
this is a sample database of a Ticketing system.
Figure 1: Sample table of air ticket.
Figure 2: Sample table of tax.
Requirement:
When ticket is made from the interface, it has multiple taxes of different names every time.
How can I store this information i.e. 'n' number of taxes for each ticket with different names every time.
I have tried to make many to many relationship but the problem is:
For each ticket if the tax is not setup, then need to add the tax first.
Any optimal solution for this?

"the problem is: For each ticket if the tax is not setup, then need to
add the tax first."
This is not a real-life problem. In real life governments declare taxes well in advance of collecting them, This gives organizations sufficient time to amend their systems which need to handle taxes. Tax is never a surprise.
"But this is very tiring solution for the end user.... to make bunch
of tax setup for each ticket"
This sort of thing is reference data, and is the duty of the system developer (hint: that's you) to populate the reference data tables. Or at least provide a screen where the user can create or amend various taxes. This is a different function from defining a ticket type.
The Ticket Creation screen should have a drop-down list (or similar widget) displaying all the existing taxes, which allows the user to pick the relevant one(s). If you reall think it's necessary you can include a link to the Create Tax screen, but that really is a very confusing workflow.
If the commentators are correct, and this is a ticket purchasing function, then your design is seriously wrong. Sales taxes must be included automatically to the cost of the purcahse as part of the transaction. Otherwise nobody would pay any tax.

Related

Is it possible to add multiple prices to one product in Woo commerce depending on whether the customer is an individual or a professional?

My client has two customer types (enterprises and individuals), he wants to propose different prices regarding the customer type. This customer type should be defined when the customer creates its account. I still haven't found a solution to do this automatically : after account creation depending on whether the customer said he is an enterprise or an individual, I want that the right price is automatically selected. Do you have any idea of how to do this without a manual user role given ?
Before registration, is it possible de display both prices so that the enterprise also knows what it will have to pay if it registered ?
That would be awesome if you have any idea of plugins doing this or how to code this.
Thanks a lot
Have a good day !
I believe you are looking for a what will be called a Wholesale User Plugin. There's a handful of them out there that you could look into. It will allow you to set up multiple user roles with different pricing structures.

modeling scenario with mostly semi-additive facts

Im learning dimensional modeling and Im trying to create a model. I was thinking about a social media platform which rates hotels. The platform has following data:
hotel information: name and address
a user can rate hotels (1-5 points)
a user can write comments
platform stores the date of the comments
hotel can answer via comment and it stores the date of it
the platform stores the total number of each rating level (i.e.: all rates with 1 point, all rates with 2 point etc.)
platform stores information of the user: sex, name, total number of votes he/she made and address
First, I tried to define which information belongs to a dimension or fact table
(here I also checked which one is additive/semi additive/non-additive)
I realized my example is kind of difficult, because it’s hard to decide if it belongs to a fact table or dimension.
I would like to hear some advice. Would someone agree with my model?
This is how I would model it:
Hotel information -> hotel dimension
User rating -> additive fact – because I can aggregate them with all dimensions
User comment -> semi additive? – because I can aggregate them with the date dimension (I don’t know if my argument is correct, but I know I would have new comments every day, which is for me a reason to store it in a fact table
Answer as comment -> same handling like with the user comments
Date of comment-> dimension
Total Number of all votes (1/2/3/4/5) -> semi-additive facts – makes no sense to aggregate them, since its already total but I would get the average
User information sex and name, address -> user-dimension
User Information: total number of votes -> could be dimension or fact. It depends how often it changes. If it changes often, I store it in a fact. If its not that often, then dimension
I still have question, hope someone can help me:
My Question: should I create two date dimensions, or can I store both information in one date dimension?
2nd Question: each user and hotel just have one address. Are there arguments, to separate the address dimension in a own hierarchy? Can I create a 1:1 relationship to a user dimension and address dimension?
For your model, it looks well considered, but here are some thoughts:
User comment (and answers to comments): they are an event to be captured (with new ones each day, as you mention) so are factual, with dimensionality of the commenter, type of comment, date, and the measure is at least a 'count' which is additive. But you don't want to store big text in a fact so you would put that in a dimension by itself which is 1:1 with the fact, for situations where you need to query on the comment itself.
Total Number of all votes (1/2/3/4/5) are, as you say, already aggregates, mostly for performance. Totals should be easy from the raw data itself so maybe not worthwhile to store them at all. You might also consider updating the hotel dimension with columns (hotel A has 5 '1' votes and 4 '2' votes) that you'd update as you go on, for easy filtering and categorisation.
User Information: total number of votes: it is factual information about a user (dimension) and it depends on whether you always just want to 'find it out' about a person or whether you are likely to use it to filter other information (i.e. show me all reviews for users who have made 10-20 votes). In that case you might store the total in the user dimension (and/or a banding, like 'number of reviews range' with 10-20, 20-30). You can update dimensions often if you need to, but you're right, it could still just live as a fact only.
As for date dimensions, if the 'grain' is 'day' then you only need one dimension, that you refer to from multiple facts.
As for addresses, you're right that there are arguments on both sides! Many people separate addresses into their own dimension, referred to from the other dimensions that use them. Kimball suggests you can do that behind the scenes if necessary, but prefers for each dimension to have its own set of address columns(but modelled as consistently as possible).

About the infomation we can confirm by Google Analytics

In my EC site, product data have the information below.
 ・Brand
 ・category
 ・Sub-category
 ・Division
 ・Style
 ・Color-way
 ・Gender
 ・Season
Can we send and confirm the information in Google Analytics?
I searched in help, and think only we can send Brand,Category, Sub-category.
https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
BestRegards,
Kazuhito
Check "Enhanced Ecommerce" for a few more options: https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce
It's important to understand, that there are multiple sections. Dependent of what you want to do, you've got other limits. If you want to send "Product Data", then your limits are: id, name, brand, category, variant, price, quantity, coupon, position
As I was in my past also in your situations and at least in my unlucky situation the reality was, that divisions could change... So I would recommend you to use what you have and ensure that you send the SKU. Then you can export GA data and export the actual data of your e-commerce system and map the two data parts over the unique identifier SKU together (VLOOKUP and so on).
If you want everything in GA you also can extend the available fields with any field you want to have over custom-dimensions/custom-metrics: https://support.google.com/analytics/answer/2709828?hl=en
If you're going for custom-dimensions/custom-metrics I really can recommend first building a concept and really think also about the future. Otherwise you will regret it.
I hope this helped :)

Dynamics AX financial stock

I have a stock dimension set up on several items. I don't want to add dimensions I just want a current stock dimension that is enabled to be recognised during financial update of stock. I thought I could create a new dimension group and add the same dimensions as the previous one except I have checked serial numbers to be part of financial stock update. I just want to know if this is ok?
You can set up a new tracking dimension group where the flag "Financial inventory" is active for dimension "Serial number", yes. Since the gui allows you to do that, this is ok from a technical point of view (if you are asking if this makes sense as a business requirement, this would be the wrong place to ask that).
You may run into problems if you want to change the tracking dimension group on an existing product. I think you can only do this as long as the product has not been used in any transactions yet.

Is it viable to use Drupal/Ubercart for an international store? Do any payment gateways support it?

I am picking tools to use for an international store. Company sells training and products in North America, Europe and a few other places. The existing store in the United States (Drupal/Ubercart/Authorize.net) works great and serves all their needs.
Displaying product prices in different currencies are relatively easy to set up, and you can display the correct currency symbols and values depending on where services are rendered, where people want to ship to, etc (useful modules include uc_multiple_currency, uc_multiprice, uc_cck_currency).
Are there viable Ubercart solutions to sell to other international markets using the same storefront? It is possible for any user to buy services/products through the US store, but paying in USD for a service offered in e.g. the Netherlands, when dealing with people based in the Netherlands is not acceptable.
The only payment gateway I could find that would accept payment in multiple currencies is Paypal. However, I am looking for a solution that would accept credit cards from international users and charge them in the correct currency. Authorize.net works great - will accept cards from anywhere and process them, but all transactions is in USD. It would be extremely problematic to charge someone €250 on the site and their final charge (after currency conversion) being e.g. €250.65 or something like it because of a delayed conversion.
Numerous people have asked this question, with very few useful insights and solutions (see for example here, here, and here, which presents a workaround-ish way of doing things).
To be clear: Displaying prices in different currencies is easy. How can I bill credit cards internationally using the correct currency through a gateway that supports it, without having to do conversions?
I have been through the same thing recently, but ended up making my own module to do the price handling. If it's done right, the prices will be displayed correct, even for order total etc. (See the hook_uc_price_handler)
This means that you will need to do two things to handle your problem.
Make sure the order only contain 1 currency, so you don't have one item costing €100 and another costing $100 (what would the total of that order be?) You could handle this by doing currency conversion if you wanted to, I believe that is how one of the modules you listed works.
When the payment is processed you need to send the correct currency to the payment provider. This already needs to be done in most cases as payment providers usually are able to collect in various currencies. Since most do the payment process via a hidden form that redirects or a inline form with hidden fields, you should be able to use hook_form_alter to set the currency to what you want. Depending on the payment module, this may be hard or easy.

Resources