[IMP] cleaning POS reports, removed bad reports
bzr revid: fp@tinyerp.com-20111211105130-y7lra445g4hzd614
This commit is contained in:
parent
966a146b1f
commit
314f15e363
|
@ -52,7 +52,6 @@ Main features :
|
|||
'wizard/pos_close_statement.xml',
|
||||
'wizard/pos_box_entries.xml',
|
||||
'wizard/pos_payment_report_user_view.xml',
|
||||
'wizard/pos_payment_report_date_view.xml',
|
||||
'wizard/pos_box_out.xml',
|
||||
'wizard/pos_sales_user.xml',
|
||||
'wizard/pos_receipt_view.xml',
|
||||
|
|
|
@ -43,17 +43,6 @@
|
|||
rml="point_of_sale/report/pos_lines.rml"
|
||||
/>
|
||||
|
||||
<report
|
||||
id="pos_payment_report"
|
||||
string="Payment Report For Sale"
|
||||
model="pos.order"
|
||||
name="pos.payment.report"
|
||||
auto="False"
|
||||
multi="True"
|
||||
menu="True"
|
||||
rml="point_of_sale/report/pos_payment_report.rml"
|
||||
/>
|
||||
|
||||
<report
|
||||
id="pos_sales_user"
|
||||
string="Sales Report"
|
||||
|
@ -76,16 +65,6 @@
|
|||
rml="point_of_sale/report/pos_sales_user_today.rml"
|
||||
/>
|
||||
|
||||
<report
|
||||
id="pos_payment_report_date"
|
||||
string="Payment Report"
|
||||
model="pos.order"
|
||||
name="pos.payment.report.date"
|
||||
auto="False"
|
||||
multi="True"
|
||||
menu="False"
|
||||
rml="point_of_sale/report/pos_payment_report_date.rml"
|
||||
/>
|
||||
<report
|
||||
id="pos_payment_report_user"
|
||||
string="Today's Payment By User"
|
||||
|
|
|
@ -734,8 +734,6 @@
|
|||
<field name="domain">[('origin','like','POS')]</field>
|
||||
</record>
|
||||
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_payment_repport_date"
|
||||
id="menu_pos_payment_report_date" parent="menu_point_rep" sequence="8" groups="base.group_extended"/>
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_details"
|
||||
id="menu_pos_details" parent="menu_point_rep" sequence="6" />
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ import pos_details_summary
|
|||
import pos_payment_report
|
||||
import pos_sales_user
|
||||
import pos_sales_user_today
|
||||
import pos_payment_report_date
|
||||
import pos_payment_report_user
|
||||
import pos_report
|
||||
import pos_order_report
|
||||
|
|
|
@ -27,9 +27,9 @@ class pos_details(report_sxw.rml_parse):
|
|||
def _get_invoice(self,inv_id,user):
|
||||
res={}
|
||||
if inv_id:
|
||||
self.cr.execute("select name from account_invoice as ac where id = %s", (inv_id,))
|
||||
self.cr.execute("select number from account_invoice as ac where id = %s", (inv_id,))
|
||||
res = self.cr.fetchone()
|
||||
return res[0]
|
||||
return res[0] or 'Draft'
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
|
|
@ -199,13 +199,13 @@
|
|||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="53.0,44.0,158.0,54.0,76.0,37.0,88.0" style="Table4">
|
||||
<blockTable colWidths="108.0,54.0,159.0,54.0,75.0,30.0,69.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Code</para>
|
||||
<para style="terp_tblheader_Details">Order</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Product</para>
|
||||
|
@ -226,7 +226,7 @@
|
|||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_1">[[ repeatIn(pos_sales_details(data['form'],user), 'line_ids') ]]</para>
|
||||
<blockTable colWidths="54.0,44.0,159.0,54.0,75.0,36.0,89.0" style="Table6">
|
||||
<blockTable colWidths="108.0,54.0,159.0,54.0,75.0,30.0,69.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(line_ids['date_order'],date_time = True) ]]</para>
|
||||
|
@ -258,7 +258,7 @@
|
|||
<blockTable colWidths="256.0,256.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Mode of Taxes</para>
|
||||
<para style="terp_tblheader_Details">Taxes</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
|
@ -289,7 +289,7 @@
|
|||
<blockTable colWidths="257.0,255.0" style="Table9">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Mode of Payment</para>
|
||||
<para style="terp_tblheader_Details">Payment</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
string="Invoiced"
|
||||
domain="[('state','=',('invoiced'))]"/>
|
||||
<filter icon="terp-dolar"
|
||||
string="Paid"
|
||||
string="Not Invoiced"
|
||||
domain="[('state','=',('paid'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
from report import report_sxw
|
||||
|
||||
class pos_payment_report_date(report_sxw.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(pos_payment_report_date, self).__init__(cr, uid, name, context=context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'pos_payment_date': self.__pos_payment_date__,
|
||||
'pos_payment_date_total':self.__pos_payment_date__total__,
|
||||
})
|
||||
|
||||
def __pos_payment_date__(self,form):
|
||||
dt1 = form['date_start'] + ' 00:00:00'
|
||||
dt2 = form['date_end'] + ' 23:59:59'
|
||||
data={}
|
||||
if form['user_id']:
|
||||
self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
|
||||
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
|
||||
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \
|
||||
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \
|
||||
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \
|
||||
,(dt1,dt2,tuple(form['user_id'])))
|
||||
else:
|
||||
self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
|
||||
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
|
||||
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \
|
||||
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \
|
||||
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \
|
||||
,(dt1,dt2))
|
||||
data=self.cr.dictfetchall()
|
||||
return data
|
||||
|
||||
def __pos_payment_date__total__(self,form):
|
||||
dt1 = form['date_start'] + ' 00:00:00'
|
||||
dt2 = form['date_end'] + ' 23:59:59'
|
||||
res=[]
|
||||
if form['user_id']:
|
||||
self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
|
||||
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
|
||||
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
|
||||
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \
|
||||
,(dt1,dt2,tuple(form['user_id'])))
|
||||
else:
|
||||
self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
|
||||
"from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
|
||||
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
|
||||
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \
|
||||
,(dt1,dt2))
|
||||
res=self.cr.fetchone()[0] or 0.0
|
||||
return res
|
||||
|
||||
|
||||
report_sxw.report_sxw('report.pos.payment.report.date', 'pos.order', 'addons/point_of_sale/report/pos_payment_report_date.rml', parser=pos_payment_report_date,header='internal')
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,188 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<document filename="Payments.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Payments" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="27.0" y1="57.0" width="512" height="728"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
<stylesheet>
|
||||
<blockTableStyle id="Standard_Outline">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table1">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table2">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table3">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table5">
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
</initialize>
|
||||
<paraStyle name="Standard" fontName="Helvetica"/>
|
||||
<paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Contents" fontName="Helvetica"/>
|
||||
<paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
|
||||
<paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Footer" fontName="Helvetica"/>
|
||||
<paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
|
||||
<paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_1" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9_Bold" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="terp_default_8">[[ repeatIn(objects,'order') ]]</para>
|
||||
<para style="terp_header_Centre">Sales Lines</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="256.0,256.0" style="Table1">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Company</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Print Date</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="256.0,256.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ company.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ formatLang(time.strftime('%Y-%m-%d'),date = True) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="256.0,71.0,57.0,57.0,71.0" style="Table3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Product</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Qty</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">Disc(%)</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">Unit Price </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">Total </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_1">[[ repeatIn(pos_payment_date(data['form']), 'line_ids') ]]</para>
|
||||
<blockTable colWidths="256.0,71.0,57.0,57.0,71.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[ [[ line_ids['code'] ]] ] [[ line_ids['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line_ids['qty']) ]] [[line_ids['uom'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line_ids['discount'], dp='Sale Price') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line_ids['price_unit'], dp='Sale Price') ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(line_ids['total'], dp='Sale Price') ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="355.0,71.0,85.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="Table Contents">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Right">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(pos_payment_date_total(data['form']), dp='Sale Price') or removeParentNode('blockTable')]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<para style="Standard">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
|
@ -35,23 +35,7 @@
|
|||
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt report'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
Create a record for the root user in pos.payment.report.user (used by the next python block).
|
||||
-
|
||||
!record {model: pos.payment.report.user, id: pos_payment_report_user_1}:
|
||||
user_id: []
|
||||
-
|
||||
Print the POS Payment Report through the wizard
|
||||
-
|
||||
!python {model: ir.ui.menu}: |
|
||||
import time
|
||||
ctx={}
|
||||
ctx.update({'model': 'ir.ui.menu','active_ids': []})
|
||||
data_dict = {'date_start': time.strftime('%Y-%m-%d'), 'date_end': time.strftime('%Y-%m-%d'), 'user_id': [(6,0,[ref('base.user_root')])] }
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_report_pos_payment_repport_date',wiz_data=data_dict, context=ctx, our_module='point_of_sale')
|
||||
|
||||
-
|
||||
Print the POS Details Report through the wizard
|
||||
Print the POS Details Report through the wizard
|
||||
-
|
||||
!python {model: ir.ui.menu}: |
|
||||
import time
|
||||
|
|
|
@ -30,7 +30,6 @@ import pos_sales_user
|
|||
import pos_sales_user_today
|
||||
import pos_receipt
|
||||
import pos_payment_report_user
|
||||
import pos_payment_report_date
|
||||
import pos_payment_report
|
||||
import pos_payment
|
||||
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
|
||||
from osv import osv
|
||||
from osv import fields
|
||||
|
||||
|
||||
class pos_payment_report_date(osv.osv_memory):
|
||||
_name = 'pos.payment.report.date'
|
||||
_description = 'POS Payment Report according to date'
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
To get the date and print the report
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@return : retrun report
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
datas = {'ids': context.get('active_ids', [])}
|
||||
res = self.read(cr, uid, ids, ['date_start', 'date_end', 'user_id'], context=context)
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
if res.get('id',False):
|
||||
datas['ids']=[res['id']]
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pos.payment.report.date',
|
||||
'datas': datas,
|
||||
}
|
||||
|
||||
_columns = {
|
||||
'date_start': fields.date('Start Date', required=True),
|
||||
'date_end': fields.date('End Date', required=True),
|
||||
'user_id': fields.many2many('res.users', 'res_user_sale_date', 'user_id', 'sale_id', 'Salesman')
|
||||
}
|
||||
_defaults = {
|
||||
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'date_end': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
|
||||
pos_payment_report_date()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="pos_payment_report_date_form" model="ir.ui.view">
|
||||
<field name="name">pos.payment.report.date.form</field>
|
||||
<field name="model">pos.payment.report.date</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sale by Date and User">
|
||||
<group col="4" colspan="4">
|
||||
<separator string="Dates" colspan="4"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<separator string="User" colspan="4"/>
|
||||
<field name="user_id" nolabel="1" colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group colspan="2" col="2">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Close" />
|
||||
<button name="print_report" string="Print Report"
|
||||
colspan="1" type="object" icon="gtk-print" />
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_pos_payment_repport_date" model="ir.actions.act_window">
|
||||
<field name="name">Sales by Products</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">pos.payment.report.date</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue