[mezzanine-users] Reverse Tax Calcuation

2015-03-23 Thread vikraw

I am trying to figure out a way to do reverse Tax calculation for Invoice 
Purposes, 

Here is the scenario, 

On product pages, the user only sees the Retail Price (Selling Price + Tax) 
i.e. the out of pocket price.

But when the invoice is generated it should include have the breakdown for 
INDIVIDUAL items the following
- Selling Price of Product (which would be lesser than Retail Price by the 
amount of Tax)
- No of Units
- Tax Type (VAT or Other Type)
- Total Tax for Item
-  Item Total = no. of units X item price + total item_tax

The order_totals only does total tax.

I was trying to change the following templates 
shop/includes/order_details.html  to have tax details for individual 
items. My Reverse calculation would be as follows
  - Individual Item tax = (item.price * tax_rate) / (100+tax_rate)
  - Selling Price = Retail Price - Individual Item tax

I was thinking of doing the maths in order_details.html template but then I 
will need some math filters.

Also, i am not sure if cartridge-tax will accomplish this? I am already 
using a custom order form and whether if I will have to change that if I 
use cartridge-tax

How to go about it?

-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Cartridge: New field to OrderForm with multiwidge, value is always None in comfirmation.html

2015-03-23 Thread Wesley
Hi guys, 
  I hit a problem when customize OrderForm.
I wanna add an option for user choosing to pickup the package, 
1.we send the package to office
2.they come to retrieve
If 2 is chosen, we display our sites for their choice again.

So, I wanna use multiwidget to do this.

Below is code snippet:
0. add model field using EXTRA_MODEL_FIELDS
(
cartridge.shop.models.Order.delivery_type,
'CharField',#DateTimeField,
{default:u'efoodin',max_length:60},
),

1.widget and field customize
class WniChoiceWidget(forms.MultiWidget):
def decompress(self,value):
if value:
#hard code here just for test
return [u'buyer',u'rj']
return ['buyer',u'xz']

class WniComplexChoiceField(forms.MultiValueField):
def __init__(self, wnichoices, max_length=80, *args, **kwargs):
 sets the two fields as not required but will enforce that (at 
least) one is set in compress 
fields = 
(forms.ChoiceField(widget=forms.RadioSelect,choices=(('efoodin',u'efoodin 
delivery'),('buyer',u'self retrieve')),required=False),
  forms.ChoiceField(choices=wnichoices,required=False))
self.widget = WniChoiceWidget(widgets=[f.widget for f in fields])

super(WniComplexChoiceField,self).__init__(required=False,fields=fields,*args,**kwargs)
def compress(self,data_list):
 return the choicefield value if selected or charfield value (if 
both empty, will throw exception 
if not data_list:
raise ValidationError('Need to select choice or enter text for 
this field')
#print data_list
return data_list[0] if data_list[0].startswith('efoodin') else 
data_list[1]

2. Within OrderForm, add this guy
delivery_type=WniComplexChoiceField(wnichoices=settings.CENTER_POTS['Tx'])

3. And, here is snippet in comformation.html
{% for field in form %}{% ifequal field.name delivery_type 
%}brlabeldelivery_type:/labelnbsp;nbsp;{{ field.value }}{% 
endifequal %}{{ field }}{% endfor %}

And, problem is:
1. to billing_shipping page, everything filled, and then, click next to 
comfirmation page.
2. problem goes here, delivery_type is None...
3. on the current wrong comfirmation page, click to edit shopping cart
4. return to checkout
5. Interesting, delivery_type is back and with correct value.

So, what's going on with this?
Is something related to formset? I see OrderForm is a formset.

Thanks.
Wesley

-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Image Cropping issues

2015-03-23 Thread Josh Cartmell
If the images are 1200x1200 and you are using 250 250 in the thumbnail tag
there should be no cropping, only resizing going on. Images that aren't
square will be cropped.  You could avoid this by using 250 0 in your
thumbnail tag, that would cause the width to be 250 and the height would
adjust itself to maintain the aspect ratio of the image.

On Sat, Mar 21, 2015 at 12:56 PM, vikraw vik...@gmail.com wrote:

 Hello Group

 I am uploading product images are usually 1200x1200 pixels. However, the
 category thumbail images are getting cropped from left/right sides.

 1-What size images should I upload to avoid cropping on category pages?
 2-Any tips/guidelines that i can pass to the photographer/editor to avoid
 cropping  and still maintain good quality product images ?

 Below are my settings.

 category.html
 img src={{ MEDIA_URL }}{% thumbnail product.image 250 250 %}

 product.html
  src={{ MEDIA_URL }}{% thumbnail image.file 0 400 %}

 Thank  You
 Vikram

 --
 You received this message because you are subscribed to the Google Groups
 Mezzanine Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to mezzanine-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Reverse Tax Calcuation

2015-03-23 Thread Josh Cartmell
The easiest way might be to make your own version of order_totals that also
does the additional calculations you need.  The just use your version
instead of the version that comes with cartridge.

On Mon, Mar 23, 2015 at 9:41 AM, vikraw vik...@gmail.com wrote:


 I am trying to figure out a way to do reverse Tax calculation for Invoice
 Purposes,

 Here is the scenario,

 On product pages, the user only sees the Retail Price (Selling Price +
 Tax) i.e. the out of pocket price.

 But when the invoice is generated it should include have the breakdown for
 INDIVIDUAL items the following
 - Selling Price of Product (which would be lesser than Retail Price by the
 amount of Tax)
 - No of Units
 - Tax Type (VAT or Other Type)
 - Total Tax for Item
 -  Item Total = no. of units X item price + total item_tax

 The order_totals only does total tax.

 I was trying to change the following templates
 shop/includes/order_details.html  to have tax details for individual
 items. My Reverse calculation would be as follows
   - Individual Item tax = (item.price * tax_rate) / (100+tax_rate)
   - Selling Price = Retail Price - Individual Item tax

 I was thinking of doing the maths in order_details.html template but then
 I will need some math filters.

 Also, i am not sure if cartridge-tax will accomplish this? I am already
 using a custom order form and whether if I will have to change that if I
 use cartridge-tax

 How to go about it?

 --
 You received this message because you are subscribed to the Google Groups
 Mezzanine Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to mezzanine-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Edit Workflow

2015-03-23 Thread Alex Bendig
Hi all -

I saw in this forum that there has been some discussion around the idea of 
supporting edit workflows (i.e. authors commit posts for review to editor, 
editors have the power to schedule publishing, etc.) Here are links to 
relevant previous discussions:

- https://groups.google.com/d/topic/mezzanine-users/sAbNG49x52k/discussion
- https://groups.google.com/d/topic/mezzanine-users/9ZG5nXm03xQ/discussion

As far as I know, there isn't currently support for this yet. What's the 
current thinking and/or development around this feature? We will need this 
in our team and we will be happy to make it available. Certainly would love 
to know whether someone has already made lots of progress here though. 
Thanks!

Best,
Alex

-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] new release?

2015-03-23 Thread elguavas
given that django 1.8 will be released soon, how are things going for a new 
pip installable release of mezzanine that supports django 1.7?

i'm also very interested in the new fabfile stuff for shared host installs.

i'm also wondering, with mezz almost missing a whole django version without 
a pip installable release, are things on the mezz release front likely to 
continue to be very slow in staying up to date with changes in mezz git? 

not intending to be critical, not at all, just looking for an honest 
assessment of how the project is faring with respect to official releases. 
cheers.

-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.