File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/php -f
2+ <?php
3+
4+ /**
5+ * AbraFlexi - Example how to create Invoice
6+ *
7+ * @author Vítězslav Dvořák <[email protected] > 8+ * @copyright (G) 2018 Vitex Software
9+ */
10+
11+ namespace Example \AbraFlexi ;
12+
13+ use \AbraFlexi \RO ;
14+ use \AbraFlexi \FakturaVydana ;
15+
16+ define ('EASE_LOGGER ' , 'syslog|console ' );
17+ include_once './config.php ' ;
18+ include_once '../vendor/autoload.php ' ;
19+
20+ $ invoiceId = 1 ;
21+
22+ $ inv = new FakturaVydana ($ invoiceId );
23+ $ inv ->takeData (["stavMailK " => "stavMail.odeslano " ]);
24+ $ inv ->sync ();
25+
26+ $ inv ->addStatusMessage (_ ('Invoice ' ) . ': ' . $ inv ->getRecordIdent () . ' ' . $ inv ->getRecordCode (),
27+ $ inv ->sync () ? 'success ' : 'error ' );
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public function __construct(string $flexidate = 'NOW') {
5151 * @return string
5252 */
5353 public function __toString () {
54- return $ this ->isNull ? null : $ this ->format (RO ::$ DateFormat );
54+ return $ this ->isNull ? '' : $ this ->format (RO ::$ DateFormat );
5555 }
5656
5757}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public function __construct(string $flexidatetime = 'NOW') {
3434 $ format = '' ;
3535 if (strchr ($ flexidatetime , '. ' )) { //NewFormat
3636 $ format = RO ::$ DateTimeFormat ;
37- } elseif ( !empty ($ flexidatetime ) && ($ flexidatetime != 'NOW ' )) { // Old format
37+ } elseif (!empty ($ flexidatetime ) && ($ flexidatetime != 'NOW ' )) { // Old format
3838 $ format = 'Y-m-d\TH:i:s+P ' ;
3939 }
4040 parent ::__construct (empty ($ format ) ? null : \DateTime::createFromFormat ($ format , $ flexidatetime )->format (\DateTimeInterface::ATOM ));
@@ -46,7 +46,7 @@ public function __construct(string $flexidatetime = 'NOW') {
4646 * @return string
4747 */
4848 public function __toString () {
49- return $ this ->isNull ? null : $ this ->format (RO ::$ DateTimeFormat );
49+ return $ this ->isNull ? '' : $ this ->format (RO ::$ DateTimeFormat );
5050 }
5151
5252}
You can’t perform that action at this time.
0 commit comments