/[papo]/papo/forms/ctaCteClient.gfd
ViewVC logotype

Diff of /papo/forms/ctaCteClient.gfd

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

revision 1.5 by charlie, Mon Apr 7 20:05:29 2003 UTC revision 1.6 by styxman, Tue Apr 15 20:19:09 2003 UTC
# Line 3  Line 3 
3    
4  <form title="Cuenta Corriente Cliente" height="17" width="76">  <form title="Cuenta Corriente Cliente" height="17" width="76">
5    
6    <datasource name="clientSearchDataSource" database="papo"    <datasource name="clientSearchDataSource" database="papo"
7                table="_entity_data, _alien_entity_data, _persona_data, _client_data,                table="_entity_data, _alien_entity_data, _persona_data, _client_data,
8                       _price_type_data, entity_type_uid_conf, _entity_uid_type_data,                       _price_type_data, entity_type_uid_conf, _entity_uid_type_data,
9                       _entity_uid_data" order_by="_entity_data.name">                       _entity_uid_data" order_by="_entity_data.name">
10      <condition>      <condition>
11        <and>        <and>
# Line 62  Line 62 
62    
63    <!-- Origen de datos que srive para calcular el total facturado -->    <!-- Origen de datos que srive para calcular el total facturado -->
64    
65    <datasource name="productInvoiceDataSource" database="papo"    <datasource name="productInvoiceDataSource" database="papo"
66                table="_entity_data, own_document, own_item, own_product_item, _price_data, own_item_tax"                table="_entity_data, own_document, own_item, own_product_invoice_item, _price_data, own_item_tax"
67                order_by="own_product_item.id">                order_by="own_product_invoice_item.id">
68      <condition>      <condition>
69        <and>        <and>
70          <eq>          <eq>
71            <!-- Aqui se refiere al cliente  -->            <!-- Aqui se refiere al cliente  -->
# Line 78  Line 78 
78          </eq>          </eq>
79          <eq>          <eq>
80            <cfield name="own_item.id"/>            <cfield name="own_item.id"/>
81            <cfield name="own_product_item.own_item"/>            <cfield name="own_product_invoice_item.own_item"/>
82          </eq>          </eq>
83          <eq>          <eq>
84            <cfield name="own_product_item.price"/>            <cfield name="own_product_invoice_item.price"/>
85            <cfield name="_price_data.id"/>            <cfield name="_price_data.id"/>
86          </eq>          </eq>
87          <eq>          <eq>
# Line 90  Line 90 
90          </eq>          </eq>
91          <eq>          <eq>
92            <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
93            <cconst value="4"/>            <cconst value="4"/>
94          </eq>          </eq>
95       </and>       </and>
96      </condition>      </condition>
97    </datasource>    </datasource>
98    
99    <datasource name="recipientInvoiceDataSource" database="papo"    <datasource name="recipientInvoiceDataSource" database="papo"
100                table="_entity_data, own_document, own_document_proceeding">                table="_entity_data, own_document, own_document_proceeding">
101      <condition>      <condition>
102        <and>        <and>
103          <eq>          <eq>
104            <!-- Aqui se refiere al cliente  -->            <!-- Aqui se refiere al cliente  -->
# Line 111  Line 111 
111          </eq>          </eq>
112          <eq>          <eq>
113            <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
114            <cconst value="3"/>            <cconst value="3"/>
115          </eq>          </eq>
116       </and>       </and>
117      </condition>      </condition>
118    </datasource>    </datasource>
119    
120    <datasource name="invTaxTotDataSource" database="papo"    <datasource name="invTaxTotDataSource" database="papo"
121                table="own_document, own_document_tax">                table="own_document, own_document_tax">
122      <condition>      <condition>
123        <eq>        <eq>
124          <cfield name="own_document.id"/>          <cfield name="own_document.id"/>
125          <cfield name="own_document_tax.own_document"/>          <cfield name="own_document_tax.own_document"/>
126        </eq>        </eq>
127      </condition>      </condition>
128    </datasource>    </datasource>
129    
130    
131    <datasource name="payTotDataSource" database="papo" table="_entity_data, own_document, own_document_proceeding">    <datasource name="payTotDataSource" database="papo" table="_entity_data, own_document, own_document_proceeding">
132      <condition>      <condition>
133        <and>        <and>
134          <eq>          <eq>
135            <!-- Aqui se refiere al cliente  -->            <!-- Aqui se refiere al cliente  -->
136            <cfield name="_entity_data._table"/>            <cfield name="_entity_data._table"/>
137            <cfield name="own_document.recipient"/>            <cfield name="own_document.recipient"/>
138          </eq>          </eq>
139          <eq>          <eq>
# Line 144  Line 144 
144            <or>            <or>
145              <eq>              <eq>
146                <cfield name="own_document.own_document_type"/>                <cfield name="own_document.own_document_type"/>
147                <cconst value="1"/>                <cconst value="1"/>
148              </eq>              </eq>
149              <eq>              <eq>
150                <cfield name="own_document.own_document_type"/>                <cfield name="own_document.own_document_type"/>
151                <cconst value="4"/>                <cconst value="4"/>
152              </eq>              </eq>
153            </or>            </or>
154          </and>          </and>
155        </and>        </and>
156      </condition>      </condition>
157    </datasource>    </datasource>
158    
159    <datasource database="papo" name="ownDocumentDataSource" table="own_document"    <datasource database="papo" name="ownDocumentDataSource" table="own_document"
160      order_by="date" />      order_by="date" />
161    
162     <datasource  name="ownItemDataSource" database="papo" detaillink="own_item.own_document"       <datasource  name="ownItemDataSource" database="papo" detaillink="own_item.own_document"
163       master="ownDocumentDataSource" masterlink="id"         master="ownDocumentDataSource" masterlink="id"
164       table="own_item, own_product_item, own_item_tax">       table="own_item, own_product_invoice_item, own_item_tax">
165      <condition>      <condition>
166        <and>        <and>
167          <eq>          <eq>
168            <cfield name="own_item.id"/>            <cfield name="own_item.id"/>
169            <cfield name="own_product_item.own_item"/>            <cfield name="own_product_invoice_item.own_item"/>
170          </eq>          </eq>
171           <eq>           <eq>
172             <cfield name="own_item.id"/>             <cfield name="own_item.id"/>
173             <cfield name="own_item_tax.own_item"/>             <cfield name="own_item_tax.own_item"/>
174          </eq>            </eq>
175          <eq>          <eq>
176             <cfield name="own_item_tax.tax"/>             <cfield name="own_item_tax.tax"/>
177             <cconst value="1"/>             <cconst value="1"/>
178           </eq>             </eq>
179        </and>        </and>
180      </condition>      </condition>
181    </datasource>    </datasource>
# Line 207  total = 0.0 Line 207  total = 0.0
207  if str(ownDocumentBlock.clientRecipientBox.clientEntry):  if str(ownDocumentBlock.clientRecipientBox.clientEntry):
208      import gnue.common.GConditions as GConditions      import gnue.common.GConditions as GConditions
209      import hack      import hack
210        
211      condProductInvoice = GConditions.GCondition()      condProductInvoice = GConditions.GCondition()
212      condRecipientInvoice = GConditions.GCondition()      condRecipientInvoice = GConditions.GCondition()
213    
# Line 231  if str(ownDocumentBlock.clientRecipientB Line 231  if str(ownDocumentBlock.clientRecipientB
231          invoiceToPayedBlock.invoiceBox.dateEntry = str(productInvoiceResultSet.current.getField("own_document.date"))          invoiceToPayedBlock.invoiceBox.dateEntry = str(productInvoiceResultSet.current.getField("own_document.date"))
232    
233          while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:          while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:
234              lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))              lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_invoice_item.qty"))
235              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price"))              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price"))
236              lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))              lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))
237              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))
238              item = lQty * lUnitPrice - lBonus - lDiscount              item = lQty * lUnitPrice - lBonus - lDiscount
239              itemTaxTotal = 0                      itemTaxTotal = 0
240              currItem = productInvoiceResultSet.current.getField("own_item.id")              currItem = productInvoiceResultSet.current.getField("own_item.id")
241              while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:              while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:
242                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))
# Line 247  if str(ownDocumentBlock.clientRecipientB Line 247  if str(ownDocumentBlock.clientRecipientB
247          while odt_more:          while odt_more:
248              invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))              invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))
249              odt_more = odt_rs.nextRecord()              odt_more = odt_rs.nextRecord()
250                    
251          invoiceToPayedBlock.invoiceBox.amountEntry = str(invoiceTotal)          invoiceToPayedBlock.invoiceBox.amountEntry = str(invoiceTotal)
252          invoiceToPayedBlock.invoiceBox.payedEntry = "0.0"          invoiceToPayedBlock.invoiceBox.payedEntry = "0.0"
253          invoiceToPayedBlock.newRecord()          invoiceToPayedBlock.newRecord()
# Line 269  if str(ownDocumentBlock.clientRecipientB Line 269  if str(ownDocumentBlock.clientRecipientB
269      import gnue.common.GConditions as GConditions      import gnue.common.GConditions as GConditions
270      import hack      import hack
271      import string      import string
272      
273      def printField (field,size):      def printField (field,size):
274          if str(field).strip() == "None":          if str(field).strip() == "None":
275              field = ""              field = ""
# Line 278  if str(ownDocumentBlock.clientRecipientB Line 278  if str(ownDocumentBlock.clientRecipientB
278      def printTitle (field,size):      def printTitle (field,size):
279          return str(field).center(size)          return str(field).center(size)
280    
281      
282      table = []      table = []
283      line = "\n\nListado de Cuenta Corrientes de Clientes\n\n\n"      line = "\n\nListado de Cuenta Corrientes de Clientes\n\n\n"
284      table.append(line)      table.append(line)
285        
286      line = printTitle("Documento",12)      line = printTitle("Documento",12)
287      line += printTitle("Numero",15)      line += printTitle("Numero",15)
288      line += printTitle("Fecha",15)      line += printTitle("Fecha",15)
# Line 312  if str(ownDocumentBlock.clientRecipientB Line 312  if str(ownDocumentBlock.clientRecipientB
312          line += printField(productInvoiceResultSet.current.getField("own_document.date"),15)          line += printField(productInvoiceResultSet.current.getField("own_document.date"),15)
313    
314          while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:          while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:
315              lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))              lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_invoice_item.qty"))
316              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price"))              lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price"))
317              lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))              lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))
318              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))              lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))
319              item = lQty * lUnitPrice - lBonus - lDiscount              item = lQty * lUnitPrice - lBonus - lDiscount
320              itemTaxTotal = 0                      itemTaxTotal = 0
321              currItem = productInvoiceResultSet.current.getField("own_item.id")              currItem = productInvoiceResultSet.current.getField("own_item.id")
322              while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:              while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:
323                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))                  itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))
# Line 344  tmpInvToPayedBlock.processRollback() Line 344  tmpInvToPayedBlock.processRollback()
344  invoiceToPayedBlock.processRollback()  invoiceToPayedBlock.processRollback()
345    
346      ]]></trigger>      ]]></trigger>
347      
348      <trigger name="clientSearchTrigger" type="NAMED"><![CDATA[      <trigger name="clientSearchTrigger" type="NAMED"><![CDATA[
349        codeToSearch = str(ownDocumentBlock.clientRecipientBox.clientCodeEntry)        codeToSearch = str(ownDocumentBlock.clientRecipientBox.clientCodeEntry)
350        nameToSearch = str(ownDocumentBlock.clientRecipientBox.clientNameEntry)        nameToSearch = str(ownDocumentBlock.clientRecipientBox.clientNameEntry)
# Line 368  invoiceToPayedBlock.processRollback() Line 368  invoiceToPayedBlock.processRollback()
368              ownDocumentBlock.clientRecipientBox.clientCodeEntry = str(clientResultBlock.uidEntry)              ownDocumentBlock.clientRecipientBox.clientCodeEntry = str(clientResultBlock.uidEntry)
369              ownDocumentBlock.clientRecipientBox.clientNameEntry = str(clientResultBlock.nameEntry)              ownDocumentBlock.clientRecipientBox.clientNameEntry = str(clientResultBlock.nameEntry)
370              ownDocumentBlock.clientRecipientBox.clientEntry = str(clientResultBlock.idEntry)              ownDocumentBlock.clientRecipientBox.clientEntry = str(clientResultBlock.idEntry)
371                
372          runForm ('clientSelect.gfd', {'data': clientResultBlock, 'callback': callback})          runForm ('clientSelect.gfd', {'data': clientResultBlock, 'callback': callback})
373        elif recordCount == 1:        elif recordCount == 1:
374          clientResultBlock.jumpRecord(0)          clientResultBlock.jumpRecord(0)
# Line 406  invoiceToPayedBlock.processRollback() Line 406  invoiceToPayedBlock.processRollback()
406    
407      <!-- Bloque para la búsqueda de clientes -->      <!-- Bloque para la búsqueda de clientes -->
408      <block name="clientResultBlock" datasource="clientSearchDataSource">      <block name="clientResultBlock" datasource="clientSearchDataSource">
409          <entry name="idEntry" field="_entity_data.id" hidden="" x="1" y="1" width="12"/>              <entry name="idEntry" field="_entity_data.id" hidden="" x="1" y="1" width="12"/>
410          <entry name="uidTypeEntry" field="_entity_uid_data.entity_uid_type" hidden="" x="1" y="1" width="12"/>                      <entry name="uidTypeEntry" field="_entity_uid_data.entity_uid_type" hidden="" x="1" y="1" width="12"/>
411          <entry name="uidEntry" field="_entity_uid_data.uid" hidden="" x="1" y="1" width="12"/>                      <entry name="uidEntry" field="_entity_uid_data.uid" hidden="" x="1" y="1" width="12"/>
412          <entry name="nameEntry" field="_entity_data.name" hidden="" x="1" y="1" width="20"/>              <entry name="nameEntry" field="_entity_data.name" hidden="" x="1" y="1" width="20"/>
413      </block>      </block>
414    
415      <block datasource="ownDocumentDataSource" name="ownDocumentBlock">      <block datasource="ownDocumentDataSource" name="ownDocumentBlock">
# Line 417  invoiceToPayedBlock.processRollback() Line 417  invoiceToPayedBlock.processRollback()
417        <entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/>        <entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/>
418        <box height="7" label="Datos del Cliente" name="clientRecipientBox" width="74" x="0" y="1">        <box height="7" label="Datos del Cliente" name="clientRecipientBox" width="74" x="0" y="1">
419          <label name="clientLbl" text="Cliente" x="1" y="1" />          <label name="clientLbl" text="Cliente" x="1" y="1" />
420          
421          <entry x="1" y="2" field="recipient" name="clientEntry" width="30" hidden=""/>          <entry x="1" y="2" field="recipient" name="clientEntry" width="30" hidden=""/>
422          <entry x="1" y="2" name="clientCodeEntry" width="20"/>          <entry x="1" y="2" name="clientCodeEntry" width="20"/>
423          <entry x="21" y="2" name="clientNameEntry" width="35"/>          <entry x="21" y="2" name="clientNameEntry" width="35"/>
424          <button name="clientSearchButton" trigger="clientSearchTrigger" label="Buscar"          <button name="clientSearchButton" trigger="clientSearchTrigger" label="Buscar"
425            width="7" height="1" x="56" y="2"/>            width="7" height="1" x="56" y="2"/>
426    
427          <label name="dateLbl" rows="1" text="Fecha" x="1" y="7" />          <label name="dateLbl" rows="1" text="Fecha" x="1" y="7" />
428          <entry field="date" name="dateEntry" style="label" readonly="" typecast="date"          <entry field="date" name="dateEntry" style="label" readonly="" typecast="date"
429            rows="1" width="24" x="7" y="7"/>            rows="1" width="24" x="7" y="7"/>
430          <button name="showInvoicesButton" trigger="showInvoiceToPayTrigger"          <button name="showInvoicesButton" trigger="showInvoiceToPayTrigger"
431            label="Cuenta Corriente" width="20" height="1" x="1" y="4"/>            label="Cuenta Corriente" width="20" height="1" x="1" y="4"/>
432          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"
433            width="20" height="1" x="43" y="4"/>            width="20" height="1" x="43" y="4"/>
434          <button name="printButton" trigger="printTrigger" label="Imprimir"          <button name="printButton" trigger="printTrigger" label="Imprimir"
435            width="20" height="1" x="22" y="4"/>            width="20" height="1" x="22" y="4"/>
436        </box>        </box>
437      </block>      </block>
# Line 445  invoiceToPayedBlock.processRollback() Line 445  invoiceToPayedBlock.processRollback()
445      </block>      </block>
446    
447      <block name="invoiceToPayedBlock" datasource="invoiceToPayedDataSource">      <block name="invoiceToPayedBlock" datasource="invoiceToPayedDataSource">
448        <box height="12" label="Documentos" name="invoiceBox"        <box height="12" label="Documentos" name="invoiceBox"
449          width="74" x="0" y="8">          width="74" x="0" y="8">
450          <label name="numberLbl" text="Numero" x="1" y="1"/>          <label name="numberLbl" text="Numero" x="1" y="1"/>
451          <label name="dateLbl" text="Fecha" x="12" y="1"/>          <label name="dateLbl" text="Fecha" x="12" y="1"/>
# Line 453  invoiceToPayedBlock.processRollback() Line 453  invoiceToPayedBlock.processRollback()
453          <label name="payedLbl" text="Pagado" x="34" y="1"/>          <label name="payedLbl" text="Pagado" x="34" y="1"/>
454    
455          <entry name="idEntry" field="id" style="label" hidden="" rows="8" x="1" y="2" width="1" />          <entry name="idEntry" field="id" style="label" hidden="" rows="8" x="1" y="2" width="1" />
456          <entry name="numberEntry" field="number" style="label" rows="8"          <entry name="numberEntry" field="number" style="label" rows="8"
457            x="1" y="2" width="10" readonly=""/>            x="1" y="2" width="10" readonly=""/>
458          <entry name="dateEntry" field="date" style="label" rows="8"          <entry name="dateEntry" field="date" style="label" rows="8"
459            x="11" y="2" width="11" readonly=""/>            x="11" y="2" width="11" readonly=""/>
460          <entry name="amountEntry" field="amount" style="label" rows="8"          <entry name="amountEntry" field="amount" style="label" rows="8"
461            typecast="number" displaymask="%0.2f"            typecast="number" displaymask="%0.2f"
462            x="23" y="2" width="10" readonly=""/>            x="23" y="2" width="10" readonly=""/>
463          <entry name="totalEntry" field="total" style="label" x="60" y="6"          <entry name="totalEntry" field="total" style="label" x="60" y="6"
464            width="10" readonly="" typecast="number" displaymask="%0.2f"/>            width="10" readonly="" typecast="number" displaymask="%0.2f"/>
465        </box>        </box>
466      </block>      </block>

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

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