/[papo]/papo/forms/components/posDocument.nebc
ViewVC logotype

Diff of /papo/forms/components/posDocument.nebc

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

revision 1.6 by mhepp, Fri May 23 18:58:42 2003 UTC revision 1.7 by mhepp, Mon Jun 2 19:05:55 2003 UTC
# Line 7  Line 7 
7  <!--   referencia al entry donde se define el tipo de documento a buscar -->  <!--   referencia al entry donde se define el tipo de documento a buscar -->
8  <!--   en $documentType y la busqueda se realiza mediante el trigger  -->  <!--   en $documentType y la busqueda se realiza mediante el trigger  -->
9  <!--   $searchNextDocumentNumber -->  <!--   $searchNextDocumentNumber -->
10    <!--   si se define $ownStorehouseBlock  genera datasouce, triggers y forms  -->
11    <!--   para buscar la "ownStorehouse" relacionada con el pos en el que -->
12    <!--   se está parado  -->
13    
14    
15    
16  <neb:Vars>  <neb:Vars>
17  $ownPosBlock => "ownPosBlock"  $ownPosBlock => "ownPosBlock"
# Line 19  $documentNumberEntryX =>"" Line 24  $documentNumberEntryX =>""
24  $documentNumberEntryY =>""  $documentNumberEntryY =>""
25  $searchNextDocumentNumber =>""  $searchNextDocumentNumber =>""
26  $searchOwnPosData => "searchOwnPosData"  $searchOwnPosData => "searchOwnPosData"
27    #storehouse
28    $ownStorehouseBlock =>""
29    $ownStorehouseIdEntry => "ownStorehouseIdEntry"
30    
31  </neb:Vars>  </neb:Vars>
32    
33        <!-- OWN STOREHOUSE -->
34      <neb:Block>if ($ownStorehouseBlock ne ""){</neb:Block>
35    <!--busqueda de storehouse-->
36      <datasource name="ownStorehowseResultDataSource" database="papo"
37        table="_entity_relation_data, _relation_types_data">
38        <condition>
39          <and>
40            <eq>
41              <cfield name="_entity_relation_data._table"/>
42              <cfield name="_relation_types_data.entity_relation"/>
43            </eq>
44            <eq>
45              <cfield name="_relation_types_data.relation_type"/>
46              <cconst value="neb:PAPO::posOfStorehouseType"/>
47            </eq>
48            <null>
49              <cfield name="_entity_relation_data._end_t"/>
50            </null>
51            <null>
52              <cfield name="_relation_types_data._end_t"/>
53            </null>
54          </and>
55      </condition>
56      </datasource>
57    
58     <trigger name="searchOwnStorehouse" type="NAMED">
59      ownStorehouseBlock.initQuery()
60      ownStorehouseBlock.ownPosEntityIdEntry =str(<neb:Inline>$ownPosBlock</neb:Inline>.ownPosEntityTableEntry)
61      ownStorehouseBlock.processQuery()
62      print "pos:",str(<neb:Inline>$ownPosBlock</neb:Inline>.<neb:Inline>$ownPosEntityIdEntry</neb:Inline>),"storehouse:",str(<neb:Inline>$ownStorehouseBlock</neb:Inline>.<neb:Inline>$ownStorehouseIdEntry</neb:Inline>)
63    
64     </trigger>
65    
66     <block name="neb:$ownStorehouseBlock" datasource="ownStorehowseResultDataSource" >
67      <entry name="neb:$ownPosEntityIdEntry" field="_entity_relation_data.entity_to" x="70"  y="5" />
68      <entry name="neb:$ownStorehouseIdEntry"  field="_entity_relation_data.entity_from" x="70"  y="6" />
69     </block>
70    <!--/busqueda de storehouse-->
71     <neb:Block>}</neb:Block>
72      <!--/POS DOCUMENT COMPONENT -->
73    
74  <!--pos-->  <!--pos-->
75   <datasource name="ownPosDataSource" database="papo" table="_own_pos_data,_own_entity_data,_entity_data" >   <datasource name="ownPosDataSource" database="papo" table="_own_pos_data,_own_entity_data,_entity_data" >
# Line 58  $searchOwnPosData => "searchOwnPosData" Line 107  $searchOwnPosData => "searchOwnPosData"
107            <cfield name="own_pos_document.id"/>            <cfield name="own_pos_document.id"/>
108            <cfield name="_own_pos_document_data._table"/>            <cfield name="_own_pos_document_data._table"/>
109          </eq>          </eq>
         <!-- numero para las facturas de servicios -->  
         <!--  <eq> -->  
         <!--    <cfield name="_own_pos_document_data.document_type"/> -->  
         <!--    <cconst value="4"/> -->  
         <!--  </eq> -->  
         <!-- que este activo -->  
