~unifield-team/unifield-wm/us-927

« back to all changes in this revision

Viewing changes to msf_supply_doc_export/report/report_sale_order_xls.mako

  • Committer: duy.vo at msf
  • Date: 2012-09-18 21:16:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1188.
  • Revision ID: duy.vo@geneva.msf.org-20120918211631-t5e7fjeumxobhcma
UF-1055: Merged with trunk 1175

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<?mso-application progid="Excel.Sheet"?>
 
3
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 
4
 xmlns:o="urn:schemas-microsoft-com:office:office"
 
5
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 
6
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 
7
 xmlns:html="http://www.w3.org/TR/REC-html40">
 
8
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
 
9
  <Author>MSFUser</Author>
 
10
  <LastAuthor>MSFUser</LastAuthor>
 
11
  <Created>2012-06-18T15:46:09Z</Created>
 
12
  <Company>Medecins Sans Frontieres</Company>
 
13
  <Version>11.9999</Version>
 
14
 </DocumentProperties>
 
15
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
 
16
  <WindowHeight>13170</WindowHeight>
 
17
  <WindowWidth>19020</WindowWidth>
 
18
  <WindowTopX>120</WindowTopX>
 
19
  <WindowTopY>60</WindowTopY>
 
20
  <ProtectStructure>False</ProtectStructure>
 
21
  <ProtectWindows>False</ProtectWindows>
 
22
 </ExcelWorkbook>
 
23
<Styles>
 
24
    <Style ss:ID="header">
 
25
        <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
 
26
        <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/>
 
27
        <Borders>
 
28
          <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
 
29
          <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
 
30
          <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
 
31
          <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
 
32
        </Borders>
 
33
    </Style>
 
34
    <Style ss:ID="line">
 
35
        <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
 
36
        <Borders>
 
37
          <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
 
38
          <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
 
39
          <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
 
40
          <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
 
41
        </Borders>
 
42
    </Style>
 
43
  <Style ss:ID="short_date">
 
44
   <Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
 
45
   <Borders>
 
46
    <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
 
47
    <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
 
48
    <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
 
49
    <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
 
50
   </Borders>
 
51
   <NumberFormat ss:Format="Short Date"/>
 
52
  </Style>
 
53
</Styles>
 
54
##  we loop over the sale_order so "objects" == sale_order
 
55
% for o in objects:
 
56
<ss:Worksheet ss:Name="${(o.name or '')|x}">
 
57
 
 
58
## definition of the columns' size
 
59
<% nb_of_columns = 8 %>
 
60
<Table x:FullColumns="1" x:FullRows="1">
 
61
<Column ss:AutoFitWidth="1" ss:Width="120" />
 
62
<Column ss:AutoFitWidth="1" ss:Width="300" />
 
63
% for x in range(2,nb_of_columns - 1):
 
64
<Column ss:AutoFitWidth="1" ss:Width="60" />
 
65
% endfor
 
66
<Column ss:AutoFitWidth="1" ss:Width="250" />
 
67
 
 
68
## we loop over the sale_order_line
 
69
    <Row>
 
70
        <Cell ss:StyleID="header" ><Data ss:Type="String">Product Code</Data></Cell>
 
71
        <Cell ss:StyleID="header" ><Data ss:Type="String">Product Description</Data></Cell>
 
72
        <Cell ss:StyleID="header" ><Data ss:Type="String">Quantity</Data></Cell>
 
73
        <Cell ss:StyleID="header" ><Data ss:Type="String">UoM</Data></Cell>
 
74
        <Cell ss:StyleID="header" ><Data ss:Type="String">Price</Data></Cell>
 
75
        <Cell ss:StyleID="header" ><Data ss:Type="String">Delivery requested date</Data></Cell>
 
76
        <Cell ss:StyleID="header" ><Data ss:Type="String">Currency</Data></Cell>
 
77
        <Cell ss:StyleID="header" ><Data ss:Type="String">Comment</Data></Cell>
 
78
    </Row>
 
79
    % for line in o.order_line:
 
80
    <Row>
 
81
        <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.default_code or '')|x}</Data></Cell>
 
82
        <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.product_id.name or '')|x}</Data></Cell>
 
83
        <Cell ss:StyleID="line" ><Data ss:Type="Number">${(line.product_uom_qty)|x}</Data></Cell>
 
84
        <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.product_uom.name or '')|x}</Data></Cell>
 
85
        <Cell ss:StyleID="line" ><Data ss:Type="Number">${(line.price_unit or '')|x}</Data></Cell>
 
86
        % if line.date_planned :
 
87
        <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${line.date_planned|n}T00:00:00.000</Data></Cell>
 
88
        % elif o.delivery_requested_date:
 
89
        <Cell ss:StyleID="short_date" ><Data ss:Type="DateTime">${o.delivery_requested_date|n}T00:00:00.000</Data></Cell>
 
90
        % endif
 
91
        <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.functional_currency_id.name or '')|x}</Data></Cell>
 
92
        <Cell ss:StyleID="line" ><Data ss:Type="String">${(line.comment or '')|x}</Data></Cell>
 
93
    </Row>
 
94
    % endfor
 
95
% endfor
 
96
</Table>
 
97
<x:WorksheetOptions/></ss:Worksheet></Workbook>
 
 
b'\\ No newline at end of file'