<?xml version="1.0" encoding="utf-8" ?>
<config>
  <connections>
    <connection id="SVM_PROD">
      <type>SQLServer</type>
      <connStr>User Id=dbuXXXX;Password=XXXX;Server=db.superventamovil.com,41500;Database=svmx;Trusted_Connection=false;MultipleActiveResultSets=True;TrustServerCertificate=True;</connStr>
      <commandTimeout>180</commandTimeout>
    </connection>

    <connection id="BASE_LOCAL_ERP_DEL_CLIENTE">
      <type>SQLServer</type>
      <connStr>User Id=dbuXXXX;Password=XXXX;Server=CLIENT_SQL,1433;Database=CLIENT_DB_DEV;Trusted_Connection=false;MultipleActiveResultSets=True;TrustServerCertificate=True;</connStr>
      <commandTimeout>180</commandTimeout>
    </connection>

    <connection id="SAMPLESAP">
      <type>SAP</type>
      <sapinstalled>true</sapinstalled>
      <dbservertype>15</dbservertype>
      <server>SAPSERVER</server>
      <usetrusted>false</usetrusted>
      <dbusername>DBUSER</dbusername>
      <dbpassword>XXXXXXX</dbpassword>
      <company>SAPTEST</company>
      <username>USERNAME</username>
      <password>XXXXXXX</password>
    </connection>
  </connections>

  <transferences>
    <transference id="PedidosCabecera">
      <mode>AP</mode>
      <source>SVM_PROD.vfPedidosCabeceraNuevos</source>
      <target>BASE_LOCAL_ERP_DEL_CLIENTE.vfPedidosCabecera</target>
      <copyType>DIRECT</copyType>
      <commands>
        <command type="update">
          <conn>source</conn>
          <table>vfPedidosCabeceraNuevos</table>
          <set>
            <field name="ped_estado">1</field>
          </set>
          <where>
            <field name="ped_fecha_reg">{source.ped_fecha_reg}</field>
            <field name="ped_usr_id">{source.ped_usr_id}</field>
          </where>
        </command>
      </commands>
    </transference>

    <transference id="PedidosDetalle">
      <mode>AP</mode>
      <source>SVM_PROD.vfPedidosDetalleNuevos</source>
      <target>BASE_LOCAL_ERP_DEL_CLIENTE.PedidosDetalle</target>
      <copyType>DIRECT</copyType>
      <commands>
        <command type="update">
          <conn>source</conn>
          <table>vfPedidosDetalleNuevos</table>
          <set>
            <field name="pedd_estado">1</field>
          </set>
          <where>
            <field name="pedd_fecha_reg">{source.pedd_fecha_reg}</field>
            <field name="pedd_usr_id">{source.pedd_usr_id}</field>
          </where>
        </command>
      </commands>
    </transference>

    <transference id="PedidosSVMXDesaToSAP">
      <mode>AP</mode>
      <source>SVM_PROD.vfPedidosNuevosSAP</source>
      <target>SAMPLESAP.Orders</target>
      <copyType>DIRECT</copyType>
      <commands>
        <command type="update">
          <conn>source</conn>
          <table>vfPedidosNuevosSAP</table>
          <set>
            <field name="ped_estado">1</field>
          </set>
          <where>
            <field name="DocDate">{source.DocDate}</field>
            <field name="ped_usr_id">{source.ped_usr_id}</field>
          </where>
        </command>
      </commands>
    </transference>
  </transferences>

  <notificationSettings>
    <enabled>true</enabled>
    <using>mi_mail</using>
    <subject>Fallo de transferencia</subject>
    <recipients>
      <recipient>soporte@DOMINIODELCLIENTE.com</recipient>
    </recipients>
    <skipSecs>3600</skipSecs>
    <consecutiveFails>3</consecutiveFails>
  </notificationSettings>

  <emailAccounts>
    <emailAccount id="mi_mail">
      <from>noreply@DOMINIODELCLIENTE.com</from>
      <host>SMTP_HOST_DEL_CLIENTE</host>
      <port>587</port>
      <enableSsl>true</enableSsl>
      <userName>SMTP_USER_DEL_CLIENTE</userName>
      <password>SMTP_PASSWORD_DEL_CLIENTE</password>
    </emailAccount>
  </emailAccounts>
</config>
