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

Diff of /papo/forms/voidInvoice.neb

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

revision 1.3 by styxman, Tue May 20 18:40:40 2003 UTC revision 1.4 by mhepp, Wed Jun 4 20:35:28 2003 UTC
# Line 1  Line 1 
1  <?xml version="1.0" encoding="ISO-8859-1"?>  <?xml version="1.0" encoding="ISO-8859-1"?>
2  <form width="80" height="25" title="Anulación de Facturas">  <form width="80" height="25" title="Anulación de Facturas">
3      <neb:Block>
4        use PAPO;
5        my $uniqed=0;
6      </neb:Block>
7    <datasource name="searchDataSource"/>    <datasource name="searchDataSource"/>
8    <datasource name="resultDataSource" database="papo" table="own_document">    <datasource name="tmpValuesDataSource" cache="1"/>
9      <datasource name="resultDataSource" database="papo" table="own_document,_entity_data">
10      <condition>      <condition>
11          <and>
12            <eq>
13              <cfield name="own_document.own_entity"/>
14              <cfield name="_entity_data.id"/>
15            </eq>
16        <or>        <or>
17          <eq> <cfield name="own_document_type"/> <cconst value="4"/> <!-- 'Factura de Productos' --> </eq>          <eq> <cfield name="own_document.own_document_type"/> <cconst value="4"/> <!-- 'Factura de Productos' --> </eq>
18          <eq> <cfield name="own_document_type"/> <cconst value="8"/> <!-- 'Factura de Productos' --> </eq>          <eq> <cfield name="own_document.own_document_type"/> <cconst value="8"/> <!-- 'Factura de Productos' --> </eq>
19          <eq> <cfield name="own_document_type"/> <cconst value="9"/> <!-- 'Factura de Productos' --> </eq>          <eq> <cfield name="own_document.own_document_type"/> <cconst value="9"/> <!-- 'Factura de Productos' --> </eq>
20        </or>        </or>
21          </and>
22      </condition>      </condition>
23    </datasource>    </datasource>
24    
# Line 87  Line 98 
98    
99    <neb:Sub neb:src="wait.nebc"/>    <neb:Sub neb:src="wait.nebc"/>
100    
101      <trigger name="startUp" type="On-Startup">
102      #cargo el own-pos entity id
103      callTrigger('searchOwnPosData')
104      #/cargo el own-pos entity id
105      </trigger>
106    
107    
108    <trigger name="searchTrigger" type="NAMED">    <trigger name="searchTrigger" type="NAMED">
109      callTrigger ('startWaitingModeTrigger')      callTrigger ('startWaitingModeTrigger')
110      resultBlock.clear ()      resultBlock.clear ()
111      resultBlock.initQuery ()      resultBlock.initQuery ()
112      resultBlock.numberEntry = str (searchBlock.numberEntry)+'%'      resultBlock.numberEntry = str(searchBlock.numberEntry)+'%'
113        resultBlock.ownEntityIdEntry = str(ownPosBlock.ownPosEntityTableEntry)
114      resultBlock.processQuery ()      resultBlock.processQuery ()
115      callTrigger ('endWaitingModeTrigger')      callTrigger ('endWaitingModeTrigger')
116    </trigger>    </trigger>
# Line 104  Line 123 
123      callTrigger ('startWaitingModeTrigger')      callTrigger ('startWaitingModeTrigger')
124      for document in filter(lambda x: (not hack.is_true(x._fields['own_document.is_void'])) != (not hack.is_true(x._initialData['own_document.is_void'])),      for document in filter(lambda x: (not hack.is_true(x._fields['own_document.is_void'])) != (not hack.is_true(x._initialData['own_document.is_void'])),
125                            resultDataSource.getRecords()):                            resultDataSource.getRecords()):
   
126          if document.getField('own_document.own_document_type') == 4:          if document.getField('own_document.own_document_type') == 4:
127                #le paso el número de documento a buscar
128                tmpValuesDataSource.documentidEntry= str(document.getField('own_document.id'))
129              # got to fix the stock              # got to fix the stock
130              if hack.a2f(document.getField('own_document.is_void')):              if hack.a2f(document.getField('own_document.is_void')):
131                  # return the stock                  callTrigger('stockAddTrigger')
                 f = lambda y: lambda x: x+y  
132              else:              else:
133                  # remove the stock                  callTrigger('stockSubstractTrigger')
                 f = lambda y: lambda x: x-y  
   
             itemBlock.clear()  
             itemBlock.initQuery()  
             itemBlock.documentEntry = str(document.getField('own_document.id'))  
             itemBlock.processQuery()  
   
             for item in itemDataSource.getRecords():  
                 levelBlock.clear()  
                 levelBlock.initQuery()  
                 levelBlock.productEntry = str( item.getField('_product_store_data.product') )  
                 levelBlock.processQuery()  
                 levelBlock.levelEntry.atomicModify(f(hack.a2f(item.getField('own_product_item.qty'))))  
             levelBlock.clear()  
