Skip to Content
author's profile photo Former Member
Former Member

Aplicar Pago de Facturas con B1if

Hola que tal

necesito aplicar los pagos de las facturas de SAP pero usando B1 Integration framework, al momento tengo esto:

<b1im_multimsg xmlns="">
  <xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;C&apos;]/jdbc:ResultSet/jdbc:Row">
  <b1im_msg>
  <B1out type="object">
  <Payments>
  <row>
  <CardCode><xsl:value-of select="jdbc:CL"></xsl:value-of></CardCode>
  <DocEntry><xsl:value-of select="jdbc:FC"></xsl:value-of></DocEntry>
  <Reference1><xsl:value-of select="jdbc:RF"></xsl:value-of></Reference1>
  </row>
  <CreditCards>
  <row>
  <!--<CardValidUntil></CardValidUntil>
  <CreditCard></CreditCard>-->
  <CreditCardNumber><xsl:value-of select="jdbc:TC"></xsl:value-of></CreditCardNumber>
  <CreditSum><xsl:value-of select="jdbc:IM"></xsl:value-of></CreditSum>
  </row>
  </CreditCards>
  </Payments>
  </B1out>
  </b1im_msg>
  </xsl:for-each>
  </b1im_multimsg>

Pero me arroja el siguiente error:

