This commit is contained in:
2026-04-15 01:24:42 +02:00
parent 6786665cbf
commit 596b7a995e
15 changed files with 1206 additions and 115 deletions

View File

@@ -414,4 +414,38 @@ class FinancesController
header( 'Location: /finances/main_view/' );
exit;
}
public static function fakturowniaDocumentPositionSkip()
{
if ( !self::requireAuth() )
return false;
if ( !\S::csrf_verify() )
{
\S::alert( 'Nieprawidlowy token bezpieczenstwa. Odswiez strone i sproboj ponownie.' );
header( 'Location: /finances/main_view/' );
exit;
}
$externalId = trim( (string)\S::get( 'external_id' ) );
$documentType = trim( (string)\S::get( 'document_type' ) );
$externalItemKey = trim( (string)\S::get( 'external_item_key' ) );
$itemName = trim( (string)\S::get( 'item_name' ) );
if ( $externalId === '' || $documentType === '' || $externalItemKey === '' )
{
\S::alert( 'Nie udalo sie pominac pozycji — brakuje danych faktury.' );
header( 'Location: /finances/main_view/' );
exit;
}
$importRepo = self::importRepo();
$importRepo -> ensureTables();
$importRepo -> markDocumentPositionSkipped( $externalId, $documentType, $externalItemKey, $itemName );
$importRepo -> removeOccurrenceFromItemQueue( $externalItemKey, $externalId );
\S::alert( 'Pozycja zostala pominieta tylko dla faktury ' . $externalId . '.' );
header( 'Location: /finances/main_view/' );
exit;
}
}