From 86e29dd23df348ec6075f0c0de8e06b8d9fb0a9a Mon Sep 17 00:00:00 2001 From: Khurshid Alam <89677621+kmkalam24@users.noreply.github.com> Date: Tue, 25 Apr 2023 20:25:52 +0600 Subject: [PATCH] Bug Fixing --- assets/.htaccess | 2 +- assets/cron/backup_db.sh | 2 + assets/cron/downloadData.bat | 1 + assets/cron/sms.sh | 4 + assets/cron/uploadData.bat | 1 + assets/js/bms.js | 3592 +++++++++++++++++ assets/js/bms.min.js | 2 +- assets/js/callCenter.js | 1106 +++++ assets/js/callCenter.min.js | 1 + assets/js/callCenterOld.js | 907 +++++ assets/js/callCenterOld.min.js | 1 + assets/js/events.js | 2293 +++++++++++ assets/js/events.min.js | 2 +- assets/js/functions.js | 969 +++++ assets/js/initiator.js | 82 + assets/js/voiceMessage.js | 255 ++ assets/js/voiceMessage.min.js | 1 + assets/upload/index.php | 3 - core/ajax/ajax_chat.php | 112 + core/ajax/ajax_pos.php | 27 +- core/ajax/ajax_pos_back.php | 4 +- core/ajax/ajax_select2.php | 80 +- core/ajax/ajax_sms.php | 13 +- core/config.php | 9 +- core/functions.php | 110 +- core/loader.php | 22 +- core/menu.php | 41 +- core/permissions.php | 21 +- core/route.php | 15 +- include/apps/generator/js-generator.php | 16 +- include/db/database.sql | 3179 ++++++--------- include/db/db.php | 4 +- include/lib/Composer/.php_history | 5 + include/lib/Composer/composer.json | 9 + include/lib/Composer/composer.lock | 1443 +++++++ include/lib/Composer/composer.phar | Bin 0 -> 2810737 bytes include/lib/Composer/vendor/autoload.php | 25 + .../cboden/ratchet/.github/workflows/ci.yml | 52 + .../Composer/vendor/cboden/ratchet/.gitignore | 5 + .../vendor/cboden/ratchet/CHANGELOG.md | 150 + .../Composer/vendor/cboden/ratchet/LICENSE | 19 + .../Composer/vendor/cboden/ratchet/Makefile | 42 + .../Composer/vendor/cboden/ratchet/README.md | 87 + .../vendor/cboden/ratchet/SECURITY.md | 8 + .../vendor/cboden/ratchet/composer.json | 40 + .../vendor/cboden/ratchet/phpunit.xml.dist | 30 + .../Ratchet/AbstractConnectionDecorator.php | 41 + .../vendor/cboden/ratchet/src/Ratchet/App.php | 147 + .../src/Ratchet/ComponentInterface.php | 31 + .../src/Ratchet/ConnectionInterface.php | 26 + .../src/Ratchet/Http/CloseResponseTrait.php | 22 + .../src/Ratchet/Http/HttpRequestParser.php | 64 + .../ratchet/src/Ratchet/Http/HttpServer.php | 76 + .../src/Ratchet/Http/HttpServerInterface.php | 14 + .../Ratchet/Http/NoOpHttpServerController.php | 18 + .../ratchet/src/Ratchet/Http/OriginCheck.php | 65 + .../ratchet/src/Ratchet/Http/Router.php | 96 + .../src/Ratchet/MessageComponentInterface.php | 5 + .../ratchet/src/Ratchet/MessageInterface.php | 12 + .../ratchet/src/Ratchet/Server/EchoServer.php | 23 + .../src/Ratchet/Server/FlashPolicy.php | 200 + .../src/Ratchet/Server/IoConnection.php | 38 + .../ratchet/src/Ratchet/Server/IoServer.php | 140 + .../src/Ratchet/Server/IpBlackList.php | 111 + .../Session/Serialize/HandlerInterface.php | 16 + .../Session/Serialize/PhpBinaryHandler.php | 33 + .../Ratchet/Session/Serialize/PhpHandler.php | 49 + .../src/Ratchet/Session/SessionProvider.php | 243 ++ .../Session/Storage/Proxy/VirtualProxy.php | 54 + .../Session/Storage/VirtualSessionStorage.php | 88 + .../ratchet/src/Ratchet/Wamp/Exception.php | 5 + .../src/Ratchet/Wamp/JsonException.php | 31 + .../src/Ratchet/Wamp/ServerProtocol.php | 161 + .../cboden/ratchet/src/Ratchet/Wamp/Topic.php | 101 + .../ratchet/src/Ratchet/Wamp/TopicManager.php | 125 + .../src/Ratchet/Wamp/WampConnection.php | 115 + .../ratchet/src/Ratchet/Wamp/WampServer.php | 67 + .../src/Ratchet/Wamp/WampServerInterface.php | 43 + .../src/Ratchet/WebSocket/ConnContext.php | 20 + .../WebSocket/MessageCallableInterface.php | 8 + .../WebSocket/MessageComponentInterface.php | 6 + .../src/Ratchet/WebSocket/WsConnection.php | 45 + .../src/Ratchet/WebSocket/WsServer.php | 225 ++ .../Ratchet/WebSocket/WsServerInterface.php | 14 + .../tests/autobahn/bin/fuzzingserver.php | 36 + .../tests/autobahn/fuzzingclient-all.json | 15 + .../tests/autobahn/fuzzingclient-profile.json | 12 + .../tests/autobahn/fuzzingclient-quick.json | 12 + .../vendor/cboden/ratchet/tests/bootstrap.php | 4 + .../AbstractMessageComponentTestCase.php | 50 + .../tests/helpers/Ratchet/Mock/Component.php | 35 + .../tests/helpers/Ratchet/Mock/Connection.php | 20 + .../Ratchet/Mock/ConnectionDecorator.php | 22 + .../helpers/Ratchet/Mock/WampComponent.php | 43 + .../tests/helpers/Ratchet/NullComponent.php | 28 + .../Wamp/Stub/WsWampServerInterface.php | 7 + .../Stub/WsMessageComponentInterface.php | 7 + .../unit/AbstractConnectionDecoratorTest.php | 147 + .../tests/unit/Http/HttpRequestParserTest.php | 50 + .../tests/unit/Http/HttpServerTest.php | 64 + .../tests/unit/Http/OriginCheckTest.php | 46 + .../ratchet/tests/unit/Http/RouterTest.php | 165 + .../tests/unit/Server/EchoServerTest.php | 26 + .../unit/Server/FlashPolicyComponentTest.php | 152 + .../tests/unit/Server/IoConnectionTest.php | 32 + .../tests/unit/Server/IoServerTest.php | 127 + .../unit/Server/IpBlackListComponentTest.php | 125 + .../unit/Session/Serialize/PhpHandlerTest.php | 43 + .../unit/Session/SessionComponentTest.php | 126 + .../Storage/VirtualSessionStoragePDOTest.php | 53 + .../tests/unit/Wamp/ServerProtocolTest.php | 295 ++ .../tests/unit/Wamp/TopicManagerTest.php | 226 ++ .../ratchet/tests/unit/Wamp/TopicTest.php | 164 + .../tests/unit/Wamp/WampConnectionTest.php | 77 + .../tests/unit/Wamp/WampServerTest.php | 49 + .../Composer/vendor/composer/ClassLoader.php | 572 +++ .../vendor/composer/InstalledVersions.php | 352 ++ include/lib/Composer/vendor/composer/LICENSE | 21 + .../vendor/composer/autoload_classmap.php | 10 + .../vendor/composer/autoload_files.php | 14 + .../vendor/composer/autoload_namespaces.php | 10 + .../vendor/composer/autoload_psr4.php | 25 + .../vendor/composer/autoload_real.php | 57 + .../vendor/composer/autoload_static.php | 140 + .../Composer/vendor/composer/installed.json | 1490 +++++++ .../Composer/vendor/composer/installed.php | 215 + .../vendor/composer/platform_check.php | 26 + .../vendor/evenement/evenement/.gitignore | 2 + .../vendor/evenement/evenement/.travis.yml | 24 + .../vendor/evenement/evenement/CHANGELOG.md | 35 + .../vendor/evenement/evenement/LICENSE | 19 + .../vendor/evenement/evenement/README.md | 83 + .../vendor/evenement/evenement/composer.json | 29 + .../evenement/evenement/doc/00-intro.md | 28 + .../vendor/evenement/evenement/doc/01-api.md | 91 + .../evenement/doc/02-plugin-system.md | 155 + .../examples/benchmark-emit-no-arguments.php | 28 + .../examples/benchmark-emit-once.php | 30 + .../examples/benchmark-emit-one-argument.php | 28 + .../evenement/examples/benchmark-emit.php | 28 + .../benchmark-remove-listener-once.php | 39 + .../evenement/evenement/phpunit.xml.dist | 24 + .../evenement/src/Evenement/EventEmitter.php | 17 + .../src/Evenement/EventEmitterInterface.php | 22 + .../src/Evenement/EventEmitterTrait.php | 135 + .../Evenement/Tests/EventEmitterTest.php | 438 ++ .../tests/Evenement/Tests/Listener.php | 51 + .../tests/Evenement/Tests/functions.php | 17 + .../vendor/guzzlehttp/psr7/CHANGELOG.md | 396 ++ .../Composer/vendor/guzzlehttp/psr7/LICENSE | 26 + .../Composer/vendor/guzzlehttp/psr7/README.md | 872 ++++ .../vendor/guzzlehttp/psr7/composer.json | 96 + .../guzzlehttp/psr7/src/AppendStream.php | 248 ++ .../guzzlehttp/psr7/src/BufferStream.php | 149 + .../guzzlehttp/psr7/src/CachingStream.php | 153 + .../guzzlehttp/psr7/src/DroppingStream.php | 49 + .../src/Exception/MalformedUriException.php | 14 + .../vendor/guzzlehttp/psr7/src/FnStream.php | 180 + .../vendor/guzzlehttp/psr7/src/Header.php | 134 + .../guzzlehttp/psr7/src/HttpFactory.php | 100 + .../guzzlehttp/psr7/src/InflateStream.php | 37 + .../guzzlehttp/psr7/src/LazyOpenStream.php | 41 + .../guzzlehttp/psr7/src/LimitStream.php | 157 + .../vendor/guzzlehttp/psr7/src/Message.php | 246 ++ .../guzzlehttp/psr7/src/MessageTrait.php | 264 ++ .../vendor/guzzlehttp/psr7/src/MimeType.php | 1237 ++++++ .../guzzlehttp/psr7/src/MultipartStream.php | 159 + .../guzzlehttp/psr7/src/NoSeekStream.php | 28 + .../vendor/guzzlehttp/psr7/src/PumpStream.php | 179 + .../vendor/guzzlehttp/psr7/src/Query.php | 113 + .../vendor/guzzlehttp/psr7/src/Request.php | 157 + .../vendor/guzzlehttp/psr7/src/Response.php | 160 + .../vendor/guzzlehttp/psr7/src/Rfc7230.php | 23 + .../guzzlehttp/psr7/src/ServerRequest.php | 344 ++ .../vendor/guzzlehttp/psr7/src/Stream.php | 282 ++ .../psr7/src/StreamDecoratorTrait.php | 155 + .../guzzlehttp/psr7/src/StreamWrapper.php | 175 + .../guzzlehttp/psr7/src/UploadedFile.php | 211 + .../vendor/guzzlehttp/psr7/src/Uri.php | 740 ++++ .../guzzlehttp/psr7/src/UriComparator.php | 52 + .../guzzlehttp/psr7/src/UriNormalizer.php | 220 + .../guzzlehttp/psr7/src/UriResolver.php | 211 + .../vendor/guzzlehttp/psr7/src/Utils.php | 459 +++ .../vendor/marcelog/pami/.codeclimate.yml | 19 + .../Composer/vendor/marcelog/pami/.gitignore | 9 + .../Composer/vendor/marcelog/pami/.travis.yml | 23 + .../lib/Composer/vendor/marcelog/pami/LICENSE | 179 + .../Composer/vendor/marcelog/pami/README.md | 373 ++ .../Composer/vendor/marcelog/pami/build.xml | 78 + .../vendor/marcelog/pami/composer.json | 38 + .../vendor/marcelog/pami/composer.phar | Bin 0 -> 1238154 bytes .../vendor/marcelog/pami/doc/ApiIndex.md | 200 + .../pami/doc/PAMI-AsyncAgi-AsyncClientImpl.md | 169 + .../PAMI-Client-Exception-ClientException.md | 19 + .../marcelog/pami/doc/PAMI-Client-IClient.md | 129 + .../pami/doc/PAMI-Client-Impl-ClientImpl.md | 415 ++ .../pami/doc/PAMI-Exception-PAMIException.md | 19 + .../pami/doc/PAMI-Listener-IEventListener.md | 36 + .../pami/doc/PAMI-Message-Action-AGIAction.md | 310 ++ ...MI-Message-Action-AbsoluteTimeoutAction.md | 310 ++ .../doc/PAMI-Message-Action-ActionMessage.md | 310 ++ .../PAMI-Message-Action-AgentLogoffAction.md | 310 ++ .../doc/PAMI-Message-Action-AgentsAction.md | 310 ++ ...I-Message-Action-AttendedTransferAction.md | 310 ++ .../doc/PAMI-Message-Action-BridgeAction.md | 310 ++ .../PAMI-Message-Action-BridgeInfoAction.md | 310 ++ ...PAMI-Message-Action-ChangeMonitorAction.md | 310 ++ .../doc/PAMI-Message-Action-CommandAction.md | 310 ++ ...AMI-Message-Action-ConfbridgeListAction.md | 310 ++ ...AMI-Message-Action-ConfbridgeMuteAction.md | 310 ++ ...I-Message-Action-ConfbridgeUnmuteAction.md | 310 ++ .../PAMI-Message-Action-CoreSettingsAction.md | 310 ++ ...I-Message-Action-CoreShowChannelsAction.md | 310 ++ .../PAMI-Message-Action-CoreStatusAction.md | 310 ++ .../PAMI-Message-Action-CreateConfigAction.md | 310 ++ .../PAMI-Message-Action-DAHDIDNDOffAction.md | 310 ++ .../PAMI-Message-Action-DAHDIDNDOnAction.md | 310 ++ ...I-Message-Action-DAHDIDialOffHookAction.md | 310 ++ .../PAMI-Message-Action-DAHDIHangupAction.md | 310 ++ .../PAMI-Message-Action-DAHDIRestartAction.md | 310 ++ ...-Message-Action-DAHDIShowChannelsAction.md | 310 ++ .../doc/PAMI-Message-Action-DBDelAction.md | 310 ++ .../PAMI-Message-Action-DBDelTreeAction.md | 310 ++ .../doc/PAMI-Message-Action-DBGetAction.md | 310 ++ .../doc/PAMI-Message-Action-DBPutAction.md | 310 ++ .../PAMI-Message-Action-DongleReloadAction.md | 310 ++ .../PAMI-Message-Action-DongleResetAction.md | 310 ++ ...PAMI-Message-Action-DongleRestartAction.md | 310 ++ ...PAMI-Message-Action-DongleSendPDUAction.md | 310 ++ ...PAMI-Message-Action-DongleSendSMSAction.md | 310 ++ ...AMI-Message-Action-DongleSendUSSDAction.md | 310 ++ ...-Message-Action-DongleShowDevicesAction.md | 310 ++ .../PAMI-Message-Action-DongleStartAction.md | 310 ++ .../PAMI-Message-Action-DongleStopAction.md | 310 ++ .../doc/PAMI-Message-Action-EventsAction.md | 310 ++ ...AMI-Message-Action-ExtensionStateAction.md | 310 ++ .../PAMI-Message-Action-GetConfigAction.md | 310 ++ ...PAMI-Message-Action-GetConfigJSONAction.md | 310 ++ .../doc/PAMI-Message-Action-GetVarAction.md | 310 ++ .../doc/PAMI-Message-Action-HangupAction.md | 310 ++ .../PAMI-Message-Action-JabberSendAction.md | 310 ++ ...AMI-Message-Action-ListCategoriesAction.md | 310 ++ .../PAMI-Message-Action-ListCommandsAction.md | 310 ++ ...-Message-Action-LocalOptimizeAwayAction.md | 310 ++ .../doc/PAMI-Message-Action-LoginAction.md | 310 ++ .../doc/PAMI-Message-Action-LogoffAction.md | 310 ++ .../PAMI-Message-Action-MailboxCountAction.md | 310 ++ ...PAMI-Message-Action-MailboxStatusAction.md | 310 ++ .../PAMI-Message-Action-MeetmeListAction.md | 310 ++ .../PAMI-Message-Action-MeetmeMuteAction.md | 310 ++ .../PAMI-Message-Action-MeetmeUnmuteAction.md | 310 ++ .../PAMI-Message-Action-MixMonitorAction.md | 342 ++ .../PAMI-Message-Action-ModuleCheckAction.md | 310 ++ .../PAMI-Message-Action-ModuleLoadAction.md | 310 ++ .../PAMI-Message-Action-ModuleReloadAction.md | 310 ++ .../PAMI-Message-Action-ModuleUnloadAction.md | 310 ++ .../doc/PAMI-Message-Action-MonitorAction.md | 314 ++ .../PAMI-Message-Action-OriginateAction.md | 470 +++ .../doc/PAMI-Message-Action-ParkAction.md | 310 ++ .../PAMI-Message-Action-ParkedCallsAction.md | 310 ++ .../PAMI-Message-Action-PauseMonitorAction.md | 310 ++ .../doc/PAMI-Message-Action-PingAction.md | 310 ++ .../doc/PAMI-Message-Action-PlayDTMFAction.md | 310 ++ .../doc/PAMI-Message-Action-QueueAddAction.md | 374 ++ .../doc/PAMI-Message-Action-QueueLogAction.md | 358 ++ .../PAMI-Message-Action-QueuePauseAction.md | 310 ++ .../PAMI-Message-Action-QueuePenaltyAction.md | 310 ++ .../PAMI-Message-Action-QueueReloadAction.md | 310 ++ .../PAMI-Message-Action-QueueRemoveAction.md | 310 ++ .../PAMI-Message-Action-QueueResetAction.md | 310 ++ .../PAMI-Message-Action-QueueRuleAction.md | 310 ++ .../PAMI-Message-Action-QueueStatusAction.md | 310 ++ .../PAMI-Message-Action-QueueSummaryAction.md | 310 ++ .../PAMI-Message-Action-QueueUnpauseAction.md | 310 ++ .../doc/PAMI-Message-Action-QueuesAction.md | 310 ++ .../doc/PAMI-Message-Action-RedirectAction.md | 374 ++ .../doc/PAMI-Message-Action-ReloadAction.md | 310 ++ .../PAMI-Message-Action-SIPNotifyAction.md | 310 ++ .../doc/PAMI-Message-Action-SIPPeersAction.md | 310 ++ ...AMI-Message-Action-SIPQualifyPeerAction.md | 310 ++ .../PAMI-Message-Action-SIPShowPeerAction.md | 310 ++ ...MI-Message-Action-SIPShowRegistryAction.md | 310 ++ .../doc/PAMI-Message-Action-SendTextAction.md | 310 ++ .../doc/PAMI-Message-Action-SetVarAction.md | 310 ++ .../PAMI-Message-Action-ShowDialPlanAction.md | 310 ++ .../doc/PAMI-Message-Action-StatusAction.md | 310 ++ ...AMI-Message-Action-StopMixMonitorAction.md | 326 ++ .../PAMI-Message-Action-StopMonitorAction.md | 310 ++ ...AMI-Message-Action-UnpauseMonitorAction.md | 310 ++ .../PAMI-Message-Action-UpdateConfigAction.md | 479 +++ .../PAMI-Message-Action-VGSMSMSTxAction.md | 474 +++ ...Message-Action-VoicemailUsersListAction.md | 310 ++ .../doc/PAMI-Message-Event-AGIExecEvent.md | 480 +++ .../PAMI-Message-Event-AgentConnectEvent.md | 506 +++ .../doc/PAMI-Message-Event-AgentloginEvent.md | 441 ++ .../PAMI-Message-Event-AgentlogoffEvent.md | 441 ++ .../PAMI-Message-Event-AgentsCompleteEvent.md | 389 ++ .../doc/PAMI-Message-Event-AgentsEvent.md | 467 +++ .../doc/PAMI-Message-Event-AsyncAGIEvent.md | 467 +++ .../doc/PAMI-Message-Event-BridgeEvent.md | 506 +++ ...MI-Message-Event-BridgeInfoChannelEvent.md | 558 +++ ...I-Message-Event-BridgeInfoCompleteEvent.md | 493 +++ .../pami/doc/PAMI-Message-Event-CELEvent.md | 688 ++++ .../PAMI-Message-Event-ChannelUpdateEvent.md | 467 +++ ...ssage-Event-ConfbridgeListCompleteEvent.md | 402 ++ .../PAMI-Message-Event-ConfbridgeListEvent.md | 532 +++ ...PAMI-Message-Event-CoreShowChannelEvent.md | 584 +++ ...age-Event-CoreShowChannelsCompleteEvent.md | 403 ++ ...ge-Event-DAHDIShowChannelsCompleteEvent.md | 403 ++ ...MI-Message-Event-DAHDIShowChannelsEvent.md | 467 +++ .../PAMI-Message-Event-DBGetResponseEvent.md | 428 ++ .../pami/doc/PAMI-Message-Event-DTMFEvent.md | 480 +++ .../pami/doc/PAMI-Message-Event-DialEvent.md | 519 +++ ...MI-Message-Event-DongleDeviceEntryEvent.md | 1156 ++++++ .../PAMI-Message-Event-DongleNewCUSDEvent.md | 428 ++ ...-Message-Event-DongleNewUSSDBase64Event.md | 428 ++ .../PAMI-Message-Event-DongleNewUSSDEvent.md | 428 ++ ...PAMI-Message-Event-DongleSMSStatusEvent.md | 441 ++ ...ge-Event-DongleShowDevicesCompleteEvent.md | 402 ++ .../PAMI-Message-Event-DongleStatusEvent.md | 428 ++ ...AMI-Message-Event-DongleUSSDStatusEvent.md | 441 ++ .../doc/PAMI-Message-Event-EventMessage.md | 389 ++ ...PAMI-Message-Event-ExtensionStatusEvent.md | 454 +++ ...age-Event-Factory-Impl-EventFactoryImpl.md | 51 + .../PAMI-Message-Event-FullyBootedEvent.md | 389 ++ .../doc/PAMI-Message-Event-HangupEvent.md | 480 +++ .../pami/doc/PAMI-Message-Event-HoldEvent.md | 441 ++ .../PAMI-Message-Event-JabberEventEvent.md | 428 ++ .../pami/doc/PAMI-Message-Event-JoinEvent.md | 495 +++ .../pami/doc/PAMI-Message-Event-LeaveEvent.md | 456 +++ .../pami/doc/PAMI-Message-Event-LinkEvent.md | 480 +++ .../PAMI-Message-Event-ListDialPlanEvent.md | 480 +++ .../doc/PAMI-Message-Event-MasqueradeEvent.md | 454 +++ .../PAMI-Message-Event-MessageWaitingEvent.md | 430 ++ .../PAMI-Message-Event-MusicOnHoldEvent.md | 443 ++ .../PAMI-Message-Event-NewAccountCodeEvent.md | 454 +++ .../PAMI-Message-Event-NewCalleridEvent.md | 467 +++ .../doc/PAMI-Message-Event-NewchannelEvent.md | 519 +++ .../doc/PAMI-Message-Event-NewextenEvent.md | 493 +++ .../doc/PAMI-Message-Event-NewstateEvent.md | 506 +++ ...MI-Message-Event-OriginateResponseEvent.md | 506 +++ .../doc/PAMI-Message-Event-ParkedCallEvent.md | 532 +++ ...-Message-Event-ParkedCallsCompleteEvent.md | 390 ++ .../doc/PAMI-Message-Event-PeerEntryEvent.md | 545 +++ .../doc/PAMI-Message-Event-PeerStatusEvent.md | 441 ++ ...AMI-Message-Event-PeerlistCompleteEvent.md | 402 ++ ...AMI-Message-Event-QueueMemberAddedEvent.md | 519 +++ .../PAMI-Message-Event-QueueMemberEvent.md | 493 +++ ...MI-Message-Event-QueueMemberPausedEvent.md | 454 +++ ...I-Message-Event-QueueMemberRemovedEvent.md | 441 ++ ...MI-Message-Event-QueueMemberStatusEvent.md | 506 +++ .../PAMI-Message-Event-QueueParamsEvent.md | 519 +++ ...-Message-Event-QueueStatusCompleteEvent.md | 390 ++ ...Message-Event-QueueSummaryCompleteEvent.md | 390 ++ .../PAMI-Message-Event-QueueSummaryEvent.md | 467 +++ .../PAMI-Message-Event-RTCPReceivedEvent.md | 558 +++ ...AMI-Message-Event-RTCPReceiverStatEvent.md | 480 +++ .../doc/PAMI-Message-Event-RTCPSentEvent.md | 558 +++ ...PAMI-Message-Event-RTPReceiverStatEvent.md | 480 +++ .../PAMI-Message-Event-RTPSenderStatEvent.md | 480 +++ ...essage-Event-RegistrationsCompleteEvent.md | 403 ++ .../doc/PAMI-Message-Event-RegistryEvent.md | 428 ++ .../doc/PAMI-Message-Event-RenameEvent.md | 454 +++ ...Message-Event-ShowDialPlanCompleteEvent.md | 454 +++ .../PAMI-Message-Event-StatusCompleteEvent.md | 402 ++ .../doc/PAMI-Message-Event-StatusEvent.md | 597 +++ .../doc/PAMI-Message-Event-TransferEvent.md | 519 +++ .../PAMI-Message-Event-UnParkedCallEvent.md | 519 +++ .../doc/PAMI-Message-Event-UnknownEvent.md | 389 ++ .../doc/PAMI-Message-Event-UnlinkEvent.md | 480 +++ .../doc/PAMI-Message-Event-UserEventEvent.md | 428 ++ .../doc/PAMI-Message-Event-VarSetEvent.md | 454 +++ .../PAMI-Message-Event-VgsmMeStateEvent.md | 441 ++ .../PAMI-Message-Event-VgsmNetStateEvent.md | 417 ++ .../doc/PAMI-Message-Event-VgsmSmsRxEvent.md | 651 +++ ...e-Event-VoicemailUserEntryCompleteEvent.md | 390 ++ ...I-Message-Event-VoicemailUserEntryEvent.md | 714 ++++ .../pami/doc/PAMI-Message-IncomingMessage.md | 372 ++ .../marcelog/pami/doc/PAMI-Message-Message.md | 277 ++ .../pami/doc/PAMI-Message-OutgoingMessage.md | 291 ++ .../PAMI-Message-Response-ResponseMessage.md | 499 +++ .../examples/asyncagi/MyPAGIApplication.php | 309 ++ .../pami/doc/examples/asyncagi/example.php | 146 + .../pami/doc/examples/quickstart/example.php | 285 ++ .../pami/doc/examples/sms/example.php | 139 + .../src/PAMI/AsyncAgi/AsyncClientImpl.php | 170 + .../PAMI/Client/Exception/ClientException.php | 49 + .../marcelog/pami/src/PAMI/Client/IClient.php | 114 + .../pami/src/PAMI/Client/Impl/ClientImpl.php | 472 +++ .../pami/src/PAMI/Exception/PAMIException.php | 44 + .../pami/src/PAMI/Listener/IEventListener.php | 56 + .../src/PAMI/Message/Action/AGIAction.php | 60 + .../Message/Action/AbsoluteTimeoutAction.php | 60 + .../src/PAMI/Message/Action/ActionMessage.php | 86 + .../PAMI/Message/Action/AgentLogoffAction.php | 60 + .../src/PAMI/Message/Action/AgentsAction.php | 55 + .../Message/Action/AttendedTransferAction.php | 64 + .../Message/Action/BlindTransferAction.php | 60 + .../src/PAMI/Message/Action/BridgeAction.php | 62 + .../PAMI/Message/Action/BridgeInfoAction.php | 59 + .../PAMI/Message/Action/ChallengeAction.php | 56 + .../Message/Action/ChangeMonitorAction.php | 60 + .../src/PAMI/Message/Action/CommandAction.php | 58 + .../Message/Action/ConfbridgeListAction.php | 58 + .../Message/Action/ConfbridgeMuteAction.php | 60 + .../Message/Action/ConfbridgeUnmuteAction.php | 60 + .../Message/Action/CoreSettingsAction.php | 55 + .../Message/Action/CoreShowChannelsAction.php | 55 + .../PAMI/Message/Action/CoreStatusAction.php | 55 + .../Message/Action/CreateConfigAction.php | 58 + .../PAMI/Message/Action/DAHDIDNDOffAction.php | 58 + .../PAMI/Message/Action/DAHDIDNDOnAction.php | 58 + .../Message/Action/DAHDIDialOffHookAction.php | 57 + .../PAMI/Message/Action/DAHDIHangupAction.php | 58 + .../Message/Action/DAHDIRestartAction.php | 55 + .../Action/DAHDIShowChannelsAction.php | 55 + .../Message/Action/DAHDITransferAction.php | 56 + .../src/PAMI/Message/Action/DBDelAction.php | 60 + .../PAMI/Message/Action/DBDelTreeAction.php | 62 + .../src/PAMI/Message/Action/DBGetAction.php | 60 + .../src/PAMI/Message/Action/DBPutAction.php | 62 + .../Message/Action/DongleReloadAction.php | 58 + .../PAMI/Message/Action/DongleResetAction.php | 58 + .../Message/Action/DongleRestartAction.php | 60 + .../Message/Action/DongleSendPDUAction.php | 60 + .../Message/Action/DongleSendSMSAction.php | 62 + .../Message/Action/DongleSendUSSDAction.php | 60 + .../Action/DongleShowDevicesAction.php | 59 + .../PAMI/Message/Action/DongleStartAction.php | 58 + .../PAMI/Message/Action/DongleStopAction.php | 60 + .../src/PAMI/Message/Action/EventsAction.php | 62 + .../Message/Action/ExtensionStateAction.php | 60 + .../Action/ExtensionStateListAction.php | 55 + .../PAMI/Message/Action/GetConfigAction.php | 62 + .../Message/Action/GetConfigJSONAction.php | 58 + .../src/PAMI/Message/Action/GetVarAction.php | 62 + .../src/PAMI/Message/Action/HangupAction.php | 63 + .../PAMI/Message/Action/JabberSendAction.php | 63 + .../Message/Action/ListCategoriesAction.php | 58 + .../Message/Action/ListCommandsAction.php | 55 + .../Action/LocalOptimizeAwayAction.php | 58 + .../src/PAMI/Message/Action/LoginAction.php | 65 + .../src/PAMI/Message/Action/LogoffAction.php | 55 + .../Message/Action/MailboxCountAction.php | 58 + .../Message/Action/MailboxStatusAction.php | 58 + .../PAMI/Message/Action/MeetmeListAction.php | 58 + .../PAMI/Message/Action/MeetmeMuteAction.php | 60 + .../Message/Action/MeetmeUnmuteAction.php | 60 + .../PAMI/Message/Action/MixMonitorAction.php | 82 + .../Message/Action/MixMonitorMuteAction.php | 90 + .../PAMI/Message/Action/ModuleCheckAction.php | 58 + .../PAMI/Message/Action/ModuleLoadAction.php | 67 + .../Message/Action/ModuleReloadAction.php | 67 + .../Message/Action/ModuleUnloadAction.php | 67 + .../src/PAMI/Message/Action/MonitorAction.php | 70 + .../PAMI/Message/Action/OriginateAction.php | 178 + .../src/PAMI/Message/Action/ParkAction.php | 68 + .../PAMI/Message/Action/ParkedCallsAction.php | 55 + .../Message/Action/PauseMonitorAction.php | 58 + .../src/PAMI/Message/Action/PingAction.php | 55 + .../PAMI/Message/Action/PlayDTMFAction.php | 60 + .../PAMI/Message/Action/QueueAddAction.php | 109 + .../PAMI/Message/Action/QueueLogAction.php | 97 + .../PAMI/Message/Action/QueuePauseAction.php | 63 + .../Message/Action/QueuePenaltyAction.php | 63 + .../PAMI/Message/Action/QueueReloadAction.php | 70 + .../PAMI/Message/Action/QueueRemoveAction.php | 60 + .../PAMI/Message/Action/QueueResetAction.php | 60 + .../PAMI/Message/Action/QueueRuleAction.php | 60 + .../PAMI/Message/Action/QueueStatusAction.php | 63 + .../Message/Action/QueueSummaryAction.php | 60 + .../Message/Action/QueueUnpauseAction.php | 63 + .../src/PAMI/Message/Action/QueuesAction.php | 55 + .../PAMI/Message/Action/RedirectAction.php | 112 + .../src/PAMI/Message/Action/ReloadAction.php | 60 + .../PAMI/Message/Action/SIPNotifyAction.php | 58 + .../PAMI/Message/Action/SIPPeersAction.php | 55 + .../Message/Action/SIPQualifyPeerAction.php | 58 + .../PAMI/Message/Action/SIPShowPeerAction.php | 58 + .../Message/Action/SIPShowRegistryAction.php | 55 + .../PAMI/Message/Action/SendTextAction.php | 60 + .../src/PAMI/Message/Action/SetVarAction.php | 64 + .../Message/Action/ShowDialPlanAction.php | 64 + .../src/PAMI/Message/Action/StatusAction.php | 60 + .../Message/Action/StopMixMonitorAction.php | 70 + .../PAMI/Message/Action/StopMonitorAction.php | 58 + .../Message/Action/UnpauseMonitorAction.php | 58 + .../Message/Action/UpdateConfigAction.php | 178 + .../PAMI/Message/Action/UserEventAction.php | 60 + .../PAMI/Message/Action/VGSMSMSTxAction.php | 176 + .../Action/VoicemailUsersListAction.php | 55 + .../PAMI/Message/Action/WaitEventAction.php | 56 + .../PAMI/Message/Event/AGIExecEndEvent.php | 215 + .../src/PAMI/Message/Event/AGIExecEvent.php | 117 + .../PAMI/Message/Event/AGIExecStartEvent.php | 195 + .../PAMI/Message/Event/AgentConnectEvent.php | 137 + .../PAMI/Message/Event/AgentloginEvent.php | 87 + .../PAMI/Message/Event/AgentlogoffEvent.php | 87 + .../Message/Event/AgentsCompleteEvent.php | 48 + .../src/PAMI/Message/Event/AgentsEvent.php | 117 + .../PAMI/Message/Event/AsyncAGIEndEvent.php | 175 + .../src/PAMI/Message/Event/AsyncAGIEvent.php | 120 + .../PAMI/Message/Event/AsyncAGIExecEvent.php | 206 + .../PAMI/Message/Event/AsyncAGIStartEvent.php | 196 + .../Message/Event/AttendedTransferEvent.php | 857 ++++ .../PAMI/Message/Event/BlindTransferEvent.php | 455 +++ .../PAMI/Message/Event/BridgeCreateEvent.php | 115 + .../PAMI/Message/Event/BridgeDestroyEvent.php | 115 + .../PAMI/Message/Event/BridgeEnterEvent.php | 245 ++ .../src/PAMI/Message/Event/BridgeEvent.php | 137 + .../Message/Event/BridgeInfoChannelEvent.php | 175 + .../Message/Event/BridgeInfoCompleteEvent.php | 125 + .../PAMI/Message/Event/BridgeLeaveEvent.php | 235 ++ .../pami/src/PAMI/Message/Event/CELEvent.php | 299 ++ .../PAMI/Message/Event/ChannelUpdateEvent.php | 107 + .../PAMI/Message/Event/ConfbridgeEndEvent.php | 125 + .../Message/Event/ConfbridgeJoinEvent.php | 265 ++ .../Message/Event/ConfbridgeLeaveEvent.php | 265 ++ .../Event/ConfbridgeListCompleteEvent.php | 57 + .../Message/Event/ConfbridgeListEvent.php | 155 + .../Message/Event/ConfbridgeMuteEvent.php | 265 ++ .../Message/Event/ConfbridgeStartEvent.php | 125 + .../Message/Event/ConfbridgeTalkingEvent.php | 275 ++ .../Message/Event/ConfbridgeUnmuteEvent.php | 265 ++ .../Message/Event/CoreShowChannelEvent.php | 198 + .../Event/CoreShowChannelsCompleteEvent.php | 59 + .../Event/DAHDIShowChannelsCompleteEvent.php | 59 + .../Message/Event/DAHDIShowChannelsEvent.php | 108 + .../PAMI/Message/Event/DBGetResponseEvent.php | 77 + .../src/PAMI/Message/Event/DNDStateEvent.php | 86 + .../src/PAMI/Message/Event/DTMFBeginEvent.php | 198 + .../src/PAMI/Message/Event/DTMFEndEvent.php | 208 + .../pami/src/PAMI/Message/Event/DTMFEvent.php | 117 + .../src/PAMI/Message/Event/DialBeginEvent.php | 315 ++ .../src/PAMI/Message/Event/DialEndEvent.php | 305 ++ .../pami/src/PAMI/Message/Event/DialEvent.php | 147 + .../Message/Event/DongleDeviceEntryEvent.php | 637 +++ .../PAMI/Message/Event/DongleNewCUSDEvent.php | 77 + .../Event/DongleNewUSSDBase64Event.php | 77 + .../PAMI/Message/Event/DongleNewUSSDEvent.php | 77 + .../Message/Event/DongleSMSStatusEvent.php | 87 + .../Event/DongleShowDevicesCompleteEvent.php | 57 + .../PAMI/Message/Event/DongleStatusEvent.php | 77 + .../Message/Event/DongleUSSDStatusEvent.php | 87 + .../src/PAMI/Message/Event/EventMessage.php | 57 + .../Message/Event/ExtensionStatusEvent.php | 97 + .../Event/Factory/Impl/EventFactoryImpl.php | 88 + .../PAMI/Message/Event/FullyBootedEvent.php | 48 + .../src/PAMI/Message/Event/HangupEvent.php | 117 + .../pami/src/PAMI/Message/Event/HoldEvent.php | 87 + .../PAMI/Message/Event/JabberEventEvent.php | 78 + .../pami/src/PAMI/Message/Event/JoinEvent.php | 127 + .../src/PAMI/Message/Event/LeaveEvent.php | 97 + .../pami/src/PAMI/Message/Event/LinkEvent.php | 117 + .../PAMI/Message/Event/ListDialplanEvent.php | 117 + .../PAMI/Message/Event/MasqueradeEvent.php | 96 + .../Message/Event/MessageWaitingEvent.php | 77 + .../PAMI/Message/Event/MusicOnHoldEvent.php | 87 + .../Message/Event/MusicOnHoldStartEvent.php | 185 + .../Message/Event/MusicOnHoldStopEvent.php | 175 + .../Message/Event/NewAccountCodeEvent.php | 97 + .../PAMI/Message/Event/NewCalleridEvent.php | 107 + .../PAMI/Message/Event/NewchannelEvent.php | 147 + .../src/PAMI/Message/Event/NewextenEvent.php | 136 + .../src/PAMI/Message/Event/NewstateEvent.php | 139 + .../Message/Event/OriginateResponseEvent.php | 147 + .../PAMI/Message/Event/ParkedCallEvent.php | 323 ++ .../Message/Event/ParkedCallGiveUpEvent.php | 345 ++ .../Message/Event/ParkedCallTimeOutEvent.php | 345 ++ .../Event/ParkedCallsCompleteEvent.php | 50 + .../src/PAMI/Message/Event/PeerEntryEvent.php | 167 + .../PAMI/Message/Event/PeerStatusEvent.php | 87 + .../Message/Event/PeerlistCompleteEvent.php | 57 + .../Message/Event/QueueCallerAbandonEvent.php | 215 + .../Message/Event/QueueCallerJoinEvent.php | 205 + .../Message/Event/QueueCallerLeaveEvent.php | 205 + .../Message/Event/QueueMemberAddedEvent.php | 147 + .../PAMI/Message/Event/QueueMemberEvent.php | 127 + .../Message/Event/QueueMemberPausedEvent.php | 97 + .../Message/Event/QueueMemberRemovedEvent.php | 87 + .../Message/Event/QueueMemberStatusEvent.php | 137 + .../PAMI/Message/Event/QueueParamsEvent.php | 147 + .../Event/QueueStatusCompleteEvent.php | 50 + .../Event/QueueSummaryCompleteEvent.php | 50 + .../PAMI/Message/Event/QueueSummaryEvent.php | 107 + .../PAMI/Message/Event/RTCPReceivedEvent.php | 172 + .../Message/Event/RTCPReceiverStatEvent.php | 117 + .../src/PAMI/Message/Event/RTCPSentEvent.php | 177 + .../Message/Event/RTPReceiverStatEvent.php | 117 + .../PAMI/Message/Event/RTPSenderStatEvent.php | 117 + .../Event/RegistrationsCompleteEvent.php | 59 + .../src/PAMI/Message/Event/RegistryEvent.php | 77 + .../src/PAMI/Message/Event/RenameEvent.php | 97 + .../Event/ShowDialPlanCompleteEvent.php | 97 + .../Message/Event/StatusCompleteEvent.php | 57 + .../src/PAMI/Message/Event/StatusEvent.php | 207 + .../src/PAMI/Message/Event/TransferEvent.php | 147 + .../PAMI/Message/Event/UnParkedCallEvent.php | 564 +++ .../src/PAMI/Message/Event/UnknownEvent.php | 48 + .../src/PAMI/Message/Event/UnlinkEvent.php | 117 + .../src/PAMI/Message/Event/UserEventEvent.php | 77 + .../src/PAMI/Message/Event/VarSetEvent.php | 97 + .../PAMI/Message/Event/VgsmMeStateEvent.php | 87 + .../PAMI/Message/Event/VgsmNetStateEvent.php | 71 + .../src/PAMI/Message/Event/VgsmSmsRxEvent.php | 251 ++ .../Event/VoicemailUserEntryCompleteEvent.php | 50 + .../Message/Event/VoicemailUserEntryEvent.php | 295 ++ .../pami/src/PAMI/Message/IncomingMessage.php | 176 + .../pami/src/PAMI/Message/Message.php | 249 ++ .../pami/src/PAMI/Message/OutgoingMessage.php | 44 + .../PAMI/Message/Response/ResponseMessage.php | 177 + .../pami/test/actions/Test_Actions.php | 1718 ++++++++ .../marcelog/pami/test/client/Test_Client.php | 1123 ++++++ .../marcelog/pami/test/events/Test_Events.php | 1573 ++++++++ .../pami/test/resources/bootstrap.php | 12 + .../marcelog/pami/test/resources/php.ini | 1 + .../marcelog/pami/test/resources/phpunit.xml | 47 + .../vendor/psr/http-factory/.gitignore | 2 + .../vendor/psr/http-factory/.pullapprove.yml | 7 + .../Composer/vendor/psr/http-factory/LICENSE | 21 + .../vendor/psr/http-factory/README.md | 10 + .../vendor/psr/http-factory/composer.json | 35 + .../src/RequestFactoryInterface.php | 18 + .../src/ResponseFactoryInterface.php | 18 + .../src/ServerRequestFactoryInterface.php | 24 + .../src/StreamFactoryInterface.php | 45 + .../src/UploadedFileFactoryInterface.php | 34 + .../http-factory/src/UriFactoryInterface.php | 17 + .../vendor/psr/http-message/CHANGELOG.md | 36 + .../Composer/vendor/psr/http-message/LICENSE | 19 + .../vendor/psr/http-message/README.md | 13 + .../vendor/psr/http-message/composer.json | 26 + .../psr/http-message/src/MessageInterface.php | 187 + .../psr/http-message/src/RequestInterface.php | 129 + .../http-message/src/ResponseInterface.php | 68 + .../src/ServerRequestInterface.php | 261 ++ .../psr/http-message/src/StreamInterface.php | 158 + .../src/UploadedFileInterface.php | 123 + .../psr/http-message/src/UriInterface.php | 323 ++ include/lib/Composer/vendor/psr/log/LICENSE | 19 + include/lib/Composer/vendor/psr/log/README.md | 58 + .../lib/Composer/vendor/psr/log/composer.json | 26 + .../vendor/psr/log/src/AbstractLogger.php | 15 + .../psr/log/src/InvalidArgumentException.php | 7 + .../Composer/vendor/psr/log/src/LogLevel.php | 18 + .../psr/log/src/LoggerAwareInterface.php | 18 + .../vendor/psr/log/src/LoggerAwareTrait.php | 26 + .../vendor/psr/log/src/LoggerInterface.php | 125 + .../vendor/psr/log/src/LoggerTrait.php | 142 + .../vendor/psr/log/src/NullLogger.php | 30 + .../vendor/ralouphie/getallheaders/LICENSE | 21 + .../vendor/ralouphie/getallheaders/README.md | 27 + .../ralouphie/getallheaders/composer.json | 26 + .../getallheaders/src/getallheaders.php | 46 + .../ratchet/rfc6455/.github/workflows/ci.yml | 43 + .../vendor/ratchet/rfc6455/.gitignore | 4 + .../Composer/vendor/ratchet/rfc6455/LICENSE | 19 + .../Composer/vendor/ratchet/rfc6455/README.md | 13 + .../vendor/ratchet/rfc6455/composer.json | 46 + .../vendor/ratchet/rfc6455/phpunit.xml.dist | 27 + .../src/Handshake/ClientNegotiator.php | 71 + ...validPermessageDeflateOptionsException.php | 7 + .../src/Handshake/NegotiatorInterface.php | 47 + .../Handshake/PermessageDeflateOptions.php | 266 ++ .../rfc6455/src/Handshake/RequestVerifier.php | 163 + .../src/Handshake/ResponseVerifier.php | 70 + .../src/Handshake/ServerNegotiator.php | 162 + .../src/Messaging/CloseFrameChecker.php | 24 + .../rfc6455/src/Messaging/DataInterface.php | 34 + .../ratchet/rfc6455/src/Messaging/Frame.php | 481 +++ .../rfc6455/src/Messaging/FrameInterface.php | 38 + .../ratchet/rfc6455/src/Messaging/Message.php | 136 + .../rfc6455/src/Messaging/MessageBuffer.php | 550 +++ .../src/Messaging/MessageInterface.php | 20 + .../ratchet/rfc6455/tests/AbResultsTest.php | 32 + .../ratchet/rfc6455/tests/ab/clientRunner.php | 268 ++ .../rfc6455/tests/ab/docker_bootstrap.sh | 12 + .../rfc6455/tests/ab/fuzzingclient.json | 16 + .../tests/ab/fuzzingclient_skip_deflate.json | 14 + .../rfc6455/tests/ab/fuzzingserver.json | 12 + .../tests/ab/fuzzingserver_skip_deflate.json | 10 + .../ratchet/rfc6455/tests/ab/run_ab_tests.sh | 48 + .../ratchet/rfc6455/tests/ab/startServer.php | 86 + .../ratchet/rfc6455/tests/bootstrap.php | 19 + .../PermessageDeflateOptionsTest.php | 30 + .../unit/Handshake/RequestVerifierTest.php | 180 + .../unit/Handshake/ResponseVerifierTest.php | 39 + .../unit/Handshake/ServerNegotiatorTest.php | 219 + .../tests/unit/Messaging/FrameTest.php | 504 +++ .../unit/Messaging/MessageBufferTest.php | 376 ++ .../tests/unit/Messaging/MessageTest.php | 61 + .../Composer/vendor/react/cache/CHANGELOG.md | 96 + .../lib/Composer/vendor/react/cache/LICENSE | 21 + .../lib/Composer/vendor/react/cache/README.md | 367 ++ .../Composer/vendor/react/cache/composer.json | 45 + .../vendor/react/cache/src/ArrayCache.php | 181 + .../vendor/react/cache/src/CacheInterface.php | 194 + .../Composer/vendor/react/dns/CHANGELOG.md | 431 ++ include/lib/Composer/vendor/react/dns/LICENSE | 21 + .../lib/Composer/vendor/react/dns/README.md | 453 +++ .../Composer/vendor/react/dns/composer.json | 45 + .../react/dns/src/BadServerException.php | 7 + .../vendor/react/dns/src/Config/Config.php | 137 + .../vendor/react/dns/src/Config/HostsFile.php | 153 + .../vendor/react/dns/src/Model/Message.php | 230 ++ .../vendor/react/dns/src/Model/Record.php | 153 + .../react/dns/src/Protocol/BinaryDumper.php | 199 + .../vendor/react/dns/src/Protocol/Parser.php | 356 ++ .../react/dns/src/Query/CachingExecutor.php | 88 + .../dns/src/Query/CancellationException.php | 7 + .../react/dns/src/Query/CoopExecutor.php | 91 + .../react/dns/src/Query/ExecutorInterface.php | 43 + .../react/dns/src/Query/FallbackExecutor.php | 49 + .../react/dns/src/Query/HostsFileExecutor.php | 89 + .../vendor/react/dns/src/Query/Query.php | 69 + .../react/dns/src/Query/RetryExecutor.php | 85 + .../src/Query/SelectiveTransportExecutor.php | 85 + .../dns/src/Query/TcpTransportExecutor.php | 378 ++ .../react/dns/src/Query/TimeoutException.php | 7 + .../react/dns/src/Query/TimeoutExecutor.php | 31 + .../dns/src/Query/UdpTransportExecutor.php | 217 + .../react/dns/src/RecordNotFoundException.php | 7 + .../vendor/react/dns/src/Resolver/Factory.php | 214 + .../react/dns/src/Resolver/Resolver.php | 147 + .../dns/src/Resolver/ResolverInterface.php | 94 + .../vendor/react/event-loop/CHANGELOG.md | 443 ++ .../Composer/vendor/react/event-loop/LICENSE | 21 + .../vendor/react/event-loop/README.md | 930 +++++ .../vendor/react/event-loop/composer.json | 49 + .../vendor/react/event-loop/src/ExtEvLoop.php | 253 ++ .../react/event-loop/src/ExtEventLoop.php | 275 ++ .../react/event-loop/src/ExtLibevLoop.php | 201 + .../react/event-loop/src/ExtLibeventLoop.php | 285 ++ .../vendor/react/event-loop/src/ExtUvLoop.php | 342 ++ .../vendor/react/event-loop/src/Factory.php | 75 + .../vendor/react/event-loop/src/Loop.php | 225 ++ .../react/event-loop/src/LoopInterface.php | 472 +++ .../react/event-loop/src/SignalsHandler.php | 63 + .../react/event-loop/src/StreamSelectLoop.php | 329 ++ .../event-loop/src/Tick/FutureTickQueue.php | 60 + .../react/event-loop/src/Timer/Timer.php | 55 + .../react/event-loop/src/Timer/Timers.php | 112 + .../react/event-loop/src/TimerInterface.php | 27 + .../vendor/react/promise-timer/CHANGELOG.md | 126 + .../vendor/react/promise-timer/LICENSE | 21 + .../vendor/react/promise-timer/README.md | 318 ++ .../vendor/react/promise-timer/composer.json | 44 + .../promise-timer/src/TimeoutException.php | 35 + .../react/promise-timer/src/functions.php | 330 ++ .../promise-timer/src/functions_include.php | 7 + .../vendor/react/promise/CHANGELOG.md | 186 + .../lib/Composer/vendor/react/promise/LICENSE | 24 + .../Composer/vendor/react/promise/README.md | 874 ++++ .../vendor/react/promise/composer.json | 48 + .../src/CancellablePromiseInterface.php | 17 + .../react/promise/src/CancellationQueue.php | 55 + .../vendor/react/promise/src/Deferred.php | 65 + .../promise/src/Exception/LengthException.php | 7 + .../promise/src/ExtendedPromiseInterface.php | 98 + .../react/promise/src/FulfilledPromise.php | 71 + .../vendor/react/promise/src/LazyPromise.php | 66 + .../vendor/react/promise/src/Promise.php | 256 ++ .../react/promise/src/PromiseInterface.php | 41 + .../react/promise/src/PromisorInterface.php | 13 + .../react/promise/src/RejectedPromise.php | 79 + .../src/UnhandledRejectionException.php | 31 + .../vendor/react/promise/src/functions.php | 407 ++ .../react/promise/src/functions_include.php | 5 + .../Composer/vendor/react/socket/CHANGELOG.md | 753 ++++ .../lib/Composer/vendor/react/socket/LICENSE | 21 + .../Composer/vendor/react/socket/README.md | 1564 +++++++ .../vendor/react/socket/composer.json | 52 + .../vendor/react/socket/src/Connection.php | 183 + .../react/socket/src/ConnectionInterface.php | 119 + .../vendor/react/socket/src/Connector.php | 236 ++ .../react/socket/src/ConnectorInterface.php | 58 + .../vendor/react/socket/src/DnsConnector.php | 117 + .../vendor/react/socket/src/FdServer.php | 218 + .../react/socket/src/FixedUriConnector.php | 41 + .../src/HappyEyeBallsConnectionBuilder.php | 333 ++ .../socket/src/HappyEyeBallsConnector.php | 69 + .../react/socket/src/LimitingServer.php | 203 + .../react/socket/src/SecureConnector.php | 123 + .../vendor/react/socket/src/SecureServer.php | 206 + .../vendor/react/socket/src/Server.php | 114 + .../react/socket/src/ServerInterface.php | 151 + .../vendor/react/socket/src/SocketServer.php | 192 + .../react/socket/src/StreamEncryption.php | 141 + .../vendor/react/socket/src/TcpConnector.php | 165 + .../vendor/react/socket/src/TcpServer.php | 258 ++ .../react/socket/src/TimeoutConnector.php | 51 + .../vendor/react/socket/src/UnixConnector.php | 51 + .../vendor/react/socket/src/UnixServer.php | 158 + .../Composer/vendor/react/stream/CHANGELOG.md | 435 ++ .../lib/Composer/vendor/react/stream/LICENSE | 21 + .../Composer/vendor/react/stream/README.md | 1248 ++++++ .../vendor/react/stream/composer.json | 47 + .../react/stream/src/CompositeStream.php | 83 + .../react/stream/src/DuplexResourceStream.php | 227 ++ .../stream/src/DuplexStreamInterface.php | 39 + .../stream/src/ReadableResourceStream.php | 179 + .../stream/src/ReadableStreamInterface.php | 362 ++ .../vendor/react/stream/src/ThroughStream.php | 190 + .../Composer/vendor/react/stream/src/Util.php | 75 + .../stream/src/WritableResourceStream.php | 168 + .../stream/src/WritableStreamInterface.php | 347 ++ .../symfony/deprecation-contracts/.gitignore | 3 + .../deprecation-contracts/CHANGELOG.md | 5 + .../symfony/deprecation-contracts/LICENSE | 19 + .../symfony/deprecation-contracts/README.md | 26 + .../deprecation-contracts/composer.json | 35 + .../deprecation-contracts/function.php | 27 + .../symfony/http-foundation/AcceptHeader.php | 153 + .../http-foundation/AcceptHeaderItem.php | 159 + .../http-foundation/BinaryFileResponse.php | 383 ++ .../symfony/http-foundation/CHANGELOG.md | 314 ++ .../vendor/symfony/http-foundation/Cookie.php | 376 ++ .../Exception/BadRequestException.php | 19 + .../Exception/ConflictingHeadersException.php | 21 + .../Exception/JsonException.php | 21 + .../Exception/RequestExceptionInterface.php | 21 + .../Exception/SessionNotFoundException.php | 27 + .../SuspiciousOperationException.php | 20 + .../ExpressionRequestMatcher.php | 48 + .../File/Exception/AccessDeniedException.php | 25 + .../Exception/CannotWriteFileException.php | 21 + .../File/Exception/ExtensionFileException.php | 21 + .../File/Exception/FileException.php | 21 + .../File/Exception/FileNotFoundException.php | 25 + .../File/Exception/FormSizeFileException.php | 21 + .../File/Exception/IniSizeFileException.php | 21 + .../File/Exception/NoFileException.php | 21 + .../File/Exception/NoTmpDirFileException.php | 21 + .../File/Exception/PartialFileException.php | 21 + .../Exception/UnexpectedTypeException.php | 20 + .../File/Exception/UploadException.php | 21 + .../symfony/http-foundation/File/File.php | 141 + .../symfony/http-foundation/File/Stream.php | 25 + .../http-foundation/File/UploadedFile.php | 269 ++ .../symfony/http-foundation/FileBag.php | 136 + .../symfony/http-foundation/HeaderBag.php | 273 ++ .../symfony/http-foundation/HeaderUtils.php | 293 ++ .../symfony/http-foundation/InputBag.php | 98 + .../symfony/http-foundation/IpUtils.php | 194 + .../symfony/http-foundation/JsonResponse.php | 189 + .../vendor/symfony/http-foundation/LICENSE | 19 + .../symfony/http-foundation/ParameterBag.php | 189 + .../vendor/symfony/http-foundation/README.md | 28 + .../AbstractRequestRateLimiter.php | 71 + .../RequestRateLimiterInterface.php | 30 + .../http-foundation/RedirectResponse.php | 91 + .../symfony/http-foundation/Request.php | 2018 +++++++++ .../http-foundation/RequestMatcher.php | 185 + .../RequestMatcherInterface.php | 25 + .../symfony/http-foundation/RequestStack.php | 107 + .../symfony/http-foundation/Response.php | 1262 ++++++ .../http-foundation/ResponseHeaderBag.php | 287 ++ .../symfony/http-foundation/ServerBag.php | 97 + .../Session/Attribute/AttributeBag.php | 148 + .../Attribute/AttributeBagInterface.php | 53 + .../Session/Flash/AutoExpireFlashBag.php | 161 + .../Session/Flash/FlashBag.php | 152 + .../Session/Flash/FlashBagInterface.php | 72 + .../http-foundation/Session/Session.php | 280 ++ .../Session/SessionBagInterface.php | 42 + .../Session/SessionBagProxy.php | 95 + .../Session/SessionFactory.php | 40 + .../Session/SessionFactoryInterface.php | 20 + .../Session/SessionInterface.php | 140 + .../http-foundation/Session/SessionUtils.php | 59 + .../Handler/AbstractSessionHandler.php | 111 + .../Storage/Handler/IdentityMarshaller.php | 42 + .../Handler/MarshallingSessionHandler.php | 76 + .../Handler/MemcachedSessionHandler.php | 121 + .../Handler/MigratingSessionHandler.php | 107 + .../Storage/Handler/MongoDbSessionHandler.php | 166 + .../Handler/NativeFileSessionHandler.php | 55 + .../Storage/Handler/NullSessionHandler.php | 64 + .../Storage/Handler/PdoSessionHandler.php | 856 ++++ .../Storage/Handler/RedisSessionHandler.php | 114 + .../Storage/Handler/SessionHandlerFactory.php | 84 + .../Storage/Handler/StrictSessionHandler.php | 98 + .../Session/Storage/MetadataBag.php | 153 + .../Storage/MockArraySessionStorage.php | 248 ++ .../Storage/MockFileSessionStorage.php | 160 + .../Storage/MockFileSessionStorageFactory.php | 42 + .../Session/Storage/NativeSessionStorage.php | 461 +++ .../Storage/NativeSessionStorageFactory.php | 50 + .../Storage/PhpBridgeSessionStorage.php | 61 + .../PhpBridgeSessionStorageFactory.php | 45 + .../Session/Storage/Proxy/AbstractProxy.php | 106 + .../Storage/Proxy/SessionHandlerProxy.php | 76 + .../SessionStorageFactoryInterface.php | 25 + .../Storage/SessionStorageInterface.php | 116 + .../http-foundation/StreamedResponse.php | 123 + .../Constraint/RequestAttributeValueSame.php | 55 + .../Constraint/ResponseCookieValueSame.php | 85 + .../Test/Constraint/ResponseFormatSame.php | 71 + .../Test/Constraint/ResponseHasCookie.php | 77 + .../Test/Constraint/ResponseHasHeader.php | 53 + .../Test/Constraint/ResponseHeaderSame.php | 55 + .../Test/Constraint/ResponseIsRedirected.php | 56 + .../Test/Constraint/ResponseIsSuccessful.php | 56 + .../Constraint/ResponseIsUnprocessable.php | 56 + .../Constraint/ResponseStatusCodeSame.php | 63 + .../symfony/http-foundation/UrlHelper.php | 102 + .../symfony/http-foundation/composer.json | 42 + .../vendor/symfony/polyfill-mbstring/LICENSE | 19 + .../symfony/polyfill-mbstring/Mbstring.php | 874 ++++ .../symfony/polyfill-mbstring/README.md | 13 + .../Resources/unidata/lowerCase.php | 1397 +++++++ .../Resources/unidata/titleCaseRegexp.php | 5 + .../Resources/unidata/upperCase.php | 1489 +++++++ .../symfony/polyfill-mbstring/bootstrap.php | 147 + .../symfony/polyfill-mbstring/bootstrap80.php | 143 + .../symfony/polyfill-mbstring/composer.json | 41 + .../Composer/vendor/symfony/routing/Alias.php | 93 + .../symfony/routing/Annotation/Route.php | 198 + .../vendor/symfony/routing/CHANGELOG.md | 296 ++ .../vendor/symfony/routing/CompiledRoute.php | 157 + .../RoutingResolverPass.php | 40 + .../routing/Exception/ExceptionInterface.php | 21 + .../Exception/InvalidArgumentException.php | 16 + .../Exception/InvalidParameterException.php | 21 + .../Exception/MethodNotAllowedException.php | 44 + .../MissingMandatoryParametersException.php | 22 + .../Exception/NoConfigurationException.php | 21 + .../Exception/ResourceNotFoundException.php | 23 + .../RouteCircularReferenceException.php | 20 + .../Exception/RouteNotFoundException.php | 21 + .../routing/Exception/RuntimeException.php | 16 + .../Generator/CompiledUrlGenerator.php | 69 + .../ConfigurableRequirementsInterface.php | 51 + .../Dumper/CompiledUrlGeneratorDumper.php | 124 + .../Generator/Dumper/GeneratorDumper.php | 37 + .../Dumper/GeneratorDumperInterface.php | 33 + .../routing/Generator/UrlGenerator.php | 374 ++ .../Generator/UrlGeneratorInterface.php | 80 + .../Composer/vendor/symfony/routing/LICENSE | 19 + .../routing/Loader/AnnotationClassLoader.php | 388 ++ .../Loader/AnnotationDirectoryLoader.php | 86 + .../routing/Loader/AnnotationFileLoader.php | 139 + .../symfony/routing/Loader/ClosureLoader.php | 41 + .../Loader/Configurator/AliasConfigurator.php | 43 + .../Configurator/CollectionConfigurator.php | 122 + .../Configurator/ImportConfigurator.php | 87 + .../Loader/Configurator/RouteConfigurator.php | 49 + .../Configurator/RoutingConfigurator.php | 78 + .../Loader/Configurator/Traits/AddTrait.php | 60 + .../Loader/Configurator/Traits/HostTrait.php | 49 + .../Traits/LocalizedRouteTrait.php | 76 + .../Configurator/Traits/PrefixTrait.php | 62 + .../Loader/Configurator/Traits/RouteTrait.php | 175 + .../routing/Loader/ContainerLoader.php | 46 + .../routing/Loader/DirectoryLoader.php | 58 + .../symfony/routing/Loader/GlobFileLoader.php | 47 + .../symfony/routing/Loader/ObjectLoader.php | 77 + .../symfony/routing/Loader/PhpFileLoader.php | 80 + .../symfony/routing/Loader/XmlFileLoader.php | 456 +++ .../symfony/routing/Loader/YamlFileLoader.php | 299 ++ .../Loader/schema/routing/routing-1.0.xsd | 194 + .../routing/Matcher/CompiledUrlMatcher.php | 31 + .../Dumper/CompiledUrlMatcherDumper.php | 501 +++ .../Dumper/CompiledUrlMatcherTrait.php | 191 + .../routing/Matcher/Dumper/MatcherDumper.php | 37 + .../Matcher/Dumper/MatcherDumperInterface.php | 33 + .../Matcher/Dumper/StaticPrefixCollection.php | 203 + .../Matcher/ExpressionLanguageProvider.php | 58 + .../Matcher/RedirectableUrlMatcher.php | 64 + .../RedirectableUrlMatcherInterface.php | 29 + .../Matcher/RequestMatcherInterface.php | 37 + .../routing/Matcher/TraceableUrlMatcher.php | 164 + .../symfony/routing/Matcher/UrlMatcher.php | 273 ++ .../routing/Matcher/UrlMatcherInterface.php | 39 + .../Composer/vendor/symfony/routing/README.md | 51 + .../vendor/symfony/routing/RequestContext.php | 303 ++ .../routing/RequestContextAwareInterface.php | 25 + .../Composer/vendor/symfony/routing/Route.php | 458 +++ .../symfony/routing/RouteCollection.php | 370 ++ .../vendor/symfony/routing/RouteCompiler.php | 341 ++ .../routing/RouteCompilerInterface.php | 28 + .../vendor/symfony/routing/Router.php | 363 ++ .../symfony/routing/RouterInterface.php | 35 + .../vendor/symfony/routing/composer.json | 49 + include/lib/htmlpurifier-4.15.0.zip | Bin 0 -> 1033027 bytes include/system/api/v1/index.php | 17 +- include/system/api/v1/routes/add_customer.php | 112 + include/system/api/v1/routes/add_sale.php | 407 +- .../system/api/v1/routes/edit_customer.php | 122 + include/system/door/login.php | 43 +- index.php | 6 +- module/accounts/ajax.php | 88 +- module/accounts/transfer-money.php | 36 +- module/expenses/ajax.php | 541 +-- module/expenses/bills.php | 17 +- module/expenses/payments-return.php | 14 +- module/expenses/payments.php | 12 +- module/home.php | 166 +- module/incomes/ajax.php | 52 +- module/invoice/invoicePrintDetailsView.php | 210 + module/invoice/loanPaymentReceipt.php | 78 + module/invoice/paymentReceipt.php | 40 +- module/invoice/posSale.php | 10 +- module/invoice/posSaleForNormalPrinter.php | 12 +- .../invoice/posSaleInvoiceForPosPrinter.php | 15 +- .../posSaleViewInvoiceForPosPrinter.php | 7 +- .../invoice/posSaleView_Back_08-11-2021.php | 165 - module/invoice/purchaseDetailsInvoice.php | 181 + module/journals/ajax.php | 42 +- module/journals/journal-records.php | 33 +- module/ledgers/ajax.php | 47 +- module/loan-management/ajax.php | 35 +- module/marketing/add-specimen-copy.php | 336 ++ module/marketing/ajax.php | 2103 ++++++++++ module/marketing/edit-specimen-copy.php | 398 ++ module/marketing/institute-list.php | 76 + module/marketing/introductory.php | 98 + module/marketing/lead-statistics.php | 281 ++ module/marketing/new-sc-distribution.php | 294 ++ module/marketing/overview.php | 112 + module/marketing/person-list.php | 134 + module/marketing/specimen-copies.php | 79 + .../marketing/specimen-copy-distributions.php | 94 + module/my-shop/ajax.php | 198 +- module/my-shop/pos-sale.php | 21 +- module/my-shop/shop-overview.php | 50 +- module/peoples/ajax.php | 2542 ++++++------ module/print/printSalesReport.php | 23 +- module/production/ajax.php | 69 +- module/products/ajax.php | 2137 +++++----- module/products/edit-product.php | 56 +- module/products/new-product.php | 53 +- module/products/product-list.php | 2 + module/reports/ajax.php | 46 +- module/reports/ajax_back.php | 2057 ++++++++++ .../customer-report-single.php | 18 +- module/reports/income-report.php | 233 ++ module/reports/product-comparison.php | 256 +- .../product-report/product-report-all.php | 43 +- module/reports/sales-report.php | 14 +- module/sales/add-sale.php | 16 +- module/sales/ajax.php | 224 +- module/sales/discounts.php | 68 + module/sales/edit-sale.php | 1018 +++-- module/sales/new-wastage-sale.php | 24 +- module/sales/pos-sale.php | 6 + module/sales/pos.php | 2 +- module/sales/wastage-sale-list.php | 12 +- module/settings/ajax.php | 322 +- module/settings/backup.php | 20 +- module/settings/invoice-settings.php | 10 + module/settings/modules.php | 2 +- module/settings/pos-settings.php | 15 +- module/stock-management/ajax.php | 693 ++-- module/stock-management/new-purchase.php | 125 +- .../product-purchases-list.php | 15 +- module/stock-management/sales-return-list.php | 3 +- theme/rui/dist/css/AdminLTE.css | 11 +- theme/rui/dist/css/AdminLTE.min.css | 58 +- theme/rui/footer.php | 600 ++- theme/rui/header.php | 63 +- theme/rui/invoice-print_old.php | 89 - 1062 files changed, 201738 insertions(+), 6035 deletions(-) create mode 100644 assets/cron/backup_db.sh create mode 100644 assets/cron/downloadData.bat create mode 100644 assets/cron/sms.sh create mode 100644 assets/cron/uploadData.bat create mode 100644 assets/js/bms.js create mode 100644 assets/js/callCenter.js create mode 100644 assets/js/callCenter.min.js create mode 100644 assets/js/callCenterOld.js create mode 100644 assets/js/callCenterOld.min.js create mode 100644 assets/js/events.js create mode 100644 assets/js/functions.js create mode 100644 assets/js/initiator.js create mode 100644 assets/js/voiceMessage.js create mode 100644 assets/js/voiceMessage.min.js delete mode 100644 assets/upload/index.php create mode 100644 core/ajax/ajax_chat.php create mode 100644 include/lib/Composer/.php_history create mode 100644 include/lib/Composer/composer.json create mode 100644 include/lib/Composer/composer.lock create mode 100644 include/lib/Composer/composer.phar create mode 100644 include/lib/Composer/vendor/autoload.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/.github/workflows/ci.yml create mode 100644 include/lib/Composer/vendor/cboden/ratchet/.gitignore create mode 100644 include/lib/Composer/vendor/cboden/ratchet/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/cboden/ratchet/LICENSE create mode 100644 include/lib/Composer/vendor/cboden/ratchet/Makefile create mode 100644 include/lib/Composer/vendor/cboden/ratchet/README.md create mode 100644 include/lib/Composer/vendor/cboden/ratchet/SECURITY.md create mode 100644 include/lib/Composer/vendor/cboden/ratchet/composer.json create mode 100644 include/lib/Composer/vendor/cboden/ratchet/phpunit.xml.dist create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/App.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/ComponentInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/ConnectionInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Http/CloseResponseTrait.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Http/HttpRequestParser.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Http/NoOpHttpServerController.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Http/OriginCheck.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Http/Router.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/MessageInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Server/EchoServer.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Server/FlashPolicy.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/PhpBinaryHandler.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/PhpHandler.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Session/SessionProvider.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/JsonException.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/ServerProtocol.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/TopicManager.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/WampConnection.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServerInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/WebSocket/ConnContext.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/WebSocket/MessageCallableInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/WebSocket/MessageComponentInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsConnection.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/autobahn/bin/fuzzingserver.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/bootstrap.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/NullComponent.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/Wamp/Stub/WsWampServerInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/helpers/Ratchet/WebSocket/Stub/WsMessageComponentInterface.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/AbstractConnectionDecoratorTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Http/HttpServerTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Http/RouterTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Server/FlashPolicyComponentTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Server/IoConnectionTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Server/IoServerTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php create mode 100644 include/lib/Composer/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php create mode 100644 include/lib/Composer/vendor/composer/ClassLoader.php create mode 100644 include/lib/Composer/vendor/composer/InstalledVersions.php create mode 100644 include/lib/Composer/vendor/composer/LICENSE create mode 100644 include/lib/Composer/vendor/composer/autoload_classmap.php create mode 100644 include/lib/Composer/vendor/composer/autoload_files.php create mode 100644 include/lib/Composer/vendor/composer/autoload_namespaces.php create mode 100644 include/lib/Composer/vendor/composer/autoload_psr4.php create mode 100644 include/lib/Composer/vendor/composer/autoload_real.php create mode 100644 include/lib/Composer/vendor/composer/autoload_static.php create mode 100644 include/lib/Composer/vendor/composer/installed.json create mode 100644 include/lib/Composer/vendor/composer/installed.php create mode 100644 include/lib/Composer/vendor/composer/platform_check.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/.gitignore create mode 100644 include/lib/Composer/vendor/evenement/evenement/.travis.yml create mode 100644 include/lib/Composer/vendor/evenement/evenement/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/evenement/evenement/LICENSE create mode 100644 include/lib/Composer/vendor/evenement/evenement/README.md create mode 100644 include/lib/Composer/vendor/evenement/evenement/composer.json create mode 100644 include/lib/Composer/vendor/evenement/evenement/doc/00-intro.md create mode 100644 include/lib/Composer/vendor/evenement/evenement/doc/01-api.md create mode 100644 include/lib/Composer/vendor/evenement/evenement/doc/02-plugin-system.md create mode 100644 include/lib/Composer/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/examples/benchmark-emit-once.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/examples/benchmark-emit.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/phpunit.xml.dist create mode 100644 include/lib/Composer/vendor/evenement/evenement/src/Evenement/EventEmitter.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php create mode 100644 include/lib/Composer/vendor/evenement/evenement/tests/Evenement/Tests/functions.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/LICENSE create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/README.md create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/composer.json create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/AppendStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/BufferStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/CachingStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/DroppingStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Exception/MalformedUriException.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/FnStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Header.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/HttpFactory.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/InflateStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/LazyOpenStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/LimitStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Message.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/MessageTrait.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/MimeType.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/MultipartStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/NoSeekStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/PumpStream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Query.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Request.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Response.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Rfc7230.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/ServerRequest.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Stream.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/StreamWrapper.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/UploadedFile.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Uri.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/UriComparator.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/UriNormalizer.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/UriResolver.php create mode 100644 include/lib/Composer/vendor/guzzlehttp/psr7/src/Utils.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/.codeclimate.yml create mode 100644 include/lib/Composer/vendor/marcelog/pami/.gitignore create mode 100644 include/lib/Composer/vendor/marcelog/pami/.travis.yml create mode 100644 include/lib/Composer/vendor/marcelog/pami/LICENSE create mode 100644 include/lib/Composer/vendor/marcelog/pami/README.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/build.xml create mode 100644 include/lib/Composer/vendor/marcelog/pami/composer.json create mode 100644 include/lib/Composer/vendor/marcelog/pami/composer.phar create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/ApiIndex.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-AsyncAgi-AsyncClientImpl.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Client-Exception-ClientException.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Client-IClient.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Client-Impl-ClientImpl.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Exception-PAMIException.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Listener-IEventListener.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-AGIAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-AbsoluteTimeoutAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ActionMessage.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-AgentLogoffAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-AgentsAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-AttendedTransferAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-BridgeAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-BridgeInfoAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ChangeMonitorAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-CommandAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ConfbridgeListAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ConfbridgeMuteAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ConfbridgeUnmuteAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-CoreSettingsAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-CoreShowChannelsAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-CoreStatusAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-CreateConfigAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DAHDIDNDOffAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DAHDIDNDOnAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DAHDIDialOffHookAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DAHDIHangupAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DAHDIRestartAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DAHDIShowChannelsAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DBDelAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DBDelTreeAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DBGetAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DBPutAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleReloadAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleResetAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleRestartAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleSendPDUAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleSendSMSAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleSendUSSDAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleShowDevicesAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleStartAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-DongleStopAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-EventsAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ExtensionStateAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-GetConfigAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-GetConfigJSONAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-GetVarAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-HangupAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-JabberSendAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ListCategoriesAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ListCommandsAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-LocalOptimizeAwayAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-LoginAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-LogoffAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-MailboxCountAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-MailboxStatusAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-MeetmeListAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-MeetmeMuteAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-MeetmeUnmuteAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-MixMonitorAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ModuleCheckAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ModuleLoadAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ModuleReloadAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ModuleUnloadAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-MonitorAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-OriginateAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ParkAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ParkedCallsAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-PauseMonitorAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-PingAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-PlayDTMFAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueAddAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueLogAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueuePauseAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueuePenaltyAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueReloadAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueRemoveAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueResetAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueRuleAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueStatusAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueSummaryAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueueUnpauseAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-QueuesAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-RedirectAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ReloadAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-SIPNotifyAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-SIPPeersAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-SIPQualifyPeerAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-SIPShowPeerAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-SIPShowRegistryAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-SendTextAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-SetVarAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-ShowDialPlanAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-StatusAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-StopMixMonitorAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-StopMonitorAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-UnpauseMonitorAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-UpdateConfigAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-VGSMSMSTxAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Action-VoicemailUsersListAction.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-AGIExecEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-AgentConnectEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-AgentloginEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-AgentlogoffEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-AgentsCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-AgentsEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-AsyncAGIEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-BridgeEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-BridgeInfoChannelEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-BridgeInfoCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-CELEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ChannelUpdateEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ConfbridgeListCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ConfbridgeListEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-CoreShowChannelEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-CoreShowChannelsCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DAHDIShowChannelsCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DAHDIShowChannelsEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DBGetResponseEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DTMFEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DialEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleDeviceEntryEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleNewCUSDEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleNewUSSDBase64Event.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleNewUSSDEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleSMSStatusEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleShowDevicesCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleStatusEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-DongleUSSDStatusEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-EventMessage.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ExtensionStatusEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-Factory-Impl-EventFactoryImpl.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-FullyBootedEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-HangupEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-HoldEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-JabberEventEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-JoinEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-LeaveEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-LinkEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ListDialPlanEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-MasqueradeEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-MessageWaitingEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-MusicOnHoldEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-NewAccountCodeEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-NewCalleridEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-NewchannelEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-NewextenEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-NewstateEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-OriginateResponseEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ParkedCallEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ParkedCallsCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-PeerEntryEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-PeerStatusEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-PeerlistCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueMemberAddedEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueMemberEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueMemberPausedEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueMemberRemovedEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueMemberStatusEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueParamsEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueStatusCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueSummaryCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-QueueSummaryEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RTCPReceivedEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RTCPReceiverStatEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RTCPSentEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RTPReceiverStatEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RTPSenderStatEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RegistrationsCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RegistryEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-RenameEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-ShowDialPlanCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-StatusCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-StatusEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-TransferEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-UnParkedCallEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-UnknownEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-UnlinkEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-UserEventEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-VarSetEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-VgsmMeStateEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-VgsmNetStateEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-VgsmSmsRxEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-VoicemailUserEntryCompleteEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Event-VoicemailUserEntryEvent.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-IncomingMessage.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Message.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-OutgoingMessage.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/PAMI-Message-Response-ResponseMessage.md create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/examples/asyncagi/MyPAGIApplication.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/examples/asyncagi/example.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/examples/quickstart/example.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/doc/examples/sms/example.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/AsyncAgi/AsyncClientImpl.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Client/Exception/ClientException.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Client/IClient.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Client/Impl/ClientImpl.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Exception/PAMIException.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Listener/IEventListener.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/AGIAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/AbsoluteTimeoutAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ActionMessage.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/AgentLogoffAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/AgentsAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/AttendedTransferAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/BlindTransferAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/BridgeAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/BridgeInfoAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ChallengeAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ChangeMonitorAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/CommandAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ConfbridgeListAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ConfbridgeMuteAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ConfbridgeUnmuteAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/CoreSettingsAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/CoreShowChannelsAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/CoreStatusAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/CreateConfigAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DAHDIDNDOffAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DAHDIDNDOnAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DAHDIDialOffHookAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DAHDIHangupAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DAHDIRestartAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DAHDIShowChannelsAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DAHDITransferAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DBDelAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DBDelTreeAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DBGetAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DBPutAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleReloadAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleResetAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleRestartAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleSendPDUAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleSendSMSAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleSendUSSDAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleShowDevicesAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleStartAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/DongleStopAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/EventsAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ExtensionStateAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ExtensionStateListAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/GetConfigAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/GetConfigJSONAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/GetVarAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/HangupAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/JabberSendAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ListCategoriesAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ListCommandsAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/LocalOptimizeAwayAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/LoginAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/LogoffAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MailboxCountAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MailboxStatusAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MeetmeListAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MeetmeMuteAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MeetmeUnmuteAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MixMonitorAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MixMonitorMuteAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ModuleCheckAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ModuleLoadAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ModuleReloadAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ModuleUnloadAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/MonitorAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/OriginateAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ParkAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ParkedCallsAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/PauseMonitorAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/PingAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/PlayDTMFAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueAddAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueLogAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueuePauseAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueuePenaltyAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueReloadAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueRemoveAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueResetAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueRuleAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueStatusAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueSummaryAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueueUnpauseAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/QueuesAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/RedirectAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ReloadAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/SIPNotifyAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/SIPPeersAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/SIPQualifyPeerAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/SIPShowPeerAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/SIPShowRegistryAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/SendTextAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/SetVarAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/ShowDialPlanAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/StatusAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/StopMixMonitorAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/StopMonitorAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/UnpauseMonitorAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/UpdateConfigAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/UserEventAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/VGSMSMSTxAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/VoicemailUsersListAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Action/WaitEventAction.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AGIExecEndEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AGIExecEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AGIExecStartEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AgentConnectEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AgentloginEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AgentlogoffEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AgentsCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AgentsEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AsyncAGIEndEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AsyncAGIEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AsyncAGIExecEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AsyncAGIStartEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/AttendedTransferEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BlindTransferEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BridgeCreateEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BridgeDestroyEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BridgeEnterEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BridgeEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BridgeInfoChannelEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BridgeInfoCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/BridgeLeaveEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/CELEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ChannelUpdateEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeEndEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeJoinEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeLeaveEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeListCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeListEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeMuteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeStartEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeTalkingEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ConfbridgeUnmuteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/CoreShowChannelEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/CoreShowChannelsCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DAHDIShowChannelsCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DAHDIShowChannelsEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DBGetResponseEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DNDStateEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DTMFBeginEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DTMFEndEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DTMFEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DialBeginEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DialEndEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DialEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleDeviceEntryEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleNewCUSDEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleNewUSSDBase64Event.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleNewUSSDEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleSMSStatusEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleShowDevicesCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleStatusEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/DongleUSSDStatusEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/EventMessage.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ExtensionStatusEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/Factory/Impl/EventFactoryImpl.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/FullyBootedEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/HangupEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/HoldEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/JabberEventEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/JoinEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/LeaveEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/LinkEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ListDialplanEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/MasqueradeEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/MessageWaitingEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/MusicOnHoldEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/MusicOnHoldStartEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/MusicOnHoldStopEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/NewAccountCodeEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/NewCalleridEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/NewchannelEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/NewextenEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/NewstateEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/OriginateResponseEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ParkedCallEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ParkedCallGiveUpEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ParkedCallTimeOutEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ParkedCallsCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/PeerEntryEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/PeerStatusEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/PeerlistCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueCallerAbandonEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueCallerJoinEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueCallerLeaveEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueMemberAddedEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueMemberEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueMemberPausedEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueMemberRemovedEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueMemberStatusEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueParamsEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueStatusCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueSummaryCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/QueueSummaryEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RTCPReceivedEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RTCPReceiverStatEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RTCPSentEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RTPReceiverStatEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RTPSenderStatEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RegistrationsCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RegistryEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/RenameEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/ShowDialPlanCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/StatusCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/StatusEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/TransferEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/UnParkedCallEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/UnknownEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/UnlinkEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/UserEventEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/VarSetEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/VgsmMeStateEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/VgsmNetStateEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/VgsmSmsRxEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/VoicemailUserEntryCompleteEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Event/VoicemailUserEntryEvent.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/IncomingMessage.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Message.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/OutgoingMessage.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/src/PAMI/Message/Response/ResponseMessage.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/test/actions/Test_Actions.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/test/client/Test_Client.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/test/events/Test_Events.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/test/resources/bootstrap.php create mode 100644 include/lib/Composer/vendor/marcelog/pami/test/resources/php.ini create mode 100644 include/lib/Composer/vendor/marcelog/pami/test/resources/phpunit.xml create mode 100644 include/lib/Composer/vendor/psr/http-factory/.gitignore create mode 100644 include/lib/Composer/vendor/psr/http-factory/.pullapprove.yml create mode 100644 include/lib/Composer/vendor/psr/http-factory/LICENSE create mode 100644 include/lib/Composer/vendor/psr/http-factory/README.md create mode 100644 include/lib/Composer/vendor/psr/http-factory/composer.json create mode 100644 include/lib/Composer/vendor/psr/http-factory/src/RequestFactoryInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-factory/src/ResponseFactoryInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-factory/src/ServerRequestFactoryInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-factory/src/StreamFactoryInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-factory/src/UriFactoryInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-message/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/psr/http-message/LICENSE create mode 100644 include/lib/Composer/vendor/psr/http-message/README.md create mode 100644 include/lib/Composer/vendor/psr/http-message/composer.json create mode 100644 include/lib/Composer/vendor/psr/http-message/src/MessageInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-message/src/RequestInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-message/src/ResponseInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-message/src/ServerRequestInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-message/src/StreamInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-message/src/UploadedFileInterface.php create mode 100644 include/lib/Composer/vendor/psr/http-message/src/UriInterface.php create mode 100644 include/lib/Composer/vendor/psr/log/LICENSE create mode 100644 include/lib/Composer/vendor/psr/log/README.md create mode 100644 include/lib/Composer/vendor/psr/log/composer.json create mode 100644 include/lib/Composer/vendor/psr/log/src/AbstractLogger.php create mode 100644 include/lib/Composer/vendor/psr/log/src/InvalidArgumentException.php create mode 100644 include/lib/Composer/vendor/psr/log/src/LogLevel.php create mode 100644 include/lib/Composer/vendor/psr/log/src/LoggerAwareInterface.php create mode 100644 include/lib/Composer/vendor/psr/log/src/LoggerAwareTrait.php create mode 100644 include/lib/Composer/vendor/psr/log/src/LoggerInterface.php create mode 100644 include/lib/Composer/vendor/psr/log/src/LoggerTrait.php create mode 100644 include/lib/Composer/vendor/psr/log/src/NullLogger.php create mode 100644 include/lib/Composer/vendor/ralouphie/getallheaders/LICENSE create mode 100644 include/lib/Composer/vendor/ralouphie/getallheaders/README.md create mode 100644 include/lib/Composer/vendor/ralouphie/getallheaders/composer.json create mode 100644 include/lib/Composer/vendor/ralouphie/getallheaders/src/getallheaders.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/.github/workflows/ci.yml create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/.gitignore create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/LICENSE create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/README.md create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/composer.json create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/phpunit.xml.dist create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Handshake/ClientNegotiator.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Handshake/InvalidPermessageDeflateOptionsException.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Handshake/PermessageDeflateOptions.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Handshake/RequestVerifier.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Handshake/ResponseVerifier.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Messaging/CloseFrameChecker.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Messaging/DataInterface.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Messaging/Frame.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Messaging/FrameInterface.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Messaging/Message.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/src/Messaging/MessageInterface.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/AbResultsTest.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/clientRunner.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/docker_bootstrap.sh create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/fuzzingclient.json create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/fuzzingclient_skip_deflate.json create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/fuzzingserver.json create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/fuzzingserver_skip_deflate.json create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/run_ab_tests.sh create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/ab/startServer.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/bootstrap.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/unit/Handshake/PermessageDeflateOptionsTest.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/unit/Handshake/RequestVerifierTest.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/unit/Handshake/ResponseVerifierTest.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/unit/Handshake/ServerNegotiatorTest.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageBufferTest.php create mode 100644 include/lib/Composer/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageTest.php create mode 100644 include/lib/Composer/vendor/react/cache/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/react/cache/LICENSE create mode 100644 include/lib/Composer/vendor/react/cache/README.md create mode 100644 include/lib/Composer/vendor/react/cache/composer.json create mode 100644 include/lib/Composer/vendor/react/cache/src/ArrayCache.php create mode 100644 include/lib/Composer/vendor/react/cache/src/CacheInterface.php create mode 100644 include/lib/Composer/vendor/react/dns/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/react/dns/LICENSE create mode 100644 include/lib/Composer/vendor/react/dns/README.md create mode 100644 include/lib/Composer/vendor/react/dns/composer.json create mode 100644 include/lib/Composer/vendor/react/dns/src/BadServerException.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Config/Config.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Config/HostsFile.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Model/Message.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Model/Record.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Protocol/BinaryDumper.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Protocol/Parser.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/CachingExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/CancellationException.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/CoopExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/ExecutorInterface.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/FallbackExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/HostsFileExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/Query.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/RetryExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/SelectiveTransportExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/TcpTransportExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/TimeoutException.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/TimeoutExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Query/UdpTransportExecutor.php create mode 100644 include/lib/Composer/vendor/react/dns/src/RecordNotFoundException.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Resolver/Factory.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Resolver/Resolver.php create mode 100644 include/lib/Composer/vendor/react/dns/src/Resolver/ResolverInterface.php create mode 100644 include/lib/Composer/vendor/react/event-loop/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/react/event-loop/LICENSE create mode 100644 include/lib/Composer/vendor/react/event-loop/README.md create mode 100644 include/lib/Composer/vendor/react/event-loop/composer.json create mode 100644 include/lib/Composer/vendor/react/event-loop/src/ExtEvLoop.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/ExtEventLoop.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/ExtLibevLoop.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/ExtLibeventLoop.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/ExtUvLoop.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/Factory.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/Loop.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/LoopInterface.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/SignalsHandler.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/StreamSelectLoop.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/Tick/FutureTickQueue.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/Timer/Timer.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/Timer/Timers.php create mode 100644 include/lib/Composer/vendor/react/event-loop/src/TimerInterface.php create mode 100644 include/lib/Composer/vendor/react/promise-timer/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/react/promise-timer/LICENSE create mode 100644 include/lib/Composer/vendor/react/promise-timer/README.md create mode 100644 include/lib/Composer/vendor/react/promise-timer/composer.json create mode 100644 include/lib/Composer/vendor/react/promise-timer/src/TimeoutException.php create mode 100644 include/lib/Composer/vendor/react/promise-timer/src/functions.php create mode 100644 include/lib/Composer/vendor/react/promise-timer/src/functions_include.php create mode 100644 include/lib/Composer/vendor/react/promise/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/react/promise/LICENSE create mode 100644 include/lib/Composer/vendor/react/promise/README.md create mode 100644 include/lib/Composer/vendor/react/promise/composer.json create mode 100644 include/lib/Composer/vendor/react/promise/src/CancellablePromiseInterface.php create mode 100644 include/lib/Composer/vendor/react/promise/src/CancellationQueue.php create mode 100644 include/lib/Composer/vendor/react/promise/src/Deferred.php create mode 100644 include/lib/Composer/vendor/react/promise/src/Exception/LengthException.php create mode 100644 include/lib/Composer/vendor/react/promise/src/ExtendedPromiseInterface.php create mode 100644 include/lib/Composer/vendor/react/promise/src/FulfilledPromise.php create mode 100644 include/lib/Composer/vendor/react/promise/src/LazyPromise.php create mode 100644 include/lib/Composer/vendor/react/promise/src/Promise.php create mode 100644 include/lib/Composer/vendor/react/promise/src/PromiseInterface.php create mode 100644 include/lib/Composer/vendor/react/promise/src/PromisorInterface.php create mode 100644 include/lib/Composer/vendor/react/promise/src/RejectedPromise.php create mode 100644 include/lib/Composer/vendor/react/promise/src/UnhandledRejectionException.php create mode 100644 include/lib/Composer/vendor/react/promise/src/functions.php create mode 100644 include/lib/Composer/vendor/react/promise/src/functions_include.php create mode 100644 include/lib/Composer/vendor/react/socket/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/react/socket/LICENSE create mode 100644 include/lib/Composer/vendor/react/socket/README.md create mode 100644 include/lib/Composer/vendor/react/socket/composer.json create mode 100644 include/lib/Composer/vendor/react/socket/src/Connection.php create mode 100644 include/lib/Composer/vendor/react/socket/src/ConnectionInterface.php create mode 100644 include/lib/Composer/vendor/react/socket/src/Connector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/ConnectorInterface.php create mode 100644 include/lib/Composer/vendor/react/socket/src/DnsConnector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/FdServer.php create mode 100644 include/lib/Composer/vendor/react/socket/src/FixedUriConnector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/HappyEyeBallsConnectionBuilder.php create mode 100644 include/lib/Composer/vendor/react/socket/src/HappyEyeBallsConnector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/LimitingServer.php create mode 100644 include/lib/Composer/vendor/react/socket/src/SecureConnector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/SecureServer.php create mode 100644 include/lib/Composer/vendor/react/socket/src/Server.php create mode 100644 include/lib/Composer/vendor/react/socket/src/ServerInterface.php create mode 100644 include/lib/Composer/vendor/react/socket/src/SocketServer.php create mode 100644 include/lib/Composer/vendor/react/socket/src/StreamEncryption.php create mode 100644 include/lib/Composer/vendor/react/socket/src/TcpConnector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/TcpServer.php create mode 100644 include/lib/Composer/vendor/react/socket/src/TimeoutConnector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/UnixConnector.php create mode 100644 include/lib/Composer/vendor/react/socket/src/UnixServer.php create mode 100644 include/lib/Composer/vendor/react/stream/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/react/stream/LICENSE create mode 100644 include/lib/Composer/vendor/react/stream/README.md create mode 100644 include/lib/Composer/vendor/react/stream/composer.json create mode 100644 include/lib/Composer/vendor/react/stream/src/CompositeStream.php create mode 100644 include/lib/Composer/vendor/react/stream/src/DuplexResourceStream.php create mode 100644 include/lib/Composer/vendor/react/stream/src/DuplexStreamInterface.php create mode 100644 include/lib/Composer/vendor/react/stream/src/ReadableResourceStream.php create mode 100644 include/lib/Composer/vendor/react/stream/src/ReadableStreamInterface.php create mode 100644 include/lib/Composer/vendor/react/stream/src/ThroughStream.php create mode 100644 include/lib/Composer/vendor/react/stream/src/Util.php create mode 100644 include/lib/Composer/vendor/react/stream/src/WritableResourceStream.php create mode 100644 include/lib/Composer/vendor/react/stream/src/WritableStreamInterface.php create mode 100644 include/lib/Composer/vendor/symfony/deprecation-contracts/.gitignore create mode 100644 include/lib/Composer/vendor/symfony/deprecation-contracts/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/symfony/deprecation-contracts/LICENSE create mode 100644 include/lib/Composer/vendor/symfony/deprecation-contracts/README.md create mode 100644 include/lib/Composer/vendor/symfony/deprecation-contracts/composer.json create mode 100644 include/lib/Composer/vendor/symfony/deprecation-contracts/function.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/AcceptHeader.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/AcceptHeaderItem.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/BinaryFileResponse.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Cookie.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Exception/BadRequestException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Exception/JsonException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Exception/RequestExceptionInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Exception/SuspiciousOperationException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/ExpressionRequestMatcher.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/ExtensionFileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/FileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/IniSizeFileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/NoFileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/NoTmpDirFileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/PartialFileException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Exception/UploadException.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/File.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/Stream.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/File/UploadedFile.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/FileBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/HeaderBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/HeaderUtils.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/InputBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/IpUtils.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/JsonResponse.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/LICENSE create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/ParameterBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/README.md create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/RateLimiter/AbstractRequestRateLimiter.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/RateLimiter/RequestRateLimiterInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/RedirectResponse.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Request.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/RequestMatcher.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/RequestMatcherInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/RequestStack.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Response.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/ResponseHeaderBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/ServerBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Flash/FlashBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Session.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/SessionBagInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/SessionBagProxy.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/SessionFactory.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/SessionFactoryInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/SessionInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/SessionUtils.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/IdentityMarshaller.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/StreamedResponse.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/UrlHelper.php create mode 100644 include/lib/Composer/vendor/symfony/http-foundation/composer.json create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/LICENSE create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/Mbstring.php create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/README.md create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/bootstrap.php create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/bootstrap80.php create mode 100644 include/lib/Composer/vendor/symfony/polyfill-mbstring/composer.json create mode 100644 include/lib/Composer/vendor/symfony/routing/Alias.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Annotation/Route.php create mode 100644 include/lib/Composer/vendor/symfony/routing/CHANGELOG.md create mode 100644 include/lib/Composer/vendor/symfony/routing/CompiledRoute.php create mode 100644 include/lib/Composer/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/ExceptionInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/InvalidArgumentException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/InvalidParameterException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/MethodNotAllowedException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/MissingMandatoryParametersException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/NoConfigurationException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/ResourceNotFoundException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/RouteCircularReferenceException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/RouteNotFoundException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Exception/RuntimeException.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Generator/CompiledUrlGenerator.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Generator/ConfigurableRequirementsInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Generator/Dumper/CompiledUrlGeneratorDumper.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Generator/Dumper/GeneratorDumperInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Generator/UrlGenerator.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Generator/UrlGeneratorInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/LICENSE create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/AnnotationClassLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/AnnotationFileLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/ClosureLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/AliasConfigurator.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/Traits/HostTrait.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/Traits/LocalizedRouteTrait.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/Traits/PrefixTrait.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/ContainerLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/DirectoryLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/GlobFileLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/ObjectLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/PhpFileLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/XmlFileLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/YamlFileLoader.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/CompiledUrlMatcher.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherDumper.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/Dumper/CompiledUrlMatcherTrait.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/Dumper/MatcherDumperInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/ExpressionLanguageProvider.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/RequestMatcherInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/UrlMatcher.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Matcher/UrlMatcherInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/README.md create mode 100644 include/lib/Composer/vendor/symfony/routing/RequestContext.php create mode 100644 include/lib/Composer/vendor/symfony/routing/RequestContextAwareInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Route.php create mode 100644 include/lib/Composer/vendor/symfony/routing/RouteCollection.php create mode 100644 include/lib/Composer/vendor/symfony/routing/RouteCompiler.php create mode 100644 include/lib/Composer/vendor/symfony/routing/RouteCompilerInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/Router.php create mode 100644 include/lib/Composer/vendor/symfony/routing/RouterInterface.php create mode 100644 include/lib/Composer/vendor/symfony/routing/composer.json create mode 100644 include/lib/htmlpurifier-4.15.0.zip create mode 100644 include/system/api/v1/routes/add_customer.php create mode 100644 include/system/api/v1/routes/edit_customer.php create mode 100644 module/invoice/invoicePrintDetailsView.php create mode 100644 module/invoice/loanPaymentReceipt.php delete mode 100644 module/invoice/posSaleView_Back_08-11-2021.php create mode 100644 module/invoice/purchaseDetailsInvoice.php create mode 100644 module/marketing/add-specimen-copy.php create mode 100644 module/marketing/ajax.php create mode 100644 module/marketing/edit-specimen-copy.php create mode 100644 module/marketing/institute-list.php create mode 100644 module/marketing/introductory.php create mode 100644 module/marketing/lead-statistics.php create mode 100644 module/marketing/new-sc-distribution.php create mode 100644 module/marketing/overview.php create mode 100644 module/marketing/person-list.php create mode 100644 module/marketing/specimen-copies.php create mode 100644 module/marketing/specimen-copy-distributions.php create mode 100644 module/reports/ajax_back.php create mode 100644 module/reports/income-report.php create mode 100644 module/sales/discounts.php delete mode 100644 theme/rui/invoice-print_old.php diff --git a/assets/.htaccess b/assets/.htaccess index 44a2c3b..978adfc 100644 --- a/assets/.htaccess +++ b/assets/.htaccess @@ -12,7 +12,7 @@ # Allow Javascript, css and images - + Allow from all diff --git a/assets/cron/backup_db.sh b/assets/cron/backup_db.sh new file mode 100644 index 0000000..34c0089 --- /dev/null +++ b/assets/cron/backup_db.sh @@ -0,0 +1,2 @@ +#!/bin/bash +mysqldump -u root -p'Dminp@s$4' mycom > /media/royall/70D4CB5DD4CB2466/db_$( date +"%d_%m_%Y__%H_%M" ).sql \ No newline at end of file diff --git a/assets/cron/downloadData.bat b/assets/cron/downloadData.bat new file mode 100644 index 0000000..80d310e --- /dev/null +++ b/assets/cron/downloadData.bat @@ -0,0 +1 @@ +E:\xampp\htdocs\royal\assets\curl\bin\curl.exe http://192.168.0.133/royal/api/v1/?action=downloadData \ No newline at end of file diff --git a/assets/cron/sms.sh b/assets/cron/sms.sh new file mode 100644 index 0000000..112a532 --- /dev/null +++ b/assets/cron/sms.sh @@ -0,0 +1,4 @@ +#!/bin/bash +adb shell am start -a android.intent.action.SENDTO -d sms:01934333221 --es sms_body "SMS BODY GOES HERE" --ez exit_on_sent true +adb shell input keyevent 22 +adb shell input keyevent 66 \ No newline at end of file diff --git a/assets/cron/uploadData.bat b/assets/cron/uploadData.bat new file mode 100644 index 0000000..43d821c --- /dev/null +++ b/assets/cron/uploadData.bat @@ -0,0 +1 @@ +E:\xampp\htdocs\royal\assets\curl\bin\curl.exe http://192.168.0.133/royal/api/v1/?action=uploadData \ No newline at end of file diff --git a/assets/js/bms.js b/assets/js/bms.js new file mode 100644 index 0000000..b041a24 --- /dev/null +++ b/assets/js/bms.js @@ -0,0 +1,3592 @@ +"use strict"; + +// Create the BMS Namespace if it doesn't exists +var BMS = BMS || {}; +var updateSDPTimeout; + +BMS.FUNCTIONS = { + + getDateTime: function() { + var date = new Date(); + return date.getFullYear() + "-" + date.getMonth() + "-" + date.getDay() + "-" + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); + }, + + calculateDiscount: function(amount, discount=null) { + + if(discount === "" || discount === null || discount === 'null' || discount === 0) { + + return parseFloat(Number(amount)); + + } else if( typeof discount === 'string' && discount.indexOf("%") > 0 ) { + + // For parcantage discount + return parseFloat(Number(amount) - (Number(discount.replace("%",""))/100) * Number(amount)); + + } else { + + // For Fixed Discount + return parseFloat(Number(amount) - Number(discount)); + + } + + }, + + calculateTarifCharges: function(amount, discount = null) { + + if(discount === "" || discount === null || discount === 'null' || discount === 0) { + + return 0.00; + + } else if (typeof discount === 'string' && discount.indexOf("%") > 0) { + + // For parcantage discount + return ((Number(discount.replace("%", "")) / 100) * Number(amount)).toFixed(2); + + } else { + + // For Fixed Discount + return (Number(discount)).toFixed(2); + + } + + }, + + datePicker: function({selector=".datePicker", format="YYYY-MM-DD", timePicker= false}="") { + + $(selector).daterangepicker({ + autoUpdateInput: false, + singleDatePicker: true, + showDropdowns: true, + timePicker: timePicker, + timePicker24Hour: true, + autoApply: true, + parentEl: "div.dynamic-container", + drops: "auto", + locale:{ + format: format, + cancelLabel: 'Clear' + } + }); + + // Apply the date + $(selector).on('apply.daterangepicker', function(ev, picker) { + + $(this).val(picker.startDate.format(format)); + + }); + + // clear the date + $(selector).on('cancel.daterangepicker', function(ev, picker){ + + $(this).val(''); + + }); + + }, + + + dateRangePicker: function({selector=".dateRangePicker", format="YYYY-MM-DD", timePicker= false}="") { + + $(selector).daterangepicker({ + autoUpdateInput: false, + showDropdowns: true, + drops: "auto", + linkedCalendars: false, + timePicker: timePicker, + timePicker24Hour: true, + parentEl: "div.dynamic-container", + locale: { + format: format, + cancelLabel: 'Clear' + } + }); + + // Apply the date + $(selector).on('apply.daterangepicker', function(ev, picker) { + + $(this).val(picker.startDate.format(format) + ' - ' + picker.endDate.format(format)); + + }); + + // clear the date + $(selector).on('cancel.daterangepicker', function(ev, picker){ + + $(this).val(''); + + }); + + }, + + dateRangePickerPreDefined: function({selector=".dateRangePickerPreDefined", format="YYYY-MM-DD", timePicker= false, ranges = {}}="") { + + $(selector).daterangepicker({ + autoUpdateInput: false, + showDropdowns: true, + drops: "auto", + alwaysShowCalendars: true, + linkedCalendars: false, + timePicker: timePicker, + timePicker24Hour: true, + parentEl: "div.dynamic-container", + locale: { + format: format, + cancelLabel: 'Clear' + }, + ranges : Object.keys(ranges).length > 0 ? ranges : { + 'Today' : [moment(), moment()], + 'This Month' : [moment().startOf('month'), moment().endOf('month')], + 'Last Month' : [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')], + 'This Year' : [moment().startOf('year'), moment().endOf('year')], + 'Last Year' : [moment().subtract(1, 'year').startOf('year'), moment().subtract(1, 'year').endOf('year')], + 'All' : [moment(0), moment().subtract('year').endOf('day')], + } + + }); + + // Apply the date + $(selector).on('apply.daterangepicker', function(ev, picker) { + + $(this).val(picker.startDate.format(format) + ' - ' + picker.endDate.format(format)); + + }); + + // clear the date + $(selector).on('cancel.daterangepicker', function(ev, picker){ + + $(this).val(''); + + }); + + }, + + multiDatePicker: function({selector=".multiDatePicker", format="yyyy-mm-dd"}="") { + + $(selector).datepicker({ + multidate: true, + multidateSeparator: ", ", + format: format, + todayHighlight: true + }); + + }, + + getCookie: function(name) { + + var cookie = decodeURIComponent(`; ${document.cookie}`).split(`; ${name}=`); + if(cookie.length > 1) return cookie[1].split("; ")[0]; + + }, + + copy: function(selector) { + + var element = $(selector); + element.select(); + //element.setSelectionRange(0, 99999); + + navigator.clipboard.write([ + + new ClipboardItem({ + 'text/html': new Blob( + [ + element.html() + ], + { + type: 'text/html' + } + ) + }) + + ]); + + }, + + // javascript number translation function + _n: function(number) { + + // Javascript language declaration + let currentLang = BMS.fn.getCookie("lang"); + + let langPack = { + "bn_BD": "bn-BD" + }; + + // Check if the language is set + if(currentLang !== undefined) { + return new Intl.NumberFormat(langPack[currentLang]).format(number); + } else { + return number; + } + + }, + + //** Create new item function when no item found on select2 search */ + createNewSelect2Item: function(selector) { + + var createNewUrl = $(selector).attr("select2-create-new-url"); + var searchValue = $(".select2-search__field").val(); + var searchValueEncode = encodeURIComponent(searchValue); + + console.log(selector); + + + /** Hide the select2 container */ + $('body').trigger('mousedown'); + + /** Open Create New modal by given url */ + $("#modalDefault").modal('show').find('.modal-content').load(createNewUrl+"&val="+ searchValueEncode); + + /** Select the select2 option after create new */ + $('#modalDefault').on('hidden.bs.modal', function(e) { + + BMS.fn.select2(selector, "", searchValue); + + }); + + }, + + play: function(toon, loop=false) { + + var url = `${full_website_address}/assets/sounds/${toon}.mp3`; + var audio = new window.Audio(url); + + $(document).on("pauseAudio", function() { + audio.pause(); + }); + + audio.loop = loop; + audio.play(); + + }, + + pause: function() { + $(document).trigger("pauseAudio"); + }, + + + startTimer(container="#timer") { + + var startTime = new Date().getTime(); + return setInterval(function() { + + var distance = new Date().getTime() - startTime; + + var totalSeconds = distance / 1000; + + var seconds = Math.floor( totalSeconds % 60 ).toString().padStart(2,0); + + var minutes = Math.floor( ( totalSeconds % 3600 ) / 60 ).toString().padStart(2,0); + + var hours = Math.floor( totalSeconds / 3600 ).toString().padStart(2,0); + + $(container).html(`${hours}:${minutes}:${seconds}`); + + }, 1000); + + + }, + + stopTimer: function(ele) { + + clearInterval(ele) + + }, + + /** + * + * @param {string} msg The msg we want to notific + */ + notify: function(msg) { + + Swal.fire({ + toast: true, + position: "top-right", + timer: 5000, + timerProgressBar: true, + iconHtml: '', + didOpen: (toast) => { + toast.addEventListener('mouseenter', Swal.stopTimer); + toast.addEventListener('mouseleave', Swal.resumeTimer); + this.play("beep"); + }, + title: ` ${msg} `, + showConfirmButton: false, + onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep. + + }); + + }, + + desktopNotify: function(title, icon="", body="") { + + if(Notification.permission !== "granted") { + + Notification.requestPermission(); + + } else { + + var notification = new Notification(title, { + icon: icon, + body: body + }); + + notification.onclick = function() { + window.focus(); + this.close(); + } + } + + }, + + alertError: function(msg) { + + Swal.fire({ + toast: true, + position: "top-right", + icon: "error", + timer: 5000, + timerProgressBar: true, + didOpen: (toast) => { + toast.addEventListener('mouseenter', Swal.stopTimer); + toast.addEventListener('mouseleave', Swal.resumeTimer); + this.play("warning"); + }, + title: ` ${msg} `, + showConfirmButton: false, + onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep. + + }); + + }, + + alertSuccess: function(msg, playSound=true) { + + Swal.fire({ + toast: true, + position: "top-right", + icon: "success", + timer: 5000, + timerProgressBar: true, + didOpen: (toast) => { + toast.addEventListener('mouseenter', Swal.stopTimer); + toast.addEventListener('mouseleave', Swal.resumeTimer); + playSound && this.play("warning"); + }, + title: ` ${msg} `, + showConfirmButton: false, + onClose: $("body").css('padding', '0px') // This is because, while close the sweet alert a 15px padding-right is keep. + + }); + + }, + + dTable: function(selector) { + + + // Check if the DataTableAjaxPostUrl is undefined + var DataTableAjaxDataUrl = ""; + if(typeof $(selector).attr("dt-data-url") !== "undefined") { + DataTableAjaxDataUrl = $(selector).attr("dt-data-url"); + } else { + DataTableAjaxDataUrl = DataTableAjaxPostUrl; + } + + // Disable on type search + var disableOnTypeSearch = true; + if(typeof $(selector).attr("dt-disable-on-type-search") !== "undefined") { + disableOnTypeSearch = false; + } + + + // Set the default ordering of datatable + var DtDefaultOrder = ($(".defaultOrder").html() !== undefined) ? [ [ $('th.defaultOrder').index(), 'desc' ] ] : [1, 'desc']; + var iDisplayLength = (typeof defaultiDisplayLength !== 'undefined') ? defaultiDisplayLength : 15; + var dtHeight = (typeof $(selector).attr("dt-height") !== 'undefined') ? $(selector).attr("dt-height") : "60vh"; + + var getDataTable = $(selector).DataTable({ + "processing": true, + "serverSide": true, + "responsive": true, + "scrollX": true, + "scrollY": dtHeight, + "scrollCollapse": true, + "stateSave": true, + "search" : { + return: true, + }, + initComplete: function(settings, json) { + + if(disableOnTypeSearch) { + + var api = new $.fn.dataTable.Api( settings ); + + $('.dataTables_filter input').unbind(); + $('.dataTables_filter input').bind('keyup', function(e){ + var code = e.keyCode || e.which; + if (code == 13) { + api.search(this.value).draw(); + } + }); + + } + + }, + "stateSaveParams": function(settings, data) { + + var api = this.api(); + + // Disable search, order and length in stateSave + data.search.search = ""; + data.length = 15; + data.order = DtDefaultOrder; + + // Set the select text on filter + data.columns.forEach( (item, i) => { + + var footer = api.column(i).footer(); + + var filterObject = $(footer).find("select"); + + if( filterObject.length > 0 ) { + + // Add option text in the state + data.columns[i].search.text = $(filterObject).find(":selected").text(); + + } + + }); + + }, + "order": DtDefaultOrder, + // "searchCols": preFilter, + "select": { + "style" : "multi+shift", + "selector": 'td:first-child' + }, + language: Object.keys(language).length > 0 ? language : { + "processing": "Processing...", + }, + "aLengthMenu": [ + [15, 100, 500, 1500, 5000, -1], + [15, 100, 500, 1500, 5000, "All"] + ], + "iDisplayLength": iDisplayLength, + "ajax": { + url : DataTableAjaxDataUrl, // The URL is come from the table page. + type: "post" // Method, By default get. + }, + "columnDefs": [ + { + "targets": 'countTotal', + "className": 'text-right', + render: $.fn.dataTable.render.number( ',', '.', 2) + }, + { + "targets": 'highlightWithCountTotal', + "className": 'text-right highlight', + render: $.fn.dataTable.render.number( ',', '.', 2) + }, + { + "targets": 'text-right', + "className": 'text-right' + }, + { + "targets": 'sort', + "orderable": true, + "searchable": true + }, + { + "targets": 'no-sort', + "orderable": false + }, + { + "targets": 0, + "orderable": false, + "checkboxes": { + "selectRow": true + } + }, + + { + "targets": "px85", + "className": 'px85' + }, + { + "targets": "px120", + "className": 'px120' + }, + { + "targets": "px160", + "className": 'px160' + }, + { + "targets": "px180", + "className": 'px180' + }, + { + "targets": "px200", + "className": 'px200' + }, + { + "targets": "px220", + "className": 'px220' + }, + { + "targets": "px320", + "className": 'px320' + }, + { + "visible": false, + "targets": 'hideit' + }, + { + "targets": "dtDescription", + "className": "dtDescription" + }, + { + "targets": "highlight", + "className": "highlight" + } + + ], + + // Total Sum by Column + "footerCallback": function(row, data, start, end, display) { + + var api = this.api(); + + api.columns('.countTotal, .highlightWithCountTotal', { + page: 'current' + }).every(function() { + var sum = this + .data() + .reduce(function(a, b) { + var x = parseFloat(a) || 0; + var y = parseFloat(b) || 0; + return x + y; + }, 0); + //console.log(BMS.fn._n(sum)); //alert(sum); + $(this.footer()).html(sum.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,')); + }); + + } + + }); + + + // Get all states + var loadedState = getDataTable.state.loaded(); + + // Check if the state is exists for current page + loadedState = loadedState !== null ? loadedState.columns : undefined; + + getDataTable.columns().every( function (index) { + + var that = this; + + var filterObject = $( 'select, textarea, input:not(.notThisValueFilter)', this.footer() ); + + // Check if there is state and any of input, select or textarea is exist + if( loadedState !== undefined && filterObject.length > 0 ) { + + var val = loadedState[index].search.search; + var text = loadedState[index].search.text !== undefined ? loadedState[index].search.text : ""; + + // if the element is html select + if(filterObject[0].nodeName === "SELECT") { + + /// remove the element if its exist + $(filterObject).find("option[value='"+ val +"']").remove(); + + $(filterObject).append( $(``) ); + + + } else { + + $(filterObject).val( val ); + + } + + } + + + // filter on changes + $( 'input, select, textarea', this.footer() ).on( 'enter change clear apply.daterangepicker cancel.daterangepicker', function () { + + /** For not search value. + * + * Suppose we want to search all employee except past. + * So the mechanism is here + */ + var notSearch = $(this).closest("th").find(".notThisValueFilter"); + + var search; + if( notSearch.length > 0 && $(notSearch).val() === "!=" && this.value !== "") { + + search = JSON.stringify({ + "operator": "!=", + "search":this.value + }); + + } else { + search = this.value; + } + + if ( that.search() !== this.value ) { + that + .search( search ) + .draw(); + } + + + }); + + + }); + + var today = new Date(); + var date = `${today.getDate()}-${today.getMonth()+1}-${today.getFullYear()} ${today.getHours()}:${today.getMinutes()}:${today.getSeconds()}`; + + if( $(".printButtonPosition").length > 0 ) { + //begin export buttons + new $.fn.dataTable.Buttons( getDataTable, { + buttons: [ + { + extend: 'print', + text: ' ', + titleAttr: 'Print', + className: 'btn btn-default btn-sm', + messageTop: "Printed On: "+ date, + title: '', + footer: true, + autoPrint: true, + exportOptions: { + columns: ':visible:not(.no-print):not(.dt-checkboxes-cell)', + format : { + footer : function (data, column, row) { + + // If no print class exists then remove the whol html inside th + return ($(row).prop('outerHTML').indexOf("no-print") > 0) ? + data.replace(data, "") : + data; + } + } + }, + messageTop: function() { + // If the dt exprot message define then append it + if($("#DtExportTopMessage").html() !== undefined) { + return $("#DtExportTopMessage").html(); + } else { + return "

