cancel
Showing results for 
Search instead for 
Did you mean: 

Aplicar Pago de Facturas con B1if

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

felipe_loyolarodriguez
Active Contributor
0 Kudos

Así es.

Esa es la mejor manera de averiguar el formato de un documento.


Saludos

Answers (1)

Answers (1)

felipe_loyolarodriguez
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hola Felipe muchas gracias por tu respuesta

te comento que lo modifique como sugieres y me manda este error el Message Log


Exception : Connect to Business One failed. (-105) Access to company database is not permitted;

log on to SAP Business One and sign end user license agreement (EULA)

#b1Server=SAPB1, company=SAPB1, licenseServer=TI-SB1:30000,

dbType=6, dbUser=sa, userName=B1#

De casualidad sabrías cual es el formato correcto para insertar un objeto 24 (Incomming Payments) que es el que quiero insertar

saludos

felipe_loyolarodriguez
Active Contributor
0 Kudos

El nuevo error que te aparece es porque no puede establecer conexion con la base de datos.

Debes ir al SLD y hacer un test connection y corregir los datos de conexión para que sea succesful.

Saludos

Former Member
0 Kudos

Ok eso ya lo corregi, pero ahora me dice que no hay registros que coincidan


Exception : DI Error: (-2028) No matching records found (ODBC -2028)

podrias ayudarme con el formato del objeto 24

saludos

felipe_loyolarodriguez
Active Contributor
0 Kudos

Este es el xml de un pago completo.


<BOM>

    <BO>

        <AdmInfo>

            <Object>46</Object>

            <Version>2</Version>

        </AdmInfo>

        <Payments>

            <row>

                <DocNum>37</DocNum>

                <DocType>rSupplier</DocType>

                <HandWritten>tNO</HandWritten>

                <Printed>tNO</Printed>

                <DocDate>20131202</DocDate>

                <CardCode>V20000</CardCode>

                <CardName>Lasercom</CardName>

                <Address>800 Billings Road 95031 SANTIAGO CHILE</Address>

                <CashAccount>1-1-010-10-001</CashAccount>

                <DocCurrency>CLP</DocCurrency>

                <CashSum>1000000.000000</CashSum>

                <TransferAccount/>

                <TransferSum>0.000000</TransferSum>

                <LocalCurrency>tNO</LocalCurrency>

                <DocRate>0.000000</DocRate>

                <Reference1>37</Reference1>

                <JournalRemarks>Pagos efectuados - V20000</JournalRemarks>

                <SplitTransaction>tNO</SplitTransaction>

                <ContactPersonCode>22</ContactPersonCode>

                <ApplyVAT>tNO</ApplyVAT>

                <TaxDate>20131202</TaxDate>

                <Series>21</Series>

                <DiscountPercent>0.000000</DiscountPercent>

                <CurrencyIsLocal>tNO</CurrencyIsLocal>

                <DeductionPercent>0.000000</DeductionPercent>

                <DeductionSum>0.000000</DeductionSum>

                <BoeAccount>2-1-080-10-000</BoeAccount>

                <BillOfExchangeAmount>0.000000</BillOfExchangeAmount>

                <WTAmount>0.000000</WTAmount>

                <Proforma>tNO</Proforma>

                <PayToCode>de Facturacion</PayToCode>

                <IsPayToBank>tNO</IsPayToBank>

                <DocEntry>37</DocEntry>

                <PaymentPriority>bopp_Priority_6</PaymentPriority>

                <BankChargeAmount>0.000000</BankChargeAmount>

                <BankChargeAmountInSC>0.000000</BankChargeAmountInSC>

                <WtBaseSum>0.000000</WtBaseSum>

                <VatDate>20131202</VatDate>

                <TransactionCode/>

                <PaymentType>bopt_None</PaymentType>

                <TransferRealAmount>0.000000</TransferRealAmount>

                <DocObjectCode>bopot_OutgoingPayments</DocObjectCode>

                <DocTypte>rSupplier</DocTypte>

                <DueDate>20131202</DueDate>

                <ControlAccount>2-1-070-10-000</ControlAccount>

                <U_CTX_ICDC>N</U_CTX_ICDC>

                <U_CTX_PDRC>N</U_CTX_PDRC>

                <U_CTX_CTRV>N</U_CTX_CTRV>

                <U_PRUEBA>ALO</U_PRUEBA>

            </row>

        </Payments>

        <PrimaryFormItems>

            <row>

                <CashFlowAssignmentsID>8</CashFlowAssignmentsID>

                <CashFlowLineItemID>7</CashFlowLineItemID>

                <Credit>0.000000</Credit>

                <PaymentMeans>pmtCash</PaymentMeans>

                <AmountLC>1000000.000000</AmountLC>

                <AmountFC>0.000000</AmountFC>

            </row>

        </PrimaryFormItems>

    </BO>

</BOM>

Saludos

FLR

felipe_loyolarodriguez
Active Contributor
0 Kudos

El anterior es un pago a cuenta, este es de un pago con facturas.