110         <null>         <null>
111            <cfield name="_own_pos_document_data._end_t"/>            <cfield name="_own_pos_document_data._end_t"/>
112          </null>          </null>
# Line 74  $searchOwnPosData => "searchOwnPosData" Line 117  $searchOwnPosData => "searchOwnPosData"
117   <trigger name="neb:$searchNextDocumentNumber" type="NAMED">   <trigger name="neb:$searchNextDocumentNumber" type="NAMED">
118      import gnue.common.GConditions as GConditions      import gnue.common.GConditions as GConditions
119      callTrigger('searchOwnPosData')      callTrigger('searchOwnPosData')
120      condDocumentNumber = GConditions.GCondition()      if str(<neb:Inline>$documentType</neb:Inline>) != '':
121      tmpAnd = GConditions.GCand(condDocumentNumber)       condDocumentNumber = GConditions.GCondition()
122      eq = GConditions.GCeq(tmpAnd)       tmpAnd = GConditions.GCand(condDocumentNumber)
123      GConditions.GCField(eq,"_own_pos_document_data.document_type")       eq = GConditions.GCeq(tmpAnd)
124      GConditions.GCConst(eq,str(<neb:Inline>$documentType</neb:Inline>))       GConditions.GCField(eq,"_own_pos_document_data.document_type")
125      #pos       GConditions.GCConst(eq,str(<neb:Inline>$documentType</neb:Inline>))
126      eq1 = GConditions.GCeq(tmpAnd)       #pos
127      GConditions.GCField(eq1,"_own_pos_document_data.own_pos")       eq1 = GConditions.GCeq(tmpAnd)
128      GConditions.GCConst(eq1,str(ownPosBlock.ownPosEntityIdEntry))       GConditions.GCField(eq1,"_own_pos_document_data.own_pos")
129      #/pos       GConditions.GCConst(eq1,str(ownPosBlock.ownPosEntityTableEntry))
130      ownPosDocumentDataSource.createResultSet(condDocumentNumber)       #/pos
131         ownPosDocumentDataSource.createResultSet(condDocumentNumber)
132    
133    </trigger>    </trigger>
134   <neb:Block>}</neb:Block>   <neb:Block>}</neb:Block>
# Line 100  $searchOwnPosData => "searchOwnPosData" Line 144  $searchOwnPosData => "searchOwnPosData"
144   ownPosBlock.initQuery()   ownPosBlock.initQuery()
145   ownPosBlock.ownPosIdEntry = str(pos)   ownPosBlock.ownPosIdEntry = str(pos)
146   ownPosBlock.processQuery()   ownPosBlock.processQuery()
147     <neb:Block>if ($ownStorehouseBlock ne ""){</neb:Block>
148     callTrigger('searchOwnStorehouse')
149     <neb:Block>}</neb:Block>
150  </trigger>  </trigger>
151  <!--/pos-->  <!--/pos-->
152    
# Line 108  $searchOwnPosData => "searchOwnPosData" Line 155  $searchOwnPosData => "searchOwnPosData"
155    <neb:Block>if ($stockByInvoice ne ""){</neb:Block>    <neb:Block>if ($stockByInvoice ne ""){</neb:Block>
156    <entry name="neb:$stockByInvoice"  field="_own_pos_data.stock_by_invoice" x="65" y="1" hidden="" />    <entry name="neb:$stockByInvoice"  field="_own_pos_data.stock_by_invoice" x="65" y="1" hidden="" />
157    <neb:Block>}</neb:Block>    <neb:Block>}</neb:Block>
158    <entry name="neb:$ownPosEntityIdEntry" field="_entity_data._table"  <!-- como los documentos son historicos en si mismo uso el id en vez de table-->
159      <entry name="neb:$ownPosEntityIdEntry" field="_entity_data.id"
160        x="75" y="1" hidden=""/>
161    <entry name="ownPosEntityTableEntry" field="_entity_data._table"
162      x="75" y="1" hidden=""/>      x="75" y="1" hidden=""/>
163      <entry name="ownPosIdEntry" field="_own_pos_data._table"  x="85"      <entry name="ownPosIdEntry" field="_own_pos_data._table"  x="85"
164      y="1" hidden=""/>      y="1" hidden=""/>
# Line 129  $searchOwnPosData => "searchOwnPosData" Line 179  $searchOwnPosData => "searchOwnPosData"
179        x="50" y="1" width="15"/>        x="50" y="1" width="15"/>
180    </block>    </block>
181    <neb:Block>}</neb:Block>    <neb:Block>}</neb:Block>
182    <!--/POS DOCUMENT COMPONENT -->  
183    
184    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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