/[papo]/papo/forms/ivaBuyer.neb
ViewVC logotype

Diff of /papo/forms/ivaBuyer.neb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by mhepp, Thu Oct 23 20:10:56 2003 UTC revision 1.16 by mhepp, Fri Oct 24 17:30:09 2003 UTC
# Line 7  Line 7 
7      my $uniqed=0;      my $uniqed=0;
8    </neb:Block>    </neb:Block>
9    <datasource name="printDataSource" cache="1"/>    <datasource name="printDataSource" cache="1"/>
   
 <!--   <datasource name="invTaxTotDataSource" database="papo" -->  
 <!--               table="alien_document, alien_document_tax"> -->  
 <!--     <condition> -->  
 <!--       <eq> -->  
 <!--         <cfield name="alien_document.id"/> -->  
 <!--         <cfield name="alien_document_tax.alien_document"/> -->  
 <!--       </eq> -->  
 <!--     </condition> -->  
 <!--   </datasource> -->  
   
10    <datasource name="productInvoiceDataSource" database="papo"    <datasource name="productInvoiceDataSource" database="papo"
11                table="_entity_data as provider, alien_document, _entity_uid_data, _document_type_data"                table="_entity_data as provider, alien_document, _entity_uid_data, _document_type_data"
12                order_by="alien_document.date,alien_document.number">                order_by="alien_document.date,alien_document.number">
# Line 71  Line 60 
60            <!-- provider credit notes -->            <!-- provider credit notes -->
61            <eq>            <eq>
62              <cfield name="alien_document.alien_document_type"/>              <cfield name="alien_document.alien_document_type"/>
63                <cconst value="33"/>
64              </eq>
65              <eq>
66                <cfield name="alien_document.alien_document_type"/>
67                <cconst value="34"/>
68              </eq>
69              <eq>
70                <cfield name="alien_document.alien_document_type"/>
71                <cconst value="35"/>
72              </eq>
73             <!-- provider credit notes -->
74              <eq>
75                <cfield name="alien_document.alien_document_type"/>
76              <cconst value="18"/>              <cconst value="18"/>
77            </eq>            </eq>
78            <eq>            <eq>
# Line 85  Line 87 
87        </and>        </and>
88      </condition>      </condition>
89    </datasource>    </datasource>
90      <!--datasource para búsqueda de other taxes-->
91      <datasource  name="otherDocumentTaxDataSource" database="papo"
92        table="alien_document_tax" />
93    
94  <!-- separar taxes-->    <!-- /separar taxes-->
 <!--datasource para búsqueda de ownDocumentTaxTotal-->  
 <!-- <datasource  name="ownDocumentTaxTotalDataSource" database="papo" -->  
 <!--   table="own_document_tax_total" /> -->  
   
 <!--datasource para búsqueda de other taxes-->  
 <datasource  name="otherDocumentTaxDataSource" database="papo"  
   table="alien_document_tax" />  
   
 <!-- /separar taxes-->  
   
 <!--   <datasource database="papo" name="alienDocumentDataSource" table="alien_document" -->  
 <!--     order_by="date" /> -->  
 <!--para buscar branch-->  
   
95    <neb:Sub neb:src="datasource.nebc" zot="../zot/PAPO-ER.zot" search="own_branch"    <neb:Sub neb:src="datasource.nebc" zot="../zot/PAPO-ER.zot" search="own_branch"
96    name="ownBranchSearchDataSource" database="papo"/>      name="ownBranchSearchDataSource" database="papo"/>
97      
98      <trigger name="startUp" type="On-Startup">
99        callTrigger('adminPeriodSet')
100        print "startup"
101      </trigger>
102      
103      <trigger name="printDateTrigger" type="NAMED">
104    if not str(printByDateBlock.startDateEntry).strip() \
105        or not str(printByDateBlock.startDateEntry).strip():
106        genericBox("Las fechas deben tener un valor",['Aceptar'])
107    else:
108        printDataSource.selectBy = "date"  
109        callTrigger('printTrigger')
110     </trigger>
111    
112     <trigger name="printPeriodTrigger" type="NAMED">
113        printDataSource.selectBy = "period"  
114        callTrigger('printTrigger')
115     </trigger>
116    
117    <trigger name="printTrigger" type="NAMED">  <trigger name="printTrigger" type="NAMED">
118    
 if not str(printBlock.printBox.startDateEntry).strip() \  
    or not str(printBlock.printBox.startDateEntry).strip():  
   genericBox("Las fechas deben tener un valor",['Aceptar'])  
 else:  
119    import gnue.common.GConditions as GConditions    import gnue.common.GConditions as GConditions
120    import string    import string
121    import hack    import hack
# Line 133  else: Line 138  else:
138    line += printing.printTitle("Perc.IVA",8) + "|"    line += printing.printTitle("Perc.IVA",8) + "|"
139    line += printing.printTitle("Otro",9) + "|"    line += printing.printTitle("Otro",9) + "|"
140    line += printing.printTitle("Total",11)    line += printing.printTitle("Total",11)
   
