Modifying Printable Invoice Template - templates

Hi I am using Big Commerce to generate invoices. I want the invoice to have itemized information of what the client ordered. Presently, it prints out a lot of info I don't need and just gives me a total of what the client ordered and not the breakdown. I want the invoice to be simple and to the point so if a client ordered a product with numerous options it shows the product and the options as well as the price.
I am unable to make this work as I want it. Do I need a developer or a different app to make what I want?

Related

Django create a view to generate a receipt

I want to create a small app that creates a kind off receipt record in to a db table, from two other tables. very much like a receipt from a grocery store where a cashier makes a sell and the ticket contains multiple items, calculates a total and subtotal and return values to the database. I currently have 3 tables: the Ticket table where i would like to insert the values of all calculations and ticket info, the services table that acts like an inventory of services available. this has the service name and price for each service and my responsible table that has a list of "cashiers" or people that will make the sale and their percentage for their commissions, i have the views to create , edit and delete cashier's and services.
What I don't have is a way to create the ticket. I am completely lost. can you guys point me in to the correct path on what to look for. i am learning to program son i don't have a lot of knowledge in this if its even possible. i don't need the system to print i just want to have all record stored this way later on i can expand on it and create reports of sold items and who sold them and how much commissions each seller has won.
You need to create relationships to two other models (tables) from the Ticket model (table). Luckily you don't have to create the relations in the database tables itself. Use django model's Foreign key fields to accomplish this. Here is the documentation link:
Django Models
You may need to read it several times to get the concepts thoroughly.

Django Copy Related Data and keep them unchanged over time

Using ForeignKey relationships, I want to be able to copy data and store it in another model. For example, think of how you would handle past Invoices and billed Services.
The Invoice would have one or more Services associated with it and with prices for the Services. This prices for a Service can / will change over time - but the Service price recorded with the Invoice should remain as it was when the Invoice was created.
My first thought was to create a pdf from the resulting data and store it. But this would make the data somewhat inaccessible.
Is there somehow a way to copy the data and keep them accessible?
This is a pretty broad problem with multiple solutions. I dont think that what you're aiming to is the correct one.
One rule for saving invoices is, that invoices never change. You should never update an invoice. So not only your 'copies' of invoices should remain the same, but the original too.
Also, you should have a InvoiceItem (or InvoiceRow) model which are the items on your invoice. Don't bind Products to a Invoice directly.
Here are 2 solutions I've used:
Solution 1
You can normalize the data on your invoice(items). So, don't use foreignkeys, but normalize all data about the product, so product info (incl. price) is saved within the invoice(item).
Solution 2
Give your products revision numbers. So everytime a product is updated (name or price change for example), a new product is created in the database. Now you can link the InvoiceItem to a Product with a Foreign Key, and it will will be historically accurate.
Im sure there are some guides/best practices for creating Invoice backends. Language or Framework is not important. Invoicing is really important, so do alot of research before starting to build something. That's just my two pennies

How to know where database has changed

I have a project that looks like a simple shopping site that sells different kinds of products. For example, I have 4 models: Brand, Product, Consignment. Consignment is linked to Product, and Product is linked to Brand. To reduce count of queries to databases, I want to save current state of these models(or at least some of them). I want to do it, because I show a sidebar with brands and products. So every time when user opens some page, it will execute the query to database to get those brands and products.
But when admin add some new product or brand, I want to handle database changing and resave it. How to implement it?
Your answer is by using Cache. Cache is a method to store your objects in memory/other app like redis temporarily so that you do not need send queries to database. You can read the full description here.
Or, you can use this third party library that helps you to cache Django ORM Model. Here are the example.
Brand.objects.filter(name='stackoverlow').cache()
After doing an update to the model, you need to clear or invalidate the cache.
invalidate_model(Brand)

How to get all products from Amazon's Product Advertising API with a single item search?

I am using Amazon's Product Advertising API. When I'm searching products by keyword from an item search operation I get only 10 results, is there any way to get all result in one single call?
No - Paging Through Results explains some of the details:
It is possible to create a request that returns many thousands of
items in a response. This is problematic for several reasons.
Returning all of the item attributes for those items would
dramatically impact the performance of Product Advertising API in a
negative way. Also, posting a thousand responses on a web page is
impractical.
...
This example shows that 9729 items matched the search criteria. Also,
it shows that those results are on 973 (~9729/10) pages. You might try
putting in an ItemPage value over 10. If you do, Product Advertising
API returns the following error.
...
So, how do you get that 973rd page? You cannot. A better approach is
to submit a new request that is more targeted and yields fewer items
in the response.

Retrieving "businesses" with Google Maps API?

This is an example of a Business on Google Maps
It has elements attached such as:
Reviews from various sites (qype, viewlondon, etc...)
Details provided by various sites
Photos and other content
I don't know how to go on about retrieving such Business and associate any items generated on my website.
What I have implemented up to date is a system using geocoding (geopy) which once given an address, it gives back Latitude and Longitude, but such system does not help me with this dilemma.
What you want is this API:
http://code.google.com/apis/ajaxsearch/local.html
Also check this:
http://googleajaxsearchapi.blogspot.com/2007/06/local-search-control-for-maps-api.html
By writing a relay server script you could do things like this, which obtains most of that information with a different layout. I don't know if it's legal to do that.