Merge lp:~openerp-india/openerp-india/trunk-nco into lp:openerp-india
- trunk-nco
- Merge into trunk
Proposed by
Nimesh Contractor(Open ERP)
Status: | Merged |
---|---|
Merge reported by: | Atul Patel(OpenERP) |
Merged at revision: | not available |
Proposed branch: | lp:~openerp-india/openerp-india/trunk-nco |
Merge into: | lp:openerp-india |
Diff against target: |
1638 lines (+649/-211) 10 files modified
l10n_in_tax_retail_invoice/__openerp__.py (+4/-0) l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py (+202/-139) l10n_in_tax_retail_invoice/report/purchase_order.py (+1/-1) l10n_in_tax_retail_invoice/report/quotation.py (+1/-1) l10n_in_tax_retail_invoice/report/sale_order_tax.py (+1/-1) l10n_in_tax_retail_invoice/report/sale_order_tax.rml (+8/-8) l10n_in_tax_retail_invoice/report/tax_invoice.py (+1/-1) l10n_in_tax_retail_invoice/report/tax_invoice.rml (+320/-60) l10n_in_tax_retail_invoice/test/purchase_order.yml (+42/-0) l10n_in_tax_retail_invoice/test/sale_order.yml (+69/-0) |
To merge this branch: | bzr merge lp:~openerp-india/openerp-india/trunk-nco |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mustufa Rangwala (Open ERP) | Pending | ||
Review via email: mp+170580@code.launchpad.net |
This proposal supersedes a proposal from 2013-06-19.
Commit message
Description of the change
Hello,
I have removed unused protal changes.
Thank You.
Nimesh.
To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote : Posted in a previous version of this proposal | # |
review:
Needs Fixing
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'l10n_in_tax_retail_invoice/__openerp__.py' | |||
2 | --- l10n_in_tax_retail_invoice/__openerp__.py 2013-05-23 08:40:28 +0000 | |||
3 | +++ l10n_in_tax_retail_invoice/__openerp__.py 2013-06-20 10:57:25 +0000 | |||
4 | @@ -53,6 +53,10 @@ | |||
5 | 53 | 'l10n_in_tax_retail_invoice_view.xml', | 53 | 'l10n_in_tax_retail_invoice_view.xml', |
6 | 54 | 'res_config_view.xml', | 54 | 'res_config_view.xml', |
7 | 55 | ], | 55 | ], |
8 | 56 | 'test':[ | ||
9 | 57 | 'test/purchase_order.yml', | ||
10 | 58 | 'test/sale_order.yml', | ||
11 | 59 | ], | ||
12 | 56 | 'installable': True, | 60 | 'installable': True, |
13 | 57 | 'auto_install': False, | 61 | 'auto_install': False, |
14 | 58 | } | 62 | } |
15 | 59 | 63 | ||
16 | === modified file 'l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py' | |||
17 | --- l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py 2013-05-23 08:40:28 +0000 | |||
18 | +++ l10n_in_tax_retail_invoice/l10n_in_tax_retail_invoice.py 2013-06-20 10:57:25 +0000 | |||
19 | @@ -23,7 +23,7 @@ | |||
20 | 23 | from lxml import etree | 23 | from lxml import etree |
21 | 24 | 24 | ||
22 | 25 | from openerp.osv import fields, osv | 25 | from openerp.osv import fields, osv |
24 | 26 | from tools.amount_to_text_en import amount_to_text | 26 | from openerp.tools.amount_to_text_en import amount_to_text |
25 | 27 | from openerp.tools.translate import _ | 27 | from openerp.tools.translate import _ |
26 | 28 | from openerp import netsvc | 28 | from openerp import netsvc |
27 | 29 | import openerp.addons.decimal_precision as dp | 29 | import openerp.addons.decimal_precision as dp |
28 | @@ -42,17 +42,20 @@ | |||
29 | 42 | _inherit = "product.product" | 42 | _inherit = "product.product" |
30 | 43 | 43 | ||
31 | 44 | def _check_packing_cost_allowed(self, cr, uid, ids, name, args, context=None): | 44 | def _check_packing_cost_allowed(self, cr, uid, ids, name, args, context=None): |
32 | 45 | ''' | ||
33 | 46 | This function allows us to use Packing Cost Features. | ||
34 | 47 | |||
35 | 48 | :param ids: list of product record ids. | ||
36 | 49 | :param name : browse name fields of packing_cost_allowed | ||
37 | 50 | :returns: True or False value of Packing Cost of company. | ||
38 | 51 | :rtype: dict | ||
39 | 52 | ''' | ||
40 | 45 | res = {} | 53 | res = {} |
41 | 46 | res_company = self.pool.get('res.company') | 54 | res_company = self.pool.get('res.company') |
42 | 47 | for id in ids: | 55 | for id in ids: |
46 | 48 | packing_cost_allowed = res_company.browse(cr, uid, uid, context=context).packing_cost | 56 | res[id] = res_company.browse(cr, uid, uid, context=context).packing_cost |
47 | 49 | res[id] = packing_cost_allowed | 57 | return res |
45 | 50 | return res | ||
48 | 51 | 58 | ||
49 | 52 | def _default_check_packing_cost_allowed(self, cr, uid, ids, context=None): | ||
50 | 53 | res_company = self.pool.get('res.company') | ||
51 | 54 | packing_cost_allowed = res_company.browse(cr, uid, uid, context=context).packing_cost | ||
52 | 55 | return packing_cost_allowed | ||
53 | 56 | 59 | ||
54 | 57 | _columns = { | 60 | _columns = { |
55 | 58 | 'packing_cost_type': fields.selection([ | 61 | 'packing_cost_type': fields.selection([ |
56 | @@ -65,26 +68,27 @@ | |||
57 | 65 | } | 68 | } |
58 | 66 | 69 | ||
59 | 67 | _defaults = { | 70 | _defaults = { |
62 | 68 | 'packing_cost_allowed': _default_check_packing_cost_allowed, | 71 | 'packing_cost_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).packing_cost, |
63 | 69 | 'packing_cost_type': 'percentage', | 72 | 'packing_cost_type': 'percentage', |
64 | 70 | } | 73 | } |
65 | 71 | 74 | ||
66 | 72 | class res_partner(osv.osv): | 75 | class res_partner(osv.osv): |
67 | 73 | 76 | ||
68 | 74 | _inherit = "res.partner" | 77 | _inherit = "res.partner" |
70 | 75 | 78 | ||
71 | 76 | def _check_dealers_discount_allowed(self, cr, uid, ids, name, args, context=None): | 79 | def _check_dealers_discount_allowed(self, cr, uid, ids, name, args, context=None): |
72 | 80 | ''' | ||
73 | 81 | This function allows us to use dealers discount feature. | ||
74 | 82 | |||
75 | 83 | :param ids: list of partner record ids. | ||
76 | 84 | :returns: True or False value of dealers discount of company | ||
77 | 85 | :rtype: dict of true and false value | ||
78 | 86 | ''' | ||
79 | 77 | res = {} | 87 | res = {} |
80 | 78 | res_company = self.pool.get('res.company') | 88 | res_company = self.pool.get('res.company') |
81 | 79 | for id in ids: | 89 | for id in ids: |
90 | 80 | dealers_discount_allowed = res_company.browse(cr, uid, uid, context=context).dealers_discount | 90 | res[id] = res_company.browse(cr, uid, uid, context=context).dealers_discount |
91 | 81 | res[id] = dealers_discount_allowed | 91 | return res |
84 | 82 | return res | ||
85 | 83 | |||
86 | 84 | def _default_check_dealers_discount_allowed(self, cr, uid, ids, context=None): | ||
87 | 85 | res_company = self.pool.get('res.company') | ||
88 | 86 | dealers_discount_allowed = res_company.browse(cr, uid, uid, context=context).dealers_discount | ||
89 | 87 | return dealers_discount_allowed | ||
92 | 88 | 92 | ||
93 | 89 | _columns = { | 93 | _columns = { |
94 | 90 | 'tin_no' : fields.char('TIN', size=32, help="Tax Identification Number"), | 94 | 'tin_no' : fields.char('TIN', size=32, help="Tax Identification Number"), |
95 | @@ -98,9 +102,12 @@ | |||
96 | 98 | } | 102 | } |
97 | 99 | 103 | ||
98 | 100 | _defaults = { | 104 | _defaults = { |
100 | 101 | 'dealers_discount_allowed': _default_check_dealers_discount_allowed, | 105 | 'dealers_discount_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).dealers_discount, |
101 | 102 | } | 106 | } |
102 | 103 | def _check_recursion(self, cr, uid, ids, context=None): | 107 | def _check_recursion(self, cr, uid, ids, context=None): |
103 | 108 | """ | ||
104 | 109 | Set constraints to cannot create recursive dealers. | ||
105 | 110 | """ | ||
106 | 104 | level = 100 | 111 | level = 100 |
107 | 105 | while len(ids): | 112 | while len(ids): |
108 | 106 | cr.execute('select distinct dealer_id from res_partner where id IN %s',(tuple(ids),)) | 113 | cr.execute('select distinct dealer_id from res_partner where id IN %s',(tuple(ids),)) |
109 | @@ -151,17 +158,34 @@ | |||
110 | 151 | 158 | ||
111 | 152 | _inherit = "sale.order" | 159 | _inherit = "sale.order" |
112 | 153 | 160 | ||
114 | 154 | def _get_pack_total(self, cursor, user, ids, name, arg, context=None): | 161 | def _get_pack_total(self, cr, uid, ids, name, arg, context=None): |
115 | 162 | ''' | ||
116 | 163 | The purpose of this function is to build and return packing_total and dealers_disc | ||
117 | 164 | :param ids: list of sale order ids | ||
118 | 165 | :returns: packing_total and dealers_disc | ||
119 | 166 | :rtype: dictionary | ||
120 | 167 | ''' | ||
121 | 155 | res = {} | 168 | res = {} |
125 | 156 | tot_diff = 0.0 | 169 | for sale in self.browse(cr, uid, ids, context=context): |
126 | 157 | for sale in self.browse(cursor, user, ids, context=context): | 170 | res[sale.id] = { |
127 | 158 | tot_diff = 0.0 | 171 | 'packing_total': 0.0, |
128 | 172 | 'dealers_disc': 0.0, | ||
129 | 173 | } | ||
130 | 174 | packing_total = dealers_disc = 0.0 | ||
131 | 159 | for line in sale.order_line: | 175 | for line in sale.order_line: |
134 | 160 | tot_diff += line.packing_amount # Need to check if packing cost apply by qty sold? | 176 | if line.lst_price: |
135 | 161 | res[sale.id] = tot_diff | 177 | dealers_disc += (line.price_unit - line.lst_price) * line.product_uom_qty |
136 | 178 | packing_total += line.packing_amount # Need to check if packing cost apply by qty sold? | ||
137 | 179 | res[sale.id]['packing_total'] = packing_total | ||
138 | 180 | res[sale.id]['dealers_disc'] = dealers_disc | ||
139 | 162 | return res | 181 | return res |
140 | 182 | |||
141 | 163 | 183 | ||
142 | 164 | def copy(self, cr, uid, id, default=None, context=None): | 184 | def copy(self, cr, uid, id, default=None, context=None): |
143 | 185 | """ | ||
144 | 186 | override orm copy method. | ||
145 | 187 | cannot duplicate invoice for sale order. | ||
146 | 188 | """ | ||
147 | 165 | default = default or {} | 189 | default = default or {} |
148 | 166 | default.update({ | 190 | default.update({ |
149 | 167 | 'invoice_id':False, | 191 | 'invoice_id':False, |
150 | @@ -169,8 +193,13 @@ | |||
151 | 169 | return super(sale_order, self).copy(cr, uid, id, default, context=context) | 193 | return super(sale_order, self).copy(cr, uid, id, default, context=context) |
152 | 170 | 194 | ||
153 | 171 | def _amount_line_tax(self, cr, uid, line, context=None): | 195 | def _amount_line_tax(self, cr, uid, line, context=None): |
156 | 172 | sale_order_line_obj = self.pool.get('sale.order.line') | 196 | ''' |
157 | 173 | packing_cost_allowed = sale_order_line_obj.browse(cr, uid, line.id, context=context).order_id.company_id.packing_cost | 197 | The purpose of this function is calculate amount with tax |
158 | 198 | :param line: browse the record of sale.order.line | ||
159 | 199 | :returns: amount val | ||
160 | 200 | :rtype: int | ||
161 | 201 | ''' | ||
162 | 202 | packing_cost_allowed = self.pool.get('sale.order.line').browse(cr, uid, line.id, context=context).order_id.company_id.packing_cost | ||
163 | 174 | if packing_cost_allowed: | 203 | if packing_cost_allowed: |
164 | 175 | val = 0.0 | 204 | val = 0.0 |
165 | 176 | for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, (line.price_unit + line.packing_amount) * (1 - (line.discount or 0.0) / 100.0), line.product_uom_qty, line.product_id, line.order_id.partner_id)['taxes']: | 205 | for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, (line.price_unit + line.packing_amount) * (1 - (line.discount or 0.0) / 100.0), line.product_uom_qty, line.product_id, line.order_id.partner_id)['taxes']: |
166 | @@ -179,25 +208,25 @@ | |||
167 | 179 | return super(sale_order, self)._amount_line_tax(cr, uid, line, context=context) | 208 | return super(sale_order, self)._amount_line_tax(cr, uid, line, context=context) |
168 | 180 | 209 | ||
169 | 181 | def _amount_all(self, cr, uid, ids, field_name, arg, context=None): | 210 | def _amount_all(self, cr, uid, ids, field_name, arg, context=None): |
170 | 211 | ''' | ||
171 | 212 | The purpose of this function is Calculate a amount, untaxed and tax | ||
172 | 213 | :param ids: list of sale order record ids. | ||
173 | 214 | :returns: amount_total, amount_untaxed,amount_tax | ||
174 | 215 | :rtype: dictionary | ||
175 | 216 | ''' | ||
176 | 182 | res = super(sale_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context) | 217 | res = super(sale_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context) |
177 | 183 | return res | 218 | return res |
178 | 184 | 219 | ||
179 | 185 | def _get_order(self, cr, uid, ids, context=None): | 220 | def _get_order(self, cr, uid, ids, context=None): |
180 | 221 | ''' | ||
181 | 222 | The purpose of this function to reculate amount total. | ||
182 | 223 | :param ids: list of sale order line record ids | ||
183 | 224 | :returns: Recalculated sale order id | ||
184 | 225 | :rtype: int | ||
185 | 226 | ''' | ||
186 | 186 | res = super(sale_order, self.pool.get('sale.order'))._get_order(cr, uid, ids, context=context) | 227 | res = super(sale_order, self.pool.get('sale.order'))._get_order(cr, uid, ids, context=context) |
187 | 187 | return res | 228 | return res |
188 | 188 | 229 | ||
189 | 189 | def _get_difference(self, cursor, user, ids, name, arg, context=None): | ||
190 | 190 | res = {} | ||
191 | 191 | tot_diff = 0.0 | ||
192 | 192 | for sale in self.browse(cursor, user, ids): | ||
193 | 193 | tot_diff = 0.0 | ||
194 | 194 | for line in sale.order_line: | ||
195 | 195 | if line.lst_price: | ||
196 | 196 | tot_diff += (line.price_unit - line.lst_price) * line.product_uom_qty | ||
197 | 197 | # tot_diff = tot_diff - line.packing_amount # Need to check if packing cost apply by qty sold? | ||
198 | 198 | res[sale.id] = tot_diff | ||
199 | 199 | return res | ||
200 | 200 | |||
201 | 201 | def _get_qty_total(self, cr, uid, ids): | 230 | def _get_qty_total(self, cr, uid, ids): |
202 | 202 | res = {} | 231 | res = {} |
203 | 203 | qty = 0.0 | 232 | qty = 0.0 |
204 | @@ -210,7 +239,7 @@ | |||
205 | 210 | _columns = { | 239 | _columns = { |
206 | 211 | 'contact_id': fields.many2one('res.partner', 'Contact'), | 240 | 'contact_id': fields.many2one('res.partner', 'Contact'), |
207 | 212 | 'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', required=True, help="Delivery address for current sales order."), | 241 | 'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', required=True, help="Delivery address for current sales order."), |
209 | 213 | 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True), | 242 | 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True, multi='_get_pack_total'), |
210 | 214 | 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Total', | 243 | 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Total', |
211 | 215 | store={ | 244 | store={ |
212 | 216 | 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), | 245 | 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), |
213 | @@ -220,7 +249,7 @@ | |||
214 | 220 | 'quote_validity': fields.integer('Quote Validity', help="Validity of Quote in days."), | 249 | 'quote_validity': fields.integer('Quote Validity', help="Validity of Quote in days."), |
215 | 221 | 'subject': fields.text('Subject'), | 250 | 'subject': fields.text('Subject'), |
216 | 222 | 'invoice_id': fields.many2one('account.invoice', 'Invoice ID'), | 251 | 'invoice_id': fields.many2one('account.invoice', 'Invoice ID'), |
218 | 223 | 'dealers_disc': fields.function(_get_difference, type="float", string='Dealers Discount', store=True), | 252 | 'dealers_disc': fields.function(_get_pack_total, type="float", string='Dealers Discount', store=True, multi='_get_pack_total'), |
219 | 224 | 'delivery_term': fields.integer('Delivery Term', help='Delivery Term in Weeks') | 253 | 'delivery_term': fields.integer('Delivery Term', help='Delivery Term in Weeks') |
220 | 225 | } | 254 | } |
221 | 226 | 255 | ||
222 | @@ -228,18 +257,17 @@ | |||
223 | 228 | """ create invoices for the given sales orders (ids), and open the form | 257 | """ create invoices for the given sales orders (ids), and open the form |
224 | 229 | view of one of the newly created invoices | 258 | view of one of the newly created invoices |
225 | 230 | """ | 259 | """ |
226 | 231 | mod_obj = self.pool.get('ir.model.data') | ||
227 | 232 | wf_service = netsvc.LocalService("workflow") | 260 | wf_service = netsvc.LocalService("workflow") |
228 | 233 | 261 | ||
229 | 234 | # create invoices through the sales orders' workflow | 262 | # create invoices through the sales orders' workflow |
230 | 235 | inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids) | 263 | inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids) |
233 | 236 | for id in ids: | 264 | for sale_order_id in ids: |
234 | 237 | wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr) | 265 | wf_service.trg_validate(uid, 'sale.order', sale_order_id, 'manual_invoice', cr) |
235 | 238 | inv_ids1 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids) | 266 | inv_ids1 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids) |
236 | 239 | # determine newly created invoices | 267 | # determine newly created invoices |
237 | 240 | new_inv_ids = list(inv_ids1 - inv_ids0) | 268 | new_inv_ids = list(inv_ids1 - inv_ids0) |
238 | 241 | self.write(cr, uid, ids[0], {'invoice_id': new_inv_ids[0]}, context=context) | 269 | self.write(cr, uid, ids[0], {'invoice_id': new_inv_ids[0]}, context=context) |
240 | 242 | res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form') | 270 | res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'invoice_form') |
241 | 243 | res_id = res and res[1] or False, | 271 | res_id = res and res[1] or False, |
242 | 244 | 272 | ||
243 | 245 | return { | 273 | return { |
244 | @@ -256,21 +284,26 @@ | |||
245 | 256 | } | 284 | } |
246 | 257 | 285 | ||
247 | 258 | def _prepare_invoice(self, cr, uid, order, lines, context=None): | 286 | def _prepare_invoice(self, cr, uid, order, lines, context=None): |
248 | 287 | """Override method of sale order to update invoice with delivery order | ||
249 | 288 | information. | ||
250 | 289 | :param browse_record order: sale.order record to invoice | ||
251 | 290 | :param list(int) line: list of invoice line IDs that must be | ||
252 | 291 | attached to the invoice | ||
253 | 292 | :return: dict of value to update the invoice | ||
254 | 293 | """ | ||
255 | 259 | stock_picking_obj = self.pool.get('stock.picking') | 294 | stock_picking_obj = self.pool.get('stock.picking') |
256 | 260 | res = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context) | 295 | res = super(sale_order, self)._prepare_invoice(cr, uid, order, lines, context=context) |
257 | 261 | delivery_id = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)], context=context) | 296 | delivery_id = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)], context=context) |
258 | 262 | if delivery_id: | 297 | if delivery_id: |
259 | 263 | delivery = stock_picking_obj.browse(cr, uid, delivery_id[0], context=context) | 298 | delivery = stock_picking_obj.browse(cr, uid, delivery_id[0], context=context) |
260 | 264 | delivery_date = delivery.date_done | ||
261 | 265 | delivery_name = delivery.name | ||
262 | 266 | res.update( | 299 | res.update( |
263 | 267 | { | 300 | { |
264 | 268 | 'delivery_order_id': delivery_id[0], | 301 | 'delivery_order_id': delivery_id[0], |
265 | 269 | 'delivery_address_id': order.partner_shipping_id.id, | 302 | 'delivery_address_id': order.partner_shipping_id.id, |
266 | 270 | 'date': order.date_order, | 303 | 'date': order.date_order, |
267 | 271 | 'carrier_id': order.carrier_id and order.carrier_id.id, | 304 | 'carrier_id': order.carrier_id and order.carrier_id.id, |
270 | 272 | 'delivery_name': delivery_name or None, | 305 | 'delivery_name': delivery.date_done or None, |
271 | 273 | 'delivery_date': delivery_date or False, | 306 | 'delivery_date': delivery.name or False, |
272 | 274 | 'sale_id': order.id | 307 | 'sale_id': order.id |
273 | 275 | } | 308 | } |
274 | 276 | ) | 309 | ) |
275 | @@ -281,14 +314,21 @@ | |||
276 | 281 | _inherit = 'sale.order.line' | 314 | _inherit = 'sale.order.line' |
277 | 282 | 315 | ||
278 | 283 | def _amount_line(self, cr, uid, ids, field_name, arg, context=None): | 316 | def _amount_line(self, cr, uid, ids, field_name, arg, context=None): |
279 | 317 | ''' | ||
280 | 318 | The purpose of this function is calculate price total value. | ||
281 | 319 | :param ids: list of order line ids | ||
282 | 320 | :param field_name: name of price subtotal | ||
283 | 321 | :returns: subtotal value | ||
284 | 322 | ''' | ||
285 | 284 | packing_cost_allowed = False | 323 | packing_cost_allowed = False |
286 | 285 | res = super(sale_order_line, self)._amount_line(cr, uid, ids, field_name, arg, context=context) | 324 | res = super(sale_order_line, self)._amount_line(cr, uid, ids, field_name, arg, context=context) |
289 | 286 | for id in ids: | 325 | for line_id in ids: |
290 | 287 | packing_cost_allowed = self.browse(cr, uid, id, context=context).order_id.company_id.packing_cost | 326 | packing_cost_allowed = self.browse(cr, uid, line_id, context=context).order_id.company_id.packing_cost |
291 | 288 | if packing_cost_allowed: | 327 | if packing_cost_allowed: |
292 | 289 | for sale_order_line_id in res: | 328 | for sale_order_line_id in res: |
295 | 290 | qty = self.browse(cr, uid, sale_order_line_id, context=context).product_uom_qty | 329 | sale_order_line_obj = self.browse(cr, uid, sale_order_line_id, context=context) |
296 | 291 | packing_amount = self.browse(cr, uid, sale_order_line_id, context=context).packing_amount | 330 | qty = sale_order_line_obj.product_uom_qty |
297 | 331 | packing_amount = sale_order_line_obj.packing_amount | ||
298 | 292 | res[sale_order_line_id] += qty * packing_amount | 332 | res[sale_order_line_id] += qty * packing_amount |
299 | 293 | return res | 333 | return res |
300 | 294 | 334 | ||
301 | @@ -301,20 +341,25 @@ | |||
302 | 301 | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, | 341 | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, |
303 | 302 | uom=False, qty_uos=0, uos=False, name='', partner_id=False, | 342 | uom=False, qty_uos=0, uos=False, name='', partner_id=False, |
304 | 303 | lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None): | 343 | lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None): |
305 | 344 | ''' | ||
306 | 345 | The purpose of this function to get value of price unit, list price, packing amount on product change. | ||
307 | 346 | :return: return this value list price , price unit, packing amount. | ||
308 | 347 | :rtype: dictionary | ||
309 | 348 | ''' | ||
310 | 304 | res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=0, | 349 | res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=0, |
311 | 305 | uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id, | 350 | uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id, |
312 | 306 | lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context) | 351 | lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context) |
313 | 307 | context = context or {} | 352 | context = context or {} |
314 | 308 | lang = lang or context.get('lang', False) | 353 | lang = lang or context.get('lang', False) |
315 | 309 | partner_obj = self.pool.get('res.partner') | ||
316 | 310 | product_obj = self.pool.get('product.product') | 354 | product_obj = self.pool.get('product.product') |
317 | 311 | if product: | 355 | if product: |
320 | 312 | packing_cost_allowed = product_obj.browse(cr, uid, product, context=context).company_id.packing_cost | 356 | product_product_obj = product_obj.browse(cr, uid, product, context=context) |
321 | 313 | dealers_discount_allowed = product_obj.browse(cr, uid, product, context=context).company_id.dealers_discount | 357 | packing_cost_allowed = product_product_obj.company_id.packing_cost |
322 | 358 | dealers_discount_allowed = product_product_obj.company_id.dealers_discount | ||
323 | 314 | # Dealer's Discount Feature | 359 | # Dealer's Discount Feature |
324 | 315 | if dealers_discount_allowed: | 360 | if dealers_discount_allowed: |
325 | 316 | if partner_id: | 361 | if partner_id: |
327 | 317 | partner_rec = partner_obj.browse(cr, uid, partner_id, context=context) | 362 | partner_rec = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) |
328 | 318 | if partner_rec.dealer_id: | 363 | if partner_rec.dealer_id: |
329 | 319 | res['value']['lst_price'] = res['value']['price_unit'] | 364 | res['value']['lst_price'] = res['value']['price_unit'] |
330 | 320 | res['value']['price_unit'] = 0.0 | 365 | res['value']['price_unit'] = 0.0 |
331 | @@ -396,10 +441,11 @@ | |||
332 | 396 | pay_term = order.partner_id.property_payment_term.id | 441 | pay_term = order.partner_id.property_payment_term.id |
333 | 397 | else: | 442 | else: |
334 | 398 | pay_term = False | 443 | pay_term = False |
339 | 399 | delivery_id = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)]) | 444 | delivery_ids = stock_picking_obj.search(cr, uid, [('sale_id', '=', order.id)]) |
340 | 400 | for id in delivery_id: | 445 | for delivery_id in delivery_ids: |
341 | 401 | delivery_date = stock_picking_obj.browse(cr, uid, id, context=context).date_done | 446 | delivery = stock_picking_obj.browse(cr, uid, delivery_id, context=context) |
342 | 402 | delivery_name = stock_picking_obj.browse(cr, uid, id, context=context).name | 447 | delivery_date = delivery.date_done |
343 | 448 | delivery_name = delivery.name | ||
344 | 403 | inv = { | 449 | inv = { |
345 | 404 | 'name': order.name, | 450 | 'name': order.name, |
346 | 405 | 'origin': order.name, | 451 | 'origin': order.name, |
347 | @@ -464,6 +510,14 @@ | |||
348 | 464 | _inherit = "stock.picking" | 510 | _inherit = "stock.picking" |
349 | 465 | 511 | ||
350 | 466 | def _prepare_invoice(self, cr, uid, picking, partner, inv_type, journal_id, context=None): | 512 | def _prepare_invoice(self, cr, uid, picking, partner, inv_type, journal_id, context=None): |
351 | 513 | """Override method of picking to update invoice with delivery order | ||
352 | 514 | information. | ||
353 | 515 | :param browse_record picking: stock.picking record to invoice | ||
354 | 516 | :param partner: browse record of partner | ||
355 | 517 | :param inv_type: invoice type (in or out invoice). | ||
356 | 518 | :param journal_id: journal id | ||
357 | 519 | :return: dict of value to update the invoice for picking | ||
358 | 520 | """ | ||
359 | 467 | res = super(stock_picking, self)._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context) | 521 | res = super(stock_picking, self)._prepare_invoice(cr, uid, picking, partner, inv_type, journal_id, context=context) |
360 | 468 | freight_allowed = self.browse(cr, uid, picking.id, context=context).company_id.freight | 522 | freight_allowed = self.browse(cr, uid, picking.id, context=context).company_id.freight |
361 | 469 | if picking.sale_id: | 523 | if picking.sale_id: |
362 | @@ -488,17 +542,18 @@ | |||
363 | 488 | 542 | ||
364 | 489 | def action_invoice_create(self, cr, uid, ids, journal_id=False, | 543 | def action_invoice_create(self, cr, uid, ids, journal_id=False, |
365 | 490 | group=False, type='out_invoice', context=None): | 544 | group=False, type='out_invoice', context=None): |
370 | 491 | sale_order_obj = self.pool.get('sale.order') | 545 | """ |
371 | 492 | 546 | Overrride method from picking to update invoice id to sale order. | |
372 | 493 | for id in ids: | 547 | """ |
373 | 494 | sale_id = self.browse(cr, uid, id, context=context).sale_id.id | 548 | for picking_id in ids: |
374 | 549 | sale_id = self.browse(cr, uid, picking_id, context=context).sale_id.id | ||
375 | 495 | 550 | ||
376 | 496 | res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=journal_id, | 551 | res = super(stock_picking, self).action_invoice_create(cr, uid, ids, journal_id=journal_id, |
377 | 497 | group=group, type=type, context=context) | 552 | group=group, type=type, context=context) |
378 | 498 | 553 | ||
379 | 499 | for key in res: | 554 | for key in res: |
380 | 500 | invoice_id = res[key] | 555 | invoice_id = res[key] |
382 | 501 | sale_order_obj.write(cr, uid, sale_id, {'invoice_id': invoice_id}, context=context) | 556 | self.pool.get('sale.order').write(cr, uid, sale_id, {'invoice_id': invoice_id}, context=context) |
383 | 502 | return res | 557 | return res |
384 | 503 | 558 | ||
385 | 504 | 559 | ||
386 | @@ -515,8 +570,9 @@ | |||
387 | 515 | res = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id, | 570 | res = super(stock_picking, self)._prepare_invoice_line(cr, uid, group, picking, move_line, invoice_id, |
388 | 516 | invoice_vals, context=context) | 571 | invoice_vals, context=context) |
389 | 517 | 572 | ||
392 | 518 | dealers_discount_allowed = self.browse(cr, uid, picking.id, context=context).company_id.dealers_discount | 573 | stock_picking_obj = self.browse(cr, uid, picking.id, context=context) |
393 | 519 | packing_cost_allowed = self.browse(cr, uid, picking.id, context=context).company_id.packing_cost | 574 | dealers_discount_allowed = stock_picking_obj.company_id.dealers_discount |
394 | 575 | packing_cost_allowed = stock_picking_obj.company_id.packing_cost | ||
395 | 520 | 576 | ||
396 | 521 | # Dealer's Discount Feature | 577 | # Dealer's Discount Feature |
397 | 522 | if dealers_discount_allowed: | 578 | if dealers_discount_allowed: |
398 | @@ -532,11 +588,16 @@ | |||
399 | 532 | _inherit = 'account.invoice' | 588 | _inherit = 'account.invoice' |
400 | 533 | 589 | ||
401 | 534 | def _amount_all(self, cr, uid, ids, name, args, context=None): | 590 | def _amount_all(self, cr, uid, ids, name, args, context=None): |
402 | 591 | """ | ||
403 | 592 | Override function from account invoice. | ||
404 | 593 | Purpose of this function is to add freight charge to amount total. | ||
405 | 594 | """ | ||
406 | 535 | res = super(account_invoice, self)._amount_all(cr, uid, ids, name, args, context=context) | 595 | res = super(account_invoice, self)._amount_all(cr, uid, ids, name, args, context=context) |
407 | 536 | for invoice_id in res: | 596 | for invoice_id in res: |
409 | 537 | freight_allowed = self.browse(cr, uid, invoice_id, context=context).company_id.freight | 597 | account_invoice_obj = self.browse(cr, uid, invoice_id, context=context) |
410 | 598 | freight_allowed = account_invoice_obj.company_id.freight | ||
411 | 538 | if freight_allowed: | 599 | if freight_allowed: |
413 | 539 | freight_charge = self.browse(cr, uid, invoice_id, context=context).freight_charge | 600 | freight_charge = account_invoice_obj.freight_charge |
414 | 540 | res[invoice_id]['amount_total'] += freight_charge | 601 | res[invoice_id]['amount_total'] += freight_charge |
415 | 541 | return res | 602 | return res |
416 | 542 | 603 | ||
417 | @@ -549,24 +610,29 @@ | |||
418 | 549 | return res | 610 | return res |
419 | 550 | 611 | ||
420 | 551 | def _get_pack_total(self, cursor, user, ids, name, arg, context=None): | 612 | def _get_pack_total(self, cursor, user, ids, name, arg, context=None): |
421 | 613 | ''' | ||
422 | 614 | The purpose of this function is calculate packing total and dealers discount | ||
423 | 615 | @param user: pass login user id | ||
424 | 616 | @param ids: pass invoice id | ||
425 | 617 | @param name: pass packing_total | ||
426 | 618 | @param args: None | ||
427 | 619 | @param context: pass context in 'type' : 'out_invoice', 'no_store_function': True/False, 'journal_type': 'sale' | ||
428 | 620 | @return: return a dict in invoice_id with packing amount of invoice line. | ||
429 | 621 | @rtype : dict | ||
430 | 622 | ''' | ||
431 | 552 | res = {} | 623 | res = {} |
432 | 553 | tot_diff = 0.0 | ||
433 | 554 | for invoice in self.browse(cursor, user, ids, context=context): | 624 | for invoice in self.browse(cursor, user, ids, context=context): |
445 | 555 | tot_diff = 0.0 | 625 | res[invoice.id] = { |
446 | 556 | for line in invoice.invoice_line: | 626 | 'packing_total': 0.0, |
447 | 557 | tot_diff += line.packing_amount # Need to check if packing cost apply by qty sold? | 627 | 'dealers_disc': 0.0, |
448 | 558 | res[invoice.id] = tot_diff | 628 | } |
449 | 559 | return res | 629 | packing_total = dealers_disc = 0.0 |
439 | 560 | |||
440 | 561 | def _get_difference(self, cursor, user, ids, name, arg, context=None): | ||
441 | 562 | res = {} | ||
442 | 563 | tot_diff = 0.0 | ||
443 | 564 | for invoice in self.browse(cursor, user, ids): | ||
444 | 565 | tot_diff = 0.0 | ||
450 | 566 | for line in invoice.invoice_line: | 630 | for line in invoice.invoice_line: |
451 | 567 | if line.lst_price: | 631 | if line.lst_price: |
454 | 568 | tot_diff += (line.price_unit - line.lst_price) * line.quantity | 632 | dealers_disc += (line.price_unit - line.lst_price) * line.quantity |
455 | 569 | res[invoice.id] = tot_diff | 633 | packing_total += line.packing_amount # Need to check if packing cost apply by qty sold? |
456 | 634 | res[invoice.id]['packing_total'] = packing_total | ||
457 | 635 | res[invoice.id]['dealers_disc'] = dealers_disc | ||
458 | 570 | return res | 636 | return res |
459 | 571 | 637 | ||
460 | 572 | def _get_qty_total(self, cr, uid, ids): | 638 | def _get_qty_total(self, cr, uid, ids): |
461 | @@ -579,6 +645,13 @@ | |||
462 | 579 | return res | 645 | return res |
463 | 580 | 646 | ||
464 | 581 | def amount_to_text(self, amount, currency): | 647 | def amount_to_text(self, amount, currency): |
465 | 648 | ''' | ||
466 | 649 | The purpose of this function is to use payment amount change in word | ||
467 | 650 | @param amount: pass Total payment of amount | ||
468 | 651 | @param currency: pass which currency to pay | ||
469 | 652 | @return: return amount in word | ||
470 | 653 | @rtype : string | ||
471 | 654 | ''' | ||
472 | 582 | amount_in_word = amount_to_text(amount) | 655 | amount_in_word = amount_to_text(amount) |
473 | 583 | if currency == 'INR': | 656 | if currency == 'INR': |
474 | 584 | amount_in_word = amount_in_word.replace("euro", "Rupees").replace("Cents", "Paise").replace("Cent", "Paise") | 657 | amount_in_word = amount_in_word.replace("euro", "Rupees").replace("Cents", "Paise").replace("Cent", "Paise") |
475 | @@ -599,11 +672,6 @@ | |||
476 | 599 | }) | 672 | }) |
477 | 600 | return super(account_invoice, self).copy(cr, uid, id, default, context) | 673 | return super(account_invoice, self).copy(cr, uid, id, default, context) |
478 | 601 | 674 | ||
479 | 602 | def _check_freight_allowed(self, cr, uid, ids, context=None): | ||
480 | 603 | res_company_obj = self.pool.get('res.company') | ||
481 | 604 | freight_allowed = res_company_obj.browse(cr, uid, uid, context=context).freight | ||
482 | 605 | return freight_allowed | ||
483 | 606 | |||
484 | 607 | _columns = { | 675 | _columns = { |
485 | 608 | 'delivery_order_id': fields.many2one('stock.picking', 'Delivery Order', readonly="True"), | 676 | 'delivery_order_id': fields.many2one('stock.picking', 'Delivery Order', readonly="True"), |
486 | 609 | 'delivery_address_id': fields.many2one('res.partner', 'Delivery Address'), | 677 | 'delivery_address_id': fields.many2one('res.partner', 'Delivery Address'), |
487 | @@ -615,8 +683,8 @@ | |||
488 | 615 | 'dispatch_doc_no': fields.char('Dispatch Document No.', size=16), | 683 | 'dispatch_doc_no': fields.char('Dispatch Document No.', size=16), |
489 | 616 | 'dispatch_doc_date': fields.date('Dispatch Document Date'), | 684 | 'dispatch_doc_date': fields.date('Dispatch Document Date'), |
490 | 617 | 'consignee_account': fields.char('Consignee Account', size=32, help="Account Name, applies when there is customer for consignee."), | 685 | 'consignee_account': fields.char('Consignee Account', size=32, help="Account Name, applies when there is customer for consignee."), |
493 | 618 | 'dealers_disc': fields.function(_get_difference, type="float", string='Dealers Discount', store=True), | 686 | 'dealers_disc': fields.function(_get_pack_total, type="float", string='Dealers Discount', store=True, multi='_get_pack_total'), |
494 | 619 | 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True), | 687 | 'packing_total': fields.function(_get_pack_total, type="float", string='Packing Cost', store=True, multi='_get_pack_total'), |
495 | 620 | 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Subtotal', track_visibility='always', | 688 | 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Subtotal', track_visibility='always', |
496 | 621 | store={ | 689 | store={ |
497 | 622 | 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20), | 690 | 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20), |
498 | @@ -645,46 +713,31 @@ | |||
499 | 645 | } | 713 | } |
500 | 646 | 714 | ||
501 | 647 | _defaults = { | 715 | _defaults = { |
503 | 648 | 'freight_allowed': _check_freight_allowed, | 716 | 'freight_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).freight, |
504 | 649 | } | 717 | } |
505 | 650 | 718 | ||
506 | 651 | # def button_reset_taxes(self, cr, uid, ids, context=None): | ||
507 | 652 | # if context is None: | ||
508 | 653 | # context = {} | ||
509 | 654 | # ctx = context.copy() | ||
510 | 655 | # ait_obj = self.pool.get('account.invoice.tax') | ||
511 | 656 | # for id in ids: | ||
512 | 657 | # cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s AND manual is False", (id,)) | ||
513 | 658 | # partner = self.browse(cr, uid, id, context=ctx).partner_id | ||
514 | 659 | # if partner.lang: | ||
515 | 660 | # ctx.update({'lang': partner.lang}) | ||
516 | 661 | # for taxe in ait_obj.compute(cr, uid, id, context=ctx).values(): | ||
517 | 662 | # ait_obj.create(cr, uid, taxe) | ||
518 | 663 | # # Update the stored value (fields.function), so we write to trigger recompute | ||
519 | 664 | # self.pool.get('account.invoice').write(cr, uid, ids, {'invoice_line':[]}, context=ctx) | ||
520 | 665 | # return True | ||
521 | 666 | # | ||
522 | 667 | # def button_compute(self, cr, uid, ids, context=None, set_total=False): | ||
523 | 668 | # self.button_reset_taxes(cr, uid, ids, context) | ||
524 | 669 | # for inv in self.browse(cr, uid, ids, context=context): | ||
525 | 670 | # if set_total: | ||
526 | 671 | # self.pool.get('account.invoice').write(cr, uid, [inv.id], {'check_total': inv.amount_total}) | ||
527 | 672 | # return True | ||
528 | 673 | |||
529 | 674 | class account_invoice_line(osv.osv): | 719 | class account_invoice_line(osv.osv): |
530 | 675 | 720 | ||
531 | 676 | _inherit = 'account.invoice.line' | 721 | _inherit = 'account.invoice.line' |
532 | 677 | 722 | ||
533 | 678 | def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict): | 723 | def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict): |
534 | 724 | ''' | ||
535 | 725 | The purpose of this function to give price subtotal. | ||
536 | 726 | :param: ids: list of invoice line record ids. | ||
537 | 727 | :param: prop: field price subtotal | ||
538 | 728 | :return: calculted price subtotal value. | ||
539 | 729 | :rtype: dictionary | ||
540 | 730 | ''' | ||
541 | 679 | res = super(account_invoice_line, self)._amount_line(cr, uid, ids, prop, unknow_none, unknow_dict) | 731 | res = super(account_invoice_line, self)._amount_line(cr, uid, ids, prop, unknow_none, unknow_dict) |
542 | 680 | packing_cost_allowed = False | 732 | packing_cost_allowed = False |
546 | 681 | for id in ids: | 733 | for invoice_line_id in ids: |
547 | 682 | if self.browse(cr, uid, id).invoice_id: | 734 | if self.browse(cr, uid, invoice_line_id).invoice_id: |
548 | 683 | packing_cost_allowed = self.browse(cr, uid, id).invoice_id.company_id.packing_cost | 735 | packing_cost_allowed = self.browse(cr, uid, invoice_line_id).invoice_id.company_id.packing_cost |
549 | 684 | if packing_cost_allowed: | 736 | if packing_cost_allowed: |
550 | 685 | for account_invoice_line_id in res: | 737 | for account_invoice_line_id in res: |
553 | 686 | qty = self.browse(cr, uid, account_invoice_line_id).quantity | 738 | account_invoice_line_obj = self.browse(cr, uid, account_invoice_line_id) |
554 | 687 | packing_amount = self.browse(cr, uid, account_invoice_line_id).packing_amount | 739 | qty = account_invoice_line_obj.quantity |
555 | 740 | packing_amount = account_invoice_line_obj.packing_amount | ||
556 | 688 | res[account_invoice_line_id] += qty * packing_amount | 741 | res[account_invoice_line_id] += qty * packing_amount |
557 | 689 | return res | 742 | return res |
558 | 690 | 743 | ||
559 | @@ -695,8 +748,12 @@ | |||
560 | 695 | } | 748 | } |
561 | 696 | 749 | ||
562 | 697 | def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None): | 750 | def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None): |
563 | 751 | ''' | ||
564 | 752 | The purpose of this function to get value of price unit, list price and packing amount on product value change. | ||
565 | 753 | :return: return this value price unit, list price, packing amount | ||
566 | 754 | :rtype: dictionary | ||
567 | 755 | ''' | ||
568 | 698 | res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty=qty, name=name, type=type, partner_id=partner_id, fposition_id=fposition_id, price_unit=price_unit, currency_id=currency_id, context=context, company_id=company_id) | 756 | res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty=qty, name=name, type=type, partner_id=partner_id, fposition_id=fposition_id, price_unit=price_unit, currency_id=currency_id, context=context, company_id=company_id) |
569 | 699 | partner_obj = self.pool.get('res.partner') | ||
570 | 700 | product_obj = self.pool.get('product.product') | 757 | product_obj = self.pool.get('product.product') |
571 | 701 | 758 | ||
572 | 702 | if product: | 759 | if product: |
573 | @@ -705,7 +762,7 @@ | |||
574 | 705 | 762 | ||
575 | 706 | # Dealer's Discount Feature | 763 | # Dealer's Discount Feature |
576 | 707 | if dealers_discount_allowed: | 764 | if dealers_discount_allowed: |
578 | 708 | partner_rec = partner_obj.browse(cr, uid, partner_id, context=context) | 765 | partner_rec = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) |
579 | 709 | if not partner_rec.dealer_id: | 766 | if not partner_rec.dealer_id: |
580 | 710 | res['value']['price_unit'] = res['value']['price_unit'] | 767 | res['value']['price_unit'] = res['value']['price_unit'] |
581 | 711 | else: | 768 | else: |
582 | @@ -726,6 +783,13 @@ | |||
583 | 726 | _inherit = "account.invoice.tax" | 783 | _inherit = "account.invoice.tax" |
584 | 727 | 784 | ||
585 | 728 | def compute(self, cr, uid, invoice_id, context=None): | 785 | def compute(self, cr, uid, invoice_id, context=None): |
586 | 786 | ''' | ||
587 | 787 | The purpose of this function calculate the total tax amount include price of product and check invoice out/in | ||
588 | 788 | base_amount + tax_amount | ||
589 | 789 | @param ids: pass invoice id include tax for the product | ||
590 | 790 | @return: return tax category,total tax,product price * unit,invoice tax code,account ids etc.. | ||
591 | 791 | @rtype : dict | ||
592 | 792 | ''' | ||
593 | 729 | tax_grouped = {} | 793 | tax_grouped = {} |
594 | 730 | tax_obj = self.pool.get('account.tax') | 794 | tax_obj = self.pool.get('account.tax') |
595 | 731 | cur_obj = self.pool.get('res.currency') | 795 | cur_obj = self.pool.get('res.currency') |
596 | @@ -784,29 +848,27 @@ | |||
597 | 784 | class purchase_order(osv.osv): | 848 | class purchase_order(osv.osv): |
598 | 785 | _inherit = 'purchase.order' | 849 | _inherit = 'purchase.order' |
599 | 786 | 850 | ||
600 | 787 | # def amount_to_text(self, amount): | ||
601 | 788 | # amount_in_word = amount_to_text(amount) | ||
602 | 789 | # amount_in_word = amount_in_word.replace("euro", "Rupees").replace("Cents", "Paise").replace("Cent", "Paise") | ||
603 | 790 | # return amount_in_word | ||
604 | 791 | |||
605 | 792 | def _amount_all(self, cr, uid, ids, field_name, arg, context=None): | 851 | def _amount_all(self, cr, uid, ids, field_name, arg, context=None): |
606 | 852 | """ | ||
607 | 853 | override function from purchase order to add inward freigh value with amount total. | ||
608 | 854 | return: amount total with inward freight value | ||
609 | 855 | """ | ||
610 | 793 | res = super(purchase_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context) | 856 | res = super(purchase_order, self)._amount_all(cr, uid, ids, field_name, arg, context=context) |
611 | 794 | for purchase_id in res: | 857 | for purchase_id in res: |
613 | 795 | freight_allowed = self.browse(cr, uid, purchase_id, context=context).company_id.freight | 858 | purchase_order_obj = self.browse(cr, uid, purchase_id, context=context) |
614 | 859 | freight_allowed = purchase_order_obj.company_id.freight | ||
615 | 796 | if freight_allowed: | 860 | if freight_allowed: |
617 | 797 | inward_freight = self.browse(cr, uid, purchase_id, context=context).inward_freight | 861 | inward_freight = purchase_order_obj.inward_freight |
618 | 798 | res[purchase_id]['amount_total'] += inward_freight | 862 | res[purchase_id]['amount_total'] += inward_freight |
619 | 799 | return res | 863 | return res |
620 | 800 | 864 | ||
621 | 801 | def _get_order(self, cr, uid, ids, context=None): | 865 | def _get_order(self, cr, uid, ids, context=None): |
622 | 866 | """ | ||
623 | 867 | The purpose of this function is to recalculate amount total based on order line | ||
624 | 868 | """ | ||
625 | 802 | res = super(purchase_order, self.pool.get('purchase.order'))._get_order(cr, uid, ids, context=context) | 869 | res = super(purchase_order, self.pool.get('purchase.order'))._get_order(cr, uid, ids, context=context) |
626 | 803 | return res | 870 | return res |
627 | 804 | 871 | ||
628 | 805 | def _check_freight_allowed(self, cr, uid, ids, context=None): | ||
629 | 806 | res_company = self.pool.get('res.company') | ||
630 | 807 | freight_allowed = res_company.browse(cr, uid, uid, context=context).freight | ||
631 | 808 | return freight_allowed | ||
632 | 809 | |||
633 | 810 | _columns = { | 872 | _columns = { |
634 | 811 | 'inward_freight': fields.float('Inward Freight'), | 873 | 'inward_freight': fields.float('Inward Freight'), |
635 | 812 | 'freight_allowed': fields.boolean('Freight Allowed'), | 874 | 'freight_allowed': fields.boolean('Freight Allowed'), |
636 | @@ -826,7 +888,7 @@ | |||
637 | 826 | } | 888 | } |
638 | 827 | 889 | ||
639 | 828 | _defaults = { | 890 | _defaults = { |
641 | 829 | 'freight_allowed': _check_freight_allowed, | 891 | 'freight_allowed': lambda self, cr, uid, context: self.pool.get('res.company').browse(cr, uid, uid, context=context).freight, |
642 | 830 | } | 892 | } |
643 | 831 | 893 | ||
644 | 832 | 894 | ||
645 | @@ -839,9 +901,10 @@ | |||
646 | 839 | res = super(purchase_order, self).action_invoice_create(cr, uid, ids, context=context) | 901 | res = super(purchase_order, self).action_invoice_create(cr, uid, ids, context=context) |
647 | 840 | account_invoice_obj = self.pool.get('account.invoice') | 902 | account_invoice_obj = self.pool.get('account.invoice') |
648 | 841 | freight_allowed = False | 903 | freight_allowed = False |
652 | 842 | for id in ids: | 904 | for purchase_order_id in ids: |
653 | 843 | freight_allowed = self.browse(cr, uid, id, context=context).company_id.freight | 905 | purchase_order_obj = self.browse(cr, uid, purchase_order_id, context=context) |
654 | 844 | inward_freight = self.browse(cr, uid, id, context=context).inward_freight | 906 | freight_allowed = purchase_order_obj.company_id.freight |
655 | 907 | inward_freight = purchase_order_obj.inward_freight | ||
656 | 845 | if freight_allowed: | 908 | if freight_allowed: |
657 | 846 | account_invoice_obj.write(cr, uid, res, {'freight_charge': inward_freight}, context=context) | 909 | account_invoice_obj.write(cr, uid, res, {'freight_charge': inward_freight}, context=context) |
658 | 847 | account_invoice_obj.button_compute(cr, uid, [res], context=context, set_total=True) | 910 | account_invoice_obj.button_compute(cr, uid, [res], context=context, set_total=True) |
659 | 848 | 911 | ||
660 | === modified file 'l10n_in_tax_retail_invoice/report/purchase_order.py' | |||
661 | --- l10n_in_tax_retail_invoice/report/purchase_order.py 2013-05-23 08:40:28 +0000 | |||
662 | +++ l10n_in_tax_retail_invoice/report/purchase_order.py 2013-06-20 10:57:25 +0000 | |||
663 | @@ -21,7 +21,7 @@ | |||
664 | 21 | 21 | ||
665 | 22 | import time | 22 | import time |
666 | 23 | 23 | ||
668 | 24 | from report import report_sxw | 24 | from openerp.report import report_sxw |
669 | 25 | 25 | ||
670 | 26 | class purchase_order(report_sxw.rml_parse): | 26 | class purchase_order(report_sxw.rml_parse): |
671 | 27 | 27 | ||
672 | 28 | 28 | ||
673 | === modified file 'l10n_in_tax_retail_invoice/report/quotation.py' | |||
674 | --- l10n_in_tax_retail_invoice/report/quotation.py 2013-05-23 08:40:28 +0000 | |||
675 | +++ l10n_in_tax_retail_invoice/report/quotation.py 2013-06-20 10:57:25 +0000 | |||
676 | @@ -21,7 +21,7 @@ | |||
677 | 21 | 21 | ||
678 | 22 | import time | 22 | import time |
679 | 23 | 23 | ||
681 | 24 | from report import report_sxw | 24 | from openerp.report import report_sxw |
682 | 25 | 25 | ||
683 | 26 | class quotation(report_sxw.rml_parse): | 26 | class quotation(report_sxw.rml_parse): |
684 | 27 | 27 | ||
685 | 28 | 28 | ||
686 | === modified file 'l10n_in_tax_retail_invoice/report/sale_order_tax.py' | |||
687 | --- l10n_in_tax_retail_invoice/report/sale_order_tax.py 2013-05-23 08:40:28 +0000 | |||
688 | +++ l10n_in_tax_retail_invoice/report/sale_order_tax.py 2013-06-20 10:57:25 +0000 | |||
689 | @@ -20,7 +20,7 @@ | |||
690 | 20 | ############################################################################## | 20 | ############################################################################## |
691 | 21 | 21 | ||
692 | 22 | import time | 22 | import time |
694 | 23 | from report import report_sxw | 23 | from openerp.report import report_sxw |
695 | 24 | from openerp.tools.translate import _ | 24 | from openerp.tools.translate import _ |
696 | 25 | from openerp.osv import fields, osv | 25 | from openerp.osv import fields, osv |
697 | 26 | 26 | ||
698 | 27 | 27 | ||
699 | === modified file 'l10n_in_tax_retail_invoice/report/sale_order_tax.rml' | |||
700 | --- l10n_in_tax_retail_invoice/report/sale_order_tax.rml 2013-05-23 08:40:28 +0000 | |||
701 | +++ l10n_in_tax_retail_invoice/report/sale_order_tax.rml 2013-06-20 10:57:25 +0000 | |||
702 | @@ -247,12 +247,12 @@ | |||
703 | 247 | <font face="Helvetica-Bold">Sales Order</font> | 247 | <font face="Helvetica-Bold">Sales Order</font> |
704 | 248 | <font color="white">..................................................................</font> | 248 | <font color="white">..................................................................</font> |
705 | 249 | </para> | 249 | </para> |
707 | 250 | <blockTable colWidths="240.0,113.0,177.0" style="Table9"> | 250 | <blockTable colWidths="200.0,133.0,197.0" style="Table9"> |
708 | 251 | <tr> | 251 | <tr> |
709 | 252 | <td> | 252 | <td> |
710 | 253 | <para style="P22">Buyer (if other than consignee)</para> | 253 | <para style="P22">Buyer (if other than consignee)</para> |
711 | 254 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> | 254 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> |
713 | 255 | <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para> | 255 | <para style="P21">[[ display_address(o.partner_id) ]]</para> |
714 | 256 | </td> | 256 | </td> |
715 | 257 | <td> | 257 | <td> |
716 | 258 | <para style="P10">Order No.</para> | 258 | <para style="P10">Order No.</para> |
717 | @@ -265,7 +265,7 @@ | |||
718 | 265 | </tr> | 265 | </tr> |
719 | 266 | <tr> | 266 | <tr> |
720 | 267 | <td> | 267 | <td> |
722 | 268 | <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '' ]], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para> | 268 | <para style="P21"></para> |
723 | 269 | </td> | 269 | </td> |
724 | 270 | <td> | 270 | <td> |
725 | 271 | <para style="P10">Mode/Terms of Payment</para> | 271 | <para style="P10">Mode/Terms of Payment</para> |
726 | @@ -277,14 +277,14 @@ | |||
727 | 277 | </td> | 277 | </td> |
728 | 278 | </tr> | 278 | </tr> |
729 | 279 | </blockTable> | 279 | </blockTable> |
731 | 280 | <blockTable colWidths="240.0,113.0,177.0" style="Table10"> | 280 | <blockTable colWidths="200.0,133.0,197.0" style="Table10"> |
732 | 281 | <tr> | 281 | <tr> |
733 | 282 | <td> | 282 | <td> |
734 | 283 | <para style="P17"> | 283 | <para style="P17"> |
735 | 284 | <font face="Helvetica" size="8.0">Consignee</font> | 284 | <font face="Helvetica" size="8.0">Consignee</font> |
736 | 285 | </para> | 285 | </para> |
737 | 286 | <para style="P23">[[ (o.partner_shipping_id and o.partner_shipping_id.title and o.partner_shipping_id.title.name) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.name) or '' ]]</para> | 286 | <para style="P23">[[ (o.partner_shipping_id and o.partner_shipping_id.title and o.partner_shipping_id.title.name) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.name) or '' ]]</para> |
739 | 287 | <para style="P21">[[ (o.partner_shipping_id and o.partner_shipping_id.street) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.street2)]]</para> | 287 | <para style="P21">[[ display_address(o.partner_shipping_id) ]]</para> |
740 | 288 | </td> | 288 | </td> |
741 | 289 | <td> | 289 | <td> |
742 | 290 | <para style="P10">Buyer's Order No.</para> | 290 | <para style="P10">Buyer's Order No.</para> |
743 | @@ -297,7 +297,7 @@ | |||
744 | 297 | </tr> | 297 | </tr> |
745 | 298 | <tr> | 298 | <tr> |
746 | 299 | <td> | 299 | <td> |
748 | 300 | <para style="P21">[[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '' ]], [[ (o.partner_shipping_id and o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name)]].</para> | 300 | <para style="P21"></para> |
749 | 301 | </td> | 301 | </td> |
750 | 302 | <td> | 302 | <td> |
751 | 303 | <para style="P10">Dispatched through</para> | 303 | <para style="P10">Dispatched through</para> |
752 | @@ -309,7 +309,7 @@ | |||
753 | 309 | </td> | 309 | </td> |
754 | 310 | </tr> | 310 | </tr> |
755 | 311 | </blockTable> | 311 | </blockTable> |
757 | 312 | <blockTable colWidths="240.0,290.0" style="Table11"> | 312 | <blockTable colWidths="200.0,330.0" style="Table11"> |
758 | 313 | <tr> | 313 | <tr> |
759 | 314 | <td> | 314 | <td> |
760 | 315 | </td> | 315 | </td> |
761 | @@ -677,7 +677,7 @@ | |||
762 | 677 | <para style="terp_default_9"> | 677 | <para style="terp_default_9"> |
763 | 678 | <font color="white"> </font> | 678 | <font color="white"> </font> |
764 | 679 | </para> | 679 | </para> |
766 | 680 | <blockTable colWidths="334.0,197.0" style="Table8"> | 680 | <blockTable colWidths="334.0,205.0" style="Table8"> |
767 | 681 | <tr> | 681 | <tr> |
768 | 682 | <td> | 682 | <td> |
769 | 683 | <para style="terp_default_9">Declaration</para> | 683 | <para style="terp_default_9">Declaration</para> |
770 | 684 | 684 | ||
771 | === modified file 'l10n_in_tax_retail_invoice/report/tax_invoice.py' | |||
772 | --- l10n_in_tax_retail_invoice/report/tax_invoice.py 2013-05-23 08:40:28 +0000 | |||
773 | +++ l10n_in_tax_retail_invoice/report/tax_invoice.py 2013-06-20 10:57:25 +0000 | |||
774 | @@ -21,7 +21,7 @@ | |||
775 | 21 | 21 | ||
776 | 22 | import time | 22 | import time |
777 | 23 | 23 | ||
779 | 24 | from report import report_sxw | 24 | from openerp.report import report_sxw |
780 | 25 | 25 | ||
781 | 26 | class tax_invoice(report_sxw.rml_parse): | 26 | class tax_invoice(report_sxw.rml_parse): |
782 | 27 | 27 | ||
783 | 28 | 28 | ||
784 | === modified file 'l10n_in_tax_retail_invoice/report/tax_invoice.rml' | |||
785 | --- l10n_in_tax_retail_invoice/report/tax_invoice.rml 2013-05-23 08:40:28 +0000 | |||
786 | +++ l10n_in_tax_retail_invoice/report/tax_invoice.rml 2013-06-20 10:57:25 +0000 | |||
787 | @@ -241,12 +241,12 @@ | |||
788 | 241 | <font color="white">.............................................................</font> | 241 | <font color="white">.............................................................</font> |
789 | 242 | <font face="Helvetica" size="7.0">(Original)</font> | 242 | <font face="Helvetica" size="7.0">(Original)</font> |
790 | 243 | </para> | 243 | </para> |
792 | 244 | <blockTable colWidths="230.0,140.0,160.0" style="Table9"> | 244 | <blockTable colWidths="210.0,160.0,160.0" style="Table9"> |
793 | 245 | <tr> | 245 | <tr> |
794 | 246 | <td> | 246 | <td> |
795 | 247 | <para style="P22">Buyer (if other than consignee)</para> | 247 | <para style="P22">Buyer (if other than consignee)</para> |
796 | 248 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> | 248 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> |
798 | 249 | <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para> | 249 | <para style="P21">[[ display_address(o.partner_id) ]]</para> |
799 | 250 | </td> | 250 | </td> |
800 | 251 | <td> | 251 | <td> |
801 | 252 | <para style="P10">Invoice No.</para> | 252 | <para style="P10">Invoice No.</para> |
802 | @@ -259,8 +259,6 @@ | |||
803 | 259 | </tr> | 259 | </tr> |
804 | 260 | <tr> | 260 | <tr> |
805 | 261 | <td> | 261 | <td> |
806 | 262 | <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para> | ||
807 | 263 | <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para> | ||
808 | 264 | </td> | 262 | </td> |
809 | 265 | <td> | 263 | <td> |
810 | 266 | <para style="P10">Delivery Note</para> | 264 | <para style="P10">Delivery Note</para> |
811 | @@ -287,14 +285,14 @@ | |||
812 | 287 | </td> | 285 | </td> |
813 | 288 | </tr> | 286 | </tr> |
814 | 289 | </blockTable> | 287 | </blockTable> |
816 | 290 | <blockTable colWidths="230.0,140.0,160.0" style="Table10"> | 288 | <blockTable colWidths="210.0,160.0,160.0" style="Table10"> |
817 | 291 | <tr> | 289 | <tr> |
818 | 292 | <td> | 290 | <td> |
819 | 293 | <para style="P17"> | 291 | <para style="P17"> |
820 | 294 | <font face="Helvetica" size="8.0">Consignee</font> | 292 | <font face="Helvetica" size="8.0">Consignee</font> |
821 | 295 | </para> | 293 | </para> |
822 | 296 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> | 294 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> |
824 | 297 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para> | 295 | <para style="P21">[[ display_address(o.delivery_address_id) ]]</para> |
825 | 298 | </td> | 296 | </td> |
826 | 299 | <td> | 297 | <td> |
827 | 300 | <para style="P10">Buyer's Order No.</para> | 298 | <para style="P10">Buyer's Order No.</para> |
828 | @@ -307,8 +305,6 @@ | |||
829 | 307 | </tr> | 305 | </tr> |
830 | 308 | <tr> | 306 | <tr> |
831 | 309 | <td> | 307 | <td> |
832 | 310 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para> | ||
833 | 311 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para> | ||
834 | 312 | </td> | 308 | </td> |
835 | 313 | <td> | 309 | <td> |
836 | 314 | <para style="P10">Dispatch Document No.</para> | 310 | <para style="P10">Dispatch Document No.</para> |
837 | @@ -333,7 +329,7 @@ | |||
838 | 333 | </td> | 329 | </td> |
839 | 334 | </tr> | 330 | </tr> |
840 | 335 | </blockTable> | 331 | </blockTable> |
842 | 336 | <blockTable colWidths="230.0,300.0" style="Table11"> | 332 | <blockTable colWidths="210.0,320.0" style="Table11"> |
843 | 337 | <tr> | 333 | <tr> |
844 | 338 | <td> | 334 | <td> |
845 | 339 | <para style="P1"> | 335 | <para style="P1"> |
846 | @@ -347,7 +343,7 @@ | |||
847 | 347 | </tr> | 343 | </tr> |
848 | 348 | </blockTable> | 344 | </blockTable> |
849 | 349 | 345 | ||
851 | 350 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 346 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
852 | 351 | <tr> | 347 | <tr> |
853 | 352 | <td> | 348 | <td> |
854 | 353 | <para style="P1">Description of Goods</para> | 349 | <para style="P1">Description of Goods</para> |
855 | @@ -398,7 +394,7 @@ | |||
856 | 398 | 394 | ||
857 | 399 | <section> | 395 | <section> |
858 | 400 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> | 396 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> |
860 | 401 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 397 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
861 | 402 | <tr> | 398 | <tr> |
862 | 403 | <td> | 399 | <td> |
863 | 404 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> | 400 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> |
864 | @@ -515,7 +511,7 @@ | |||
865 | 515 | 511 | ||
866 | 516 | <section> | 512 | <section> |
867 | 517 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> | 513 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> |
869 | 518 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] | 514 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] |
870 | 519 | <tr> | 515 | <tr> |
871 | 520 | <td> | 516 | <td> |
872 | 521 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> | 517 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> |
873 | @@ -579,7 +575,76 @@ | |||
874 | 579 | </blockTable> | 575 | </blockTable> |
875 | 580 | </section> | 576 | </section> |
876 | 581 | 577 | ||
878 | 582 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | 578 | <section> |
879 | 579 | <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]] | ||
880 | 580 | <tr> | ||
881 | 581 | <td> | ||
882 | 582 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
883 | 583 | </td> | ||
884 | 584 | <td> | ||
885 | 585 | <para style="P1"> | ||
886 | 586 | <font color="white"> </font> | ||
887 | 587 | </para> | ||
888 | 588 | </td> | ||
889 | 589 | <td> | ||
890 | 590 | <para style="P1"> | ||
891 | 591 | <font color="white"> </font> | ||
892 | 592 | </para> | ||
893 | 593 | </td> | ||
894 | 594 | <td> | ||
895 | 595 | <para style="P1"> | ||
896 | 596 | <font color="white"> </font> | ||
897 | 597 | </para> | ||
898 | 598 | </td> | ||
899 | 599 | <td> | ||
900 | 600 | <para style="P1"> | ||
901 | 601 | <font color="white"> </font> | ||
902 | 602 | </para> | ||
903 | 603 | </td> | ||
904 | 604 | <td> | ||
905 | 605 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
906 | 606 | </td> | ||
907 | 607 | </tr> | ||
908 | 608 | </blockTable> | ||
909 | 609 | |||
910 | 610 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]] | ||
911 | 611 | <tr> | ||
912 | 612 | <td> | ||
913 | 613 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
914 | 614 | </td> | ||
915 | 615 | <td> | ||
916 | 616 | <para style="P1"> | ||
917 | 617 | <font color="white"> </font> | ||
918 | 618 | </para> | ||
919 | 619 | </td> | ||
920 | 620 | <td> | ||
921 | 621 | <para style="P1"> | ||
922 | 622 | <font color="white"> </font> | ||
923 | 623 | </para> | ||
924 | 624 | </td> | ||
925 | 625 | <td> | ||
926 | 626 | <para style="P1"> | ||
927 | 627 | <font color="white"> </font> | ||
928 | 628 | </para> | ||
929 | 629 | </td> | ||
930 | 630 | <td> | ||
931 | 631 | <para style="P1"> | ||
932 | 632 | <font color="white"> </font> | ||
933 | 633 | </para> | ||
934 | 634 | </td> | ||
935 | 635 | <td> | ||
936 | 636 | <para style="P1"> | ||
937 | 637 | <font color="white"> </font> | ||
938 | 638 | </para> | ||
939 | 639 | </td> | ||
940 | 640 | <td> | ||
941 | 641 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
942 | 642 | </td> | ||
943 | 643 | </tr> | ||
944 | 644 | </blockTable> | ||
945 | 645 | </section> | ||
946 | 646 | |||
947 | 647 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | ||
948 | 583 | <tr> | 648 | <tr> |
949 | 584 | <td> | 649 | <td> |
950 | 585 | <para style="terp_default_10">Dealers' Discount </para> | 650 | <para style="terp_default_10">Dealers' Discount </para> |
951 | @@ -640,7 +705,7 @@ | |||
952 | 640 | </tr> | 705 | </tr> |
953 | 641 | </blockTable> | 706 | </blockTable> |
954 | 642 | 707 | ||
956 | 643 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 708 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
957 | 644 | <tr> | 709 | <tr> |
958 | 645 | <td> | 710 | <td> |
959 | 646 | <para style="terp_default_10">Total</para> | 711 | <para style="terp_default_10">Total</para> |
960 | @@ -703,7 +768,7 @@ | |||
961 | 703 | <para style="terp_default_9"> | 768 | <para style="terp_default_9"> |
962 | 704 | <font color="white"> </font> | 769 | <font color="white"> </font> |
963 | 705 | </para> | 770 | </para> |
965 | 706 | <blockTable colWidths="334.0,197.0" style="Table8"> | 771 | <blockTable colWidths="334.0,205.0" style="Table8"> |
966 | 707 | <tr> | 772 | <tr> |
967 | 708 | <td> | 773 | <td> |
968 | 709 | <para style="terp_default_9">Declaration</para> | 774 | <para style="terp_default_9">Declaration</para> |
969 | @@ -750,12 +815,12 @@ | |||
970 | 750 | <font color="white">..........................................................</font> | 815 | <font color="white">..........................................................</font> |
971 | 751 | <font face="Helvetica" size="7.0">(Duplicate)</font> | 816 | <font face="Helvetica" size="7.0">(Duplicate)</font> |
972 | 752 | </para> | 817 | </para> |
974 | 753 | <blockTable colWidths="230.0,140.0,160.0" style="Table9"> | 818 | <blockTable colWidths="210.0,160.0,160.0" style="Table9"> |
975 | 754 | <tr> | 819 | <tr> |
976 | 755 | <td> | 820 | <td> |
977 | 756 | <para style="P22">Buyer (if other than consignee)</para> | 821 | <para style="P22">Buyer (if other than consignee)</para> |
978 | 757 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> | 822 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> |
980 | 758 | <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para> | 823 | <para style="P21">[[ display_address(o.partner_id) ]]</para> |
981 | 759 | </td> | 824 | </td> |
982 | 760 | <td> | 825 | <td> |
983 | 761 | <para style="P10">Invoice No.</para> | 826 | <para style="P10">Invoice No.</para> |
984 | @@ -768,8 +833,6 @@ | |||
985 | 768 | </tr> | 833 | </tr> |
986 | 769 | <tr> | 834 | <tr> |
987 | 770 | <td> | 835 | <td> |
988 | 771 | <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para> | ||
989 | 772 | <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para> | ||
990 | 773 | </td> | 836 | </td> |
991 | 774 | <td> | 837 | <td> |
992 | 775 | <para style="P10">Delivery Note</para> | 838 | <para style="P10">Delivery Note</para> |
993 | @@ -796,14 +859,14 @@ | |||
994 | 796 | </td> | 859 | </td> |
995 | 797 | </tr> | 860 | </tr> |
996 | 798 | </blockTable> | 861 | </blockTable> |
998 | 799 | <blockTable colWidths="230.0,140.0,160.0" style="Table10"> | 862 | <blockTable colWidths="210.0,160.0,160.0" style="Table10"> |
999 | 800 | <tr> | 863 | <tr> |
1000 | 801 | <td> | 864 | <td> |
1001 | 802 | <para style="P17"> | 865 | <para style="P17"> |
1002 | 803 | <font face="Helvetica" size="8.0">Consignee</font> | 866 | <font face="Helvetica" size="8.0">Consignee</font> |
1003 | 804 | </para> | 867 | </para> |
1004 | 805 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> | 868 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> |
1006 | 806 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para> | 869 | <para style="P21">[[ display_address(o.delivery_address_id) ]]</para> |
1007 | 807 | </td> | 870 | </td> |
1008 | 808 | <td> | 871 | <td> |
1009 | 809 | <para style="P10">Buyer's Order No.</para> | 872 | <para style="P10">Buyer's Order No.</para> |
1010 | @@ -816,8 +879,6 @@ | |||
1011 | 816 | </tr> | 879 | </tr> |
1012 | 817 | <tr> | 880 | <tr> |
1013 | 818 | <td> | 881 | <td> |
1014 | 819 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para> | ||
1015 | 820 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para> | ||
1016 | 821 | </td> | 882 | </td> |
1017 | 822 | <td> | 883 | <td> |
1018 | 823 | <para style="P10">Dispatch Document No.</para> | 884 | <para style="P10">Dispatch Document No.</para> |
1019 | @@ -842,7 +903,7 @@ | |||
1020 | 842 | </td> | 903 | </td> |
1021 | 843 | </tr> | 904 | </tr> |
1022 | 844 | </blockTable> | 905 | </blockTable> |
1024 | 845 | <blockTable colWidths="230.0,300.0" style="Table11"> | 906 | <blockTable colWidths="210.0,320.0" style="Table11"> |
1025 | 846 | <tr> | 907 | <tr> |
1026 | 847 | <td> | 908 | <td> |
1027 | 848 | <para style="P1"> | 909 | <para style="P1"> |
1028 | @@ -856,7 +917,7 @@ | |||
1029 | 856 | </tr> | 917 | </tr> |
1030 | 857 | </blockTable> | 918 | </blockTable> |
1031 | 858 | 919 | ||
1033 | 859 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 920 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1034 | 860 | <tr> | 921 | <tr> |
1035 | 861 | <td> | 922 | <td> |
1036 | 862 | <para style="P1">Description of Goods</para> | 923 | <para style="P1">Description of Goods</para> |
1037 | @@ -907,7 +968,7 @@ | |||
1038 | 907 | 968 | ||
1039 | 908 | <section> | 969 | <section> |
1040 | 909 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> | 970 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> |
1042 | 910 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 971 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1043 | 911 | <tr> | 972 | <tr> |
1044 | 912 | <td> | 973 | <td> |
1045 | 913 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> | 974 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> |
1046 | @@ -1024,7 +1085,7 @@ | |||
1047 | 1024 | 1085 | ||
1048 | 1025 | <section> | 1086 | <section> |
1049 | 1026 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> | 1087 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> |
1051 | 1027 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] | 1088 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] |
1052 | 1028 | <tr> | 1089 | <tr> |
1053 | 1029 | <td> | 1090 | <td> |
1054 | 1030 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> | 1091 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> |
1055 | @@ -1087,7 +1148,76 @@ | |||
1056 | 1087 | </tr> | 1148 | </tr> |
1057 | 1088 | </blockTable> | 1149 | </blockTable> |
1058 | 1089 | </section> | 1150 | </section> |
1060 | 1090 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | 1151 | |
1061 | 1152 | <section> | ||
1062 | 1153 | <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]] | ||
1063 | 1154 | <tr> | ||
1064 | 1155 | <td> | ||
1065 | 1156 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
1066 | 1157 | </td> | ||
1067 | 1158 | <td> | ||
1068 | 1159 | <para style="P1"> | ||
1069 | 1160 | <font color="white"> </font> | ||
1070 | 1161 | </para> | ||
1071 | 1162 | </td> | ||
1072 | 1163 | <td> | ||
1073 | 1164 | <para style="P1"> | ||
1074 | 1165 | <font color="white"> </font> | ||
1075 | 1166 | </para> | ||
1076 | 1167 | </td> | ||
1077 | 1168 | <td> | ||
1078 | 1169 | <para style="P1"> | ||
1079 | 1170 | <font color="white"> </font> | ||
1080 | 1171 | </para> | ||
1081 | 1172 | </td> | ||
1082 | 1173 | <td> | ||
1083 | 1174 | <para style="P1"> | ||
1084 | 1175 | <font color="white"> </font> | ||
1085 | 1176 | </para> | ||
1086 | 1177 | </td> | ||
1087 | 1178 | <td> | ||
1088 | 1179 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
1089 | 1180 | </td> | ||
1090 | 1181 | </tr> | ||
1091 | 1182 | </blockTable> | ||
1092 | 1183 | |||
1093 | 1184 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]] | ||
1094 | 1185 | <tr> | ||
1095 | 1186 | <td> | ||
1096 | 1187 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
1097 | 1188 | </td> | ||
1098 | 1189 | <td> | ||
1099 | 1190 | <para style="P1"> | ||
1100 | 1191 | <font color="white"> </font> | ||
1101 | 1192 | </para> | ||
1102 | 1193 | </td> | ||
1103 | 1194 | <td> | ||
1104 | 1195 | <para style="P1"> | ||
1105 | 1196 | <font color="white"> </font> | ||
1106 | 1197 | </para> | ||
1107 | 1198 | </td> | ||
1108 | 1199 | <td> | ||
1109 | 1200 | <para style="P1"> | ||
1110 | 1201 | <font color="white"> </font> | ||
1111 | 1202 | </para> | ||
1112 | 1203 | </td> | ||
1113 | 1204 | <td> | ||
1114 | 1205 | <para style="P1"> | ||
1115 | 1206 | <font color="white"> </font> | ||
1116 | 1207 | </para> | ||
1117 | 1208 | </td> | ||
1118 | 1209 | <td> | ||
1119 | 1210 | <para style="P1"> | ||
1120 | 1211 | <font color="white"> </font> | ||
1121 | 1212 | </para> | ||
1122 | 1213 | </td> | ||
1123 | 1214 | <td> | ||
1124 | 1215 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
1125 | 1216 | </td> | ||
1126 | 1217 | </tr> | ||
1127 | 1218 | </blockTable> | ||
1128 | 1219 | </section> | ||
1129 | 1220 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | ||
1130 | 1091 | <tr> | 1221 | <tr> |
1131 | 1092 | <td> | 1222 | <td> |
1132 | 1093 | <para style="terp_default_10">Dealers' Discount </para> | 1223 | <para style="terp_default_10">Dealers' Discount </para> |
1133 | @@ -1149,7 +1279,7 @@ | |||
1134 | 1149 | </blockTable> | 1279 | </blockTable> |
1135 | 1150 | 1280 | ||
1136 | 1151 | 1281 | ||
1138 | 1152 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 1282 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1139 | 1153 | <tr> | 1283 | <tr> |
1140 | 1154 | <td> | 1284 | <td> |
1141 | 1155 | <para style="terp_default_10">Total</para> | 1285 | <para style="terp_default_10">Total</para> |
1142 | @@ -1212,7 +1342,7 @@ | |||
1143 | 1212 | <para style="terp_default_9"> | 1342 | <para style="terp_default_9"> |
1144 | 1213 | <font color="white"> </font> | 1343 | <font color="white"> </font> |
1145 | 1214 | </para> | 1344 | </para> |
1147 | 1215 | <blockTable colWidths="334.0,197.0" style="Table8"> | 1345 | <blockTable colWidths="334.0,205.0" style="Table8"> |
1148 | 1216 | <tr> | 1346 | <tr> |
1149 | 1217 | <td> | 1347 | <td> |
1150 | 1218 | <para style="terp_default_9">Declaration</para> | 1348 | <para style="terp_default_9">Declaration</para> |
1151 | @@ -1259,12 +1389,12 @@ | |||
1152 | 1259 | <font color="white">.........................................................</font> | 1389 | <font color="white">.........................................................</font> |
1153 | 1260 | <font face="Helvetica" size="7.0">(Triplicate)</font> | 1390 | <font face="Helvetica" size="7.0">(Triplicate)</font> |
1154 | 1261 | </para> | 1391 | </para> |
1156 | 1262 | <blockTable colWidths="230.0,140.0,160.0" style="Table9"> | 1392 | <blockTable colWidths="210.0,160.0,160.0" style="Table9"> |
1157 | 1263 | <tr> | 1393 | <tr> |
1158 | 1264 | <td> | 1394 | <td> |
1159 | 1265 | <para style="P22">Buyer (if other than consignee)</para> | 1395 | <para style="P22">Buyer (if other than consignee)</para> |
1160 | 1266 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> | 1396 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> |
1162 | 1267 | <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para> | 1397 | <para style="P21">[[ display_address(o.partner_id) ]]</para> |
1163 | 1268 | </td> | 1398 | </td> |
1164 | 1269 | <td> | 1399 | <td> |
1165 | 1270 | <para style="P10">Invoice No.</para> | 1400 | <para style="P10">Invoice No.</para> |
1166 | @@ -1277,8 +1407,6 @@ | |||
1167 | 1277 | </tr> | 1407 | </tr> |
1168 | 1278 | <tr> | 1408 | <tr> |
1169 | 1279 | <td> | 1409 | <td> |
1170 | 1280 | <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para> | ||
1171 | 1281 | <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para> | ||
1172 | 1282 | </td> | 1410 | </td> |
1173 | 1283 | <td> | 1411 | <td> |
1174 | 1284 | <para style="P10">Delivery Note</para> | 1412 | <para style="P10">Delivery Note</para> |
1175 | @@ -1305,14 +1433,14 @@ | |||
1176 | 1305 | </td> | 1433 | </td> |
1177 | 1306 | </tr> | 1434 | </tr> |
1178 | 1307 | </blockTable> | 1435 | </blockTable> |
1180 | 1308 | <blockTable colWidths="230.0,140.0,160.0" style="Table10"> | 1436 | <blockTable colWidths="210.0,160.0,160.0" style="Table10"> |
1181 | 1309 | <tr> | 1437 | <tr> |
1182 | 1310 | <td> | 1438 | <td> |
1183 | 1311 | <para style="P17"> | 1439 | <para style="P17"> |
1184 | 1312 | <font face="Helvetica" size="8.0">Consignee</font> | 1440 | <font face="Helvetica" size="8.0">Consignee</font> |
1185 | 1313 | </para> | 1441 | </para> |
1186 | 1314 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> | 1442 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> |
1188 | 1315 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para> | 1443 | <para style="P21">[[ display_address(o.delivery_address_id) ]]</para> |
1189 | 1316 | </td> | 1444 | </td> |
1190 | 1317 | <td> | 1445 | <td> |
1191 | 1318 | <para style="P10">Buyer's Order No.</para> | 1446 | <para style="P10">Buyer's Order No.</para> |
1192 | @@ -1325,8 +1453,6 @@ | |||
1193 | 1325 | </tr> | 1453 | </tr> |
1194 | 1326 | <tr> | 1454 | <tr> |
1195 | 1327 | <td> | 1455 | <td> |
1196 | 1328 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para> | ||
1197 | 1329 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para> | ||
1198 | 1330 | </td> | 1456 | </td> |
1199 | 1331 | <td> | 1457 | <td> |
1200 | 1332 | <para style="P10">Dispatch Document No.</para> | 1458 | <para style="P10">Dispatch Document No.</para> |
1201 | @@ -1351,7 +1477,7 @@ | |||
1202 | 1351 | </td> | 1477 | </td> |
1203 | 1352 | </tr> | 1478 | </tr> |
1204 | 1353 | </blockTable> | 1479 | </blockTable> |
1206 | 1354 | <blockTable colWidths="230.0,300.0" style="Table11"> | 1480 | <blockTable colWidths="210.0,320.0" style="Table11"> |
1207 | 1355 | <tr> | 1481 | <tr> |
1208 | 1356 | <td> | 1482 | <td> |
1209 | 1357 | <para style="P1"> | 1483 | <para style="P1"> |
1210 | @@ -1365,7 +1491,7 @@ | |||
1211 | 1365 | </tr> | 1491 | </tr> |
1212 | 1366 | </blockTable> | 1492 | </blockTable> |
1213 | 1367 | 1493 | ||
1215 | 1368 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 1494 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1216 | 1369 | <tr> | 1495 | <tr> |
1217 | 1370 | <td> | 1496 | <td> |
1218 | 1371 | <para style="P1">Description of Goods</para> | 1497 | <para style="P1">Description of Goods</para> |
1219 | @@ -1416,7 +1542,7 @@ | |||
1220 | 1416 | 1542 | ||
1221 | 1417 | <section> | 1543 | <section> |
1222 | 1418 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> | 1544 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> |
1224 | 1419 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 1545 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1225 | 1420 | <tr> | 1546 | <tr> |
1226 | 1421 | <td> | 1547 | <td> |
1227 | 1422 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> | 1548 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> |
1228 | @@ -1533,7 +1659,7 @@ | |||
1229 | 1533 | 1659 | ||
1230 | 1534 | <section> | 1660 | <section> |
1231 | 1535 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> | 1661 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> |
1233 | 1536 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] | 1662 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] |
1234 | 1537 | <tr> | 1663 | <tr> |
1235 | 1538 | <td> | 1664 | <td> |
1236 | 1539 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> | 1665 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> |
1237 | @@ -1597,7 +1723,76 @@ | |||
1238 | 1597 | </blockTable> | 1723 | </blockTable> |
1239 | 1598 | </section> | 1724 | </section> |
1240 | 1599 | 1725 | ||
1242 | 1600 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | 1726 | <section> |
1243 | 1727 | <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]] | ||
1244 | 1728 | <tr> | ||
1245 | 1729 | <td> | ||
1246 | 1730 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
1247 | 1731 | </td> | ||
1248 | 1732 | <td> | ||
1249 | 1733 | <para style="P1"> | ||
1250 | 1734 | <font color="white"> </font> | ||
1251 | 1735 | </para> | ||
1252 | 1736 | </td> | ||
1253 | 1737 | <td> | ||
1254 | 1738 | <para style="P1"> | ||
1255 | 1739 | <font color="white"> </font> | ||
1256 | 1740 | </para> | ||
1257 | 1741 | </td> | ||
1258 | 1742 | <td> | ||
1259 | 1743 | <para style="P1"> | ||
1260 | 1744 | <font color="white"> </font> | ||
1261 | 1745 | </para> | ||
1262 | 1746 | </td> | ||
1263 | 1747 | <td> | ||
1264 | 1748 | <para style="P1"> | ||
1265 | 1749 | <font color="white"> </font> | ||
1266 | 1750 | </para> | ||
1267 | 1751 | </td> | ||
1268 | 1752 | <td> | ||
1269 | 1753 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
1270 | 1754 | </td> | ||
1271 | 1755 | </tr> | ||
1272 | 1756 | </blockTable> | ||
1273 | 1757 | |||
1274 | 1758 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]] | ||
1275 | 1759 | <tr> | ||
1276 | 1760 | <td> | ||
1277 | 1761 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
1278 | 1762 | </td> | ||
1279 | 1763 | <td> | ||
1280 | 1764 | <para style="P1"> | ||
1281 | 1765 | <font color="white"> </font> | ||
1282 | 1766 | </para> | ||
1283 | 1767 | </td> | ||
1284 | 1768 | <td> | ||
1285 | 1769 | <para style="P1"> | ||
1286 | 1770 | <font color="white"> </font> | ||
1287 | 1771 | </para> | ||
1288 | 1772 | </td> | ||
1289 | 1773 | <td> | ||
1290 | 1774 | <para style="P1"> | ||
1291 | 1775 | <font color="white"> </font> | ||
1292 | 1776 | </para> | ||
1293 | 1777 | </td> | ||
1294 | 1778 | <td> | ||
1295 | 1779 | <para style="P1"> | ||
1296 | 1780 | <font color="white"> </font> | ||
1297 | 1781 | </para> | ||
1298 | 1782 | </td> | ||
1299 | 1783 | <td> | ||
1300 | 1784 | <para style="P1"> | ||
1301 | 1785 | <font color="white"> </font> | ||
1302 | 1786 | </para> | ||
1303 | 1787 | </td> | ||
1304 | 1788 | <td> | ||
1305 | 1789 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
1306 | 1790 | </td> | ||
1307 | 1791 | </tr> | ||
1308 | 1792 | </blockTable> | ||
1309 | 1793 | </section> | ||
1310 | 1794 | |||
1311 | 1795 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | ||
1312 | 1601 | <tr> | 1796 | <tr> |
1313 | 1602 | <td> | 1797 | <td> |
1314 | 1603 | <para style="terp_default_10">Dealers' Discount </para> | 1798 | <para style="terp_default_10">Dealers' Discount </para> |
1315 | @@ -1658,7 +1853,7 @@ | |||
1316 | 1658 | </tr> | 1853 | </tr> |
1317 | 1659 | </blockTable> | 1854 | </blockTable> |
1318 | 1660 | 1855 | ||
1320 | 1661 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 1856 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1321 | 1662 | <tr> | 1857 | <tr> |
1322 | 1663 | <td> | 1858 | <td> |
1323 | 1664 | <para style="terp_default_10">Total</para> | 1859 | <para style="terp_default_10">Total</para> |
1324 | @@ -1721,7 +1916,7 @@ | |||
1325 | 1721 | <para style="terp_default_9"> | 1916 | <para style="terp_default_9"> |
1326 | 1722 | <font color="white"> </font> | 1917 | <font color="white"> </font> |
1327 | 1723 | </para> | 1918 | </para> |
1329 | 1724 | <blockTable colWidths="334.0,197.0" style="Table8"> | 1919 | <blockTable colWidths="334.0,205.0" style="Table8"> |
1330 | 1725 | <tr> | 1920 | <tr> |
1331 | 1726 | <td> | 1921 | <td> |
1332 | 1727 | <para style="terp_default_9">Declaration</para> | 1922 | <para style="terp_default_9">Declaration</para> |
1333 | @@ -1768,12 +1963,12 @@ | |||
1334 | 1768 | <font color="white">........................................................</font> | 1963 | <font color="white">........................................................</font> |
1335 | 1769 | <font face="Helvetica" size="7.0">(Extra Copy)</font> | 1964 | <font face="Helvetica" size="7.0">(Extra Copy)</font> |
1336 | 1770 | </para> | 1965 | </para> |
1338 | 1771 | <blockTable colWidths="230.0,140.0,160.0" style="Table9"> | 1966 | <blockTable colWidths="210.0,160.0,160.0" style="Table9"> |
1339 | 1772 | <tr> | 1967 | <tr> |
1340 | 1773 | <td> | 1968 | <td> |
1341 | 1774 | <para style="P22">Buyer (if other than consignee)</para> | 1969 | <para style="P22">Buyer (if other than consignee)</para> |
1342 | 1775 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> | 1970 | <para style="P23">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para> |
1344 | 1776 | <para style="P21">[[ (o.partner_id and o.partner_id.street) or '' ]] [[ (o.partner_id and o.partner_id.street2) or '']]</para> | 1971 | <para style="P21">[[ display_address(o.partner_id) ]]</para> |
1345 | 1777 | </td> | 1972 | </td> |
1346 | 1778 | <td> | 1973 | <td> |
1347 | 1779 | <para style="P10">Invoice No.</para> | 1974 | <para style="P10">Invoice No.</para> |
1348 | @@ -1786,8 +1981,6 @@ | |||
1349 | 1786 | </tr> | 1981 | </tr> |
1350 | 1787 | <tr> | 1982 | <tr> |
1351 | 1788 | <td> | 1983 | <td> |
1352 | 1789 | <para style="P21">[[ (o.partner_id and o.partner_id.village_taluka) or '' ]]</para> | ||
1353 | 1790 | <para style="P21">[[ (o.partner_id and o.partner_id.city) or '' ]] - [[ (o.partner_id and o.partner_id.zip) or '']], [[ (o.partner_id and o.partner_id.state_id.name) or '' ]].</para> | ||
1354 | 1791 | </td> | 1984 | </td> |
1355 | 1792 | <td> | 1985 | <td> |
1356 | 1793 | <para style="P10">Delivery Note</para> | 1986 | <para style="P10">Delivery Note</para> |
1357 | @@ -1814,14 +2007,14 @@ | |||
1358 | 1814 | </td> | 2007 | </td> |
1359 | 1815 | </tr> | 2008 | </tr> |
1360 | 1816 | </blockTable> | 2009 | </blockTable> |
1362 | 1817 | <blockTable colWidths="230.0,140.0,160.0" style="Table10"> | 2010 | <blockTable colWidths="210.0,160.0,160.0" style="Table10"> |
1363 | 1818 | <tr> | 2011 | <tr> |
1364 | 1819 | <td> | 2012 | <td> |
1365 | 1820 | <para style="P17"> | 2013 | <para style="P17"> |
1366 | 1821 | <font face="Helvetica" size="8.0">Consignee</font> | 2014 | <font face="Helvetica" size="8.0">Consignee</font> |
1367 | 1822 | </para> | 2015 | </para> |
1368 | 1823 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> | 2016 | <para style="P23">[[ (o.delivery_address_id and o.delivery_address_id.title and o.delivery_address_id.title.name) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.name) or '' ]]</para> |
1370 | 1824 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.street) or '' ]] [[ (o.delivery_address_id and o.delivery_address_id.street2)]]</para> | 2017 | <para style="P21">[[ display_address(o.delivery_address_id) ]]</para> |
1371 | 1825 | </td> | 2018 | </td> |
1372 | 1826 | <td> | 2019 | <td> |
1373 | 1827 | <para style="P10">Buyer's Order No.</para> | 2020 | <para style="P10">Buyer's Order No.</para> |
1374 | @@ -1834,8 +2027,6 @@ | |||
1375 | 1834 | </tr> | 2027 | </tr> |
1376 | 1835 | <tr> | 2028 | <tr> |
1377 | 1836 | <td> | 2029 | <td> |
1378 | 1837 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.village_taluka) or '' ]]</para> | ||
1379 | 1838 | <para style="P21">[[ (o.delivery_address_id and o.delivery_address_id.city) or '' ]] - [[ (o.delivery_address_id and o.delivery_address_id.zip) or '']], [[ (o.delivery_address_id and o.delivery_address_id.state_id and o.delivery_address_id.state_id.name)]].</para> | ||
1380 | 1839 | </td> | 2030 | </td> |
1381 | 1840 | <td> | 2031 | <td> |
1382 | 1841 | <para style="P10">Dispatch Document No.</para> | 2032 | <para style="P10">Dispatch Document No.</para> |
1383 | @@ -1860,7 +2051,7 @@ | |||
1384 | 1860 | </td> | 2051 | </td> |
1385 | 1861 | </tr> | 2052 | </tr> |
1386 | 1862 | </blockTable> | 2053 | </blockTable> |
1388 | 1863 | <blockTable colWidths="230.0,300.0" style="Table11"> | 2054 | <blockTable colWidths="210.0,320.0" style="Table11"> |
1389 | 1864 | <tr> | 2055 | <tr> |
1390 | 1865 | <td> | 2056 | <td> |
1391 | 1866 | <para style="P1"> | 2057 | <para style="P1"> |
1392 | @@ -1874,7 +2065,7 @@ | |||
1393 | 1874 | </tr> | 2065 | </tr> |
1394 | 1875 | </blockTable> | 2066 | </blockTable> |
1395 | 1876 | 2067 | ||
1397 | 1877 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 2068 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table3">[[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1398 | 1878 | <tr> | 2069 | <tr> |
1399 | 1879 | <td> | 2070 | <td> |
1400 | 1880 | <para style="P1">Description of Goods</para> | 2071 | <para style="P1">Description of Goods</para> |
1401 | @@ -1925,7 +2116,7 @@ | |||
1402 | 1925 | 2116 | ||
1403 | 1926 | <section> | 2117 | <section> |
1404 | 1927 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> | 2118 | <para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para> |
1406 | 1928 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 2119 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1407 | 1929 | <tr> | 2120 | <tr> |
1408 | 1930 | <td> | 2121 | <td> |
1409 | 1931 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> | 2122 | <para style="terp_default_91">[[ l.product_id and l.product_id.categ_id.name or '']]</para> |
1410 | @@ -2042,7 +2233,7 @@ | |||
1411 | 2042 | 2233 | ||
1412 | 2043 | <section> | 2234 | <section> |
1413 | 2044 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> | 2235 | <para style="terp_default_2">[[ repeatIn(o.tax_line,'t') ]]</para> |
1415 | 2045 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] | 2236 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table4"> [[ o.company_id.packing_cost or removeParentNode('blockTable') and (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable')]] |
1416 | 2046 | <tr> | 2237 | <tr> |
1417 | 2047 | <td> | 2238 | <td> |
1418 | 2048 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> | 2239 | <para style="terp_default_81">[[ t.name ]] <font face="Helvetica">([[ t.tax_categ in ('excise', 'cess', 'cst', 'other') and removeParentNode('font') or ((t.base)) ]])</font></para> |
1419 | @@ -2106,7 +2297,76 @@ | |||
1420 | 2106 | </blockTable> | 2297 | </blockTable> |
1421 | 2107 | </section> | 2298 | </section> |
1422 | 2108 | 2299 | ||
1424 | 2109 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | 2300 | <section> |
1425 | 2301 | <blockTable colWidths="210.0,70.0,50.0,71.0,40.0,89.0" style="Table5"> [[( o.freight_allowed == True and o.company_id.packing_cost == False) or removeParentNode('blockTable')]] | ||
1426 | 2302 | <tr> | ||
1427 | 2303 | <td> | ||
1428 | 2304 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
1429 | 2305 | </td> | ||
1430 | 2306 | <td> | ||
1431 | 2307 | <para style="P1"> | ||
1432 | 2308 | <font color="white"> </font> | ||
1433 | 2309 | </para> | ||
1434 | 2310 | </td> | ||
1435 | 2311 | <td> | ||
1436 | 2312 | <para style="P1"> | ||
1437 | 2313 | <font color="white"> </font> | ||
1438 | 2314 | </para> | ||
1439 | 2315 | </td> | ||
1440 | 2316 | <td> | ||
1441 | 2317 | <para style="P1"> | ||
1442 | 2318 | <font color="white"> </font> | ||
1443 | 2319 | </para> | ||
1444 | 2320 | </td> | ||
1445 | 2321 | <td> | ||
1446 | 2322 | <para style="P1"> | ||
1447 | 2323 | <font color="white"> </font> | ||
1448 | 2324 | </para> | ||
1449 | 2325 | </td> | ||
1450 | 2326 | <td> | ||
1451 | 2327 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
1452 | 2328 | </td> | ||
1453 | 2329 | </tr> | ||
1454 | 2330 | </blockTable> | ||
1455 | 2331 | |||
1456 | 2332 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[( o.company_id.packing_cost and o.freight_allowed == True) or removeParentNode('blockTable')]] | ||
1457 | 2333 | <tr> | ||
1458 | 2334 | <td> | ||
1459 | 2335 | <para style="terp_default_10"><font face="Helvetica">Inward Freight</font></para> | ||
1460 | 2336 | </td> | ||
1461 | 2337 | <td> | ||
1462 | 2338 | <para style="P1"> | ||
1463 | 2339 | <font color="white"> </font> | ||
1464 | 2340 | </para> | ||
1465 | 2341 | </td> | ||
1466 | 2342 | <td> | ||
1467 | 2343 | <para style="P1"> | ||
1468 | 2344 | <font color="white"> </font> | ||
1469 | 2345 | </para> | ||
1470 | 2346 | </td> | ||
1471 | 2347 | <td> | ||
1472 | 2348 | <para style="P1"> | ||
1473 | 2349 | <font color="white"> </font> | ||
1474 | 2350 | </para> | ||
1475 | 2351 | </td> | ||
1476 | 2352 | <td> | ||
1477 | 2353 | <para style="P1"> | ||
1478 | 2354 | <font color="white"> </font> | ||
1479 | 2355 | </para> | ||
1480 | 2356 | </td> | ||
1481 | 2357 | <td> | ||
1482 | 2358 | <para style="P1"> | ||
1483 | 2359 | <font color="white"> </font> | ||
1484 | 2360 | </para> | ||
1485 | 2361 | </td> | ||
1486 | 2362 | <td> | ||
1487 | 2363 | <para style="terp_default_Right_10">[[ o.currency_id.symbol ]] [[ formatLang(o.freight_charge, digits=get_digits(dp='Account')) ]]</para> | ||
1488 | 2364 | </td> | ||
1489 | 2365 | </tr> | ||
1490 | 2366 | </blockTable> | ||
1491 | 2367 | </section> | ||
1492 | 2368 | |||
1493 | 2369 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ ( o.company_id.dealers_discount == True and o.company_id.packing_cost == True ) or removeParentNode('blockTable') ]] | ||
1494 | 2110 | <tr> | 2370 | <tr> |
1495 | 2111 | <td> | 2371 | <td> |
1496 | 2112 | <para style="terp_default_10">Dealers' Discount </para> | 2372 | <para style="terp_default_10">Dealers' Discount </para> |
1497 | @@ -2167,7 +2427,7 @@ | |||
1498 | 2167 | </tr> | 2427 | </tr> |
1499 | 2168 | </blockTable> | 2428 | </blockTable> |
1500 | 2169 | 2429 | ||
1502 | 2170 | <blockTable colWidths="200.0,60.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] | 2430 | <blockTable colWidths="210.0,50.0,50.0,61.0,50.0,40.0,69.0" style="Table5"> [[ o.company_id.packing_cost or removeParentNode('blockTable') ]] |
1503 | 2171 | <tr> | 2431 | <tr> |
1504 | 2172 | <td> | 2432 | <td> |
1505 | 2173 | <para style="terp_default_10">Total</para> | 2433 | <para style="terp_default_10">Total</para> |
1506 | @@ -2230,7 +2490,7 @@ | |||
1507 | 2230 | <para style="terp_default_9"> | 2490 | <para style="terp_default_9"> |
1508 | 2231 | <font color="white"> </font> | 2491 | <font color="white"> </font> |
1509 | 2232 | </para> | 2492 | </para> |
1511 | 2233 | <blockTable colWidths="334.0,197.0" style="Table8"> | 2493 | <blockTable colWidths="334.0,205.0" style="Table8"> |
1512 | 2234 | <tr> | 2494 | <tr> |
1513 | 2235 | <td> | 2495 | <td> |
1514 | 2236 | <para style="terp_default_9">Declaration</para> | 2496 | <para style="terp_default_9">Declaration</para> |
1515 | 2237 | 2497 | ||
1516 | === modified file 'l10n_in_tax_retail_invoice/report/tax_invoice.sxw' | |||
1517 | 2238 | Binary files l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-05-23 08:40:28 +0000 and l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-06-20 10:57:25 +0000 differ | 2498 | Binary files l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-05-23 08:40:28 +0000 and l10n_in_tax_retail_invoice/report/tax_invoice.sxw 2013-06-20 10:57:25 +0000 differ |
1518 | === added directory 'l10n_in_tax_retail_invoice/test' | |||
1519 | === added file 'l10n_in_tax_retail_invoice/test/purchase_order.yml' | |||
1520 | --- l10n_in_tax_retail_invoice/test/purchase_order.yml 1970-01-01 00:00:00 +0000 | |||
1521 | +++ l10n_in_tax_retail_invoice/test/purchase_order.yml 2013-06-20 10:57:25 +0000 | |||
1522 | @@ -0,0 +1,42 @@ | |||
1523 | 1 | - | ||
1524 | 2 | In order to test the tax invoice reports defined on an invoice, I create a Purchase Order with cost price 13.0 and inward freight 5.0. | ||
1525 | 3 | - | ||
1526 | 4 | !record {model: purchase.order, id: purchase_order_1}: | ||
1527 | 5 | partner_id: base.res_partner_3 | ||
1528 | 6 | invoice_method: 'order' | ||
1529 | 7 | inward_freight: 5.0 | ||
1530 | 8 | order_line: | ||
1531 | 9 | - product_id: product.product_product_48 | ||
1532 | 10 | product_qty: 1.0 | ||
1533 | 11 | price_unit: 13.0 | ||
1534 | 12 | - | ||
1535 | 13 | I confirm the purchase order and supplier invoice is created. | ||
1536 | 14 | - | ||
1537 | 15 | !workflow {model: purchase.order, ref: purchase_order_1, action: purchase_confirm} | ||
1538 | 16 | - | ||
1539 | 17 | I select Purchase Freight and check that the untaxed Amount should be 13.0, and Total Amount should be 18.0. | ||
1540 | 18 | - | ||
1541 | 19 | !python {model: purchase.order}: | | ||
1542 | 20 | purchase = self.browse(cr,uid,ref('purchase_order_1')) | ||
1543 | 21 | assert(purchase.amount_untaxed == 13.0), _('Untax Amount should be 13.0') | ||
1544 | 22 | assert(purchase.inward_freight == 5.0), _('Inward Freight should be 5.0') | ||
1545 | 23 | if purchase.company_id.freight: | ||
1546 | 24 | assert(purchase.amount_total == 18.0), _('Amount should be 18.0') | ||
1547 | 25 | - | ||
1548 | 26 | I check that supplier invoice is created or not after confirming purchase order. | ||
1549 | 27 | - | ||
1550 | 28 | !python {model: purchase.order}: | | ||
1551 | 29 | purchase_order_obj = self.browse(cr,uid,ref('purchase_order_1')) | ||
1552 | 30 | invoice_id = self.pool.get('account.invoice').search(cr, uid, [('partner_id','=',purchase_order_obj.partner_id.id),('origin','=',purchase_order_obj.name)]) | ||
1553 | 31 | assert(invoice_id), _('Supplier Invoice should be created') | ||
1554 | 32 | - | ||
1555 | 33 | In order to test PDF reports defined on invoice, we will print an tax Invoice Report. | ||
1556 | 34 | - | ||
1557 | 35 | !python {model: account.invoice}: | | ||
1558 | 36 | from openerp import netsvc, tools | ||
1559 | 37 | import os | ||
1560 | 38 | purchase_order_obj = self.pool.get('purchase.order').browse(cr,uid,ref('purchase_order_1')) | ||
1561 | 39 | invoice_id = self.search(cr,uid,[('partner_id','=',purchase_order_obj.partner_id.id),('origin','=',purchase_order_obj.name)]) | ||
1562 | 40 | (data, format) = netsvc.LocalService('report.account.invoice.tax.excise').create(cr, uid, invoice_id, {}, {}) | ||
1563 | 41 | if tools.config['test_report_directory']: | ||
1564 | 42 | file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) | ||
1565 | 0 | 43 | ||
1566 | === added file 'l10n_in_tax_retail_invoice/test/sale_order.yml' | |||
1567 | --- l10n_in_tax_retail_invoice/test/sale_order.yml 1970-01-01 00:00:00 +0000 | |||
1568 | +++ l10n_in_tax_retail_invoice/test/sale_order.yml 2013-06-20 10:57:25 +0000 | |||
1569 | @@ -0,0 +1,69 @@ | |||
1570 | 1 | - | ||
1571 | 2 | In order to test the tax invoice reports defined on an invoice, we will create sale order with packing amount and dealers discount. | ||
1572 | 3 | For that we have a VAT tax defined. | ||
1573 | 4 | - | ||
1574 | 5 | !record {model: account.tax, id: tax_1}: | ||
1575 | 6 | name: 'Vat' | ||
1576 | 7 | tax_categ: 'vat' | ||
1577 | 8 | amount: 0.04 | ||
1578 | 9 | - | ||
1579 | 10 | we have a Additional tax defined. | ||
1580 | 11 | - | ||
1581 | 12 | !record {model: account.tax, id: tax_2}: | ||
1582 | 13 | name: 'Additional' | ||
1583 | 14 | tax_categ: 'other' | ||
1584 | 15 | amount: 0.01 | ||
1585 | 16 | - | ||
1586 | 17 | Create one sale order for [ADPT] USB Adapter. | ||
1587 | 18 | - | ||
1588 | 19 | !record {model: sale.order, id: sale_order_01}: | ||
1589 | 20 | partner_id: base.res_partner_2 | ||
1590 | 21 | order_policy: 'prepaid' | ||
1591 | 22 | order_line: | ||
1592 | 23 | - name: USB Adapter | ||
1593 | 24 | product_uom_qty: 1.0 | ||
1594 | 25 | price_unit: 18.0 | ||
1595 | 26 | packing_amount: 5.0 | ||
1596 | 27 | lst_price: 10.0 | ||
1597 | 28 | tax_id: | ||
1598 | 29 | - tax_1 | ||
1599 | 30 | - tax_2 | ||
1600 | 31 | - | ||
1601 | 32 | I confirm sale order. | ||
1602 | 33 | - | ||
1603 | 34 | !workflow {model: sale.order, action: order_confirm, ref: sale_order_01} | ||
1604 | 35 | |||
1605 | 36 | - | ||
1606 | 37 | I select Packing cost and check that the untaxed Amount should be 23.0, Tax should be 1.15, Total Amount is 24.15. | ||
1607 | 38 | - | ||
1608 | 39 | !python {model: sale.order}: | | ||
1609 | 40 | sale = self.browse(cr, uid, ref('sale_order_01')) | ||
1610 | 41 | if sale.company_id.packing_cost: | ||
1611 | 42 | assert(sale.amount_untaxed == 23.0), _('Untax Amount should be 23.0') | ||
1612 | 43 | assert(sale.amount_tax == 1.15), _('Tax should be 1.15') | ||
1613 | 44 | assert(sale.amount_total == 24.15), _('Amount should be 24.15') | ||
1614 | 45 | - | ||
1615 | 46 | I check that the dealers discount should be 8.0. | ||
1616 | 47 | - | ||
1617 | 48 | !python {model: sale.order}: | | ||
1618 | 49 | sale = self.browse(cr, uid, ref('sale_order_01')) | ||
1619 | 50 | assert(sale.dealers_disc == 8.0), _('Dealers discount should be 8.0') | ||
1620 | 51 | |||
1621 | 52 | - | ||
1622 | 53 | I check that customer invoice is created or not after confirming sale order. | ||
1623 | 54 | - | ||
1624 | 55 | !python {model: sale.order}: | | ||
1625 | 56 | sale_order_obj = self.browse(cr, uid, ref('sale_order_01')) | ||
1626 | 57 | invoice_id = self.pool.get('account.invoice').search(cr, uid, [('partner_id','=',sale_order_obj.partner_id.id),('origin','=',sale_order_obj.name)]) | ||
1627 | 58 | assert(invoice_id), _('customer Invoice should be created') | ||
1628 | 59 | - | ||
1629 | 60 | In order to test the PDF reports defined on an invoice, we will print an Tax Invoice Report. | ||
1630 | 61 | - | ||
1631 | 62 | !python {model: account.invoice}: | | ||
1632 | 63 | import netsvc, tools, os | ||
1633 | 64 | sale_order_obj = self.pool.get('sale.order').browse(cr, uid, ref('sale_order_01')) | ||
1634 | 65 | invoice_id = self.search(cr, uid, [('partner_id','=',sale_order_obj.partner_id.id),('origin','=',sale_order_obj.name)]) | ||
1635 | 66 | (data, format) = netsvc.LocalService('report.account.invoice.tax.excise').create(cr, uid, invoice_id, {}, {}) | ||
1636 | 67 | if tools.config['test_report_directory']: | ||
1637 | 68 | file(os.path.join(tools.config['test_report_directory'], 'account-invoice.'+format), 'wb+').write(data) | ||
1638 | 69 |
Make clean diff currently it is showing changes on portal also..
Thanks,