<BOM>

    <BO>

        <AdmInfo>

            <Object>46</Object>

            <Version>2</Version>

        </AdmInfo>

        <Payments>

            <row>

                <DocNum>36</DocNum>

                <DocType>rSupplier</DocType>

                <HandWritten>tNO</HandWritten>

                <Printed>tNO</Printed>

                <DocDate>20090125</DocDate>

                <CardCode>V1010</CardCode>

                <CardName>Far East Imports</CardName>

                <Address>300 Elm Street 95035 SANTIAGO CHILE</Address>

                <CashAccount>1-1-010-10-001</CashAccount>

                <DocCurrency>CLP</DocCurrency>

                <CashSum>35784788.000000</CashSum>

                <TransferAccount>1-1-010-10-001</TransferAccount>

                <TransferSum>0.000000</TransferSum>

                <LocalCurrency>tNO</LocalCurrency>

                <DocRate>0.000000</DocRate>

                <Reference1>36</Reference1>

                <JournalRemarks>Outgoing Payments - V1010</JournalRemarks>

                <SplitTransaction>tNO</SplitTransaction>

                <ContactPersonCode>20</ContactPersonCode>

                <ApplyVAT>tNO</ApplyVAT>

                <TaxDate>20090125</TaxDate>

                <Series>21</Series>

                <DiscountPercent>0.000000</DiscountPercent>

                <CurrencyIsLocal>tNO</CurrencyIsLocal>

                <DeductionPercent>0.000000</DeductionPercent>

                <DeductionSum>0.000000</DeductionSum>

                <BoeAccount>2-1-080-10-000</BoeAccount>

                <BillOfExchangeAmount>0.000000</BillOfExchangeAmount>

                <WTAmount>0.000000</WTAmount>

                <Proforma>tNO</Proforma>

                <PayToCode>de Pago</PayToCode>

                <IsPayToBank>tNO</IsPayToBank>

                <DocEntry>36</DocEntry>

                <PaymentPriority>bopp_Priority_6</PaymentPriority>

                <BankChargeAmount>0.000000</BankChargeAmount>

                <BankChargeAmountInSC>0.000000</BankChargeAmountInSC>

                <WtBaseSum>0.000000</WtBaseSum>

                <VatDate>20090825</VatDate>

                <TransactionCode/>

                <PaymentType>bopt_None</PaymentType>

                <TransferRealAmount>0.000000</TransferRealAmount>

                <DocObjectCode>bopot_OutgoingPayments</DocObjectCode>

                <DocTypte>rSupplier</DocTypte>

                <DueDate>20090125</DueDate>

                <ControlAccount>2-1-070-10-000</ControlAccount>

                <U_CTX_ICDC>N</U_CTX_ICDC>

                <U_CTX_PDRC>N</U_CTX_PDRC>

                <U_CTX_CTRV>N</U_CTX_CTRV>

            </row>

        </Payments>

        <Payments_Invoices>

            <row>

                <LineNum>0</LineNum>

                <DocEntry>180</DocEntry>

                <SumApplied>11707369.000000</SumApplied>

                <AppliedFC>0.000000</AppliedFC>

                <AppliedSys>20708.000000</AppliedSys>

                <DocRate>0.000000</DocRate>

                <DocLine>0</DocLine>

                <InvoiceType>it_PurchaseInvoice</InvoiceType>

                <DiscountPercent>0.000000</DiscountPercent>

                <PaidSum>0.000000</PaidSum>

                <InstallmentId>1</InstallmentId>

                <TotalDiscount>0.000000</TotalDiscount>

                <TotalDiscountFC>0.000000</TotalDiscountFC>

            </row>

            <row>

                <LineNum>1</LineNum>

                <DocEntry>188</DocEntry>

                <SumApplied>2061675.000000</SumApplied>

                <AppliedFC>0.000000</AppliedFC>

                <AppliedSys>3647.000000</AppliedSys>

                <DocRate>0.000000</DocRate>

                <DocLine>0</DocLine>

                <InvoiceType>it_PurchaseInvoice</InvoiceType>

                <DiscountPercent>0.000000</DiscountPercent>

                <PaidSum>0.000000</PaidSum>

                <InstallmentId>1</InstallmentId>

                <TotalDiscount>0.000000</TotalDiscount>

                <TotalDiscountFC>0.000000</TotalDiscountFC>

            </row>

            <row>

                <LineNum>2</LineNum>

                <DocEntry>196</DocEntry>

                <SumApplied>22015744.000000</SumApplied>

                <AppliedFC>0.000000</AppliedFC>

                <AppliedSys>38942.000000</AppliedSys>

                <DocRate>0.000000</DocRate>

                <DocLine>0</DocLine>

                <InvoiceType>it_PurchaseInvoice</InvoiceType>

                <DiscountPercent>0.000000</DiscountPercent>

                <PaidSum>0.000000</PaidSum>

                <InstallmentId>1</InstallmentId>

                <TotalDiscount>0.000000</TotalDiscount>

                <TotalDiscountFC>0.000000</TotalDiscountFC>

            </row>

        </Payments_Invoices>

    </BO>

</BOM>

Saludos

FLR

Former Member
0 Kudos

disculpa, y si quiero hacer el pago con tarjeta de credito

que campos deberia usar

saludos