Exception : DI error: Invoke of: GetBusinessObjectFromXML Source: Description: Property 'row' of 'Payment' is invalid

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2014 at 04:27 PM

    Hola, Felipe

    Gracias por tu colaboracion me diste una idea de como deberia ser el formato de mi xml, asi que lo que hice fue lo siguiente

    Hice un nuevo step con B1Event y lo que hace es obtener la actualizacion de el objeto 24 (Incomming Payment) y desde el message log puedo ver el resultado.

    Y me dio este formato, lo comparto por si a alguien le sirve

    <Payload Role="S" Result="0000" Msg="">
        <BOM>
          <BO>
            <AdmInfo>
              <Object>24</Object>
              <Version>2</Version>
            </AdmInfo>
            <Payments>
              <row>
                <DocNum>1</DocNum>
                <DocType>rCustomer</DocType>
                <HandWritten>tNO</HandWritten>
                <Printed>tNO</Printed>
                <DocDate>20140128</DocDate>
                <CardCode>CLI-1234</CardCode>
                <CardName>user name</CardName>
                <Address>address</Address>
                <CashAccount/>
                <DocCurrency>MXP</DocCurrency>
                <CashSum>0.000000</CashSum>
                <CheckAccount nil="true"/>
                <TransferAccount nil="true"/>
                <TransferSum>0.000000</TransferSum>
                <TransferDate nil="true"/>
                <TransferReference nil="true"/>
                <LocalCurrency>tNO</LocalCurrency>
                <DocRate>0.000000</DocRate>
               <Reference1>1</Reference1>
               <Reference2>PG1234</Reference2>
               <CounterReference>PG1234</CounterReference>
               <Remarks nil="true"/>
               <JournalRemarks>Pagos recibidos - </JournalRemarks>
               <SplitTransaction>tNO</SplitTransaction>
                <ContactPersonCode>5405</ContactPersonCode>
                <ApplyVAT>tNO</ApplyVAT>
                <TaxDate>20140128</TaxDate>
                <Series>17</Series>
                <BankCode nil="true"/>
                <BankAccount nil="true"/>
                <DiscountPercent>0.000000</DiscountPercent>
                <ProjectCode nil="true"/>
                <CurrencyIsLocal>tNO</CurrencyIsLocal>
               <DeductionPercent>0.000000</DeductionPercent>
               <DeductionSum>0.000000</DeductionSum>
                <CashSumFC>0.000000</CashSumFC>
                <CashSumSys>0.000000</CashSumSys>
                <BoeAccount nil="true"/>
                <BillOfExchangeAmount>0.000000</BillOfExchangeAmount>
                <BillofExchangeStatus nil="true">0.000000</BillofExchangeStatus>
                <BillOfExchangeAmountFC>0.000000</BillOfExchangeAmountFC>
                <BillOfExchangeAmountSC>0.000000</BillOfExchangeAmountSC>
                <BillOfExchangeAgent nil="true"/>
                <WTCode nil="true"/>
                <WTAmount>0.000000</WTAmount>
                <WTAmountFC>0.000000</WTAmountFC>
                <WTAmountSC>0.000000</WTAmountSC>
                <WTAccount nil="true"/>
                <WTTaxableAmount>0.000000</WTTaxableAmount>
                <Proforma>tNO</Proforma>
                <PayToBankCode nil="true"/>
                <PayToBankBranch nil="true"/>
                <PayToBankAccountNo nil="true"/>
                <PayToCode>FACTURACION1</PayToCode>
                <PayToBankCountry nil="true"/>
                <IsPayToBank>tNO</IsPayToBank>
                <DocEntry>1</DocEntry>
                <PaymentPriority>bopp_Priority_6</PaymentPriority>
                <TaxGroup nil="true"/>
                <BankChargeAmount>0.000000</BankChargeAmount>
                <BankChargeAmountInFC>0.000000</BankChargeAmountInFC>
                <BankChargeAmountInSC>0.000000</BankChargeAmountInSC>
                <UnderOverpaymentdifference>0.000000</UnderOverpaymentdifference>
                <UnderOverpaymentdiffSC>0.000000</UnderOverpaymentdiffSC>
                <WtBaseSum>0.000000</WtBaseSum>
                <WtBaseSumFC>0.000000</WtBaseSumFC>
                <WtBaseSumSC>0.000000</WtBaseSumSC>
                <VatDate>20140128</VatDate>
                <TransactionCode/>
                <PaymentType>bopt_None</PaymentType>
                <TransferRealAmount>0.000000</TransferRealAmount>
                <DocObjectCode>bopot_IncomingPayments</DocObjectCode>
                <DocTypte>rCustomer</DocTypte>
                <DueDate>20140128</DueDate>
                <LocationCode nil="true">0</LocationCode>
                <Cancelled>tNO</Cancelled>
                <ControlAccount>_SYS00000000152</ControlAccount>
                <UnderOverpaymentdiffFC>0.000000</UnderOverpaymentdiffFC>
                <AuthorizationStatus>pasWithout</AuthorizationStatus>
                <BPLID nil="true">0</BPLID>
                <BPLName nil="true"/>
                <VATRegNum nil="true"/>
            </row>
           </Payments>
           <Payments_Invoices>
                <row>
                     <LineNum>0</LineNum>
                     <DocEntry>1227</DocEntry>
                     <SumApplied>1.160000</SumApplied>
                     <AppliedFC>0.000000</AppliedFC>
                     <AppliedSys>0.090000</AppliedSys>
                     <DocRate>0.000000</DocRate>
                     <DocLine>0</DocLine>
                     <InvoiceType>it_Invoice</InvoiceType>
                     <DiscountPercent>0.000000</DiscountPercent>
                     <PaidSum>0.000000</PaidSum>
                     <InstallmentId>1</InstallmentId>
                     <WitholdingTaxApplied>0.000000</WitholdingTaxApplied>
                     <WitholdingTaxAppliedFC>0.000000</WitholdingTaxAppliedFC>
                     <WitholdingTaxAppliedSC>0.000000</WitholdingTaxAppliedSC>
                     <LinkDate nil="true"/>
                     <DistributionRule nil="true"/>
                     <DistributionRule2 nil="true"/>
                     <DistributionRule3 nil="true"/>
                     <DistributionRule4 nil="true"/>
                     <DistributionRule5 nil="true"/>
                     <TotalDiscount>0.000000</TotalDiscount>
                     <TotalDiscountFC>0.000000</TotalDiscountFC>
                     <TotalDiscountSC>0.000000</TotalDiscountSC>
                </row>
           </Payments_Invoices>
           <Payments_CreditCards>
                <row>
                      <LineNum>0</LineNum> 
                      <CreditCard>3</CreditCard> 
                      <CreditAcct>_SYS00000000</CreditAcct> 
                      <CreditCardNumber>0001</CreditCardNumber> 
                      <CardValidUntil>201</CardValidUntil> 
                      <VoucherNum>12345</VoucherNum> 
                      <OwnerIdNum nil="true"/> 
                      <OwnerPhone nil="true"/> 
                      <PaymentMethodCode>1</PaymentMethodCode> 
                      <NumOfPayments>1</NumOfPayments> 
                      <FirstPaymentDue>20140128</FirstPaymentDue> 
                      <FirstPaymentSum>1.160000</FirstPaymentSum> 
                      <AdditionalPaymentSum>0.000000</AdditionalPaymentSum> 
                      <CreditSum>1.160000</CreditSum> x
                      <CreditCur>MXP</CreditCur> 
                      <CreditRate>0.000000</CreditRate> 
                      <ConfirmationNum nil="true"/> 
                      <NumOfCreditPayments>1</NumOfCreditPayments> 
                      <CreditType>cr_Regular</CreditType> 
                      <SplitPayments>tNO</SplitPayments> 
                </row>
           </Payments_CreditCards>
      </BO>
      </BOM>
    </Payload>
    

    Saludos

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 27, 2014 at 01:48 PM

    Buen dìa

    Si estàs añadiendo objetos de negocio, tu XML está mal formado.

    Debe tener esta estructura:

    <xsl:template name="transform">
            <BOM xmlns="">
                <BO>
                    <AdmInfo>
                        <Object>
                            <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom8&apos;]/jdbc:Row/jdbc:ObjType"/>
                        </Object>
                        <Version>2</Version>
                    </AdmInfo>
                    <Documents xmlns="">
                        <row>
                            <FolioPrefixString>FC</FolioPrefixString>
                            <FolioNumber>
                                <xsl:value-of select="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom8&apos;]/jdbc:Row/jdbc:FolioNum"/>
                            </FolioNumber>
                        </row>
                    </Documents>
                </BO>
            </BOM>
        </xsl:template>
    

    Además veo que tienes un for-each en tu xslt, recuerda que la DI API solo trabaja a 1 transacción a la vez, no puede enviarle múltiples mensajes.

    Para eso, debes usar un atom llamado for-each y enviar cada nuevo objeto de negocio al call B1 Object, y si quieres aun mas estabilidad, lo mejor es usar una atom de Internal Queque para enviar los B1 Object a una cola interna y luego procesarlos con otro step.

    Saludos

    FLR

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.