" + document.title + "


Printed On: "+ date +"


"; + } + } + }, + { + extend: 'copy', + text: ' ', + titleAttr: 'Copy', + className: 'btn btn-default btn-sm', + footer: true, + exportOptions: { + columns: ':visible:not(.no-print):not(.dt-checkboxes-cell)', + format : { + footer : function (data, column, row) { + + // If no print class exists then remove the whol html inside th + return ($(row).prop('outerHTML').indexOf("no-print") > 0) ? + data.replace(data, "") : + data; + } + } + } + }, + + { + extend: 'excel', + text: ' ', + titleAttr: 'Excel', + className: 'btn btn-default btn-sm', + footer: true, + exportOptions: { + columns: ':visible:not(.no-print):not(.dt-checkboxes-cell)', + format : { + footer : function (data, column, row) { + + // If no print class exists then remove the whol html inside th + return ($(row).prop('outerHTML').indexOf("no-print") > 0) ? + data.replace(data, "") : + data; + } + } + }, + messageTop: function() { + // If the dt exprot message define then append it + if($("#DtExportTopMessage").html() !== undefined) { + return $("#DtExportTopMessage").html(); + } + } + }, + + { + extend: 'pdf', + text: ' ', + titleAttr: 'PDF', + className: 'btn btn-default btn-sm', + exportOptions: { + columns: ':visible:not(.no-print):not(.dt-checkboxes-cell)', + format : { + footer : function (data, column, row) { + + // If no print class exists then remove the whol html inside th + return ($(row).prop('outerHTML').indexOf("no-print") > 0) ? + data.replace(data, "") : + data; + } + } + }, + messageTop: function() { + // If the dt exprot message define then append it + if($("#DtExportTopMessage").html() !== undefined) { + return $("#DtExportTopMessage").html(); + } + } + }, + + { + extend: 'colvis', + text: ' ', + className: 'btn btn-default btn-sm', + collectionLayout: 'fixed' + } + + ] + + }); + + getDataTable.buttons().container().appendTo('.printButtonPosition'); + + } + + function format(data) { + + + // Get all column visibility states + var columnVisibleState = getDataTable.columns().visible(); + var childRowHtml = ''; //'
'; + + data.forEach((item) => { + + childRowHtml += ''; + + item.forEach((itemData, index) => { + + var headerClassName = getDataTable.columns().header()[index].className; + + // If the column is visible, then append the child column with row + childRowHtml += columnVisibleState[index] ? `${itemData}` : ''; + + }) + + childRowHtml += ''; + + }); + + + return $(childRowHtml).toArray(); + + } + + + // Collapsable row + // getDataTable + $('#dataTableWithAjaxExtend tbody').on("click", ".has-child-row", function() { + + var tr = $(this).closest("tr"); + var row = getDataTable.row(tr); + var parentProductId = $(this).attr("data-parent-product-id"); + var wid = $("#productReportWarehouseSelection").select2('data')[0].id; + + var itemName = $(this).text(); + var that = this; + + // If shown, then hide + if( row.child.isShown() ) { + + row.child.hide(); + tr.removeClass('shown'); + + } else { + + // Add loading/ spiner with product/item name + $(that).html(`${itemName} `); + + BMS.fn.get(`getChildProductData&pid=${parentProductId}&wid=${wid}`, function(data) { + + + if(data == 0) { + + BMS.fn.alertError("Sorry! no item found."); + + } else { + + // Show the child row + row.child( format( data ) ).show(); + tr.addClass('shown'); + + $('tr.childRow').fadeIn('slow'); + + } + + // Remove the spinner after loading child items/ products + $(that).html(`${itemName}`); + + }); + + } + + + }); + + }, + + select2: function(selector, optionVal="", optionText="") { + + // Get the url + var select2AjaxUrl = $(selector).attr("select2-ajax-url"); + var select2MinimumInputLength = $(selector).attr("select2-minimum-input-length"); + var tag = ($(selector).attr("select2-tag") === "true") ? true : false; + var closeOnSelect = ($(selector).attr("closeOnSelect") === "false") ? false : true; + var that = selector; + + /** + * For creating create new button + */ + var noResults = ""; + if ( $(selector).attr("select2-create-new-url") === undefined ) { + + noResults = ""; + + } else { + + noResults = ` `; + + } + + + // While enter open the new bath window + $(document).on("keyup", ".select2-search__field", function(event) { + + if(event.key === "Enter") { + $(".createNewSelect2Item").click(); + } + + }); + + // Initialize Select Ajax Elements + var select2 = $(selector).select2({ + placeholder: ($(selector).children('option:first').html()) ? $(selector).children('option:first').html() : "Select Options", // Get the first option as placeholder + allowClear: true, + closeOnSelect:closeOnSelect, + tags: tag, + minimumInputLength: select2MinimumInputLength, + language: { + noResults: function() { + return noResults; + } + }, + escapeMarkup: function(markup) { + return markup; + }, + ajax: { + url: select2AjaxUrl, + dataType: "json", + delay: 400, + processResults: function (data) { + return { + results: data + }; + }, + cache: true + }, + templateResult: function(state) { + + if(!state.id) { + return state.text; + } + + + if (typeof state.text === "object" ) { + + var results = state.text; + var resultsHtml = ""; + resultsHtml +=`
+
${results[0]}
+
Cost
+
Price
+
Stock
+
Brand
+
+ `; + resultsHtml += `
+
${results[1]}
+
${results[2]}
+
${results[3]}
+
${results[4]}
+
${results[5]}
+
+ `; + + return resultsHtml; + + + } else { + + return state.text; + + } + + } + + }) + + + /** + ***************************************** + * Set the default value for select2 ajax + ***************************************** + * + * Check if the optionVal is not empty and + * the previous selected value is not same with current + */ + if( optionText !== "" && optionVal === "" ) { + + /** + * If do not know the id/value of select2 option then, + * search and select from database + */ + $.ajax({ + type: 'get', + url: select2AjaxUrl +"&q=" + optionText + }).then(function(data) { + + var data = JSON.parse(data)[0]; + + if(data !== undefined) { + + var newOption = new Option(data.text, data.id, true, true); + select2.append(newOption).trigger('change'); + + } + + }); + + } else if( optionVal !== "" && select2.find(':selected').val() !== optionVal ) { + + /** + * If we know the id/value + * Set the default value */ + var newOption = new Option(optionText, optionVal, true, true); + select2.append(newOption).trigger('change'); + + } + + }, + + get: function(target, returnData) { + + // Send ajax Request and return the data + $.ajax({ + url: full_website_address + `/info/?module=data&page=${target}`, + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function (data, status) { + returnData(data); + }, + error: function() { + returnData(""); + } + }); + + } + +}, + +// create alias +BMS.fn = BMS.FUNCTIONS, + +BMS.MAIN = { + + printPage: function(sURL, event, afterPrintOrCancel= function(){}) { + + event.preventDefault(); + + // Remove previous iframe if there is any + $(".dynamic-container > iframe").remove(); + + var oHideFrame = document.createElement("iframe"); + oHideFrame.onload = function() { + + //** this onafterprint event not working in iframe currently */ + + // this.contentWindow.onbeforeunload = function() { + // $(".dynamic-container > iframe").remove(); + // afterPrintOrCancel(true); + // }; + // this.contentWindow.onafterprint = function() { + // $(".dynamic-container > iframe").remove(); + // afterPrintOrCancel(true); + // }; + + this.contentWindow.focus(); // Required for IE + this.contentWindow.print(); + + afterPrintOrCancel(true); + + }; + oHideFrame.style.position = "fixed"; + oHideFrame.style.right = "0"; + oHideFrame.style.bottom = "0"; + oHideFrame.style.width = "0"; + oHideFrame.style.height = "0"; + oHideFrame.style.border = "0"; + oHideFrame.src = sURL; + $(".dynamic-container").append(oHideFrame); + + }, + + addTariffChargesRow: function(container) { + + $(container).append( + `

