update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user