141    table.append(line)    table.append(line)
142    table.append(separator)    table.append(separator)
143    
144      #condiciones
145    condProductInvoice = GConditions.GCondition()    condProductInvoice = GConditions.GCondition()
146    tmpAnd = GConditions.GCand(condProductInvoice)    tmpAnd = GConditions.GCand(condProductInvoice)
147    ge = GConditions.GCge(tmpAnd)    
   GConditions.GCField(ge,"alien_document.date")  
   GConditions.GCConst(ge,str(printBlock.printBox.startDateEntry))  
   lt = GConditions.GClt(tmpAnd)  
   GConditions.GCField(lt,"alien_document.date")  
148    
149    endTime = hack.addNDaysToDate(printBlock.printBox.endDateEntry)    #por fecha
150      if printDataSource.selectBy == "date" :
151          ge = GConditions.GCge(tmpAnd)
152          GConditions.GCField(ge,"alien_document.date")
153          GConditions.GCConst(ge,str(printByDateBlock.startDateEntry))
154          lt = GConditions.GClt(tmpAnd)
155          GConditions.GCField(lt,"alien_document.date")
156          endTime = hack.addNDaysToDate(printByDateBlock.endDateEntry)
157          GConditions.GCConst(lt,endTime)
158          #branch
159          ownBranchId=str(printByDateBlock.ownBranchIdSearch)
160      #por periodo
161      else:
162          eq6 = GConditions.GCeq(tmpAnd)
163          GConditions.GCField(eq6,"alien_document.id")
164          GConditions.GCField(eq6,"alien_document_admin_period.alien_document")
165          eq7 = GConditions.GCeq(tmpAnd)
166          GConditions.GCField(eq7,"alien_document_admin_period.admin_period")
167          GConditions.GCConst(eq7,str(printByPeriodBlock.periodoIdEntry))
168          #branch
169          ownBranchId=str(printByPeriodBlock.ownBranchIdSearch)
170        
   GConditions.GCConst(lt,endTime)  
171    #condiciones por Branch    #condiciones por Branch
172    if str(printBlock.printBox.ownBranchIdSearch):    if str(printByDateBlock.ownBranchIdSearch):
173     #print str(printBlock.printBox.ownBranchIdSearch)     #print str(printByDateBlock.ownBranchIdSearch)
174     #condiciono relacion ownPos con ownBranch     #condiciono relacion ownPos con ownBranch
175     #condiciono documentos emitidos por el pos     #condiciono documentos emitidos por el pos
176     eq1 = GConditions.GCeq(tmpAnd)     eq1 = GConditions.GCeq(tmpAnd)
177     GConditions.GCField(eq1,"_entity_relation_data.entity_from")     GConditions.GCField(eq1,"_entity_relation_data.entity_from")
178     GConditions.GCField(eq1,"_entity_data._table")     GConditions.GCField(eq1,"_entity_data._table")
    eq5 = GConditions.GCeq(tmpAnd)  
    GConditions.GCField(eq5,"_entity_data.id")  
    GConditions.GCField(eq5,"alien_document.own_entity")  
179     eq2 = GConditions.GCeq(tmpAnd)     eq2 = GConditions.GCeq(tmpAnd)
180     GConditions.GCField(eq2,"_entity_relation_data.entity_to")     GConditions.GCField(eq2,"_entity_data.id")
181     GConditions.GCConst(eq2,str(printBlock.printBox.ownBranchIdSearch))     GConditions.GCField(eq2,"alien_document.own_entity")
    #condiciono relacion del tipo own_pos del branch al que pertenece  
182     eq3 = GConditions.GCeq(tmpAnd)     eq3 = GConditions.GCeq(tmpAnd)
183     GConditions.GCField(eq3,"_entity_relation_data._table")     GConditions.GCField(eq3,"_entity_relation_data.entity_to")
184     GConditions.GCField(eq3,"_relation_types_data.entity_relation")     GConditions.GCConst(eq3,ownBranchId)
185       #GConditions.GCConst(eq3,str(printByDateBlock.ownBranchIdSearch))
186       #condiciono relacion del tipo own_pos del branch al que pertenece
187     eq4 = GConditions.GCeq(tmpAnd)     eq4 = GConditions.GCeq(tmpAnd)
188     GConditions.GCField(eq4,"_relation_types_data.relation_type")     GConditions.GCField(eq4,"_entity_relation_data._table")
189     GConditions.GCConst(eq4,<neb:Inline>'"'.PAPO::posOfType.'"'</neb:Inline>)     GConditions.GCField(eq4,"_relation_types_data.entity_relation")
190       eq5 = GConditions.GCeq(tmpAnd)
191       GConditions.GCField(eq5,"_relation_types_data.relation_type")
192       GConditions.GCConst(eq5,<neb:Inline>'"'.PAPO::posOfType.'"'</neb:Inline>)
193     # solo veo los datos actuales     # solo veo los datos actuales
194     null1 = GConditions.GCnull(tmpAnd)     null1 = GConditions.GCnull(tmpAnd)
195     GConditions.GCField(null1,"_relation_types_data._end_t")     GConditions.GCField(null1,"_relation_types_data._end_t")
# Line 185  else: Line 207  else:
207    totalOtherTax = 0    totalOtherTax = 0
208    totalAmount = 0    totalAmount = 0
209        
210    documentSign={'2': 1, '10':1, '11':1,'18':-1, '20':-1, '19':-1}    documentSign={'2': 1, '10':1, '11':1,'33': 1, '34':1, '35':1,'18':-1, '20':-1, '19':-1}
211    
212    print more    print more
213    while more:    while more:
# Line 290  else: Line 312  else:
312    ]]></trigger>    ]]></trigger>
313    
314    <page name="por Fechas">    <page name="por Fechas">
315        <box height="8" label="Listado de I.V.A. Compras"
316      <block datasource="printDataSource" name="printBlock" restrictInsert="">        name="printBox" width="37" x="1" y="1">
317          <block datasource="printDataSource" name="printByDateBlock" restrictInsert="">
       <box height="8" label="Listado de I.V.A. Compras"  
         name="printBox" width="37" x="1" y="1">  