+
+ +
+
+ +
+
+ +
+
` + ); + + } + + +}, + +BMS.PRODUCT = { + + /** + * + * @param {int} product_id The product to check + * @param {string} whereToCheck Optional! The container where to check the product is exists + */ + isExists: function(product_id, whereToCheck=".productID") { + + return $(whereToCheck).filter(function() { return this.value === product_id; }).length > 0; + + }, + + /** + * + * @param {object} product The parent product details object + * @param {object} location In which target the addProduct function will actiavted. Eg: BMS.POS.addProduct() or BMS.PURCHASE.addProduct() + * @param {object} returnData The child product details object + * @returns + */ + validationCheck: function(product, location, returnData) { + + /* Check if the product already in the list + if (this.isExists(product.pid) && !confirm(`The product (${product.pn}) is already in the list. Do you want to add it again?`)) { + return; + } */ + + if (this.isExists(product.pid)) { + return alert(`The product (${product.pn}) is already in the list.`) + } + + /** check if there has product variation */ + if( product.pv !== undefined ) { + + /** Generate product variation selection html */ + var variationsHtml = ""; + var variationList = {}; + var defaultVariation = [] + var productids = {}; + + /** + * mk = meta key + * mv = meta value + */ + $.each(product.pv, function(key, variation) { + + if ( !Array.isArray(variationList[variation.mk]) ) { + + variationList[variation.mk] = [variation.mv]; + + } else if( !variationList[variation.mk].includes(variation.mv) ) { + + variationList[variation.mk].push(variation.mv); + + } + + if( variation.t === "DV" ) { + + defaultVariation.push(variation.mv); + + } else { + + if ( !Array.isArray( productids[variation.id]) ) { + + productids[variation.id] = [variation.mv]; + + } else { + + productids[variation.id].push(variation.mv); + + } + + } + + }); + + + $.each(variationList, function(attribute, variations) { + + variationsHtml += `
+ +
+ +
+
`; + + }); + + Swal.fire({ + title: 'Select Variation', + html: 'for '+ product.pn +'

'+variationsHtml, + showCloseButton: true, + showCancelButton: true, + focusConfirm: false, + confirmButtonText: 'Ok' + }).then((result) => { + + // if confirmed then add the product + if(result.isConfirmed) { + + // Get the select variation + var getAttribution = $("#variationSelection select"); + var selectedVariation = []; + $.each(getAttribution, function(){ + + /** + * Check if the option is selected + * or if the selected value is not empty + */ + if( this.value !== "" ) { + + selectedVariation.push(this.value); + + } + + }); + + + // Find the product id based on selected variation + var getPid = ""; + $.each(productids, function(key, val) { + + + if(selectedVariation.every( ai => val.includes(ai) ) ) { + + getPid = key; + return false; + + } + + + }); + + /** Check if the product id is not empty or selected variation is not empty */ + if(getPid === "" || selectedVariation.length === 0 ) { + + Swal.fire("Sorry! no product found"); + + } else { + + location.addProduct(getPid); + + } + + } + + }); + + } else { + + // Return the product + return returnData(product); + + } + + }, + + parseProductList: function( {category='', brand='', edition='', generic='', author=''}, returnData ) { + + // Parse product list and return + $.ajax({ + url: full_website_address + `/info/?module=data&page=productList&catId=${category}&brand=${brand}&edition=${edition}&generic=${generic}&author=${author}`, + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function (data, status) { + returnData(data); + } + }); + + }, + + showProduct: function({container='#productListContainer', category='', brand='', edition='', generic='', author=''}='' ) { + + this.parseProductList({ + category:category, + brand:brand, + edition:edition, + generic:generic, + author:author + }, productData => { + + // if no product found then display the error msg + if(productData == null) { + $(container).html("
Sorry! No products found in this criteria.
"); + return; + } + + var productHtml = ""; + productData.forEach(product => { + + var productPhoto = full_website_address; + if( product.v && product.v > 0 ) { + productPhoto += "/images/?for=products&id="+ product.id +"&q=YTozOntzOjI6Iml3IjtpOjIwMDtzOjI6ImloIjtpOjIyMDtzOjI6ImlxIjtpOjcwO30="+"&v="+ product.v; + } else { + productPhoto += "/assets/images/noimage.png"; + } + + productHtml += " \ + "; + }); + + // Now all the products display in the products container + $(container).html(productHtml); + + }); + + }, + + getDetails: function(product_id, returnData) { + + // Parse product list and return + $.ajax({ + url: full_website_address + `/info/?module=data&page=productDetails&product_id=${product_id}`, + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function (data, status) { + returnData(data); + } + }); + + }, + + addProduct: function(product_id="", isScanner=false) { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + + if (productId === "") { + alert("Please select a product"); + return; + } + + // Get product details + this.getDetails(productId, products => { + + products.forEach(eachProduct=> { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + /** Ignore batched/expiry product to adding in bundle/sub product */ + if(product.hed === "1") { + BMS.fn.alertError("Sorry! The product which have expiry date or batch number, can not be added in sub/bundle product."); + return; + } + + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + + var html = ` + + ${product.pn} + + ${product.pu} + + + + + `; + + $("#productTable > tbody").append(html); + + }); + + + + // This will not required. Becase we are removing the group product + /*if( $("#productType").val() === "Grouped") { + + // Hide price on grouped product + $(".gbProductPrice").hide(); + + }*/ + + /* remove the value from selectProduct select box */ + $('#selectProduct').empty(); + + }); + + // Select Quantity input field if not barcose scanner + if(isScanner === false) { + $(`#productTable > tbody tr:last`).find(".productQnt").select(); + } + + }); + + }, + + getListByGeneric: function(genericName) { + + /** + * Get Product list by + * initializing the select2 with default option + * + * Arguments: Selector, option value, Option text + * + */ + BMS.fn.select2("#productGenericFilter", genericName, genericName); + + }, + + productUnitCheck: function(selector) { + + this.getDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + unit: $(selector).val() + }, products => { + + // Change the sale price on unit change + $(selector).closest("tr").find(".productSalePrice").val(products[0]["sp"]); + + }); + + } + +}; + +BMS.POS = { + + clearScreen: function() { + + $(".dynamic-container").slideUp(350, function() { + + // Set today date if it change + var date = new Date(); + $("#salesDate").val( date.toISOString().split('T')[0] ); + + // Remove tariff and Charges except first one + $("#tariffCharges .row").not('div:first').remove(); + + // Remove select2 tarrif and charges value + $(".tariffChargesName").val('').change(); + + // Remove Discount + //$("#orderDiscountValue").val("0"); + + // Remove all payment options and add new empty one + var paymentItemRow = `
+
+ + +
+
+ + +
+ +
+ + +
+
`; + + $(".paymentMethodBox").html(paymentItemRow); + + // remove order discount, paid amount and sales note value + $("#orderDiscountValue, #shippingCharge, .posSalePaymentAmount, #adjustAmount, #salesNote").val(""); + + // Remove shippingChargeEdited from #shippingCharge + $("#shippingCharge").removeClass("shippingChargeEdited"); + + // Remove disablePaymentAmountAutoChange class From posSalePaymentAmount + $(".posSalePaymentAmount").removeClass("disablePaymentAmountAutoChange"); + + // Remove all product items + $("#productTable > tbody").html(""); + + // If the sale is edit then remove the salesId hidden input field and + // Add Hold & Confirm button in finalize sale modal + $("#editSalesId").remove(); + $("#payment .modal-footer").html(` + + + + + `); + + // Uncheck checked elements + $("input:radio, input:checkbox").prop("checked", false); + + // Initialize select2 set walk in customer and open the select2 + BMS.fn.select2("#customers", 1, "Walk-in Customer"); + // This features will use later + //$("#customers").select2('open'); + + + // Count the Total Quantity + BMS.POS.grandTotal(); + + // Disable the customer Selection and Warehouse selection if there have any product in the list + BMS.POS.disableEnableWCSelect(); + + }).slideDown(500); + + }, + + getProductDetails: function( {product_id, warehouse_id, customer_id="", qnt='', batch='', packet=''}, returnData ) { + + + // Parse product list and return + $.ajax({ + url: full_website_address + `/info/?module=data&page=productDetailsForPos&product_id=${product_id}&warehouse_id=${warehouse_id}&cid=${customer_id}&pqnt=${qnt}&batch=${batch}&packet=${packet}`, + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function (data, status) { + returnData(data); + } + }); + + }, + + disableEnableWCSelect: function() { + // WC = warehouse and Customer + if( $(".productQnt").length > 0) { + $("#customers, #warehouse").prop("disabled", true); + } else { + $("#customers, #warehouse").prop("disabled", false); + } + + }, + + grandTotal: function(event="") { + + var productQuantity = 0; + var productItem = 0; + $(".productQnt").each(function() { + productQuantity += Number($(this).val()); + productItem += 1; + }); + + // Display total product quantity and items + $(".totalItemAndQnt").html(productItem + ' (' + productQuantity + ')'); + + // Count Total Amount + var totalAmount = 0; + $(".subtotalCol").each( function() { + totalAmount += Number($(this).html()); + }); + + // Display Total amount + $(".totalAmount").html(totalAmount.toFixed(2)); + + + // Calculate the Discount + var orderDiscount = $("#orderDiscountValue").val(); + + var amountAfterDiscount = BMS.FUNCTIONS.calculateDiscount(totalAmount, orderDiscount); + + // Display the discount amount in the order discount field + $(".totalOrderDiscountAmount").html("(-) " + (totalAmount - amountAfterDiscount).toFixed(2)); + + // Calculate tarif and Charges + var totaltarifChargesAmount = 0; + $("#tariffCharges > .row").each(function() { + + var tarifChargesValue = $(this).closest(".row").find(".tariffChargesName").val().split(": ")[1]; + var tarifChargesAmount = BMS.FUNCTIONS.calculateTarifCharges(amountAfterDiscount, tarifChargesValue); + + $(this).closest(".row").find(".tariffChargesAmount").val(tarifChargesAmount); + totaltarifChargesAmount += Number(tarifChargesAmount); + + }); + + // Display the Tariff and Charges amount + $(".totalTariffChargesAmount").html("(+) " + (totaltarifChargesAmount).toFixed(2)); + + // check if the Finalize Sale window is open + if($("#payment").hasClass("in") === true) { + + // Calculate Shipping and display Shipping Charge if shipping input box is not focused + // and totalPackets or packetShipingRate is focused. + if( $("#shippingCharge").is(":focus") === false && ( $("#totalPackets").is(":focus") || $("#packetShippingRate").is(":focus") ) ) { + + var calculatShipping = $("#totalPackets").val() * $("#packetShippingRate").val(); + $("#shippingCharge").val(calculatShipping); + + } + + } else { + + // Count Total Packet + var totalPacket = 0; + $(".productPacket").each( function() { + totalPacket += Number($(this).val()); + }) + + // Display Packet + $(".displayTotalPackets").html( (totalPacket).toFixed(2) ); + $("#totalPackets").val( Math.round(totalPacket) ); + + // Calculate Shipping and display + var calculatShipping = $("#totalPackets").val() * $("#packetShippingRate").val(); + + // Display Shipping Charge + $("#shippingCharge").val(calculatShipping); + + } + + // Display the Net total + var calculateNetTotal = (Number(totaltarifChargesAmount) + Number(amountAfterDiscount)).toFixed(2); + $(".netTotalAmount").html(calculateNetTotal); + $("#finalizeSale > tbody > tr:nth-child(1) > td:nth-child(3)").html( calculateNetTotal ); + + // Get shipping + var shippingCharge = Number($("#shippingCharge").val()); + + // Calculate the grand total + var grandTotal = Number(calculateNetTotal) + shippingCharge; + + // Automatic adjust amount + if( config.posSaleAutoAdjustAmount === "1" ) { + + $("#adjustAmount:not(.disableAdjustAmountAutoChange)").val( parseFloat( parseFloat(grandTotal).toFixed() - grandTotal ).toFixed(2) ); + + } + + var adjustAmount = Number($("#adjustAmount").val()); + + // Calculate the grand total by minusing/suming adjust amount + var grandTotal = parseFloat( Number(calculateNetTotal) + shippingCharge + Number(adjustAmount) ).toFixed(2); + + // Add payable amount in paid amount box if the option posSaleAutoMarkAsPaid is enabled + if( config.posSaleAutoMarkAsPaid === "1" ) { + + // Calculate entered payment amount + var enteredPayment = sumInputs(".disablePaymentAmountAutoChange"); + + // calculating payable amount + var payableAmount = 0; + if( grandTotal > 0 && grandTotal > enteredPayment ) { + + // For positive grand total + payableAmount = grandTotal - enteredPayment; + + } else if( grandTotal < 0 && grandTotal < enteredPayment ) { + + // For negative grand total/return purpose + payableAmount = grandTotal - enteredPayment; + + } + + $(".posSalePaymentAmount:not(.disablePaymentAmountAutoChange)").first().val( parseFloat(payableAmount).toFixed(2) ); + + } + + + var paidAmount = sumInputs(".posSalePaymentAmount"); + var amountChange = (grandTotal < paidAmount) ? (paidAmount - grandTotal) : 0; + var amountDue = (grandTotal > paidAmount) ? (grandTotal - paidAmount) : 0; + + // Display the Grand Total, Due amount and change amount + $("#finalizeSale > tbody > tr:nth-child(4) > td:nth-child(2)").html( grandTotal ); + $("#finalizeSale > tbody > tr:nth-child(6) > td:nth-child(2)").html( amountChange ); + $("#finalizeSale > tbody > tr:nth-child(7) > td:nth-child(2)").html( amountDue ); + + // Display Quick Cash + $("#quickPayableAmount").html( grandTotal ); + + //console.log(grandTotal); + //console.log(paidAmount); + + // If paid amount is more then grand total and payment modal is opened + if( $("#payment").hasClass("in") === true && ( (grandTotal > 0 && grandTotal < paidAmount) || (grandTotal < 0 && grandTotal > paidAmount) ) ) { + + Swal.fire({ + title: "Paid amount can not be more then Grand total.", + icon: "error" + }); + + // Display the payable amount + $(".posSalePaymentAmount").last().val(0); + + } + + + }, + + + + editProductItemDetails: function(rowId, product_name) { + + // Display the product name on modal + $("#productSaleDetails .modal-title").html(product_name); + $("#productSaleDetails .rowId").val(rowId); + + // select product details row + var product_row = $(`#${rowId}`); + + $("#productSaleDetails #productSaleItemPrice").val( product_row.find(".netSalesPrice").val() ); + $("#productSaleDetails #productSaleItemDiscount").val( product_row.find(".productDiscount").val() ); + $("#productSaleDetails #productSaleItemPacket").val( product_row.find(".productPacket").val() ); + $("#productSaleDetails #productSaleItemDetails").val( product_row.find(".productItemDetails").val() ); + + }, + + + addProduct: function(product_id="", isScanner=false) { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + + if (productId === "") { + alert("Please select a product"); + return; + } + + // Remove/ empty the product selection input. + if($('#selectProduct').val() > 0) { + $("#selectProduct").html(""); + } + + // Get product details + this.getProductDetails({ + product_id: productId, + warehouse_id: $("#warehouseId").val(), + customer_id: $("#customersId").val() + }, products => { + + if(products["error"] !== undefined && products["error"] === true) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: products["msg"], + icon: "error" + }); + + return; + } + + // Loop throw Products + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var packet = 0; + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + if(product.pq > 0) { + packet = (itemQnt / Number(product.pq)).toFixed(2); + } + + // Check Discount + var productDiscount = !product.pd ? "0" : product.pd; + + // Generate Discount + var amountAfterDiscount = BMS.FUNCTIONS.calculateDiscount(product.sp, productDiscount); + var displayProductPrice = ""; + if( Number(amountAfterDiscount) === Number(product.sp) ) { + displayProductPrice = parseFloat(product.sp).toFixed(2); + } else { + displayProductPrice = "" + parseFloat(amountAfterDiscount).toFixed(2) + ""+ parseFloat(product.sp).toFixed(2) +""; + } + + var rowId = Date.now()+product.pid; + var generic = product.gn === null ? "" : `${product.gn}`; + + var html = ` + + + ${product.pn} + ${generic} + + ${displayProductPrice} + + ${product.pu} + ${ parseFloat(Number(amountAfterDiscount)* Number(itemQnt)).toFixed(2) } + + + + + + + + + + + + + `; + + $("#productTable > tbody").append(html); + + }); + + }); + + + // Select Quantity input field if not barcose scanner + if(isScanner === false) { + $(`#productTable > tbody tr:last`).find(".productQnt").select(); + } + + // Count the Total Quantity + this.grandTotal(); + + // Disable the customer Selection and Warehouse selection if there have any product in the list + this.disableEnableWCSelect(); + + }); + + }, + + addReturnProduct: function ( + pid, + product_name, + product_generic, + batch_id, + product_unit, + hed, + discount, + item_price, + item_qty, + item_subtotal + ) { + + /* Check if the product already in the list */ + if (BMS.PRODUCT.isExists(pid) && !confirm(`The product (${product_name}) is already in the list. Do you want to add it again?`)) { + return; + } + + var rowId = Date.now()+pid; + var generic = product_generic === null ? "" : `${product_generic}`; + + var html = ` + + + ${product_name} + ${generic} + + ${item_price} + + ${product_unit} + -${ item_subtotal } + + + + + + + + + + + + `; + + $("#productTable > tbody").append(html); + + // Count the Total Quantity + this.grandTotal(); + + }, + + /** + * This is not required. Now commenting. Will delete in near version + * + productUnitCheck: function(selector) { + + var Quantity = $(selector).closest("tr").find(".productQnt").val(); + var Discount = $(selector).closest("tr").find(".productDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find("td.subtotalCol"); + + var that = selector; + + this.getProductDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + warehouse_id: $("#warehouseId").val(), + qnt: Quantity, + unit: $(selector).val() + }, product => { + + + if(product["error"] !== undefined && product["error"] === true) { + + $(that).closest("tr").find(".productQnt").val(product.stq); // Set the product quantity with Stock Quantity + Quantity = parseFloat(product.stq).toFixed(0); + + // Display the error message + Swal.fire({ + title: "Error!", + text: product["msg"], + icon: "error" + }); + + } + + // Check if product[0] isset, if not the use direct product + // Because If there is any error then the product details come with the error + var product = product[0] ? product[0] : product; + + // Change the product Price + var amountAfterDiscount = BMS.FUNCTIONS.calculateDiscount(product.sp, Discount); + var displayProductPrice = ""; + if( Number(amountAfterDiscount) === Number(product.sp) ) { + var displayProductPrice = parseFloat(product.sp).toFixed(2); + } else { + var displayProductPrice = "" + amountAfterDiscount + ""+ parseFloat(product.sp).toFixed(2) +""; + } + + $(that).closest("tr").find(".netSalesPrice").val(product.sp); + $(that).closest("tr").find(".productMainSalePirce").val(product.sp); + $(that).closest("tr").find(".displayProductPrice").html(displayProductPrice); + $(SubtotalRow).html( (Quantity * amountAfterDiscount).toFixed(2) ); + + // Calculate all data + this.grandTotal(); + + }) + + }, + + */ + + productQntCheck: function(selector, event) { + + // Count Sub total for each product. + var netSalesPrice = $(selector).closest("tr").find(".netSalesPrice").val(); + var Quantity = $(selector).val(); + var Discount = $(selector).closest("tr").find(".productDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find("td.subtotalCol"); + var packetSelector = $(selector).closest("tr").find(".productPacket"); + var that = selector; + + // If the product quantity less then 1 then throw an error + if(Quantity == 0) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Product qunatity can not be zero (0)", + icon: "error" + }); + + // Set product quantity 1 + $(selector).val(1); + Quantity = 1; + + } + + this.getProductDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + warehouse_id: $("#warehouseId").val(), + qnt: Quantity, + unit: $(selector).closest("tr").find(".productItemUnit").val() + }, product => { + + if(product["error"] !== undefined && product["error"] === true) { + + $(that).val(product.stq); // Set the product quantity with Stock Quantity + Quantity = product.stq; + + // Display the error message + Swal.fire({ + title: "Error!", + text: product["msg"], + icon: "error" + }); + + } + + // Check if product[0] isset, if not the use direct product + // Because If there is any error then the product details come with the error + var product = product[0] ? product[0] : product; + + // change product background color while changing qty and when out of stock + if(product.so) { + + $(selector).closest("tr").css("background-color", "pink"); + + } else { + + $(selector).closest("tr").css("background-color", "white"); + + } + + // Display Subtotal for each product + $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * Quantity).toFixed(2)); + + // Update the packet + var packet = 0; + if(Number(product.pq) > 0) { + packet = (Quantity / Number(product.pq)).toFixed(2); + } + packetSelector.val( packet ); + + // Call the grand total + this.grandTotal(); + + }); + + }, + + productPacketCheck: function() { + + // Count Sub total for each product. + var netSalesPrice = $(selector).closest("tr").find(".netSalesPrice").val(); + var Packet = $(selector).val(); + var Discount = $(selector).closest("tr").find(".productDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find("td.subtotalCol"); + var quantitySelector = $(selector).closest("tr").find(".productQnt"); + var packetSelector = $(selector).closest("tr").find(".productPacket"); + + this.getProductDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + warehouse_id: $("#warehouseId").val(), + packet: Packet + }, product => { + + if(product["error"] !== undefined && product["error"] === true) { + + $(quantitySelector).val(product["having_item_quantity"]); // Set the product quantity with max + + // Display Subtotal for each product + $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * product["having_item_quantity"] ).toFixed(2)); + + // Update the packet + var packet = 0; + if(Number(product.product_packet_quantity) > 0) { + packet = ( product["having_item_quantity"] / Number(product.product_packet_quantity)).toFixed(2); + } + packetSelector.val( packet ); + + // Display the error message + Swal.fire({ + title: "Error!", + text: product["msg"], + icon: "error" + }); + + } else { + + // Calculate total product based on packet + var TotalProduct = Math.round(Number(product["product_packet_quantity"]) * Packet); + + // Display total quantity againts of total packet + if(TotalProduct > 0) { + $(quantitySelector).val( TotalProduct ); + // Display Subtotal for each product + $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * TotalProduct ).toFixed(2)); + } + + } + + // Call the grand total + this.grandTotal(); + + }); + + }, + + + productDiscountCheck: function(event) { + + // Count Sub total for each product. + var netSalesPrice = $("#productSaleItemPrice").val(); + var Discount = $("#productSaleItemDiscount").val(); + + if( event.key === "Enter" && Discount.indexOf("%") > 1 && Discount.replace("%","") >= 100) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Discount Must be below of 100%", + icon: "error" + }); + + $("#productSaleItemDiscount").val(""); + $("#productSaleItemDiscount").select(); + + event.preventDefault(); + + } else if ( event.key === "Enter" && Number(Discount) >= Number(netSalesPrice) && Discount.indexOf("%") < 1) { + + $("#productSaleItemDiscount").val(""); + $("#productSaleItemDiscount").select(); + + // Prevent closing modal if presed enter when have discount problem + if(event.key === "Enter") { + event.preventDefault(); + } + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Discount Must be below of product sale price", + icon: "error" + }); + + event.preventDefault(); + + } + + }, + + + orderDiscountCheck: function(selector, e) { + + var totalAmount = $(".totalAmount").text(); + var orderDiscount = $(selector).val(); + + if(orderDiscount.indexOf("%") > 1 && orderDiscount.replace("%","") >= 100) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Discount Must be below of 100%", + icon: "error" + }); + $(selector).val(0); + + e.preventDefault(); + + + } else if( Number(totalAmount) < 0 && Number(orderDiscount) > 0 ) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Discount must be a negative amount in case of negative total amount.", + icon: "error" + }); + + $(selector).val(-Number(orderDiscount)); + + e.preventDefault(); + + } else if( Number(totalAmount) < 0 && ( Number(orderDiscount) > 0 || Math.abs(Number(orderDiscount)) >= Math.abs(Number(totalAmount)) ) ) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Discount Must be below of total amount.", + icon: "error" + }); + + $(selector).val(0); + + e.preventDefault(); + + } else if ( Number(totalAmount) > 0 && Number(orderDiscount) >= Number(totalAmount) && orderDiscount.indexOf("%") < 1) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Discount Must be below of total amount.", + icon: "error" + }); + + $(selector).val(0); + + e.preventDefault(); + + + } else if( this.isGivenDiscountPermitted(selector) !== true ) { // If the current biller has permission to give such discount + + // Display the error message + Swal.fire({ + title: "Error!", + text: `You do not have permission to give ${orderDiscount} discount.`, + icon: "error" + }); + $(selector).val(0); + + e.preventDefault(); + + } + + // Grand total + this.grandTotal(); + + + }, + + + isGivenDiscountPermitted: function(selector) { + + var totalAmount = $(".totalAmount").text(); + var orderDiscount = $(selector).val(); + + if( get_options("maxDiscount") != "" ) { // If the current biller set a max discount + + var maxDiscountAmount = totalAmount - BMS.FUNCTIONS.calculateDiscount(totalAmount, get_options("maxDiscount")); + var givenDiscountAmount = totalAmount - BMS.FUNCTIONS.calculateDiscount(totalAmount, orderDiscount); + + // In case of return/ negative value + // -2 is greater then -4 + // So we are converting all negative value to abs + return Math.abs(maxDiscountAmount) >= Math.abs(givenDiscountAmount); + + } else { + return true; + } + + } + + +}; + + +BMS.PURCHASE = { + + getProductDetails: BMS.PRODUCT.getDetails, + + grandTotal: function() { + + var totalProductQnt = 0; + $(".productQnt").each(function() { + totalProductQnt += Number($(this).val()); + }); + + /* Display total product quantity */ + $("#totalItems").html( $(".productQnt").length + "(" + totalProductQnt + ")"); + + /* Count Total Amount */ + var totalAmount = 0; + $(".subTotal").each(function() { + totalAmount += Number($(this).html()); + }); + + /* Display Total amount (Sub Total) */ + $(".totalPurchasePrice").html(totalAmount.toFixed(2)); + + var amountAfterDiscount = BMS.FUNCTIONS.calculateDiscount(totalAmount, $("#purchaseDiscountValue").val()); + + /* Display Discount amount */ + $(".totalPurchaseDiscount").html("(-) " + (totalAmount - amountAfterDiscount).toFixed(2)); + + /* Calculate tarif and Charges */ + var totaltarifChargesAmount = 0; + $("#tariffCharges > .row").each(function() { + + var tarifChargesValue = $(this).closest(".row").find(".tariffChargesName").val().split(": ")[1]; + var tarifChargesAmount = BMS.FUNCTIONS.calculateTarifCharges(amountAfterDiscount, tarifChargesValue); + + $(this).closest(".row").find(".tariffChargesAmount").val(tarifChargesAmount); + totaltarifChargesAmount += Number(tarifChargesAmount); + + }); + + /* Display Total tarif and Charges Amount */ + $(".totalTariffCharges").html("(+) " + totaltarifChargesAmount.toFixed(2)); + + + /* Display net total */ + var calculateNetTotal = (Number(totaltarifChargesAmount) + Number(amountAfterDiscount)).toFixed(2); + $(".netTotal").html(calculateNetTotal); + $("#purchaseNetTotal").val(calculateNetTotal); + + /* Display Grand Total by adding shipping */ + var calculateGrandTotal = Number(calculateNetTotal) + Number($("#purchaseShipping").val()); + $("#purchaseGrandTotal").val(calculateGrandTotal); + + /* Calculate Due Amount */ + var paidAmount = Number($("#purchasePaidAmount").val()); + + var dueAmount = (calculateGrandTotal <= paidAmount) ? 0 : calculateGrandTotal - paidAmount; + var changeAmount = (calculateGrandTotal >= paidAmount) ? 0 : paidAmount - calculateGrandTotal; + + /* Display Change Amount */ + $("#purchaseChangeAmount").val(changeAmount); + + /* Display Due Amount */ + $("#purchaseDueAmount").val(dueAmount); + + }, + + + calculateEachProduct: function(selector) { + + /* Count Sub total for each product. */ + var NetPurchasePriceOrCosting = $(selector).closest("tr").find(".productPurchasePrice").val(); + var Quantity = $(selector).closest("tr").find(".productQnt").val(); + var Discount = $(selector).closest("tr").find(".productPurchaseDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find(".subTotal"); + + /** Check if the quantity is a numeric value */ + if( isNaN(Quantity) ) { + alert("Product quantity must be a valid number."); + $(selector).closest("tr").find(".productQnt").val(1); + return; + } + + /* Check if product quantity below of 1 */ + if (Quantity < 1 && $("#purchaseStatus").val() !== "Ordered") { + alert("Product quantity must be minimum of 1."); + $(selector).closest("tr").find(".productQnt").val(1); + return; + } + + /* Check product purchase Price */ + if (NetPurchasePriceOrCosting === "" || NetPurchasePriceOrCosting === null || NetPurchasePriceOrCosting === 'null') { + NetPurchasePriceOrCosting = 0; + $(selector).closest("tr").find(".productPurchasePrice").val(0.00); + } + + /* Check Discount */ + if (Discount.indexOf("%") > 1 && Discount.replace("%", "") >= 100) { + + // Set Discount to Zero + $(selector).closest("tr").find(".productPurchaseDiscount").val(0); + alert("Discount Must be below of 100%"); + return; + + } else if (Number(Discount) > Number(NetPurchasePriceOrCosting) && Discount.indexOf("%") < 1) { + + // Set Discount to Zero + $(selector).closest("tr").find(".productPurchaseDiscount").val(0); + alert("Discount Must be below of product purchase price"); + return; + } + /* Display Subtotal for each product */ + $(SubtotalRow).html(( BMS.FUNCTIONS.calculateDiscount(NetPurchasePriceOrCosting, Discount) * Quantity).toFixed(2) ); + + }, + + + addProduct: function(product_id="", isScanner=false) { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + + if (productId === "") { + alert("Please select a product"); + return; + } + + this.getProductDetails(productId, products => { + + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var productBatchHtml = ""; + /** check if the product has expiry date */ + if( product.hed !== undefined && product.hed === "1" && $("#purchaseStatus").val() !== "Ordered" ) { + + productBatchHtml = ``; + } + + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + + var html = ` + + ${product.pn} + ${productBatchHtml} + ${product.alertq} ${product.soldq} ${product.stockq} + + ${product.pu} + + + + ${product.pp} + + + + `; + + $("#productTable > tbody").append(html); + + }); + + }); + + // Select Quantity input field if not barcose scanner + if(isScanner === false) { + $(`#productTable > tbody tr:last`).find(".productQnt").select(); + } + + + /* Count the Total Quantity */ + this.grandTotal(); + + /* remove the value from selectProduct select box */ + $('#selectProduct').empty(); + + }); + + }, + + + productUnitCheck: function(selector) { + + var productId = $(selector).closest("tr").find(".productID").val(); + var self = this; + $.ajax({ + url: full_website_address + "/info/?module=data&page=productUnitDetails&product_id=" + productId + "&unit=" + $(selector).val(), + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function(productUnit, status) { + if (status == "success") { + + /* Change the product Price */ + $(selector).closest("tr").find(".productPurchasePrice").val(productUnit.pp); + $(selector).closest("tr").find(".productMainPurchasePrice").val(productUnit.pp); + + /* Calculate all data */ + self.calculateEachProduct(selector); + self.grandTotal(); + + } + } + }); + + } + +}; + + +// Assing all functionality from POS +BMS.ORDER = Object.assign({}, BMS.POS); + +// Rewrite addProduct Functions +BMS.ORDER.addProduct = function(product_id="") { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + + if (productId === "") { + alert("Please select a product"); + return; + } + + // Remove/ empty the product selection input. + if($('#selectProduct').val() > 0) { + $("#selectProduct").html(""); + } + + // Get product details + BMS.PRODUCT.getDetails(productId, products => { + + // Loop throw Products + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var packet = 0; + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + if(product.pq > 0) { + packet = (itemQnt / Number(product.pq)).toFixed(2); + } + + // Check Discount + var productDiscount = !product.pd ? "0" : product.pd; + + // Generate Discount + var amountAfterDiscount = BMS.FUNCTIONS.calculateDiscount(product.sp, productDiscount); + var displayProductPrice = ""; + if( Number(amountAfterDiscount) === Number(product.sp) ) { + displayProductPrice = parseFloat(product.sp).toFixed(2); + } else { + displayProductPrice = "" + amountAfterDiscount + ""+ parseFloat(product.sp).toFixed(2) +""; + } + + var rowId = Date.now()+product.pid; + + var html = ` + + + ${product.pn} + + ${displayProductPrice} + + ${product.pu} + ${ parseFloat(Number(amountAfterDiscount)* Number(itemQnt)).toFixed(2) } + + + + + + + + + + + + + `; + + $("#productTable > tbody").append(html); + + }); + + }); + + // Select Quantity input field + $(`#productTable > tbody tr:last`).find(".productQnt").select(); + + // Count the Total Quantity + this.grandTotal(); + + // Disable the customer Selection and Warehouse selection if there have any product in the list + this.disableEnableWCSelect(); + + }); +}; + +// Rewrite productQntCheck function +BMS.ORDER.productQntCheck = function(selector, event) { + + // Count Sub total for each product. + var netSalesPrice = $(selector).closest("tr").find(".netSalesPrice").val(); + var Quantity = $(selector).val(); + var Discount = $(selector).closest("tr").find(".productDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find("td.subtotalCol"); + + // If the product quantity less then 1 then throw an error + if(Quantity == 0) { + + // Display the error message + Swal.fire({ + title: "Error!", + text: "Product qunatity can not be zero (0)", + icon: "error" + }); + + // Set product quantity 1 + $(selector).val(1); + Quantity = 1; + + } + + // Display Subtotal for each product + $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(netSalesPrice,Discount) * Quantity).toFixed(2)); + + // Call the grand total + this.grandTotal(); + +}; + + +BMS.STOCK_TRANSFER = { + + getProductDetails: BMS.POS.getProductDetails, + + grandTotal: function() { + + var totalProductQnt = 0; + $(".productQnt").each(function() { + totalProductQnt += Number($(this).val()); + }); + + /* Display total product quantity */ + $("#totalItems").html( $(".productQnt").length + "(" + totalProductQnt + ")"); + + /* Count Total Amount */ + var totalAmount = 0; + $(".subTotal").each(function() { + totalAmount += Number($(this).html()); + }); + + /* Display Total amount (Sub Total) */ + $(".totalPurchasePrice").html(totalAmount.toFixed(2)); + + }, + + disableEnableWarehouseSelect: function() { + + var productCountInList = $(".productQnt").length; + + if(productCountInList > 0) { + $("#stockTransferFromWarehouse, #stockTransferToWarehouse").prop("disabled", true); + } else { + $("#stockTransferFromWarehouse, #stockTransferToWarehouse").prop("disabled", false); + } + + }, + + calculateEachProduct: function(selector) { + + /* Count Sub total for each product. */ + var subTotal = 0; + var NetPurchasePriceOrCosting = $(selector).closest("tr").find(".productPurchasePrice").val(); + var Quantity = $(selector).closest("tr").find(".productQnt").val(); + var Discount = $(selector).closest("tr").find(".productPurchaseDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find(".subTotal"); + + /* Check if product quantity below of 1 */ + if (Quantity < 1) { + alert("Product quantity must be minimum of 1."); + $(selector).closest("tr").find(".productQnt").val(1); + return; + } + + /* Check product purchase Price */ + if (NetPurchasePriceOrCosting === "" || NetPurchasePriceOrCosting === null || NetPurchasePriceOrCosting === 'null') { + NetPurchasePriceOrCosting = 0; + $(selector).closest("tr").find(".productPurchasePrice").val(0.00); + } + + /* Check Discount */ + if (Discount.indexOf("%") > 1 && Discount.replace("%", "") >= 100) { + + // Set Discount to Zero + $(selector).closest("tr").find(".productPurchaseDiscount").val(0); + alert("Discount Must be below of 100%"); + return; + + } else if (Number(Discount) > Number(NetPurchasePriceOrCosting) && Discount.indexOf("%") < 1) { + + // Set Discount to Zero + $(selector).closest("tr").find(".productPurchaseDiscount").val(0); + alert("Discount Must be below of product purchase price"); + return; + } + /* Display Subtotal for each product */ + $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(NetPurchasePriceOrCosting, Discount) * Quantity).toFixed(2)); + + }, + + addProduct: function(product_id="", isScanner=false) { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + var fromWarehouse = $("#stockTransferFromWarehouseId").val(); + var pqnt = 1; + + if( fromWarehouse === "" ) { + alert("Please select an warehouse to add product"); + return; + } + + if (productId === "") { + alert("Please select a product"); + return; + } + + + this.getProductDetails({ + product_id: productId, + warehouse_id: fromWarehouse, + qnt: pqnt + }, products => { + + if(products["error"] !== undefined && products["error"] === true) { + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: products["msg"], + icon: "error" + }); + + return; + } + + + // Loop throw Products + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var productBatchHtml = ""; + /** check if the product has expiry date */ + if( product.hed !== undefined && product.hed === "1" ) { + + productBatchHtml = ``; + } + + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + var html = ` + + ${product.pn} + ${productBatchHtml} + + ${product.pu} + + + + ${parseFloat(product.pp * itemQnt).toFixed(2) } + + + + `; + + $("#productTable > tbody").append(html); + + }); + + }); + + + /* Count the Total Quantity */ + this.grandTotal(); + this.disableEnableWarehouseSelect(); + + /* remove the value from selectProduct select box */ + $('#selectProduct').empty(); + + + }); + + }, + + productUnitCheck: function(selector) { + + var that = selector; + + this.getProductDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + warehouse_id: $("#stockTransferFromWarehouseId").val(), + qnt: $(selector).closest("tr").find(".productQnt").val(), + unit: $(selector).val() + }, product => { + + if(product["error"] !== undefined && product["error"] === true) { + + console.log(product.stq); + + $(that).closest("tr").find(".productQnt").val(product.stq); /* Set the product quantity with max */ + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: product["msg"], + icon: "error" + }); + + } + + /* Change the product Price */ + $(that).closest("tr").find(".productPurchasePrice").val(parseFloat(product.pp).toFixed(2)); + + /* Calculate all data */ + this.calculateEachProduct(that); + this.grandTotal(); + + }); + + }, + + + productQntCheck: function(selector) { + + var Quantity = $(selector).val(); + var that = $(selector); + + /** Check if the quantity is a numeric value */ + if( isNaN(Quantity) ) { + alert("Product quantity must be a valid number."); + /* Set product quantity 1 */ + $(selector).val(1); + Quantity = 1; + + } + + /* If the product quantity less then 1 then throw an error */ + if(Quantity < 1) { + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: "Product qunatity must be at least one", + icon: "error" + }); + + /* Set product quantity 1 */ + $(selector).val(1); + Quantity = 1; + + } + + this.getProductDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + warehouse_id: $("#stockTransferFromWarehouseId").val(), + qnt: Quantity, + unit: $(selector).closest("tr").find(".productItemUnit").val() + }, product => { + + if(product["error"] !== undefined && product["error"] === true) { + + $(that).val(product["stq"]); /* Set the product quantity with max */ + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: product["msg"], + icon: "error" + }); + + } + + /* Call the grand total */ + this.calculateEachProduct(that); + this.grandTotal(); + + }); + + } + +} + + +BMS.STOCK_ENTRY = { + + getProductDetails: BMS.PRODUCT.getDetails, + + grandTotal: function() { + + var totalProductQnt = 0; + $(".productQnt").each(function() { + totalProductQnt += Number($(this).val()); + }); + + /* Display total product quantity */ + $("#totalItems").html( $(".productQnt").length + "(" + totalProductQnt + ")"); + + /* Count Total Amount */ + var totalAmount = 0; + $(".subTotal").each(function() { + totalAmount += Number($(this).html()); + }); + + /* Display Total amount (Sub Total) */ + $(".totalPurchasePrice").html(totalAmount.toFixed(2)); + + }, + + + calculateEachProduct: function(selector) { + + /* Count Sub total for each product. */ + var subTotal = 0; + var NetPurchasePriceOrCosting = $(selector).closest("tr").find(".productPurchasePrice").val(); + var Quantity = $(selector).closest("tr").find(".productQnt").val(); + var Discount = $(selector).closest("tr").find(".productPurchaseDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find(".subTotal"); + + /* Check if product quantity below of 1 */ + if (Quantity < 1 && $("#stockEntryType").val() === "Production" ) { + alert("Negative quantity is not valid for Production of stock."); + $(selector).closest("tr").find(".productQnt").val(1); + return; + } + + /* Check product purchase Price */ + if (NetPurchasePriceOrCosting === "" || NetPurchasePriceOrCosting === null || NetPurchasePriceOrCosting === 'null') { + NetPurchasePriceOrCosting = 0; + $(selector).closest("tr").find(".productPurchasePrice").val(0.00); + } + + /* Check Discount */ + if (Discount.indexOf("%") > 1 && Discount.replace("%", "") >= 100) { + + // Set Discount to Zero + $(selector).closest("tr").find(".productPurchaseDiscount").val(0); + alert("Discount Must be below of 100%"); + return; + + } else if (Number(Discount) > Number(NetPurchasePriceOrCosting) && Discount.indexOf("%") < 1) { + + // Set Discount to Zero + $(selector).closest("tr").find(".productPurchaseDiscount").val(0); + alert("Discount Must be below of product purchase price"); + return; + } + /* Display Subtotal for each product */ + $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(NetPurchasePriceOrCosting, Discount) * Quantity).toFixed(2)); + + }, + + addProduct: function(product_id="") { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + var fromWarehouse = $("#stockTransferFromWarehouseId").val(); + var pqnt = 1; + + if( fromWarehouse === "" ) { + alert("Please select an warehouse to add product"); + return; + } + + if (productId === "") { + alert("Please select a product"); + return; + } + + + this.getProductDetails(productId, products => { + + if(products["error"] !== undefined && products["error"] === true) { + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: products["msg"], + icon: "error" + }); + + return; + } + + + // Loop throw Products + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var productBatchHtml = ""; + /** check if the product has expiry date */ + if( product.hed !== undefined && product.hed === "1" ) { + + productBatchHtml = ``; + } + + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + var html = ` + + ${product.pn} + ${productBatchHtml} + + ${product.pu} + + + + ${parseFloat(product.pp * itemQnt).toFixed(2) } + + + + `; + + $("#productTable > tbody").append(html); + + }); + + }); + + + /* Count the Total Quantity */ + this.grandTotal(); + + /* remove the value from selectProduct select box */ + $('#selectProduct').empty(); + + }); + + } + +} + + +BMS.RETURN = { + + getProductReturnDetails: function({product_id, customer_id}, returnData) { + + $.ajax({ + url: full_website_address + "/info/?module=data&page=productDetailsForReturn&product_id=" + product_id+"&customer_id="+customer_id, + contentType: "application/json; charset=utf-8", + dataType: "json", + success: function (data, status) { + returnData(data); + } + }); + + }, + + grandTotal: function() { + + var totalProductQnt = 0; + $(".productQnt").each(function() { + totalProductQnt += Number($(this).val()); + }); + + /* Display total product quantity */ + $("#totalItems").html( $(".productQnt").length + "(" + totalProductQnt + ")"); + + /* Count Total Amount */ + var totalAmount = 0; + $(".subTotal").each(function() { + totalAmount += Number($(this).html()); + }); + + /* Display Total amount (Sub Total) */ + $(".totalReturnPrice").html(totalAmount.toFixed(2)); + + var amountAfterDiscount = BMS.FUNCTIONS.calculateDiscount(totalAmount, $("#returnDiscountValue").val()); + + /* Display Discount amount */ + $(".totalReturnDiscount").html("(-) " + (totalAmount - amountAfterDiscount).toFixed(2)); + + /* Calculate tarif and Charges */ + var totaltarifChargesAmount = 0; + $("#tariffCharges > .row").each(function() { + + var tarifChargesValue = $(this).closest(".row").find(".tariffChargesName").val().split(": ")[1]; + var tarifChargesAmount = BMS.FUNCTIONS.calculateTarifCharges(amountAfterDiscount, tarifChargesValue); + + $(this).closest(".row").find(".tariffChargesAmount").val(tarifChargesAmount); + totaltarifChargesAmount += Number(tarifChargesAmount); + + }); + + /* Display Total tarif and Charges Amount */ + $(".totalTariffCharges").html("(+) " + totaltarifChargesAmount.toFixed(2)); + + + /* Display net total */ + var calculateNetTotal = (Number(totaltarifChargesAmount) + Number(amountAfterDiscount)).toFixed(2); + $(".netTotal").html(calculateNetTotal); + $("#returnNetTotal").val(calculateNetTotal); + + // get shipping + var returnShipping = $("#returnShipping").val(); + + /* Display Grand Total by subtracting surcharge */ + var calculateGrandTotal = ( Number(calculateNetTotal) + Number(returnShipping) ) - Number($("#returnSurcharge").val()); + $("#returnGrandTotal").val(calculateGrandTotal); + + /* Calculate Due Amount */ + var paidAmount = Number($("#returnPaidAmount").val()); + + var dueAmount = (calculateGrandTotal <= paidAmount) ? 0 : calculateGrandTotal - paidAmount; + var changeAmount = (calculateGrandTotal >= paidAmount) ? 0 : paidAmount - calculateGrandTotal; + + /* Display Change Amount */ + $("#returnChangeAmount").val(changeAmount); + + /* Display Due Amount */ + $("#returnDueAmount").val(dueAmount); + + }, + + calculateEachProduct: function(selector) { + + /* Count Sub total for each product. */ + var subTotal = 0; + var NetReturnPriceOrCosting = $(selector).closest("tr").find(".productReturnPrice").val(); + var Quantity = $(selector).closest("tr").find(".productQnt").val(); + var Discount = $(selector).closest("tr").find(".productReturnDiscount").val(); + var SubtotalRow = $(selector).closest("tr").find(".subTotal"); + + /* Check if product quantity below of 1 */ + if (Quantity < 1) { + alert("Product quantity must be minimum of 1."); + $(selector).closest("tr").find(".productQnt").val(1); + return; + } + + /* Check product return Price */ + if (NetReturnPriceOrCosting === "" || NetReturnPriceOrCosting === null || NetReturnPriceOrCosting === 'null') { + NetReturnPriceOrCosting = 0; + $(selector).closest("tr").find(".productReturnPrice").val(0.00); + } + + /* Check Discount */ + if (Discount.indexOf("%") > 1 && Discount.replace("%", "") >= 100) { + alert("Discount Must be below of 100%"); + return; + } else if (Number(Discount) > Number(NetReturnPriceOrCosting) && Discount.indexOf("%") < 1) { + alert("Discount Must be below of product return price"); + return; + } + /* Display Subtotal for each product */ + $(SubtotalRow).html((BMS.FUNCTIONS.calculateDiscount(NetReturnPriceOrCosting, Discount) * Quantity).toFixed(2)); + + }, + + + addProduct: function(product_id="") { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + var customer_id = $("#returnCustomer").val(); + + if(customer_id === "") { + alert("Please select the customer"); + return; + } + + if (productId === "") { + alert("Please select a product"); + return; + } + + + this.getProductReturnDetails({ + product_id: productId, + customer_id: customer_id + }, products => { + + + // Loop throw Products + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var productDiscount = !product.pd ? "0" : product.pd; + var amountAfterDiscount = parseFloat(BMS.FUNCTIONS.calculateDiscount(product.sp, productDiscount)).toFixed(2); + + var productBatchHtml = ""; + /** check if the product has expiry date */ + if( product.hed !== undefined && product.hed === "1" ) { + + productBatchHtml = ``; + } + + var html = ` + + ${product.pn}
(Purchased: ${product.prq} Returned: ${product.rtq}) + ${productBatchHtml} + + ${product.pu} + + + + ${amountAfterDiscount} + + + + `; + + $("#productTable > tbody").append(html); + + }); + + }); + + + /* Count the Total Quantity */ + this.grandTotal(); + + /* remove the value from selectProduct select box */ + $('#selectProduct').empty(); + + }); + + }, + + + productUnitCheck: function(selector) { + + var that = selector; + + this.getProductReturnDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + customer_id: $("#returnCustomer").val(), + unit: $(selector).val() + }, products => { + + var product = products[0]; + + /* Change the product Price */ + $(that).closest("tr").find(".productReturnPrice").val( parseFloat(product.sp).toFixed(2) ); + + var productDetails = product.pn + '
(Purchased: '+ parseFloat(product.prq).toFixed(2) +', Returned: '+ parseFloat(product.rtq).toFixed(2) + ')'; + $(that).closest("tr").find(".productDetails").html( productDetails ); + + /* Calculate all data */ + this.calculateEachProduct(that); + this.grandTotal(); + + }); + + } + +} + + +BMS.WASTAGE_SALE = { + + grandTotal: function() { + + var totalProductQnt = 0; + $(".wastageSaleItemQnt").each(function() { + totalProductQnt += Number($(this).val()); + }); + + /* Display total product quantity */ + $("#totalItems").html( $(".wastageSaleItemQnt").length + "(" + totalProductQnt + ")"); + + /* Count Total Amount */ + var totalAmount = 0; + $(".wastageSaleItemSubtotal").each(function() { + totalAmount += Number($(this).text()); + }); + + /* Display Total amount (Sub Total) */ + $(".totalWastageSalePrice").html(totalAmount.toFixed(2)); + + var amountAfterDiscount = BMS.FUNCTIONS.calculateDiscount(totalAmount, $("#wastageSaleDiscountValue").val()); + + /* Display Discount amount */ + $(".totalWastageSaleDiscount").html("(-) " + (totalAmount - amountAfterDiscount).toFixed(2)); + + /* Calculate tarif and Charges */ + var totaltarifChargesAmount = 0; + $("#tariffCharges > .row").each(function() { + + var tarifChargesValue = $(this).closest(".row").find(".tariffChargesName").val().split(": ")[1]; + var tarifChargesAmount = BMS.FUNCTIONS.calculateTarifCharges(amountAfterDiscount, tarifChargesValue); + + $(this).closest(".row").find(".tariffChargesAmount").val(tarifChargesAmount); + totaltarifChargesAmount += Number(tarifChargesAmount); + + }); + + /* Display Total tarif and Charges Amount */ + $(".totalTariffCharges").html("(+) " + totaltarifChargesAmount.toFixed(2)); + + + /* Display net total */ + var calculateNetTotal = (Number(totaltarifChargesAmount) + Number(amountAfterDiscount)).toFixed(2); + $(".netTotal").html(calculateNetTotal); + $("#wastageSaleNetTotal").val(calculateNetTotal); + + /** Get Paid Amount */ + var paidAmount = $("#wastageSalePaidAmount").val(); + + /** Caculate Due amount and display */ + var dueAmount = ( paidAmount < calculateNetTotal ) ? (calculateNetTotal - paidAmount) : 0; + $("#wastageSaleDue").val( (dueAmount).toFixed(2) ); + + }, + + + addWastageSaleItem: function() { + + var html = '\ + \ + \ + \ + 0.00\ + \ + \ + \ + '; + + $("#productTable > tbody").append(html); + + /* Focus the item name input field */ + $(".wastageSaleItem").focus(); + + /* Count all totals */ + this.grandTotal(); + + } + +} + + +BMS.SPECIMEN_COPY = { + + getProductDetails: BMS.POS.getProductDetails, + + disableEnableWarehouseSelect: function() { + + if ( $(".productQnt").length > 0) { + $("#scTransferWarehouse").prop("disabled", true); + } else { + $("#scTransferWarehouse").prop("disabled", false); + } + + }, + + addProduct: function(product_id="") { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + var fromWarehouse = $("#scTransferWarehouse").val(); + + if (fromWarehouse === "") { + alert("Please select an warehouse to add product"); + return; + } + + if (productId === "") { + alert("Please select a product"); + return; + } + + + // Get product details + this.getProductDetails({ + product_id: productId, + warehouse_id: fromWarehouse, + }, products => { + + if (products["error"] !== undefined && products["error"] === true) { + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: products["msg"], + icon: "error" + }); + + return; + } + + // Loop throw Products + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + + var html = ` \ + + ${product.pn} + + ${product.pu} + + + + `; + + $("#productTable > tbody").append(html); + + }); + + + }); + + + /* Count the Total Quantity */ + this.disableEnableWarehouseSelect(); + + /* remove the value from selectProduct select box */ + $('#selectProduct').empty(); + + }); + + + }, + + productUnitCheck: function(selector) { + + this.getProductDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + warehouse_id: $("#scTransferWarehouse").val(), + qnt: $(selector).closest("tr").find(".productQnt").val(), + unit: $(selector).val() + }, product => { + + if (product["error"] !== undefined && product["error"] === true) { + + $(selector).closest("tr").find(".productQnt").val(product.stq); /* Set the product quantity with max */ + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: product["msg"], + icon: "error" + }); + + } + + }); + + }, + + productQntCheck: function(selector) { + + var Quantity = $(selector).val(); + + /** Check if the quantity is a numeric value */ + if( isNaN(Quantity) ) { + alert("Product quantity must be a valid number."); + /* Set product quantity 1 */ + $(selector).val(1); + Quantity = 1; + } + + /* If the product quantity less then 1 then throw an error */ + if (Quantity < 1) { + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: "Product qunatity must be at least one", + icon: "error" + }); + + /* Set product quantity 1 */ + $(selector).val(1); + Quantity = 1; + + } + + this.getProductDetails({ + product_id: $(selector).closest("tr").find(".productID").val(), + warehouse_id: $("#scTransferWarehouse").val(), + qnt: Quantity, + unit: $(selector).closest("tr").find(".productItemUnit").val() + }, product => { + + if (product["error"] !== undefined && product["error"] === true) { + + $(selector).val(product.stq); /* Set the product quantity with max */ + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: product["msg"], + icon: "error" + }); + + } + + }); + + } + +} + + +BMS.SC_DISTRIBUTION = { + + getProductDetails: BMS.PRODUCT.getDetails, + + addProduct: function(product_id="") { + + var productId = (product_id === "") ? $('#selectProduct').val() : product_id; + + if (productId === "") { + alert("Please select a product"); + return; + } + + + // Get product details + this.getProductDetails(productId, products => { + + if (products["error"] !== undefined && products["error"] === true) { + + /* Display the error message */ + Swal.fire({ + title: "Error!", + text: products["msg"], + icon: "error" + }); + + return; + + } + + // Loop throw Products + products.forEach(eachProduct => { + + BMS.PRODUCT.validationCheck(eachProduct, this, product => { + + var itemQnt = product.iq ? parseFloat(product.iq).toFixed(0) : 1; + + var html = ` + + ${product.pn} + + ${product.pu} + + + + `; + + $("#productTable > tbody").append(html); + + }); + + + }); + + /* remove the value from selectProduct select box */ + $('#selectProduct').empty(); + + }); + + } + +}; + + +BMS.CHAT = { + + + showChatBox: function(event, userId) { + + if(event !== "") { + event.preventDefault(); + } + + // Get SDP Data for selected user + $.ajax({ + url: full_website_address + "/info/?module=chat&page=getChatUserData", + type: "post", + data: { + userId: userId + }, + success: function(data, status) { + + var data = JSON.parse(data) ; + + console.log( data ); + + var latestMsg = ""; + if( data.latest_msg !== "" ) { + + data.latest_msg.forEach(item => { + + if( item.from_user != userId ) { + // Local user conversation + latestMsg += `
+
+ ${item.from_username} + ${item.datetime} +
+ +
+ ${item.msg_text} +
+
`; + + } else { + + // Remote user conversation + latestMsg += `
+
+ ${item.from_username} + ${item.datetime} +
+ +
+ ${item.msg_text} +
+
`; + + + } + + }); + + } + + // Show the chat box + var chatBox = `
+ +
+ +
+

