src/org/openbravo/erpCommon/ad_forms/EdiFileImport_data.xsql
author Iván Perdomo <ivan.perdomo@openbravo.com>
Thu, 24 Apr 2008 17:12:02 +0000
changeset 770 8850d5956eba
parent 593 42d0fd250393
child 799 fef2c5e2feb7
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 Openbravo  Public  License
carlos@0
     5
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
carlos@0
     6
 * Version 1.1  with a permitted attribution clause; you may not  use this
carlos@0
     7
 * file except in compliance with the License. You  may  obtain  a copy of
carlos@0
     8
 * the License at http://www.openbravo.com/legal/license.html 
carlos@0
     9
 * Software distributed under the License  is  distributed  on  an "AS IS"
carlos@0
    10
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
carlos@0
    11
 * License for the specific  language  governing  rights  and  limitations
carlos@0
    12
 * under the License. 
carlos@0
    13
 * The Original Code is Openbravo ERP. 
carlos@0
    14
 * The Initial Developer of the Original Code is Openbravo SL 
carlos@0
    15
 * All portions are Copyright (C) 2001-2006 Openbravo SL 
carlos@0
    16
 * All Rights Reserved. 
carlos@0
    17
 * Contributor(s):  ______________________________________.
carlos@0
    18
 ************************************************************************
carlos@0
    19
-->
carlos@0
    20
carlos@0
    21
carlos@0
    22
carlos@0
    23
carlos@0
    24
carlos@0
    25
<SqlClass name="EdiFileImportData" package="org.openbravo.erpCommon.ad_forms">
carlos@0
    26
	<SqlClassComment></SqlClassComment>
carlos@0
    27
carlos@0
    28
	<SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    29
			<SqlMethodComment></SqlMethodComment>
carlos@0
    30
			<Sql> <![CDATA[
carlos@0
    31
				select I_ORDER_ID, AD_CLIENT_ID, AD_ORG_ID, AD_ORGTRX_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY,
carlos@0
    32
				I_ISIMPORTED, I_ERRORMSG, PROCESSING, PROCESSED, SALESREP_ID, M_WAREHOUSE_ID, M_PRICELIST_ID, C_CURRENCY_ID,
carlos@0
    33
				M_SHIPPER_ID, ISSOTRX, C_BPARTNER_ID, BPARTNERVALUE, NAME, C_BPARTNER_LOCATION_ID, BILLTO_ID, C_LOCATION_ID,
carlos@0
    34
				ADDRESS1, ADDRESS2, POSTAL, CITY, C_REGION_ID, REGIONNAME, C_COUNTRY_ID, COUNTRYCODE, AD_USER_ID, CONTACTNAME,
carlos@0
    35
				EMAIL, PHONE, C_PROJECT_ID, C_ACTIVITY_ID, C_DOCTYPE_ID, DOCTYPENAME, C_PAYMENTTERM_ID, PAYMENTTERMVALUE,
carlos@0
    36
				C_ORDER_ID, DOCUMENTNO, DESCRIPTION, M_PRODUCT_ID, PRODUCTVALUE, UPC, SKU, C_TAX_ID, TAXINDICATOR, TAXAMT,
carlos@0
    37
				C_ORDERLINE_ID, LINEDESCRIPTION, C_UOM_ID, QTYORDERED, PRICEACTUAL, FREIGHTAMT, C_CAMPAIGN_ID, DATEORDERED,
carlos@0
    38
				DATEPROMISED, ORDER_REFERENCENO, BPARTNERUPC, BILLTO_UPC, C_BPARTNER_LOCATION_UPC, VENDOR_UPC
carlos@0
    39
				from i_order
carlos@423
    40
				where I_ORDER_ID = TO_NUMBER(?)
carlos@0
    41
			]]></Sql>
carlos@0
    42
		<Parameter name="iOrderId"/>
carlos@0
    43
	</SqlMethod>
carlos@0
    44
carlos@0
    45
	<SqlMethod name="insert" type="preparedStatement" connection="true" return="rowCount" static="false">
carlos@0
    46
		<SqlMethodComment></SqlMethodComment>
carlos@0
    47
		<Sql>
carlos@0
    48
			<![CDATA[
carlos@0
    49
				INSERT INTO I_ORDER (
carlos@0
    50
				i_order_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, i_isimported,
carlos@0
    51
				issotrx, processing, processed, order_Referenceno, dateordered, datepromised, upc,
carlos@0
    52
				linedescription, qtyordered, bpartnerupc, doctypename, billto_upc, description, c_bpartner_location_upc, vendor_upc)
carlos@593
    53
				VALUES(TO_NUMBER(?), TO_NUMBER(?), TO_NUMBER(?), 'Y', now(), TO_NUMBER(?), now(), TO_NUMBER(?), ?, ?, ?, ?, ?, to_date(?, 'yyyymmdd'), to_date(?, 'yyyymmdd'), ?, ?, TO_NUMBER(?), ?, ?, ?, ?, ?, ?)
carlos@0
    54
		]]>
carlos@0
    55
		</Sql>
carlos@0
    56
		<Parameter name="iOrderId"/>
carlos@0
    57
		<Parameter name="adClientId"/>
carlos@0
    58
		<Parameter name="adOrgId"/>
carlos@0
    59
		<Parameter name="adUserId"/>
carlos@0
    60
		<Parameter name="adUserId"/>
carlos@0
    61
		<Parameter name="iIsimported"/>
carlos@0
    62
		<Parameter name="issotrx"/>
carlos@0
    63
		<Parameter name="processing"/>
carlos@0
    64
		<Parameter name="processed"/>
carlos@0
    65
		<Parameter name="orderReferenceno"/>
carlos@0
    66
		<Parameter name="dateordered"/>
carlos@0
    67
		<Parameter name="datepromised"/>
carlos@0
    68
		<Parameter name="upc"/>
carlos@0
    69
		<Parameter name="linedescription"/>
carlos@0
    70
		<Parameter name="qtyordered"/>
carlos@0
    71
		<Parameter name="bpartnerupc"/>
carlos@0
    72
		<Parameter name="doctypename"/>
carlos@0
    73
		<Parameter name="billtoUpc"/>
carlos@0
    74
		<Parameter name="description"/>
carlos@0
    75
		<Parameter name="cBpartnerLocationUpc"/>
carlos@0
    76
		<Parameter name="vendorUpc"/>
carlos@0
    77
	</SqlMethod>
carlos@0
    78
carlos@0
    79
	<SqlMethod name="delete" type="preparedStatement" connection="true" return="rowCount">
carlos@0
    80
		<SqlMethodComment></SqlMethodComment>
carlos@0
    81
		<Sql>
carlos@0
    82
			<![CDATA[
carlos@0
    83
				DELETE FROM I_ORDER
carlos@423
    84
				where ad_client_ID = TO_NUMBER(?)
carlos@0
    85
		]]>
carlos@0
    86
		</Sql>
carlos@0
    87
		<Parameter name="client"/>
carlos@0
    88
	</SqlMethod>
carlos@0
    89
carlos@0
    90
</SqlClass>