Neues Standardtemplate Angebot und Endbetrag inkl Skonto
parent
0e9ec565a2
commit
9df5978c9c
|
|
@ -33,7 +33,7 @@
|
|||
""",
|
||||
'author': 'camadeus GmbH',
|
||||
'website': 'http://www.camadeus.at',
|
||||
'depends': ['account'],
|
||||
'depends': ['account', 'sale'],
|
||||
'data': [
|
||||
'cam_invoice_skonto_view.xml',
|
||||
'cam_invoice_skonto_data.xml',
|
||||
|
|
|
|||
|
|
@ -82,4 +82,19 @@ class account_invoice(models.Model):
|
|||
inv.write({'skonto_faelligkeit': datetime.strptime(inv.date_invoice, '%Y-%m-%d') + timedelta(days=inv.payment_term.skonto_tage)})
|
||||
return True
|
||||
|
||||
class sale_order(osv.osv):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
def _skonto_betrag_inkl(self, cr, uid, ids, field_name, arg, context=None):
|
||||
res = {}
|
||||
sos = self.browse(cr, uid, ids, context=context)
|
||||
for so in sos:
|
||||
if so.payment_term and so.payment_term.skonto_prozent:
|
||||
res[so.id] = so.amount_total * (1 - so.payment_term.skonto_prozent/100.0)
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'skonto_betrag_inkl': fields.function(_skonto_betrag_inkl, string='Betrag inkl. Skonto', type='float'),
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- account.payment.term -->
|
||||
<record id="view_payment_term_form" model="ir.ui.view">
|
||||
<field name="name">cam_invoice_skonto.payment.term.form</field>
|
||||
<field name="model">account.payment.term</field>
|
||||
|
|
@ -46,7 +45,6 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- account.invoice -->
|
||||
<record id="invoice_form" model="ir.ui.view">
|
||||
<field name="name">cam_invoice_skonto.invoice.form</field>
|
||||
<field name="model">account.invoice</field>
|
||||
|
|
@ -60,6 +58,17 @@
|
|||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_order_form" model="ir.ui.view">
|
||||
<field name="name">sale.order.form</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="amount_total" position="after">
|
||||
<field name="skonto_betrag_inkl"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
|||
|
|
@ -1,85 +1,90 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
<reports>
|
||||
<report>sale.report_saleorder</report>
|
||||
</reports>
|
||||
-->
|
||||
|
||||
<document filename="Sales Order.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Sale Order" author="Andreas Brückl" allowSplitting="20">
|
||||
<document filename="Auftrag.pdf">
|
||||
<template pageSize="(595.0,842.0)" title="Sale Order" author="Camadeus Consulting" allowSplitting="20">
|
||||
<pageTemplate id="first">
|
||||
<frame id="first" x1="15.0" y1="42.0" width="539" height="758"/>
|
||||
</pageTemplate>
|
||||
</template>
|
||||
|
||||
<story>
|
||||
|
||||
<para>
|
||||
<seqReset id="L1"/>
|
||||
</para>
|
||||
<para>[[repeatIn(objects,'o')]] [[ setLang(o.partner_id.commercial_partner_id.lang)]]</para>
|
||||
|
||||
<para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (o.partner_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id and o.partner_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para>
|
||||
|
||||
|
||||
<blockTable colWidths="100,110" style="Struktur" hAlign="RIGHT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ihre Referenz:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.client_order_ref ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ansprechpartner:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.user_id and o.user_id.name) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr> [[ o.user_id and o.user_id.phone or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="normal">Tel.:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.user_id and o.user_id.phone) or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Ihre UID:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.vat or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Angebotsdatum:[[ o.state not in ['draft','sent'] and removeParentNode('para') ]]</para>
|
||||
<para style="normal">Bestelldatum:[[ o.state in ['draft','sent'] and removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ formatLang(o.date_order,date = True) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
|
||||
<blockTable colWidths="270,85,145" style="Struktur">
|
||||
<tr>
|
||||
<td>
|
||||
<section>
|
||||
<para style="fett">[[ o.partner_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.commercial_partner_id.id != o.partner_id.id and o.partner_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (o.partner_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (o.partner_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.zip) or '' ]] [[ (o.partner_id and o.partner_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (o.partner_id.state_id and o.partner_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (o.partner_id.country_id and o.partner_id.country_id.name) or '' ]]</para>
|
||||
<!-- Für Sichtfenster -->
|
||||
<section>[[ not (o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.ref) or removeParentNode('section') ]]
|
||||
<para style="normal"> </para>
|
||||
</section>
|
||||
</section>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">Angebotsdatum:[[ o.state not in ['draft','sent'] and removeParentNode('para') ]]</para>
|
||||
<para style="normal">Bestelldatum:[[ o.state in ['draft','sent'] and removeParentNode('para') ]]</para>
|
||||
<para style="normal">Quelldokument:</para>
|
||||
<para style="normal">Referenz:</para>
|
||||
<!--<para style="normal">Kundennummer:</para>-->
|
||||
<para style="normal">Kunde UID Nr.:</para>
|
||||
<para style="normal">Ansprechpartner:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ formatLang(o.date_order,date = True) ]] </para>
|
||||
<para style="normal">[[ o.origin ]] </para>
|
||||
<para style="normal">[[ o.client_order_ref ]] </para>
|
||||
<!--<para style="normal">[[ o.partner_id.commercial_partner_id.ref ]] </para>-->
|
||||
<para style="normal">[[ o.partner_id.commercial_partner_id and o.partner_id.commercial_partner_id.vat or '' ]] </para>
|
||||
<para style="normal">[[ (o.user_id and o.user_id.name) or '' ]] </para>
|
||||
</td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td>
|
||||
<section>[[ (o.partner_shipping_id and o.partner_shipping_id.id != o.partner_id.id) or removeParentNode('section')]]
|
||||
<spacer length="0.5cm"/>
|
||||
<para style="normal">Lieferadresse:</para>
|
||||
<para style="normal">[[ o.partner_shipping_id.commercial_partner_id.name ]]</para>
|
||||
<para style="normal">[[ (o.partner_shipping_id.commercial_partner_id.id != o.partner_shipping_id.id and o.partner_shipping_id.name) or '' ]] </para>
|
||||
<para style="normal">[[ (o.partner_shipping_id.street ) or '']]</para>
|
||||
<para style="normal">[[ (o.partner_shipping_id.street2) or removeParentNode('para') ]]</para>
|
||||
<para style="normal">[[ (o.partner_shipping_id.zip) or '' ]] [[ (o.partner_shipping_id and o.partner_shipping_id.city) or '' ]]</para>
|
||||
<para style="normal">[[ (o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name) or removeParentNode('para')]]</para>
|
||||
<para style="normal">[[ (o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name) or '' ]]</para>
|
||||
</section>
|
||||
<para style="normal"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal"> </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal"> </para>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
</blockTable>
|
||||
|
||||
<spacer length="1.0cm"/>
|
||||
|
||||
<section>
|
||||
<para style="ueberschrift"><b>[[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Angebot [[ o.name ]]</b></para>
|
||||
<para style="ueberschrift"><b>[[ o.state in ['draft','sent'] and removeParentNode('para') ]] Bestellbestätigung [[ o.name ]]</b></para>
|
||||
<para style="ueberschrift2"><b>[[ o.state not in ['draft','sent'] and removeParentNode('para') ]] Angebot [[ o.name ]]</b></para>
|
||||
<para style="ueberschrift2"><b>[[ o.state in ['draft','sent'] and removeParentNode('para') ]] Bestellbestätigung [[ o.name ]]</b></para>
|
||||
</section>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="30,57,213,45,50,40,75" repeatRows="1" style="TabelleHaupt" hAlign="LEFT">
|
||||
<blockTable colWidths="30,57,170,75,63,40,75" repeatRows="1" style="TabelleHaupt" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="tabelle_header">Pos</para>
|
||||
|
|
@ -91,10 +96,10 @@
|
|||
<para style="tabelle_header_links">Bezeichnung</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header">Menge</para>
|
||||
</td>
|
||||
<para style="tabelle_header_links">Menge</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header_rechts">E-Preis</para>
|
||||
<para style="tabelle_header_rechts">Einzelpreis</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_header"></para>
|
||||
|
|
@ -103,7 +108,7 @@
|
|||
<para style="tabelle_header_rechts">Gesamtpreis</para>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>[[repeatIn(o.order_line,'line')]]
|
||||
<td>
|
||||
<para style="tabelle_daten_center" leftIndent="0" bulletIndent="0" size="8.0">
|
||||
|
|
@ -118,12 +123,11 @@
|
|||
<section>[[ repeatIn((line.name or '').split('\n\n')[1:],'paragraphs') ]]
|
||||
<spacer length="0.4cm"/>
|
||||
<para style="tabelle_daten_links">[[ paragraphs ]]</para>
|
||||
</section>
|
||||
</section>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<para style="tabelle_daten_center">[[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty, digits=0) ]]</para>
|
||||
</td>
|
||||
<para style="tabelle_daten_links">[[ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty, digits=0) ]] [[ line.product_uom.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="tabelle_daten_rechts">[[ formatLang(line.price_unit,digits=2) ]]</para>
|
||||
</td>
|
||||
|
|
@ -135,7 +139,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<blockTable colWidths="210,200,100" style="TabelleSchlussrechnung">
|
||||
<tr>
|
||||
<td>
|
||||
|
|
@ -170,6 +174,17 @@
|
|||
<para style="schlussrechnung_fett">[[ formatLang(o.amount_total,digits=2 ) ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">Rechnungsbetrag inkl. Skonto in €</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="schlussrechnung">[[ (o.skonto_betrag_inkl and formatLang(o.skonto_betrag_inkl,digits=2)) or removeParentNode('tr') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
|
@ -181,19 +196,39 @@
|
|||
</section>
|
||||
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="110,300" style="Struktur" hAlign="LEFT">
|
||||
|
||||
<blockTable colWidths="110,390" style="Struktur" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal">Zahlungsziele:</para>
|
||||
<para style="normal">Zahlungsbedingungen:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="normal">[[ (o.payment_term and o.payment_term.note) or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
<!--
|
||||
<spacer length="0.5cm"/>
|
||||
|
||||
<blockTable colWidths="500" style="Struktur" hAlign="LEFT">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="normal"></para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ o.date_due and o.payment_term and o.payment_term.skonto_prozent or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="normal">Zahlbar bis [[ formatLang(o.skonto_faelligkeit,date = True) ]] abzüglich [[ formatLang(o.payment_term.skonto_prozent,digits=2) ]]% beträgt [[ formatLang(o.skonto_betrag_inkl,digits=2) ]]€.</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>[[ o.date_due or removeParentNode('tr') ]]
|
||||
<td>
|
||||
<para style="normal">Zahlbar bis [[ formatLang(o.date_due,date = True) ]] ohne Abzug.</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
-->
|
||||
|
||||
</story>
|
||||
</document>
|
||||
|
|
|
|||
Loading…
Reference in New Issue