All notable changes to laravel-sapb1-toolkit will be documented in this file.
Commands
sapb1:audit-prune- CLI command for pruning old audit log entries--daysoption for custom retention period--dry-runoption to preview deletions--forceoption to skip confirmation
sapb1:audit-export- CLI command for exporting audit logs--entityoption to filter by entity type--sinceoption to filter by date--limitoption to limit export size--formatoption (csv or json)--outputoption for custom output path
Jobs
AuditPruneJob- Queueable job for scheduled audit log pruning- Supports custom retention days
- Auto-retry with 3 attempts
- Schedulable in Laravel's console kernel
Driver Enhancement
DatabaseDriver::countOlderThan()- Count entries older than given days for dry-run support
// CLI Prune
// php artisan sapb1:audit-prune --days=90 --force
// php artisan sapb1:audit-prune --dry-run
// CLI Export
// php artisan sapb1:audit-export --entity=Orders --format=csv
// php artisan sapb1:audit-export --since=2026-01-01 --format=json
// Scheduled Pruning (Console Kernel)
$schedule->job(new AuditPruneJob)->daily();
$schedule->job(new AuditPruneJob(days: 30))->weekly();
// Dispatch manually
AuditPruneJob::dispatch();
AuditPruneJob::dispatch(days: 90);Core Components
AuditService- High-level audit service with fluent query interfacelog()/logCreated()/logUpdated()/logDeleted()- Logging methodsfor()/forEntity()/byUser()- Query builder methodssince()/limit()/get()/first()- Query executionstats()- Entity statistics (created/updated/deleted counts)prune()- Old entry cleanup
AuditLogger- Low-level logger with driver abstractionAuditEntry- Value object for audit entriesAuditContext- Request context capture (user, IP, user agent)
Drivers (3 drivers)
DatabaseDriver- Eloquent-based storage withAuditLogmodelLogDriver- Laravel Log facade integrationNullDriver- No-op driver for testing/disabled mode
Events
AuditRecorded- Dispatched when an audit entry is recordedAuditFailed- Dispatched when audit recording fails
Model Traits
HasAudittrait for automatic model auditingauditChanges()- Manual change logginggetAuditLogs()- Retrieve model's audit history- Automatic change detection on save
HasUdfMappingtrait for UDF field aliasing- Property-style access to UDFs (
$order->deliveryDate) - Type casting support (date, integer, boolean, json, array)
- Validation support
- Property-style access to UDFs (
Exceptions
AuditException- Base exception for audit errors
Config Updates
audit.enabled- Enable/disable audit loggingaudit.driver- Default driver (database/log/null)audit.async- Queue-based loggingaudit.context.*- Context capture settingsaudit.retention.days- Log retention periodaudit.entities.*- Per-entity configuration
use SapB1\Toolkit\Audit\AuditService;
$audit = app(AuditService::class);
// Log operations
$audit->logCreated('Orders', 123, $data);
$audit->logUpdated('Items', 'A001', $oldData, $newData);
$audit->logDeleted('Partners', 'C001', $data);
// Query logs
$logs = $audit->for('Orders', 123)->get();
$logs = $audit->forEntity('Orders')->since('2026-01-01')->limit(100)->get();
$stats = $audit->stats('Orders');
// With trait
class Order extends SapB1Model
{
use HasAudit, HasUdfMapping;
protected array $udfMappings = [
'deliveryDate' => ['field' => 'U_DeliveryDate', 'type' => 'date'],
'customerId' => ['field' => 'U_CustomerID', 'type' => 'integer'],
];
}
$order = Order::find(123);
$order->deliveryDate; // Carbon instance from U_DeliveryDate
$order->getAuditLogs(); // All audit entries for this orderCore Service
MultiTenantService- High-level multi-tenant orchestratorsetTenant()/getTenantId()/clearTenant()- Tenant context managementregisterTenant()/getTenantConfig()- Configuration managementrunAs()- Execute operations in specific tenant contextregisterFromConfig()- Load tenants from Laravel config
Tenant Resolvers (3 resolvers)
ConfigTenantResolver- Config-based tenant resolutionHeaderTenantResolver- HTTP header-based resolution (X-Tenant-ID)AuthUserTenantResolver- Authenticated user-based resolution
Model Support
HasTenanttrait for tenant-aware modelssetTenantId()/getTenantId()- Instance-level tenant trackingbelongsToTenant()/belongsToCurrentTenant()- Ownership checksforTenant()- Static scope for tenant queries
HTTP Middleware
TenantMiddleware- Request-level tenant resolution- Route parameter support
- Header resolution (X-Tenant-ID)
- Query parameter support
- Subdomain resolution
- Authenticated user fallback
Exception Handling
MultiTenantExceptionfor multi-tenant errorstenantNotFound(),noTenantSet(),missingConfiguration()invalidResolver(),tenantMismatch()
Config Updates
multi_tenant.enabled- Enable/disable multi-tenant modemulti_tenant.resolver- Default resolver type (config/header/user)multi_tenant.header- Header name for header-based resolutionmulti_tenant.subdomain.*- Subdomain resolution settingsmulti_tenant.tenants- Tenant configurations
use SapB1\Toolkit\MultiTenant\MultiTenantService;
$multiTenant = app(MultiTenantService::class);
// Register tenants
$multiTenant->registerTenant('tenant-1', [
'sap_url' => 'https://sap1.example.com/b1s/v1',
'sap_database' => 'SBO_TENANT1',
'sap_username' => 'manager',
'sap_password' => env('TENANT1_SAP_PASSWORD'),
]);
// Set current tenant
$multiTenant->setTenant('tenant-1');
// Execute in tenant context
$multiTenant->runAs('tenant-2', function () {
$orders = Order::all(); // Uses tenant-2's SAP connection
});
// Middleware usage (add to Kernel.php aliases)
// 'tenant' => \SapB1\Toolkit\Http\Middleware\TenantMiddleware::class
// Config-based tenants (config/laravel-toolkit.php)
'multi_tenant' => [
'enabled' => true,
'resolver' => 'header',
'tenants' => [
'tenant-1' => [
'sap_url' => 'https://sap1.example.com/b1s/v1',
'sap_database' => 'SBO_TENANT1',
'sap_username' => 'manager',
'sap_password' => env('TENANT1_SAP_PASSWORD'),
],
],
],Sync Events (4 events)
SyncStarted- Dispatched when sync begins (entity, syncType, since)SyncCompleted- Dispatched on success (entity, SyncResult)SyncFailed- Dispatched on failure (entity, error, exception)SyncProgress- Progress reporting (processed, total, percentage)
Queue Integration
SyncEntityJob- Queueable job for async sync operations- Auto-retry (3 attempts, 60s backoff)
- Job tags for monitoring (sync, entity:*, full-sync/incremental-sync)
- Support for full sync, incremental sync, and since-date sync
Logging
- Comprehensive logging in
LocalSyncService - Start/complete/fail logging with context
- Debug logging for delete detection
Config Updates
sync.dispatch_events- Enable/disable event dispatchingsync.queue.*- Queue configuration (connection, queue, tries, backoff)
// Async sync with queue
use SapB1\Toolkit\Jobs\SyncEntityJob;
SyncEntityJob::dispatch('Items'); // Incremental
SyncEntityJob::dispatch('Items', fullSync: true); // Full sync
SyncEntityJob::dispatch('Orders', since: '2026-01-01');
// Queue to specific queue
SyncEntityJob::dispatch('Items')->onQueue('sync');
// Listen to events
Event::listen(SyncCompleted::class, function ($event) {
Log::info("Synced {$event->entity}: {$event->total()} records");
});
// Disable events
$syncService->withoutEvents()->sync('Items');LocalSyncService- SAP'tan local DB'ye sync orchestratorSyncRegistry- Entity configuration managementSyncConfig- Predefined configs for 10 entitiesSyncMetadataEloquent model - Sync state trackingSyncResultvalue object - Operation resultsSyncException- Error handling
sapb1:sync-setup- Migration generator for sync tablessapb1:sync-status- Status monitoring command- Updated
sapb1:sync- Local DB sync support
metadata.stub- Sync metadata tableitems.stub,business_partners.stub- Master dataorders.stub,invoices.stub,delivery_notes.stub,quotations.stub,credit_notes.stub- Salespurchase_orders.stub,purchase_invoices.stub,goods_receipt_po.stub- Purchase
// Setup migrations (one-time)
// php artisan sapb1:sync-setup Items BusinessPartners Orders
// Incremental sync
$result = $syncService->sync('Items');
// SyncResult { created: 10, updated: 140, deleted: 0, duration: 1.23s }
// Full sync with delete detection
$result = $syncService->fullSyncWithDeletes('Items');
// Artisan commands
// php artisan sapb1:sync Items --full
// php artisan sapb1:sync-statusChangeTracker- Polling-based change detection engineWatcherConfig- Fluent entity watch configurationChangevalue object - Represents detected changesChangeTypeenum - Created, Updated, DeletedStateStoreinterface andCacheStateStoreimplementationChangesDetectedandEntityChangeDetectedeventsChangeTrackingService- Multi-entity orchestratorsapb1:watchArtisan command - CLI-based watching
$tracker = ChangeTracker::for('Orders')
->primaryKey('DocEntry')
->detectCreated(true)
->detectUpdated(true);
$changes = $tracker->poll();
// php artisan sapb1:watch Orders --interval=30CacheResolver- 5-level priority cache decision systemCacheManager- Laravel Cache integration with tagsHasCachetrait for ModelsQueryBuilder::cache()andnoCache()methods- Entity-level cache configuration
CacheExceptionfor error handling
- Query-level →
Item::cache(600)->find($id) - Model-level →
protected static bool $cacheEnabled = true - Entity config →
config('laravel-toolkit.cache.entities.Items.enabled') - Global config →
config('laravel-toolkit.cache.enabled')(default: false)
UdfService- UserFieldsMD endpoint (read-only)- Entity-to-Table mapping (40+ entities: Orders→ORDR, etc.)
HasUdftrait for Models (getUdf, setUdf, getUdfs)- Builder
udf()method support UdfExceptionfor error handling
$order = Order::find(123);
$value = $order->getUdf('CustomField');
$order->setUdf('CustomField', 'value');
$order->save();DocumentActionService- Close, Cancel, Reopen actionsDraftService- Drafts endpoint managementDocumentTypeenum enhancements- Bulk operations with BatchRequest
DocumentActionExceptionandDraftException
$actionService->closeOrder(123);
$actionService->cancelInvoice(456);
$results = $actionService->closeOrders([123, 124, 125]);
$draft = $draftService->createOrderDraft($data);
$document = $draftService->saveAsDocument($draftEntry);SemanticQueryService- sml.svc endpoint wrapperSemanticQueryServiceBuilder- Fluent query builder- Dimensions, measures, filters support
- Laravel Collection integration
AttachmentService- Attachments2 endpoint wrapperBatchService- $batch endpoint wrapperSqlQueryService- SQLQueries endpoint wrapperHasAttachmentstrait for Models
A comprehensive ORM-like model layer that brings Eloquent-style syntax to SAP B1 entities.
SapB1Model- Base abstract model class with CRUD operationsQueryBuilder- OData query builder with Eloquent-like syntaxModelCollection- Collection class with filter, map, pluck, sum, avg, etc.Paginator- Pagination support with OData $top/$skipModelNotFoundException- Exception for missing models
HasAttributes- Attribute management, fill, __get/__setHasCasting- Attribute casting (integer, float, date, datetime, decimal, enum, etc.)HasDirtyTracking- Track changes for partial updatesHasEvents- Model lifecycle events (creating, created, updating, updated, etc.)HasQueryBuilder- Static query methods (where, orderBy, limit, etc.)HasRelationships- Relationship definitions and loading
Relation- Base relation classHasMany- One-to-many relationshipsHasOne- One-to-one relationshipsBelongsTo- Inverse relationships (N:1)
AsBoolean,AsInteger,AsFloat,AsDecimalAsDate,AsDateTimeAsArray,AsEnum
Order,Quotation,Invoice,Delivery,SalesReturn,CreditNoteDownPayment,Draft,BlanketAgreementCorrectionInvoice,CorrectionInvoiceReversal,SalesTaxInvoice
PurchaseOrder,PurchaseQuotation,GoodsReceipt,PurchaseInvoicePurchaseReturn,PurchaseCreditNote,PurchaseDownPayment,PurchaseRequestPurchaseTaxInvoice,CorrectionPurchaseInvoice,CorrectionPurchaseInvoiceReversal
Partner- Business Partner model with orders/invoices relationshipsItem- Item model with warehouse relationshipWarehouse- Warehouse model
DocumentLine- Generic document line with item/warehouse relationsJournalEntryLine- Journal entry linePaymentInvoice- Payment invoice lineBlanketAgreementItemLine- Blanket agreement item line
use SapB1\Toolkit\Models\Sales\Order;
// Find
$order = Order::find(123);
// Relationships (lazy loading)
$order->partner; // BelongsTo Partner
$order->documentLines; // HasMany DocumentLine
// Query builder (Eloquent-like)
$orders = Order::where('DocTotal', '>', 1000)
->where('DocumentStatus', 'bost_Open')
->orderBy('DocDate', 'desc')
->with('partner')
->limit(10)
->get();
// Hybrid OData filter support
$orders = Order::filter("DocTotal gt 1000 and DocDate ge '2024-01-01'")
->orderBy('DocDate', 'desc')
->get();
// Scopes
$openOrders = Order::open()->get();
$customerOrders = Order::byCustomer('C001')->get();
// CRUD operations
$order = Order::create([
'CardCode' => 'C001',
'DocumentLines' => [...]
]);
$order->Comments = 'Updated';
$order->save(); // Only sends changed fields (dirty tracking)
// Domain methods
$delivery = $order->toDelivery();
$invoice = $order->toInvoice();
$order->close();
$order->cancel();- Total PHP files: 570+
- Total Models: 53 (Core: 25, Sales: 12, Purchase: 11, Lines: 4, Essential: 3)
- PHPStan Level 8 compliance maintained
- All existing 1135+ tests passing
- PHPStan errors: 0
BusinessPartnerGroupAction,BusinessPartnerGroupDto,BusinessPartnerGroupBuilder- BP groupsSalesPersonAction,SalesPersonDto,SalesPersonBuilder- Sales persons with commission trackingTerritoryAction,TerritoryDto,TerritoryBuilder- Territory managementIndustryAction,IndustryDto,IndustryBuilder- Industry classificationsSalesOpportunityAction,SalesOpportunityDto,SalesOpportunityLineDto,SalesOpportunityBuilder- CRM opportunitiesSalesStageAction,SalesStageDto,SalesStageBuilder- Sales pipeline stagesContactAction,ContactBuilder- Standalone contact employee management (reuses ContactPersonDto)CampaignAction,CampaignDto,CampaignItemDto,CampaignBuilder- Marketing campaignsCampaignResponseTypeAction,CampaignResponseTypeDto,CampaignResponseTypeBuilder- Campaign response types
ServiceCallAction,ServiceCallDto,ServiceCallBuilder- Service call management with close actionServiceContractAction,ServiceContractDto,ServiceContractLineDto,ServiceContractBuilder- Service contracts with linesServiceCallOriginAction,ServiceCallOriginDto,ServiceCallOriginBuilder- Call originsServiceCallTypeAction,ServiceCallTypeDto,ServiceCallTypeBuilder- Call typesServiceCallStatusAction,ServiceCallStatusDto,ServiceCallStatusBuilder- Call statusesServiceCallSolutionStatusAction,ServiceCallSolutionStatusDto,ServiceCallSolutionStatusBuilder- Solution statusesServiceCallProblemTypeAction,ServiceCallProblemTypeDto,ServiceCallProblemTypeBuilder- Problem typesServiceCallProblemSubTypeAction,ServiceCallProblemSubTypeDto,ServiceCallProblemSubTypeBuilder- Problem sub-typesServiceGroupAction,ServiceGroupDto,ServiceGroupBuilder- Service groups
ServiceCallPriority- Low, Medium, HighOpportunityStatus- Open, Won, LostCampaignStatus- Draft, Active, Finished, Cancelled
- Total entities increased from 54 to 72 (+18)
- Total DTOs: ~100 (including line DTOs)
- Total Builders: ~75
- Total Actions: ~75
- PHPStan Level 8 compliance maintained
- 256 new unit tests for v1.2.0 entities
- DTO tests: fromArray, fromResponse, toArray, null filtering
- Builder tests: fluent interface, method chaining, line/item management
- Total test count: ~890+
- Package renamed from
ismaildasci/laravel-toolkittoismaildasci/laravel-sapb1-toolkit
BinLocationAction,BinLocationDto,BinLocationBuilder- Bin location managementBatchNumberDetailAction,BatchNumberDetailDto,BatchNumberDetailBuilder- Batch trackingSerialNumberDetailAction,SerialNumberDetailDto,SerialNumberDetailBuilder- Serial number trackingInventoryGenEntryAction,InventoryGenEntryDto,InventoryGenEntryLineDto,InventoryGenEntryBuilder- Goods ReceiptInventoryGenExitAction,InventoryGenExitDto,InventoryGenExitLineDto,InventoryGenExitBuilder- Goods IssueInventoryPostingAction,InventoryPostingDto,InventoryPostingLineDto,InventoryPostingBuilder- Inventory postingInventoryCountingAction,InventoryCountingDto,InventoryCountingLineDto,InventoryCountingBuilder- Physical countingInventoryCycleAction,InventoryCycleDto,InventoryCycleBuilder- Cycle count configurationInventoryTransferRequestAction,InventoryTransferRequestDto,InventoryTransferRequestLineDto,InventoryTransferRequestBuilder- Transfer requestsInventoryOpeningBalanceAction,InventoryOpeningBalanceDto,InventoryOpeningBalanceLineDto,InventoryOpeningBalanceBuilder- Opening balancesPickListAction,PickListDto,PickListLineDto,PickListBuilder- Pick list managementCycleCountDeterminationAction,CycleCountDeterminationDto,CycleCountDeterminationBuilder- Cycle count setupStockTakingAction,StockTakingDto,StockTakingLineDto,StockTakingBuilder- Stock taking
BankAction,BankDto,BankBuilder- Bank master dataHouseBankAccountAction,HouseBankAccountDto,HouseBankAccountBuilder- Company bank accountsCurrencyAction,CurrencyDto,CurrencyBuilder- Currency definitionsVatGroupAction,VatGroupDto,VatGroupBuilder- VAT groupsWithholdingTaxCodeAction,WithholdingTaxCodeDto,WithholdingTaxCodeBuilder- Withholding taxSalesTaxCodeAction,SalesTaxCodeDto,SalesTaxCodeBuilder- Sales tax codesSalesTaxAuthorityAction,SalesTaxAuthorityDto,SalesTaxAuthorityBuilder- Tax authoritiesPaymentTermsTypeAction,PaymentTermsTypeDto,PaymentTermsTypeBuilder- Payment termsBankStatementAction,BankStatementDto,BankStatementRowDto,BankStatementBuilder- Bank statementsBankPageAction,BankPageDto,BankPageBuilder- Bank pagesDepositAction,DepositDto,DepositCheckDto,DepositCreditCardDto,DepositBuilder- DepositsCreditCardAction,CreditCardDto,CreditCardBuilder- Credit card definitionsCreditCardPaymentAction,CreditCardPaymentDto,CreditCardPaymentBuilder- Credit card paymentsChecksforPaymentAction,ChecksforPaymentDto,ChecksforPaymentBuilder- Payment checksCashFlowLineItemAction,CashFlowLineItemDto,CashFlowLineItemBuilder- Cash flow itemsCashDiscountAction,CashDiscountDto,CashDiscountBuilder- Cash discountsBudgetAction,BudgetDto,BudgetLineDto,BudgetBuilder- Budget managementBudgetScenarioAction,BudgetScenarioDto,BudgetScenarioBuilder- Budget scenariosBudgetDistributionAction,BudgetDistributionDto,BudgetDistributionBuilder- Budget distributionsFinancialYearAction,FinancialYearDto,FinancialYearBuilder- Financial yearsInternalReconciliationAction,InternalReconciliationDto,InternalReconciliationBuilder- Internal reconciliationsPaymentDraftAction,PaymentDraftDto,PaymentDraftBuilder- Payment drafts
- Total entities increased from 19 to 54
- Total DTOs: 80 (including line DTOs)
- Total Builders: 57
- Total Actions: 56
- PHPStan Level 8 compliance maintained
- Comprehensive unit test coverage for all new entities
- 97 test files, 634 tests total
- DTO tests: fromArray, fromResponse, toArray methods
- Builder tests: fluent interface, method chaining, reset functionality
- Production-ready stable release
- 147 PHP files
- 178 tests, PHPStan Level 8
- CacheService for master data caching
- Integration test infrastructure
DownPaymentDto,DownPaymentBuilder,DownPaymentActionfor SalesPurchaseDownPaymentDto,PurchaseDownPaymentBuilder,PurchaseDownPaymentActionfor PurchaseDownPaymentTypeandDownPaymentStatusenums
TaxCode- Turkish tax codes (KDV0, KDV1, KDV8, KDV10, KDV18, KDV20, STOPAJ, EXEMPT)Currency- Common currencies with symbols (TRY, USD, EUR, GBP, etc.)UnitOfMeasure- Units of measure (PCS, KG, LT, M, M2, HR, etc.)
php artisan sapb1:generate {name}- Scaffolds DTO, Builder, and Action files- Options:
--module,--entity,--type,--force - Stub files for customization
php artisan sapb1:install- One-command package installation- Publishes config and migrations
- Displays post-install instructions
- JSON fixtures for Orders, Invoices, BusinessPartners, Items, Payments, Warehouses, JournalEntries, DownPayments
FixtureLoaderhelper class for loading test data
- Enum tests (DocumentStatus, DocumentType, TaxCode, Currency, UnitOfMeasure, DownPaymentType, CardType)
- DTO tests (DocumentDto, DocumentLineDto)
- Builder tests (DocumentBuilder, DownPaymentBuilder)
- Feature tests (ServiceProvider, InstallCommand, GenerateCommand, FixtureLoader)
- 142 tests, 418 assertions
- ServiceProvider migration registration (
hasMigration()) - Simplified service registration (removed unnecessary callbacks)
- PHPStan type safety in GenerateCommand
- Removed empty
resources/views/directory
- Base contracts:
ActionInterface,BuilderInterface,DtoInterface,ServiceInterface - Base classes:
BaseAction,BaseDto,BaseBuilder,DocumentAction - Common traits:
HasDocumentLines,HasApproval,HasTaxes,Cancellable,Closable
- Document enums:
DocumentStatus,PrintStatus,DocumentType - Business Partner enums:
CardType,GroupType,PaymentTermsType,ShippingType - Inventory enums:
ItemType,ItemClass,ValuationMethod - Finance enums:
AccountType,PaymentMethod - Common enums:
BoYesNo,ApprovalStatus,ProductionOrderStatus
- Base DTOs:
AddressDto,DocumentDto,DocumentLineDto - Sales DTOs:
OrderDto,QuotationDto,DeliveryNoteDto,InvoiceDto,CreditNoteDto,ReturnDto - Purchase DTOs:
PurchaseOrderDto,GoodsReceiptDto,PurchaseInvoiceDto,PurchaseReturnDto - Inventory DTOs:
ItemDto,WarehouseDto,StockTransferDto,StockTransferLineDto,BatchDto - Business Partner DTOs:
BusinessPartnerDto,ContactPersonDto,ActivityDto - Finance DTOs:
JournalEntryDto,JournalEntryLineDto,PaymentDto,PaymentInvoiceDto,ChartOfAccountDto - Response DTOs:
ApiResponseDto,PaginatedResponseDto,BatchResponseDto,BatchItemResponseDto
- Base builders:
DocumentBuilder,DocumentLineBuilder - Sales builders:
OrderBuilder,QuotationBuilder,DeliveryBuilder,InvoiceBuilder,CreditNoteBuilder,ReturnBuilder - Purchase builders:
PurchaseOrderBuilder,GoodsReceiptBuilder,PurchaseInvoiceBuilder,PurchaseReturnBuilder - Inventory builders:
ItemBuilder,WarehouseBuilder,StockTransferBuilder - Finance builders:
PaymentBuilder,JournalEntryBuilder - Business Partner builders:
BusinessPartnerBuilder,ActivityBuilder
- Sales actions:
OrderAction,QuotationAction,DeliveryAction,InvoiceAction,CreditNoteAction,ReturnAction - Purchase actions:
PurchaseOrderAction,GoodsReceiptAction,PurchaseInvoiceAction,PurchaseReturnAction - Inventory actions:
ItemAction,WarehouseAction,StockTransferAction - Finance actions:
PaymentAction,JournalEntryAction - Business Partner actions:
BusinessPartnerAction,ActivityAction
BaseService- Base service with connection managementDocumentFlowService- Document conversion (order to invoice, order to delivery, etc.)PaymentService- Incoming/outgoing payment managementInventoryService- Stock transfers, batch operations, stock queriesReportingService- Sales/purchase summaries, aging reports, top customers/itemsApprovalService- Approval workflow managementSyncService- Full and incremental data synchronization
DocumentCreated- Fired when a document is createdDocumentUpdated- Fired when a document is updatedDocumentClosed- Fired when a document is closedDocumentCancelled- Fired when a document is cancelledPaymentReceived- Fired when a payment is receivedApprovalRequested- Fired when approval is requestedApprovalCompleted- Fired when approval is completed
SapB1Exception- Base exception classDocumentNotFoundException- Document not foundValidationException- Validation errorsConnectionException- Connection errorsAuthenticationException- Authentication errorsDocumentClosedException- Document is closedInsufficientStockException- Insufficient stockApprovalRequiredException- Approval required
CardCodeRule- Validates business partner codesItemCodeRule- Validates item codes (with sales/purchase item checks)DocEntryRule- Validates document entry numbersWarehouseCodeRule- Validates warehouse codesAccountCodeRule- Validates chart of account codes
SapDateCast- Converts SAP B1 date formatsSapBooleanCast- Converts SAP B1 tYES/tNO to booleanMoneyAmountCast- Handles monetary amounts with precisionDocumentTypeCast- Casts to DocumentType enumCardTypeCast- Casts to CardType enum
sapb1:test- Test SAP B1 connectionsapb1:sync- Sync data from SAP B1 (full or incremental)sapb1:cache- Cache management (warm/clear)sapb1:report- Generate reports (sales, purchases, aging, top-customers, top-items)