~vauxoo/openerp-venezuela-localization/rodolfo-openerp-fiscal-printer-check-fiscal-data

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0"?>
<!--
    Bematech 4000Fi supports up tu 29 characters
    for the product description value, that's why
    we truncated it to that value
-->
<document filename="test.pdf">
  <template pageSize="215.9mm,279.4 mm" title="Test" author="Martin Simon" allowSplitting="20">
    <pageTemplate id="first">
      <frame id="first" x1="57.0" y1="57.0" width="498" height="678"/>
    </pageTemplate>
  </template>
  <stylesheet />
  <story>
      <section>
          <para>[[repeatIn(objects, 'o')]]</para>
        <section>
          <para> </para>
          <para>ack_st = ctypes.c_uint*4</para>
          <para>ack_st = ack_st(0,0,0,0)</para>
          <para>retorno = driver_obj.Bematech_FI_AbrePortaSerial(port)</para>
          <para>param1 = ctypes.create_string_buffer(1024)</para>
          <para>param2 = ctypes.create_string_buffer(1024)</para>
          <para>retorno = driver_obj.Bematech_FI_AbreCupom(param1,param2)</para>
        </section>
        <section>
          <para>[[repeatIn(get_lines(o), 'l')]]</para>
          <para>product_code = ctypes.create_string_buffer(8)</para>
          <para>product_code.value = "[[l.product_id.default_code]]"</para>
          <para>product_description = ctypes.create_string_buffer(30)</para>
          <para>product_description.value = "[[normal(l.product_id.name_template[:29])]]"</para>
          <para>move_type = ctypes.create_string_buffer(3)</para>
          <para>move_type.value = "[[get_tax_code(l) or "II"]]"</para>
          <para>product_qty = ctypes.create_string_buffer(5)</para>
          <para>product_qty.value = "[[str(l.qty).split('.')[0].rjust(4, '0')]]"</para>
          <para>product_price = ctypes.create_string_buffer(9)</para>
          <para>product_price.value = "[[''.join(str("%.2f" % l.price_unit).split('.')).rjust(8, '0')]]"</para>
          <para>product_discount = ctypes.create_string_buffer(5)</para>
          <para>product_discount.value = "0000"</para>
          <para>retorno = driver_obj.Bematech_FI_VendeItem(product_code, product_description, move_type, product_qty, product_price, product_discount, ack_st)</para>
        </section>
        <section>
          <para> </para>
          <para>sale_discount_type = ctypes.create_string_buffer(2)</para>
          <para>sale_discount_type.value = "D"</para>
          <para>sale_discount = ctypes.create_string_buffer(5)</para>
          <para>sale_discount.value = "0000"</para>
          <para>retorno = driver_obj.Bematech_FI_IniciaFechamentoCupom(sale_discount_type, sale_discount, ack_st)</para>
          <para>mensaje = ctypes.create_string_buffer(29)</para>
          <para>mensaje.value = "---Gracias por su compra---"</para>
          <para>cliente = ctypes.create_string_buffer(30)</para>
          <para>cliente.value = "[[normal(o.partner_id.name[:29])]]"</para>
          <para>cedula = ctypes.create_string_buffer(29)</para>
          <para>cedula.value = "[[o.partner_id.ref]]"</para>
          <para>direccion = ctypes.create_string_buffer(29)</para>
          <para>direccion.value = "[[normal(o.partner_id.address[0].street)]]"</para>
          <para>telefono = ctypes.create_string_buffer(29)</para>
          <para>telefono.value = "[[o.partner_id.phone]]"</para>
          <para>retorno = driver_obj.Bematech_FI_TerminaFechamentoCupom(mensaje, cliente, cedula, direccion, telefono, ack_st)</para>
          <para>retorno = driver_obj.Bematech_FI_FechaPorta()</para>
        </section>
        </section>
  </story>
</document>