update
This commit is contained in:
@@ -54,12 +54,12 @@ class FakturowniaInvoiceImporter
|
||||
], JSON_UNESCAPED_UNICODE );
|
||||
$this -> repo -> saveState( 'last_import_summary', $lastSummary );
|
||||
|
||||
if ( $summary['imported'] === 0 && $summary['unmapped'] === 0 && $summary['errors'] === 0 )
|
||||
return [ 'status' => 'empty', 'msg' => 'Import Fakturownia: brak nowych dokumentow.' ];
|
||||
|
||||
if ( $summary['errors'] > 0 )
|
||||
return [ 'status' => 'error', 'msg' => $this -> formatMessage( $summary ), 'summary' => $summary ];
|
||||
|
||||
if ( $summary['imported'] === 0 )
|
||||
return [ 'status' => 'empty', 'msg' => $this -> formatMessage( $summary ), 'summary' => $summary ];
|
||||
|
||||
return [ 'status' => 'ok', 'msg' => $this -> formatMessage( $summary ), 'summary' => $summary ];
|
||||
}
|
||||
|
||||
@@ -148,7 +148,9 @@ class FakturowniaInvoiceImporter
|
||||
$this -> repo -> queueUnmapped( 'item', $position['item_key'], $position['name'], [
|
||||
'document_id' => $document['external_id'],
|
||||
'document_number' => $document['number'],
|
||||
'document_type' => $documentType
|
||||
'document_type' => $documentType,
|
||||
'buyer_name' => $document['buyer_name'],
|
||||
'seller_name' => $document['seller_name']
|
||||
] );
|
||||
return 'unmapped';
|
||||
}
|
||||
@@ -324,6 +326,8 @@ class FakturowniaInvoiceImporter
|
||||
'document_key' => $documentType . ':' . $externalId,
|
||||
'number' => $number,
|
||||
'date' => $date,
|
||||
'buyer_name' => (string)( $rawDocument['buyer_name'] ?? '' ),
|
||||
'seller_name' => (string)( $rawDocument['seller_name'] ?? '' ),
|
||||
'client_name' => $clientName,
|
||||
'client_tax_no' => $clientTaxNo,
|
||||
'client_key' => $this -> buildClientKey( $rawDocument, $clientName, $clientTaxNo ),
|
||||
|
||||
@@ -95,6 +95,16 @@ $esc = function( $value )
|
||||
<tr>
|
||||
<td>
|
||||
<?= $esc( $row['external_name'] ); ?><br>
|
||||
<? $payload = is_array( $row['payload'] ?? null ) ? $row['payload'] : []; ?>
|
||||
<? if ( !empty( $payload['document_number'] ) ): ?>
|
||||
<small class="text-muted">Faktura: <?= $esc( $payload['document_number'] ); ?></small><br>
|
||||
<? endif; ?>
|
||||
<? if ( !empty( $payload['buyer_name'] ) || !empty( $payload['seller_name'] ) ): ?>
|
||||
<small class="text-muted">
|
||||
Nabywca: <?= $esc( $payload['buyer_name'] ?? '-' ); ?> |
|
||||
Sprzedawca: <?= $esc( $payload['seller_name'] ?? '-' ); ?>
|
||||
</small><br>
|
||||
<? endif; ?>
|
||||
<small class="text-muted">Klucz: <?= $esc( $row['external_key'] ); ?> | wystapienia: <?= (int)$row['hits']; ?></small>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user