318          <label name="startDateLbl" text="Desde : " x="1" y="1"/>          <label name="startDateLbl" text="Desde : " x="1" y="1"/>
319          <entry name="startDateEntry" typecast="date" x="9" y="1"          <entry name="startDateEntry" typecast="date" x="9" y="1"
320          width="12"/>          width="12"/>
# Line 305  else: Line 325  else:
325          <entry  x="9" y="3" name="ownBranchIdSearch"  width="25" style="dropdown"          <entry  x="9" y="3" name="ownBranchIdSearch"  width="25" style="dropdown"
326            foreign_key="ownBranchSearchDataSource._entity_data._table"            foreign_key="ownBranchSearchDataSource._entity_data._table"
327            foreign_key_description="_entity_data.name" />            foreign_key_description="_entity_data.name" />
328          <button x="2" y="4" trigger="printTrigger" width="20" label="Imprimir"          <button x="2" y="4" trigger="printDateTrigger" width="20" label="Imprimir"
329            name="printBotton" height="1"/>            name="printBotton" height="1"/>
   
       </box>  
   
330      </block>      </block>
331      </box>
332     </page>
333    
   </page>  
   <page name="por Periodos">  
334    
335    </page>  <!-- Por Periodos  -->
336    
337    <!-- Datasource para busqueda y seleccion del ultimo periodo sin cerrar -->
338     <datasource name="adminPeriodSetDataSource" database="papo"
339       table="admin_period" order_by="id">
340      <condition>
341        <and>
342          <eq>
343            <cfield name="admin_period.admin_period_type"/>
344            <cconst value="1" />
345          </eq>
346          <eq>
347            <cfield name="admin_period.closed"/>
348            <cconst value="f" />
349          </eq>
350        </and>
351      </condition>
352     </datasource>
353    
354     <trigger name="adminPeriodSet" type="NAMED">
355      adminPeriodSetResultSet = adminPeriodSetDataSource.createResultSet()
356      adminPeriodSetResultSet.firstRecord()
357      adminPeriodId = adminPeriodSetResultSet.current.getField("id")
358      adminPeriodName = adminPeriodSetResultSet.current.getField("name")
359      #print "adminPeriodId", adminPeriodId
360      #print "adminPeriodName", adminPeriodName
361      #asigno
362      printByPeriodBlock.periodoIdEntry = adminPeriodId
363      callTrigger ('admin_periodForId')
364    </trigger>
365    
366    <!--  -->
367    <datasource name="periodoIvaDropDownDataSource" database="papo" table="admin_period">
368      <condition>
369        <and>
370          <eq>
371            <cfield name="admin_period.admin_period_type"/>
372            <cconst value="1" />
373          </eq>
374        </and>
375      </condition>
376    </datasource>
377    <!-- / -->
378      <page name="por Periodos">
379        <box height="8" label="Listado de I.V.A. Compras" name="printBox" width="37" x="1" y="1">
380          <block datasource="printDataSource" name="printByPeriodBlock" restrictInsert="">
381            <label  text="Periodo : " x="1" y="1"/>
382            <lam:box lam:boxtype="h" x="10" y="1" width="12">
383            <neb:Sub neb:src="inlineSearch.nebc"
384              table="admin_period"
385              search_data_source="periodoIvaDropDownDataSource"
386              target_field="alien_document_admin_period.admin_period"
387              target_block="printByPeriodBlock"
388              object_select_form="productClassificationSelect.gfd"
389              disable_object_form="1"
390              block_name="periodoBlock"
391              id_entry="periodoIdEntry"
392              id_field="id"
393              name_entry="periodoNameEntry"
394              with_history=""
395              use_code =""
396              rows="1"
397              />
398              </lam:box>
399            <label  text="sucursal :" x="1" y="3"/>
400            <entry  x="9" y="3" name="ownBranchIdSearch"  width="25" style="dropdown"
401              foreign_key="ownBranchSearchDataSource._entity_data._table"
402              foreign_key_description="_entity_data.name" />
403            <button x="2" y="4" trigger="printPeriodTrigger" width="20" label="Imprimir"
404              name="printBotton" height="1"/>
405             </block>
406      </box>
407     </page>
408  </form>  </form>

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26