[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9535] property: invoice search criteria
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9535] property: invoice search criteria |
Date: |
Fri, 08 Jun 2012 10:34:39 +0000 |
Revision: 9535
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9535
Author: sigurdne
Date: 2012-06-08 10:34:39 +0000 (Fri, 08 Jun 2012)
Log Message:
-----------
property: invoice search criteria
Modified Paths:
--------------
trunk/property/inc/class.soinvoice.inc.php
trunk/property/inc/class.uiinvoice2.inc.php
trunk/property/js/portico/ajax_invoice.js
trunk/property/setup/phpgw_no.lang
trunk/property/templates/base/invoice2.xsl
Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php 2012-06-08 10:31:52 UTC (rev
9534)
+++ trunk/property/inc/class.soinvoice.inc.php 2012-06-08 10:34:39 UTC (rev
9535)
@@ -2304,8 +2304,36 @@
if($data['query'])
{
- $query = (int) $data['query'];
- $querymethod = " $where (bilagsnr = {$query} OR
bilagsnr_ut = {$query})";
+ switch ($data['criteria'])
+ {
+ case 'voucher_id':
+ $query = (int) $data['query'];
+ $querymethod = " $where
(bilagsnr = {$query} OR bilagsnr_ut = {$query})";
+ break;
+
+ case 'invoice_id':
+ $query = $data['query'];
+ $querymethod = " $where
fakturanr = '{$query}'";
+ break;
+
+ case 'order_id':
+ $query = $data['query'];
+ $querymethod = " $where
pmwrkord_code = '{$query}'";
+ break;
+
+ case 'vendor_id':
+ $query = (int) $data['query'];
+ $querymethod = " $where
(spvend_code = {$query} OR org_name {$this->like} '%{$data['query']}%')";
+ break;
+
+ case 'b_account':
+ $query = $data['query'];
+ $querymethod = " $where
spbudact_code = '{$query}'";
+ break;
+
+ default:
+ }
+
$where = 'AND';
}
Modified: trunk/property/inc/class.uiinvoice2.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice2.inc.php 2012-06-08 10:31:52 UTC (rev
9534)
+++ trunk/property/inc/class.uiinvoice2.inc.php 2012-06-08 10:34:39 UTC (rev
9535)
@@ -352,6 +352,35 @@
'values' => json_encode($datatable)
);
+ $criteria_list = array
+ (
+ array
+ (
+ 'id' => 'voucher_id',
+ 'name' => lang('voucher id'),
+ ),
+ array
+ (
+ 'id' => 'invoice_id',
+ 'name' => lang('invoice number'),
+ ),
+ array
+ (
+ 'id' => 'vendor_id',
+ 'name' => lang('vendor'),
+ ),
+ array
+ (
+ 'id' => 'order_id',
+ 'name' => lang('order id'),
+ ),
+ array
+ (
+ 'id' => 'b_account',
+ 'name' => lang('budget account'),
+ ),
+ );
+
$data = array
(
'td_count'
=> '""',
@@ -379,6 +408,7 @@
'janitor_list' =>
array('options' => $janitor_list),
'supervisor_list' =>
array('options' => $supervisor_list),
'budget_responsible_list' =>
array('options' => $budget_responsible_list),
+
'criteria_list' =>
array('options' => $criteria_list)
),
'filter_invoice'
=> array
(
@@ -456,9 +486,10 @@
$janitor_lid =
phpgw::get_var('janitor_lid', 'string');
$supervisor_lid =
phpgw::get_var('supervisor_lid', 'string');
$budget_responsible_lid =
phpgw::get_var('budget_responsible_lid', 'string');
+ $criteria =
phpgw::get_var('criteria', 'string');
$query =
phpgw::get_var('query', 'string');
- $vouchers = $this->bo->get_vouchers(array('janitor_lid'
=> $janitor_lid, 'supervisor_lid' => $supervisor_lid, 'budget_responsible_lid'
=>$budget_responsible_lid, 'query' => $query ));
+ $vouchers = $this->bo->get_vouchers(array('janitor_lid'
=> $janitor_lid, 'supervisor_lid' => $supervisor_lid, 'budget_responsible_lid'
=>$budget_responsible_lid, 'criteria' => $criteria, 'query' => $query ));
return $vouchers;
}
Modified: trunk/property/js/portico/ajax_invoice.js
===================================================================
--- trunk/property/js/portico/ajax_invoice.js 2012-06-08 10:31:52 UTC (rev
9534)
+++ trunk/property/js/portico/ajax_invoice.js 2012-06-08 10:34:39 UTC (rev
9535)
@@ -179,12 +179,16 @@
function update_voucher_filter(){
- var janitor_lid = $("#janitor_lid").val();
- var supervisor_lid = $("#supervisor_lid").val();
- var budget_responsible_lid = $("#budget_responsible_lid").val();
- var query = $("#query").val();
- var oArgs = {menuaction:'property.uiinvoice2.get_vouchers'};
+ var oArgs = {
+ menuaction:'property.uiinvoice2.get_vouchers',
+ janitor_lid: $("#janitor_lid").val(),
+ supervisor_lid: $("#supervisor_lid").val(),
+ budget_responsible_lid: $("#budget_responsible_lid").val(),
+ criteria: $("#criteria").val(),
+ query: $("#query").val()
+ };
+
var requestUrl = phpGWLink('index.php', oArgs, true);
var htmlString = "";
@@ -192,7 +196,7 @@
$.ajax({
type: 'POST',
dataType: 'json',
- url: requestUrl + "&janitor_lid=" + janitor_lid +
"&supervisor_lid=" + supervisor_lid + "&budget_responsible_lid=" +
budget_responsible_lid + "&query=" + query,
+ url: requestUrl,
success: function(data) {
if( data != null)
{
Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang 2012-06-08 10:31:52 UTC (rev 9534)
+++ trunk/property/setup/phpgw_no.lang 2012-06-08 10:34:39 UTC (rev 9535)
@@ -1416,6 +1416,7 @@
search by location_code. to show all entries, empty all fields and press the
submit button again property no Søk etter lokaliseringskode
search by property property no søk ved eiendom
search by seksjon. to show all entries, empty all fields and press the submit
button again property no Søk etter Seksjon
+search criteria property no Søkekriterie
search for history at this location property no søk etter
historikk for denne lokaliseringen
search for investment entries property no søk etter
investeringsposter
search for paid invoices property no søk etter betalte bilag
Modified: trunk/property/templates/base/invoice2.xsl
===================================================================
--- trunk/property/templates/base/invoice2.xsl 2012-06-08 10:31:52 UTC (rev
9534)
+++ trunk/property/templates/base/invoice2.xsl 2012-06-08 10:34:39 UTC (rev
9535)
@@ -169,8 +169,11 @@
<xsl:value-of select="php:function('lang', 'budget
responsible')" />
</td>
<td>
- <xsl:value-of select="php:function('lang', 'voucher
id')" />
+ <xsl:value-of select="php:function('lang', 'search
criteria')" />
</td>
+ <td>
+ <xsl:value-of select="php:function('lang', 'search')" />
+ </td>
</tr>
<tr id="filters">
<td>
@@ -189,6 +192,11 @@
</select>
</td>
<td>
+ <select id="criteria" name="criteria">
+ <xsl:apply-templates select="criteria_list/options"/>
+ </select>
+ </td>
+ <td>
<input type="text" name="query" id="query"/>
</td>
<td>
@@ -277,28 +285,6 @@
</div>
</td>
</tr>
-<!--
- <tr>
- <td>
- <xsl:value-of select="php:function('lang',
'amount')" />
- </td>
- <td>
- <div id="amount">
- <xsl:value-of
select="voucher_info/generic/amount"/>
- </div>
- </td>
- </tr>
- <tr>
- <td>
- <xsl:value-of select="php:function('lang',
'approved amount')" />
- </td>
- <td>
- <div id="approved_amount">
- <xsl:value-of
select="voucher_info/generic/approved_amount"/>
- </div>
- </td>
- </tr>
--->
<tr class ='row_on'>
<td>
<xsl:value-of select="php:function('lang',
'currency')" />
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9535] property: invoice search criteria,
Sigurd Nes <=