${data.name}

+

${data.position}

+
+
+ + + +
+
+
+ +
+ ${latestMsg} +
+
+
+ + + +
+
`; + + $(".chatBox").prepend(chatBox).ready( function() { + + var container = $(`.chatBoxForUser${userId}`).find(".direct-chat-messages"); + + var chatHeight = $(container).get(0).scrollHeight; + $(container).animate({ scrollTop: chatHeight }, 0); + + + // Focus the composer + $(container).closest(".chatBox").find(".message-composer").focus(); + + }); + + } + + }); + + }, + + + send: function(msg, toUserId) { + + wss.send(JSON.stringify({ + "type" : "message", + "toUser" : toUserId, + "msg" : msg + })); + + } + +} \ No newline at end of file diff --git a/assets/js/bms.min.js b/assets/js/bms.min.js index 24bc7fa..9ef4555 100644 --- a/assets/js/bms.min.js +++ b/assets/js/bms.min.js @@ -1 +1 @@ -"use strict";var BMS=BMS||{};BMS.FUNCTIONS={calculateDiscount:function(t,e=null){return""===e||null===e||"null"===e||0===e?parseFloat(Number(t)):"string"==typeof e&&e.indexOf("%")>0?parseFloat(Number(t)-Number(e.replace("%",""))/100*Number(t)):parseFloat(Number(t)-Number(e))},calculateTarifCharges:function(t,e=null){return""===e||null===e||"null"===e||0===e?0:"string"==typeof e&&e.indexOf("%")>0?(Number(e.replace("%",""))/100*Number(t)).toFixed(2):Number(e).toFixed(2)},datePicker:function({selector:t=".datePicker",format:e="YYYY-MM-DD",timePicker:a=!1}=""){$(t).daterangepicker({autoUpdateInput:!1,singleDatePicker:!0,showDropdowns:!0,timePicker:a,timePicker24Hour:!0,autoApply:!0,parentEl:"div.dynamic-container",drops:"auto",locale:{format:e,cancelLabel:"Clear"}}),$(t).on("apply.daterangepicker",(function(t,a){$(this).val(a.startDate.format(e))})),$(t).on("cancel.daterangepicker",(function(t,e){$(this).val("")}))},dateRangePicker:function({selector:t=".dateRangePicker",format:e="YYYY-MM-DD",timePicker:a=!1}=""){$(t).daterangepicker({autoUpdateInput:!1,showDropdowns:!0,drops:"auto",linkedCalendars:!1,timePicker:a,timePicker24Hour:!0,parentEl:"div.dynamic-container",locale:{format:e,cancelLabel:"Clear"}}),$(t).on("apply.daterangepicker",(function(t,a){$(this).val(a.startDate.format(e)+" - "+a.endDate.format(e))})),$(t).on("cancel.daterangepicker",(function(t,e){$(this).val("")}))},dateRangePickerPreDefined:function({selector:t=".dateRangePickerPreDefined",format:e="YYYY-MM-DD",timePicker:a=!1,ranges:o={}}=""){$(t).daterangepicker({autoUpdateInput:!1,showDropdowns:!0,drops:"auto",alwaysShowCalendars:!0,linkedCalendars:!1,timePicker:a,timePicker24Hour:!0,parentEl:"div.dynamic-container",locale:{format:e,cancelLabel:"Clear"},ranges:Object.keys(o).length>0?o:{Today:[moment(),moment()],"This Month":[moment().startOf("month"),moment().endOf("month")],"Last Month":[moment().subtract(1,"month").startOf("month"),moment().subtract(1,"month").endOf("month")],"This Year":[moment().startOf("year"),moment().endOf("year")],"Last Year":[moment().subtract(1,"year").startOf("year"),moment().subtract(1,"year").endOf("year")],All:[moment(0),moment().subtract("year").endOf("day")]}}),$(t).on("apply.daterangepicker",(function(t,a){$(this).val(a.startDate.format(e)+" - "+a.endDate.format(e))})),$(t).on("cancel.daterangepicker",(function(t,e){$(this).val("")}))},multiDatePicker:function({selector:t=".multiDatePicker",format:e="yyyy-mm-dd"}=""){$(t).datepicker({multidate:!0,multidateSeparator:", ",format:e,todayHighlight:!0})},getCookie:function(t){var e=decodeURIComponent(`; ${document.cookie}`).split(`; ${t}=`);if(e.length>1)return e[1].split("; ")[0]},_n:function(t){let e=BMS.fn.getCookie("lang"),a={bn_BD:"bn-BD"};return void 0!==e?new Intl.NumberFormat(a[e]).format(t):t},createNewSelect2Item:function(t){var e=$(t).attr("select2-create-new-url"),a=$(".select2-search__field").val(),o=encodeURIComponent(a);console.log(t),$("body").trigger("mousedown"),$("#modalDefault").modal("show").find(".modal-content").load(e+"&val="+o),$("#modalDefault").on("hidden.bs.modal",(function(e){BMS.fn.select2(t,"",a)}))},play:function(t,e=!1){var a=`${full_website_address}/assets/sounds/${t}.mp3`,o=new window.Audio(a);$(document).on("pauseAudio",(function(){o.pause()})),o.loop=e,o.play()},pause:function(){$(document).trigger("pauseAudio")},startTimer(t="#timer"){var e=(new Date).getTime();return setInterval((function(){var a=(new Date).getTime()-e,o=Math.floor(a%864e3/36e4).toString().padStart(2,0),r=Math.floor(a%36e4/6e4).toString().padStart(2,0),n=Math.floor(a%6e4/1e3).toString().padStart(2,0);$(t).html(`${o}:${r}:${n}`)}),1e3)},stopTimer:function(t){clearInterval(t)},notify:function(t){Swal.fire({toast:!0,position:"top-right",timer:5e3,timerProgressBar:!0,iconHtml:'',didOpen:t=>{t.addEventListener("mouseenter",Swal.stopTimer),t.addEventListener("mouseleave",Swal.resumeTimer),this.play("beep")},title:` ${t} `,showConfirmButton:!1,onClose:$("body").css("padding","0px")})},desktopNotify:function(t,e="",a=""){"granted"!==Notification.permission?Notification.requestPermission():new Notification(t,{icon:e,body:a}).onclick=function(){window.focus(),this.close()}},alertError:function(t){Swal.fire({toast:!0,position:"top-right",icon:"error",timer:5e3,timerProgressBar:!0,didOpen:t=>{t.addEventListener("mouseenter",Swal.stopTimer),t.addEventListener("mouseleave",Swal.resumeTimer),this.play("warning")},title:` ${t} `,showConfirmButton:!1,onClose:$("body").css("padding","0px")})},alertSuccess:function(t,e=!0){Swal.fire({toast:!0,position:"top-right",icon:"success",timer:5e3,timerProgressBar:!0,didOpen:t=>{t.addEventListener("mouseenter",Swal.stopTimer),t.addEventListener("mouseleave",Swal.resumeTimer),e&&this.play("warning")},title:` ${t} `,showConfirmButton:!1,onClose:$("body").css("padding","0px")})},dTable:function(t){var e=JSON.parse(localStorage.getItem("filterItem"));null!==e&&($(t).find("tfoot select").each((function(t,a){e[a.id]&&($("#"+a.id+" option[value='"+e[a.id].value+"']").remove(),$("#"+a.id).append($('")))})),$(t).find("tfoot input, tfoot textarea").each((function(t,a){e[a.id]&&e[a.id].value&&$("#"+a.id).val(e[a.id].value)})));var a="";a=void 0!==$(t).attr("dt-data-url")?$(t).attr("dt-data-url"):DataTableAjaxPostUrl;var o=!0;void 0!==$(t).attr("dt-disable-on-type-search")&&(o=!1);var r=void 0!==$(".defaultOrder").html()?[[$("th.defaultOrder").index(),"desc"]]:[1,"desc"],n="undefined"!=typeof defaultiDisplayLength?defaultiDisplayLength:15,l=void 0!==$(t).attr("dt-height")?$(t).attr("dt-height"):"60vh",s=$(t).DataTable({processing:!0,serverSide:!0,responsive:!1,scrollX:!0,scrollY:l,scrollCollapse:!0,stateSave:!0,search:{return:!0},initComplete:function(t,e){if(o){var a=new $.fn.dataTable.Api(t);$(".dataTables_filter input").unbind(),$(".dataTables_filter input").bind("keyup",(function(t){13==(t.keyCode||t.which)&&a.search(this.value).draw()}))}},stateSaveParams:function(t,e){e.search.search="",e.length=15,e.order=r},order:r,select:{style:"multi+shift",selector:"td:first-child"},language:Object.keys(language).length>0?language:{processing:"Processing..."},aLengthMenu:[[15,100,500,1500,5e3,-1],[15,100,500,1500,5e3,"All"]],iDisplayLength:n,ajax:{url:a,type:"post"},columnDefs:[{targets:"countTotal",className:"text-right",render:$.fn.dataTable.render.number(",",".",2)},{targets:"highlightWithCountTotal",className:"text-right highlight",render:$.fn.dataTable.render.number(",",".",2)},{targets:"text-right",className:"text-right"},{targets:"sort",orderable:!0,searchable:!0},{targets:"no-sort",orderable:!1},{targets:0,orderable:!1,checkboxes:{selectRow:!0}},{targets:"px120",className:"px120"},{targets:"px160",className:"px160"},{visible:!1,targets:"hideit"},{targets:"dtDescription",className:"dtDescription"},{targets:"highlight",className:"highlight"}],footerCallback:function(t,e,a,o,r){this.api().columns(".countTotal, .highlightWithCountTotal",{page:"current"}).every((function(){var t=this.data().reduce((function(t,e){return(parseFloat(t)||0)+(parseFloat(e)||0)}),0);$(this.footer()).html(t.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,"))}))}}),i={};s.columns().every((function(){var t=this,e=$("select",this.footer())[0],a=$("textarea, input:not(.notThisValueFilter)",this.footer())[0];e&&(i[e.id]={value:e.value,text:e.options[e.selectedIndex].text}),a&&(i[a.id]={value:a.value}),$("input, select, textarea",this.footer()).on("enter change clear apply.daterangepicker",(function(){var o,r=$(this).closest("th").find(".notThisValueFilter");o=r.length>0&&"!="===$(r).val()&&""!==this.value?JSON.stringify({operator:"!=",search:this.value}):this.value,t.search()!==this.value&&t.search(o).draw(),e&&(i[e.id]={value:e.value,text:e.options[e.selectedIndex].text}),a&&(i[a.id]={value:a.value}),localStorage.setItem("filterItem",JSON.stringify(i))}))}));var c=new Date,d=`${c.getDate()}-${c.getMonth()+1}-${c.getFullYear()} ${c.getHours()}:${c.getMinutes()}:${c.getSeconds()}`;$(".printButtonPosition").length>0&&(new $.fn.dataTable.Buttons(s,{buttons:[{extend:"print",text:' ',titleAttr:"Print",className:"btn btn-default btn-sm",messageTop:"Printed On: "+d,title:"",footer:!0,autoPrint:!0,exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}},messageTop:function(){return void 0!==$("#DtExportTopMessage").html()?$("#DtExportTopMessage").html():"

"+document.title+"


Printed On: "+d+"


"}},{extend:"copy",text:' ',titleAttr:"Copy",className:"btn btn-default btn-sm",footer:!0,exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}}},{extend:"excel",text:' ',titleAttr:"Excel",className:"btn btn-default btn-sm",footer:!0,exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}},messageTop:function(){if(void 0!==$("#DtExportTopMessage").html())return $("#DtExportTopMessage").html()}},{extend:"pdf",text:' ',titleAttr:"PDF",className:"btn btn-default btn-sm",exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}},messageTop:function(){if(void 0!==$("#DtExportTopMessage").html())return $("#DtExportTopMessage").html()}},{extend:"colvis",text:' ',className:"btn btn-default btn-sm",collectionLayout:"fixed"}]}),s.buttons().container().appendTo(".printButtonPosition")),$("#dataTableWithAjaxExtend tbody").on("click",".has-child-row",(function(){var t=$(this).closest("tr"),e=s.row(t),a=$(this).attr("data-parent-product-id"),o=$("#productReportWarehouseSelection").select2("data")[0].id,r=$(this).text(),n=this;e.child.isShown()?(e.child.hide(),t.removeClass("shown")):($(n).html(`${r} `),BMS.fn.get(`getChildProductData&pid=${a}&wid=${o}`,(function(a){0==a?BMS.fn.alertError("Sorry! no item found."):(e.child(function(t){var e=s.columns().visible(),a="";return t.forEach((t=>{a+='',t.forEach(((t,o)=>{var r=s.columns().header()[o].className;a+=e[o]?`${t}`:""})),a+=""})),$(a).toArray()}(a)).show(),t.addClass("shown"),$("tr.childRow").fadeIn("slow")),$(n).html(`${r}`)})))}))},select2:function(t,e="",a=""){var o=$(t).attr("select2-ajax-url"),r=$(t).attr("select2-minimum-input-length"),n="true"===$(t).attr("select2-tag"),l="false"!==$(t).attr("closeOnSelect"),s="";s=void 0===$(t).attr("select2-create-new-url")?"":` `,$(document).on("keyup",".select2-search__field",(function(t){"Enter"===t.key&&$(".createNewSelect2Item").click()}));var i=$(t).select2({placeholder:$(t).children("option:first").html()?$(t).children("option:first").html():"Select Options",allowClear:!0,closeOnSelect:l,tags:n,minimumInputLength:r,language:{noResults:function(){return s}},escapeMarkup:function(t){return t},ajax:{url:o,dataType:"json",delay:250,processResults:function(t){return{results:t}},cache:!0},templateResult:function(t){if(!t.id)return t.text;if("object"==typeof t.text){var e=t.text,a="";return a+=`
\n
${e[0]}
\n
Cost
\n
Price
\n
Stock
\n
Brand
\n
\n `,a+=`
\n
${e[1]}
\n
${e[2]}
\n
${e[3]}
\n
${e[4]}
\n
${e[5]}
\n
\n `}return t.text}});if(""!==a&&""===e)$.ajax({type:"get",url:o+"&q="+a}).then((function(t){if(void 0!==(t=JSON.parse(t)[0])){var e=new Option(t.text,t.id,!0,!0);i.append(e).trigger("change")}}));else if(""!==e&&i.find(":selected").val()!==e){var c=new Option(a,e,!0,!0);i.append(c).trigger("change")}},get:function(t,e){$.ajax({url:full_website_address+`/info/?module=data&page=${t}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,a){e(t)},error:function(){e("")}})}},BMS.fn=BMS.FUNCTIONS,BMS.MAIN={printPage:function(t,e,a=function(){}){e.preventDefault();var o=document.createElement("iframe");o.onload=function(){this.contentWindow.onbeforeunload=function(){$(".dynamic-container > iframe").remove(),a(!0)},this.contentWindow.onafterprint=function(){$(".dynamic-container > iframe").remove(),a(!0)},this.contentWindow.focus(),this.contentWindow.print()},o.style.position="fixed",o.style.right="0",o.style.bottom="0",o.style.width="0",o.style.height="0",o.style.border="0",o.src=t,$(".dynamic-container").append(o)},addTariffChargesRow:function(t){$(t).append(`

\n
\n \n
\n
\n \n
\n
\n \n
\n
`)}},BMS.PRODUCT={isExists:function(t,e=".productID"){return $(e).filter((function(){return this.value===t})).length>0},validationCheck:function(t,e,a){if(this.isExists(t.pid))return alert(`The product (${t.pn}) is already in the list.`);if(void 0===t.pv)return a(t);var o="",r={},n=[],l={};$.each(t.pv,(function(t,e){Array.isArray(r[e.mk])?r[e.mk].includes(e.mv)||r[e.mk].push(e.mv):r[e.mk]=[e.mv],"DV"===e.t?n.push(e.mv):Array.isArray(l[e.id])?l[e.id].push(e.mv):l[e.id]=[e.mv]})),$.each(r,(function(t,e){o+=`
\n \n
\n \n
\n
"})),Swal.fire({title:"Select Variation",html:"for "+t.pn+"

"+o,showCloseButton:!0,showCancelButton:!0,focusConfirm:!1,confirmButtonText:"Ok"}).then((t=>{if(t.isConfirmed){var a=$("#variationSelection select"),o=[];$.each(a,(function(){""!==this.value&&o.push(this.value)}));var r="";$.each(l,(function(t,e){if(o.every((t=>e.includes(t))))return r=t,!1})),""===r||0===o.length?Swal.fire("Sorry! no product found"):e.addProduct(r)}}))},parseProductList:function({category:t="",brand:e="",edition:a="",generic:o="",author:r=""},n){$.ajax({url:full_website_address+`/info/?module=data&page=productList&catId=${t}&brand=${e}&edition=${a}&generic=${o}&author=${r}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,e){n(t)}})},showProduct:function({container:t="#productListContainer",category:e="",brand:a="",edition:o="",generic:r="",author:n=""}=""){this.parseProductList({category:e,brand:a,edition:o,generic:r,author:n},(e=>{if(null!=e){var a="";e.forEach((t=>{var e=full_website_address;t.v&&t.v>0?e+="/images/?for=products&id="+t.id+"&q=YTozOntzOjI6Iml3IjtpOjIwMDtzOjI6ImloIjtpOjIyMDtzOjI6ImlxIjtpOjcwO30=&v="+t.v:e+="/assets/images/noimage.png",a+=" "})),$(t).html(a)}else $(t).html("
Sorry! No products found in this criteria.
")}))},getDetails:function(t,e){$.ajax({url:full_website_address+`/info/?module=data&page=productDetails&product_id=${t}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,a){e(t)}})},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t;""!==a?this.getDetails(a,(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{if("1"!==t.hed){var e=t.iq?parseFloat(t.iq).toFixed(0):1,a=`\n \n ${t.pn}\n \n ${t.pu}\n \n \n \n \n `;$("#productTable > tbody").append(a)}else BMS.fn.alertError("Sorry! The product which have expiry date or batch number, can not be added in sub/bundle product.")})),$("#selectProduct").empty()})),!1===e&&$("#productTable > tbody tr:last").find(".productQnt").select()})):alert("Please select a product")},getListByGeneric:function(t){BMS.fn.select2("#productGenericFilter",t,t)},productUnitCheck:function(t){this.getDetails({product_id:$(t).closest("tr").find(".productID").val(),unit:$(t).val()},(e=>{$(t).closest("tr").find(".productSalePrice").val(e[0].sp)}))}},BMS.POS={clearScreen:function(){$(".dynamic-container").slideUp(350,(function(){var t=new Date;$("#salesDate").val(t.toISOString().split("T")[0]),$("#tariffCharges .row").not("div:first").remove(),$(".tariffChargesName").val("").change();$(".paymentMethodBox").html('
\n
\n \n \n
\n
\n \n \n
\n \n
\n \n \n
\n
'),$("#orderDiscountValue, #shippingCharge, .posSalePaymentAmount, #adjustAmount, #salesNote").val(""),$("#shippingCharge").removeClass("shippingChargeEdited"),$(".posSalePaymentAmount").removeClass("disablePaymentAmountAutoChange"),$("#productTable > tbody").html(""),$("#editSalesId").remove(),$("#payment .modal-footer").html('\n \n \n \n \n '),$("input:radio, input:checkbox").prop("checked",!1),BMS.fn.select2("#customers",1,"Walk-in Customer"),BMS.POS.grandTotal(),BMS.POS.disableEnableWCSelect()})).slideDown(500)},getProductDetails:function({product_id:t,warehouse_id:e,customer_id:a="",qnt:o="",batch:r="",packet:n=""},l){$.ajax({url:full_website_address+`/info/?module=data&page=productDetailsForPos&product_id=${t}&warehouse_id=${e}&cid=${a}&pqnt=${o}&batch=${r}&packet=${n}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,e){l(t)}})},disableEnableWCSelect:function(){$(".productQnt").length>0?$("#customers, #warehouse").prop("disabled",!0):$("#customers, #warehouse").prop("disabled",!1)},grandTotal:function(t=""){var e=0,a=0;$(".productQnt").each((function(){e+=Number($(this).val()),a+=1})),$(".totalItemAndQnt").html(a+" ("+e+")");var o=0;$(".subtotalCol").each((function(){o+=Number($(this).html())})),$(".totalAmount").html(o.toFixed(2));var r=$("#orderDiscountValue").val(),n=BMS.FUNCTIONS.calculateDiscount(o,r);$(".totalOrderDiscountAmount").html("(-) "+(o-n).toFixed(2));var l=0;if($("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(n,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),l+=Number(e)})),$(".totalTariffChargesAmount").html("(+) "+l.toFixed(2)),!0===$("#payment").hasClass("in")){if(!1===$("#shippingCharge").is(":focus")&&($("#totalPackets").is(":focus")||$("#packetShippingRate").is(":focus"))){var s=$("#totalPackets").val()*$("#packetShippingRate").val();$("#shippingCharge").val(s)}}else{var i=0;$(".productPacket").each((function(){i+=Number($(this).val())})),$(".displayTotalPackets").html(i.toFixed(2)),$("#totalPackets").val(Math.round(i));s=$("#totalPackets").val()*$("#packetShippingRate").val();$("#shippingCharge").val(s)}var c=(Number(l)+Number(n)).toFixed(2);$(".netTotalAmount").html(c),$("#finalizeSale > tbody > tr:nth-child(1) > td:nth-child(3)").html(c);var d=Number($("#shippingCharge").val()),u=Number(c)+d;"1"===config.posSaleAutoAdjustAmount&&$("#adjustAmount:not(.disableAdjustAmountAutoChange)").val(parseFloat(parseFloat(u).toFixed()-u).toFixed(2));var p=Number($("#adjustAmount").val());u=parseFloat(Number(c)+d+Number(p)).toFixed(2);if("1"===config.posSaleAutoMarkAsPaid){var m=sumInputs(".disablePaymentAmountAutoChange"),h=0;(u>0&&u>m||u<0&&uf?u-f:0;$("#finalizeSale > tbody > tr:nth-child(4) > td:nth-child(2)").html(u),$("#finalizeSale > tbody > tr:nth-child(6) > td:nth-child(2)").html(v),$("#finalizeSale > tbody > tr:nth-child(7) > td:nth-child(2)").html(g),$("#quickPayableAmount").html(u),!0===$("#payment").hasClass("in")&&(u>0&&uf)&&(Swal.fire({title:"Paid amount can not be more then Grand total.",icon:"error"}),$(".posSalePaymentAmount").last().val(0))},editProductItemDetails:function(t,e){$("#productSaleDetails .modal-title").html(e),$("#productSaleDetails .rowId").val(t);var a=$(`#${t}`);$("#productSaleDetails #productSaleItemPrice").val(a.find(".netSalesPrice").val()),$("#productSaleDetails #productSaleItemDiscount").val(a.find(".productDiscount").val()),$("#productSaleDetails #productSaleItemPacket").val(a.find(".productPacket").val()),$("#productSaleDetails #productSaleItemDetails").val(a.find(".productItemDetails").val())},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t;""!==a?($("#selectProduct").val()>0&&$("#selectProduct").html(""),this.getProductDetails({product_id:a,warehouse_id:$("#warehouseId").val(),customer_id:$("#customersId").val()},(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=0,o=t.iq?parseFloat(t.iq).toFixed(0):1;t.pq>0&&(e=(o/Number(t.pq)).toFixed(2));var r=t.pd?t.pd:"0",n=BMS.FUNCTIONS.calculateDiscount(t.sp,r),l="";l=Number(n)===Number(t.sp)?parseFloat(t.sp).toFixed(2):""+parseFloat(n).toFixed(2)+""+parseFloat(t.sp).toFixed(2)+"";var s=Date.now()+t.pid,i=null===t.gn?"":`${t.gn}`,c=` \n \n \n ${t.pn}\n ${i}\n \n ${l} \n \n ${t.pu} \n ${parseFloat(Number(n)*Number(o)).toFixed(2)} \n \n \n \n \n \n \n \n \n \n \n \n \n `;$("#productTable > tbody").append(c)}))})),!1===e&&$("#productTable > tbody tr:last").find(".productQnt").select(),this.grandTotal(),this.disableEnableWCSelect()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})}))):alert("Please select a product")},addReturnProduct:function(t,e,a,o,r,n,l,s,i,c){if(!BMS.PRODUCT.isExists(t)||confirm(`The product (${e}) is already in the list. Do you want to add it again?`)){var d=Date.now()+t,u=` \n \n \n ${e}\n ${null===a?"":`${a}`}\n \n ${s} \n \n ${r} \n -${c} \n \n \n \n \n \n \n \n \n \n \n \n `;$("#productTable > tbody").append(u),this.grandTotal()}},productQntCheck:function(t,e){var a=$(t).closest("tr").find(".netSalesPrice").val(),o=$(t).val(),r=$(t).closest("tr").find(".productDiscount").val(),n=$(t).closest("tr").find("td.subtotalCol"),l=$(t).closest("tr").find(".productPacket"),s=t;0==o&&(Swal.fire({title:"Error!",text:"Product qunatity can not be zero (0)",icon:"error"}),$(t).val(1),o=1),this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#warehouseId").val(),qnt:o,unit:$(t).closest("tr").find(".productItemUnit").val()},(e=>{void 0!==e.error&&!0===e.error&&($(s).val(e.stq),o=e.stq,Swal.fire({title:"Error!",text:e.msg,icon:"error"})),(e=e[0]?e[0]:e).so?$(t).closest("tr").css("background-color","pink"):$(t).closest("tr").css("background-color","white"),$(n).html((BMS.FUNCTIONS.calculateDiscount(a,r)*o).toFixed(2));var i=0;Number(e.pq)>0&&(i=(o/Number(e.pq)).toFixed(2)),l.val(i),this.grandTotal()}))},productPacketCheck:function(){var t=$(selector).closest("tr").find(".netSalesPrice").val(),e=$(selector).val(),a=$(selector).closest("tr").find(".productDiscount").val(),o=$(selector).closest("tr").find("td.subtotalCol"),r=$(selector).closest("tr").find(".productQnt"),n=$(selector).closest("tr").find(".productPacket");this.getProductDetails({product_id:$(selector).closest("tr").find(".productID").val(),warehouse_id:$("#warehouseId").val(),packet:e},(l=>{if(void 0!==l.error&&!0===l.error){$(r).val(l.having_item_quantity),$(o).html((BMS.FUNCTIONS.calculateDiscount(t,a)*l.having_item_quantity).toFixed(2));var s=0;Number(l.product_packet_quantity)>0&&(s=(l.having_item_quantity/Number(l.product_packet_quantity)).toFixed(2)),n.val(s),Swal.fire({title:"Error!",text:l.msg,icon:"error"})}else{var i=Math.round(Number(l.product_packet_quantity)*e);i>0&&($(r).val(i),$(o).html((BMS.FUNCTIONS.calculateDiscount(t,a)*i).toFixed(2)))}this.grandTotal()}))},productDiscountCheck:function(t){var e=$("#productSaleItemPrice").val(),a=$("#productSaleItemDiscount").val();"Enter"===t.key&&a.indexOf("%")>1&&a.replace("%","")>=100?(Swal.fire({title:"Error!",text:"Discount Must be below of 100%",icon:"error"}),$("#productSaleItemDiscount").val(""),$("#productSaleItemDiscount").select(),t.preventDefault()):"Enter"===t.key&&Number(a)>=Number(e)&&a.indexOf("%")<1&&($("#productSaleItemDiscount").val(""),$("#productSaleItemDiscount").select(),"Enter"===t.key&&t.preventDefault(),Swal.fire({title:"Error!",text:"Discount Must be below of product sale price",icon:"error"}),t.preventDefault())},orderDiscountCheck:function(t,e){var a=$(".totalAmount").html(),o=$(t).val();o.indexOf("%")>1&&o.replace("%","")>=100?(Swal.fire({title:"Error!",text:"Discount Must be below of 100%",icon:"error"}),$(t).val(0),e.preventDefault()):Number(a)<0&&Number(o)>0?(Swal.fire({title:"Error!",text:"Discount must be a nagative amount in case of nagative total amount.",icon:"error"}),$(t).val(-Number(o)),e.preventDefault()):(Number(a)<0&&(Number(o)>0||Math.abs(Number(o))>=Math.abs(Number(a)))||Number(a)>0&&Number(o)>=Number(a)&&o.indexOf("%")<1)&&(Swal.fire({title:"Error!",text:"Discount Must be below of total amount.",icon:"error"}),$(t).val(0),e.preventDefault()),this.grandTotal()}},BMS.PURCHASE={getProductDetails:BMS.PRODUCT.getDetails,grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalPurchasePrice").html(e.toFixed(2));var a=BMS.FUNCTIONS.calculateDiscount(e,$("#purchaseDiscountValue").val());$(".totalPurchaseDiscount").html("(-) "+(e-a).toFixed(2));var o=0;$("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(a,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),o+=Number(e)})),$(".totalTariffCharges").html("(+) "+o.toFixed(2));var r=(Number(o)+Number(a)).toFixed(2);$(".netTotal").html(r),$("#purchaseNetTotal").val(r);var n=Number(r)+Number($("#purchaseShipping").val());$("#purchaseGrandTotal").val(n);var l=Number($("#purchasePaidAmount").val()),s=n<=l?0:n-l,i=n>=l?0:l-n;$("#purchaseChangeAmount").val(i),$("#purchaseDueAmount").val(s)},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productPurchasePrice").val(),a=$(t).closest("tr").find(".productQnt").val(),o=$(t).closest("tr").find(".productPurchaseDiscount").val(),r=$(t).closest("tr").find(".subTotal");return isNaN(a)?(alert("Product quantity must be a valid number."),void $(t).closest("tr").find(".productQnt").val(1)):a<1?(alert("Product quantity must be minimum of 1."),void $(t).closest("tr").find(".productQnt").val(1)):(""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productPurchasePrice").val(0)),o.indexOf("%")>1&&o.replace("%","")>=100?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of 100%")):Number(o)>Number(e)&&o.indexOf("%")<1?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of product purchase price")):void $(r).html((BMS.FUNCTIONS.calculateDiscount(e,o)*a).toFixed(2)))},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t;""!==a?this.getProductDetails(a,(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e="";void 0!==t.hed&&"1"===t.hed&&(e=``);var a=t.iq?parseFloat(t.iq).toFixed(0):1,o=` \n ${t.pn}\n ${e}\n \n ${t.pu}\n \n \n \n ${t.pp}\n \n \n \n `;$("#productTable > tbody").append(o)}))})),!1===e&&$("#productTable > tbody tr:last").find(".productQnt").select(),this.grandTotal(),$("#selectProduct").empty()})):alert("Please select a product")},productUnitCheck:function(t){var e=$(t).closest("tr").find(".productID").val(),a=this;$.ajax({url:full_website_address+"/info/?module=data&page=productUnitDetails&product_id="+e+"&unit="+$(t).val(),contentType:"application/json; charset=utf-8",dataType:"json",success:function(e,o){"success"==o&&($(t).closest("tr").find(".productPurchasePrice").val(e.pp),$(t).closest("tr").find(".productMainPurchasePrice").val(e.pp),a.calculateEachProduct(t),a.grandTotal())}})}},BMS.ORDER=Object.assign({},BMS.POS),BMS.ORDER.addProduct=function(t=""){var e=""===t?$("#selectProduct").val():t;""!==e?($("#selectProduct").val()>0&&$("#selectProduct").html(""),BMS.PRODUCT.getDetails(e,(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var a=0,o=t.iq?parseFloat(t.iq).toFixed(0):1;t.pq>0&&(a=(o/Number(t.pq)).toFixed(2));var r=t.pd?t.pd:"0",n=BMS.FUNCTIONS.calculateDiscount(t.sp,r),l="";l=Number(n)===Number(t.sp)?parseFloat(t.sp).toFixed(2):""+n+""+parseFloat(t.sp).toFixed(2)+"";var s=Date.now()+t.pid,i=` \n \n \n ${t.pn}\n \n ${l} \n \n ${t.pu} \n ${parseFloat(Number(n)*Number(o)).toFixed(2)} \n \n \n \n \n \n \n \n \n \n \n \n \n `;$("#productTable > tbody").append(i)}))})),$("#productTable > tbody tr:last").find(".productQnt").select(),this.grandTotal(),this.disableEnableWCSelect()}))):alert("Please select a product")},BMS.ORDER.productQntCheck=function(t,e){var a=$(t).closest("tr").find(".netSalesPrice").val(),o=$(t).val(),r=$(t).closest("tr").find(".productDiscount").val(),n=$(t).closest("tr").find("td.subtotalCol");0==o&&(Swal.fire({title:"Error!",text:"Product qunatity can not be zero (0)",icon:"error"}),$(t).val(1),o=1),$(n).html((BMS.FUNCTIONS.calculateDiscount(a,r)*o).toFixed(2)),this.grandTotal()},BMS.STOCK_TRANSFER={getProductDetails:BMS.POS.getProductDetails,grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalPurchasePrice").html(e.toFixed(2))},disableEnableWarehouseSelect:function(){$(".productQnt").length>0?$("#stockTransferFromWarehouse, #stockTransferToWarehouse").prop("disabled",!0):$("#stockTransferFromWarehouse, #stockTransferToWarehouse").prop("disabled",!1)},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productPurchasePrice").val(),a=$(t).closest("tr").find(".productQnt").val(),o=$(t).closest("tr").find(".productPurchaseDiscount").val(),r=$(t).closest("tr").find(".subTotal");return a<1?(alert("Product quantity must be minimum of 1."),void $(t).closest("tr").find(".productQnt").val(1)):(""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productPurchasePrice").val(0)),o.indexOf("%")>1&&o.replace("%","")>=100?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of 100%")):Number(o)>Number(e)&&o.indexOf("%")<1?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of product purchase price")):void $(r).html((BMS.FUNCTIONS.calculateDiscount(e,o)*a).toFixed(2)))},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t,o=$("#stockTransferFromWarehouseId").val();""!==o?""!==a?this.getProductDetails({product_id:a,warehouse_id:o,qnt:1},(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e="";void 0!==t.hed&&"1"===t.hed&&(e=``);var a=t.iq?parseFloat(t.iq).toFixed(0):1,o=`\n \n ${t.pn}\n ${e}\n \n ${t.pu}\n \n \n \n ${parseFloat(t.pp*a).toFixed(2)}\n \n \n \n `;$("#productTable > tbody").append(o)}))})),this.grandTotal(),this.disableEnableWarehouseSelect(),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product"):alert("Please select an warehouse to add product")},productUnitCheck:function(t){var e=t;this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#stockTransferFromWarehouseId").val(),qnt:$(t).closest("tr").find(".productQnt").val(),unit:$(t).val()},(t=>{void 0!==t.error&&!0===t.error&&(console.log(t.stq),$(e).closest("tr").find(".productQnt").val(t.stq),Swal.fire({title:"Error!",text:t.msg,icon:"error"})),$(e).closest("tr").find(".productPurchasePrice").val(parseFloat(t.pp).toFixed(2)),this.calculateEachProduct(e),this.grandTotal()}))},productQntCheck:function(t){var e=$(t).val(),a=$(t);isNaN(e)&&(alert("Product quantity must be a valid number."),$(t).val(1),e=1),e<1&&(Swal.fire({title:"Error!",text:"Product qunatity must be at least one",icon:"error"}),$(t).val(1),e=1),this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#stockTransferFromWarehouseId").val(),qnt:e,unit:$(t).closest("tr").find(".productItemUnit").val()},(t=>{void 0!==t.error&&!0===t.error&&($(a).val(t.stq),Swal.fire({title:"Error!",text:t.msg,icon:"error"})),this.calculateEachProduct(a),this.grandTotal()}))}},BMS.STOCK_ENTRY={getProductDetails:BMS.PRODUCT.getDetails,grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalPurchasePrice").html(e.toFixed(2))},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productPurchasePrice").val(),a=$(t).closest("tr").find(".productQnt").val(),o=$(t).closest("tr").find(".productPurchaseDiscount").val(),r=$(t).closest("tr").find(".subTotal");return a<1&&"Production"===$("#stockEntryType").val()?(alert("Negative quantity is not valid for Production of stock."),void $(t).closest("tr").find(".productQnt").val(1)):(""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productPurchasePrice").val(0)),o.indexOf("%")>1&&o.replace("%","")>=100?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of 100%")):Number(o)>Number(e)&&o.indexOf("%")<1?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of product purchase price")):void $(r).html((BMS.FUNCTIONS.calculateDiscount(e,o)*a).toFixed(2)))},addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t;""!==$("#stockTransferFromWarehouseId").val()?""!==e?this.getProductDetails(e,(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e="";void 0!==t.hed&&"1"===t.hed&&(e=``);var a=t.iq?parseFloat(t.iq).toFixed(0):1,o=`\n \n ${t.pn}\n ${e}\n \n ${t.pu}\n \n \n \n ${parseFloat(t.pp*a).toFixed(2)}\n \n \n \n `;$("#productTable > tbody").append(o)}))})),this.grandTotal(),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product"):alert("Please select an warehouse to add product")}},BMS.RETURN={getProductReturnDetails:function({product_id:t,customer_id:e},a){$.ajax({url:full_website_address+"/info/?module=data&page=productDetailsForReturn&product_id="+t+"&customer_id="+e,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,e){a(t)}})},grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalReturnPrice").html(e.toFixed(2));var a=BMS.FUNCTIONS.calculateDiscount(e,$("#returnDiscountValue").val());$(".totalReturnDiscount").html("(-) "+(e-a).toFixed(2));var o=0;$("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(a,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),o+=Number(e)})),$(".totalTariffCharges").html("(+) "+o.toFixed(2));var r=(Number(o)+Number(a)).toFixed(2);$(".netTotal").html(r),$("#returnNetTotal").val(r);var n=$("#returnShipping").val(),l=Number(r)+Number(n)-Number($("#returnSurcharge").val());$("#returnGrandTotal").val(l);var s=Number($("#returnPaidAmount").val()),i=l<=s?0:l-s,c=l>=s?0:s-l;$("#returnChangeAmount").val(c),$("#returnDueAmount").val(i)},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productReturnPrice").val(),a=$(t).closest("tr").find(".productQnt").val(),o=$(t).closest("tr").find(".productReturnDiscount").val(),r=$(t).closest("tr").find(".subTotal");if(a<1)return alert("Product quantity must be minimum of 1."),void $(t).closest("tr").find(".productQnt").val(1);""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productReturnPrice").val(0)),o.indexOf("%")>1&&o.replace("%","")>=100?alert("Discount Must be below of 100%"):Number(o)>Number(e)&&o.indexOf("%")<1?alert("Discount Must be below of product return price"):$(r).html((BMS.FUNCTIONS.calculateDiscount(e,o)*a).toFixed(2))},addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t,a=$("#returnCustomer").val();""!==a?""!==e?this.getProductReturnDetails({product_id:e,customer_id:a},(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=t.pd?t.pd:"0",a=parseFloat(BMS.FUNCTIONS.calculateDiscount(t.sp,e)).toFixed(2),o="";void 0!==t.hed&&"1"===t.hed&&(o=``);var r=`\n \n ${t.pn}
(Purchased: ${t.prq} Returned: ${t.rtq})\n ${o}\n \n ${t.pu}\n \n \n \n ${a}\n \n \n \n `;$("#productTable > tbody").append(r)}))})),this.grandTotal(),$("#selectProduct").empty()})):alert("Please select a product"):alert("Please select the customer")},productUnitCheck:function(t){var e=t;this.getProductReturnDetails({product_id:$(t).closest("tr").find(".productID").val(),customer_id:$("#returnCustomer").val(),unit:$(t).val()},(t=>{var a=t[0];$(e).closest("tr").find(".productReturnPrice").val(parseFloat(a.sp).toFixed(2));var o=a.pn+"
(Purchased: "+parseFloat(a.prq).toFixed(2)+", Returned: "+parseFloat(a.rtq).toFixed(2)+")";$(e).closest("tr").find(".productDetails").html(o),this.calculateEachProduct(e),this.grandTotal()}))}},BMS.WASTAGE_SALE={grandTotal:function(){var t=0;$(".wastageSaleItemQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".wastageSaleItemQnt").length+"("+t+")");var e=0;$(".wastageSaleItemSubtotal").each((function(){e+=Number($(this).text())})),$(".totalWastageSalePrice").html(e.toFixed(2));var a=BMS.FUNCTIONS.calculateDiscount(e,$("#wastageSaleDiscountValue").val());$(".totalWastageSaleDiscount").html("(-) "+(e-a).toFixed(2));var o=0;$("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(a,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),o+=Number(e)})),$(".totalTariffCharges").html("(+) "+o.toFixed(2));var r=(Number(o)+Number(a)).toFixed(2);$(".netTotal").html(r),$("#wastageSaleNetTotal").val(r);var n=$("#wastageSalePaidAmount").val(),l=n tbody").append(' 0.00 '),$(".wastageSaleItem").focus(),this.grandTotal()}},BMS.SPECIMEN_COPY={getProductDetails:BMS.POS.getProductDetails,disableEnableWarehouseSelect:function(){$(".productQnt").length>0?$("#scTransferWarehouse").prop("disabled",!0):$("#scTransferWarehouse").prop("disabled",!1)},addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t,a=$("#scTransferWarehouse").val();""!==a?""!==e?this.getProductDetails({product_id:e,warehouse_id:a},(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=t.iq?parseFloat(t.iq).toFixed(0):1,a=` \n ${t.pn}\n \n ${t.pu}\n \n \n \n `;$("#productTable > tbody").append(a)}))})),this.disableEnableWarehouseSelect(),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product"):alert("Please select an warehouse to add product")},productUnitCheck:function(t){this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#scTransferWarehouse").val(),qnt:$(t).closest("tr").find(".productQnt").val(),unit:$(t).val()},(e=>{void 0!==e.error&&!0===e.error&&($(t).closest("tr").find(".productQnt").val(e.stq),Swal.fire({title:"Error!",text:e.msg,icon:"error"}))}))},productQntCheck:function(t){var e=$(t).val();isNaN(e)&&(alert("Product quantity must be a valid number."),$(t).val(1),e=1),e<1&&(Swal.fire({title:"Error!",text:"Product qunatity must be at least one",icon:"error"}),$(t).val(1),e=1),this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#scTransferWarehouse").val(),qnt:e,unit:$(t).closest("tr").find(".productItemUnit").val()},(e=>{void 0!==e.error&&!0===e.error&&($(t).val(e.stq),Swal.fire({title:"Error!",text:e.msg,icon:"error"}))}))}},BMS.SC_DISTRIBUTION={getProductDetails:BMS.PRODUCT.getDetails,addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t;""!==e?this.getProductDetails(e,(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=t.iq?parseFloat(t.iq).toFixed(0):1,a=`\n \n ${t.pn}\n \n ${t.pu}\n \n \n \n `;$("#productTable > tbody").append(a)}))})),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product")}}; \ No newline at end of file +"use strict";var updateSDPTimeout,BMS=BMS||{};BMS.FUNCTIONS={getDateTime:function(){var t=new Date;return t.getFullYear()+"-"+t.getMonth()+"-"+t.getDay()+"-"+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()},calculateDiscount:function(t,e=null){return""===e||null===e||"null"===e||0===e?parseFloat(Number(t)):"string"==typeof e&&e.indexOf("%")>0?parseFloat(Number(t)-Number(e.replace("%",""))/100*Number(t)):parseFloat(Number(t)-Number(e))},calculateTarifCharges:function(t,e=null){return""===e||null===e||"null"===e||0===e?0:"string"==typeof e&&e.indexOf("%")>0?(Number(e.replace("%",""))/100*Number(t)).toFixed(2):Number(e).toFixed(2)},datePicker:function({selector:t=".datePicker",format:e="YYYY-MM-DD",timePicker:a=!1}=""){$(t).daterangepicker({autoUpdateInput:!1,singleDatePicker:!0,showDropdowns:!0,timePicker:a,timePicker24Hour:!0,autoApply:!0,parentEl:"div.dynamic-container",drops:"auto",locale:{format:e,cancelLabel:"Clear"}}),$(t).on("apply.daterangepicker",(function(t,a){$(this).val(a.startDate.format(e))})),$(t).on("cancel.daterangepicker",(function(t,e){$(this).val("")}))},dateRangePicker:function({selector:t=".dateRangePicker",format:e="YYYY-MM-DD",timePicker:a=!1}=""){$(t).daterangepicker({autoUpdateInput:!1,showDropdowns:!0,drops:"auto",linkedCalendars:!1,timePicker:a,timePicker24Hour:!0,parentEl:"div.dynamic-container",locale:{format:e,cancelLabel:"Clear"}}),$(t).on("apply.daterangepicker",(function(t,a){$(this).val(a.startDate.format(e)+" - "+a.endDate.format(e))})),$(t).on("cancel.daterangepicker",(function(t,e){$(this).val("")}))},dateRangePickerPreDefined:function({selector:t=".dateRangePickerPreDefined",format:e="YYYY-MM-DD",timePicker:a=!1,ranges:r={}}=""){$(t).daterangepicker({autoUpdateInput:!1,showDropdowns:!0,drops:"auto",alwaysShowCalendars:!0,linkedCalendars:!1,timePicker:a,timePicker24Hour:!0,parentEl:"div.dynamic-container",locale:{format:e,cancelLabel:"Clear"},ranges:Object.keys(r).length>0?r:{Today:[moment(),moment()],"This Month":[moment().startOf("month"),moment().endOf("month")],"Last Month":[moment().subtract(1,"month").startOf("month"),moment().subtract(1,"month").endOf("month")],"This Year":[moment().startOf("year"),moment().endOf("year")],"Last Year":[moment().subtract(1,"year").startOf("year"),moment().subtract(1,"year").endOf("year")],All:[moment(0),moment().subtract("year").endOf("day")]}}),$(t).on("apply.daterangepicker",(function(t,a){$(this).val(a.startDate.format(e)+" - "+a.endDate.format(e))})),$(t).on("cancel.daterangepicker",(function(t,e){$(this).val("")}))},multiDatePicker:function({selector:t=".multiDatePicker",format:e="yyyy-mm-dd"}=""){$(t).datepicker({multidate:!0,multidateSeparator:", ",format:e,todayHighlight:!0})},getCookie:function(t){var e=decodeURIComponent(`; ${document.cookie}`).split(`; ${t}=`);if(e.length>1)return e[1].split("; ")[0]},copy:function(t){var e=$(t);e.select(),navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e.html()],{type:"text/html"})})])},_n:function(t){let e=BMS.fn.getCookie("lang"),a={bn_BD:"bn-BD"};return void 0!==e?new Intl.NumberFormat(a[e]).format(t):t},createNewSelect2Item:function(t){var e=$(t).attr("select2-create-new-url"),a=$(".select2-search__field").val(),r=encodeURIComponent(a);console.log(t),$("body").trigger("mousedown"),$("#modalDefault").modal("show").find(".modal-content").load(e+"&val="+r),$("#modalDefault").on("hidden.bs.modal",(function(e){BMS.fn.select2(t,"",a)}))},play:function(t,e=!1){var a=`${full_website_address}/assets/sounds/${t}.mp3`,r=new window.Audio(a);$(document).on("pauseAudio",(function(){r.pause()})),r.loop=e,r.play()},pause:function(){$(document).trigger("pauseAudio")},startTimer(t="#timer"){var e=(new Date).getTime();return setInterval((function(){var a=((new Date).getTime()-e)/1e3,r=Math.floor(a%60).toString().padStart(2,0),o=Math.floor(a%3600/60).toString().padStart(2,0),n=Math.floor(a/3600).toString().padStart(2,0);$(t).html(`${n}:${o}:${r}`)}),1e3)},stopTimer:function(t){clearInterval(t)},notify:function(t){Swal.fire({toast:!0,position:"top-right",timer:5e3,timerProgressBar:!0,iconHtml:'',didOpen:t=>{t.addEventListener("mouseenter",Swal.stopTimer),t.addEventListener("mouseleave",Swal.resumeTimer),this.play("beep")},title:` ${t} `,showConfirmButton:!1,onClose:$("body").css("padding","0px")})},desktopNotify:function(t,e="",a=""){"granted"!==Notification.permission?Notification.requestPermission():new Notification(t,{icon:e,body:a}).onclick=function(){window.focus(),this.close()}},alertError:function(t){Swal.fire({toast:!0,position:"top-right",icon:"error",timer:5e3,timerProgressBar:!0,didOpen:t=>{t.addEventListener("mouseenter",Swal.stopTimer),t.addEventListener("mouseleave",Swal.resumeTimer),this.play("warning")},title:` ${t} `,showConfirmButton:!1,onClose:$("body").css("padding","0px")})},alertSuccess:function(t,e=!0){Swal.fire({toast:!0,position:"top-right",icon:"success",timer:5e3,timerProgressBar:!0,didOpen:t=>{t.addEventListener("mouseenter",Swal.stopTimer),t.addEventListener("mouseleave",Swal.resumeTimer),e&&this.play("warning")},title:` ${t} `,showConfirmButton:!1,onClose:$("body").css("padding","0px")})},dTable:function(t){var e="";e=void 0!==$(t).attr("dt-data-url")?$(t).attr("dt-data-url"):DataTableAjaxPostUrl;var a=!0;void 0!==$(t).attr("dt-disable-on-type-search")&&(a=!1);var r=void 0!==$(".defaultOrder").html()?[[$("th.defaultOrder").index(),"desc"]]:[1,"desc"],o="undefined"!=typeof defaultiDisplayLength?defaultiDisplayLength:15,n=void 0!==$(t).attr("dt-height")?$(t).attr("dt-height"):"60vh",s=$(t).DataTable({processing:!0,serverSide:!0,responsive:!0,scrollX:!0,scrollY:n,scrollCollapse:!0,stateSave:!0,search:{return:!0},initComplete:function(t,e){if(a){var r=new $.fn.dataTable.Api(t);$(".dataTables_filter input").unbind(),$(".dataTables_filter input").bind("keyup",(function(t){13==(t.keyCode||t.which)&&r.search(this.value).draw()}))}},stateSaveParams:function(t,e){var a=this.api();e.search.search="",e.length=15,e.order=r,e.columns.forEach(((t,r)=>{var o=a.column(r).footer(),n=$(o).find("select");n.length>0&&(e.columns[r].search.text=$(n).find(":selected").text())}))},order:r,select:{style:"multi+shift",selector:"td:first-child"},language:Object.keys(language).length>0?language:{processing:"Processing..."},aLengthMenu:[[15,100,500,1500,5e3,-1],[15,100,500,1500,5e3,"All"]],iDisplayLength:o,ajax:{url:e,type:"post"},columnDefs:[{targets:"countTotal",className:"text-right",render:$.fn.dataTable.render.number(",",".",2)},{targets:"highlightWithCountTotal",className:"text-right highlight",render:$.fn.dataTable.render.number(",",".",2)},{targets:"text-right",className:"text-right"},{targets:"sort",orderable:!0,searchable:!0},{targets:"no-sort",orderable:!1},{targets:0,orderable:!1,checkboxes:{selectRow:!0}},{targets:"px85",className:"px85"},{targets:"px120",className:"px120"},{targets:"px160",className:"px160"},{targets:"px180",className:"px180"},{targets:"px200",className:"px200"},{targets:"px220",className:"px220"},{targets:"px320",className:"px320"},{visible:!1,targets:"hideit"},{targets:"dtDescription",className:"dtDescription"},{targets:"highlight",className:"highlight"}],footerCallback:function(t,e,a,r,o){this.api().columns(".countTotal, .highlightWithCountTotal",{page:"current"}).every((function(){var t=this.data().reduce((function(t,e){return(parseFloat(t)||0)+(parseFloat(e)||0)}),0);$(this.footer()).html(t.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,"))}))}}),l=s.state.loaded();l=null!==l?l.columns:void 0,s.columns().every((function(t){var e=this,a=$("select, textarea, input:not(.notThisValueFilter)",this.footer());if(void 0!==l&&a.length>0){var r=l[t].search.search,o=void 0!==l[t].search.text?l[t].search.text:"";"SELECT"===a[0].nodeName?($(a).find("option[value='"+r+"']").remove(),$(a).append($(``))):$(a).val(r)}$("input, select, textarea",this.footer()).on("enter change clear apply.daterangepicker cancel.daterangepicker",(function(){var t,a=$(this).closest("th").find(".notThisValueFilter");t=a.length>0&&"!="===$(a).val()&&""!==this.value?JSON.stringify({operator:"!=",search:this.value}):this.value,e.search()!==this.value&&e.search(t).draw()}))}));var c=new Date,i=`${c.getDate()}-${c.getMonth()+1}-${c.getFullYear()} ${c.getHours()}:${c.getMinutes()}:${c.getSeconds()}`;$(".printButtonPosition").length>0&&(new $.fn.dataTable.Buttons(s,{buttons:[{extend:"print",text:' ',titleAttr:"Print",className:"btn btn-default btn-sm",messageTop:"Printed On: "+i,title:"",footer:!0,autoPrint:!0,exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}},messageTop:function(){return void 0!==$("#DtExportTopMessage").html()?$("#DtExportTopMessage").html():"

"+document.title+"


Printed On: "+i+"


"}},{extend:"copy",text:' ',titleAttr:"Copy",className:"btn btn-default btn-sm",footer:!0,exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}}},{extend:"excel",text:' ',titleAttr:"Excel",className:"btn btn-default btn-sm",footer:!0,exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}},messageTop:function(){if(void 0!==$("#DtExportTopMessage").html())return $("#DtExportTopMessage").html()}},{extend:"pdf",text:' ',titleAttr:"PDF",className:"btn btn-default btn-sm",exportOptions:{columns:":visible:not(.no-print):not(.dt-checkboxes-cell)",format:{footer:function(t,e,a){return $(a).prop("outerHTML").indexOf("no-print")>0?t.replace(t,""):t}}},messageTop:function(){if(void 0!==$("#DtExportTopMessage").html())return $("#DtExportTopMessage").html()}},{extend:"colvis",text:' ',className:"btn btn-default btn-sm",collectionLayout:"fixed"}]}),s.buttons().container().appendTo(".printButtonPosition")),$("#dataTableWithAjaxExtend tbody").on("click",".has-child-row",(function(){var t=$(this).closest("tr"),e=s.row(t),a=$(this).attr("data-parent-product-id"),r=$("#productReportWarehouseSelection").select2("data")[0].id,o=$(this).text(),n=this;e.child.isShown()?(e.child.hide(),t.removeClass("shown")):($(n).html(`${o} `),BMS.fn.get(`getChildProductData&pid=${a}&wid=${r}`,(function(a){0==a?BMS.fn.alertError("Sorry! no item found."):(e.child(function(t){var e=s.columns().visible(),a="";return t.forEach((t=>{a+='',t.forEach(((t,r)=>{var o=s.columns().header()[r].className;a+=e[r]?`${t}`:""})),a+=""})),$(a).toArray()}(a)).show(),t.addClass("shown"),$("tr.childRow").fadeIn("slow")),$(n).html(`${o}`)})))}))},select2:function(t,e="",a=""){var r=$(t).attr("select2-ajax-url"),o=$(t).attr("select2-minimum-input-length"),n="true"===$(t).attr("select2-tag"),s="false"!==$(t).attr("closeOnSelect"),l="";l=void 0===$(t).attr("select2-create-new-url")?"":` `,$(document).on("keyup",".select2-search__field",(function(t){"Enter"===t.key&&$(".createNewSelect2Item").click()}));var c=$(t).select2({placeholder:$(t).children("option:first").html()?$(t).children("option:first").html():"Select Options",allowClear:!0,closeOnSelect:s,tags:n,minimumInputLength:o,language:{noResults:function(){return l}},escapeMarkup:function(t){return t},ajax:{url:r,dataType:"json",delay:400,processResults:function(t){return{results:t}},cache:!0},templateResult:function(t){if(!t.id)return t.text;if("object"==typeof t.text){var e=t.text,a="";return a+=`
\n
${e[0]}
\n
Cost
\n
Price
\n
Stock
\n
Brand
\n
\n `,a+=`
\n
${e[1]}
\n
${e[2]}
\n
${e[3]}
\n
${e[4]}
\n
${e[5]}
\n
\n `}return t.text}});if(""!==a&&""===e)$.ajax({type:"get",url:r+"&q="+a}).then((function(t){if(void 0!==(t=JSON.parse(t)[0])){var e=new Option(t.text,t.id,!0,!0);c.append(e).trigger("change")}}));else if(""!==e&&c.find(":selected").val()!==e){var i=new Option(a,e,!0,!0);c.append(i).trigger("change")}},get:function(t,e){$.ajax({url:full_website_address+`/info/?module=data&page=${t}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,a){e(t)},error:function(){e("")}})}},BMS.fn=BMS.FUNCTIONS,BMS.MAIN={printPage:function(t,e,a=function(){}){e.preventDefault(),$(".dynamic-container > iframe").remove();var r=document.createElement("iframe");r.onload=function(){this.contentWindow.focus(),this.contentWindow.print(),a(!0)},r.style.position="fixed",r.style.right="0",r.style.bottom="0",r.style.width="0",r.style.height="0",r.style.border="0",r.src=t,$(".dynamic-container").append(r)},addTariffChargesRow:function(t){$(t).append(`

\n
\n \n
\n
\n \n
\n
\n \n
\n
`)}},BMS.PRODUCT={isExists:function(t,e=".productID"){return $(e).filter((function(){return this.value===t})).length>0},validationCheck:function(t,e,a){if(this.isExists(t.pid))return alert(`The product (${t.pn}) is already in the list.`);if(void 0===t.pv)return a(t);var r="",o={},n=[],s={};$.each(t.pv,(function(t,e){Array.isArray(o[e.mk])?o[e.mk].includes(e.mv)||o[e.mk].push(e.mv):o[e.mk]=[e.mv],"DV"===e.t?n.push(e.mv):Array.isArray(s[e.id])?s[e.id].push(e.mv):s[e.id]=[e.mv]})),$.each(o,(function(t,e){r+=`
\n \n
\n \n
\n
"})),Swal.fire({title:"Select Variation",html:"for "+t.pn+"

"+r,showCloseButton:!0,showCancelButton:!0,focusConfirm:!1,confirmButtonText:"Ok"}).then((t=>{if(t.isConfirmed){var a=$("#variationSelection select"),r=[];$.each(a,(function(){""!==this.value&&r.push(this.value)}));var o="";$.each(s,(function(t,e){if(r.every((t=>e.includes(t))))return o=t,!1})),""===o||0===r.length?Swal.fire("Sorry! no product found"):e.addProduct(o)}}))},parseProductList:function({category:t="",brand:e="",edition:a="",generic:r="",author:o=""},n){$.ajax({url:full_website_address+`/info/?module=data&page=productList&catId=${t}&brand=${e}&edition=${a}&generic=${r}&author=${o}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,e){n(t)}})},showProduct:function({container:t="#productListContainer",category:e="",brand:a="",edition:r="",generic:o="",author:n=""}=""){this.parseProductList({category:e,brand:a,edition:r,generic:o,author:n},(e=>{if(null!=e){var a="";e.forEach((t=>{var e=full_website_address;t.v&&t.v>0?e+="/images/?for=products&id="+t.id+"&q=YTozOntzOjI6Iml3IjtpOjIwMDtzOjI6ImloIjtpOjIyMDtzOjI6ImlxIjtpOjcwO30=&v="+t.v:e+="/assets/images/noimage.png",a+=" "})),$(t).html(a)}else $(t).html("
Sorry! No products found in this criteria.
")}))},getDetails:function(t,e){$.ajax({url:full_website_address+`/info/?module=data&page=productDetails&product_id=${t}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,a){e(t)}})},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t;""!==a?this.getDetails(a,(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{if("1"!==t.hed){var e=t.iq?parseFloat(t.iq).toFixed(0):1,a=`\n \n ${t.pn}\n \n ${t.pu}\n \n \n \n \n `;$("#productTable > tbody").append(a)}else BMS.fn.alertError("Sorry! The product which have expiry date or batch number, can not be added in sub/bundle product.")})),$("#selectProduct").empty()})),!1===e&&$("#productTable > tbody tr:last").find(".productQnt").select()})):alert("Please select a product")},getListByGeneric:function(t){BMS.fn.select2("#productGenericFilter",t,t)},productUnitCheck:function(t){this.getDetails({product_id:$(t).closest("tr").find(".productID").val(),unit:$(t).val()},(e=>{$(t).closest("tr").find(".productSalePrice").val(e[0].sp)}))}},BMS.POS={clearScreen:function(){$(".dynamic-container").slideUp(350,(function(){var t=new Date;$("#salesDate").val(t.toISOString().split("T")[0]),$("#tariffCharges .row").not("div:first").remove(),$(".tariffChargesName").val("").change();$(".paymentMethodBox").html('
\n
\n \n \n
\n
\n \n \n
\n \n
\n \n \n
\n
'),$("#orderDiscountValue, #shippingCharge, .posSalePaymentAmount, #adjustAmount, #salesNote").val(""),$("#shippingCharge").removeClass("shippingChargeEdited"),$(".posSalePaymentAmount").removeClass("disablePaymentAmountAutoChange"),$("#productTable > tbody").html(""),$("#editSalesId").remove(),$("#payment .modal-footer").html('\n \n \n \n \n '),$("input:radio, input:checkbox").prop("checked",!1),BMS.fn.select2("#customers",1,"Walk-in Customer"),BMS.POS.grandTotal(),BMS.POS.disableEnableWCSelect()})).slideDown(500)},getProductDetails:function({product_id:t,warehouse_id:e,customer_id:a="",qnt:r="",batch:o="",packet:n=""},s){$.ajax({url:full_website_address+`/info/?module=data&page=productDetailsForPos&product_id=${t}&warehouse_id=${e}&cid=${a}&pqnt=${r}&batch=${o}&packet=${n}`,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,e){s(t)}})},disableEnableWCSelect:function(){$(".productQnt").length>0?$("#customers, #warehouse").prop("disabled",!0):$("#customers, #warehouse").prop("disabled",!1)},grandTotal:function(t=""){var e=0,a=0;$(".productQnt").each((function(){e+=Number($(this).val()),a+=1})),$(".totalItemAndQnt").html(a+" ("+e+")");var r=0;$(".subtotalCol").each((function(){r+=Number($(this).html())})),$(".totalAmount").html(r.toFixed(2));var o=$("#orderDiscountValue").val(),n=BMS.FUNCTIONS.calculateDiscount(r,o);$(".totalOrderDiscountAmount").html("(-) "+(r-n).toFixed(2));var s=0;if($("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(n,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),s+=Number(e)})),$(".totalTariffChargesAmount").html("(+) "+s.toFixed(2)),!0===$("#payment").hasClass("in")){if(!1===$("#shippingCharge").is(":focus")&&($("#totalPackets").is(":focus")||$("#packetShippingRate").is(":focus"))){var l=$("#totalPackets").val()*$("#packetShippingRate").val();$("#shippingCharge").val(l)}}else{var c=0;$(".productPacket").each((function(){c+=Number($(this).val())})),$(".displayTotalPackets").html(c.toFixed(2)),$("#totalPackets").val(Math.round(c));l=$("#totalPackets").val()*$("#packetShippingRate").val();$("#shippingCharge").val(l)}var i=(Number(s)+Number(n)).toFixed(2);$(".netTotalAmount").html(i),$("#finalizeSale > tbody > tr:nth-child(1) > td:nth-child(3)").html(i);var d=Number($("#shippingCharge").val()),u=Number(i)+d;"1"===config.posSaleAutoAdjustAmount&&$("#adjustAmount:not(.disableAdjustAmountAutoChange)").val(parseFloat(parseFloat(u).toFixed()-u).toFixed(2));var p=Number($("#adjustAmount").val());u=parseFloat(Number(i)+d+Number(p)).toFixed(2);if("1"===config.posSaleAutoMarkAsPaid){var m=sumInputs(".disablePaymentAmountAutoChange"),h=0;(u>0&&u>m||u<0&&uf?u-f:0;$("#finalizeSale > tbody > tr:nth-child(4) > td:nth-child(2)").html(u),$("#finalizeSale > tbody > tr:nth-child(6) > td:nth-child(2)").html(v),$("#finalizeSale > tbody > tr:nth-child(7) > td:nth-child(2)").html(g),$("#quickPayableAmount").html(u),!0===$("#payment").hasClass("in")&&(u>0&&uf)&&(Swal.fire({title:"Paid amount can not be more then Grand total.",icon:"error"}),$(".posSalePaymentAmount").last().val(0))},editProductItemDetails:function(t,e){$("#productSaleDetails .modal-title").html(e),$("#productSaleDetails .rowId").val(t);var a=$(`#${t}`);$("#productSaleDetails #productSaleItemPrice").val(a.find(".netSalesPrice").val()),$("#productSaleDetails #productSaleItemDiscount").val(a.find(".productDiscount").val()),$("#productSaleDetails #productSaleItemPacket").val(a.find(".productPacket").val()),$("#productSaleDetails #productSaleItemDetails").val(a.find(".productItemDetails").val())},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t;""!==a?($("#selectProduct").val()>0&&$("#selectProduct").html(""),this.getProductDetails({product_id:a,warehouse_id:$("#warehouseId").val(),customer_id:$("#customersId").val()},(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=0,r=t.iq?parseFloat(t.iq).toFixed(0):1;t.pq>0&&(e=(r/Number(t.pq)).toFixed(2));var o=t.pd?t.pd:"0",n=BMS.FUNCTIONS.calculateDiscount(t.sp,o),s="";s=Number(n)===Number(t.sp)?parseFloat(t.sp).toFixed(2):""+parseFloat(n).toFixed(2)+""+parseFloat(t.sp).toFixed(2)+"";var l=Date.now()+t.pid,c=null===t.gn?"":`${t.gn}`,i=` \n \n \n ${t.pn}\n ${c}\n \n ${s} \n \n ${t.pu} \n ${parseFloat(Number(n)*Number(r)).toFixed(2)} \n \n \n \n \n \n \n \n \n \n \n \n \n `;$("#productTable > tbody").append(i)}))})),!1===e&&$("#productTable > tbody tr:last").find(".productQnt").select(),this.grandTotal(),this.disableEnableWCSelect()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})}))):alert("Please select a product")},addReturnProduct:function(t,e,a,r,o,n,s,l,c,i){if(!BMS.PRODUCT.isExists(t)||confirm(`The product (${e}) is already in the list. Do you want to add it again?`)){var d=Date.now()+t,u=` \n \n \n ${e}\n ${null===a?"":`${a}`}\n \n ${l} \n \n ${o} \n -${i} \n \n \n \n \n \n \n \n \n \n \n \n `;$("#productTable > tbody").append(u),this.grandTotal()}},productQntCheck:function(t,e){var a=$(t).closest("tr").find(".netSalesPrice").val(),r=$(t).val(),o=$(t).closest("tr").find(".productDiscount").val(),n=$(t).closest("tr").find("td.subtotalCol"),s=$(t).closest("tr").find(".productPacket"),l=t;0==r&&(Swal.fire({title:"Error!",text:"Product qunatity can not be zero (0)",icon:"error"}),$(t).val(1),r=1),this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#warehouseId").val(),qnt:r,unit:$(t).closest("tr").find(".productItemUnit").val()},(e=>{void 0!==e.error&&!0===e.error&&($(l).val(e.stq),r=e.stq,Swal.fire({title:"Error!",text:e.msg,icon:"error"})),(e=e[0]?e[0]:e).so?$(t).closest("tr").css("background-color","pink"):$(t).closest("tr").css("background-color","white"),$(n).html((BMS.FUNCTIONS.calculateDiscount(a,o)*r).toFixed(2));var c=0;Number(e.pq)>0&&(c=(r/Number(e.pq)).toFixed(2)),s.val(c),this.grandTotal()}))},productPacketCheck:function(){var t=$(selector).closest("tr").find(".netSalesPrice").val(),e=$(selector).val(),a=$(selector).closest("tr").find(".productDiscount").val(),r=$(selector).closest("tr").find("td.subtotalCol"),o=$(selector).closest("tr").find(".productQnt"),n=$(selector).closest("tr").find(".productPacket");this.getProductDetails({product_id:$(selector).closest("tr").find(".productID").val(),warehouse_id:$("#warehouseId").val(),packet:e},(s=>{if(void 0!==s.error&&!0===s.error){$(o).val(s.having_item_quantity),$(r).html((BMS.FUNCTIONS.calculateDiscount(t,a)*s.having_item_quantity).toFixed(2));var l=0;Number(s.product_packet_quantity)>0&&(l=(s.having_item_quantity/Number(s.product_packet_quantity)).toFixed(2)),n.val(l),Swal.fire({title:"Error!",text:s.msg,icon:"error"})}else{var c=Math.round(Number(s.product_packet_quantity)*e);c>0&&($(o).val(c),$(r).html((BMS.FUNCTIONS.calculateDiscount(t,a)*c).toFixed(2)))}this.grandTotal()}))},productDiscountCheck:function(t){var e=$("#productSaleItemPrice").val(),a=$("#productSaleItemDiscount").val();"Enter"===t.key&&a.indexOf("%")>1&&a.replace("%","")>=100?(Swal.fire({title:"Error!",text:"Discount Must be below of 100%",icon:"error"}),$("#productSaleItemDiscount").val(""),$("#productSaleItemDiscount").select(),t.preventDefault()):"Enter"===t.key&&Number(a)>=Number(e)&&a.indexOf("%")<1&&($("#productSaleItemDiscount").val(""),$("#productSaleItemDiscount").select(),"Enter"===t.key&&t.preventDefault(),Swal.fire({title:"Error!",text:"Discount Must be below of product sale price",icon:"error"}),t.preventDefault())},orderDiscountCheck:function(t,e){var a=$(".totalAmount").text(),r=$(t).val();r.indexOf("%")>1&&r.replace("%","")>=100?(Swal.fire({title:"Error!",text:"Discount Must be below of 100%",icon:"error"}),$(t).val(0),e.preventDefault()):Number(a)<0&&Number(r)>0?(Swal.fire({title:"Error!",text:"Discount must be a negative amount in case of negative total amount.",icon:"error"}),$(t).val(-Number(r)),e.preventDefault()):Number(a)<0&&(Number(r)>0||Math.abs(Number(r))>=Math.abs(Number(a)))||Number(a)>0&&Number(r)>=Number(a)&&r.indexOf("%")<1?(Swal.fire({title:"Error!",text:"Discount Must be below of total amount.",icon:"error"}),$(t).val(0),e.preventDefault()):!0!==this.isGivenDiscountPermitted(t)&&(Swal.fire({title:"Error!",text:`You do not have permission to give ${r} discount.`,icon:"error"}),$(t).val(0),e.preventDefault()),this.grandTotal()},isGivenDiscountPermitted:function(t){var e=$(".totalAmount").text(),a=$(t).val();if(""!=get_options("maxDiscount")){var r=e-BMS.FUNCTIONS.calculateDiscount(e,get_options("maxDiscount")),o=e-BMS.FUNCTIONS.calculateDiscount(e,a);return Math.abs(r)>=Math.abs(o)}return!0}},BMS.PURCHASE={getProductDetails:BMS.PRODUCT.getDetails,grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalPurchasePrice").html(e.toFixed(2));var a=BMS.FUNCTIONS.calculateDiscount(e,$("#purchaseDiscountValue").val());$(".totalPurchaseDiscount").html("(-) "+(e-a).toFixed(2));var r=0;$("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(a,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),r+=Number(e)})),$(".totalTariffCharges").html("(+) "+r.toFixed(2));var o=(Number(r)+Number(a)).toFixed(2);$(".netTotal").html(o),$("#purchaseNetTotal").val(o);var n=Number(o)+Number($("#purchaseShipping").val());$("#purchaseGrandTotal").val(n);var s=Number($("#purchasePaidAmount").val()),l=n<=s?0:n-s,c=n>=s?0:s-n;$("#purchaseChangeAmount").val(c),$("#purchaseDueAmount").val(l)},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productPurchasePrice").val(),a=$(t).closest("tr").find(".productQnt").val(),r=$(t).closest("tr").find(".productPurchaseDiscount").val(),o=$(t).closest("tr").find(".subTotal");return isNaN(a)?(alert("Product quantity must be a valid number."),void $(t).closest("tr").find(".productQnt").val(1)):a<1&&"Ordered"!==$("#purchaseStatus").val()?(alert("Product quantity must be minimum of 1."),void $(t).closest("tr").find(".productQnt").val(1)):(""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productPurchasePrice").val(0)),r.indexOf("%")>1&&r.replace("%","")>=100?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of 100%")):Number(r)>Number(e)&&r.indexOf("%")<1?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of product purchase price")):void $(o).html((BMS.FUNCTIONS.calculateDiscount(e,r)*a).toFixed(2)))},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t;""!==a?this.getProductDetails(a,(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e="";void 0!==t.hed&&"1"===t.hed&&"Ordered"!==$("#purchaseStatus").val()&&(e=``);var a=t.iq?parseFloat(t.iq).toFixed(0):1,r=`\n \n ${t.pn}\n ${e}\n ${t.alertq} ${t.soldq} ${t.stockq}\n \n ${t.pu}\n \n \n \n ${t.pp}\n \n \n \n `;$("#productTable > tbody").append(r)}))})),!1===e&&$("#productTable > tbody tr:last").find(".productQnt").select(),this.grandTotal(),$("#selectProduct").empty()})):alert("Please select a product")},productUnitCheck:function(t){var e=$(t).closest("tr").find(".productID").val(),a=this;$.ajax({url:full_website_address+"/info/?module=data&page=productUnitDetails&product_id="+e+"&unit="+$(t).val(),contentType:"application/json; charset=utf-8",dataType:"json",success:function(e,r){"success"==r&&($(t).closest("tr").find(".productPurchasePrice").val(e.pp),$(t).closest("tr").find(".productMainPurchasePrice").val(e.pp),a.calculateEachProduct(t),a.grandTotal())}})}},BMS.ORDER=Object.assign({},BMS.POS),BMS.ORDER.addProduct=function(t=""){var e=""===t?$("#selectProduct").val():t;""!==e?($("#selectProduct").val()>0&&$("#selectProduct").html(""),BMS.PRODUCT.getDetails(e,(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var a=0,r=t.iq?parseFloat(t.iq).toFixed(0):1;t.pq>0&&(a=(r/Number(t.pq)).toFixed(2));var o=t.pd?t.pd:"0",n=BMS.FUNCTIONS.calculateDiscount(t.sp,o),s="";s=Number(n)===Number(t.sp)?parseFloat(t.sp).toFixed(2):""+n+""+parseFloat(t.sp).toFixed(2)+"";var l=Date.now()+t.pid,c=` \n \n \n ${t.pn}\n \n ${s} \n \n ${t.pu} \n ${parseFloat(Number(n)*Number(r)).toFixed(2)} \n \n \n \n \n \n \n \n \n \n \n \n \n `;$("#productTable > tbody").append(c)}))})),$("#productTable > tbody tr:last").find(".productQnt").select(),this.grandTotal(),this.disableEnableWCSelect()}))):alert("Please select a product")},BMS.ORDER.productQntCheck=function(t,e){var a=$(t).closest("tr").find(".netSalesPrice").val(),r=$(t).val(),o=$(t).closest("tr").find(".productDiscount").val(),n=$(t).closest("tr").find("td.subtotalCol");0==r&&(Swal.fire({title:"Error!",text:"Product qunatity can not be zero (0)",icon:"error"}),$(t).val(1),r=1),$(n).html((BMS.FUNCTIONS.calculateDiscount(a,o)*r).toFixed(2)),this.grandTotal()},BMS.STOCK_TRANSFER={getProductDetails:BMS.POS.getProductDetails,grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalPurchasePrice").html(e.toFixed(2))},disableEnableWarehouseSelect:function(){$(".productQnt").length>0?$("#stockTransferFromWarehouse, #stockTransferToWarehouse").prop("disabled",!0):$("#stockTransferFromWarehouse, #stockTransferToWarehouse").prop("disabled",!1)},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productPurchasePrice").val(),a=$(t).closest("tr").find(".productQnt").val(),r=$(t).closest("tr").find(".productPurchaseDiscount").val(),o=$(t).closest("tr").find(".subTotal");return a<1?(alert("Product quantity must be minimum of 1."),void $(t).closest("tr").find(".productQnt").val(1)):(""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productPurchasePrice").val(0)),r.indexOf("%")>1&&r.replace("%","")>=100?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of 100%")):Number(r)>Number(e)&&r.indexOf("%")<1?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of product purchase price")):void $(o).html((BMS.FUNCTIONS.calculateDiscount(e,r)*a).toFixed(2)))},addProduct:function(t="",e=!1){var a=""===t?$("#selectProduct").val():t,r=$("#stockTransferFromWarehouseId").val();""!==r?""!==a?this.getProductDetails({product_id:a,warehouse_id:r,qnt:1},(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e="";void 0!==t.hed&&"1"===t.hed&&(e=``);var a=t.iq?parseFloat(t.iq).toFixed(0):1,r=`\n \n ${t.pn}\n ${e}\n \n ${t.pu}\n \n \n \n ${parseFloat(t.pp*a).toFixed(2)}\n \n \n \n `;$("#productTable > tbody").append(r)}))})),this.grandTotal(),this.disableEnableWarehouseSelect(),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product"):alert("Please select an warehouse to add product")},productUnitCheck:function(t){var e=t;this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#stockTransferFromWarehouseId").val(),qnt:$(t).closest("tr").find(".productQnt").val(),unit:$(t).val()},(t=>{void 0!==t.error&&!0===t.error&&(console.log(t.stq),$(e).closest("tr").find(".productQnt").val(t.stq),Swal.fire({title:"Error!",text:t.msg,icon:"error"})),$(e).closest("tr").find(".productPurchasePrice").val(parseFloat(t.pp).toFixed(2)),this.calculateEachProduct(e),this.grandTotal()}))},productQntCheck:function(t){var e=$(t).val(),a=$(t);isNaN(e)&&(alert("Product quantity must be a valid number."),$(t).val(1),e=1),e<1&&(Swal.fire({title:"Error!",text:"Product qunatity must be at least one",icon:"error"}),$(t).val(1),e=1),this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#stockTransferFromWarehouseId").val(),qnt:e,unit:$(t).closest("tr").find(".productItemUnit").val()},(t=>{void 0!==t.error&&!0===t.error&&($(a).val(t.stq),Swal.fire({title:"Error!",text:t.msg,icon:"error"})),this.calculateEachProduct(a),this.grandTotal()}))}},BMS.STOCK_ENTRY={getProductDetails:BMS.PRODUCT.getDetails,grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalPurchasePrice").html(e.toFixed(2))},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productPurchasePrice").val(),a=$(t).closest("tr").find(".productQnt").val(),r=$(t).closest("tr").find(".productPurchaseDiscount").val(),o=$(t).closest("tr").find(".subTotal");return a<1&&"Production"===$("#stockEntryType").val()?(alert("Negative quantity is not valid for Production of stock."),void $(t).closest("tr").find(".productQnt").val(1)):(""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productPurchasePrice").val(0)),r.indexOf("%")>1&&r.replace("%","")>=100?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of 100%")):Number(r)>Number(e)&&r.indexOf("%")<1?($(t).closest("tr").find(".productPurchaseDiscount").val(0),void alert("Discount Must be below of product purchase price")):void $(o).html((BMS.FUNCTIONS.calculateDiscount(e,r)*a).toFixed(2)))},addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t;""!==$("#stockTransferFromWarehouseId").val()?""!==e?this.getProductDetails(e,(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e="";void 0!==t.hed&&"1"===t.hed&&(e=``);var a=t.iq?parseFloat(t.iq).toFixed(0):1,r=`\n \n ${t.pn}\n ${e}\n \n ${t.pu}\n \n \n \n ${parseFloat(t.pp*a).toFixed(2)}\n \n \n \n `;$("#productTable > tbody").append(r)}))})),this.grandTotal(),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product"):alert("Please select an warehouse to add product")}},BMS.RETURN={getProductReturnDetails:function({product_id:t,customer_id:e},a){$.ajax({url:full_website_address+"/info/?module=data&page=productDetailsForReturn&product_id="+t+"&customer_id="+e,contentType:"application/json; charset=utf-8",dataType:"json",success:function(t,e){a(t)}})},grandTotal:function(){var t=0;$(".productQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".productQnt").length+"("+t+")");var e=0;$(".subTotal").each((function(){e+=Number($(this).html())})),$(".totalReturnPrice").html(e.toFixed(2));var a=BMS.FUNCTIONS.calculateDiscount(e,$("#returnDiscountValue").val());$(".totalReturnDiscount").html("(-) "+(e-a).toFixed(2));var r=0;$("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(a,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),r+=Number(e)})),$(".totalTariffCharges").html("(+) "+r.toFixed(2));var o=(Number(r)+Number(a)).toFixed(2);$(".netTotal").html(o),$("#returnNetTotal").val(o);var n=$("#returnShipping").val(),s=Number(o)+Number(n)-Number($("#returnSurcharge").val());$("#returnGrandTotal").val(s);var l=Number($("#returnPaidAmount").val()),c=s<=l?0:s-l,i=s>=l?0:l-s;$("#returnChangeAmount").val(i),$("#returnDueAmount").val(c)},calculateEachProduct:function(t){var e=$(t).closest("tr").find(".productReturnPrice").val(),a=$(t).closest("tr").find(".productQnt").val(),r=$(t).closest("tr").find(".productReturnDiscount").val(),o=$(t).closest("tr").find(".subTotal");if(a<1)return alert("Product quantity must be minimum of 1."),void $(t).closest("tr").find(".productQnt").val(1);""!==e&&null!==e&&"null"!==e||(e=0,$(t).closest("tr").find(".productReturnPrice").val(0)),r.indexOf("%")>1&&r.replace("%","")>=100?alert("Discount Must be below of 100%"):Number(r)>Number(e)&&r.indexOf("%")<1?alert("Discount Must be below of product return price"):$(o).html((BMS.FUNCTIONS.calculateDiscount(e,r)*a).toFixed(2))},addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t,a=$("#returnCustomer").val();""!==a?""!==e?this.getProductReturnDetails({product_id:e,customer_id:a},(t=>{t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=t.pd?t.pd:"0",a=parseFloat(BMS.FUNCTIONS.calculateDiscount(t.sp,e)).toFixed(2),r="";void 0!==t.hed&&"1"===t.hed&&(r=``);var o=`\n \n ${t.pn}
(Purchased: ${t.prq} Returned: ${t.rtq})\n ${r}\n \n ${t.pu}\n \n \n \n ${a}\n \n \n \n `;$("#productTable > tbody").append(o)}))})),this.grandTotal(),$("#selectProduct").empty()})):alert("Please select a product"):alert("Please select the customer")},productUnitCheck:function(t){var e=t;this.getProductReturnDetails({product_id:$(t).closest("tr").find(".productID").val(),customer_id:$("#returnCustomer").val(),unit:$(t).val()},(t=>{var a=t[0];$(e).closest("tr").find(".productReturnPrice").val(parseFloat(a.sp).toFixed(2));var r=a.pn+"
(Purchased: "+parseFloat(a.prq).toFixed(2)+", Returned: "+parseFloat(a.rtq).toFixed(2)+")";$(e).closest("tr").find(".productDetails").html(r),this.calculateEachProduct(e),this.grandTotal()}))}},BMS.WASTAGE_SALE={grandTotal:function(){var t=0;$(".wastageSaleItemQnt").each((function(){t+=Number($(this).val())})),$("#totalItems").html($(".wastageSaleItemQnt").length+"("+t+")");var e=0;$(".wastageSaleItemSubtotal").each((function(){e+=Number($(this).text())})),$(".totalWastageSalePrice").html(e.toFixed(2));var a=BMS.FUNCTIONS.calculateDiscount(e,$("#wastageSaleDiscountValue").val());$(".totalWastageSaleDiscount").html("(-) "+(e-a).toFixed(2));var r=0;$("#tariffCharges > .row").each((function(){var t=$(this).closest(".row").find(".tariffChargesName").val().split(": ")[1],e=BMS.FUNCTIONS.calculateTarifCharges(a,t);$(this).closest(".row").find(".tariffChargesAmount").val(e),r+=Number(e)})),$(".totalTariffCharges").html("(+) "+r.toFixed(2));var o=(Number(r)+Number(a)).toFixed(2);$(".netTotal").html(o),$("#wastageSaleNetTotal").val(o);var n=$("#wastageSalePaidAmount").val(),s=n tbody").append(' 0.00 '),$(".wastageSaleItem").focus(),this.grandTotal()}},BMS.SPECIMEN_COPY={getProductDetails:BMS.POS.getProductDetails,disableEnableWarehouseSelect:function(){$(".productQnt").length>0?$("#scTransferWarehouse").prop("disabled",!0):$("#scTransferWarehouse").prop("disabled",!1)},addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t,a=$("#scTransferWarehouse").val();""!==a?""!==e?this.getProductDetails({product_id:e,warehouse_id:a},(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=t.iq?parseFloat(t.iq).toFixed(0):1,a=` \n ${t.pn}\n \n ${t.pu}\n \n \n \n `;$("#productTable > tbody").append(a)}))})),this.disableEnableWarehouseSelect(),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product"):alert("Please select an warehouse to add product")},productUnitCheck:function(t){this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#scTransferWarehouse").val(),qnt:$(t).closest("tr").find(".productQnt").val(),unit:$(t).val()},(e=>{void 0!==e.error&&!0===e.error&&($(t).closest("tr").find(".productQnt").val(e.stq),Swal.fire({title:"Error!",text:e.msg,icon:"error"}))}))},productQntCheck:function(t){var e=$(t).val();isNaN(e)&&(alert("Product quantity must be a valid number."),$(t).val(1),e=1),e<1&&(Swal.fire({title:"Error!",text:"Product qunatity must be at least one",icon:"error"}),$(t).val(1),e=1),this.getProductDetails({product_id:$(t).closest("tr").find(".productID").val(),warehouse_id:$("#scTransferWarehouse").val(),qnt:e,unit:$(t).closest("tr").find(".productItemUnit").val()},(e=>{void 0!==e.error&&!0===e.error&&($(t).val(e.stq),Swal.fire({title:"Error!",text:e.msg,icon:"error"}))}))}},BMS.SC_DISTRIBUTION={getProductDetails:BMS.PRODUCT.getDetails,addProduct:function(t=""){var e=""===t?$("#selectProduct").val():t;""!==e?this.getProductDetails(e,(t=>{void 0===t.error||!0!==t.error?(t.forEach((t=>{BMS.PRODUCT.validationCheck(t,this,(t=>{var e=t.iq?parseFloat(t.iq).toFixed(0):1,a=`\n \n ${t.pn}\n \n ${t.pu}\n \n \n \n `;$("#productTable > tbody").append(a)}))})),$("#selectProduct").empty()):Swal.fire({title:"Error!",text:t.msg,icon:"error"})})):alert("Please select a product")}},BMS.CHAT={showChatBox:function(t,e){""!==t&&t.preventDefault(),$.ajax({url:full_website_address+"/info/?module=chat&page=getChatUserData",type:"post",data:{userId:e},success:function(t,a){t=JSON.parse(t);console.log(t);var r="";""!==t.latest_msg&&t.latest_msg.forEach((t=>{t.from_user!=e?r+=`
\n
\n ${t.from_username}\n ${t.datetime}\n
\n \n
\n ${t.msg_text}\n
\n
`:r+=`
\n
\n ${t.from_username}\n ${t.datetime}\n
\n \n
\n ${t.msg_text}\n
\n
`}));var o=`
\n \n
\n \n
\n

${t.name}

\n

${t.position}

\n
\n
\n \n \n \n
\n
\n
\n \n
\n ${r}\n
\n
\n
\n \n \n \n
\n
`;$(".chatBox").prepend(o).ready((function(){var t=$(`.chatBoxForUser${e}`).find(".direct-chat-messages"),a=$(t).get(0).scrollHeight;$(t).animate({scrollTop:a},0),$(t).closest(".chatBox").find(".message-composer").focus()}))}})},send:function(t,e){wss.send(JSON.stringify({type:"message",toUser:e,msg:t}))}}; \ No newline at end of file diff --git a/assets/js/callCenter.js b/assets/js/callCenter.js new file mode 100644 index 0000000..c3cd3f8 --- /dev/null +++ b/assets/js/callCenter.js @@ -0,0 +1,1106 @@ +if(typeof sipCredentials === "undefined") { + throw new Error("Sorry! No SIP credentials found"); +} + +// Set getUserMedia for all browsers +navigator.getUserMedia = ( navigator.getUserMedia || + navigator.webkitGetUserMedia || + navigator.mozGetUserMedia || + navigator.msGetUserMedia + ); + +if(navigator.getUserMedia !== undefined) { + + // Check if there have microphone connected + //var userMedia = navigator.getUserMedia() || navigator.mediaDevices.getUserMedia(); + navigator.getUserMedia( + {audio: true}, + function(){ + + // enable call button + $("#callButton").prop("disabled", false); + + }, + function() { + // error callback, no microphone + $("#status").html("
No microphone found! Please connect your mic and reload!
").show(); + + // disable call button + $("#callButton").prop("disabled", true); + return; + } + ); + +} else { + + // Show error no user medai + $("#status").html("
Sorry! No media found. This module will not work.
").show(); + + // disable call button + $("#callButton").prop("disabled", true); + +} + + + +var remoteAudio = new window.Audio(); +remoteAudio.autoplay = true; +remoteAudio.crossOrigin="anonymous"; + +var socket = new JsSIP.WebSocketInterface(sipCredentials.socket); +var configuration = { + sockets : [ socket ], + 'uri': sipCredentials.uri, + 'password': sipCredentials.pass, + 'username': sipCredentials.user, + 'register': true +}; + + +var callOptions = { + mediaConstraints: {audio: true, video: false} +}; + + +var caller = ""; +var callerDisplay = ""; +var hideNumbers = ['*78', '*79', '*76']; + +var phone = new JsSIP.UA(configuration); + +phone.start(); +var session; + +phone.on('newRTCSession', function(data){ + + var newSession = data.session; + + if(session){ // if any existing session is running then terminate the new call + + /** + * Add a call log if any call is coming while the agents are busy + */ + addCallLog({ + caller: newSession.remote_identity.uri.user, + direction: newSession.direction, + duration: 0, + status: "Missed" + }); + + newSession.terminate(); + return false; + + } + + session = newSession; + var completeSession = function(){ + + session = null; + + // Reset the mute and holde button + $("#muteCall, #holdCall").show(); + $("#unholdCall, #unmuteCall").hide(); + + }; + + caller = session.remote_identity.uri.user; + callerDisplay = session.remote_identity.display_name; + + // Show number in sms receipient + $("#csSmsSendTo").val(caller); + + // Show number in feedback caller + $("#feedbackCaller").val(caller); + + + session.on('ended', function() { + + // Do not show/ Add the caller details for hidden numbers + if( jQuery.inArray(caller, hideNumbers) < 0 ) { + + addCallLog({ + caller: caller, + direction: session.direction, + duration: Math.floor( (session.end_time.getTime() - session.start_time.getTime()) / 1000), + status: "Answered" + }); + + // Pause Ring + BMS.fn.pause(); + + + // Stop Timer + BMS.fn.stopTimer(window.timer); + + $("#status").html(`${caller} is disconnected`).show(); + + + $("#timer").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(500).fadeIn(500); + + // disable the number search and hangButton + $("#hangButton").prop("disabled", true); + + // Show the feedback tab + $('.nav-tabs a[href="#tab_feedback"]').tab('show'); + + // Stop the phone + phone.stop(); + + } + + // Complete the session + completeSession(); + + }); + + + session.on('failed', function(e) { + + // Show the call dialer after session end + $(".call-dialer").show(); + + // Hide call Received + $("#callReceiver").hide(); + + // Pause Ring + BMS.fn.pause(); + + // Show the call button + $("#callButton").show(); + + // Hide the end button + $("#hangButton").hide(); + + // Enable the number search and hangButton + $(".numberSearch, #hangButton").prop("disabled", false); + $(".number-dialer-div .input-group-addon").removeClass("disable-number-dialer-div"); + + + if(session.direction === 'incoming' ) { + + + if( e.originator === "local" ) { + + $("#status").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(250).fadeIn(250, function() { + + $("#status").html(`Call rejected!`).show(); + + addCallLog({ + caller: caller, + direction: 'incoming', + duration: 0, + status: "Rejected" + }); + + }); + + } else { + + $("#status").html(`Missed call from ${callerDisplay}!`).show(); + addCallLog({ + caller: caller, + direction: 'incoming', + duration: 0, + status: "Missed" + }); + + } + + + } else { + + if( e.originator === "local" ) { + + $("#status").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(250).fadeIn(250, function() { + + $("#status").html(`Dial a number!`).show(); + + addCallLog({ + caller: caller, + direction: 'outgoing', + duration: 0, + status: "Unreachable" + }); + + }); + + } else { + + $("#status").fadeOut(100).fadeIn(100).fadeOut(150).fadeIn(150).fadeOut(200).fadeIn(200).fadeOut(250).fadeIn(250, function() { + + + if( e.cause === "SIP Failure Code" ) { + + $("#status").html(`The number is not answered!`).show(); + + addCallLog({ + caller: caller, + direction: 'outgoing', + duration: 0, + status: "Not Answered" + }); + + } else { + + $("#status").html(`The number is busy!`).show(); + addCallLog({ + caller: caller, + direction: 'outgoing', + duration: 0, + status: "Busy" + }); + + } + + // Show the feedback tab for writing feedback if the call is not received or terminate by the remote caller + $('.nav-tabs a[href="#tab_feedback"]').tab('show'); + + // Stop the phone + // phone.stop(); + + + }); + + } + + } + + completeSession(); + + }); + + session.on("hold", function(e) { + + if(e.originator === "remote") { + + $("#status").html(`${caller} is hold you.`).show(); + + } else { + + $("#status").html(`${caller} is on hold.`).show(); + + } + + }); + + session.on("muted", function(e) { + + $("#status").html(`Call is muted.`).show(); + + }); + + session.on("unmuted", function(e) { + + $("#status").html(`${caller} is connected.`).show(); + + }); + + session.on("unhold", function() { + + $("#status").html(`${caller} is connected.`).show(); + + }); + + session.on('accepted', function(){ + + // Do not show the caller details for hidden numbers + if( jQuery.inArray(caller, hideNumbers) < 0 ) { + + // Show timer + $("#timer").show(); + window.timer = BMS.fn.startTimer(); + + $("#status").html(`${caller} is connected.`).show(); + + } + + + }); + + session.on('confirmed',function(){ + var localStream = session.connection.getLocalStreams()[0]; + var dtmfSender = session.connection.createDTMFSender(localStream.getAudioTracks()[0]); + session.sendDTMF = function(tone){ + dtmfSender.insertDTMF(tone); + }; + + }); + + + session.on('peerconnection', (e) => { + + let logError = ''; + const peerconnection = e.peerconnection; + + peerconnection.onaddstream = function (e) { + + // set remote audio stream (to listen to remote audio) + // remoteAudio is