src/org/openbravo/erpCommon/ad_forms/DocLineCash_data.xsql
author Iván Perdomo <ivan.perdomo@openbravo.com>
Thu, 24 Apr 2008 17:12:02 +0000
changeset 770 8850d5956eba
parent 423 ecf368072c48
child 1060 7344af4a4a8a
permissions -rw-r--r--
Bug fix [0000111]. Modified mapping name used on manual code.
carlos@0
     1
<?xml version="1.0" encoding="UTF-8" ?>
carlos@0
     2
<!--
carlos@0
     3
 ******************************************************************************
carlos@0
     4
 * The contents of this file are subject to the   Compiere License  Version 1.1
carlos@0
     5
 * ("License"); You may not use this file except in compliance with the License
carlos@0
     6
 * You may obtain a copy of the License at http://www.compiere.org/license.html
carlos@0
     7
 * Software distributed under the License is distributed on an  "AS IS"  basis,
carlos@0
     8
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
carlos@0
     9
 * the specific language governing rights and limitations under the License.
carlos@0
    10
 * The Original Code is                  Compiere  ERP & CRM  Business Solution
carlos@0
    11
 * The Initial Developer of the Original Code is Jorg Janke  and ComPiere, Inc.
carlos@0
    12
 * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
carlos@0
    13
 * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
carlos@0
    14
 * Contributor(s): Openbravo SL
carlos@0
    15
 * Contributions are Copyright (C) 2001-2006 Openbravo S.L.
carlos@0
    16
 ******************************************************************************
carlos@0
    17
-->
carlos@0
    18
carlos@0
    19
carlos@0
    20
carlos@0
    21
carlos@0
    22
carlos@0
    23
<SqlClass name="DocLineCashData" package="org.openbravo.erpCommon.ad_forms">
carlos@0
    24
  <SqlClassComment></SqlClassComment>
carlos@0
    25
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    26
    <SqlMethodComment></SqlMethodComment>
carlos@0
    27
    <Sql>
carlos@0
    28
      <![CDATA[
carlos@0
    29
      SELECT C.C_CASHLINE_ID, C.AD_ORG_ID, C.LINE, C.DESCRIPTION, C.C_CHARGE_ID,
carlos@0
    30
      c.C_ORDER_ID, C.C_DEBT_PAYMENT_ID, 
carlos@0
    31
      C.AMOUNT,C.WRITEOFFAMT,C.CASHTYPE, C.DISCOUNTAMT,CB.C_CURRENCY_ID AS C_Currency_ID, 
carlos@0
    32
      (CASE WHEN DP.C_BPARTNER_ID IS NULL THEN O.C_BPARTNER_ID ELSE DP.C_BPARTNER_ID END) AS C_BPARTNER_ID
carlos@0
    33
      FROM C_CashLine C left join C_DEBT_PAYMENT DP on C.C_DEBT_PAYMENT_ID = DP.C_DEBT_PAYMENT_ID
carlos@0
    34
                        left join C_ORDER O on C.C_ORDER_ID = O.C_ORDER_ID,   
carlos@0
    35
           C_CASHBOOK CB, C_CASH CA
carlos@423
    36
      WHERE CA.C_Cash_ID = TO_NUMBER(?)
carlos@0
    37
      AND CB.C_CASHBOOK_ID = CA.C_CASHBOOK_ID
carlos@0
    38
      AND CA.C_CASH_ID = C.C_CASH_ID
carlos@0
    39
      ORDER BY Line
carlos@0
    40
     ]]>
carlos@0
    41
     </Sql>
carlos@0
    42
     <Parameter name="cash"/>
carlos@0
    43
   </SqlMethod>
carlos@0
    44
  <SqlMethod name="selectBank" type="preparedStatement" return="multiple">
carlos@0
    45
    <SqlMethodComment></SqlMethodComment>
carlos@0
    46
    <Sql>
carlos@0
    47
      <![CDATA[
carlos@423
    48
      SELECT AD_Org_ID, C_Currency_ID, 0 AS C_BPARTNER_ID FROM C_BankAccount WHERE C_BankAccount_ID = TO_NUMBER(?)
carlos@0
    49
     ]]>
carlos@0
    50
     </Sql>
carlos@0
    51
     <Parameter name="bankAccount"/>
carlos@0
    52
   </SqlMethod>
carlos@0
    53
  <SqlMethod name="selectReferenceInfo" type="preparedStatement" return="multiple">
carlos@0
    54
    <SqlMethodComment></SqlMethodComment>
carlos@0
    55
    <Sql>
carlos@0
    56
      <![CDATA[
carlos@423
    57
      SELECT AD_Org_ID, C_Currency_ID, C_BPartner_ID FROM C_Invoice WHERE C_Invoice_ID = TO_NUMBER(?)
carlos@0
    58
     ]]>
carlos@0
    59
     </Sql>
carlos@0
    60
     <Parameter name="invoice"/>
carlos@0
    61
   </SqlMethod>
carlos@0
    62
  <SqlMethod name="selectOrder" type="preparedStatement" return="multiple">
carlos@0
    63
    <SqlMethodComment></SqlMethodComment>
carlos@0
    64
    <Sql>
carlos@0
    65
      <![CDATA[
carlos@423
    66
      SELECT AD_Org_ID, C_Currency_ID, C_BPartner_ID FROM C_Order WHERE C_Order_ID = TO_NUMBER(?)
carlos@0
    67
     ]]>
carlos@0
    68
     </Sql>
carlos@0
    69
     <Parameter name="C_Order_ID"/>
carlos@0
    70
   </SqlMethod>
carlos@0
    71
  <SqlMethod name="selectPayment" type="preparedStatement" return="multiple">
carlos@0
    72
    <SqlMethodComment></SqlMethodComment>
carlos@0
    73
    <Sql>
carlos@0
    74
      <![CDATA[
carlos@423
    75
      SELECT AD_Org_ID, C_Currency_ID, C_BPartner_ID FROM C_DEBT_PAYMENT WHERE C_DEBT_PAYMENT_ID = TO_NUMBER(?)
carlos@0
    76
     ]]>
carlos@0
    77
     </Sql>
carlos@0
    78
     <Parameter name="C_DEBT_PAYMENT_ID"/>
carlos@0
    79
   </SqlMethod>
carlos@0
    80
  <SqlMethod name="selectDebtBPartner" type="preparedStatement" return="string" default="">
carlos@0
    81
    <SqlMethodComment></SqlMethodComment>
carlos@0
    82
    <Sql>
carlos@0
    83
      <![CDATA[
carlos@423
    84
      SELECT C_BPartner_ID FROM C_DEBT_PAYMENT WHERE C_DEBT_PAYMENT_ID = TO_NUMBER(?)
carlos@0
    85
     ]]>
carlos@0
    86
     </Sql>
carlos@0
    87
     <Parameter name="C_DEBT_PAYMENT_ID"/>
carlos@0
    88
   </SqlMethod>
carlos@0
    89
  </SqlClass>