riesenia / pohoda Goto Github PK
View Code? Open in Web Editor NEWXML generator a parser pre Pohodu
XML generator a parser pre Pohodu
Zdravím,
prosím o radu jak správně načíst data ze dvou a více skladů.
Čekal bych, že by mohl fungovat tento zápis:
$request->addFilter(["store" => ["SkladA", "SkladB"]]);
což nicméně vygeneruje nevalidní request:
<lStk:requestStock>
<ftr:filter>
<ftr:store>
<typ:0>SkladA</typ:0>
<typ:1>SkladB</typ:1>
</ftr:store>
</ftr:filter>
</lStk:requestStock>
Děkuji za radu.
Hi, I'd like to set custom encoding (utf-8). What is the best way to do it?
It's being set on 2 places currently
RP lze zadat i přímo do faktury:
Agendu Recyklační příspěvky můžete používat také ve variantách programu POHODA bez skladové evidence; najdete ji v nabídce Fakturace. Zobrazení sloupců pro přiřazení příspěvků textovým položkám si nastavíte v agendě Globální nastavení v sekci Doklady.
XML requestu pak vypadá takto:
<inv:recyclingContrib>
<typ:recyclingContribText>Recyklační příspěvek bez DPH:</typ:recyclingContribText>
<typ:recyclingContribAmount>1.1</typ:recyclingContribAmount>
<typ:recyclingContribUnit>kg</typ:recyclingContribUnit>
<typ:coefficientOfRecyclingContrib>0.056</typ:coefficientOfRecyclingContrib>
</inv:recyclingContrib>
Pohoda allows clients to create custom fields which aren't curencly supported by this library. Is there any chance of this being added in the future?
OptionsResolver.php, metoda _createNormalizer:
case 'float':
case 'number':
return function ($options, $value) {
return (string) \floatval(\str_replace(',', '.', \strval(\preg_replace('/[^0-9,.-]/', '', (string) $value))));
};
Pokud je vstupní hodnota $value
float 10.4
, pak normalizer vrací string "10,4"
s čárkou jako oddělovačem, což nezchroupe import.
Možná je v kódu zbytečná konverze zpět na float a přetypování na string? Nebylo by řešením následující?
return \str_replace(',', '.', \strval(\preg_replace('/[^0-9,.-]/', '', (string) $value)));
Nejsem si jistý, jestli by to nemělo vedlejší následky v jiných případech?
Díky.
Described in PR #33
Chtěl jsem instalovat přes Composer: composer require 'riesenia/pohoda:~1.0'
Výsledek:
[UnexpectedValueException]
Could not parse version constraint ~1.0': Invalid version string "~1.0'"
Zdravím,
bylo by možné k závislostem přidat také symfony/options-resolver ~5.0
? Nový projekt máme postavený na Symfony 5 a současná závislost symfony/options-resolver ~4.0
bohužel nevyhovuje.
Díky.
Zdravim,
pri vytvarani objednavky mi vyskakuje tato chyba:
local.ERROR: preg_replace(): Argument #3 ($subject) must be of type array|string, float given
{"exception":"[object] (TypeError(code: 0): preg_replace():
Argument #3 ($subject) must be of type array|string, float given at vendor\\Riesenia\\pohoda\\src\\Pohoda\\Common\\OptionsResolver.php:94)
[stacktrace]
#0 vendor\\Riesenia\\pohoda\\src\\Pohoda\\Common\\OptionsResolver.php(94): preg_replace()
#1 vendor\\symfony\\options-resolver\\OptionsResolver.php(1122): Riesenia\\Pohoda\\Common\\OptionsResolver->Riesenia\\Pohoda\\Common\\{closure}()
#2 vendor\\symfony\\options-resolver\\OptionsResolver.php(910): Symfony\\Component\\OptionsResolver\\OptionsResolver->offsetGet()
#3 vendor\\Riesenia\\pohoda\\src\\Pohoda\\Agenda.php(225): Symfony\\Component\\OptionsResolver\\OptionsResolver->resolve()
#4 vendor\\Riesenia\\pohoda\\src\\Pohoda\\Agenda.php(52): Riesenia\\Pohoda\\Agenda->_resolveOptions()
#5 vendor\\Riesenia\\pohoda\\src\\Pohoda\\Order\\Item.php(36): Riesenia\\Pohoda\\Agenda->__construct()
#6 vendor\\Riesenia\\pohoda\\src\\Pohoda\\Order.php(54): Riesenia\\Pohoda\\Order\\Item->__construct()
#7 app\\Services\\PohodaOrderService.php(47): Riesenia\\Pohoda\\Order->addItem()
Sposobuje to $item['quantity'] = 1
a $item['delivered'] = 0
co nedava zmysel, nakolko sa predsa jedna o int resp. float a nechapem preco to ocakava string. Order pritom pri oboch ma normalizer nastaveny na float.
Nejde generovat/parsovat interní doklady.
The option "markRecord" does not exist. Defined options are: "activity", "carrier", "centre", "contract", "date", "dateDelivery", "dateFrom", "dateTo", "intNote", "isExecuted", "isReserved", "myIdentity", "note", "number", "numberOrder", "orderType", "partnerIdentity", "paymentType", "priceLevel", "regVATinEU", "text".
<xsd:element name="markRecord" type="typ:boolean" minOccurs="0" default="true">
<xsd:annotation>
<xsd:documentation>
Označení záznamu v programu POHODA, sloupec "X". Výchozí hodnota je "označený záznam".
</xsd:documentation>
</xsd:annotation>
</xsd:element>
Hello all
I'm doing export for client and currently, all orders are placed to "Orders received" area.
How to place exported orders to "Invoice" area?
I presume, "ord:orderType" should contain other value than "receivedOrder"?
if yes, which one?
Thank you.
Hi, there's missing a property on AddressBook, I've made PR #37
Zdravim,
bylo by mozne do zásob (Stock) pridat intrastat a recyclingContrib
Diky
Described in PR #35
Zdravim,
neviem ci robim nieco zle, ale potreboval som nacitavat XML z premennej namiesto suboru. Nevedel som to cez $pohoda->load
tak som si rozsiril classu o tuto funkciu. Robim to zbytocne a slo to aj bez toho alebo sa s nacitanim XML z premennej/stringu neratalo?
use Riesenia\Pohoda;
class PohodaString extends Pohoda
{
/**
* Load XML string.
*
* @param string $name
* @param string $xmlstring
*
* @return bool
*/
public function loadString(string $name, string $xmlstring)
{
$this->_xmlReader = new \XMLReader();
if (!$this->_xmlReader->XML($xmlstring)) {
return false;
}
$fullName = 'Riesenia\\Pohoda\\' . $name;
if (!\class_exists($fullName)) {
throw new \DomainException('Not allowed entity: ' . $name);
}
while ($this->_xmlReader->read() && $this->_xmlReader->name !== $fullName::$importRoot) {
// skip to first element
}
return true;
}
}
Hi,
I'm working on a project where I need to include cancelled invoices as well.
Could you add the storno option below to the list of allowed options? I've just hardcoded it in the source code, but if I ever need to upgrade your library, all the changes will be gone.
<inv:storno>cancelDocument</inv:storno>
it should go right after
<inv:invoiceType>issuedInvoice</inv:invoiceType>
Ve firmě vyvýjíme podporu pro příjem skupin zásob z Pohoda do e-shopu. Používáme tuto knihovnu. Je nějaký plán přidat rozhraní právě pro práci se skupinou zásob?
V mezičase jsem si vytvořil fork a začal na tom pracovat, ale nerad bych následně zjistil že je nás víc.
Hi,
i want use Windows-1250 encoded input, It work in most cases, but https://github.com/riesenia/pohoda/blob/master/src/Pohoda/Common/OptionsResolver.php#L69 use hardcoded Utf-8
return \mb_substr($value, 0, $param, 'utf-8');
Which make use of other encodings inpossible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.