Skip to content

Commit

Permalink
One Record parsing fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Nov 9, 2024
1 parent baa9e08 commit 355a02c
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mServer/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function processResponseData($responseData): void
foreach ($responseData as $key => $value) {
switch ($key) {
case 'lAdb:addressbook':
$this->parsed = $this->processListAddressBook($value);
$this->parsed = $this->processListAddressBook(array_key_exists(0, $value) ? $value : [$value]);

break;
case 'rdc:producedDetails':
Expand All @@ -160,7 +160,7 @@ public function processResponseData($responseData): void

break;
case 'lst:bank':
$this->parsed = $this->processBank($value);
$this->parsed = $this->processBank(array_key_exists(0, $value) ? $value : [$value]);

break;
case '@version':
Expand Down
83 changes: 83 additions & 0 deletions tests/bank-one-record.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="Windows-1250"?>
<rsp:responsePack version="2.0" id="0.09550200 1731103280" state="ok" programVersion="13800.186 SQL (10.10.2024)" ico="24278998" key="a5595f20-4346-4fb9-b451-9da2d12cd745" note="generated by PHPmPohoda" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd" xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd" xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd" xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd" xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd" xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd" xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd" xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd" xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd" xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd" xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd" xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd" xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd" xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd" xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd" xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd" xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd" xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd" xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd" xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd" xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd" xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd" xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd" xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd" xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd" xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd" xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd" xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd" xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd" xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd" xmlns:lck="http://www.stormware.cz/schema/version_2/lock.xsd" xmlns:isd="http://www.stormware.cz/schema/version_2/isdoc.xsd" xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd" xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd" xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd" xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd" xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd" xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd" xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd" xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd" xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd" xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd" xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd" xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd" xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd" xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd" xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd" xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd" xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd" xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd" xmlns:rgn="http://www.stormware.cz/schema/version_2/registrationNumber.xsd" xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd" xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd" xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd" xmlns:req="http://www.stormware.cz/schema/version_2/productRequirement.xsd" xmlns:mov="http://www.stormware.cz/schema/version_2/movement.xsd" xmlns:rec="http://www.stormware.cz/schema/version_2/recyclingContrib.xsd" xmlns:srv="http://www.stormware.cz/schema/version_2/service.xsd" xmlns:rul="http://www.stormware.cz/schema/version_2/rulesPairing.xsd" xmlns:lwl="http://www.stormware.cz/schema/version_2/liquidationWithoutLink.xsd" xmlns:dis="http://www.stormware.cz/schema/version_2/discount.xsd" xmlns:lqd="http://www.stormware.cz/schema/version_2/automaticLiquidation.xsd" xmlns:uag="http://www.stormware.cz/schema/version_2/userAgenda.xsd" xmlns:apf="http://www.stormware.cz/schema/version_2/advancePartFulfilment.xsd">
<rsp:responsePackItem version="2.0" id="2" state="ok">
<lst:listBank version="2.0" dateTimeStamp="2024-11-08T23:01:20" dateValidFrom="2024-11-08" state="ok">
<lst:bank version="2.0">
<bnk:bankHeader>
<bnk:id>8540</bnk:id>
<bnk:bankType>receipt</bnk:bankType>
<bnk:account>
<typ:id>2</typ:id>
<typ:ids>RAF</typ:ids>
</bnk:account>
<bnk:number>RAF1550001</bnk:number>
<bnk:statementNumber>
<bnk:statementNumber>155</bnk:statementNumber>
<bnk:numberMovement>0001</bnk:numberMovement>
</bnk:statementNumber>
<bnk:symVar>1810</bnk:symVar>
<bnk:dateStatement>2024-11-07</bnk:dateStatement>
<bnk:datePayment>2024-11-07</bnk:datePayment>
<bnk:accounting>
<typ:id>1</typ:id>
<typ:ids>Ruènì</typ:ids>
</bnk:accounting>
<bnk:text>Úhrada VZ è. 240800470</bnk:text>
<bnk:partnerIdentity>
<typ:address>
<typ:company>Josef Novák</typ:company>
</typ:address>
</bnk:partnerIdentity>
<bnk:myIdentity>
<typ:address>
<typ:company>Pokusná Firma</typ:company>
<typ:title>s.r.o.</typ:title>
<typ:surname>Karel</typ:surname>
<typ:name>Novotný</typ:name>
<typ:city>Praha 7</typ:city>
<typ:street>Biskupcova</typ:street>
<typ:number>1595/14</typ:number>
<typ:zip>174 00</typ:zip>
<typ:ico>24556798</typ:ico>
<typ:dic>CZ24274648</typ:dic>
</typ:address>
</bnk:myIdentity>
<bnk:symConst>0308</bnk:symConst>
<bnk:symPar>1810</bnk:symPar>
<bnk:lock2>false</bnk:lock2>
<bnk:markRecord>false</bnk:markRecord>
</bnk:bankHeader>
<bnk:bankDetail>
<bnk:bankItem>
<bnk:id>6266</bnk:id>
<bnk:text>Úhrada VZ è. 240800470</bnk:text>
<bnk:homeCurrency>
<bnk:unitPrice>5494036</bnk:unitPrice>
</bnk:homeCurrency>
<bnk:symPar>1810</bnk:symPar>
<bnk:accounting>
<typ:id>106</typ:id>
<typ:ids>5Bp</typ:ids>
</bnk:accounting>
</bnk:bankItem>
</bnk:bankDetail>
<bnk:bankSummary>
<bnk:roundingDocument>none</bnk:roundingDocument>
<bnk:roundingVAT>none</bnk:roundingVAT>
<bnk:homeCurrency>
<typ:priceNone>5494036</typ:priceNone>
<typ:priceLow>0</typ:priceLow>
<typ:priceLowVAT rate="12">0</typ:priceLowVAT>
<typ:priceLowSum>0</typ:priceLowSum>
<typ:priceHigh>0</typ:priceHigh>
<typ:priceHighVAT rate="21">0</typ:priceHighVAT>
<typ:priceHighSum>0</typ:priceHighSum>
<typ:round>
<typ:priceRound>0</typ:priceRound>
</typ:round>
</bnk:homeCurrency>
</bnk:bankSummary>
</lst:bank>
</lst:listBank>
</rsp:responsePackItem>
</rsp:responsePack>

0 comments on commit 355a02c

Please sign in to comment.