134    
135      searchBlock.clear()      searchBlock.clear()
     itemBlock.clear()  
     levelBlock.clear()  
136      callTrigger ('endWaitingModeTrigger')      callTrigger ('endWaitingModeTrigger')
137    
138      from gnue.common.GDataObjects import ConnectionError as DBError      from gnue.common.GDataObjects import ConnectionError as DBError
# Line 166  Line 169 
169          <lam:box lam:boxtype="h" height="1"/>          <lam:box lam:boxtype="h" height="1"/>
170        </block>        </block>
171      </box>      </box>
172       <!--busco own pos entityIdEntry-->
173        <neb:Sub neb:src="posDocument.nebc" ownPosBlock="ownPosBlock"
174        ownPosEntityIdEntry="ownPosEntityIdEntry"
175        searchOwnPosData="searchOwnPosData"
176     ownStorehouseBlock ="ownStorehouseBlock" ownStorehouseIdEntry="ownStorehouseIdEntry" />
177    
178    <neb:Sub neb:src="setStock.nebc"
179          ownDocumentId="tmpValuesDataSource.documentidEntry"
180          storehouseEntityId="ownStorehouseBlock.ownStorehouseIdEntry"  
181    stockAddTrigger="stockAddTrigger"
182          stockSubstractTrigger="stockSubstractTrigger" />
183      <box label="Anular facturas">      <box label="Anular facturas">
184        <block name="resultBlock" datasource="resultDataSource" transparentBlock="" restrictInsert="">        <block name="resultBlock" datasource="resultDataSource" transparentBlock="" restrictInsert="">
185          <lam:box>          <lam:box>
186            <lam:box lam:boxtype="h">            <lam:box lam:boxtype="h">
187              <entry name="idREntry" field="own_document.id" hidden="y"/>              <entry name="idREntry" field="own_document.id" hidden="y"/>
188              <entry name="own_document_typeEntry" field="own_document.own_document_type" hidden="y"/>              <entry name="own_document_typeEntry" field="own_document.own_document_type" hidden="y"/>
189                <entry name="ownEntityIdEntry" field="_entity_data._table" hidden="y"/>
190              <lam:box>              <lam:box>
191                <label text="Fecha"/>                <label text="Fecha"/>
192                <lam:box lam:boxtype="h" height="1"/>                <lam:box lam:boxtype="h" height="1"/>
# Line 190  Line 204 
204              <lam:box>              <lam:box>
205                <label text="Cliente"/>                <label text="Cliente"/>
206                <lam:box lam:boxtype="h" height="1"/>                <lam:box lam:boxtype="h" height="1"/>
207                <entry name="clientEntry" field="own_document.recipient" style="textlookup" readonly="y"                <entry name="clientEntry" field="own_document.recipient" style="textlookup" readonly="y"                foreign_key="clientDataSource._entity_data.id" foreign_key_description="_entity_data.name"  rows="10"/>
                 foreign_key="clientDataSource._entity_data._table" foreign_key_description="_entity_data.name"  
                 rows="10"/>  
208              </lam:box>              </lam:box>
209              <lam:box width="1"/>              <lam:box width="1"/>
210              <lam:box>              <lam:box>
# Line 224  Line 236 
236        <entry x="0" y="0" field="_product_store_data.level" name="levelEntry" hidden="y"/>        <entry x="0" y="0" field="_product_store_data.level" name="levelEntry" hidden="y"/>
237        <entry x="0" y="0" field="own_product_item.qty" name="qtyEntry" hidden="y"/>        <entry x="0" y="0" field="own_product_item.qty" name="qtyEntry" hidden="y"/>
238      </block>      </block>
     <block name="levelBlock" datasource="levelDataSource">  
       <entry x="0" y="0" field="_product_store_data.level" name="levelEntry" hidden="y"/>  
       <entry x="0" y="0" field="_product_store_data.product" name="productEntry" hidden="y"/>  
       <entry x="0" y="0" field="_product_store_data.lowater" name="lowaterEntry" hidden="y"/>  
       <entry x="0" y="0" field="_product_store_data.hiwater" name="hiwaterEntry" hidden="y"/>  
       <entry x="0" y="0" field="_product_store_data.storehouse" name="storehouseEntry" hidden="y"/>  
     </block>  
239    </page>    </page>
240  </form>  </form>

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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