{"version":3,"file":"main.bundle.js","sources":["webpack:///./src/app/common/Transaction Components/transaction.service.ts","webpack:///./src/app/pages/Style.css","webpack:///./src/app/common/repositories/masterRepo.service.ts","webpack:///./src/app/common/repositories/index.ts","webpack:///./src/app/common/services/alert/alert.service.ts","webpack:///./src/app/global.state.ts","webpack:///./src/app/common/popupLists/pStyle.css","webpack:///./src/app/theme/nga.module.ts","webpack:///./src/app/common/services/index.ts","webpack:///./src/app/common/services/permission/authService.service.ts","webpack:///./src/app/common/services/permission/index.ts","webpack:///./src/app/common/services/spinner/spinner.service.ts","webpack:///delegated ./node_modules/rxjs/BehaviorSubject.js from dll-reference vendor_lib","webpack:///./src/app/common/popupLists/generic-grid/generic-popup-grid.component.ts","webpack:///delegated ./node_modules/rxjs/Subject.js from dll-reference vendor_lib","webpack:///./src/app/common/interfaces/TrnMain.ts","webpack:///delegated ./node_modules/rxjs/Observable.js from dll-reference vendor_lib","webpack:///./src/app/common/Transaction Components/_theming.scss","webpack:///delegated ./node_modules/rxjs/Subscription.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/Rx.js from dll-reference vendor_lib","webpack:///./src/app/theme/index.ts","webpack:///./src/app/pages/login/loginService.service.ts","webpack:///delegated ./node_modules/rxjs/add/operator/debounceTime.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/filter.js from dll-reference vendor_lib","webpack:///./src/app/pages/modaldialogs/messageDialog/messageDialog.component.ts","webpack:///./src/app/common/popupLists/new-generic-grid/new-generic-popup-grid.component.ts","webpack:///./src/app/paged-list-component-base.ts","webpack:///./src/app/theme/services/index.ts","webpack:///./src/app/common/services/permission/guard.service.ts","webpack:///./src/app/common/services/navigation-perventor/navigation-perventor.service.ts","webpack:///./src/app/common/services/setting.service.ts","webpack:///./src/app/theme/theme.constants.ts","webpack:///./src/app/pages/login/forgetPassword.css","webpack:///delegated ./node_modules/rxjs/add/operator/catch.js from dll-reference vendor_lib","webpack:///./src/app/common/popupLists/multiple-price-popup/multiple-price-popup-grid.component.ts","webpack:///./src/app/common/popupLists/notification/notification.service.ts","webpack:///./src/app/pages/login/login.component.ts","webpack:///./src/app/theme/theme.config.ts","webpack:///./src/app/theme/theme.configProvider.ts","webpack:///delegated ./node_modules/rxjs/add/operator/distinctUntilChanged.js from dll-reference vendor_lib","webpack:///./src/app/environment.ts","webpack:///./src/app/common/popupLists/generic-grid/generic-popup-grid.module.ts","webpack:///./src/app/pages/Others/components/AdditionalCost/addtionalCost.service.ts","webpack:///./src/app/common/popupLists/file-uploader/file-uploader-popup.component.ts","webpack:///./src/app/common/popupLists/popuplist.module.ts","webpack:///./src/app/common/Invoice/print-invoice/print-invoice.component.ts","webpack:///./src/app/common/popupLists/PopBatchList/PopBatch.component.ts","webpack:///./src/app/common/services/AppSettings.ts","webpack:///./src/app/pages/login/login.module.ts","webpack:///./src/app/common/popupLists/PopItemList/PopItems.component.ts","webpack:///./src/app/pages/userManager/components/userManger/password-strength-validators.component.ts","webpack:///./src/app/theme/services/baMenu/baMenu.service.ts","webpack:///./src/app/common/Transaction Components/pricecalculator/price-calculatorpopup.component.ts","webpack:///./src/app/common/popupLists/file-uploader/file-uploader-popup.service.ts","webpack:///./src/app/common/popupLists/import-purchase-details/import-purchase-details.component.ts","webpack:///./src/app/common/popupLists/new-generic-grid-approved/new-generic-popup-grid-approved.component.ts","webpack:///./src/app/common/popupLists/notification/notification-popup-grid.component.ts","webpack:///./src/app/common/popupLists/party-opening-details-popup/party-opening-details-popup.component.ts","webpack:///./src/app/common/services/permission/cacheService.service.ts","webpack:///./src/app/common/services/permission/permission.service.ts","webpack:///./src/app/common/services/permission/userToken.service.ts","webpack:///./src/app/pages/Sales/components/salesinvoice/AddCustomerPopup.ts","webpack:///./src/app/pages/Sales/components/salesinvoice/Transport-popup.component.ts","webpack:///./src/app/pages/Sales/components/salesinvoice/generic-popup-Tender.component.ts","webpack:///./src/app/pages/login/searchUser.component.ts","webpack:///./src/app/pages/login/sendEmail.component.ts","webpack:///./src/app/pages/modaldialogs/dispatchDialog/dispatchDialog.component.ts","webpack:///./src/app/pages/modaldialogs/index.ts","webpack:///./src/app/pages/pages.component.ts","webpack:///./src/app/pages/login/login.html","webpack:///./src/app/pages/login/login.scss?1adb","webpack:///delegated ./node_modules/rxjs/add/observable/from.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/observable/of.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/toArray.js from dll-reference vendor_lib","webpack:///fs (ignored)","webpack:///./src/app/index.ts","webpack:///./src/app/pages/modal-style.css","webpack:///./src/app/pages/modaldialogs/authorizationDialog/authorizationDialog.component.ts","webpack:///./src/app/app-component-base.ts","webpack:///./src/app/common/Transaction Components/halfcolumn.css","webpack:///./src/app/common/Transaction Components/transaction.module.ts","webpack:///./src/app/common/popupLists/file-uploader/file-uploader-popup.module.ts","webpack:///./src/app/common/services/guard/can-navigate.guard.ts","webpack:///./src/app/common/popupLists/new-generic-grid/new-generic-popup-grid.module.ts","webpack:///./src/app/common/directives/limit-decimal.module.ts","webpack:///./src/app/common/popupLists/multiple-price-popup/multiple-price-popup-grid.module.ts","webpack:///./src/app/pages/pages.module.ts","webpack:///./src/app/theme/validators/index.ts","webpack:///delegated ./node_modules/process/browser.js from dll-reference polyfills_lib","webpack:///delegated ./node_modules/rxjs/add/observable/throw.js from dll-reference vendor_lib","webpack:///./src/app/common/popupLists/PopupCategoryList/PopCategory.component.ts","webpack:///./src/app/common/services/common.service.ts","webpack:///./src/app/pages/pages.menu.ts","webpack:///./src/app/theme/pipes/index.ts","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/app.routing.ts","webpack:///./src/app/app.service.ts","webpack:///./src/app/common/Invoice/invoice.component.ts","webpack:///./src/app/common/Invoice/invoicePrint.component.ts","webpack:///./src/app/common/Invoice/purchasePrint.component.ts","webpack:///./src/app/common/Transaction Components/InventoryParameters.ts","webpack:///./src/app/common/Transaction Components/ProductInsert.ts","webpack:///./src/app/common/Transaction Components/TrnMainParameters.ts","webpack:///./src/app/common/Transaction Components/VATnoEntry.component.ts","webpack:///./src/app/common/Transaction Components/account-master-action.component.ts","webpack:///./src/app/common/Transaction Components/account-voucher-summary.component.ts","webpack:///./src/app/common/Transaction Components/creditnotemodes.ts","webpack:///./src/app/common/Transaction Components/focus.directive.ts","webpack:///./src/app/common/Transaction Components/opening-balance-action.component.ts","webpack:///./src/app/common/Transaction Components/sales-mode.component.ts","webpack:///./src/app/common/Transaction Components/sub-ledger-focus.directive.ts","webpack:///./src/app/common/Transaction Components/trnmain-branch.component.ts","webpack:///./src/app/common/Transaction Components/trnmain-note-itembase-entry.component.ts","webpack:///./src/app/common/Transaction Components/trnmain-purchase.component.ts","webpack:///./src/app/common/Transaction Components/trnmain-voucher-entry.component.ts","webpack:///./src/app/common/Transaction Components/trntran-voucher-entry.component.ts","webpack:///./src/app/common/Transaction Components/voucher-date.component.ts","webpack:///./src/app/common/Transaction Components/voucher-master-action.component.ts","webpack:///./src/app/common/Transaction Components/voucher-master-toggler.component.ts","webpack:///./src/app/common/Transaction Components/voucher-message-remarks.component.ts","webpack:///./src/app/common/Transaction Components/voucher-sidebar-billdetail.component.ts","webpack:///./src/app/common/Transaction Components/voucher-total-area.component.ts","webpack:///./src/app/common/directives/limit-decimal.directive.ts","webpack:///./src/app/common/nepali-date-picker/nepali-date-picker.component.ts","webpack:///./src/app/common/popupLists/PopPartyList/popPartyList.ts","webpack:///./src/app/common/popupLists/PopScheme/popscheme.ts","webpack:///./src/app/common/popupLists/PopupItemGrpList/PopItemGrp.component.ts","webpack:///./src/app/common/popupLists/focus.directive.ts","webpack:///./src/app/common/popupLists/import-purchase-details/import-purchase-details.module.ts","webpack:///./src/app/common/popupLists/new-generic-grid-approved/new-generic-popup-grid-approved.module.ts","webpack:///./src/app/common/popupLists/notification/notification-popup-grid.module.ts","webpack:///./src/app/common/repositories/MockmasterRepo.service.ts","webpack:///./src/app/common/services/IndexedDbWrapper.ts","webpack:///./src/app/common/services/alert/directives/alert.component.ts","webpack:///./src/app/common/services/navigation-perventor/directives/navigation-preventor.component.ts","webpack:///./src/app/common/services/permission/sessionStorage.service.ts","webpack:///./src/app/common/services/spinner/directives/spinner.component.ts","webpack:///./src/app/pages/Purchases/components/DebitNoteAccountWise/FooterwithIncludedVAT.component.ts","webpack:///./src/app/pages/Sales/components/salesinvoice/AddCustomerPopup.module.ts","webpack:///./src/app/pages/Sales/components/salesinvoice/Transport-popup.module.ts","webpack:///./src/app/pages/Sales/components/salesinvoice/generic-popup-Tender.module.ts","webpack:///./src/app/pages/footer/footer.component.ts","webpack:///./src/app/pages/login/enterSecurityCode.component.ts","webpack:///./src/app/pages/login/index.ts","webpack:///./src/app/pages/login/login.componentcopy.ts","webpack:///./src/app/pages/login/login.routing.ts","webpack:///./src/app/pages/login/newPassword.component.ts","webpack:///./src/app/pages/masters/components/party-ledger/partyledger.service.ts","webpack:///./src/app/pages/modaldialogs/GRNDialog/GRNPopUp.ts","webpack:///./src/app/pages/modaldialogs/logindialog/logindialog.component.ts","webpack:///./src/app/pages/pages.routing.ts","webpack:///./src/app/theme/components/baAmChart/baAmChart.component.ts","webpack:///./src/app/theme/components/baAmChart/baAmChartTheme.service.ts","webpack:///./src/app/theme/components/baAmChart/index.ts","webpack:///./src/app/theme/components/baBackTop/baBackTop.component.ts","webpack:///./src/app/theme/components/baBackTop/index.ts","webpack:///./src/app/theme/components/baCard/baCard.component.ts","webpack:///./src/app/theme/components/baCard/baCardBlur.directive.ts","webpack:///./src/app/theme/components/baCard/baCardBlurHelper.service.ts","webpack:///./src/app/theme/components/baCard/index.ts","webpack:///./src/app/theme/components/baChartistChart/baChartistChart.component.ts","webpack:///./src/app/theme/components/baChartistChart/index.ts","webpack:///./src/app/theme/components/baCheckbox/baCheckbox.component.ts","webpack:///./src/app/theme/components/baCheckbox/index.ts","webpack:///./src/app/theme/components/baContentTop/baContentTop.component.ts","webpack:///./src/app/theme/components/baContentTop/index.ts","webpack:///./src/app/theme/components/baFullCalendar/baFullCalendar.component.ts","webpack:///./src/app/theme/components/baFullCalendar/index.ts","webpack:///./src/app/theme/components/baMenu/baMenu.component.ts","webpack:///./src/app/theme/components/baMenu/components/baMenuItem/baMenuItem.component.ts","webpack:///./src/app/theme/components/baMenu/components/baMenuItem/index.ts","webpack:///./src/app/theme/components/baMenu/index.ts","webpack:///./src/app/theme/components/baMsgCenter/baMsgCenter.component.ts","webpack:///./src/app/theme/components/baMsgCenter/baMsgCenter.service.ts","webpack:///./src/app/theme/components/baMsgCenter/index.ts","webpack:///./src/app/theme/components/baMultiCheckbox/baMultiCheckbox.component.ts","webpack:///./src/app/theme/components/baMultiCheckbox/index.ts","webpack:///./src/app/theme/components/baPageTop/baPageTop.component.ts","webpack:///./src/app/theme/components/baPageTop/index.ts","webpack:///./src/app/theme/components/baPictureUploader/baPictureUploader.component.ts","webpack:///./src/app/theme/components/baPictureUploader/index.ts","webpack:///./src/app/theme/components/baSidebar/baSidebar.component.ts","webpack:///./src/app/theme/components/baSidebar/index.ts","webpack:///./src/app/theme/components/index.ts","webpack:///./src/app/theme/directives/baScrollPosition/baScrollPosition.directive.ts","webpack:///./src/app/theme/directives/baScrollPosition/index.ts","webpack:///./src/app/theme/directives/baSlimScroll/baSlimScroll.directive.ts","webpack:///./src/app/theme/directives/baSlimScroll/index.ts","webpack:///./src/app/theme/directives/baThemeRun/baThemeRun.directive.ts","webpack:///./src/app/theme/directives/baThemeRun/index.ts","webpack:///./src/app/theme/directives/index.ts","webpack:///./src/app/theme/pipes/baAppPicture/baAppPicture.pipe.ts","webpack:///./src/app/theme/pipes/baAppPicture/index.ts","webpack:///./src/app/theme/pipes/baKameleonPicture/baKameleonPicture.pipe.ts","webpack:///./src/app/theme/pipes/baKameleonPicture/index.ts","webpack:///./src/app/theme/pipes/baProfilePicture/baProfilePicture.pipe.ts","webpack:///./src/app/theme/pipes/baProfilePicture/index.ts","webpack:///./src/app/theme/pipes/twoDigitNumber/index.ts","webpack:///./src/app/theme/pipes/twoDigitNumber/twoDigitNumber.pipe.ts","webpack:///./src/app/theme/services/baImageLoader/baImageLoader.service.ts","webpack:///./src/app/theme/services/baImageLoader/index.ts","webpack:///./src/app/theme/services/baMenu/index.ts","webpack:///./src/app/theme/services/baThemePreloader/baThemePreloader.service.ts","webpack:///./src/app/theme/services/baThemePreloader/index.ts","webpack:///./src/app/theme/services/baThemeSpinner/baThemeSpinner.service.ts","webpack:///./src/app/theme/services/baThemeSpinner/index.ts","webpack:///./src/app/theme/validators/editPassword.validator.ts","webpack:///./src/app/theme/validators/email.validator.ts","webpack:///./src/app/theme/validators/equalPasswords.validator.ts","webpack:///./~/moment/locale ^\\.\\/.*$","webpack:///./src/app/theme/initial.scss","webpack:///./src/app/app.scss","webpack:///./src/app/common/nepali-date-picker/nepali-date-picker.component.scss","webpack:///./src/app/pages/login/login.scss","webpack:///./src/app/theme/components/baAmChart/baAmChart.scss","webpack:///./src/app/theme/components/baBackTop/baBackTop.scss","webpack:///./src/app/theme/components/baChartistChart/baChartistChart.scss","webpack:///./src/app/theme/components/baCheckbox/baCheckbox.scss","webpack:///./src/app/theme/components/baContentTop/baContentTop.scss","webpack:///./src/app/theme/components/baFullCalendar/baFullCalendar.scss","webpack:///./src/app/theme/components/baMenu/baMenu.scss","webpack:///./src/app/theme/components/baMenu/components/baMenuItem/baMenuItem.scss","webpack:///./src/app/theme/components/baMsgCenter/baMsgCenter.scss","webpack:///./src/app/theme/components/baPageTop/baPageTop.scss","webpack:///./src/app/theme/components/baPictureUploader/baPictureUploader.scss","webpack:///./src/app/theme/components/baSidebar/baSidebar.scss","webpack:///./src/app/common/Invoice/invoice.component.html","webpack:///./src/app/common/Invoice/invoicePrint.component.html","webpack:///./src/app/common/Invoice/purchasePrint.component.html","webpack:///./src/app/common/Transaction Components/InventoryParameters.html","webpack:///./src/app/common/Transaction Components/ProductInsert.html","webpack:///./src/app/common/Transaction Components/TrnMainParameters.html","webpack:///./src/app/common/Transaction Components/VATnoEntry.component.html","webpack:///./src/app/common/Transaction Components/account-master-action.component.html","webpack:///./src/app/common/Transaction Components/account-voucher-summary.component.html","webpack:///./src/app/common/Transaction Components/opening-balance-action.component.html","webpack:///./src/app/common/Transaction Components/pricecalculator/price-calculatorpopup.component.css","webpack:///./src/app/common/Transaction Components/pricecalculator/price-calculatorpopup.component.html","webpack:///./src/app/common/Transaction Components/trnmain-branch.component.html","webpack:///./src/app/common/Transaction Components/trnmain-note-itembase-entry.component.html","webpack:///./src/app/common/Transaction Components/trnmain-purchase.component.html","webpack:///./src/app/common/Transaction Components/trnmain-voucher-entry.component.html","webpack:///./src/app/common/Transaction Components/trntran-voucher-entry.component.html","webpack:///./src/app/common/Transaction Components/voucher-date.component.html","webpack:///./src/app/common/Transaction Components/voucher-master-action.component.html","webpack:///./src/app/common/Transaction Components/voucher-master-toggler.component.html","webpack:///./src/app/common/Transaction Components/voucher-message-remarks.component.html","webpack:///./src/app/common/Transaction Components/voucher-sidebar-billdetail.component.html","webpack:///./src/app/common/Transaction Components/voucher-total-area.component.html","webpack:///./src/app/common/nepali-date-picker/nepali-date-picker.component.html","webpack:///./src/app/common/popupLists/PopBatchList/PopBatch.html","webpack:///./src/app/common/popupLists/PopItemList/PopItems.html","webpack:///./src/app/common/popupLists/PopPartyList/popPartyList.html","webpack:///./src/app/common/popupLists/PopScheme/popscheme.html","webpack:///./src/app/common/popupLists/PopupCategoryList/PopCategory.html","webpack:///./src/app/common/popupLists/PopupItemGrpList/PopItemGrp.html","webpack:///./src/app/common/popupLists/file-uploader/file-uploader-popup.component.html","webpack:///./src/app/common/popupLists/generic-grid/generic-popup-grid.component.html","webpack:///./src/app/common/popupLists/import-purchase-details/import-purchase-details.component.css","webpack:///./src/app/common/popupLists/import-purchase-details/import-purchase-details.component.html","webpack:///./src/app/common/popupLists/multiple-price-popup/multiple-price-popup-grid.component.html","webpack:///./src/app/common/popupLists/new-generic-grid-approved/new-generic-popup-grid-approved.component.html","webpack:///./src/app/common/popupLists/new-generic-grid/new-generic-popup-grid.component.html","webpack:///./src/app/common/popupLists/notification/notification-popup-grid.component.html","webpack:///./src/app/common/popupLists/party-opening-details-popup/party-opening-details-popup.component.html","webpack:///./src/app/common/services/alert/directives/alert.component.html","webpack:///./src/app/common/services/navigation-perventor/directives/navigation-preventor.component.html","webpack:///./src/app/common/services/spinner/directives/spinner.component.html","webpack:///./src/app/pages/Purchases/components/DebitNoteAccountWise/FooterwithIncludedVAT.component.html","webpack:///./src/app/pages/Sales/components/salesinvoice/AddCustomerPopup.html","webpack:///./src/app/pages/Sales/components/salesinvoice/Transport-popup.html","webpack:///./src/app/pages/Sales/components/salesinvoice/generic-popup-Tender.html","webpack:///./src/app/pages/login/enterSecurityCode.component.html","webpack:///./src/app/pages/login/newPassword.component.html","webpack:///./src/app/pages/login/searchUser.component.html","webpack:///./src/app/pages/login/sendEmail.component.html","webpack:///./src/app/pages/modaldialogs/GRNDialog/GRNPopUp.html","webpack:///./src/app/pages/modaldialogs/logindialog/logindialog.component.css","webpack:///./src/app/theme/components/baAmChart/baAmChart.html","webpack:///./src/app/theme/components/baCard/baCard.html","webpack:///./src/app/theme/components/baChartistChart/baChartistChart.html","webpack:///./src/app/theme/components/baCheckbox/baCheckbox.html","webpack:///./src/app/theme/components/baContentTop/baContentTop.html","webpack:///./src/app/theme/components/baFullCalendar/baFullCalendar.html","webpack:///./src/app/theme/components/baMenu/baMenu.html","webpack:///./src/app/theme/components/baMenu/components/baMenuItem/baMenuItem.html","webpack:///./src/app/theme/components/baMsgCenter/baMsgCenter.html","webpack:///./src/app/theme/components/baMultiCheckbox/baMultiCheckbox.html","webpack:///./src/app/theme/components/baPageTop/baPageTop.html","webpack:///./src/app/theme/components/baPictureUploader/baPictureUploader.html","webpack:///./src/app/theme/components/baSidebar/baSidebar.html","webpack:///./src/app/theme/initial.scss?6a5d","webpack:///./src/app/app.scss?366e","webpack:///./src/app/theme/components/baAmChart/baAmChart.scss?929e","webpack:///./src/app/theme/components/baChartistChart/baChartistChart.scss?1fe3","webpack:///./src/app/theme/components/baFullCalendar/baFullCalendar.scss?9e52","webpack:///./src/app/theme/components/baMenu/baMenu.scss?0fa9","webpack:///./src/app/theme/components/baMenu/components/baMenuItem/baMenuItem.scss?8572","webpack:///./src/app/theme/components/baPageTop/baPageTop.scss?b814","webpack:///./src/app/theme/components/baSidebar/baSidebar.scss?e992","webpack:///delegated ./node_modules/rxjs/ReplaySubject.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/operator/observeOn.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/SubjectSubscription.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/operator/distinctUntilChanged.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/scheduler/queue.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/Subscriber.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/@angular/compiler/@angular/compiler.es5.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/observable/forkJoin.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/observable/fromEvent.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/observable/merge.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/observable/timer.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/auditTime.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/do.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/finally.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/first.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/share.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/startWith.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/switchMap.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/add/operator/toPromise.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/operator/scan.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/operator/map.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/symbol/rxSubscriber.js from dll-reference vendor_lib","webpack:///delegated ./node_modules/rxjs/util/ObjectUnsubscribedError.js from dll-reference vendor_lib","webpack:///crypto (ignored)","webpack:///stream (ignored)","webpack:///./src/main.browser.ts"],"sourcesContent":["import { Injectable, ElementRef } from \"@angular/core\";\r\nimport { PREFIX } from \"./../interfaces/Prefix.interface\";\r\nimport { MasterRepo } from \"./../repositories/masterRepo.service\";\r\nimport {\r\n TrnProd,\r\n VoucherTypeEnum,\r\n TrnMain_AdditionalInfo,\r\n Transporter_Eway,\r\n Trntran,\r\n} from \"./../interfaces/TrnMain\";\r\nimport { TrnMain } from \"./../interfaces/TrnMain\";\r\nimport { IDivision } from \"./../interfaces/commonInterface.interface\";\r\nimport { AuthService } from \"./../services/permission/index\";\r\nimport { Observable } from \"rxjs/Observable\";\r\nimport { BehaviorSubject } from \"rxjs/BehaviorSubject\";\r\nimport { TAcList } from \"../interfaces/Account.interface\";\r\nimport Rx, { Subject } from \"rxjs/Rx\";\r\nimport * as _ from \"lodash\";\r\nimport { SettingService } from \"../services/setting.service\";\r\nimport { Product } from \"../interfaces\";\r\nimport { PriceRate } from \"./../interfaces/PriceRate.interface\";\r\nimport { AlertService } from \"../services/alert/alert.service\";\r\nimport { SpinnerService } from \"../services/spinner/spinner.service\";\r\nimport { Filter } from \"../interfaces/filter.interface\";\r\nimport { Subscriber } from \"rxjs/Subscriber\";\r\nimport { ActivatedRoute } from \"@angular/router\";\r\nimport * as moment from 'moment'\r\nimport { FindValueOperator } from \"rxjs/operator/find\";\r\nimport { ComponentsModule } from \"../../pages/components/components.module\";\r\nimport { ProductDistributionChannelLevelReport } from \"../../pages/ReportDialogs/product-distribution-channel-level/product-distribution-channel-level.component\";\r\nimport { PreventNavigationService } from \"../services/navigation-perventor/navigation-perventor.service\";\r\nimport { ImportPurchaseDetails } from \"../popupLists/import-purchase-details/import-purchase-details.component\";\r\n\r\n@Injectable()\r\nexport class TransactionService {\r\n TrnMainObj: TrnMain = {};\r\n FilterObj: Filter = {}\r\n Warehouse: string;\r\n pageHeading: string;\r\n prefix: PREFIX = {};\r\n division: IDivision = {};\r\n saveDisable: boolean;\r\n differenceAmount: number = 0;\r\n trntranTotal: number = 0;\r\n CustomerObjForDiscount: any = {};\r\n activeurlpath: any;\r\n crTotal: number = 0;\r\n drTotal: number = 0;\r\n salesMode: string;\r\n cnMode: string;\r\n warrentyUpToDate: Date;\r\n warrentyVchrList: any[];\r\n buttonHeading: string = \"Reference No\";\r\n QuantityMsg: string;\r\n Dup_ItemBatchValidation: string;\r\n inputCode: boolean;\r\n qtyCheckForPrint: boolean = false;\r\n customerEvent: boolean = false;\r\n printModeForInvoice: any;\r\n prodListForUnfinedBill: boolean = false;\r\n schemeApplyClick: boolean = false;\r\n schemePresentCheck: boolean = false;\r\n accountListSubject: BehaviorSubject = new BehaviorSubject<\r\n TAcList[]\r\n >([]);\r\n accountListObersver$: Observable<\r\n TAcList[]\r\n > = this.accountListSubject.asObservable();\r\n TableAcHeader: string = \"Description\";\r\n prodListMode: ProdListMode;\r\n prodDisableSubject: BehaviorSubject = new BehaviorSubject(\r\n false\r\n );\r\n prodDisable$: Observable = this.prodDisableSubject.asObservable();\r\n cnReturnedProdList: TrnProd[];\r\n referenceNoSubject: BehaviorSubject = new BehaviorSubject(\"\");\r\n referenceNo$: Observable = this.referenceNoSubject.asObservable();\r\n public PrintStuffSubject: BehaviorSubject = new BehaviorSubject({});\r\n public PrintStuff$: Observable = this.PrintStuffSubject.asObservable();\r\n\r\n supplierwiseItem: any = 0;\r\n returnVoucherMain: any = {};\r\n DefaultSellableWarehouse: string;\r\n partyList: any[] = [];\r\n userProfile: any = {};\r\n userSetting: any = {};\r\n CustomerList: any[] = [];\r\n doubleClick: boolean = false;\r\n customerListInPopup: boolean = false;\r\n salesmanID: string;\r\n salesmanName: string;\r\n routeCode: string;\r\n customerDoubleClick: boolean = false;\r\n saveButton: boolean = false;\r\n billtoStatus: boolean = false;\r\n billunitevent: boolean = false;\r\n //extra settings for performa invoice\r\n showPerformaApproveReject: boolean = false; // initially false\r\n stocktransferBillType:string; \r\n disableFullReturn:boolean=false;\r\n\r\n\r\n salesReturnWarehouse: string;\r\n warehousetypeforSalesReturn: string;\r\n onViewClick: boolean;\r\n fromNotification: boolean = false;\r\n billTo: string;\r\n BarcodeFromScan: string;\r\n ItemsListForMultiItemBarcode: any[] = [];\r\n voucherNoHeader: string = \"Bill No\";\r\n availableSchemes: any[] = [];\r\n unApprovedSKUTotalQty: number;\r\n billedCustomerType: string;\r\n refBillforUnselablePurchaseReturn: string;\r\n isNotificationView: boolean;\r\n skuWiseTotalQty: number;\r\n skuWiseList: any;\r\n disableInvRefBillAccBillType: boolean;\r\n disableQuantityEdit: boolean;//disable quantity entry field in purchase\r\n altConfactor: number;\r\n TOTALALLDISCOUNT: number;\r\n conversrionFactor: number = 0;\r\n disableSupplierInfo: boolean;\r\n saveChanges: boolean = true;\r\n disablePerformaBillingForLastTwoDays: boolean = false;\r\n public isSelfBill = false;\r\n subledgerfocus:boolean=false;\r\n totalCRAmount: number = 0;\r\n creditList: Trntran[] = [];\r\n public viewDate = new Subject();\r\n creditlimit : any;\r\n MAPID_Is : any;\r\n Party_or_Expense_Ac: any; \r\n masterSelectACID: string;\r\n checkCrAmount:boolean;\r\n PhiscalObj: any = {};\r\n totalDRAmount: number = 0;\r\n storePreviousRoundOff\r\n DrillMode:string;\r\n AD_PHISCALID:string;\r\n BEGINDATE:string;\r\n ENDDATE:string;\r\n ProrataDis:number;\r\n public HidePopup = new Subject();\r\n showAddCosting:boolean;\r\n schemeApply:any[]=[];\r\n remarks:string;\r\n BATCH:string;\r\n isDownloaded:number\r\n excelLoad:boolean=false\r\n constructor(\r\n private masterService: MasterRepo,\r\n private setting: SettingService,\r\n private authservice: AuthService,\r\n private alertService: AlertService,\r\n private loadingService: SpinnerService,\r\n private arouter: ActivatedRoute,\r\n public preventNavigationService: PreventNavigationService\r\n ) {\r\n this.AppSettings = setting.appSetting;\r\n this.userProfile = authservice.getUserProfile();\r\n this.userSetting = authservice.getSetting();\r\n \r\n // this.masterService.getProductItemList().subscribe();\r\n\r\n this.isNotificationView = false;\r\n this.isSelfBill = false;\r\n this.TrnMainObj.isSelfBill = false;\r\n \r\n }\r\n\r\n trnmainBehavior: BehaviorSubject = new BehaviorSubject({});\r\n loadDataObservable: Observable = this.trnmainBehavior.asObservable();\r\n PMode: string; //p for party mode and c for customer mode\r\n MaxTotalAmountLimit: number = 5000;\r\n DefaultCustomerAc: string = \"\";\r\n SettlementNo: any;\r\n INVMAIN: any;\r\n AppSettings: any;\r\n CashList: any[] = [];\r\n PurchaseAcList: any[] = [];\r\n paymentmodelist: any[] = [];\r\n paymentAccountList: any[] = [];\r\n settlementList: any[] = [];\r\n stockListForApproved: any[] = [];\r\n loadData(VCHR, division, phiscalid) {\r\n //return new Observable((observer: Subscriber) => {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n\r\n\r\n if (this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoice || this.TrnMainObj.VoucherType == VoucherTypeEnum.PerformaSalesInvoice) {\r\n this.salesmanName = this.TrnMainObj.SALESMAN;\r\n if (this.TrnMainObj.TRNMODE == 'cash') {\r\n this.masterService.getAccountNameByTrnac(this.TrnMainObj.TRNAC).subscribe(\r\n data => {\r\n this.masterService.Account = data.result.result;\r\n }\r\n )\r\n\r\n }\r\n }\r\n if (this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase) {\r\n this.TrnMainObj.Mode = \"EDIT\";\r\n }\r\n\r\n else if (this.TrnMainObj.VoucherType == VoucherTypeEnum.PerformaSalesInvoice) {\r\n\r\n if (this.masterService.headerMode == \"(VIEW)\") {\r\n\r\n this.TrnMainObj.Mode = \"VIEW\"\r\n }\r\n if (this.masterService.headerMode == \"(EDIT)\") {\r\n this.TrnMainObj.Mode = \"EDIT\"\r\n }\r\n\r\n }\r\n else {\r\n this.TrnMainObj.Mode = \"VIEW\";\r\n }\r\n\r\n if (this.TrnMainObj.TransporterEway == null) {\r\n this.TrnMainObj.TransporterEway = {};\r\n }\r\n if (this.TrnMainObj.AdditionalObj == null) {\r\n this.TrnMainObj.AdditionalObj = {};\r\n }\r\n if (this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSettlement) {\r\n this.TrnMainObj.Mode = \"EDIT\";\r\n this.TrnMainObj.ProdList.forEach(element => {\r\n element.inputMode = true;\r\n });\r\n }\r\n\r\n this.viewDate.next();\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n\r\n }\r\n\r\n\r\n this.ReCalculateBillWithNormal();\r\n\r\n if (this.TrnMainObj.VoucherType == VoucherTypeEnum.PerformaSalesInvoice) {\r\n this.Warehouse = this.TrnMainObj.MWAREHOUSE;\r\n if (\r\n !this.Warehouse &&\r\n this.TrnMainObj.ProdList &&\r\n this.TrnMainObj.ProdList.length > 0\r\n ) {\r\n this.Warehouse = this.TrnMainObj.ProdList[0].WAREHOUSE;\r\n }\r\n\r\n }\r\n\r\n // if (this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase) {\r\n // if(data.result.ImporterPriceCalcList!=null && data.result.ImporterPriceCalcList && data.result.ImporterPriceCalcList.length){\r\n // for (let i of data.result.ProdList) {\r\n // let costingdata= data.result.ImporterPriceCalcList.filter(x=>(x.MCODE==i.MCODE && x.BATCH==i.BATCH));\r\n // i.ImporterPriceCalcList = data.result.ImporterPriceCalcList.filter(x=>(x.MCODE==i.MCODE && x.BATCH==i.BATCH))[0];\r\n // for (let j of costingdata) {\r\n // if(j.MCODE==i.MCODE && j.BATCH==i.BATCH){\r\n // i.IsCostingSaved=true;\r\n // i.backgroundcolor=\"lightgreen\";\r\n // }\r\n // }\r\n\r\n // } \r\n // }\r\n // }\r\n\r\n \r\n\r\n\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n this.TrnMainObj.CHEQUEDATE =\r\n this.TrnMainObj.CHEQUEDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.CHEQUEDATE.toString().substring(0, 10);\r\n this.TrnMainObj.DeliveryDate =\r\n this.TrnMainObj.DeliveryDate == null\r\n ? \"\"\r\n : this.TrnMainObj.DeliveryDate.toString().substring(0, 10);\r\n\r\n this.TrnMainObj.TrntranList.forEach(trntran => {\r\n if (trntran.A_ACID) {\r\n trntran.acitem = trntran.AccountItem;\r\n trntran.ROWMODE == \"save\";\r\n } else {\r\n trntran.acitem = {};\r\n trntran.ROWMODE == \"save\";\r\n }\r\n });\r\n\r\n let acid = this.TrnMainObj.TRNAC;\r\n\r\n this.masterService.accountList$.subscribe(aclist => {\r\n if (aclist) {\r\n let ac = aclist.find(x => x.ACID == acid);\r\n if (ac && ac != null && ac != undefined)\r\n this.TrnMainObj.TRNACName = ac.ACNAME;\r\n }\r\n this.trnmainBehavior.next(this.TrnMainObj);\r\n });\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n }\r\n\r\n loadStockSettlement(VCHR) {\r\n this.masterService.LoadStockSettlement(VCHR).subscribe(\r\n data => {\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n\r\n\r\n if (this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSettlement) {\r\n this.TrnMainObj.Mode = \"NEW\";\r\n\r\n this.TrnMainObj.ProdList.forEach(element => {\r\n element.inputMode = true;\r\n });\r\n }\r\n\r\n for (let i in this.TrnMainObj.ProdList) {\r\n // this.setAltunitDropDownForViewStock(i);\r\n this.setAltunitDropDownForView(i);\r\n\r\n this.TrnMainObj.ProdList[i].IsApproveStockSettlement = true;\r\n this.TrnMainObj.ProdList[i].MFGDATE =\r\n this.TrnMainObj.ProdList[i].MFGDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(\r\n 0,\r\n 10\r\n );\r\n this.TrnMainObj.ProdList[i].EXPDATE =\r\n this.TrnMainObj.ProdList[i].EXPDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(\r\n 0,\r\n 10\r\n );\r\n\r\n }\r\n\r\n this.ReCalculateBillWithNormal();\r\n this.getCurrentDate();\r\n this.Warehouse = this.TrnMainObj.MWAREHOUSE;\r\n if (\r\n !this.Warehouse &&\r\n this.TrnMainObj.ProdList &&\r\n this.TrnMainObj.ProdList.length > 0\r\n ) {\r\n this.Warehouse = this.TrnMainObj.ProdList[0].WAREHOUSE;\r\n }\r\n this.trnmainBehavior.next(this.TrnMainObj);\r\n }\r\n },\r\n error => {\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => this.trnmainBehavior.complete()\r\n );\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n getItemType() {\r\n return [\r\n { label: \"FOC\", value: \"FOC\" },\r\n { label: \"FAULTY\", value: \"FALUTY\" }\r\n ];\r\n }\r\n\r\n getReceivedType() {\r\n return [\r\n { label: \"DAMAGED\", value: \"DAMAGED\" },\r\n { label: \"MISSING\", value: \"MISSING\" }\r\n ];\r\n }\r\n // ReCalculateBill() {\r\n // //calculating flat discount. If GblReplaceIndividualWithFlat=1 or 0\r\n // var i: number = 0;\r\n // //var amt: number = 0;\r\n // this.TrnMainObj.TOTAMNT = 0;\r\n // this.TrnMainObj.TOTALINDDISCOUNT = 0;\r\n // this.TrnMainObj.TOTALPROMOTION = 0;\r\n // this.TrnMainObj.TOTALLOYALTY = 0;\r\n // this.TrnMainObj.DCAMNT = 0;\r\n // this.TrnMainObj.ServiceCharge = 0;\r\n // this.TrnMainObj.TAXABLE = 0;\r\n // this.TrnMainObj.NONTAXABLE = 0;\r\n // this.TrnMainObj.VATAMNT = 0;\r\n // this.TrnMainObj.NETWITHOUTROUNDOFF = 0;\r\n // this.TrnMainObj.TotalWithIndDiscount = 0;\r\n // this.TrnMainObj.TOTALDISCOUNT = 0;\r\n // this.TrnMainObj.TOTALQTY = 0;\r\n // this.TrnMainObj.TOTALWEIGHT = 0;\r\n // this.TrnMainObj.TOTALDISCOUNT_VATINCLUDED = 0;\r\n // this.TrnMainObj.ProdList.forEach(prod => {\r\n // if (prod.EXPDATE != null) {\r\n // prod.EXPDATE = prod.EXPDATE.toString().substring(0, 10);\r\n // }\r\n // if (prod.MFGDATE != null) {\r\n // prod.MFGDATE = prod.MFGDATE.toString().substring(0, 10);\r\n // }\r\n\r\n\r\n\r\n // i++;\r\n // prod.SNO = i;\r\n // let totalAmt = 0;\r\n // this.TrnMainObj.ProdList.forEach(x => {\r\n // totalAmt +=\r\n // x.AMOUNT -\r\n // this.nullToZeroConverter(x.INDDISCOUNT) -\r\n // this.nullToZeroConverter(x.PROMOTION) -\r\n // this.nullToZeroConverter(x.LOYALTY) -\r\n // this.nullToZeroConverter(x.PrimaryDiscount) -\r\n // this.nullToZeroConverter(x.SecondaryDiscount) -\r\n // this.nullToZeroConverter(x.LiquiditionDiscount);\r\n // });\r\n // // amt +=\r\n // // prod.AMOUNT -\r\n // // this.nullToZeroConverter(prod.INDDISCOUNT) -\r\n // // this.nullToZeroConverter(prod.PROMOTION) -\r\n // // this.nullToZeroConverter(prod.LOYALTY) -\r\n // // this.nullToZeroConverter(prod.PrimaryDiscount) -\r\n // // this.nullToZeroConverter(prod.SecondaryDiscount) -\r\n // // this.nullToZeroConverter(prod.LiquiditionDiscount)\r\n // // ;\r\n // i++;\r\n // prod.SNO = i;\r\n // if (this.TrnMainObj.ReplaceIndividualWithFlatDiscount == 1) {\r\n // if (this.TrnMainObj.TOTALFLATDISCOUNT != 0) {\r\n // prod.INDDISCOUNT = 0;\r\n // }\r\n // }\r\n // if (totalAmt == 0) {\r\n // prod.FLATDISCOUNT = 0;\r\n // } else {\r\n // prod.FLATDISCOUNT =\r\n // (prod.AMOUNT -\r\n // this.nullToZeroConverter(prod.INDDISCOUNT) -\r\n // this.nullToZeroConverter(prod.PROMOTION) -\r\n // this.nullToZeroConverter(prod.LOYALTY) -\r\n // this.nullToZeroConverter(prod.PrimaryDiscount) -\r\n // this.nullToZeroConverter(prod.SecondaryDiscount) -\r\n // this.nullToZeroConverter(prod.LiquiditionDiscount)) *\r\n // (this.nullToZeroConverter(this.TrnMainObj.TOTALFLATDISCOUNT) /\r\n // totalAmt);\r\n // }\r\n\r\n // prod.DISCOUNT =\r\n // this.nullToZeroConverter(prod.INDDISCOUNT) +\r\n // this.nullToZeroConverter(prod.FLATDISCOUNT) +\r\n // this.nullToZeroConverter(prod.PROMOTION) +\r\n // this.nullToZeroConverter(prod.LOYALTY) +\r\n // this.nullToZeroConverter(prod.PrimaryDiscount) +\r\n // this.nullToZeroConverter(prod.SecondaryDiscount) +\r\n // this.nullToZeroConverter(prod.LiquiditionDiscount);\r\n // if (prod.ISSERVICECHARGE == 1) {\r\n // prod.SERVICETAX =\r\n // (prod.AMOUNT - prod.DISCOUNT) *\r\n // this.setting.appSetting.ServiceTaxRate;\r\n // }\r\n // if (prod.ISVAT == 1) {\r\n // prod.TAXABLE =\r\n // prod.AMOUNT -\r\n // prod.DISCOUNT +\r\n // this.nullToZeroConverter(prod.SERVICETAX);\r\n // prod.VAT = (prod.TAXABLE *this.nullToZeroConverter(this.setting.appSetting.VATRate)) / 100;\r\n // // prod.VAT_ONLYFORSHOWING =\r\n // // prod.TAXABLE - prod.TAXABLE / (1 + prod.GSTRATE_ONLYFORSHOWING / 100);\r\n // prod.NONTAXABLE = 0;\r\n // prod.NCRATE = prod.RATE * prod.EXRATE;\r\n // // if (prod.REALQTY_IN == 0)\r\n // // { prod.NCRATE = prod.PRATE; }\r\n // // else\r\n // // { prod.NCRATE = prod.TAXABLE / this.nullToZeroConverter(prod.REALQTY_IN); }\r\n // } else {\r\n // prod.TAXABLE = 0;\r\n // prod.VAT = 0;\r\n // prod.NONTAXABLE =\r\n // prod.AMOUNT -\r\n // prod.DISCOUNT +\r\n // this.nullToZeroConverter(prod.SERVICETAX);\r\n // prod.NCRATE = prod.RATE * prod.EXRATE;\r\n // // if (prod.REALQTY_IN == 0)\r\n // // { prod.NCRATE = prod.PRATE; }\r\n // // else\r\n // // { prod.NCRATE = prod.NONTAXABLE / this.nullToZeroConverter(prod.REALQTY_IN); }\r\n // }\r\n // prod.NETAMOUNT =\r\n // this.nullToZeroConverter(prod.TAXABLE) +\r\n // this.nullToZeroConverter(prod.NONTAXABLE) +\r\n // this.nullToZeroConverter(prod.SERVICETAX) +\r\n // this.nullToZeroConverter(prod.VAT);\r\n\r\n // this.TrnMainObj.TOTAMNT += prod.AMOUNT;\r\n // this.TrnMainObj.TOTALINDDISCOUNT += this.nullToZeroConverter(\r\n // prod.INDDISCOUNT\r\n // );\r\n // this.TrnMainObj.TOTALLOYALTY += this.nullToZeroConverter(prod.LOYALTY);\r\n // this.TrnMainObj.TOTALPROMOTION += this.nullToZeroConverter(\r\n // prod.PROMOTION\r\n // );\r\n // this.TrnMainObj.DCAMNT += this.nullToZeroConverter(prod.DISCOUNT);\r\n // this.TrnMainObj.ServiceCharge += this.nullToZeroConverter(\r\n // prod.SERVICETAX\r\n // );\r\n // this.TrnMainObj.TAXABLE += this.nullToZeroConverter(prod.TAXABLE);\r\n // this.TrnMainObj.NONTAXABLE += this.nullToZeroConverter(prod.NONTAXABLE);\r\n // this.TrnMainObj.VATAMNT += this.nullToZeroConverter(prod.VAT);\r\n // this.TrnMainObj.NETWITHOUTROUNDOFF += this.nullToZeroConverter(\r\n // prod.NETAMOUNT\r\n // );\r\n // this.TrnMainObj.TotalWithIndDiscount += this.nullToZeroConverter(\r\n // prod.TOTAL\r\n // );\r\n // this.TrnMainObj.TOTALDISCOUNT += this.nullToZeroConverter(prod.DISCOUNT);\r\n // this.TrnMainObj.TOTALQTY += this.nullToZeroConverter(\r\n // prod.Quantity *\r\n // (this.nullToZeroConverter(prod.CONFACTOR) <= 0\r\n // ? 1\r\n // : this.nullToZeroConverter(prod.CONFACTOR))\r\n // );\r\n // this.TrnMainObj.TOTALWEIGHT += this.nullToZeroConverter(prod.WEIGHT);\r\n // this.TrnMainObj.TOTALDISCOUNT_VATINCLUDED +=\r\n // this.nullToZeroConverter(prod.INDIVIDUALDISCOUNT_WITHVAT) +\r\n // this.nullToZeroConverter(prod.FLATDISCOUNT);\r\n // });\r\n\r\n // this.TrnMainObj.NETAMNT = Math.round(\r\n // this.nullToZeroConverter(this.TrnMainObj.NETWITHOUTROUNDOFF)\r\n // );\r\n // this.TrnMainObj.ROUNDOFF =\r\n // this.TrnMainObj.NETAMNT - this.TrnMainObj.NETWITHOUTROUNDOFF;\r\n // }\r\n\r\n nullToZeroConverter(value) {\r\n\r\n if (\r\n value == undefined ||\r\n value == null ||\r\n value == \"\" ||\r\n value == \"Infinity\" ||\r\n value == \"NaN\" ||\r\n value === undefined ||\r\n isNaN(parseFloat(value))\r\n ) {\r\n return 0;\r\n }\r\n\r\n return parseFloat(value);\r\n }\r\n // CalculateNormalNew(i) {\r\n // let POBJ = this.TrnMainObj.ProdList[i];\r\n\r\n // try {\r\n // if (\r\n // this.TrnMainObj.ProdList[i].Quantity == null ||\r\n // this.TrnMainObj.ProdList[i].RATE == null\r\n // )\r\n // return;\r\n\r\n // this.TrnMainObj.ProdList[i].AMOUNT =\r\n // this.TrnMainObj.ProdList[i].Quantity *\r\n // this.TrnMainObj.ProdList[i].ALTRATE;\r\n // this.TrnMainObj.ProdList[i].WEIGHT =\r\n // this.TrnMainObj.ProdList[i].CONFACTOR *\r\n // this.TrnMainObj.ProdList[i].Quantity *\r\n // this.nullToZeroConverter(\r\n // this.TrnMainObj.ProdList[i].SELECTEDITEM.GWEIGHT\r\n // );\r\n // if (POBJ.BATCHSCHEME != null) {\r\n // if (POBJ.BATCHSCHEME.discountRateType == 0) {\r\n // this.TrnMainObj.ProdList[i].PROMOTION =\r\n // (POBJ.BATCHSCHEME.schemeDisRate *\r\n // this.TrnMainObj.ProdList[i].AMOUNT) /\r\n // 100;\r\n // } else if (POBJ.BATCHSCHEME.discountRateType == 1) {\r\n // this.TrnMainObj.ProdList[i].PROMOTION =\r\n // this.TrnMainObj.ProdList[i].Quantity *\r\n // POBJ.BATCHSCHEME.schemeDisRate;\r\n // } else if (POBJ.BATCHSCHEME.discountRateType == 2) {\r\n // var factor =\r\n // this.TrnMainObj.ProdList[i].Quantity /\r\n // (POBJ.BATCHSCHEME.minQty + POBJ.BATCHSCHEME.schemeDisRate);\r\n // this.TrnMainObj.ProdList[i].PROMOTION =\r\n // Math.floor(factor) *\r\n // this.TrnMainObj.ProdList[i].RATE *\r\n // POBJ.BATCHSCHEME.schemeDisRate;\r\n // }\r\n // }\r\n // if (\r\n // this.TrnMainObj.ProdList[i].INDDISCOUNTRATE != null &&\r\n // this.nullToZeroConverter( this.TrnMainObj.ProdList[i].INDDISCOUNTRATE) > 0\r\n // ) {\r\n // this.TrnMainObj.ProdList[i].INDDISCOUNT = (this.TrnMainObj.ProdList[i].AMOUNT *\r\n // this.nullToZeroConverter( this.TrnMainObj.ProdList[i].INDDISCOUNTRATE)) / 100;\r\n // if (this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"retailer\" ||\r\n // this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ak\" ||\r\n // this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ck\" ||\r\n // this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"pms\") {\r\n // this.TrnMainObj.ProdList[i].INDIVIDUALDISCOUNT_WITHVAT =\r\n // Math.round(\r\n // ((this.TrnMainObj.ProdList[i].Quantity *\r\n // this.TrnMainObj.ProdList[i].CONFACTOR*\r\n // this.TrnMainObj.ProdList[i].MRP *\r\n // this.nullToZeroConverter( this.TrnMainObj.ProdList[i].INDDISCOUNTRATE)) /\r\n // 100) *\r\n // 100\r\n // ) / 100;\r\n // }\r\n // } else {\r\n // // if (this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"retailer\" ||\r\n // // this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ak\" ||\r\n // // this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ck\" ||\r\n // // this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"pms\") {\r\n // // if (this.nullToZeroConverter(this.TrnMainObj.ProdList[i].INDIVIDUALDISCOUNT_WITHVAT) > 0) {\r\n // // this.TrnMainObj.ProdList[i].INDDISCOUNT =\r\n // // this.nullToZeroConverter( this.TrnMainObj.ProdList[i].INDIVIDUALDISCOUNT_WITHVAT) /\r\n // // (1 + this.TrnMainObj.ProdList[i].GSTRATE / 100);\r\n // // }\r\n // // }\r\n // }\r\n // //primary,secondary,liquidition discount calculate\r\n // this.TrnMainObj.ProdList[i].PrimaryDiscount =\r\n // this.TrnMainObj.ProdList[i].BasePrimaryDiscount *\r\n // this.TrnMainObj.ProdList[i].Quantity;\r\n // this.TrnMainObj.ProdList[i].SecondaryDiscount =\r\n // this.TrnMainObj.ProdList[i].BaseSecondaryDiscount *\r\n // this.TrnMainObj.ProdList[i].Quantity;\r\n // this.TrnMainObj.ProdList[i].LiquiditionDiscount =\r\n // this.TrnMainObj.ProdList[i].BaseLiquiditionDiscount *\r\n // this.TrnMainObj.ProdList[i].Quantity;\r\n // this.TrnMainObj.ProdList[i].DISCOUNT =\r\n // this.nullToZeroConverter(this.TrnMainObj.ProdList[i].INDDISCOUNT) +\r\n // this.nullToZeroConverter(this.TrnMainObj.ProdList[i].PROMOTION) +\r\n // this.nullToZeroConverter(this.TrnMainObj.ProdList[i].LOYALTY) +\r\n // this.nullToZeroConverter(this.TrnMainObj.ProdList[i].PrimaryDiscount) +\r\n // this.nullToZeroConverter(\r\n // this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n // ) +\r\n // this.nullToZeroConverter(\r\n // this.TrnMainObj.ProdList[i].LiquiditionDiscount\r\n // );\r\n // if (this.TrnMainObj.ProdList[i].ISVAT == 1) {\r\n\r\n // this.TrnMainObj.ProdList[i].TAXABLE =\r\n // this.TrnMainObj.ProdList[i].AMOUNT -\r\n // this.TrnMainObj.ProdList[i].DISCOUNT;\r\n // this.TrnMainObj.ProdList[i].NONTAXABLE = 0;\r\n // this.TrnMainObj.ProdList[i].VAT =\r\n // (this.TrnMainObj.ProdList[i].TAXABLE * this.nullToZeroConverter(this.setting.appSetting.VATRate)) /\r\n // 100;\r\n\r\n // this.TrnMainObj.ProdList[i].VAT_ONLYFORSHOWING =\r\n // this.TrnMainObj.ProdList[i].TAXABLE -\r\n // this.TrnMainObj.ProdList[i].TAXABLE /\r\n // (1 + this.TrnMainObj.ProdList[i].GSTRATE_ONLYFORSHOWING / 100);\r\n // } else {\r\n // this.TrnMainObj.ProdList[i].TAXABLE = 0;\r\n // this.TrnMainObj.ProdList[i].NONTAXABLE =\r\n // this.TrnMainObj.ProdList[i].AMOUNT -\r\n // this.TrnMainObj.ProdList[i].DISCOUNT;\r\n // }\r\n // this.TrnMainObj.ProdList[i].NETAMOUNT =\r\n // this.TrnMainObj.ProdList[i].TAXABLE +\r\n // this.TrnMainObj.ProdList[i].NONTAXABLE +\r\n // this.TrnMainObj.ProdList[i].VAT;\r\n\r\n // } catch (ex) {\r\n // this.alertService.error(ex);\r\n // }\r\n // }\r\n CalculateNormal(\r\n TrnProdObj: TrnProd,\r\n ServiceTaxRate = this.setting.appSetting.ServiceTaxRate,\r\n VatRate = this.setting.appSetting.VATRate,\r\n calcuteDiscount = 0\r\n ) {\r\n TrnProdObj.AMOUNT = TrnProdObj.Quantity * TrnProdObj.RATE;\r\n if (this.setting.appSetting.ENABLEMULTICURRENCY == 1) {\r\n TrnProdObj.NCRATE = this.curencyConvert(TrnProdObj.RATE);\r\n TrnProdObj.EXRATE = this.TrnMainObj.EXRATE;\r\n TrnProdObj.AMOUNT = TrnProdObj.Quantity * TrnProdObj.NCRATE;\r\n }\r\n if (calcuteDiscount == 1) {\r\n if (TrnProdObj.IDIS != null) {\r\n if (TrnProdObj.IDIS.indexOf(\"%\") < 0) {\r\n TrnProdObj.INDDISCOUNT = parseFloat(TrnProdObj.IDIS);\r\n } else {\r\n var dis = parseFloat(TrnProdObj.IDIS.replace(\"%\", \"\").trim());\r\n dis = dis / 100;\r\n TrnProdObj.INDDISCOUNT = TrnProdObj.AMOUNT * dis;\r\n }\r\n }\r\n }\r\n TrnProdObj.DISCOUNT =\r\n this.nullToZeroConverter(TrnProdObj.INDDISCOUNT) +\r\n this.nullToZeroConverter(TrnProdObj.PROMOTION) +\r\n this.nullToZeroConverter(TrnProdObj.LOYALTY);\r\n if (this.nullToZeroConverter(TrnProdObj.ISSERVICECHARGE) == 1) {\r\n TrnProdObj.SERVICETAX =\r\n (TrnProdObj.AMOUNT - TrnProdObj.DISCOUNT) * ServiceTaxRate;\r\n }\r\n if (TrnProdObj.ISVAT == 1) {\r\n TrnProdObj.TAXABLE =\r\n TrnProdObj.AMOUNT -\r\n TrnProdObj.DISCOUNT +\r\n this.nullToZeroConverter(TrnProdObj.SERVICETAX);\r\n TrnProdObj.NONTAXABLE = 0;\r\n TrnProdObj.VAT = TrnProdObj.TAXABLE * VatRate;\r\n } else {\r\n TrnProdObj.TAXABLE = 0;\r\n TrnProdObj.NONTAXABLE =\r\n TrnProdObj.AMOUNT -\r\n TrnProdObj.DISCOUNT +\r\n this.nullToZeroConverter(TrnProdObj.SERVICETAX);\r\n }\r\n TrnProdObj.NETAMOUNT =\r\n TrnProdObj.TAXABLE + TrnProdObj.NONTAXABLE + TrnProdObj.VAT;\r\n return TrnProdObj;\r\n }\r\n FlatDiscountPercentChange() {\r\n this.flatDiscountAssign(\"percent\");\r\n }\r\n FlatDiscountAmountChange() {\r\n this.flatDiscountAssign(\"amount\");\r\n }\r\n flatDiscountAssign(changeType) {\r\n if (\r\n changeType == \"percent\" &&\r\n (this.TrnMainObj.DCRATE < 0 || this.TrnMainObj.DCRATE > 100)\r\n ) {\r\n this.TrnMainObj.DCRATE = 0;\r\n alert(\"Invalid Flat Discount Percent\");\r\n return;\r\n }\r\n\r\n let totalAmountWithIndDiscount = this.TrnMainObj.ProdList.reduce(\r\n (sum, x) =>\r\n sum +\r\n (this.nullToZeroConverter(x.AMOUNT) -\r\n this.nullToZeroConverter(x.INDDISCOUNT)),\r\n 0\r\n );\r\n\r\n if (changeType == \"amount\") {\r\n this.TrnMainObj.DCRATE = 0;\r\n if(this.TrnMainObj.TOTALFLATDISCOUNT < 0 || (this.TrnMainObj.TOTALFLATDISCOUNT > this.TrnMainObj.TOTAMNT) ){\r\n this.TrnMainObj.TOTALFLATDISCOUNT=0;\r\n alert(\"Invalid Flat Discount Amount\");\r\n return;\r\n }else{\r\n if(totalAmountWithIndDiscount>0){\r\n this.TrnMainObj.DCRATE = (this.TrnMainObj.TOTALFLATDISCOUNT * 100) / totalAmountWithIndDiscount ;\r\n }\r\n }\r\n } else {\r\n this.TrnMainObj.TOTALFLATDISCOUNT =\r\n (this.TrnMainObj.DCRATE * totalAmountWithIndDiscount) / 100;\r\n }\r\n this.ReCalculateBillWithNormal();\r\n }\r\n curencyConvert(rate) {\r\n var C = this.masterService.Currencies.find(\r\n x => x.CURNAME == this.TrnMainObj.FCurrency\r\n );\r\n if (C != null) {\r\n return C.EXRATE * rate;\r\n } else return rate;\r\n }\r\n\r\n ischeckReturnQuantityError(prod: TrnProd): boolean {\r\n try {\r\n var pr = this.cnReturnedProdList.find(itm => itm.MCODE == prod.MCODE);\r\n if (!pr) {\r\n //there is no such product in return list\r\n return true;\r\n }\r\n let prodarray: TrnProd[] = [];\r\n this.cnReturnedProdList.forEach(prd => {\r\n var p: TrnProd;\r\n\r\n if (prodarray.length > 0) {\r\n p = prodarray.find(res => res.MCODE == prd.MCODE);\r\n }\r\n if (p) {\r\n p.Quantity += prd.Quantity;\r\n p.REALQTY_IN += prd.REALQTY_IN;\r\n if (prd.RATE > p.RATE) {\r\n p.RATE = prd.RATE;\r\n }\r\n } else {\r\n prodarray.push(prd);\r\n }\r\n });\r\n var tProd = prodarray.find(prd => prd.MCODE == prod.MCODE);\r\n if (tProd) {\r\n if (prod.Quantity > tProd.Quantity) {\r\n return true;\r\n }\r\n if (prod.RATE > tProd.RATE) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n } catch (ex) {\r\n }\r\n }\r\n\r\n resetData() {\r\n this.TrnMainObj.TRNAC = null;\r\n this.TrnMainObj.PARAC = null;\r\n this.TrnMainObj.BILLTO = \"\";\r\n this.TrnMainObj.BILLTOADD = \"\";\r\n this.TrnMainObj.BILLTOMOB = \"\";\r\n this.TrnMainObj.BILLTOTEL = \"\";\r\n // this.TrnMainObj.ProdList = [];\r\n }\r\n a = [\r\n \"\",\r\n \"One \",\r\n \"Two \",\r\n \"Three \",\r\n \"Four \",\r\n \"Five \",\r\n \"Six \",\r\n \"Seven \",\r\n \"Eight \",\r\n \"Nine \",\r\n \"Ten \",\r\n \"Eleven \",\r\n \"Twelve \",\r\n \"Thirteen \",\r\n \"Fourteen \",\r\n \"Fifteen \",\r\n \"Sixteen \",\r\n \"Seventeen \",\r\n \"Eighteen \",\r\n \"Nineteen \"\r\n ];\r\n b = [\r\n \"\",\r\n \"\",\r\n \"Twenty\",\r\n \"Thirty\",\r\n \"Forty\",\r\n \"Fifty\",\r\n \"Sixty\",\r\n \"Seventy\",\r\n \"Eighty\",\r\n \"Ninety\"\r\n ];\r\n\r\n decimalToWord(frac) {\r\n if (parseInt(frac[1]) != 0) {\r\n return (\r\n (this.a[Number(frac[1])] ||\r\n this.b[frac[1][0]] + \" \" + this.a[frac[1][1]]) + \"Paisa Only \"\r\n );\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n digitToWord(num) {\r\n if (num != null && num != \"\" && num != undefined) {\r\n var nums = num.toString().split(\".\");\r\n var whole = nums[0];\r\n let w = (\"000000000\" + whole)\r\n .substr(-9)\r\n .match(/^(\\d{2})(\\d{2})(\\d{2})(\\d{1})(\\d{2})$/);\r\n if ((whole = whole.toString()).length > 9) return \"Overflow\";\r\n if (nums.length == 2) {\r\n var wholeFraction = nums[1];\r\n var fraction = wholeFraction.substring(0, 2);\r\n if (\r\n fraction == \"1\" ||\r\n fraction == \"2\" ||\r\n fraction == \"3\" ||\r\n fraction == \"4\" ||\r\n fraction == \"5\" ||\r\n fraction == \"6\" ||\r\n fraction == \"7\" ||\r\n fraction == \"8\" ||\r\n fraction == \"9\"\r\n ) {\r\n fraction = fraction + \"0\";\r\n } else if (\r\n fraction == \"01\" ||\r\n fraction == \"02\" ||\r\n fraction == \"03\" ||\r\n fraction == \"04\" ||\r\n fraction == \"05\" ||\r\n fraction == \"06\" ||\r\n fraction == \"07\" ||\r\n fraction == \"08\" ||\r\n fraction == \"09\"\r\n ) {\r\n fraction = \"09\";\r\n fraction = fraction.substring(1, 2);\r\n }\r\n let f = (\"00\" + fraction).substr(-2).match(/^(\\d{2})$/);\r\n\r\n if (!w || !f) return;\r\n var str = \"\";\r\n str +=\r\n parseInt(w[1]) != 0\r\n ? (this.a[Number(w[1])] ||\r\n this.b[w[1][0]] + \" \" + this.a[w[1][1]]) + \"Crore \"\r\n : \"\";\r\n str +=\r\n parseInt(w[2]) != 0\r\n ? (this.a[Number(w[2])] ||\r\n this.b[w[2][0]] + \" \" + this.a[w[2][1]]) + \"Lakh \"\r\n : \"\";\r\n str +=\r\n parseInt(w[3]) != 0\r\n ? (this.a[Number(w[3])] ||\r\n this.b[w[3][0]] + \" \" + this.a[w[3][1]]) + \"Thousand \"\r\n : \"\";\r\n str +=\r\n parseInt(w[4]) != 0\r\n ? (this.a[Number(w[4])] ||\r\n this.b[w[4][0]] + \" \" + this.a[w[4][1]]) + \"Hundred \"\r\n : \"\";\r\n str +=\r\n parseInt(w[5]) != 0\r\n ? (this.a[Number(w[5])] ||\r\n this.b[w[5][0]] + \" \" + this.a[w[5][1]]) +\r\n \"and \" +\r\n this.decimalToWord(f)\r\n : \"\";\r\n return str;\r\n } else {\r\n if (!w) return;\r\n var str = \"\";\r\n str +=\r\n parseInt(w[1]) != 0\r\n ? (this.a[Number(w[1])] ||\r\n this.b[w[1][0]] + \" \" + this.a[w[1][1]]) + \"Crore \"\r\n : \"\";\r\n str +=\r\n parseInt(w[2]) != 0\r\n ? (this.a[Number(w[2])] ||\r\n this.b[w[2][0]] + \" \" + this.a[w[2][1]]) + \"Lakh \"\r\n : \"\";\r\n str +=\r\n parseInt(w[3]) != 0\r\n ? (this.a[Number(w[3])] ||\r\n this.b[w[3][0]] + \" \" + this.a[w[3][1]]) + \"Thousand \"\r\n : \"\";\r\n str +=\r\n parseInt(w[4]) != 0\r\n ? (this.a[Number(w[4])] ||\r\n this.b[w[4][0]] + \" \" + this.a[w[4][1]]) + \"Hundred \"\r\n : \"\";\r\n str +=\r\n parseInt(w[5]) != 0\r\n ? (this.a[Number(w[5])] ||\r\n this.b[w[5][0]] + \" \" + this.a[w[5][1]]) + \" Rupees Only \"\r\n : (this.a[Number(w[5])] ||\r\n this.b[w[5][0]] + \" \" + this.a[w[5][1]]) + \" Rupees Only \";\r\n return str;\r\n }\r\n }\r\n }\r\n\r\n setDefaultValueInTransaction() {\r\n if (this.TrnMainObj.MWAREHOUSE == null || this.TrnMainObj.MWAREHOUSE == \"\") { this.TrnMainObj.MWAREHOUSE = this.userProfile.userWarehouse; }\r\n\r\n this.TrnMainObj.BRANCH = this.userProfile.userBranch;\r\n this.TrnMainObj.DIVISION = this.userProfile.userDivision;\r\n\r\n\r\n\r\n if (this.TrnMainObj.AdditionalObj.RETURNTYPE != 'DamageSalesReturnApproved') {\r\n this.TrnMainObj.ProdList.forEach(prod => {\r\n prod.WAREHOUSE = this.TrnMainObj.MWAREHOUSE;\r\n prod.BRANCH = this.TrnMainObj.BRANCH;\r\n // prod.Supplier=this.TrnMainObj.PARAC;\r\n });\r\n }\r\n\r\n\r\n if (this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSettlement) {\r\n var settlementmode = this.settlementList.filter(\r\n x => x.DESCRIPTION == this.TrnMainObj.TRNMODE\r\n )[0];\r\n if (settlementmode == null) {\r\n this.alertService.warning(\"Settlement Mode not found.\");\r\n return false;\r\n }\r\n for (let i of this.TrnMainObj.ProdList) {\r\n if (settlementmode.DECREASE == 0) {\r\n i.REALQTY_IN = i.Quantity;\r\n i.ALTQTY_IN = i.Quantity;\r\n i.RealQty = 0;\r\n i.AltQty = 0;\r\n } else if (settlementmode.DECREASE == 1) {\r\n i.REALQTY_IN = 0;\r\n i.ALTQTY_IN = 0;\r\n i.RealQty = i.Quantity;\r\n i.AltQty = i.Quantity;\r\n }\r\n }\r\n var StockVAlidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.STOCK && x.STOCK > 0)[0];\r\n if (StockVAlidateItem != null) {\r\n\r\n this.alertService.error(\"Inserted Quantity is greater than its Stock on item :\" + StockVAlidateItem.ITEMDESC);\r\n return false;\r\n }\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.BranchTransferIn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.BranchTransferOut\r\n ) {\r\n this.TrnMainObj.BILLTO = this.TrnMainObj.DIVISION;\r\n }\r\n return true;\r\n }\r\n checkTransactionValidation() {\r\n // debugger;\r\n\r\n let validate_itemdesc = this.TrnMainObj.ProdList.filter(x => x.MCODE!=null && (x.ITEMDESC == \"\" || x.ITEMDESC == null || x.ITEMDESC === undefined))[0];\r\n\r\n if (validate_itemdesc != null && validate_itemdesc !== undefined) {\r\n this.alertService.info(`Empty item description detected on item code ${validate_itemdesc.MCODE}`);\r\n return false;\r\n }\r\n\r\n let validateQty = this.TrnMainObj.ProdList.filter(x => this.nullToZeroConverter(x.ALTERNATEQUANTIY) == 0 && this.nullToZeroConverter(x.BASEQUANTITY) == 0)[0];\r\n\r\n\r\n if (validateQty != null && validateQty !== undefined) {\r\n\r\n alert(`invalid Quantity detected on item ${validateQty.ITEMDESC}`)\r\n return false;\r\n }\r\n if (this.TrnMainObj.Mode == \"VIEW\" &&\r\n this.TrnMainObj.VoucherType != VoucherTypeEnum.TaxInvoiceCancel\r\n ) {\r\n alert(\"Can Not save View Voucher\");\r\n return false;\r\n }\r\n\r\n \r\n let value = this.arouter.snapshot.url;\r\n if(value.length >0){\r\n if (this.arouter.snapshot.url[0].path == 'add-debitnote-itembase') {\r\n\r\n var StockVAlidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.STOCK && x.STOCK > 0)[0];\r\n var PIStockVAlidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.PISTOCK && x.PISTOCK > 0)[0];\r\n var _StockValidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.STOCK && (x.STOCK > 0 || x.STOCK == 0 || x.STOCK < 0));\r\n if (StockVAlidateItem != null) {\r\n this.alertService.error(\"Inserted Quantity is greater than its Stock on item :\" + StockVAlidateItem.ITEMDESC);\r\n return false;\r\n }\r\n if (_StockValidateItem && _StockValidateItem.length > 0 ) {\r\n this.alertService.error(\"Inserted Quantity is greater than its Stock on item :\" + _StockValidateItem[0].ITEMDESC);\r\n return false;\r\n }\r\n \r\n if (PIStockVAlidateItem != null && PIStockVAlidateItem) {\r\n this.alertService.error(\"Inserted Quantity is greater than Purchase Stock on item :\" + PIStockVAlidateItem.ITEMDESC);\r\n return false;\r\n }\r\n }\r\n\r\n }\r\n\r\n \r\n \r\n \r\n\r\n \r\n\r\n\r\n\r\n if(this.pageHeading == \"Self Bill\") {\r\n // this.TrnMainObj.TRNAC = this.userProfile.CompanyInfo.COMPANYID;\r\n // this.TrnMainObj.PARAC = this.userProfile.CompanyInfo.COMPANYID;\r\n this.masterService.getOwnCustomerIDForSelfBill(this.userProfile.CompanyInfo.NAME).subscribe(x => {\r\n \r\n if(x.result == '' || x.result == null || x.result.length == 0){\r\n this.alertService.info(\"Please entry company name as customer name.\");\r\n }else{\r\n this.TrnMainObj.PARAC = this.TrnMainObj.TRNAC = x.result && x.result.length > 0 && x.result[0].ACID ? x.result[0].ACID : this.userProfile.CompanyInfo.COMPANYID;\r\n }\r\n });\r\n\r\n }\r\n if ((this.TrnMainObj.VoucherType == VoucherTypeEnum.StockIssue ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSample\r\n )\r\n && this.arouter.snapshot.url[0].path != 'add-stock-issue-approval') {\r\n if (\r\n this.TrnMainObj.BILLTO == null ||\r\n this.TrnMainObj.BILLTO == undefined ||\r\n this.TrnMainObj.BILLTO == \"\"\r\n ) {\r\n alert(\"Warehouse From field is not detected.\");\r\n return false;\r\n }\r\n if (\r\n this.TrnMainObj.BILLTOADD == null ||\r\n this.TrnMainObj.BILLTOADD == undefined ||\r\n this.TrnMainObj.BILLTOADD == \"\"\r\n ) {\r\n alert(\"Warehouse To field is not detected.\");\r\n return false;\r\n }\r\n if (this.TrnMainObj.BILLTOADD == this.TrnMainObj.BILLTO) {\r\n alert(\"You cannot transfer to same Warehouse\");\r\n return false;\r\n }\r\n if (this.TrnMainObj.AdditionalObj.INVOICETYPE == 'Opening') {\r\n var OPStockVAlidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.OPSTOCK)[0];\r\n\r\n if (OPStockVAlidateItem != null) {\r\n this.alertService.error(\"Inserted Quantity is greater than Opening Invoice Stock on item :\" + OPStockVAlidateItem.ITEMDESC);\r\n return false;\r\n }\r\n } else {\r\n var PIStockVAlidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.PISTOCK && x.PISTOCK > 0)[0];\r\n if (PIStockVAlidateItem != null) {\r\n this.alertService.error(\"Inserted Quantity is greater than Purchase Ivoice Stock on item :\" + PIStockVAlidateItem.ITEMDESC);\r\n return false;\r\n }\r\n\r\n }\r\n\r\n if(this.stocktransferBillType != 'SalesReturn'){\r\n\r\n var StockVAlidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.STOCK && x.STOCK >= 0)[0];\r\n var checkStock = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.STOCK)[0];\r\n if (StockVAlidateItem != null) {\r\n this.alertService.error(\"Inserted Quantity is greater than its Stock on item :\" + StockVAlidateItem.ITEMDESC);\r\n return false;\r\n }\r\n if (checkStock != null) {\r\n this.alertService.error(\"Inserted Quantity is greater than its Stock on item :\" + checkStock.ITEMDESC);\r\n return false;\r\n }\r\n \r\n }\r\n\r\n \r\n\r\n\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Sales ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoice\r\n ) {\r\n \r\n if (this.TrnMainObj.TRNAC == null || this.TrnMainObj.TRNAC == \"\") {\r\n alert(\"Please select Transaction account\");\r\n return false;\r\n }\r\n\r\n // let schemeAmount = this.TrnMainObj.ProdList.filter(x => x.SecondaryDiscount == 0)[0];\r\n // if(schemeAmount !=null){\r\n // if(this.availableSchemes.length>0){ \r\n // let availableSchemeAmout = this.availableSchemes.filter(x => x.discountamount >0); \r\n // if(availableSchemeAmout !=null){\r\n // this.alertService.info(\"Scheme amount is availabe please select scheme button\");\r\n // return false;\r\n // }\r\n // }\r\n // } \r\n\r\n\r\n if (this.schemeApplyClick == false) {\r\n if (this.schemePresentCheck != false) {\r\n if (confirm(\"Do you want to save without applying Scheme?\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n }\r\n }\r\n\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.OpeningStockBalance ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoice ||\r\n ( this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote && this.TrnMainObj.AdditionalObj.INVOICETYPE == 'NewBill'\r\n || this.TrnMainObj.VoucherType == VoucherTypeEnum.DebitNote)\r\n ) {\r\n if (\r\n this.TrnMainObj.ProdList.some(x => x.EXPDATE == null && x.MCODE != null)\r\n ) {\r\n this.alertService.warning(\r\n \"Expiry Date of Item Not Detected..Please Review the list...\"\r\n );\r\n return false;\r\n }\r\n\r\n if(this.TrnMainObj.AdditionalObj.WAREHOUSETYPE==\"nonsellable\" && this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote && this.TrnMainObj.AdditionalObj.INVOICETYPE == 'NewBill'){\r\n console.log(\"_2 No expiry date validation for unsaleable!\")\r\n }else{\r\n let expitem = this.TrnMainObj.ProdList.filter(x => new Date(x.EXPDATE) < new Date(new Date().setDate(new Date().getDate() - 1)) && x.MCODE != null)[0];\r\n if (expitem != null) {\r\n if(this.pageHeading != \"Self Bill\") {\r\n this.alertService.warning(\r\n \"Expired Item Detected with code : \" + expitem.MCODE + \"..Please Review the list...\"\r\n );\r\n return false;\r\n }\r\n \r\n }\r\n }\r\n \r\n if (\r\n this.TrnMainObj.ProdList.some(\r\n x => new Date(x.MFGDATE) > new Date() && x.MCODE != null\r\n )\r\n ) {\r\n this.alertService.warning(\r\n \"Invalid Manufacture Date Item Detected..Please Review the list...\"\r\n );\r\n return false;\r\n }\r\n // alert(\"reached\")\r\n if (\r\n this.TrnMainObj.ProdList.some(\r\n x => x.MCODE != null && this.nullToZeroConverter(x.Quantity) < 1\r\n )\r\n ) {\r\n this.alertService.warning(\r\n \"Invalid Entry With Invalid Quantity Detected.Please Check the Item Entry. \"\r\n );\r\n return false;\r\n }\r\n \r\n var StockVAlidateItem = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.STOCK && x.STOCK > 0)[0];\r\n \r\n if (StockVAlidateItem != null && StockVAlidateItem !== undefined) {\r\n this.alertService.error(\"Inserted Quantity is greater than its Stock on item :\" + StockVAlidateItem.ITEMDESC);\r\n return false;\r\n }\r\n var checkStock = this.TrnMainObj.ProdList.filter(x => x.RealQty > x.STOCK)[0];\r\n \r\n if (this.TrnMainObj.VoucherType === VoucherTypeEnum.TaxInvoice && this.TrnMainObj.MWAREHOUSE == 'Proforma Warehouse') {}\r\n else {\r\n if (checkStock != null && checkStock !== undefined) {\r\n\r\n this.alertService.error(\"Inserted Quantity is greater than its Stock on item :\" + checkStock.ITEMDESC);\r\n return;\r\n }\r\n }\r\n\r\n\r\n\r\n }\r\n return true;\r\n }\r\n\r\n initialFormLoad(voucherType) {\r\n\r\n var phiscal_ID=this.TrnMainObj.PhiscalID;\r\n this.TrnMainObj = {};\r\n this.showPerformaApproveReject = false;\r\n // alert(\"reached\")\r\n this.TrnMainObj.AdditionalObj = {};\r\n this.TrnMainObj.TransporterEway = {};\r\n // this.TrnMainObj.TrntranList = [];\r\n const uuidV1 = require('uuid/v1');\r\n this.TrnMainObj.guid = uuidV1();\r\n this.TrnMainObj.Mode = \"NEW\";\r\n this.masterService.headerMode = \"(NEW)\"\r\n this.TrnMainObj.DIVISION = this.userProfile.userDivision;\r\n this.TrnMainObj.MWAREHOUSE = this.userProfile.userWarehouse;\r\n this.TrnMainObj.PhiscalID = this.userProfile.CompanyInfo.PhiscalID;\r\n\r\n switch (voucherType) {\r\n case VoucherTypeEnum.PurchaseOrder:\r\n this.TrnMainObj.VoucherPrefix = \"PO\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.PurchaseOrder;\r\n this.pageHeading = \"Purchase Order\";\r\n break;\r\n case VoucherTypeEnum.Purchase:\r\n this.TrnMainObj.VoucherPrefix = \"PI\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.Purchase;\r\n this.pageHeading = \"Purchase Invoice\";\r\n break;\r\n // case VoucherTypeEnum.DebitNote:\r\n // this.TrnMainObj.VoucherPrefix = \"DN\";\r\n // this.TrnMainObj.VoucherType = VoucherTypeEnum.DebitNote;\r\n // this.pageHeading = \"Debit Note\";\r\n // break;\r\n // case VoucherTypeEnum.DebitNote:\r\n // this.TrnMainObj.VoucherPrefix = \"DN\";\r\n // this.TrnMainObj.VoucherType = VoucherTypeEnum.DebitNote;\r\n // this.pageHeading = \"Debit Note\";\r\n // break;\r\n case VoucherTypeEnum.SalesOrder:\r\n this.TrnMainObj.VoucherPrefix = \"SO\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.SalesOrder;\r\n this.voucherNoHeader = \"SO No\";\r\n this.pageHeading = \"Sales Order\";\r\n break;\r\n case VoucherTypeEnum.Sales:\r\n this.TrnMainObj.VoucherPrefix = \"SI\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.Sales;\r\n this.pageHeading = \"Sales Invoice\";\r\n break;\r\n case VoucherTypeEnum.TaxInvoice:\r\n this.TrnMainObj.VoucherPrefix = \"TI\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.TaxInvoice;\r\n\r\n // if(this.arouter.snapshot[0].path == 'addsientry'){\r\n this.pageHeading = \"Tax Invoice\";\r\n // }\r\n // else if(this.arouter.snapshot.url[0].path == 'shelfbill'){\r\n // this.pageHeading = \"Shelf Bill\"\r\n // }\r\n // alert(\"reached\")\r\n this.isSelfBill = false;\r\n this.TrnMainObj.isSelfBill = false;\r\n if (this.userProfile.CompanyInfo.ORG_TYPE == 'retailer' ||\r\n this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ak\" ||\r\n this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ck\" ||\r\n this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"pms\") {\r\n this.masterService.getCurrentDate().subscribe(\r\n date => {\r\n this.TrnMainObj.DeliveryDate = date.Date.substring(0, 10);\r\n },\r\n error => {\r\n this.masterService.resolveError(\r\n error,\r\n \"voucher-date - getCurrentDate\"\r\n );\r\n }\r\n );\r\n }\r\n break;\r\n // case VoucherTypeEnum.CreditNote:\r\n // this.TrnMainObj.VoucherPrefix = \"CN\";\r\n // this.TrnMainObj.VoucherType = VoucherTypeEnum.CreditNote;\r\n // this.pageHeading = \"Credit Note\";\r\n // break;\r\n\r\n case VoucherTypeEnum.SelfBill:\r\n \r\n this.TrnMainObj.VoucherPrefix = \"TI\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.TaxInvoice;\r\n this.isSelfBill = true;\r\n this.TrnMainObj.isSelfBill = true;\r\n this.pageHeading = \"Self Bill\";\r\n \r\n \r\n this.TrnMainObj.BILLTO = this.userProfile.CompanyInfo.NAME;\r\n this.TrnMainObj.BILLTOADD = this.userProfile.CompanyInfo.ADDRESS;\r\n this.TrnMainObj.BILLTOTEL = this.userProfile.CompanyInfo.VAT;\r\n this.masterService.getOwnCustomerIDForSelfBill(this.userProfile.CompanyInfo.NAME).subscribe(x => {\r\n\r\n if(x.result == '' || x.result == null || x.result.length == 0){\r\n this.alertService.info(\"Please entry company name as customer name.\");\r\n }else{\r\n this.TrnMainObj.PARAC = this.TrnMainObj.TRNAC = x.result && x.result.length > 0 && x.result[0].ACID ? x.result[0].ACID : this.userProfile.CompanyInfo.COMPANYID;\r\n }\r\n });\r\n if (this.userProfile.CompanyInfo.ORG_TYPE == 'retailer' ||\r\n this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ak\" ||\r\n this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"ck\" ||\r\n this.userProfile.CompanyInfo.ORG_TYPE.toLowerCase() == \"pms\") {\r\n this.masterService.getCurrentDate().subscribe(\r\n date => {\r\n this.TrnMainObj.DeliveryDate = date.Date.substring(0, 10);\r\n },\r\n error => {\r\n this.masterService.resolveError(\r\n error,\r\n \"voucher-date - getCurrentDate\"\r\n );\r\n }\r\n );\r\n }\r\n break;\r\n case VoucherTypeEnum.StockIssue:\r\n this.TrnMainObj.VoucherPrefix = \"IS\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.StockIssue;\r\n if (this.arouter.snapshot.url[0].path == 'add-stock-issue-approval') {\r\n this.pageHeading = 'Stock Transfer Approval';\r\n } else {\r\n this.pageHeading = \"Stock Transfer\";\r\n }\r\n break;\r\n case VoucherTypeEnum.StockSettlement:\r\n this.TrnMainObj.VoucherPrefix = \"DM\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.StockSettlement;\r\n this.pageHeading = \"Stock Settlement\";\r\n break;\r\n\r\n case VoucherTypeEnum.OpeningStockBalance:\r\n this.TrnMainObj.VoucherPrefix = \"OP\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.OpeningStockBalance;\r\n this.pageHeading = \"Opening Stock Entry\";\r\n break;\r\n case VoucherTypeEnum.BranchTransferIn:\r\n this.TrnMainObj.VoucherPrefix = \"TR\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.BranchTransferIn;\r\n this.pageHeading = \"Branch Transfer In\";\r\n break;\r\n case VoucherTypeEnum.StockSettlement:\r\n this.TrnMainObj.VoucherPrefix = \"TO\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.BranchTransferOut;\r\n this.pageHeading = \"Branch Transfer Out\";\r\n break;\r\n case VoucherTypeEnum.PerformaSalesInvoice:\r\n this.TrnMainObj.VoucherPrefix = \"PP\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.PerformaSalesInvoice;\r\n this.pageHeading = \"Proforma Invoice\";\r\n break;\r\n case VoucherTypeEnum.PurchaseOrderCancel:\r\n this.TrnMainObj.VoucherPrefix = \"PC\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.PurchaseOrderCancel;\r\n this.pageHeading = \"PO Cancel\";\r\n break;\r\n\r\n //for account vouchers\r\n case VoucherTypeEnum.Journal:\r\n this.TrnMainObj.VoucherPrefix = \"JV\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.Journal;\r\n this.TrnMainObj.TrntranList = [];\r\n this.pageHeading = \"Journal Voucher\";\r\n this.TableAcHeader = \"Acount (A/C)\";\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n case VoucherTypeEnum.PaymentVoucher:\r\n this.TrnMainObj.VoucherPrefix = \"PV\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.PaymentVoucher;\r\n this.TrnMainObj.TrntranList = [];\r\n this.pageHeading = \"Expenses Voucher \";\r\n this.TableAcHeader = \"Party/Expenses A/C\";\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n case VoucherTypeEnum.ReceiveVoucher:\r\n this.TrnMainObj.VoucherPrefix = \"RV\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.ReceiveVoucher;\r\n this.pageHeading = \"Income Voucher\";\r\n this.TrnMainObj.TrntranList = [];\r\n this.TableAcHeader = \"Party/Income A/C\";\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n case VoucherTypeEnum.DebitNote:\r\n this.TrnMainObj.VoucherPrefix = \"DN\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.DebitNote;\r\n this.TrnMainObj.VoucherAbbName = 'DN'\r\n if (this.arouter.snapshot.url[0].path == 'add-debitnote-itembase') {\r\n this.pageHeading = \"Purchase Return\";\r\n this.masterService.focusAnyControl(\"supplierid\")\r\n } else if (this.arouter.snapshot.url[0].path == 'add-debitnote-itembase-approval') {\r\n this.pageHeading = \"Purchase Return(Approved)\";\r\n } else {\r\n this.pageHeading = \"Debit Note\";\r\n }\r\n this.TrnMainObj.TrntranList = [];\r\n this.addRowForTransaction(-1);\r\n \r\n break;\r\n\r\n case VoucherTypeEnum.CreditNote:\r\n this.TrnMainObj.VoucherPrefix = \"CN\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.CreditNote;\r\n if (this.arouter.snapshot.url[0].path == 'add-creditnote-itembase') {\r\n this.pageHeading = \"Sales Return\";\r\n } else {\r\n this.pageHeading = \"Credit Note\";\r\n }\r\n this.voucherNoHeader = \"Return No\";\r\n this.TrnMainObj.TrntranList = [];\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n case VoucherTypeEnum.CreditNoteApproval:\r\n this.TrnMainObj.VoucherPrefix = \"CA\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.CreditNoteApproval;\r\n this.TrnMainObj.VoucherAbbName = \"CA\";\r\n this.pageHeading = \"Sales Return Approval\";\r\n this.voucherNoHeader = \"Return No\";\r\n this.TrnMainObj.TrntranList = [];\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n case VoucherTypeEnum.ContraVoucher:\r\n this.TrnMainObj.VoucherPrefix = \"CE\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.ContraVoucher;\r\n this.pageHeading = \"Contra Voucher\";\r\n this.TrnMainObj.TrntranList = [];\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n //configuration\r\n case VoucherTypeEnum.AccountOpeningBalance:\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.AccountOpeningBalance;\r\n this.pageHeading = \"Account Opening Balance\";\r\n this.TrnMainObj.TrntranList = [];\r\n this.TrnMainObj.VoucherPrefix = \"OB\";\r\n this.TrnMainObj.VoucherAbbName = \"OB\";\r\n this.TrnMainObj.VoucherName = \"OBBILL\";\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n case VoucherTypeEnum.PartyOpeningBalance:\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.PartyOpeningBalance;\r\n this.pageHeading = \"Party Opening Balance\";\r\n this.TrnMainObj.TrntranList = [];\r\n this.TrnMainObj.VoucherPrefix = \"AO\";\r\n this.TrnMainObj.VoucherAbbName = \"AO\";\r\n this.TrnMainObj.VoucherName = \"OPPARTYBILL\";\r\n this.addRowForTransaction(-1);\r\n break;\r\n\r\n case VoucherTypeEnum.LoadSheet:\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.LoadSheet;\r\n this.pageHeading = \"Load Sheet\";\r\n this.TrnMainObj.VoucherPrefix = \"LS\";\r\n this.TrnMainObj.VoucherAbbName = \"LS\";\r\n break;\r\n\r\n case VoucherTypeEnum.TaxInvoiceCancel:\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.TaxInvoiceCancel;\r\n this.pageHeading = \"Bill Cancel\";\r\n this.TrnMainObj.VoucherPrefix = \"SC\";\r\n this.TrnMainObj.VoucherAbbName = \"SC\";\r\n break;\r\n case VoucherTypeEnum.ReverseSalesRetrun:\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.ReverseSalesRetrun;\r\n this.pageHeading = \"Reverse Sales Return\";\r\n this.TrnMainObj.VoucherPrefix = \"RR\";\r\n this.TrnMainObj.VoucherAbbName = \"RR\";\r\n break;\r\n case VoucherTypeEnum.BatchTransfer:\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.BatchTransfer;\r\n this.pageHeading = \"Batch Transfer\";\r\n this.TrnMainObj.VoucherPrefix = \"BT\";\r\n this.TrnMainObj.VoucherAbbName = \"BT\";\r\n break;\r\n case VoucherTypeEnum.AdditionalCost:\r\n this.TrnMainObj.VoucherPrefix = \"AD\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.AdditionalCost;\r\n this.pageHeading = \"Additional Cost\";\r\n this.TrnMainObj.PhiscalID=this.AD_PHISCALID?this.AD_PHISCALID:phiscal_ID;\r\n break;\r\n }\r\n\r\n this.getVoucherNumber();\r\n\r\n this.getCurrentDate();\r\n\r\n if (this.TrnMainObj.VoucherType == 14) {\r\n this.masterService.getCurrentDate().subscribe(\r\n date => {\r\n // this.TrnMainObj.AdditionalObj.DUEDATE = date.Date.substring(0, 10);\r\n this.TrnMainObj.AdditionalObj.DUEDATE = date.Date.split(\"T\")[0];\r\n },\r\n error => {\r\n }\r\n );\r\n }\r\n\r\n if (this.TrnMainObj.VoucherType == 65 ) {\r\n this.loadBillUnits();\r\n }\r\n\r\n if (this.TrnMainObj.VoucherType == 65 || this.TrnMainObj.VoucherType == 61) {\r\n this.loadBillUnitsandFormat();\r\n }\r\n\r\n if(this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoice ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.DebitNote ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PerformaSalesInvoice\r\n ){\r\n this.loadVoucherWiseBillUnitsBillFormats(this.TrnMainObj.VoucherPrefix);\r\n this.masterService.focusAnyControl(\"supplierid\")\r\n }\r\n\r\n if (this.TrnMainObj.VoucherType == 14 || this.TrnMainObj.VoucherType == 15 || this.TrnMainObj.VoucherType == 57) {\r\n if (this.userProfile.CompanyInfo.ORG_TYPE == 'retailer') {\r\n this.TrnMainObj.INVOICETYPE = 'retailinvoice';\r\n }\r\n else {\r\n this.TrnMainObj.INVOICETYPE = 'taxinvoice';\r\n }\r\n }\r\n\r\n if (this.TrnMainObj.VoucherType == 58)\r\n return;\r\n\r\n this.addRow();\r\n }\r\n\r\n getVoucherNumber() {\r\n if(this.arouter.snapshot.url && this.arouter.snapshot.url[0] && this.arouter.snapshot.url[0].path == 'add-stock-issue'){ \r\n this.TrnMainObj.VoucherPrefix = \"SS\";\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.StockSample;\r\n }\r\n\r\n this.masterService.getVoucherNo(this.TrnMainObj).subscribe(res => {\r\n\r\n if (res.status == \"ok\") {\r\n let TMain = res.result;\r\n this.TrnMainObj.VCHRNO = TMain.VCHRNO;\r\n this.TrnMainObj.CHALANNO = TMain.CHALANNO;\r\n this.TrnMainObj.PhiscalID = TMain.PhiscalID;\r\n this.TrnMainObj.PARAC = TMain.PARAC;\r\n //this.TrnMainObj.MWAREHOUSE = 'Proforma Warehouse';\r\n //this.TrnMainObj.ProdList.forEach(x=>x.WAREHOUSE = 'Proforma Warehouse')\r\n } else {\r\n alert(\"Failed to retrieve VoucherNo\");\r\n }\r\n });\r\n }\r\n\r\n getVoucherNoForPerforma() {\r\n this.masterService.getVoucherNo(this.TrnMainObj).subscribe(res => {\r\n\r\n if (res.status == \"ok\") {\r\n let TMain = res.result;\r\n this.TrnMainObj.VCHRNO = TMain.VCHRNO;\r\n this.TrnMainObj.CHALANNO = TMain.CHALANNO;\r\n this.TrnMainObj.PhiscalID = TMain.PhiscalID;\r\n this.TrnMainObj.PARAC = TMain.PARAC;\r\n this.TrnMainObj.MWAREHOUSE = 'Proforma Warehouse';\r\n this.TrnMainObj.ProdList.forEach(x => x.WAREHOUSE = 'Proforma Warehouse')\r\n } else {\r\n alert(\"Failed to retrieve VoucherNo\");\r\n }\r\n });\r\n }\r\n\r\n\r\n\r\n getVoucherNumberForTaxCancel() {\r\n this.masterService.getVoucherNo(this.TrnMainObj).subscribe(res => {\r\n if (res.status == \"ok\") {\r\n let TMain = res.result;\r\n this.TrnMainObj.CHALANNO = TMain.CHALANNO;\r\n this.TrnMainObj.PhiscalID = TMain.PhiscalID;\r\n this.TrnMainObj.PARAC = TMain.PARAC;\r\n } else {\r\n alert(\"Failed to retrieve VoucherNo\");\r\n }\r\n });\r\n }\r\n\r\n getCurrentDate() {\r\n this.masterService.getCurrentDate().subscribe(\r\n date => {\r\n if (this.TrnMainObj.VoucherType==VoucherTypeEnum.Purchase && this.masterService.disableQuantityEdit == true) {\r\n this.TrnMainObj.TRN_DATE = date.Date.substring(0, 10);\r\n this.TrnMainObj.BS_DATE = this.getBsDate(this.TrnMainObj.TRN_DATE);\r\n\r\n }\r\n else{\r\n this.masterService.getCurrentTimeUtc().subscribe(\r\n (data) => {\r\n this.TrnMainObj.TRNDATE = data.dateTime.substring(0, 10);; // Accessing the datetime from the response\r\n this.TrnMainObj.BSDATE = this.getBsDate(this.TrnMainObj.TRNDATE);\r\n this.TrnMainObj.TRN_DATE = data.dateTime.substring(0, 10);; // Accessing the datetime from the response\r\n this.TrnMainObj.BS_DATE = this.getBsDate(this.TrnMainObj.TRN_DATE);\r\n },\r\n )\r\n }\r\n // else{\r\n\r\n // this.TrnMainObj.TRNDATE = date.Date.substring(0, 10);\r\n // this.TrnMainObj.TRN_DATE = date.Date.substring(0, 10);\r\n // this.TrnMainObj.BSDATE = this.getBsDate(this.TrnMainObj.TRNDATE)\r\n // this.TrnMainObj.BS_DATE = this.getBsDate(this.TrnMainObj.TRN_DATE)\r\n // console.log( this.TrnMainObj.TRNDATE)\r\n // }\r\n\r\n },\r\n error => {\r\n this.masterService.resolveError(error, \"voucher-date - getCurrentDate\");\r\n }\r\n );\r\n \r\n }\r\n\r\n getBsDate(date) {\r\n var adbs = require(\"ad-bs-converter\");\r\n var adDate = (date.replace(\"-\", \"/\")).replace(\"-\", \"/\");\r\n var bsDate = adbs.ad2bs(adDate);\r\n return (bsDate.en.year + '-' + (bsDate.en.month == '1' || bsDate.en.month == '2' || bsDate.en.month == '3' || bsDate.en.month == '4' || bsDate.en.month == '5' || bsDate.en.month == '6' || bsDate.en.month == '7' || bsDate.en.month == '8' || bsDate.en.month == '9' ? '0' + bsDate.en.month : bsDate.en.month) + '-' + (bsDate.en.day == '1' || bsDate.en.day == '2' || bsDate.en.day == '3' || bsDate.en.day == '4' || bsDate.en.day == '5' || bsDate.en.day == '6' || bsDate.en.day == '7' || bsDate.en.day == '8' || bsDate.en.day == '9' ? '0' + bsDate.en.day : bsDate.en.day));\r\n }\r\n\r\n loadBillUnitsandFormat() {\r\n this.masterService.loadCompany().subscribe((res) => {\r\n this.TrnMainObj.AdditionalObj.BILLUNITS = res.BILLUNITS\r\n this.TrnMainObj.AdditionalObj.BILLFORMATS = res.BILLFORMATS\r\n })\r\n }\r\n\r\n loadBillUnits() {\r\n this.masterService.loadCompany().subscribe((res) => {\r\n this.TrnMainObj.AdditionalObj.BILLUNITS = res.BILLUNITS\r\n })\r\n }\r\n\r\n loadVoucherWiseBillUnitsBillFormats(VoucherPrefix){\r\n if (this.inputCode != true) {\r\n this.masterService.loadVoucherWiseBillUnitsBillFormats(VoucherPrefix).subscribe((res) => {\r\n if(!res.result.BILLUNITS){\r\n this.TrnMainObj.AdditionalObj.BILLUNITS='EACH';\r\n }else{\r\n this.TrnMainObj.AdditionalObj.BILLUNITS = res.result.BILLUNITS;\r\n }\r\n if(!res.result.BILLFORMATS){\r\n if(this.userProfile.CompanyInfo.ORG_TYPE == 'superdistributor'){\r\n this.TrnMainObj.AdditionalObj.BILLFORMATS='FULL';\r\n }else if(this.userProfile.CompanyInfo.ORG_TYPE == 'distributor'){\r\n this.TrnMainObj.AdditionalObj.BILLFORMATS='HALF';\r\n }\r\n }else{\r\n this.TrnMainObj.AdditionalObj.BILLFORMATS = res.result.BILLFORMATS;\r\n }\r\n })\r\n }\r\n }\r\n\r\n loadVoucherWiseBillUnitsBillFormatsAtReset(VoucherPrefix){\r\n this.masterService.loadVoucherWiseBillUnitsBillFormats(VoucherPrefix).subscribe((res) => {\r\n if(!res.result.BILLUNITS){\r\n this.TrnMainObj.AdditionalObj.BILLUNITS='EACH';\r\n }else{\r\n this.TrnMainObj.AdditionalObj.BILLUNITS = res.result.BILLUNITS;\r\n }\r\n if(!res.result.BILLFORMATS){\r\n if(this.userProfile.CompanyInfo.ORG_TYPE == 'superdistributor'){\r\n this.TrnMainObj.AdditionalObj.BILLFORMATS='FULL';\r\n }else if(this.userProfile.CompanyInfo.ORG_TYPE == 'distributor'){\r\n this.TrnMainObj.AdditionalObj.BILLFORMATS='HALF';\r\n }\r\n }else{\r\n this.TrnMainObj.AdditionalObj.BILLFORMATS = res.result.BILLFORMATS;\r\n }\r\n })\r\n }\r\n\r\n updateVoucherWiseBillUnitsBillFormats(BillUnits,BillFormats,VoucherPrefix){\r\n this.masterService.updateVoucherWiseBillUnitsBillFormats(BillUnits,BillFormats,VoucherPrefix).subscribe((res)=>{\r\n })\r\n }\r\n\r\n addRow() {\r\n try {\r\n if (this.TrnMainObj.ProdList == null) {\r\n this.TrnMainObj.ProdList = [];\r\n }\r\n //Duplicate Item with same batch check\r\n // let duplicatecheck = 0;\r\n // if (this.TrnMainObj.ProdList == null) {\r\n // this.TrnMainObj.ProdList = [];\r\n // }\r\n // this.TrnMainObj.ProdList.reduce((aac, obj) => {\r\n // var existitem = aac.find(\r\n // item => item.MCODE === obj.MCODE && item.BATCH === obj.BATCH\r\n // );\r\n // if (existitem && this.TrnMainObj.VoucherType != VoucherTypeEnum.SalesOrder) {\r\n // alert(\"Duplicate Item with same batch detected...\");\r\n // duplicatecheck = 1;\r\n // return;\r\n // }\r\n // aac.push(obj);\r\n // return aac;\r\n // }, []);\r\n // if (duplicatecheck == 1) {\r\n // return false;\r\n // }\r\n\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.OpeningStockBalance ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoice || this.TrnMainObj.VoucherType == VoucherTypeEnum.DebitNote||\r\n ( this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote && this.TrnMainObj.AdditionalObj.INVOICETYPE == 'NewBill')\r\n ) {\r\n if (\r\n this.TrnMainObj.ProdList.some(\r\n x => x.EXPDATE == null && x.MCODE != null\r\n )\r\n ) {\r\n this.alertService.warning(\r\n \"Expiry Date of Item Not Detected..Please Review the list...\"\r\n );\r\n return false;\r\n }\r\n\r\n if(this.TrnMainObj.AdditionalObj.WAREHOUSETYPE==\"nonsellable\" && this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote && this.TrnMainObj.AdditionalObj.INVOICETYPE == 'NewBill'){\r\n console.log(\"_1 No expiry date validation for unsaleable!\")\r\n }else{\r\n let expitem = this.TrnMainObj.ProdList.filter(x => new Date(x.EXPDATE) < new Date(new Date().setDate(new Date().getDate() - 1)) && x.MCODE != null)[0];\r\n if (expitem != null) {\r\n if(this.pageHeading != \"Self Bill\") {\r\n this.alertService.warning(\r\n \"Expired Item Detected with code : \" + expitem.MCODE + \"..Please Review the list...\"\r\n );\r\n return false;\r\n }\r\n \r\n }\r\n }\r\n\r\n\r\n\r\n // if (\r\n // this.TrnMainObj.ProdList.some(\r\n\r\n // x => new Date(x.MFGDATE) > new Date() && x.MCODE != null\r\n\r\n // )\r\n // ) {\r\n // this.alertService.warning(\r\n // \"Invalid Manufacture Date Item with Detected..Please Review the list...\"\r\n // );\r\n // return false;\r\n // }\r\n if (\r\n this.TrnMainObj.ProdList.some(\r\n x => x.MCODE != null && this.nullToZeroConverter(x.Quantity) < 1\r\n )\r\n ) {\r\n this.alertService.warning(\r\n \"Invalid Entry With Invalid Quantity Detected.Please Check the Item Entry. \"\r\n );\r\n return false;\r\n }\r\n }\r\nthis.validateFlatDiscount();\r\n // this.TrnMainObj.ProdList.forEach(x => x.inputMode = false);\r\n var newRow = {};\r\n newRow.inputMode = true;\r\n newRow.MENUCODE = null;\r\n newRow.ITEMDESC = null;\r\n newRow.RATE = null;\r\n newRow.RATE = null;\r\n newRow.NCRATE = null;\r\n newRow.AMOUNT = null;\r\n newRow.DISCOUNT = null;\r\n newRow.VAT = null;\r\n newRow.NETAMOUNT = null;\r\n newRow.ITEMTYPE = null;\r\n newRow.RECEIVEDTYPE = null;\r\n newRow.WAREHOUSE = null;\r\n newRow.BC = null;\r\n \r\n this.TrnMainObj.ProdList.push(newRow);\r\n return true;\r\n } catch (ex) {\r\n //this.alertService.error(ex);\r\n return false;\r\n }\r\n }\r\nvalidateFlatDiscount(){\r\n if(this.TrnMainObj.VoucherType!=VoucherTypeEnum.CreditNote && this.TrnMainObj.VoucherType != VoucherTypeEnum.DebitNote)\r\n if(this.TrnMainObj.TOTALFLATDISCOUNT !=undefined){\r\n if( this.TrnMainObj.TOTALFLATDISCOUNT >0 ){\r\n this.TrnMainObj.DCRATE=null;\r\n this.TrnMainObj.TOTALFLATDISCOUNT=null;\r\n this.TrnMainObj.TOTALDISCOUNT=0;\r\n alert(\"Previous applied flat discount will be removed.Please apply for new flat discount!!\")\r\n }\r\n}\r\n}\r\n loadSODataToSales(VCHR) {\r\n this.masterService\r\n .masterPostmethod(\"/getSalesBillFromSO\", { REFBILL: VCHR })\r\n .subscribe(\r\n data => {\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n // this.TrnMainObj.Mode = \"VIEW\";\r\n // this.ReCalculateBill();\r\n\r\n this.trnmainBehavior.next(this.TrnMainObj);\r\n }\r\n },\r\n error => {\r\n this.trnmainBehavior.complete();\r\n },\r\n () => this.trnmainBehavior.complete()\r\n );\r\n //});\r\n }\r\n\r\n RealQuantitySet(i, CONFACTOR: number = 1) {\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.SalesReturn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.BranchTransferIn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.DeliveryReturn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.GoodsReceived ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder\r\n\r\n ) {\r\n //.CONFACTOR *\r\n this.TrnMainObj.ProdList[i].REALQTY_IN =\r\n this.nullToZeroConverter(this.TrnMainObj.ProdList[i].Quantity) * CONFACTOR;\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = this.TrnMainObj.ProdList[i].Quantity;\r\n this.TrnMainObj.ProdList[i].RealQty = 0;\r\n this.TrnMainObj.ProdList[i].AltQty = 0;\r\n this.TrnMainObj.ProdList[i].VoucherType = this.TrnMainObj.VoucherType;\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Sales ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseReturn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.DebitNote ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Delivery ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.BranchTransferOut ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoice ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockIssue ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSample ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.SalesOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PerformaSalesInvoice\r\n ) {\r\n //alert(\"DispatchOut\")\r\n //.CONFACTOR *\r\n this.TrnMainObj.ProdList[i].RealQty =\r\n this.nullToZeroConverter(this.TrnMainObj.ProdList[i].Quantity) *\r\n CONFACTOR;\r\n this.TrnMainObj.ProdList[i].AltQty = this.TrnMainObj.ProdList[i].Quantity;\r\n this.TrnMainObj.ProdList[i].REALQTY_IN = 0;\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = 0;\r\n this.TrnMainObj.ProdList[i].VoucherType = this.TrnMainObj.VoucherType;\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.OpeningStockBalance\r\n ) {\r\n if (this.TrnMainObj.ProdList[i].Quantity > 0) {\r\n //.CONFACTOR *\r\n this.TrnMainObj.ProdList[i].REALQTY_IN =\r\n this.nullToZeroConverter(this.TrnMainObj.ProdList[i].Quantity) *\r\n CONFACTOR;\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = this.TrnMainObj.ProdList[\r\n i\r\n ].Quantity;\r\n this.TrnMainObj.ProdList[i].RealQty = 0;\r\n this.TrnMainObj.ProdList[i].AltQty = 0;\r\n this.TrnMainObj.ProdList[i].VoucherType = this.TrnMainObj.VoucherType;\r\n } else if (this.TrnMainObj.ProdList[i].Quantity < 0) {\r\n // .CONFACTOR *\r\n this.TrnMainObj.ProdList[i].RealQty =\r\n -1 * this.TrnMainObj.ProdList[i].Quantity * CONFACTOR;\r\n this.TrnMainObj.ProdList[i].AltQty =\r\n -1 * this.TrnMainObj.ProdList[i].Quantity;\r\n this.TrnMainObj.ProdList[i].REALQTY_IN = 0;\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = 0;\r\n this.TrnMainObj.ProdList[i].VoucherType = this.TrnMainObj.VoucherType;\r\n }\r\n } else if (this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSettlement) {\r\n /*\r\n none of the value are 0 here\r\n later while save the value it will checks StockSettlement and then return 0 there.\r\n */\r\n //.CONFACTOR *\r\n this.TrnMainObj.ProdList[i].REALQTY_IN =\r\n this.nullToZeroConverter(this.TrnMainObj.ProdList[i].Quantity) *\r\n CONFACTOR;\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = this.TrnMainObj.ProdList[\r\n i\r\n ].Quantity;\r\n //.CONFACTOR *\r\n this.TrnMainObj.ProdList[i].RealQty =\r\n this.nullToZeroConverter(this.TrnMainObj.ProdList[i].Quantity) *\r\n CONFACTOR;\r\n this.TrnMainObj.ProdList[i].AltQty = this.TrnMainObj.ProdList[i].Quantity;\r\n this.TrnMainObj.ProdList[i].VoucherType = this.TrnMainObj.VoucherType;\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrderCancel\r\n ) {\r\n /*\r\n none of the value are 0 here\r\n later while save the value it will checks StockSettlement and then return 0 there.\r\n */\r\n //.CONFACTOR *\r\n this.TrnMainObj.ProdList[i].REALQTY_IN =\r\n this.nullToZeroConverter(this.TrnMainObj.ProdList[i].Quantity) *\r\n CONFACTOR;\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = this.TrnMainObj.ProdList[\r\n i\r\n ].Quantity;\r\n //.CONFACTOR *\r\n this.TrnMainObj.ProdList[i].RealQty =\r\n this.nullToZeroConverter(this.TrnMainObj.ProdList[i].Quantity) *\r\n CONFACTOR;\r\n this.TrnMainObj.ProdList[i].AltQty = this.TrnMainObj.ProdList[i].Quantity;\r\n this.TrnMainObj.ProdList[i].VoucherType = this.TrnMainObj.VoucherType;\r\n this.TrnMainObj.ProdList[i].REALQTY_IN = 0;\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = 0;\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoiceCancel\r\n ) {\r\n this.TrnMainObj.ProdList[i].REALQTY_IN = this.nullToZeroConverter(\r\n this.TrnMainObj.ProdList[i].RealQty\r\n );\r\n this.TrnMainObj.ProdList[i].ALTQTY_IN = this.TrnMainObj.ProdList[\r\n i\r\n ].AltQty;\r\n this.TrnMainObj.ProdList[i].VoucherType = this.TrnMainObj.VoucherType;\r\n this.TrnMainObj.ProdList[i].RealQty = 0;\r\n this.TrnMainObj.ProdList[i].AltQty = 0;\r\n } else {\r\n alert(\"Vouchertype not found please contact admin.\");\r\n }\r\n }\r\n\r\n // setunit(baseRate: number, baseRate2: number, activerowIndex, altunitObj) {\r\n // if (altunitObj == null) {\r\n // altunitObj = {};\r\n // }\r\n // this.TrnMainObj.ProdList[activerowIndex].CONFACTOR = altunitObj.CONFACTOR;\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTUNIT = altunitObj.ALTUNIT;\r\n // this.TrnMainObj.ProdList[activerowIndex].UNIT = altunitObj.BASEUOM;\r\n // this.TrnMainObj.ProdList[activerowIndex].RATE = baseRate;\r\n // this.TrnMainObj.ProdList[activerowIndex].REALRATE = baseRate;\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n // baseRate * altunitObj.CONFACTOR;\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTRATE2 =\r\n // baseRate2 * altunitObj.CONFACTOR;\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTMRP = this.TrnMainObj.ProdList[activerowIndex].MRP* altunitObj.CONFACTOR;\r\n // this.RealQuantitySet(activerowIndex, altunitObj.CONFACTOR);\r\n // }\r\n setAltunitDropDownForView(activerowIndex) {\r\n this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].ALTUNITObj = this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].Product.AlternateUnits.filter(\r\n x => x.ALTUNIT == this.TrnMainObj.ProdList[activerowIndex].ALTERNATEUNIT\r\n )[0];\r\n }\r\n\r\n setAltunitDropDownForViewStock(activerowIndex) {\r\n this.masterService.masterGetmethod(\r\n \"/getAltUnitsOfItem/\" + this.TrnMainObj.ProdList[activerowIndex].MCODE\r\n )\r\n .subscribe(res => {\r\n if (res.status = \"ok\") {\r\n this.TrnMainObj.ProdList[activerowIndex].Product.AlternateUnits = JSON.parse(res.result);\r\n\r\n }\r\n })\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].ALTUNITObj =\r\n this.TrnMainObj.ProdList[activerowIndex].Product.AlternateUnits.filter(x => x.ALTUNIT == this.TrnMainObj.ProdList[activerowIndex].ALTUNIT);\r\n }\r\n\r\n // getStockSettlementItemUnit(activerowIndex){\r\n // this.masterService.masterGetmethod(\"getAluUnitsOfItem/\")\r\n // .subscribe(res => {\r\n // if(res.status = \"ok\"){\r\n // this.TrnMainObj.ProdList[activerowIndex].Product.AlternateUnits = JSON.parse(res.result);\r\n // }\r\n // })\r\n // }\r\n\r\n getPricingOfItem(activerowIndex, batchcode = \"\", getAltunitListFromApi = true) {\r\n\r\n var getpricingObj = {\r\n mcode: this.TrnMainObj.ProdList[activerowIndex].MCODE,\r\n batchcode: batchcode,\r\n };\r\n this.masterService\r\n .masterPostmethod(\"/getBatchwiseItemPriceanddiscounts\", getpricingObj)\r\n .subscribe(res => {\r\n if (res.status == \"ok\") {\r\n\r\n if (this.TrnMainObj.VoucherType != 3) {\r\n this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR = 0;\r\n }\r\n\r\n this.AssignSellingPriceAndDiscounts(JSON.parse(res.result), activerowIndex);\r\n if (getAltunitListFromApi) {\r\n this.masterService\r\n .masterGetmethod(\r\n \"/getAltUnitsOfItem/\" +\r\n this.TrnMainObj.ProdList[activerowIndex].MCODE\r\n )\r\n .subscribe(\r\n ress => {\r\n if (ress.status == \"ok\") {\r\n\r\n\r\n if (\r\n this.TrnMainObj.ProdList[activerowIndex].Product == null\r\n ) {\r\n this.TrnMainObj.ProdList[activerowIndex].Product = {};\r\n }\r\n this.TrnMainObj.ProdList[activerowIndex].Product.MCODE = this.TrnMainObj.ProdList[activerowIndex].MCODE;\r\n this.TrnMainObj.ProdList[activerowIndex].Product.AlternateUnits = JSON.parse(ress.result);\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].ALTUNITObj = this.TrnMainObj.ProdList[activerowIndex].Product.AlternateUnits[0];\r\n this.TrnMainObj.ProdList[activerowIndex].ALTERNATEUNIT = this.TrnMainObj.ProdList[activerowIndex].ALTUNITObj.ALTUNIT\r\n\r\n\r\n this.altConfactor = this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR = this.TrnMainObj.ProdList[activerowIndex].ALTUNITObj.CONFACTOR;\r\n\r\n\r\n // let rate1 = this.TrnMainObj.ProdList[activerowIndex].RATE;\r\n // let rate2 = 0;\r\n // if (this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder || this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase) {\r\n // rate2 = this.TrnMainObj.ProdList[activerowIndex].SPRICE;\r\n // } else {\r\n // rate2 = this.TrnMainObj.ProdList[activerowIndex].PRATE;\r\n // }\r\n // this.setunit(\r\n // rate1,\r\n // rate2,\r\n // activerowIndex,\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTUNITObj\r\n // );\r\n } else {\r\n }\r\n },\r\n error => {\r\n }\r\n );\r\n } else {\r\n let rate1 = this.TrnMainObj.ProdList[activerowIndex].RATE;\r\n let rate2 = 0;\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase\r\n ) {\r\n rate2 = this.TrnMainObj.ProdList[activerowIndex].SPRICE;\r\n } else {\r\n rate2 = this.TrnMainObj.ProdList[activerowIndex].PRATE;\r\n }\r\n // this.setunit(\r\n // rate1,\r\n // rate2,\r\n // activerowIndex,\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTUNITObj\r\n // );\r\n this.ReCalculateBillWithNormal();\r\n }\r\n } else {\r\n alert(res.result);\r\n }\r\n });\r\n }\r\n AssignSellingPriceAndDiscounts(PriceRate: PriceRate[], activerowIndex) {\r\n\r\n // debugger\r\n var confacto = this.nullToZeroConverter(this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR);\r\n var MCODE = this.nullToZeroConverter(this.TrnMainObj.ProdList[activerowIndex].MCODE);\r\n\r\n if (confacto == 0) {\r\n this.getConfacter(MCODE);\r\n }\r\n\r\n var a = this.nullToZeroConverter(this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR);\r\n\r\n let priceidO = PriceRate.filter(x => x.ColType == \"priceid\")[0];\r\n\r\n if (priceidO != null) {\r\n this.TrnMainObj.ProdList[activerowIndex].PRICEID = priceidO.ColName;\r\n this.TrnMainObj.ProdList[activerowIndex].MANUFACTURER = priceidO.ColName;\r\n\r\n }\r\n let orgType = this.userProfile.CompanyInfo.ORG_TYPE;\r\n if (orgType.toLowerCase() == \"superdistributor\") {\r\n\r\n let spp = PriceRate.filter(x => x.ColName == \"superdistributorlandingprice\")[0];\r\n let srsp = PriceRate.filter(x => x.ColName == \"distributor\" && x.ColType == \"sellingprice\")[0];\r\n let ssp = {};\r\n if (this.TrnMainObj.AdditionalObj.CUSTOMERTYPE == '111111-1') {\r\n ssp = srsp;\r\n } else {\r\n if (this.isSelfBill == false) {\r\n\r\n ssp = PriceRate.filter(x => x.ColType == \"sellingprice\" && x.ColName == \"superdistributor\")[0];\r\n }\r\n else {\r\n\r\n ssp = PriceRate.filter(x => x.ColType == \"value\" && x.ColName == \"superdistributorlandingprice\")[0];\r\n }\r\n\r\n\r\n }\r\n // if(this.TrnMainObj.DISPENSEBY == \"SUBIMPTRN\"){\r\n // spp = ssp;\r\n // }\r\n\r\n\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.OpeningStockBalance ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockIssue ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSettlement ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSettlementEntryApproval ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Stockadjustment\r\n ) {\r\n if (this.TrnMainObj.AdditionalObj.BILLUNITS == \"CASE\") {\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE = this.nullToZeroConverter(spp.Value * this.nullToZeroConverter(this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR));\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n spp == undefined || spp == null ? 0 : this.nullToZeroConverter(spp.Value);\r\n this.TrnMainObj.ProdList[activerowIndex].SPRICE =\r\n ssp == undefined || ssp == null ? 0 : this.nullToZeroConverter(ssp.Value);\r\n } else {\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n spp == undefined || spp == null ? 0 : this.nullToZeroConverter(spp.Value);\r\n this.TrnMainObj.ProdList[activerowIndex].SPRICE =\r\n ssp == undefined || ssp == null ? 0 : this.nullToZeroConverter(ssp.Value);\r\n }\r\n }\r\n else {\r\n // debugger;\r\n\r\n if (this.TrnMainObj.AdditionalObj.BILLUNITS == \"CASE\") {\r\n\r\n var con = this.nullToZeroConverter(this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR);\r\n var conversionFactor = (con == 0 ? this.conversrionFactor : con);\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n this.nullToZeroConverter(ssp.Value * conversionFactor);\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n ssp == undefined || ssp == null ? 0 : this.nullToZeroConverter(ssp.Value);\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n spp == undefined || spp == null ? 0 : this.nullToZeroConverter(spp.Value);\r\n } else {\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n ssp == undefined || ssp == null ? 0 : this.nullToZeroConverter(ssp.Value);\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n spp == undefined || spp == null ? 0 : this.nullToZeroConverter(spp.Value);\r\n }\r\n\r\n // this.TrnMainObj.ProdList[activerowIndex].REALRATE = \r\n // this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n // this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n // ssp == undefined || ssp == null? 0: this.nullToZeroConverter(ssp.Value);\r\n\r\n // this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n // spp == undefined || spp == null? 0: this.nullToZeroConverter(spp.Value);\r\n }\r\n } else if (orgType.toLowerCase() == \"distributor\") {\r\n let dpp = PriceRate.filter(x => x.ColType == \"sellingprice\" && x.ColName == \"superdistributor\")[0];\r\n let dsp = PriceRate.filter(x => x.ColName == \"distributor\" && x.ColType == \"sellingprice\")[0];\r\n\r\n if (this.isSelfBill == true) {\r\n dsp = PriceRate.filter(x => x.ColType == \"sellingprice\" && x.ColName == \"superdistributor\")[0];\r\n }\r\n \r\n\r\n\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.OpeningStockBalance ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSample\r\n ) {\r\n if (this.TrnMainObj.AdditionalObj.BILLUNITS == \"CASE\") {\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE = this.nullToZeroConverter(dpp.Value * this.nullToZeroConverter(this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR));\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n dpp == undefined || dpp == null ? 0 : this.nullToZeroConverter(dpp.Value);\r\n this.TrnMainObj.ProdList[activerowIndex].SPRICE =\r\n dsp == undefined || dsp == null ? 0 : this.nullToZeroConverter(dsp.Value);\r\n\r\n } else {\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n dpp == undefined || dpp == null ? 0 : this.nullToZeroConverter(dpp.Value);\r\n this.TrnMainObj.ProdList[activerowIndex].SPRICE =\r\n dsp == undefined || dsp == null ? 0 : this.nullToZeroConverter(dsp.Value);\r\n }\r\n }\r\n else {\r\n\r\n if (this.TrnMainObj.AdditionalObj.BILLUNITS == \"CASE\") {\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE = this.nullToZeroConverter(dsp.Value * this.nullToZeroConverter(this.TrnMainObj.ProdList[activerowIndex].ALTCONFACTOR));\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n dsp == undefined || dsp == null ? 0 : this.nullToZeroConverter(dsp.Value);\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n dpp == undefined || dpp == null ? 0 : this.nullToZeroConverter(dpp.Value);\r\n\r\n } else {\r\n this.TrnMainObj.ProdList[activerowIndex].REALRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n dsp == undefined || dsp == null ? 0 : this.nullToZeroConverter(dsp.Value);\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n dpp == undefined || dpp == null ? 0 : this.nullToZeroConverter(dpp.Value);\r\n\r\n }\r\n\r\n // this.TrnMainObj.ProdList[activerowIndex].REALRATE = \r\n // this.TrnMainObj.ProdList[activerowIndex].ALTRATE =\r\n // this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n // dsp == undefined || dsp == null? 0: this.nullToZeroConverter(dsp.Value);\r\n // this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n // dpp == undefined || dpp == null ?0: this.nullToZeroConverter(dpp.Value);\r\n\r\n\r\n\r\n }\r\n } else {\r\n let rsp = {};\r\n let rpp = PriceRate.filter(x => x.ColType == \"sellingprice\" && x.ColName == \"distributor\")[0];\r\n\r\n rsp = PriceRate.filter(\r\n x => x.ColName == \"retailer\" && x.ColType == \"sellingprice\"\r\n )[0];\r\n // }\r\n\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.OpeningStockBalance\r\n ) {\r\n this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].PRATE = this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].REALRATE = this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].ALTRATE = this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n rpp == undefined || rpp == null\r\n ? 0\r\n : this.nullToZeroConverter(rpp.Value);\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].SPRICE =\r\n rsp == undefined || rsp == null\r\n ? 0\r\n : this.nullToZeroConverter(rsp.Value);\r\n } else {\r\n this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].REALRATE = this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].ALTRATE = this.TrnMainObj.ProdList[activerowIndex].RATE =\r\n rsp == undefined || rsp.Value == null\r\n ? 0\r\n : this.nullToZeroConverter(rsp.Value);\r\n\r\n this.TrnMainObj.ProdList[activerowIndex].PRATE =\r\n rpp == undefined || rpp == null\r\n ? 0\r\n : this.nullToZeroConverter(rpp.Value);\r\n }\r\n }\r\n }\r\n MergeSameItemWithSameBatchOfProd() {\r\n // let MergedProd=[];\r\n // Rx.Observable.from(this.TrnMainObj.ProdList)\r\n // .groupBy(x =>{ x.MCODE,x.ITEMDESC,x.MENUCODE}) // using groupBy from Rxjs\r\n // .flatMap(group => group.toArray())// GroupBy dont create a array object so you have to flat it\r\n // .map(g => {// mapping\r\n // return {\r\n // MCODE: g[0].MCODE,//take the first name because we grouped them by name\r\n // Quantity: _.sumBy(g, 'Quantity'),\r\n // REALQTY_IN: _.sumBy(g, 'REALQTY_IN'),\r\n // }\r\n // })\r\n // .toArray() //.toArray because I guess you want to loop on it with ngFor\r\n // .do(sum => console.log('sum:', sum)) // just for debug\r\n // .subscribe(d => MergedProd = d);\r\n }\r\n\r\n addRowForTransaction(index) {\r\n try {\r\n if (index == -1) {\r\n // this.TrnMainObj.TrntranList[0].ROWMODE = \"new\";\r\n this.AddNewTrnTranRow(index);\r\n return;\r\n }\r\n\r\n if (this.TrnMainObj.TrntranList[index + 1]) return; //prevent to add row if selected at the item at somewhere except last\r\n\r\n var rm = this.TrnMainObj.TrntranList[index].ROWMODE;\r\n if (rm == \"new\") {\r\n this.TrnMainObj.TrntranList[index].ROWMODE = \"new\";\r\n this.AddNewTrnTranRow(index);\r\n } else if (rm == \"edit\") {\r\n this.TrnMainObj.TrntranList[index].ROWMODE = \"edit\";\r\n }\r\n } catch (ex) {\r\n this.alertService.error(ex);\r\n }\r\n }\r\n\r\n AddNewTrnTranRow(index) {\r\n try {\r\n if (!this.TrnMainObj.TrntranList) {\r\n this.TrnMainObj.TrntranList = [];\r\n }\r\n\r\n let currentObj = this.TrnMainObj.TrntranList[index];\r\n\r\n if (this.TrnMainObj.TrntranList[index + 1]) {\r\n return;\r\n }\r\n\r\n if (\r\n index != -1 &&\r\n (!currentObj.AccountItem ||\r\n currentObj.AccountItem.ACID == undefined ||\r\n currentObj.AccountItem.ACID == \"\")\r\n ) {\r\n // this.alertService.info(\"Please Select A/C\");\r\n alert(\"Please Select A/C\");\r\n return;\r\n }\r\n\r\n if (\r\n index != -1 &&\r\n ((currentObj.DRAMNT == 0 || currentObj.DRAMNT == null) &&\r\n (currentObj.CRAMNT == 0 || currentObj.CRAMNT == null))\r\n ) {\r\n alert(\"Debit Amount or Credit Amount is Required.\");\r\n return;\r\n }\r\n\r\n var newRow = {};\r\n var newaclist: TAcList = {};\r\n newRow.AccountItem = newaclist;\r\n newRow.inputMode = true;\r\n newRow.editMode = true;\r\n\r\n newRow.ROWMODE = \"new\";\r\n newRow.PartyDetails = [];\r\n this.TrnMainObj.TrntranList.push(newRow);\r\n } catch (ex) {\r\n this.alertService.error(ex);\r\n }\r\n }\r\n\r\n deleteAccountTrnRow(index) {\r\n try {\r\n if (this.TrnMainObj.TrntranList.length < 1) return;\r\n\r\n if (this.TrnMainObj.TrntranList.length == 1) {\r\n this.TrnMainObj.TrntranList.splice(index, 1);\r\n this.addRowForTransaction(-1);\r\n return;\r\n }\r\n var rm = this.TrnMainObj.TrntranList[index].ROWMODE;\r\n if (rm == \"new\") {\r\n this.TrnMainObj.TrntranList.splice(index, 1);\r\n } else if (rm == \"save\" || rm == \"edit\") {\r\n this.TrnMainObj.TrntranList.splice(index, 1);\r\n }\r\n } catch (ex) {\r\n this.alertService.error(ex);\r\n }\r\n }\r\n\r\n calculateDrCrDifferences() {\r\n try {\r\n this.calculateCrDrTotal();\r\n this.differenceAmount = 0;\r\n if (\r\n this.TrnMainObj.VoucherType != VoucherTypeEnum.Journal &&\r\n this.TrnMainObj.VoucherType != VoucherTypeEnum.ContraVoucher\r\n ) {\r\n return;\r\n }\r\n let diffAmount: number = 0;\r\n this.TrnMainObj.TrntranList.forEach(tran => {\r\n diffAmount =\r\n diffAmount +\r\n ((tran.DRAMNT == null ? 0 : tran.DRAMNT) -\r\n (tran.CRAMNT == null ? 0 : tran.CRAMNT));\r\n });\r\n // this.differenceAmount = Math.abs(diffAmount);\r\n this.differenceAmount = diffAmount;\r\n } catch (ex) {\r\n this.alertService.error(ex);\r\n }\r\n }\r\n calculateCrDrTotal() {\r\n this.crTotal = 0;\r\n this.drTotal = 0;\r\n\r\n this.TrnMainObj.TrntranList.forEach(tran => {\r\n this.crTotal = this.crTotal + (tran.CRAMNT == null ? 0 : tran.CRAMNT);\r\n this.drTotal = this.drTotal + (tran.DRAMNT == null ? 0 : tran.DRAMNT);\r\n });\r\n }\r\n\r\n barcodeEnterCommand(event) {\r\n\r\n event.preventDefault();\r\n document.getElementById(\"itembarcode\").blur();\r\n this.masterService\r\n .masterPostmethod(\"/getItemDetailsFromBarcode\", {\r\n barcode: this.BarcodeFromScan\r\n })\r\n .subscribe(\r\n res => {\r\n if (res.status == \"ok\") {\r\n if (res.message == \"multiItem\") {\r\n this.ItemsListForMultiItemBarcode = JSON.parse(res.result);\r\n this.masterService.PlistTitle = \"itemList\";\r\n } else {\r\n let item = JSON.parse(res.result);\r\n let index = this.TrnMainObj.ProdList.findIndex(\r\n x => x.MCODE == item.MCODE\r\n );\r\n\r\n if (index < 0) {\r\n this.addRow();\r\n this.assignValueToProdFromBarcode(\r\n item,\r\n this.TrnMainObj.ProdList.findIndex(x => x.MCODE == null)\r\n );\r\n document.getElementById(\"itembarcode\").focus();\r\n } else {\r\n let alreadyExistingitem = this.TrnMainObj.ProdList[index];\r\n this.TrnMainObj.ProdList[index].Quantity += 1;\r\n this.RealQuantitySet(index, alreadyExistingitem.CONFACTOR);\r\n this.ReCalculateBillWithNormal();\r\n document.getElementById(\"itembarcode\").focus();\r\n }\r\n this.BarcodeFromScan = \"\";\r\n }\r\n } else {\r\n this.alertService.error(res.result);\r\n }\r\n },\r\n error => {\r\n this.alertService.error(error);\r\n }\r\n );\r\n }\r\n assignValueToProdFromBarcode(value, activerowIndex) {\r\n if (this.TrnMainObj.ProdList[activerowIndex] != null) {\r\n this.TrnMainObj.ProdList[activerowIndex].SELECTEDITEM = value;\r\n this.TrnMainObj.ProdList[activerowIndex].BC = value.BARCODE;\r\n this.TrnMainObj.ProdList[activerowIndex].PROMOTION = 0;\r\n this.TrnMainObj.ProdList[activerowIndex].BATCHSCHEME = null;\r\n this.TrnMainObj.ProdList[activerowIndex].ALLSCHEME = null;\r\n this.TrnMainObj.ProdList[activerowIndex].MRP = value.BatchObj.MRP;\r\n this.TrnMainObj.ProdList[activerowIndex].ISVAT = value.ISVAT;\r\n this.TrnMainObj.ProdList[activerowIndex].MENUCODE = value.MENUCODE;\r\n this.TrnMainObj.ProdList[activerowIndex].ITEMDESC = value.DESCA;\r\n this.TrnMainObj.ProdList[activerowIndex].MCODE = value.MCODE;\r\n this.TrnMainObj.ProdList[activerowIndex].GSTRATE_ONLYFORSHOWING =\r\n this.nullToZeroConverter(this.setting.appSetting.VATRate);\r\n this.TrnMainObj.ProdList[activerowIndex].GSTRATE = this.nullToZeroConverter(this.setting.appSetting.VATRate);\r\n this.TrnMainObj.ProdList[activerowIndex].WEIGHT = value.GWEIGHT;\r\n this.TrnMainObj.ProdList[activerowIndex].Mcat = value.MCAT;\r\n this.TrnMainObj.ProdList[activerowIndex].Product = value.Product;\r\n\r\n this.AssignSellingPriceAndDiscounts(\r\n value.PClist,\r\n activerowIndex\r\n\r\n );\r\n this.assignBatchToActiveProdRow(value.BatchObj, activerowIndex);\r\n this.TrnMainObj.ProdList[activerowIndex].Quantity = 1;\r\n this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].ALTUNITObj = this.TrnMainObj.ProdList[\r\n activerowIndex\r\n ].Product.AlternateUnits.filter(x => x.ISDEFAULT == 1)[0];\r\n\r\n let rate1 = this.TrnMainObj.ProdList[activerowIndex].RATE;\r\n let rate2 = 0;\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase\r\n ) {\r\n rate2 = this.TrnMainObj.ProdList[activerowIndex].SPRICE;\r\n } else {\r\n rate2 = this.TrnMainObj.ProdList[activerowIndex].PRATE;\r\n }\r\n // this.setunit(\r\n // rate1,\r\n // rate2,\r\n // activerowIndex,\r\n // this.TrnMainObj.ProdList[activerowIndex].ALTUNITObj\r\n // );\r\n\r\n this.ReCalculateBillWithNormal();\r\n }\r\n }\r\n\r\n assignBatchToActiveProdRow(value, activerowIndex) {\r\n this.TrnMainObj.ProdList[activerowIndex].BATCH = value.BATCH;\r\n this.TrnMainObj.ProdList[activerowIndex].BC = value.BCODE;\r\n this.TrnMainObj.ProdList[activerowIndex].MFGDATE =\r\n value.MFGDATE == null ? \"\" : value.MFGDATE.toString().substring(0, 10);\r\n this.TrnMainObj.ProdList[activerowIndex].EXPDATE =\r\n value.EXPIRY == null ? \"\" : value.EXPIRY.toString().substring(0, 10);\r\n this.TrnMainObj.ProdList[activerowIndex].STOCK = value.STOCK;\r\n this.TrnMainObj.ProdList[activerowIndex].WAREHOUSE = value.WAREHOUSE;\r\n this.TrnMainObj.ProdList[activerowIndex].BATCHSCHEME = value.SCHEME;\r\n this.TrnMainObj.ProdList[activerowIndex].BATCHID = value.BATCHID; //0531 BATCHID comment \r\n this.TrnMainObj.ProdList[activerowIndex].CRATE = value.CRATE; //save crate of batchpricemaster\r\n this.checkDuplicateProductWithBatchCode(activerowIndex);\r\n }\r\n\r\n\r\n nullToReturnZero(value) {\r\n if (\r\n value === undefined ||\r\n value === null ||\r\n value === null ||\r\n value === \"\" ||\r\n value === \"Infinity\" ||\r\n value === \"NaN\" ||\r\n isNaN(parseFloat(value))\r\n ) {\r\n return 0;\r\n }\r\n return parseFloat(value);\r\n\r\n }\r\n\r\n\r\n\r\n checkDuplicateProductWithBatchCode(i) {\r\n if (this.TrnMainObj.VoucherType == 3) {\r\n let differentPriceID = this.TrnMainObj.ProdList.filter(x => x.MCODE == this.TrnMainObj.ProdList[i].MCODE && x.BATCH == this.TrnMainObj.ProdList[i].BATCH\r\n && x.MANUFACTURER != this.TrnMainObj.ProdList[i].MANUFACTURER);\r\n if (differentPriceID != null) {\r\n if (differentPriceID.length == 1 || differentPriceID.length > 1) {\r\n this.alertService.info(\"Same Product with Different Price ID is not allowed\")\r\n this.Dup_ItemBatchValidation = 'DifferentPriceID';\r\n return;\r\n } else {\r\n this.Dup_ItemBatchValidation = '';\r\n }\r\n }\r\n } \r\n // else {\r\n let duplicateProdandBatch = this.TrnMainObj.ProdList.filter(x => x.MCODE == this.TrnMainObj.ProdList[i].MCODE && x.BATCH == this.TrnMainObj.ProdList[i].BATCH);\r\n if (duplicateProdandBatch != null) {\r\n if (duplicateProdandBatch.length > 1) {\r\n this.alertService.info(\"Duplicate Product With Batch is not allowed\")\r\n this.Dup_ItemBatchValidation = 'DuplicateProduct';\r\n return;\r\n } else {\r\n this.Dup_ItemBatchValidation = '';\r\n }\r\n }\r\n // }\r\n }\r\n\r\n\r\n\r\n diffAmountItemForAccount: number = 0;\r\n diffAmountDrCrType: string = \"\";\r\n getAccountWiseTrnAmount(acid: string) {\r\n if (!acid || acid == null || acid == undefined) return;\r\n\r\n this.diffAmountItemForAccount = 0;\r\n this.diffAmountDrCrType = \"\";\r\n let companyId = this.authservice.getCurrentCompanyId();\r\n let requestType = 0;\r\n if (this.TrnMainObj.VoucherType == 22 || this.TrnMainObj.VoucherType == 23) {\r\n requestType = 1;\r\n }\r\n\r\n this.masterService\r\n .getAccountWiseTrnAmount(\r\n this.TrnMainObj.TRNDATE.toString(),\r\n companyId,\r\n acid,\r\n this.TrnMainObj.DIVISION\r\n )\r\n .subscribe(\r\n res => {\r\n if (res.status == \"ok\") {\r\n this.diffAmountDrCrType = res.result < 0 ? \"Cr\" : \"Dr\";\r\n if(this.diffAmountDrCrType == \"Cr\"){\r\n this.diffAmountItemForAccount = Math.abs(res.result);\r\n }else{\r\n this.diffAmountItemForAccount=0;\r\n }\r\n } else {\r\n this.diffAmountItemForAccount = 0;\r\n this.diffAmountDrCrType = \"\";\r\n }\r\n },\r\n error => {\r\n this.diffAmountItemForAccount = 0;\r\n this.diffAmountDrCrType = \"\";\r\n }\r\n );\r\n }\r\n ReCalculateBillWithNormal() {\r\n try {\r\n // this.TrnMainObj.ProdList.forEach(prod => {\r\n // if(this.nullToZeroConverter(prod.Quantity) == 0)\r\n // this.alertService.error(\"Quantity cannot be zero\")\r\n // return;\r\n // })\r\n this.TrnMainObj.DCRATE = (this.TrnMainObj.TOTALFLATDISCOUNT * 100) / this.TrnMainObj.TOTAMNT ;\r\n this.TrnMainObj.TOTAMNT = 0;\r\n this.TrnMainObj.TOTALINDDISCOUNT = 0;\r\n this.TrnMainObj.TOTALPROMOTION = 0;\r\n this.TrnMainObj.TOTALLOYALTY = 0;\r\n this.TrnMainObj.DCAMNT = 0;\r\n this.TrnMainObj.ServiceCharge = 0;\r\n this.TrnMainObj.TAXABLE = 0;\r\n this.TrnMainObj.NONTAXABLE = 0;\r\n this.TrnMainObj.VATAMNT = 0;\r\n this.TrnMainObj.NETWITHOUTROUNDOFF = 0;\r\n this.TrnMainObj.TotalWithIndDiscount = 0;\r\n this.TrnMainObj.TOTALDISCOUNT = 0;\r\n this.TrnMainObj.TOTALQTY = 0;\r\n this.TrnMainObj.TOTALWEIGHT = 0;\r\n this.TrnMainObj.totalAlternateQuantity = 0;\r\n this.TrnMainObj.totalBaseQuantity = 0;\r\n this.TrnMainObj.TOTALPRIMARYDISCOUNT = 0;\r\n this.TrnMainObj.TOTALSECONDARYDISCOUNT = 0;\r\n this.TrnMainObj.TOTALLIQUIDATIONDISCOUNT = 0;\r\n this.TrnMainObj.TOTALQPSDISCOUNT = 0;\r\n\r\n // var rQty = 0;\r\n //var totalQuantity = 0;\r\n this.TrnMainObj.TOTALFLATDISCOUNT = 0;\r\n this.TrnMainObj.ProdList.forEach(prod => {\r\n prod.VoucherType = this.TrnMainObj.VoucherType;\r\n //realqty calculation \r\n\r\n let rQty = (this.nullToZeroConverter(prod.ALTERNATEQUANTIY) * this.nullToZeroConverter(prod.ALTCONFACTOR)) + this.nullToZeroConverter(prod.BASEQUANTITY);\r\n\r\n // console.log(\"prodAmoutn_calc\",prod.ALTERNATEQUANTIY,prod.ALTCONFACTOR,prod.BASEQUANTITY)\r\n // let rQty= 100\r\n\r\n\r\n if (this.TrnMainObj.AdditionalObj.BILLUNITS == \"CASE\") {\r\n prod.ALTUNIT = this.TrnMainObj.AdditionalObj.BILLUNITS;\r\n prod.UNIT = prod.BASEUNIT;\r\n\r\n } else {\r\n prod.ALTUNIT = prod.BASEUNIT;\r\n prod.UNIT = prod.BASEUNIT;\r\n\r\n }\r\n\r\n if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.SalesReturn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.BranchTransferIn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.DeliveryReturn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.GoodsReceived ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNoteApproval ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.ReverseSalesRetrun\r\n ) {\r\n\r\n prod.RealQty = 0;\r\n prod.AltQty = 0;\r\n if (this.TrnMainObj.AdditionalObj.BILLUNITS == 'CASE') {\r\n\r\n // prod.AltQty = this.nullToZeroConverter(prod.AltQty = this.nullToZeroConverter(prod.ALTERNATEQUANTIY));\r\n prod.ALTUNIT = 'CASE';\r\n prod.UNIT = 'EACH';\r\n prod.Quantity =\r\n prod.REALQTY_IN = rQty;\r\n prod.ALTQTY_IN = prod.ALTERNATEQUANTIY;\r\n\r\n }\r\n else if (this.TrnMainObj.AdditionalObj.BILLUNITS == 'EACH') {\r\n // prod.AltQty = this.nullToZeroConverter(prod.AltQty = this.nullToZeroConverter(prod.BASEQUANTITY))\r\n prod.ALTUNIT = 'EACH';\r\n prod.UNIT = 'EACH'\r\n prod.Quantity =\r\n prod.REALQTY_IN =\r\n prod.ALTQTY_IN = prod.BASEQUANTITY;\r\n }\r\n else {\r\n this.alertService.warning(\"Please choose bill unit\");\r\n return;\r\n }\r\n\r\n if (prod.AltQty == undefined || prod.AltQty == null) { this.alertService.warning(\"Cannot assign value to AltQty\"); return; }\r\n\r\n\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Sales ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseReturn ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.DebitNote ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.Delivery ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.BranchTransferOut ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoice ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockIssue ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.SalesOrder ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PerformaSalesInvoice ||\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSample\r\n ) {\r\n //alert(\"DispatchOut\")\r\n //.CONFACTOR *\r\n // prod.Quantity=\r\n // prod.AltQty =\r\n // prod.RealQty =rQty;\r\n // prod.REALQTY_IN = 0;\r\n // prod.ALTQTY_IN = 0;\r\n\r\n prod.Quantity = rQty;\r\n prod.AltQty = this.nullToZeroConverter(prod.ALTERNATEQUANTIY) == 0 ? rQty : this.nullToZeroConverter(prod.ALTERNATEQUANTIY);\r\n prod.RealQty = rQty;\r\n prod.REALQTY_IN = 0;\r\n prod.ALTQTY_IN = 0;\r\n\r\n }\r\n else if (this.TrnMainObj.VoucherType == VoucherTypeEnum.OpeningStockBalance) {\r\n if (rQty > 0) {\r\n //.CONFACTOR *\r\n prod.Quantity =\r\n prod.ALTQTY_IN =\r\n prod.REALQTY_IN = rQty;\r\n prod.RealQty = 0;\r\n prod.AltQty = 0;\r\n\r\n // prod.Quantity= rQty;\r\n // prod.ALTQTY_IN = this.nullToZeroConverter(prod.ALTERNATEQUANTIY)\r\n // prod.REALQTY_IN = rQty;\r\n // prod.RealQty = 0;\r\n // prod.AltQty = 0;\r\n\r\n } else if (rQty < 0) {\r\n prod.Quantity =\r\n prod.AltQty =\r\n prod.RealQty = rQty;\r\n prod.REALQTY_IN = 0;\r\n prod.ALTQTY_IN = 0;\r\n }\r\n } else if (this.TrnMainObj.VoucherType == VoucherTypeEnum.StockSettlement) {\r\n /*\r\n none of the value are 0 here\r\n later while save the value it will checks StockSettlement and then return 0 there.\r\n */\r\n prod.ALTQTY_IN =\r\n prod.REALQTY_IN =\r\n prod.Quantity =\r\n prod.AltQty =\r\n prod.RealQty = rQty;\r\n prod.REALQTY_IN = 0;\r\n prod.ALTQTY_IN = 0;\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.PurchaseOrderCancel\r\n ) {\r\n\r\n\r\n } else if (\r\n this.TrnMainObj.VoucherType == VoucherTypeEnum.TaxInvoiceCancel\r\n ) {\r\n\r\n } else {\r\n alert(\"Vouchertype not found please contact admin.\");\r\n }\r\n\r\n // prod.AMOUNT =0;\r\n prod.AMOUNT = rQty * this.nullToZeroConverter(prod.RATE)\r\n\r\n\r\n\r\n if (prod.Weighable == 'kg' || prod.Weighable == 'ltr') {\r\n prod.WEIGHT = rQty * this.nullToZeroConverter(prod.PWEIGHT);\r\n }\r\n else if (prod.Weighable == 'gram' || prod.Weighable == 'ml') {\r\n prod.WEIGHT = rQty * this.nullToZeroConverter(prod.PWEIGHT / 1000);\r\n }\r\n\r\n // primary discount used as Customer FIxed Discount\r\n //secondary discount as scheme \r\n //liquidation discount as contract discount \r\n if (prod.INDDISCOUNTRATE != null && prod.INDDISCOUNTRATE > 0) {\r\n prod.INDDISCOUNT = (prod.AMOUNT * prod.INDDISCOUNTRATE) / 100;\r\n }\r\n\r\n if((this.TrnMainObj.VoucherType==VoucherTypeEnum.Purchase && this.masterService.disableQuantityEdit == true)|| this.TrnMainObj.Mode=='VIEW'){\r\n \r\n }else{\r\n if (prod.INDDISCOUNT != null && prod.INDDISCOUNT > 0) {\r\n prod.INDDISCOUNTRATE = (prod.INDDISCOUNT * 100) / prod.AMOUNT ;\r\n \r\n } \r\n }\r\n \r\n \r\n // prod.PrimaryDiscount = this.nullToZeroConverter(this.TrnMainObj.CUS_FIX_DISCOUNT_PER) == 0 ?\r\n // 0 : (this.nullToZeroConverter(this.TrnMainObj.CUS_FIX_DISCOUNT_PER) * prod.AMOUNT / 100);\r\n prod.SecondaryDiscount = 0;\r\n if( this.TrnMainObj.VoucherType == VoucherTypeEnum.CreditNote &&this.TrnMainObj.DOPARTIALSALESRETURN==1){\r\n if(this.TrnMainObj.AdditionalObj.BILLUNITS == 'EACH'){\r\n prod.SecondaryDiscount= this.nullToZeroConverter(prod.BASEQUANTITY * prod.ProrataDis);\r\n }else{\r\n prod.SecondaryDiscount= this.nullToZeroConverter(prod.ALTERNATEQUANTIY * prod.ALTCONFACTOR * prod.ProrataDis);\r\n }\r\n \r\n }else{\r\n prod.SecondaryDiscount = this.nullToZeroConverter(prod.BaseSecondaryDiscount);\r\n }\r\n // prod.LiquiditionDiscount = this.nullToZeroConverter(prod.BaseLiquiditionDiscount) * prod.Quantity;\r\n if (this.TrnMainObj.Mode !== \"VIEW\") {\r\n prod.LiquiditionDiscount = this.nullToZeroConverter(this.TrnMainObj.CUS_Remote_Discount) == 0 ? 0 :\r\n (this.nullToZeroConverter(this.TrnMainObj.CUS_Remote_Discount) * prod.AMOUNT / 100);\r\n }\r\n\r\n let disExcludingFlatDiscount =\r\n this.nullToZeroConverter(prod.INDDISCOUNT) +\r\n this.nullToZeroConverter(prod.PROMOTION) +\r\n this.nullToZeroConverter(prod.LOYALTY) +\r\n this.nullToZeroConverter(prod.PrimaryDiscount) +\r\n this.nullToZeroConverter(prod.SecondaryDiscount) +\r\n this.nullToZeroConverter(prod.LiquiditionDiscount);\r\n let totalAmt = 0;\r\n // if(this.TrnMainObj.VoucherType != VoucherTypeEnum.DebitNote){\r\n this.TrnMainObj.ProdList.forEach(x => {\r\n totalAmt +=\r\n x.AMOUNT -\r\n this.nullToZeroConverter(x.INDDISCOUNT) -\r\n this.nullToZeroConverter(x.PROMOTION) -\r\n this.nullToZeroConverter(x.LOYALTY) -\r\n this.nullToZeroConverter(x.PrimaryDiscount) -\r\n this.nullToZeroConverter(x.SecondaryDiscount) -\r\n this.nullToZeroConverter(x.LiquiditionDiscount);\r\n });\r\n if (totalAmt == 0) {\r\n prod.FLATDISCOUNT = 0;\r\n }\r\n else {\r\n // prod.FLATDISCOUNT =\r\n // ((prod.AMOUNT - disExcludingFlatDiscount) *\r\n // this.nullToZeroConverter(this.TrnMainObj.TOTALFLATDISCOUNT)) /\r\n // totalAmt;\r\n \r\n\r\n if(this.TrnMainObj.VoucherType == VoucherTypeEnum.Purchase && this.fromNotification==true){\r\n this.TrnMainObj.TOTALFLATDISCOUNT+= prod.FLATDISCOUNT\r\n \r\n }else{\r\n // if(this.TrnMainObj.TOTALFLATDISCOUNT==0){\r\n prod.FLATDISCOUNT= this.nullToZeroConverter(prod.AMOUNT * this.TrnMainObj.DCRATE)/100;\r\n this.TrnMainObj.TOTALFLATDISCOUNT+= prod.FLATDISCOUNT\r\n // }else{\r\n \r\n // }\r\n // console.log(\"Deriirsd\",this.TrnMainObj.TOTALFLATDISCOUNT)\r\n // prod.FLATDISCOUNT= this.nullToZeroConverter(this.TrnMainObj.DCAMNT/prod.AMOUNT)*100;\r\n // console.log(\"Deriirsa\",this.TrnMainObj.DCAMNT,prod.AMOUNT,prod.FLATDISCOUNT,this.TrnMainObj.TOTALFLATDISCOUNT)\r\n // this.TrnMainObj.TOTALFLATDISCOUNT+= prod.FLATDISCOUNT\r\n // console.log(\"Deriirs\",this.TrnMainObj.TOTALFLATDISCOUNT)\r\n }\r\n }\r\n\r\n\r\n // }else{\r\n // prod.FLATDISCOUNT= this.nullToZeroConverter(prod.AMOUNT * this.TrnMainObj.DCRATE)/100;\r\n // this.TrnMainObj.TOTALFLATDISCOUNT+= prod.FLATDISCOUNT\r\n // }\r\n // prod.FixedDiscount = prod.RATE*prod.RealQty*this.CustomerObjForDiscount.CUS_FIX_DISCOUNT_PER/100\r\n // prod.RemoteDiscount = prod.RATE*prod.RealQty*this.CustomerObjForDiscount.CUS_Remote_Discount/100\r\n prod.DISCOUNT =\r\n disExcludingFlatDiscount + this.nullToZeroConverter(prod.FLATDISCOUNT);\r\n\r\n // prod.RATE = (this.nullToZeroConverter(prod.RATE)* this.nullToZeroConverter(prod.ALTCONFACTOR))\r\n if (prod.ISSERVICECHARGE == 1) {\r\n prod.SERVICETAX =\r\n (prod.AMOUNT - prod.DISCOUNT) *\r\n this.setting.appSetting.ServiceTaxRate;\r\n }\r\n\r\n prod.NCRATE = prod.RATE * prod.EXRATE;\r\n let vatamnt = (prod.AMOUNT - prod.DISCOUNT + this.nullToZeroConverter(prod.SERVICETAX)) * this.nullToZeroConverter(this.setting.appSetting.VATRate);\r\n // if (prod.ISVAT == 1 && vatamnt>0) {\r\n prod.TAXABLE = prod.AMOUNT - prod.DISCOUNT + this.nullToZeroConverter(prod.SERVICETAX);\r\n prod.NONTAXABLE = 0;\r\n prod.VAT = vatamnt;\r\n // } else {\r\n // prod.TAXABLE = 0;\r\n // prod.NONTAXABLE = prod.AMOUNT - prod.DISCOUNT+ this.nullToZeroConverter(prod.SERVICETAX);\r\n // }\r\n\r\n prod.NETAMOUNT = prod.TAXABLE + prod.NONTAXABLE + prod.VAT + this.nullToZeroConverter(prod.SERVICETAX);;\r\n this.TrnMainObj.TOTAMNT += prod.AMOUNT;\r\n this.TrnMainObj.TOTALINDDISCOUNT += this.nullToZeroConverter(prod.INDDISCOUNT);\r\n this.TrnMainObj.TOTALLOYALTY += this.nullToZeroConverter(prod.LOYALTY);\r\n this.TrnMainObj.TOTALPROMOTION += this.nullToZeroConverter(prod.PROMOTION);\r\n this.TrnMainObj.DCAMNT += this.nullToZeroConverter(prod.DISCOUNT);\r\n this.TrnMainObj.ServiceCharge += this.nullToZeroConverter(prod.SERVICETAX);\r\n this.TrnMainObj.TAXABLE += this.nullToZeroConverter(prod.TAXABLE);\r\n this.TrnMainObj.NONTAXABLE += this.nullToZeroConverter(prod.NONTAXABLE);\r\n this.TrnMainObj.VATAMNT += this.nullToZeroConverter(prod.VAT);\r\n this.TrnMainObj.NETWITHOUTROUNDOFF += this.nullToZeroConverter(prod.NETAMOUNT);\r\n this.TrnMainObj.TotalWithIndDiscount += this.nullToZeroConverter(prod.TOTAL);\r\n this.TrnMainObj.TOTALDISCOUNT += this.nullToZeroConverter(prod.DISCOUNT);\r\n this.TrnMainObj.TOTALQTY += rQty;\r\n this.TrnMainObj.TOTALWEIGHT += this.nullToZeroConverter(prod.WEIGHT);\r\n this.TrnMainObj.totalAlternateQuantity += this.nullToZeroConverter(prod.ALTERNATEQUANTIY);\r\n this.TrnMainObj.totalBaseQuantity += this.nullToZeroConverter(prod.BASEQUANTITY);\r\n this.TrnMainObj.TOTALPRIMARYDISCOUNT += this.nullToZeroConverter(prod.PrimaryDiscount);\r\n this.TrnMainObj.TOTALSECONDARYDISCOUNT += this.nullToZeroConverter(prod.SecondaryDiscount);\r\n this.TrnMainObj.TOTALLIQUIDATIONDISCOUNT += this.nullToZeroConverter(prod.LiquiditionDiscount);\r\n this.TrnMainObj.TOTALQPSDISCOUNT += this.nullToZeroConverter(prod.QpsDiscount);\r\n this.TOTALALLDISCOUNT = this.nullToZeroConverter(this.TrnMainObj.TOTALINDDISCOUNT) + this.nullToZeroConverter(this.TrnMainObj.TOTALPRIMARYDISCOUNT) +\r\n this.nullToZeroConverter(this.TrnMainObj.TOTALSECONDARYDISCOUNT) +\r\n this.nullToZeroConverter(this.TrnMainObj.TOTALLIQUIDATIONDISCOUNT) +\r\n this.nullToZeroConverter(this.TrnMainObj.TOTALQPSDISCOUNT) +\r\n this.nullToZeroConverter(this.TrnMainObj.TOTALFLATDISCOUNT);\r\n });\r\n\r\n this.TrnMainObj.NETAMNT = Math.round(\r\n this.nullToZeroConverter(this.TrnMainObj.NETWITHOUTROUNDOFF)\r\n );\r\n this.TrnMainObj.ROUNDOFF =\r\n this.TrnMainObj.NETAMNT - this.TrnMainObj.NETWITHOUTROUNDOFF;\r\n if (this.isSelfBill == false) {\r\n if(this.arouter.snapshot.url[0].path == 'add-creditnote-itembase' && this.userProfile.CompanyInfo.ORG_TYPE=='superdistributor'){\r\n \r\n }else{\r\n this.TrnMainObj.MWAREHOUSE = 'Main Warehouse'\r\n }\r\n this.TrnMainObj.isSelfBill = false;\r\n }\r\n else {\r\n this.TrnMainObj.isSelfBill = true;\r\n }\r\n\r\n\r\n } catch (error) {\r\n this.alertService.error(\"ERROR ON BILL CALCULATION:\" + error + \"...Please Contact To Administrator\");\r\n }\r\n }\r\n\r\n private newMethod() {\r\n return this;\r\n }\r\n\r\n getCustomerListRouteAndSalesmanWise(salesManId: any, route: any) {\r\n let data = { salesManId: salesManId, route: route };\r\n this.masterService.getCustomerListBasedUponRouteAndSalesman(data)\r\n .subscribe(\r\n (res) => {\r\n this.CustomerList = res;\r\n if (this.CustomerList.length == 0) {\r\n this.customerListInPopup = true;\r\n }\r\n else if (this.CustomerList.length != 0) {\r\n this.customerListInPopup = false;\r\n }\r\n })\r\n }\r\n\r\n loadDataForTaxCancel(VCHR, division, phiscalid) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.TaxInvoiceCancel;\r\n this.TrnMainObj.VoucherAbbName = \"SC\";\r\n this.TrnMainObj.VoucherPrefix = \"SC\";\r\n this.TrnMainObj.Mode = \"NEW\";\r\n this.TrnMainObj.REFBILL = this.TrnMainObj.VCHRNO;\r\n const uuidV1 = require('uuid/v1');\r\n this.TrnMainObj.guid = uuidV1();\r\n\r\n this.getVoucherNumberForTaxCancel();\r\n\r\n this.masterService.checkCustomerTypeForBillCancel(this.TrnMainObj.BILLTO, this.TrnMainObj.PARAC)\r\n .subscribe(\r\n res => {\r\n this.billedCustomerType = res.result;\r\n\r\n }\r\n )\r\n this.masterService.getSavedVoucherNo(this.TrnMainObj.REFBILL).subscribe(data=>{\r\n \r\n })\r\n\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n \r\n }\r\n \r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n }\r\n\r\n loadDataForSalesReturn(VCHR, division, phiscalid) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.getSavedVoucherNo(VCHR).subscribe((data:any)=>{\r\n \r\n if(data.result==true){\r\n this.loadingService.hide();\r\n this.TrnMainObj.DOPARTIALSALESRETURN=1;\r\n this.disableFullReturn=true;\r\n this.DoManualSalesReturn(this.TrnMainObj.DOPARTIALSALESRETURN)\r\n }else{\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(\r\n data => {\r\n this.disableFullReturn=false;\r\n if (data.status == \"ok\") {\r\n this.loadingService.hide();\r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.VoucherType = 15;\r\n this.TrnMainObj.VoucherAbbName = \"CN\";\r\n this.TrnMainObj.VoucherPrefix = \"CN\";\r\n \r\n this.TrnMainObj.Mode = \"NEW\";\r\n const uuidV1 = require('uuid/v1');\r\n this.TrnMainObj.guid = uuidV1();\r\n this.TrnMainObj.CHALANNO = null;\r\n \r\n this.TrnMainObj.MWAREHOUSE = this.salesReturnWarehouse;\r\n this.TrnMainObj.REFBILL = this.TrnMainObj.VCHRNO;\r\n this.TrnMainObj.AdditionalObj.WAREHOUSETYPE = this.warehousetypeforSalesReturn;\r\n this.TrnMainObj.DOFULLRETURN=1;\r\n this.TrnMainObj.REMARKS=this.remarks\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n \r\n this.ReCalculateBillWithNormal();\r\n this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n \r\n }\r\n })\r\n \r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n loadDataForStockIssue(VCHR, division, phiscalid) {\r\n let VCHRNO = VCHR;\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.VoucherType = 71;\r\n this.TrnMainObj.VoucherAbbName = \"SS\";\r\n this.TrnMainObj.VoucherPrefix = \"SS\"; \r\n this.TrnMainObj.AdditionalObj.INVOICETYPE =this.stocktransferBillType; \r\n this.TrnMainObj.REFORDBILL = this.TrnMainObj.REFBILL;\r\n this.TrnMainObj.REFBILL = VCHRNO;\r\n this.TrnMainObj.REMARKS = \"\";\r\n \r\n this.TrnMainObj.Mode = \"NEW\";\r\n const uuidV1 = require('uuid/v1');\r\n this.TrnMainObj.guid = uuidV1();\r\n this.TrnMainObj.CHALANNO = null;\r\n\r\n // this.TrnMainObj.MWAREHOUSE = this.salesReturnWarehouse;\r\n // this.TrnMainObj.REFBILL = this.TrnMainObj.VCHRNO;\r\n // this.TrnMainObj.AdditionalObj.WAREHOUSETYPE = this.warehousetypeforSalesReturn;\r\n\r\n for (let i in this.TrnMainObj.ProdList) {\r\n \r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n loadDataForSalesReturnRevers(VCHR, division, phiscalid) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.VoucherType = 38;\r\n this.TrnMainObj.VoucherAbbName = \"RR\";\r\n this.TrnMainObj.VoucherPrefix = \"RR\";\r\n\r\n\r\n this.TrnMainObj.Mode = \"NEW\";\r\n const uuidV1 = require('uuid/v1');\r\n this.TrnMainObj.guid = uuidV1();\r\n this.TrnMainObj.CHALANNO = null;\r\n\r\n this.TrnMainObj.MWAREHOUSE = this.salesReturnWarehouse;\r\n this.TrnMainObj.REFBILL = this.TrnMainObj.VCHRNO;\r\n this.TrnMainObj.AdditionalObj.WAREHOUSETYPE = this.warehousetypeforSalesReturn;\r\n\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n loadDataForSalesReturnApproval(VCHR, division, phiscalid) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.VoucherType = 65;\r\n this.TrnMainObj.VoucherAbbName = \"CA\";\r\n this.TrnMainObj.VoucherPrefix = \"CA\";\r\n this.TrnMainObj.Mode = \"NEW\";\r\n const uuidV1 = require('uuid/v1');\r\n this.TrnMainObj.guid = uuidV1();\r\n this.TrnMainObj.CHALANNO = null;\r\n\r\n this.TrnMainObj.REFBILL = this.TrnMainObj.VCHRNO;\r\n\r\n\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n\r\n }\r\n\r\n\r\n loadApprovedDataSalesReturn(VCHR, division, phiscalid) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadApprovedSalesReturn(VCHR, division, phiscalid).subscribe(\r\n\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n\r\n this.onViewClick = false;\r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.Mode = 'VIEW';\r\n this.TrnMainObj.VoucherType = 65;\r\n this.TrnMainObj.VoucherAbbName = \"CA\";\r\n this.TrnMainObj.VoucherPrefix = \"CA\";\r\n if (this.TrnMainObj.AdditionalObj == null) {\r\n this.TrnMainObj.AdditionalObj = {};\r\n }\r\n //this.TrnMainObj.AdditionalObj.INVOICETYPE = 'NewBill'\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n // this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n }\r\n\r\n\r\n\r\n loadDataForSOApproval(VCHR, division, phiscalid) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadSalesReturnForSoApproval(VCHR, division, phiscalid).subscribe(\r\n\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n\r\n this.onViewClick = false;\r\n this.TrnMainObj.ProdList = data.result;\r\n\r\n this.TrnMainObj.VoucherType = 65;\r\n this.TrnMainObj.VoucherAbbName = \"CA\";\r\n this.TrnMainObj.VoucherPrefix = \"CA\";\r\n if (this.TrnMainObj.AdditionalObj == null) {\r\n this.TrnMainObj.AdditionalObj = {};\r\n }\r\n //this.TrnMainObj.AdditionalObj.INVOICETYPE = 'NewBill'\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n // this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n }\r\n\r\n\r\n\r\n\r\n loadDataForStockTransferApproval(VCHR, division, phiscalid, SETTLEMENTMODE) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid, SETTLEMENTMODE).subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n \r\n if(this.arouter.snapshot.url[0].path !='add-stock-issue-approval'){\r\n for (let i of data.result.ProdList) {\r\n if (i.WAREHOUSE = \"Main Warehouse\") {\r\n data.result.ProdList.splice(i, 1);\r\n }\r\n }\r\n }\r\n \r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.BILLTOADD = this.TrnMainObj.SETTLEMENTMODE;\r\n this.TrnMainObj.Mode = 'NEW';\r\n const uuidV1 = require('uuid/v1');\r\n this.TrnMainObj.guid = uuidV1();\r\n this.TrnMainObj.VoucherType = 5;\r\n this.TrnMainObj.VoucherPrefix = \"IS\";\r\n\r\n this.TrnMainObj.REFBILL = this.TrnMainObj.VCHRNO;\r\n if (this.TrnMainObj.AdditionalObj == null) {\r\n this.TrnMainObj.AdditionalObj = {};\r\n }\r\n\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n }\r\n\r\n\r\n\r\n getConfacter(mcode) {\r\n this.masterService\r\n .getConfactor(\"/getConfactor\", { mcode: mcode })\r\n .subscribe(\r\n res => {\r\n if (res.status == \"ok\") {\r\n\r\n this.conversrionFactor = res.result;\r\n\r\n } else {\r\n this.alertService.error(res.result);\r\n }\r\n },\r\n error => {\r\n this.alertService.error(error);\r\n }\r\n );\r\n }\r\n\r\n\r\n\r\n loadStockIssueDataForPurchaseReturn(VCHR, division, phiscalid) {\r\n this.loadingService.show(\"Getting Details, Please Wait...\");\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n if (data.status == \"ok\") {\r\n this.TrnMainObj = data.result;\r\n this.TrnMainObj.Mode = 'NEW';\r\n this.TrnMainObj.VoucherType = VoucherTypeEnum.DebitNote;\r\n this.TrnMainObj.VoucherPrefix = 'DN';\r\n this.TrnMainObj.VoucherAbbName = 'DN';\r\n\r\n this.TrnMainObj.VCHRNO = this.TrnMainObj.REFBILL;\r\n\r\n for (let i in this.TrnMainObj.ProdList) {\r\n this.setAltunitDropDownForView(i);\r\n this.TrnMainObj.ProdList[i].MFGDATE = ((this.TrnMainObj.ProdList[i].MFGDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].MFGDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].EXPDATE = ((this.TrnMainObj.ProdList[i].EXPDATE == null) ? \"\" : this.TrnMainObj.ProdList[i].EXPDATE.toString().substring(0, 10));\r\n this.TrnMainObj.ProdList[i].VCHRNO = this.TrnMainObj.REFBILL;\r\n this.TrnMainObj.ProdList[i].BaseSecondaryDiscount = this.TrnMainObj.ProdList[i].SecondaryDiscount\r\n }\r\n this.ReCalculateBillWithNormal();\r\n this.getVoucherNumber();\r\n this.getCurrentDate();\r\n this.TrnMainObj.TRNDATE =\r\n this.TrnMainObj.TRNDATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRNDATE.toString().substring(0, 10);\r\n this.TrnMainObj.TRN_DATE =\r\n this.TrnMainObj.TRN_DATE == null\r\n ? \"\"\r\n : this.TrnMainObj.TRN_DATE.toString().substring(0, 10);\r\n }\r\n },\r\n error => {\r\n this.loadingService.hide();\r\n this.alertService.error(error)\r\n this.trnmainBehavior.complete();\r\n },\r\n () => {\r\n this.loadingService.hide();\r\n this.trnmainBehavior.complete();\r\n }\r\n );\r\n }\r\n\r\n calculateRate(i) {\r\n let eachRate = this.TrnMainObj.ProdList[i].RATE;\r\n let conFactor = this.TrnMainObj.ProdList[i].ALTERNATEUNIT;\r\n\r\n if (this.TrnMainObj.ProdList[i].UNIT == \"EACH\") {\r\n return eachRate;\r\n } else {\r\n\r\n }\r\n }\r\n\r\n skuWiseEnteredStockCheck(i) {\r\n this.skuWiseTotalQty = 0;\r\n this.skuWiseList = this.TrnMainObj.ProdList.filter(x => x.MCODE == this.TrnMainObj.ProdList[i].MCODE && x.BATCH == this.TrnMainObj.ProdList[i].BATCH).forEach(x => this.skuWiseTotalQty += x.Quantity)\r\n if (this.skuWiseTotalQty > this.TrnMainObj.ProdList[i].STOCK) {\r\n this.alertService.error(\"Quantity Exceed the Stock\");\r\n this.QuantityMsg = 'GreaterQuantity'\r\n return;\r\n } else {\r\n this.QuantityMsg = '';\r\n }\r\n }\r\n\r\n checkPreviousApprovedStock(i) {\r\n this.masterService.getPreviousApprovedStock(this.TrnMainObj.REFBILL).subscribe(res => {\r\n if (res.status == 'ok') {\r\n let Qty = this.TrnMainObj.ProdList[i].Quantity;\r\n let selectedProduct = this.stockListForApproved.filter(x => x.MCODE == this.TrnMainObj.ProdList[i].MCODE && x.BATCH == this.TrnMainObj.ProdList[i].BATCH)\r\n for (let j of selectedProduct) {\r\n\r\n if (Qty > j.RealQty) {\r\n this.alertService.info(`Quantity Exceed the transaction Stock. Previous approved Quantity is${j.RealQty}`);\r\n this.QuantityMsg = 'GreaterQuantity'\r\n return;\r\n } else {\r\n this.QuantityMsg = '';\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n\r\n skuWisePUrchaseInvoiceEnteredStockCheck(i) {\r\n let skuPIWiseTotalQty = 0;\r\n let skuWiseList = this.TrnMainObj.ProdList.filter(x => x.MCODE == this.TrnMainObj.ProdList[i].MCODE && x.BATCH == this.TrnMainObj.ProdList[i].BATCH).forEach(x => skuPIWiseTotalQty += x.Quantity)\r\n\r\n if (skuPIWiseTotalQty > this.TrnMainObj.ProdList[i].PISTOCK) {\r\n this.alertService.error(\"Quantity Exceed the Stock\");\r\n this.QuantityMsg = 'GreaterQuantity'\r\n return;\r\n } else {\r\n this.QuantityMsg = '';\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n\r\n rowBackGrounColor(i) {\r\n let color = this.TrnMainObj.ProdList[i].backgroundcolor;\r\n if (color == null || color == \"\") {\r\n color = \"white\";\r\n }\r\n return color;\r\n }\r\n\r\n checkLastTwoDaysOfMonth() {\r\n let currentDate = new Date();\r\n let currentYear = currentDate.getFullYear();\r\n let currentMonth = currentDate.getMonth();\r\n let currentDay = currentDate.getDay();\r\n let dayValues = new Date(currentYear, currentMonth + 1, 0).getDate();\r\n if (currentDay == dayValues) {\r\n this.disablePerformaBillingForLastTwoDays = true;\r\n } else if (currentDay = dayValues - 1) {\r\n // this.disablePerformaBillingForLastTwoDays = true;\r\n }\r\n \r\n }\r\n\r\n checkLastThreeDaysOfMonth(){\r\n \r\n let currentDate = new Date();\r\n // let currentYear = currentDate.getFullYear();\r\n // let currentMonth = currentDate.getMonth();\r\n let currentDay = currentDate.getDay();\r\n if(currentDay==28 || currentDay==29 || currentDay==30){\r\n this.alertService.warning(\"Cannot do Performa invoice at the end of the month\");\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n subtractDates(date1, date2) {\r\n var dt1 = new Date(date1);\r\n var dt2 = new Date(date2);\r\n return Math.floor((Date.UTC(dt2.getFullYear(), dt2.getMonth(), dt2.getDate()) - Date.UTC(dt1.getFullYear(), dt1.getMonth(), dt1.getDate())) / (1000 * 60 * 60 * 24));\r\n }\r\n\r\n transformDatetoMMddYY(date) {\r\n return moment(date).format('MM/DD/YYYY')\r\n }\r\n deteProforma(vchrno) {\r\n this.masterService\r\n .masterPostmethod(\"/deteteProforma\", {\r\n barcode: vchrno\r\n })\r\n .subscribe(\r\n res => {\r\n if (res.status == \"ok\") {\r\n this.alertService.success(\"Deleted Succesfully\")\r\n\r\n this.initialFormLoad(this.TrnMainObj.VoucherType);\r\n\r\n } else {\r\n this.alertService.error(res.result);\r\n }\r\n },\r\n error => {\r\n this.alertService.error(error);\r\n }\r\n );\r\n }\r\n\r\n preventNavigation() {\r\n if (!this.saveChanges) {\r\n this.preventNavigationService.preventNavigation(true);\r\n } else {\r\n this.preventNavigationService.preventNavigation(false);\r\n }\r\n }\r\n checkPurchaseVerification():boolean {\r\n if(this.userProfile.CompanyInfo.ORG_TYPE =='distributor' &&\r\n this.userSetting.isIRDVerified == 1 &&\r\n this.TrnMainObj.VoucherType === VoucherTypeEnum.Purchase && this.fromNotification==false\r\n ){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }\r\n isCashPayment:boolean;\r\n setDefaultAcc(){\r\n\r\n this.isCashPayment = false;\r\n if(this.TrnMainObj.TRNMODE.toUpperCase() == 'CASH'){\r\n // document.getElementById(\"supplierid\").focus();\r\n if(this.userSetting.CASHINHAND_AC){\r\n this.TrnMainObj.TRNAC = this.userSetting.CASHINHAND_AC;\r\n this.masterService.Account = 'CASHINHAND_AC';\r\n this.isCashPayment = true;\r\n }\r\n \r\n else {\r\n alert(\"'Default Cash' on database not found. Please Contact to Administrator for this!\");\r\n this.TrnMainObj.TRNACName = 'error...';\r\n }\r\n }\r\n \r\n }\r\n DoManualSalesReturn(value){\r\n if(value==1){\r\n // this.DisableMasterMode(false); \r\n this.TrnMainObj.DOFULLRETURN =0;\r\n this.TrnMainObj.ProdList=[]\r\n if(this.TrnMainObj.TOTALFLATDISCOUNT !=0){\r\n // this.TrnMainObj.DCRATE=0;\r\n this.TrnMainObj.TOTALFLATDISCOUNT=0;\r\n this.TrnMainObj.TOTALDISCOUNT=0;\r\n alert(\"Previous applied flat discount will be removed.Please apply for new flat discount!!\")\r\n }\r\n this.addRow()\r\n }else{\r\n if(this.disableFullReturn==false){\r\n // this.DisableMasterMode(true);\r\n this.TrnMainObj.DOFULLRETURN =1;\r\n }\r\n\r\n }\r\n\r\n }\r\n \r\n DoFulReturnClick(value) {\r\n // if (this._trnMainService.TrnMainObj.REFBILL == undefined || this._trnMainService.TrnMainObj.REFBILL == '' || this._trnMainService.TrnMainObj.REFBILL == null) {\r\n // return;\r\n // }\r\n\r\n value == true? this.TrnMainObj.DOPARTIALSALESRETURN =0: this.TrnMainObj.DOPARTIALSALESRETURN = 1;\r\n // this._trnMainService.DOFULLRETURN = this._trnMainService.TrnMainObj.DOFULLRETURN;\r\n \r\n\r\n \r\n }\r\n\r\n resetAllPopup(){\r\n this.HidePopup.next();\r\n // this.genericGridApproved.hide();\r\n\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n\r\nexport interface ProdListMode {\r\n mode: string;\r\n selectedRow: TrnMain;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/Transaction Components/transaction.service.ts","module.exports = \"input, select,option {\\r\\n height:23px;\\r\\n vertical-align: middle;\\r\\n font-size:13px; \\r\\n border: 1px solid #cbcbcb;\\r\\n border-radius: 3px;\\r\\n color: black;\\r\\n}\\r\\n\\r\\ntextarea {\\r\\n font-size:13px; \\r\\n border: 1px solid #cbcbcb;\\r\\n border-radius: 3px;\\r\\n color: black;\\r\\n}\\r\\n\\r\\n.plainBackGround {\\r\\n border: 2px solid #E6E6E6;\\r\\n margin-bottom:5px;\\r\\n padding:10px;\\r\\n}\\r\\n/*.myFont {\\r\\n font-size:13px;\\r\\n font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\\r\\n font-style:normal;\\r\\n}\\r\\n*/\\r\\nlabel {\\r\\n height:28px;\\r\\n font-weight: normal;\\r\\n width: 90px;\\r\\n margin: 2px;\\r\\n vertical-align: middle;\\r\\n font-size:13px; \\r\\n padding-top: 4px;\\r\\n}\\r\\n\\r\\ninput{\\r\\n padding-left: 4px;\\r\\n}\\r\\n\\r\\ninput[type=number]::-webkit-inner-spin-button, \\r\\ninput[type=number]::-webkit-outer-spin-button { \\r\\n -webkit-appearance: none; \\r\\n margin: 0; \\r\\n}\\r\\n\\r\\n\\r\\ninput:disabled, select:disabled, textarea:disabled {\\r\\n cursor: not-allowed !important;\\r\\n color: black !important;\\r\\n background-color: #EBEBE4 !important;\\r\\n}\\r\\n\\r\\nbutton:disabled{\\r\\n cursor: not-allowed !important;\\r\\n}\\r\\n\\r\\n.btn-add-focus:focus {\\r\\n transform: scale(1.2);\\r\\n -webkit-transform: scale(1.2);\\r\\n -ms-transform: scale(1.2);\\r\\n -moz-transform: scale(1.2);\\r\\n -o-transform: scale(1.2);\\r\\n}\\r\\n\\r\\ntr th{\\r\\n font-weight: bold;\\r\\n}\\r\\n\\r\\n\\r\\n .tableBorder{\\r\\n border:1px solid;border-color:#dcdcdc\\r\\n }\\r\\n\\r\\n\\r\\n .show {\\r\\n overflow: visible;\\r\\n height: auto;\\r\\n }\\r\\n\\r\\n .alert-danger {\\r\\n background-color: none !important; \\r\\n border-color: none !important; \\r\\n color: #a94442;\\r\\n}\\r\\n\\r\\n/* Style the tab */\\r\\n\\r\\n.tab {\\r\\n overflow: hidden;\\r\\n border: 1px solid #ccc;\\r\\n background-color: #f1f1f1;\\r\\n }\\r\\n \\r\\n /* Style the buttons inside the tab */\\r\\n .tab button {\\r\\n background-color: inherit;\\r\\n float: left;\\r\\n border: none;\\r\\n outline: none;\\r\\n cursor: pointer;\\r\\n padding: 14px 16px;\\r\\n transition: 0.3s;\\r\\n font-size: 17px;\\r\\n }\\r\\n \\r\\n /* Change background color of buttons on hover */\\r\\n .tab button:hover {\\r\\n background-color: #ddd;\\r\\n }\\r\\n \\r\\n /* Create an active/current tablink class */\\r\\n .tab button.active {\\r\\n background-color: #ccc;\\r\\n }\\r\\n \\r\\n /* Style the tab content */\\r\\n .tabcontent {\\r\\n display: none;\\r\\n padding: 6px 12px;\\r\\n border: 1px solid #ccc;\\r\\n border-top: none;\\r\\n }\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/Style.css\n// module id = 8\n// module chunks = 22","import { Schedule } from \"./../interfaces/Schedule.interface\";\r\nimport { Injectable } from \"@angular/core\";\r\nimport { Trntran, TSubLedger } from \"./../interfaces/TrnMain\";\r\nimport { ImporterPriceCalc, TAcList } from \"./../interfaces/Account.interface\";\r\nimport * as _ from \"lodash\";\r\nimport {\r\n IRateGroup,\r\n IDivision,\r\n BatchStock\r\n} from \"../interfaces/commonInterface.interface\";\r\n// import { SalesTerminal } from \"../../pages/masters/components/sales-terminal/sales-terminal.interface\"\r\nimport { Http, Response, Headers, RequestOptions, ResponseContentType } from \"@angular/http\";\r\nimport { AuthService } from \"../services/permission/authService.service\";\r\nimport { Subject } from \"rxjs/subject\";\r\nimport { GlobalState } from \"../../global.state\";\r\nimport { Observable } from \"rxjs/Observable\";\r\nimport { Subscriber } from \"rxjs/Subscriber\";\r\nimport * as FileSaver from 'file-saver';\r\nimport * as XLSX from 'xlsx';\r\nimport {\r\n Item,\r\n VoucherTypeEnum,\r\n TrnMain,\r\n CostCenter,\r\n Warehouse,\r\n AcListTree\r\n} from \"../interfaces/index\";\r\nimport { IndexedDbWrapper, SettingService, AppSettings } from \"../services\";\r\nimport { BehaviorSubject } from \"rxjs/BehaviorSubject\";\r\nimport { LoginDialog } from \"../../pages/modaldialogs/index\";\r\nimport { MdDialog, MdDialogRef } from \"@angular/material\";\r\nimport { MessageDialog } from \"../../pages/modaldialogs/messageDialog/messageDialog.component\";\r\nimport { Company } from \"../interfaces/CompanyInfo.interface\";\r\nimport { HotkeysService, Hotkey } from \"angular2-hotkeys\";\r\nimport { TransactionService } from \"../Transaction Components/transaction.service\";\r\nimport { min } from \"rxjs/operator/min\";\r\nimport { max } from \"rxjs/operator/max\";\r\nimport { AlertService } from \"../services/alert/alert.service\";\r\nimport { Row } from \"primeng/primeng\";\r\nimport { importdocument } from \"../interfaces/AdditionalCost.interface\";\r\n@Injectable()\r\nexport class MasterRepo {\r\n //Message dialogbox\r\n // messageSubject: BehaviorSubject = new BehaviorSubject(\"\");\r\n // message$: Observable = this.messageSubject.asObservable();\r\n // childDialogRef: MdDialogRef;\r\n //---end message dialogbox\r\n private _rateGroups: Array = [];\r\n\r\n private _account: TAcList[] = [];\r\n private _subLedger: TSubLedger[] = [];\r\n private _reqOption: RequestOptions;\r\n public _itemList: Item[] = [];\r\n public PartialProductList: any[] = [];\r\n public ProductGroupTree: any[] = [];\r\n private _accountTree: any[] = [];\r\n private _accountPartyTree: any[] = [];\r\n public _ptypeList: any[] = [];\r\n public _Units: any[] = [];\r\n public _Chanels: any[] = [];\r\n public Currencies: any[] = [];\r\n private orgType:any;\r\n public userProfiles:any = {};\r\n disableQuantityEdit:boolean = false;\r\n public isLoginSync = false;\r\n public showfiscalPopup:boolean;\r\n ItemList_Available: string;\r\n batch:any;\r\n AdditionalPurchaseAcObj: any;\r\n AdditionalPurchaseCreditAcObj: any;\r\n mcode:any;\r\n desca:any;\r\n postdatedvoucher:boolean;\r\n public viewDivision = new Subject();\r\n batchid:any;\r\n RefObj: any = {};\r\n costType: any = \"GroupCost\";\r\n loadedTrnmain: TrnMain = {};\r\n userSetting: any;\r\n importDocumentDetailsObj: importdocument = {}\r\n addnMode: any;\r\n //private _lastProductStockCheckDateLocal:Date= new Date('1990-01-01T00:00:00');\r\n Account:any;\r\n disableAdditionalCost:boolean = false;\r\n showadditionalcost:boolean= true;\r\n EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';\r\n EXCEL_EXTENSION = '.xlsx';\r\nMode:string;\r\nfilterIndex:number=0\r\nretailerlevelschemetype:string;\r\n private get _lastProductChangeDateLocal(): Date {\r\n return (\r\n this.authService.getSessionVariable(\"LastProductChangeDateLocal\")\r\n );\r\n }\r\n private get _lastProductStockCheckDateLocal(): Date {\r\n return (\r\n this.authService.getSessionVariable(\"LastProductStockCheckDateLocal\")\r\n );\r\n }\r\n public get itemList(): Item[] {\r\n return this._itemList;\r\n }\r\n public get accountList(): TAcList[] {\r\n return this._account;\r\n }\r\n\r\n //Observable for divisionList\r\n public _divisions: Array = [];\r\n\r\n private _divisionListObservable: Observable>;\r\n public rateGroups: Subject> = new Subject();\r\n private Subscriptions: any[];\r\n public PartialAccountList: any[] = [];\r\n private subject: Subject;\r\n commands: Observable;\r\n ShowMore = false;\r\n PType: string;\r\n partyPopUpHeaderText: string = \"\";\r\n PlistTitle: string = \"\";\r\n public appType;\r\n headerMode = \"(NEW)\";\r\n //constructor\r\n defaultProductValue:number;\r\n PhiscalObj: any = {};\r\n private showSalesmanListPopupSource = new BehaviorSubject(true);\r\n showSalesmanListPopup$ = this.showSalesmanListPopupSource.asObservable();\r\n constructor(\r\n private http: Http,\r\n private authService: AuthService,\r\n private state: GlobalState,\r\n private dbWrapper: IndexedDbWrapper,\r\n public dialog: MdDialog,\r\n private setting: SettingService,\r\n private hotkeysService: HotkeysService,\r\n private alterService:AlertService\r\n\r\n \r\n ) {\r\n this.appType=this.setting.appSetting.APPTYPE;\r\n this.userProfiles = this.authService.getUserProfile();\r\n\r\n // this.orgType = this.userProfiles.CompanyInfo.ORG_TYPE;\r\n this.authService.setSessionVariable(\r\n \"LastProductStockCheckDateLocal\",\r\n new Date(\"1990-01-01T00:00:00\")\r\n );\r\n //setting requestOption with headers and authorizationkey\r\n //this.getRateGroups();\r\n //this.getRateGroupsFromApi();\r\n this.refreshTransactionList();\r\n //this.getRateGroupList();\r\n // this.PhiscalObj = authService.getPhiscalInfo();\r\n \r\n }\r\n setShowSalesmanListPopup(value:boolean){\r\n this.showSalesmanListPopupSource.next(value);\r\n }\r\n ngAfterViewInit() {\r\n this.subject = new Subject();\r\n this.commands = this.subject.asObservable();\r\n this.http\r\n .get(\"./../../assets/config.json\")\r\n .toPromise()\r\n .then(r => r.json() as ConfigModel)\r\n .then(c => {\r\n for (const key in c.hotkeys) {\r\n const commands = c.hotkeys[key];\r\n this.hotkeysService.add(\r\n new Hotkey(key, (ev, combo) => this.hotkey(ev, combo, commands))\r\n );\r\n }\r\n });\r\n }\r\n\r\n hotkey(ev: KeyboardEvent, combo: string, commands: string[]): boolean {\r\n commands.forEach(c => {\r\n const command = {\r\n name: c,\r\n ev: ev,\r\n combo: combo\r\n } as Command;\r\n this.subject.next(command);\r\n });\r\n return true;\r\n }\r\n public refreshTransactionList() {\r\n return;\r\n if (this.accountSubject.getValue().length == 0) {\r\n this.refreshAccountList(\"maseter initial\");\r\n }\r\n\r\n if (this._divisionListSubject.getValue().length == 0) {\r\n this.refreshDivsionList();\r\n }\r\n if (this.costCenterSubject.getValue().length == 0) {\r\n this.refreshCostCenters();\r\n }\r\n if (this.warehouseSubject.getValue().length == 0) {\r\n this.refreshWarehouses();\r\n }\r\n if (this.rateGroupSubject.getValue().length == 0) {\r\n this.refreshRateGroupList();\r\n }\r\n if (this.accountSubject.getValue().length == 0) {\r\n this.refreshAccountList(\"maseter initial\");\r\n }\r\n }\r\n\r\n //OBSERVABLE ReDefined\r\n //Division list observable\r\n private allDivisionSubject: BehaviorSubject<\r\n IDivision[]\r\n > = new BehaviorSubject([]);\r\n public allDivisionList$: Observable<\r\n IDivision[]\r\n > = this.allDivisionSubject.asObservable();\r\n public _divisionListSubject: BehaviorSubject<\r\n IDivision[]\r\n > = new BehaviorSubject([]);\r\n public divisionList$: Observable<\r\n IDivision[]\r\n > = this._divisionListSubject.asObservable();y\r\n public refreshDivsionList(refresh: boolean = false) {\r\n let divList: IDivision[] = [];\r\n this.http\r\n .get(this.apiUrl + \"/getDivisionlist\", this.getRequestOption())\r\n .flatMap(res => res.json() || [])\r\n .map(ret => {\r\n divList.push(ret);\r\n this.allDivisionSubject.next(divList);\r\n return divList;\r\n })\r\n .map(ret => {\r\n if (this.setting.appSetting.UserwiseDivision == 1) {\r\n var divs: IDivision[] = [];\r\n var userdivs = this.setting.appSetting.userDivisionList;\r\n ret.forEach(div => {\r\n var divitem = userdivs.find(d => d == div.INITIAL);\r\n if (divitem) {\r\n divs.push(div);\r\n }\r\n });\r\n return divs;\r\n }\r\n else {\r\n return ret;\r\n }\r\n })\r\n .share()\r\n .subscribe(\r\n data => {\r\n this._divisionListSubject.next(data);\r\n },\r\n error => {\r\n var err = error;\r\n //alert(err);\r\n },\r\n () => {\r\n this._divisions = divList;\r\n }\r\n );\r\n }\r\n //-------end of divisionlist----------------\r\n\r\n //Cost Center\r\n public costCenterSubject: BehaviorSubject = new BehaviorSubject<\r\n CostCenter[]\r\n >([]);\r\n public costCenterList$: Observable<\r\n CostCenter[]\r\n > = this.costCenterSubject.asObservable();\r\n\r\n public refreshCostCenters() {\r\n let _costCenterList: CostCenter[] = [];\r\n this.http\r\n .get(this.apiUrl + \"/getCostCenterList\", this.getRequestOption())\r\n .flatMap(res => res.json() || [])\r\n .map(ret => {\r\n _costCenterList.push(ret);\r\n return _costCenterList;\r\n })\r\n .share()\r\n .subscribe(\r\n data => {\r\n this.costCenterSubject.next(data);\r\n },\r\n error => {\r\n this.resolveError(error, \"masterRepo-getCostCenters\");\r\n }\r\n );\r\n }\r\n\r\n //---end costcenter\r\n // WarehouseList\r\n public warehouseSubject: BehaviorSubject = new BehaviorSubject<\r\n Warehouse[]\r\n >([]);\r\n public warehouseList$: Observable<\r\n Warehouse[]\r\n > = this.warehouseSubject.asObservable();\r\n private allWarehouseSubject: BehaviorSubject<\r\n Warehouse[]\r\n > = new BehaviorSubject([]);\r\n public allWarehouseList$: Observable<\r\n Warehouse[]\r\n > = this.allWarehouseSubject.asObservable();\r\n\r\n public refreshWarehouses() {\r\n let wlist: Warehouse[] = [];\r\n this.http\r\n .get(this.apiUrl + \"/getWarehouseList\", this.getRequestOption())\r\n .flatMap(response => response.json() || [])\r\n .map(ret => {\r\n wlist.push(ret);\r\n this.allWarehouseSubject.next(wlist);\r\n return wlist;\r\n })\r\n // .map(ret => {\r\n // if (this.setting.appSetting.UserwiseDivision == 1) {\r\n // var wares: Warehouse[] = [];\r\n // var userWares = this.setting.appSetting.userWarehouseList;\r\n // userWares.forEach(ware => {\r\n // var war = ret.find(w => w.NAME == ware);\r\n // if (war) {\r\n // wares.push(war);\r\n // }\r\n // });\r\n // return wares;\r\n // }\r\n // else {\r\n // return ret;\r\n // }\r\n // })\r\n .share()\r\n .subscribe(\r\n data => {\r\n this.warehouseSubject.next(data);\r\n },\r\n error => {\r\n this.resolveError(error, \"masterService-getwarehouses\");\r\n }\r\n );\r\n }\r\n //---end of WarehouseList\r\n //------end of redefined\r\n\r\n // RateGroupList\r\n public rateGroupSubject: BehaviorSubject = new BehaviorSubject<\r\n IRateGroup[]\r\n >([]);\r\n public rateGroupList$: Observable<\r\n IRateGroup[]\r\n > = this.rateGroupSubject.asObservable();\r\n public refreshRateGroupList() {\r\n let rlist: IRateGroup[] = [];\r\n this.http\r\n .get(this.apiUrl + \"/getRateGroupList\", this.getRequestOption())\r\n .flatMap(response => response.json() || [])\r\n .map(ret => {\r\n rlist.push(ret);\r\n return rlist;\r\n })\r\n .share()\r\n .subscribe(\r\n data => {\r\n this.rateGroupSubject.next(data);\r\n },\r\n error => {\r\n this.resolveError(error, \"masterService-getrateGroup\");\r\n }\r\n );\r\n }\r\n //---end of RateGroupList\r\n //accountlist\r\n accountSubject: BehaviorSubject = new BehaviorSubject(\r\n []\r\n );\r\n accountList$: Observable = this.accountSubject.asObservable();\r\n public refreshAccountList(calledFrom: string) {\r\n var ilist: TAcList[] = [];\r\n if (this._account.length > 0) return;\r\n this.http\r\n .get(this.apiUrl + \"/getAccountList\", this.getRequestOption())\r\n .flatMap(res => res.json() || [])\r\n .share()\r\n .subscribe(\r\n data => {\r\n ilist.push(data);\r\n this.accountSubject.next(ilist);\r\n },\r\n Error => {\r\n this.accountSubject.complete();\r\n },\r\n () => {\r\n this._account = ilist;\r\n this.accountSubject.next(ilist);\r\n this.accountSubject.complete();\r\n }\r\n );\r\n }\r\n //end accountlist\r\n public get apiUrl(): string {\r\n let url = this.state.getGlobalSetting(\"apiUrl\");\r\n let apiUrl = \"\";\r\n\r\n if (!!url && url.length > 0) {\r\n apiUrl = url[0];\r\n }\r\n return apiUrl;\r\n }\r\n public getRequestOption() {\r\n let headers: Headers = new Headers({\r\n \"Content-type\": \"application/json\",\r\n Authorization: this.authService.getAuth().token\r\n });\r\n return new RequestOptions({ headers: headers });\r\n }\r\n\r\n\r\n \r\n\r\n prodListHttp$ = this.http\r\n .post(\r\n this.apiUrl + \"/getProductList\",\r\n { EDATE: this._lastProductChangeDateLocal },\r\n this.getRequestOption()\r\n )\r\n .flatMap(res => res.json() || [])\r\n .share();\r\n\r\n public getVoucherNo(TrnMainObj: any) {\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .post(this.apiUrl + \"/getVoucherNo\", TrnMainObj, this.getRequestOption())\r\n .subscribe(data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n returnSubject.next(retData);\r\n } else {\r\n returnSubject.next(retData);\r\n }\r\n });\r\n return returnSubject;\r\n }\r\n // public itemListSubject: BehaviorSubject = new BehaviorSubject([]);\r\n // public _itemListObservable$: Observable = this.itemListSubject.asObservable();\r\n\r\n public _itemListObservable$: Observable;\r\n\r\n public getProductItemList() {\r\n try {\r\n if (this._itemList.length > 0) {\r\n return Observable.of(this._itemList);\r\n } else if (this._itemListObservable$) {\r\n return this._itemListObservable$;\r\n } else {\r\n this._itemListObservable$ = null;\r\n this._itemListObservable$ = this.http\r\n .post(\r\n this.apiUrl + \"/getProductList\",\r\n { EDATE: this._lastProductChangeDateLocal },\r\n this.getRequestOption()\r\n )\r\n .flatMap(res => res.json() || [])\r\n .map(data => {\r\n this._itemList.push(data);\r\n return this._itemList;\r\n })\r\n .share();\r\n return this._itemListObservable$;\r\n }\r\n }\r\n catch (ex) {\r\n }\r\n }\r\n public getProductItemPagedList() {\r\n try {\r\n if (this._itemList.length > 0) {\r\n return Observable.of(this._itemList);\r\n }\r\n else if (this._itemListObservable$) {\r\n return this._itemListObservable$;\r\n }\r\n else {\r\n this._itemListObservable$ = null;\r\n this._itemListObservable$ = this.http.post(this.apiUrl + '/getProductPagedList', { EDATE: this._lastProductChangeDateLocal }, this.getRequestOption())\r\n .flatMap(res => res.json() || [])\r\n .map(data => {\r\n this._itemList.push(data)\r\n return this._itemList;\r\n })\r\n .share();\r\n return this._itemListObservable$;\r\n }\r\n }\r\n catch (ex) {\r\n }\r\n }\r\n\r\n // public IListSubject: BehaviorSubject = new BehaviorSubject([]);\r\n // public ItemList$: Observable = this.IListSubject.asObservable();\r\n // private ItemListSubject: BehaviorSubject = new BehaviorSubject([]);\r\n // public _itemListObservable$: Observable = this.ItemListSubject.asObservable();\r\n // public getProductItemList() {\r\n // try {\r\n // if (this._itemList.length > 0) {\r\n // //return this._itemList;\r\n // return Observable.of(this._itemList);\r\n // }\r\n // else if (this._itemListObservable$) {\r\n // return this._itemListObservable$;\r\n // }\r\n // else {\r\n // this.http.get(this.apiUrl + '/getWarehouseList', this.getRequestOption()).flatMap(response => response.json() || [])\r\n // .map(ret => {\r\n // this._itemList.push(ret);\r\n // this.ItemListSubject.next(this._itemList);\r\n // return this._itemList;\r\n // })\r\n // .map(ret => {\r\n // if (this.setting.appSetting.UserwiseDivision == 1) {\r\n\r\n // }\r\n // else {\r\n // return ret;\r\n // }\r\n // })\r\n // .share()\r\n // .subscribe(data => {\r\n // this.ItemListSubject.next(data)\r\n // },\r\n // error => {\r\n // this.resolveError(error, 'masterService-getwarehouses')\r\n // })\r\n\r\n // ;\r\n // }\r\n\r\n // }\r\n // catch (ex) {\r\n // }\r\n // }\r\n\r\n // public getProductItemList() {\r\n // try {\r\n // var db = this.dbWrapper.dbHelper;\r\n // if (this._itemList.length > 0) {\r\n // return Observable.of(this._itemList);\r\n // }\r\n // else if(this._itemListObservable$){\r\n // return this._itemListObservable$;\r\n // }\r\n // else if(db){\r\n // this.dbWrapper.dbHelper.openCursor('PRODUCT', (evt) => {\r\n // let cursor = evt.target.result;\r\n // if (cursor) {\r\n // this._itemList.push(cursor.value);\r\n // cursor.continue();\r\n // }\r\n // else {\r\n // return Observable.of(this._itemList);\r\n // }\r\n // }).catch((error) => {\r\n // this.refreshProductItemList();\r\n // return;\r\n // //return Observable.of([]);\r\n // });\r\n // }\r\n // else{\r\n // var lastProductChangeDateLocal = this.authService.getSessionVariable('LastProductChangeDateLocal');\r\n // if (lastProductChangeDateLocal) {\r\n // this.refreshProductItemList();\r\n\r\n // }\r\n\r\n // }\r\n // }\r\n // catch (ex) {\r\n // }\r\n // }\r\n public refreshProductItemList() {\r\n try {\r\n if (this._itemList.length > 0) return;\r\n var plist: Item[] = [];\r\n var LastDate = new Date(\"1900-01-01T00:00:00\");\r\n var db = this.dbWrapper.dbHelper;\r\n this.prodListHttp$.share().subscribe(\r\n data => {\r\n var pitem = data;\r\n if (LastDate < pitem.EDATE) {\r\n LastDate = pitem.EDATE;\r\n }\r\n db.update(\"PRODUCT\", pitem).catch(error => { });\r\n },\r\n Error => console.log(Error),\r\n () => {\r\n this.authService.removeSessionVariable(\"LastProductChangeDateLocal\");\r\n //this._itemList = plist;\r\n }\r\n );\r\n } catch (ex) {\r\n }\r\n }\r\n\r\n // public getProductItemList() {\r\n // return new Observable((observer: Subscriber>) => {\r\n // if (this._itemList.length > 0) {\r\n // observer.next(this._itemList);\r\n // observer.complete();\r\n // }\r\n // else {\r\n // this.http.get(this.apiUrl + '/getProductList', this.getRequestOption())\r\n // .flatMap(res => res.json() || [])\r\n // .subscribe(data => {\r\n // this._itemList.push(data);\r\n // observer.next(this._itemList)\r\n // },\r\n // Error => {\r\n // observer.complete();\r\n // observer.error(Error);\r\n // }\r\n // ,\r\n // () => observer.complete()\r\n // )\r\n // }\r\n // }\r\n // );\r\n // }\r\n // public getRateGroupList(): Array {\r\n // if (this._rateGroups.length > 0) {\r\n // return this._rateGroups;\r\n // }\r\n // this.http.get(this.apiUrl + '/getRateGroupList', this.getRequestOption())\r\n // .flatMap(Response => Response.json() || [])\r\n // .subscribe(data => {\r\n // this._rateGroups.push(data)\r\n // })\r\n // }\r\n public getRateGroups() {\r\n\r\n this.state.subscribe(\"rateGroupList\", data => {\r\n this._rateGroups = data;\r\n this.rateGroups.next(data);\r\n });\r\n }\r\n\r\n private getRateGroupsFromApi() {\r\n let url = this.state.getGlobalSetting(\"apiUrl\");\r\n let apiUrl;\r\n\r\n if (!!url && url.length > 0) {\r\n apiUrl = url[0];\r\n }\r\n let retRateGroups: Array = [];\r\n this.http\r\n .get(apiUrl + \"/getRateGroupList\", this.getRequestOption())\r\n .flatMap(Response => Response.json() || [])\r\n .subscribe(\r\n data => {\r\n retRateGroups.push(data);\r\n },\r\n error => {\r\n },\r\n () => {\r\n this.state.notifyDataChanged(\"rateGroupList\", retRateGroups);\r\n }\r\n );\r\n }\r\n\r\n public getDivisions(refresh: boolean = false) {\r\n let dlist = [];\r\n let returnDiv = [];\r\n this.getAllDivisions().subscribe(res => {\r\n dlist.push(res);\r\n if (this.setting.appSetting.UserwiseDivision == 1) {\r\n var divs = [];\r\n var userdivs = this.setting.appSetting.userDivisionList;\r\n dlist.forEach(div => {\r\n var divitem = userdivs.find(d => d == div.INITIAL);\r\n if (divitem) {\r\n divs.push(div);\r\n }\r\n });\r\n returnDiv = divs;\r\n } else {\r\n returnDiv = dlist;\r\n }\r\n });\r\n return Observable.of(returnDiv);\r\n }\r\n\r\n //New Api\r\n public getMGroupFromMenuItem() {\r\n return this.http\r\n .get(this.apiUrl + \"/getMGroupFromMenuItem\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getPartyGroup() {\r\n return this.http\r\n .get(this.apiUrl + \"/getPartyGroup\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n //---------------------\r\n\r\n public getAllDivisions() {\r\n return this.http\r\n .get(this.apiUrl + \"/getDivisionlist\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n\r\n public getReportDetails() {\r\n return this.http\r\n .get(this.apiUrl + \"/getReportDetails\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getCurrencies() {\r\n return this.http\r\n .get(this.apiUrl + \"/getCurrencyList\", this.getRequestOption())\r\n .flatMap(response => response.json() || [])\r\n .subscribe(res => {\r\n this.Currencies.push(res);\r\n });\r\n }\r\n public getSalesman(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getSalesmanList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n //.subscribe(res=>{\r\n // this._divisions.push(res);\r\n //this.subjectDivision.next(this._divisions);\r\n //})\r\n }\r\n private getSalesmanFromApi() { }\r\n\r\n public getCostCenter(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getCostCenterList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n //.subscribe(res=>{\r\n // this._divisions.push(res);\r\n //this.subjectDivision.next(this._divisions);\r\n //})\r\n }\r\n public getAllCostCenter(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getAllCostCenterList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n //.subscribe(res=>{\r\n // this._divisions.push(res);\r\n //this.subjectDivision.next(this._divisions);\r\n //})\r\n }\r\n private getCostCenterFromApi() { }\r\n public getCategory(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getCategoryList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n //.subscribe(res=>{\r\n // this._divisions.push(res);\r\n //this.subjectDivision.next(this._divisions);\r\n //})\r\n }\r\n public getAllCategory(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getAllCategoryList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n //.subscribe(res=>{\r\n // this._divisions.push(res);\r\n //this.subjectDivision.next(this._divisions);\r\n //})\r\n }\r\n private getCategoryFromApi() { }\r\n public getAllCat() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(this.apiUrl + \"/getAllCategoryList\", this.getRequestOption())\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public getSalesTerminal(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getSalesTerminalList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getWarehouse(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getAllWarehouseList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getTerminalCategory(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getTerminalCategoryList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getPType(refresh: boolean = false) {\r\n let ptypeList = [];\r\n return this.http\r\n .get(this.apiUrl + \"/getPTypeList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getAllUnitList(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getUnitList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getCounterProduct(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getCounterProductList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n\r\n\r\n // public getAccountList(): Array {\r\n // if (this._account.length > 0) {\r\n // return this._account;\r\n // }\r\n // else {\r\n // this.http.get(this.apiUrl + '/getAccountList', this.getRequestOption())\r\n // .flatMap(response => response.json() || []).subscribe(res => {\r\n // this._account.push(res);\r\n // }, Error => { console.log(Error) }\r\n // , () => { return this._account })\r\n // }\r\n // }\r\n getAccountObservable: Observable;\r\n\r\n public getAccount(calledFrom: string) {\r\n if (this._account.length > 0) {\r\n return Observable.of(this._account);\r\n } else if (this.getAccountObservable) {\r\n return this.getAccountObservable;\r\n } else {\r\n var aList: TAcList[] = [];\r\n this.getAccountObservable = this.http\r\n .get(this.apiUrl + \"/getAccountList\", this.getRequestOption())\r\n .flatMap(res => {\r\n if (res.status == 400) {\r\n return Observable.of([]);\r\n } else if (res.status == 200) {\r\n return res.json() || [];\r\n }\r\n })\r\n .map(data => {\r\n this.getAccountObservable = null;\r\n aList.push(data);\r\n this._account = aList;\r\n return aList.filter(x => x.TYPE == 'A');\r\n })\r\n .share();\r\n return this.getAccountObservable;\r\n }\r\n }\r\n\r\n public getAccoutFilteredObs(keyword: any, byacid: number = 0) {\r\n return new Observable((observer: Subscriber) => {\r\n this.getAccount(\"getAccountFilteredObs\")\r\n .map(aclist => {\r\n if (byacid == 0) {\r\n return aclist.filter(ac =>\r\n ac.ACCODE == null\r\n ? \"\"\r\n : ac.ACCODE.toUpperCase().indexOf(keyword.toUpperCase()) > -1 && ac.TYPE == 'A'\r\n );\r\n } else {\r\n return aclist.filter(ac =>\r\n ac.ACNAME == null\r\n ? \"\"\r\n : ac.ACNAME.toUpperCase().indexOf(keyword.toUpperCase()) > -1 && ac.TYPE == 'A'\r\n );\r\n }\r\n })\r\n .subscribe(\r\n data => {\r\n observer.next(data);\r\n },\r\n Error => {\r\n observer.complete();\r\n },\r\n () => {\r\n observer.complete();\r\n }\r\n );\r\n });\r\n }\r\n // public getAccoutFilteredObs1(keyword: any, byacid: number = 0) {\r\n // return new Observable((observer: Subscriber>) => {\r\n // if (this._account.length == 0) {\r\n // this.http.get(this.apiUrl + '/getAccountList', this.getRequestOption())\r\n // .flatMap(response => response.json() || []).subscribe(res => {\r\n // this._account.push(res);\r\n // if (keyword) {\r\n // let filteredList;\r\n // if (byacid == 0) {\r\n // filteredList = this._account.filter((fil: TAcList) => {\r\n // if (fil.ACCODE.toLowerCase().indexOf(keyword.toLowerCase()) != -1) {\r\n // return fil;\r\n // }\r\n // });\r\n // }\r\n // else {\r\n // filteredList = this._account.filter((fil: TAcList) => {\r\n // if (fil.ACNAME.toLowerCase().indexOf(keyword.toLowerCase()) != -1) {\r\n // return fil;\r\n // }\r\n // });\r\n // }\r\n // observer.next(filteredList);\r\n // }\r\n // else {\r\n // observer.next(this._account);\r\n // }\r\n\r\n // });\r\n // }\r\n // else {\r\n // if (keyword) {\r\n // let filteredList;\r\n // if (byacid == 0) {\r\n // filteredList = this._account.filter((fil: TAcList) => {\r\n // if (fil.ACCODE.toLowerCase().indexOf(keyword.toLowerCase()) != -1) {\r\n // return fil;\r\n // }\r\n // });\r\n // }\r\n // else {\r\n // filteredList = this._account.filter((fil: TAcList) => {\r\n // if (fil.ACNAME.toLowerCase().indexOf(keyword.toLowerCase()) != -1) {\r\n // return fil;\r\n // }\r\n // });\r\n // }\r\n // observer.next(filteredList);\r\n // }\r\n // else {\r\n // observer.next(this._account);\r\n // }\r\n // }\r\n // })\r\n // }\r\n /*public getAccoutFilteredAcidObs2(keyword: any) {\r\n return new Observable(observer => {\r\n if (this._account.length == 0) {\r\n this.http.get(this.apiUrl + '/getAccountList', this.getRequestOption())\r\n .flatMap(response => response.json() || []).subscribe(res => {\r\n this._account.push(res);\r\n if (keyword) {\r\n observer.next(this._account.filter((fil: TAcList) => fil.ACID.includes(keyword)));\r\n }\r\n else {\r\n observer.next(this._account);\r\n }\r\n\r\n });\r\n }\r\n else {\r\n if (keyword) {\r\n observer.next(this._account.filter((fil: TAcList) => fil.ACID.includes(keyword)));\r\n }\r\n else {\r\n observer.next(this._account);\r\n }\r\n }\r\n })\r\n }*/\r\n\r\n /*public getAccountFiltered5(keyword: any) {\r\n if (this._account.length == 0) {\r\n return this.http.get(this.apiUrl + '/getAccountList', this.getRequestOption())\r\n .flatMap(response => response.json() || [])\r\n .filter((fil: TAcList) => {\r\n return fil.ACNAME.includes(keyword);\r\n });\r\n\r\n\r\n } else {\r\n if (keyword) {\r\n var aclist = this._account.filter(ac => ac.ACNAME.includes(keyword))\r\n return Observable.of(aclist);\r\n }\r\n else {\r\n\r\n Observable.of(this._account);\r\n }\r\n }\r\n\r\n }*/\r\n\r\n public getMembershipList(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getMembershipList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n public getOccupationList(refresh: boolean = false) {\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getOccupationList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getDesignationList(refresh: boolean = false) {\r\n // console.log({ request: this._reqOption });\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getDesignationList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getMemberSchemeList(refresh: boolean = false) {\r\n // console.log({ request: this._reqOption });\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getMemberSchemeList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getSalesmanList(refresh: boolean = false) {\r\n //console.log({ request: this._reqOption });\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getSalesmanList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getSalesOfficerMaster(category,importertag){\r\n return this.http\r\n .get(this.apiUrl + `/getAllGeographicalHierarchyList?CATEGORY=${category}&IMPORTERTAG=${importertag}`, this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n getSalesOfficer(name) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/getSo/${name}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getProvinceWithSOCode(officerCode) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/getProvince/${officerCode}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getDistrictByProvince(province) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/getDistrict/${decodeURIComponent(province)}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getLocalLevelNamebyDistrict(district) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/getLocalLevelName/${district}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getWarNoByLocalLevelName(locallevelname) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/getWard/${locallevelname}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getRuralUrbanByLocalLevelName(locallevelname) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/getRuralUrban/${locallevelname}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public getContactDetailByURC(uniqueretailercode){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/getDataFromURC/${uniqueretailercode}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n\r\n public getSchemeGroupList(refresh: boolean = false) {\r\n // console.log({ request: this._reqOption });\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getSchemeGroupList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getSchemeList(refresh: boolean = false) {\r\n // console.log({ request: this._reqOption });\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getSchemeList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getJournalList(refresh: boolean = false) {\r\n // console.log({ request: this._reqOption });\r\n\r\n return this.http\r\n .get(this.apiUrl + \"/getJournalList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getProductGroupTree(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getProductGroupTree\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getACListTree(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getACListTree\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getUnits() {\r\n return this.http\r\n .get(this.apiUrl + \"/getUnits\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getMCatList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getMCatList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getMCat1List() {\r\n return this.http\r\n .get(this.apiUrl + \"/getMCat1List\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getRGroupList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getRGroupList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getWarehouseList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getWarehouseList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getunsalableWarehouseList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllUnsalableWarehouseList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n \r\n\r\n public getSettlementList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getSettlementList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n \r\n // public getCostCenterList(refresh: boolean = false) {\r\n // console.log({ request: this._reqOption });\r\n\r\n // return this.http.get(this.apiUrl + '/getAllCostCenterList', this.getRequestOption())\r\n // .flatMap(response => response.json() || [])\r\n // }\r\n public getPTypeList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getPType\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getItemGroupList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllItemGroupList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getKotCategoryList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getKotCategoryList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getBCodeDetails() {\r\n return this.http\r\n .get(this.apiUrl + \"/getBCodeDetails\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getBrandList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getBrandList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getMotherPack() {\r\n return this.http\r\n .get(this.apiUrl + \"/getMotherPackList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getModelList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getModelList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getSupplierListFromApi() {\r\n return this.http\r\n .get(this.apiUrl + \"/getSupplierList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getSupplierList() {\r\n return this.getAccount(\"masterrepo-supplierlist\").map((data: TAcList[]) => {\r\n let lst = data.filter(\r\n fil => fil.ACID.substr(0, 2) == \"PA\" && fil.PType == \"V\"\r\n );\r\n return lst;\r\n });\r\n }\r\n\r\n public getCustomers() {\r\n return this.getAccount(\"masterrepo-customerlist\").map((data: TAcList[]) => {\r\n let lst = data.filter(\r\n fil => fil.ACID.substr(0, 2) == \"PA\" && fil.PType == \"C\"\r\n );\r\n return lst;\r\n });\r\n }\r\n\r\n public getCusSup() {\r\n return this.getAccount(\"masterrepo-customerlist\").map((data: TAcList[]) => {\r\n let lst = data.filter(fil => fil.ACID.substr(0, 2) == \"PA\");\r\n return lst;\r\n });\r\n }\r\n\r\n public getCashList() {\r\n return this.getAccount(\"masterrepo-cashlist\").map((data: TAcList[]) => {\r\n let lst = data.filter(\r\n fil => fil.ACID.substr(0, 2) == \"AT\" && fil.MAPID == \"C\"\r\n );\r\n return lst;\r\n });\r\n }\r\n\r\n public getBankList() {\r\n return this.getAccount(\"masterrepo-banklist\").map((data: TAcList[]) => {\r\n let lst = data.filter(\r\n fil => fil.ACID.substr(0, 2) == \"AT\" && fil.MAPID == \"B\"\r\n );\r\n return lst;\r\n });\r\n }\r\n\r\n public getAcList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getAcList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n // public getCustomers() { return this.http.get(this.apiUrl + '/getCustomers', this.getRequestOption()).flatMap(response => response.json() || []); }\r\n // public getCashList() { return this.http.get(this.apiUrl + '/getCashList', this.getRequestOption()).flatMap(response => response.json() || []); }\r\n // public getBankList() { return this.http.get(this.apiUrl + '/getBankList', this.getRequestOption()).flatMap(response => response.json() || []); }\r\n public getPurchaseAcList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getPurchaseAcList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getSalesAcList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getSalesAcList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getCostCenterList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getCostCenterList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getSubLedgerList() {\r\n return new Observable((observer: Subscriber) => {\r\n if (this._subLedger.length == 0) {\r\n this.http\r\n .get(this.apiUrl + \"/getSubLedgerList\", this.getRequestOption())\r\n .flatMap(response => response.json() || [])\r\n .subscribe(\r\n res => {\r\n this._subLedger.push(res);\r\n },\r\n error => {\r\n observer.next([]);\r\n },\r\n () => {\r\n observer.next(this._subLedger);\r\n }\r\n );\r\n } else {\r\n observer.next(this._subLedger);\r\n }\r\n });\r\n }\r\n public getProductList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getProductList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getCashAndBankList() {\r\n return this.http\r\n .get(this.apiUrl + \"/getCashAndBankList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getTrnMainList(prefix: string) {\r\n return this.http\r\n .get(this.apiUrl + \"/getTrnMainList/\" + prefix, this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getCurrentDate() {\r\n let date: Subject = new Subject();\r\n this.http\r\n .get(this.apiUrl + \"/getCurrentDate\", this.getRequestOption())\r\n .subscribe(response => {\r\n date.next(response.json());\r\n date.unsubscribe();\r\n });\r\n return date;\r\n }\r\n getCurrentTimeUtc(): Observable {\r\n let date: Subject = new Subject();\r\n this.http\r\n .get('https://timeapi.io/api/Time/current/zone?timeZone=UTC', this.getRequestOption())\r\n .subscribe(response => {\r\n date.next(response.json());\r\n date.unsubscribe();\r\n });\r\n return date;\r\n }\r\n public getBarcodeWiseProductForTran(barcode: string) {\r\n return this.http\r\n .get(\r\n this.apiUrl + \"/getBarcodeWiseProductForTran/\" + barcode,\r\n this.getRequestOption()\r\n )\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getProductForTran(mcode: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getProductForTran\",\r\n { mcode: mcode },\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getAccountTreeObservable: Observable;\r\n\r\n public getacListTree() {\r\n if (this._accountTree.length > 0) {\r\n return Observable.of(this._accountTree);\r\n } else if (this.getAccountTreeObservable) {\r\n return this.getAccountTreeObservable;\r\n } else {\r\n this.getAccountTreeObservable = null;\r\n var atList: AcListTree[] = [];\r\n this.getAccountTreeObservable = this.http\r\n .get(this.apiUrl + \"/getAccountTree\", this.getRequestOption())\r\n .flatMap(res => {\r\n if (res.status == 400) {\r\n return Observable.of([]);\r\n } else if (res.status == 200) {\r\n return res.json() || [];\r\n }\r\n })\r\n .map(data => {\r\n this.getAccountTreeObservable = null;\r\n atList.push(data);\r\n this._accountTree = atList;\r\n return atList;\r\n })\r\n .share();\r\n return this.getAccountTreeObservable;\r\n }\r\n }\r\n\r\n getPartyTreeObservable: Observable;\r\n\r\n public getpartyListTree() {\r\n if (this._accountPartyTree.length > 0) {\r\n return Observable.of(this._accountPartyTree);\r\n } else if (this.getPartyTreeObservable) {\r\n return this.getPartyTreeObservable;\r\n } else {\r\n var apList: any[] = [];\r\n this.getPartyTreeObservable = this.http\r\n .get(this.apiUrl + \"/getPartyListTree\", this.getRequestOption())\r\n .flatMap(res => {\r\n if (res.status == 400) {\r\n return Observable.of([]);\r\n } else if (res.status == 200) {\r\n return res.json() || [];\r\n }\r\n })\r\n .map(data => {\r\n this.getPartyTreeObservable = null;\r\n apList.push(data);\r\n this._accountPartyTree = apList;\r\n return apList;\r\n })\r\n .share();\r\n return this.getPartyTreeObservable;\r\n }\r\n }\r\n getAllAccount(ACID: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to edit\");\r\n let bodyData = { mode: \"query\", data: { ACID: ACID } };\r\n this.http\r\n .post(this.apiUrl + \"/getAccount\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n AdditionalCostTrnTran: Trntran[] = [];\r\n public saveTransaction(mode: string, trnmain: any, extra: any = null) {\r\n try {\r\n var messageSubject: BehaviorSubject = new BehaviorSubject(\r\n \"Saving data Please wait a moment...\"\r\n );\r\n var message$: Observable = messageSubject.asObservable();\r\n let childDialogRef = this.dialog.open(MessageDialog, {\r\n hasBackdrop: true,\r\n data: { header: \"Information\", message: message$ }\r\n });\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {};\r\n if (extra == null) {\r\n bodyData = { mode: mode, data: trnmain, AdditionalCost: this.AdditionalCostTrnTran };\r\n } else {\r\n bodyData = { mode: mode, data: trnmain, extra: extra };\r\n }\r\n // console.log(\"CheckSavedData\",bodyData)\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveTransaction\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n var retData = data.json();\r\n if (retData.status == \"ok\") {\r\n messageSubject.next(\"Data Saved Successfully with VCHRNO = \" + retData.result2.VCHRNO);\r\n returnSubject.next(retData);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n }, 2000);\r\n this.AutoSync();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n messageSubject.next(res.result);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n returnSubject.next(res);\r\n }, 3000);\r\n }\r\n },\r\n error => {\r\n messageSubject.next(error.json());\r\n this.resolveError(error, \"savetransaction\");\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n returnSubject.next({ status: \"error\", result: error });\r\n }, 3000);\r\n }\r\n );\r\n return returnSubject;\r\n } catch (ex) {\r\n // console.log({ saveTransactionError: ex });\r\n //alert(ex);\r\n }\r\n }\r\n\r\n public saveStockSettlement(mode: string, trnmain: any, extra: any = null) {\r\n try {\r\n var messageSubject: BehaviorSubject = new BehaviorSubject(\r\n \"Saving data Please wait a moment...\"\r\n );\r\n var message$: Observable = messageSubject.asObservable();\r\n let childDialogRef = this.dialog.open(MessageDialog, {\r\n hasBackdrop: true,\r\n data: { header: \"Information\", message: message$ }\r\n });\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {};\r\n if (extra == null) {\r\n bodyData = { mode: mode, data: trnmain };\r\n } else {\r\n bodyData = { mode: mode, data: trnmain, extra: extra };\r\n }\r\n\r\n // console.log(\"savesalesinvoice\", bodyData);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveStockSettlement\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n messageSubject.next(\"Data Saved Successfully\");\r\n returnSubject.next(retData);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n }, 1000);\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n messageSubject.next(res.result);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n returnSubject.next(res);\r\n }, 3000);\r\n }\r\n },\r\n error => {\r\n messageSubject.next(error.json());\r\n this.resolveError(error, \"saveStockSettlement\");\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n returnSubject.next({ status: \"error\", result: error });\r\n }, 3000);\r\n }\r\n );\r\n return returnSubject;\r\n } catch (ex) {\r\n // console.log({ saveTransactionError: ex });\r\n //alert(ex);\r\n }\r\n }\r\n\r\n public saveStockSettlementApproval(mode: string, trnmain: any, extra: any = null) {\r\n try {\r\n var messageSubject: BehaviorSubject = new BehaviorSubject(\r\n \"Saving data Please wait a moment...\"\r\n );\r\n var message$: Observable = messageSubject.asObservable();\r\n let childDialogRef = this.dialog.open(MessageDialog, {\r\n hasBackdrop: true,\r\n data: { header: \"Information\", message: message$ }\r\n });\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {};\r\n if (extra == null) {\r\n bodyData = { mode: mode, data: trnmain };\r\n } else {\r\n bodyData = { mode: mode, data: trnmain, extra: extra };\r\n }\r\n // console.log(\"Stock Settlement Data\" + JSON.stringify(bodyData));\r\n // console.log(\"savesalesinvoice\", bodyData);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveApprovalStockSettlement\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n messageSubject.next(\"Data Saved Successfully\");\r\n returnSubject.next(retData);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n }, 1000);\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n messageSubject.next(res.result);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n returnSubject.next(res);\r\n }, 3000);\r\n }\r\n },\r\n error => {\r\n messageSubject.next(error.json());\r\n this.resolveError(error, \"saveStockSettlement\");\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n returnSubject.next({ status: \"error\", result: error });\r\n }, 3000);\r\n }\r\n );\r\n return returnSubject;\r\n } catch (ex) {\r\n // console.log({ saveTransactionError: ex });\r\n //alert(ex);\r\n }\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n public saveUnit(mode: string, trnmain: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: trnmain };\r\n this.http\r\n .post(this.apiUrl + \"/saveUnit\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n }\r\n },\r\n error => {\r\n var er = error.json();\r\n // console.log(er);\r\n // res.status = \"error2\", res.result = error;\r\n // console.log(res);\r\n returnSubject.next(er);\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public saveChanel(mode: string, trnmain: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: trnmain };\r\n // console.log(\"chanel data\" + JSON.stringify(bodyData));\r\n this.http\r\n .post(this.apiUrl + \"/saveChanel\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n }\r\n },\r\n error => {\r\n var er = error.json();\r\n // console.log(er);\r\n // res.status = \"error2\", res.result = error;\r\n // console.log(res);\r\n returnSubject.next(er);\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public saveSalesTerminal(mode: string, salesTerminal: any, cpList: any[]) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {\r\n mode: mode,\r\n data: salesTerminal,\r\n CounterProductList: cpList\r\n };\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveSalesTerminal\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveClaimType(mode: string, claimType: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: claimType };\r\n this.http\r\n .post(this.apiUrl + \"/saveClaimType\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveWarehouse(mode: string, warehouse: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: warehouse };\r\n this.http\r\n .post(this.apiUrl + \"/saveWarehouse\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveOrganizationHierarchy(mode: string, warehouse: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: warehouse };\r\n // console.log(\"OrganizationHierarchy\" + JSON.stringify(bodyData));\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveOrganizationHierarchy\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public saveSalesManType(mode: string, salesmanType: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: salesmanType };\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveSalesmanType\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public saveSalesman(mode: string, salesman: any,RouteList:any[]=[]) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: salesman,dataList:RouteList };\r\n // console.log(\"Sales man \" + bodyData);\r\n this.http\r\n .post(this.apiUrl + \"/saveSalesman\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public savePType(mode: string, salesman: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: salesman };\r\n this.http\r\n .post(this.apiUrl + \"/savePType\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveProduct(\r\n mode: string,\r\n prodObj: any,\r\n RGLIST: any[],\r\n AlternateUnits: any[],\r\n PBarCodeCollection: any[],\r\n BrandModelList: any[]\r\n ) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {\r\n mode: mode,\r\n data: {\r\n product: prodObj,\r\n rglist: RGLIST,\r\n alternateunits: AlternateUnits,\r\n bcodeList: PBarCodeCollection,\r\n bmList: BrandModelList\r\n }\r\n };\r\n // console.log(\"product json\");\r\n var data = JSON.stringify(bodyData, undefined, 2);\r\n // console.log(data);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveProductMaster\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveMembership(mode: string, membership: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: membership };\r\n this.http\r\n .post(this.apiUrl + \"/saveMembership\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveDivision(mode: string, division: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: division };\r\n this.http\r\n .post(this.apiUrl + \"/saveDivision\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveCostCenter(mode: string, costCenter: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: costCenter };\r\n this.http\r\n .post(this.apiUrl + \"/saveCostCenter\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public loadCompany() {\r\n return new Observable((observer: Subscriber) => {\r\n let res = { status: \"error\", result: \"\" };\r\n this.http\r\n .get(this.apiUrl + \"/loadCompanyInfo\", this.getRequestOption())\r\n .map(ret => ret.json())\r\n .subscribe(\r\n data => { \r\n observer.next(data.result);\r\n },\r\n error => {\r\n let ret = this.resolveError(error, \"loadcompany\");\r\n if (ret == \"Login resolved\") {\r\n this.loadCompany();\r\n return;\r\n }\r\n observer.next(null);\r\n observer.complete();\r\n }\r\n );\r\n });\r\n }\r\n public saveCompany(mode: string, costCenter: any) {\r\n var messageSubject: BehaviorSubject = new BehaviorSubject(\r\n \"Saving data Please wait a moment...\"\r\n );\r\n var message$: Observable = messageSubject.asObservable();\r\n let childDialogRef = this.dialog.open(MessageDialog, {\r\n hasBackdrop: true,\r\n data: { header: \"Information\", message: message$ }\r\n });\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: costCenter };\r\n // console.log(\"Check\", bodyData)\r\n this.http\r\n .post(this.apiUrl + \"/saveCompanyInfo\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n messageSubject.next(\"Data saved successfully\");\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n }, 1000);\r\n\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n messageSubject.next(res.result);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n }, 1000);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n let ret = this.resolveError(error, \"savecompany\");\r\n messageSubject.next(ret);\r\n setTimeout(() => {\r\n childDialogRef.close();\r\n }, 3000);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveCategory(mode: string, category: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: category };\r\n this.http\r\n .post(this.apiUrl + \"/saveCategory\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveAccount(mode: string, Account: any, SOLIST: any[] = [],IsDuplicateVATSave:boolean) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: Account, SOList: SOLIST,IsDuplicateVATSave: IsDuplicateVATSave};\r\n // console.log(\"serviceData--\" + JSON.stringify(bodyData));\r\n this.http\r\n .post(this.apiUrl + \"/saveAccount\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n //to load the vouher in trnmain. this is common function to load voucher\r\n public LoadTransaction(vchrno: string, division: string, phiscalID: string,settlementMode ='') {\r\n let bodyData = { VCHRNO: vchrno, DIVISION: division, PHISCALID: phiscalID,SETTLEMENTMODE:settlementMode};\r\n // console.log({ bodydata: bodyData });\r\n return this.http\r\n .post(this.apiUrl + \"/getViewVoucher\", bodyData, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n public checkCustomerTypeForBillCancel(customerName:string, customerID:string ){\r\n let bodyData = {BILLTO:customerName, PARAC:customerID }\r\n return this.http\r\n .post(this.apiUrl + \"/getCustomerTypeForBillCancel\", bodyData, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n public LoadApprovedSalesReturn(vchrno: string, division: string, phiscalID: string) {\r\n let bodyData = { VCHRNO: vchrno, DIVISION: division, PHISCALID: phiscalID };\r\n // console.log({ bodydata: bodyData });\r\n return this.http\r\n .post(this.apiUrl + \"/getApprovedSalesReturnForView\", bodyData, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n\r\n\r\n\r\n public LoadSalesReturnForSoApproval(vchrno: string, division: string, phiscalID: string) {\r\n let bodyData = { VCHRNO: vchrno, DIVISION: division, PHISCALID: phiscalID };\r\n // console.log({ bodydata: bodyData });\r\n return this.http\r\n .post(this.apiUrl + \"/getSalesReturnDataApproval\", bodyData, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n\r\n public getInvoiceData(prntobj:any) {\r\n // console.log(\"CheckDataPrint1\",prntobj)\r\n let bodyData = { VCHRNO: prntobj.vchrno, DIVISION: prntobj.division, PHISCALID: prntobj.phiscalid,TRNUSER:prntobj.parac };\r\n // console.log(\"CheckDataPrint2\",bodyData)\r\n return this.http\r\n .post(this.apiUrl + \"/getInvoiceData\", bodyData, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n public getReprintData(vchrno: string, division: string, phiscalID: string, trnUser: string) {\r\n // let bodyData = { VCHRNO: vchrno, DIVISION: division, PHISCALID: phiscalID,TRNUSER:trnUser };\r\n // console.log(vchrno, division, phiscalID,trnUser );\r\n return this.http\r\n .get(this.apiUrl + `/getReprintData?VCHRNO=${vchrno}&DIVISION=${division}&PHISCALID=${phiscalID}&TRNUSER=${trnUser}`, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n //Save Print Log of Tax Invoice\r\n public savePrintLog(vchrno: string, division: string, phiscalID: string, trnUser: string) {\r\n //let bodyData = { VCHRNO: vchrno, DIVISION: division, PHISCALID: phiscalID,TRNUSER:trnUser };\r\n // console.log(\"xyz\",vchrno, division, phiscalID,trnUser );\r\n return this.http\r\n .get(this.apiUrl + `/savePrintLog?VCHRNO=${vchrno}&DIVISION=${division}&PHISCALID=${phiscalID}&TRNUSER=${trnUser}`, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n //Title for Tax Invoice\r\n public getPrintTitle(vchrno: string, division: string, phiscalID: string, trnUser: string) {\r\n return this.http\r\n .get(this.apiUrl + `/getPrintInvoiceTitle?VCHRNO=${vchrno}&DIVISION=${division}&PHISCALID=${phiscalID}&TRNUSER=${trnUser}`, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n //Title ffor other print invoices except Tax Invoice\r\n public getPrintTitleAsCopy(vchrno: string, division: string, phiscalID: string, trnUser: string) {\r\n return this.http\r\n .get(this.apiUrl + `/getPrintInvoiceTitleAsCopy?VCHRNO=${vchrno}&DIVISION=${division}&PHISCALID=${phiscalID}&TRNUSER=${trnUser}`, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n\r\n public LoadStockSettlement(vchrno: string) {\r\n let bodyData = { VCHRNO: vchrno };\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getStockSettlement\", bodyData, this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n\r\n\r\n }\r\n\r\n\r\n\r\n\r\n public getPrefixVname(vtype: VoucherTypeEnum) {\r\n if (vtype == 14) {\r\n return \"TI\";\r\n }\r\n switch (vtype) {\r\n case 12:\r\n return \"JV\";\r\n case 17:\r\n return \"PV\";\r\n case 18:\r\n return \"RV\";\r\n case 3:\r\n return \"PI\";\r\n case 1:\r\n return \"SI\";\r\n case 14: \r\n return \"TI\";\r\n case 5:\r\n return \"IS\";\r\n case 15:\r\n return \"CN\";\r\n case 16:\r\n return \"DN\";\r\n case 7:\r\n return \"TR\";\r\n case 8:\r\n return \"TO\";\r\n case 13:\r\n return \"DL\";\r\n case 2:\r\n return \"SR\";\r\n case 21:\r\n return \"DR\";\r\n case 9:\r\n return \"DM\";\r\n default:\r\n return \"00\";\r\n }\r\n }\r\n\r\n public checkUserValid() {\r\n return new Observable((observer: Subscriber) => {\r\n this.http\r\n .get(this.apiUrl + \"/checkLogin\", this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n this.state.setGlobalSetting(\"LoggedIn\", [\"true\"]);\r\n observer.next(true);\r\n observer.complete();\r\n },\r\n Error => {\r\n // console.log({ checkUserValid: false });\r\n observer.next(false);\r\n observer.complete();\r\n },\r\n () => {\r\n observer.complete();\r\n }\r\n );\r\n });\r\n }\r\n\r\n public IsLoginDialogOpened: boolean = false;\r\n public resolveError(error: any, callFrom: string) {\r\n // console.log({ callfrom: callFrom, Error: error });\r\n try {\r\n let dialogResult;\r\n if (error.statusText == \"Unauthorized\") {\r\n if (this.IsLoginDialogOpened == true) {\r\n return;\r\n }\r\n this.IsLoginDialogOpened = true;\r\n let dialogRef = this.dialog.open(LoginDialog, { disableClose: true });\r\n dialogRef.afterClosed().subscribe(result => {\r\n this.IsLoginDialogOpened = false;\r\n });\r\n return null;\r\n }\r\n let err = error;\r\n // console.log({ errorconvert: err });\r\n if (\r\n err &&\r\n err == \"The ConnectionString property has not been initialized.\"\r\n ) {\r\n if (this.IsLoginDialogOpened == true) {\r\n return;\r\n }\r\n this.IsLoginDialogOpened = true;\r\n let dialogRef = this.dialog.open(LoginDialog, { disableClose: true });\r\n dialogRef.afterClosed().subscribe(result => {\r\n this.IsLoginDialogOpened = false;\r\n });\r\n return null;\r\n }\r\n // console.log(error);\r\n return err;\r\n } catch (ex) {\r\n // console.log({ callfrom: callFrom, catchError: ex });\r\n }\r\n }\r\n\r\n public saveClientTerminal(mode: string, value: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: value };\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveClientTerminal\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getSingleObject(postData, postUrl: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let bodyData = { mode: \"query\", data: postData };\r\n this.http\r\n .post(this.apiUrl + postUrl, bodyData, this.getRequestOption())\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public getList(data, url) {\r\n // console.log({ getlist: data });\r\n return this.http\r\n .post(this.apiUrl + url, data, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n }\r\n public getSalesModeList(postobj) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to edit\");\r\n let bodyData = postobj;\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getSalesModeList\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n private _receipeitemList: any[] = [];\r\n public _receipeitemListObservable$: Observable;\r\n public getReceipeItemList(refreshFromDatabase: boolean = false) {\r\n try {\r\n if (this._receipeitemList.length > 0 && refreshFromDatabase == false) {\r\n return Observable.of(this._receipeitemList);\r\n } else if (\r\n this._receipeitemListObservable$ &&\r\n refreshFromDatabase == false\r\n ) {\r\n return this._receipeitemListObservable$;\r\n } else {\r\n // console.log(\"from databse\");\r\n this._receipeitemListObservable$ = null;\r\n this._receipeitemList = [];\r\n this._receipeitemListObservable$ = this.http\r\n .post(\r\n this.apiUrl + \"/getReceipeItemList\",\r\n { EDATE: this._lastProductChangeDateLocal },\r\n this.getRequestOption()\r\n )\r\n .flatMap(res => res.json() || [])\r\n .map(data => {\r\n this._receipeitemList.push(data);\r\n return this._receipeitemList;\r\n })\r\n .share();\r\n return this._receipeitemListObservable$;\r\n }\r\n } catch (ex) {\r\n // console.log({ getReceipelistError: ex });\r\n }\r\n }\r\n public saveObject(mode: string, value: any, url: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: value };\r\n this.http\r\n .post(this.apiUrl + url, bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getParentWiseProduct(MCODE: string) {\r\n alert(\"MCODE\" + MCODE);\r\n return this.http\r\n .get(\r\n this.apiUrl + \"/getParentWiseProduct/\" + MCODE,\r\n this.getRequestOption()\r\n )\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getTreeForSchemeDiscount_MGroup() {\r\n return this.http\r\n .get(\r\n this.apiUrl + \"/getTreeForSchemeDiscount_MGroup\",\r\n this.getRequestOption()\r\n )\r\n .flatMap(response => response.json() || []);\r\n }\r\n public getTreeForSchemeDiscount_Parent() {\r\n return this.http\r\n .get(\r\n this.apiUrl + \"/getTreeForSchemeDiscount_Parent\",\r\n this.getRequestOption()\r\n )\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public saveschedule(mode: string, Account: any) {\r\n // console.log(\"AccountTT\", mode);\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\");\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: Account };\r\n this.http\r\n .post(this.apiUrl + \"/saveschedule\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public getAllSchedule() {\r\n return this.http\r\n .get(this.apiUrl + \"/getSchedule\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n public saveScheme(\r\n mode: string,\r\n Account: any[],\r\n Flag,\r\n data: any,\r\n rangeList: any[]\r\n ) {\r\n // console.log(\"SCHEM@\", Account);\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\");\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {\r\n mode: mode,\r\n data: data,\r\n dataList: Account,\r\n flag: Flag,\r\n dataRange: rangeList\r\n };\r\n // console.log({ SchemeJson: bodyData });\r\n this.http\r\n .post(this.apiUrl + \"/schemeSave\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public saveComboList(comboList: any[]) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\");\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { data: comboList };\r\n this.http\r\n .post(this.apiUrl + \"/saveComboList\", comboList, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getSelectedComboList(Initial: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to edit\");\r\n let bodyData = { mode: \"query\", data: { DisID: Initial } };\r\n alert(\"getSelectedComboList\");\r\n this.http\r\n .post(\r\n this.apiUrl + \"/GETSelectedComboList\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n getAllSchemeList(Initial: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to edit\");\r\n let bodyData = { mode: \"query\", data: { DisID: Initial } };\r\n this.http\r\n .post(\r\n this.apiUrl + \"/GetAllSchemeList\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n public getAllScheme() {\r\n return this.http\r\n .get(this.apiUrl + \"/GetAllScheme\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n getParentWiseProductforScheme(MCODE: string) {\r\n return this.http\r\n .get(\r\n this.apiUrl + \"/getParentWiseProductforScheme/\" + MCODE,\r\n this.getRequestOption()\r\n )\r\n .flatMap(response => response.json() || []);\r\n }\r\n private _comboList: any[] = [];\r\n public _ComboListObservable$: Observable;\r\n public getComboList() {\r\n try {\r\n if (this._comboList.length > 0) {\r\n return Observable.of(this._comboList);\r\n } else if (this._ComboListObservable$) {\r\n return this._ComboListObservable$;\r\n } else {\r\n this._ComboListObservable$ = null;\r\n this._ComboListObservable$ = this.http\r\n .post(\r\n this.apiUrl + \"/GETcombolist\",\r\n { EDATE: this._lastProductChangeDateLocal },\r\n this.getRequestOption()\r\n )\r\n .flatMap(res => res.json() || [])\r\n .map(data => {\r\n this._comboList.push(data);\r\n return this._comboList;\r\n })\r\n .share();\r\n return this._ComboListObservable$;\r\n }\r\n } catch (ex) {\r\n // console.log({ getReceipelistError: ex });\r\n }\r\n }\r\n\r\n getComboIdWise(CID: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnItemSubject: Subject = new Subject();\r\n // console.log(\"CIDIDI\", CID);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getItemfromComboId\",\r\n { CID: CID },\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n } else {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnItemSubject.next(res);\r\n returnItemSubject.unsubscribe();\r\n }\r\n );\r\n return returnItemSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n getWarehouseWiseCounterProduct(value) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getWarehouseWiseCounterProduct\",\r\n value,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n checkConsumptionDate(a: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnItemSubject: Subject = new Subject();\r\n // console.log(\"CIDIDI\", a);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/checkConsumptionEntryDate\",\r\n { CID: a },\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n } else {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnItemSubject.next(res);\r\n returnItemSubject.unsubscribe();\r\n }\r\n );\r\n return returnItemSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n\r\n // List\r\n getConsumptionList(a: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnItemSubject: Subject = new Subject();\r\n // console.log(\"CIDIDI\", a);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getConsumptionEntryList\",\r\n { CID: a },\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n } else {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnItemSubject.next(res);\r\n returnItemSubject.unsubscribe();\r\n }\r\n );\r\n return returnItemSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n public SaveConsumptionEntry(mode: string, List: any[], TRN: any) {\r\n // console.log(\"SCHEM@\", List);\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\");\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: List, data2: TRN };\r\n // console.log({ SchemeJson: bodyData });\r\n this.http\r\n .post(this.apiUrl + \"/saveConsumption\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n //Table\r\n public getAllConsumption() {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllConsumption\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n // private _AllConsumptionList: any[] = [];\r\n // public _AlllConsumptionListObservable$: Observable;\r\n // public getAllConsumption() {\r\n // alert(\"reached\")\r\n // try {\r\n // if (this._AllConsumptionList.length > 0) {\r\n // return Observable.of(this._AllConsumptionList);\r\n // }\r\n // else if (this._AlllConsumptionListObservable$) {\r\n\r\n // return this._AlllConsumptionListObservable$;\r\n // }\r\n // else {\r\n // this._AlllConsumptionListObservable$ = null;\r\n // alert(\"reached2\")\r\n // this._AlllConsumptionListObservable$ = this.http.post(this.apiUrl + '/getAllConsumption', this.getRequestOption())\r\n // .flatMap(res => res.json() || [])\r\n // .map(data => {\r\n // this._AllConsumptionList.push(data)\r\n // return this._AllConsumptionList;\r\n // })\r\n // .share();\r\n // return this._AlllConsumptionListObservable$;\r\n // }\r\n\r\n // }\r\n // catch (ex) {\r\n // console.log({ getReceipelistError: ex });\r\n // }\r\n // }\r\n\r\n getConsumptionFromID(CID: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnItemSubject: Subject = new Subject();\r\n // console.log(\"CIDIDI\", CID);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getConsumptionFromID\",\r\n { CID: CID },\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n } else {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnItemSubject.next(res);\r\n returnItemSubject.unsubscribe();\r\n }\r\n );\r\n return returnItemSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n getAllMcodeNAME() {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllMcodeNAME\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n getAllSettlement() {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllSettlement\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n getSettlementMode() {\r\n return this.http\r\n .get(this.apiUrl + \"/getSettlementMode\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n getStockSettlementFromID(CID: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnItemSubject: Subject = new Subject();\r\n // console.log(\"CIDIDI\", CID);\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getStockSettlementFromID\",\r\n { CID: CID },\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n } else {\r\n returnItemSubject.next(data);\r\n returnItemSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnItemSubject.next(res);\r\n returnItemSubject.unsubscribe();\r\n }\r\n );\r\n return returnItemSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n\r\n public saveBatch(value: any, url: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { data: value };\r\n this.http\r\n .post(this.apiUrl + url, bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getExcelReport(reportData:any){\r\n\r\n const type = 'application/vnd.ms-excel';\r\n const options = new RequestOptions({\r\n responseType: ResponseContentType.Blob,\r\n headers: new Headers({ 'Accept': type,\r\n Authorization: this.authService.getAuth().token\r\n })\r\n });\r\n \r\n return this.http\r\n .post(this.apiUrl + `/loadExcelReports/`,reportData, options,)\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }),\r\n filename: `${reportData.reportname}.xlsx`\r\n };\r\n return data;\r\n });\r\n\r\n }\r\n\r\n\r\n\r\n\r\n // DownLoadAllExcelReportPreparedFromAPI(reportData:any){\r\n\r\n // const type = 'application/vnd.ms-excel';\r\n // const options = new RequestOptions({\r\n // responseType: ResponseContentType.Blob,\r\n // headers: new Headers({ 'Accept': type,\r\n // Authorization: this.authService.getAuth().token\r\n // })\r\n // });\r\n // let reportdownloadname = reportData.REPORTDISPLAYNAME?reportData.REPORTDISPLAYNAME:reportData.reportname;\r\n // return this.http\r\n // .post(this.apiUrl + `/downLoadAllReportExcel`,reportData, options,)\r\n // .map((response: Response) => {\r\n // let data = {\r\n // content: new Blob([(response)._body], {\r\n // type: response.headers.get(\"Content-Type\")\r\n // }),\r\n // filename: `${reportdownloadname}.xlsx`\r\n // };\r\n // return data;\r\n // });\r\n\r\n // }\r\n DownLoadAllExcelReportPreparedFromAPI(reportData: any) {\r\nconsole.log(reportData)\r\n const type = 'application/vnd.ms-excel';\r\n if (reportData.extension == \"xlsx\") {\r\n const type = 'application/vnd.ms-excel';\r\n }\r\n else if (reportData.extension == \"zip\") {\r\n const type = 'application/zip';\r\n }\r\n\r\n const options = new RequestOptions({\r\n responseType: ResponseContentType.Blob,\r\n headers: new Headers({\r\n 'Accept': type,\r\n Authorization: this.authService.getAuth().token\r\n })\r\n });\r\n let reportdownloadname = reportData.REPORTDISPLAYNAME ? reportData.REPORTDISPLAYNAME : reportData.reportname;\r\n return this.http\r\n .post(this.apiUrl + `/downLoadAllReportExcel`, reportData, options,)\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }),\r\n filename: `${reportdownloadname}.${reportData.extension}`\r\n };\r\n return data;\r\n });\r\n\r\n }\r\n\r\n getPricingForExport(fileName:any){\r\n\r\n const type = 'application/vnd.ms-excel';\r\n const options = new RequestOptions({\r\n responseType: ResponseContentType.Blob,\r\n headers: new Headers({ 'Accept': type,\r\n Authorization: this.authService.getAuth().token\r\n })\r\n });\r\n // let opt = this.getRequestOption();\r\n // let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n // let op: RequestOptions = new RequestOptions();\r\n return this.http\r\n .post(this.apiUrl + `/getPricing`, fileName,options)\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }),\r\n filename: fileName.reportname+`.xlsx`\r\n };\r\n \r\n return data;\r\n });\r\n\r\n }\r\n\r\n\r\n \r\n getExcelFile(url:any,fileName:any){\r\n const type = 'application/vnd.ms-excel';\r\n const options = new RequestOptions({\r\n responseType: ResponseContentType.Blob,\r\n headers: new Headers({ 'Accept': type,\r\n Authorization: this.authService.getAuth().token\r\n })\r\n });\r\n // let opt = this.getRequestOption();\r\n // let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n // let op: RequestOptions = new RequestOptions();\r\n return this.http\r\n .post(this.apiUrl +url,fileName, options)\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }),\r\n filename: fileName.reportname+`.xlsx`\r\n };\r\n return data;\r\n });\r\n }\r\n\r\n downloadFile(response: any) {\r\n const element = document.createElement(\"a\");\r\n element.href = URL.createObjectURL(response.content);\r\n element.download = response.filename;\r\n document.body.appendChild(element);\r\n element.click();\r\n }\r\n\r\n\r\n\r\n\r\n \r\n getReportData(dataToSave, postUrl) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n\r\n this.http\r\n .post(this.apiUrl + postUrl, dataToSave, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n //Additional Cost Service\r\n saveAdditionalCost(saveObj: any): any {\r\n let res = { status: \"error\", result: \"\" };\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { saveObj };\r\n alert(\"masterService!!\" + JSON.stringify(bodyData));\r\n this.http\r\n .post(\r\n this.apiUrl + \"/saveAdditionalCost\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(res => {\r\n // console.log(\"ok\" + res);\r\n // console.log(\"ok\" + JSON.stringify(res));\r\n });\r\n }\r\n\r\n //Additional Cost Service Ends\r\n\r\n batchValidation(batch){ \r\n let batchCode = batch.substring(1,4);\r\n var item = +batchCode;\r\n if(isNaN(item)){\r\n this.alterService.info(\"Given number is not number type\");\r\n return false;\r\n }\r\n if(batchCode<0 || batchCode>366){\r\n this.alterService.info(\"Invalid Batch Code\"); \r\n return false;\r\n }\r\n \r\n }\r\n\r\n masterGetmethod(geturl) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n this.http.get(this.apiUrl + geturl, this.getRequestOption()).subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n masterPostmethod(posturl, data) {\r\n let res = { status: \"error\", result: \"\", result2: \"\", message: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n\r\n this.http\r\n .post(this.apiUrl + posturl, data, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n res.result2 = retData.result2;\r\n res.message = retData.message;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n showmessagedialog(message) {\r\n let dialogRef = this.dialog.open(MessageDialog, message);\r\n setTimeout(() => {\r\n this.dialog.closeAll();\r\n }, 5000);\r\n }\r\n public getAllBranch(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllBranchList\", this.getRequestOption())\r\n .flatMap(response => response.json() || []);\r\n }\r\n\r\n public getAllChanel(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllChanelList\", this.getRequestOption())\r\n .map(response => response.json() || []);\r\n }\r\n public getAllSalesHierarchyParent(refresh: boolean = false) {\r\n return this.http\r\n .get(\r\n this.apiUrl + \"/getAllSalesHierarchyParentList\",\r\n this.getRequestOption()\r\n )\r\n .map(response => response.json() || []);\r\n }\r\n\r\n public getAllProductHierarchyParent(refresh: boolean = false) {\r\n return this.http\r\n .get(\r\n this.apiUrl + \"/getAllProductHierarchyParentList\",\r\n this.getRequestOption()\r\n )\r\n .map(response => response.json() || []);\r\n }\r\n public getAllChannelParent(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllChanelParentList\", this.getRequestOption())\r\n .map(response => response.json() || []);\r\n }\r\n public getAllProductCategoryLine(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getProdcutCategoryLineList\", this.getRequestOption())\r\n .map(response => response.json() || []);\r\n }\r\n public getAllRouteMasterName(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getAllRouteMasterList\", this.getRequestOption())\r\n .map(response => response.json() || []);\r\n }\r\n\r\n public getAllDivisionList(refresh: boolean = false) {\r\n return this.http\r\n .get(this.apiUrl + \"/getDivisionList\", this.getRequestOption())\r\n .map(response => response.json() || []);\r\n }\r\n\r\n\r\n\r\n\r\n getitemfromMenuCat(MENUCAT: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to edit\");\r\n let bodyData = { mode: \"query\", data: { MCAT: MENUCAT } };\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getitemfromMenuCat\",\r\n bodyData,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n /* return this.http.get(\"/rategroups.json\").toPromise()\r\n .then((res) => res.json());*/\r\n }\r\n getStockList() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n this.apiUrl + \"/getStock/\" + this._lastProductStockCheckDateLocal,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n // this._lastProductStockCheckDateLocal=new Date();\r\n // this.getCurrentDate().subscribe(date => {\r\n // this.authService.setSessionVariable(\"LastProductStockCheckDateLocal\",date.Date); }, error => {\r\n // console.log({ errorGetCurrentDate: error });\r\n\r\n\r\n // });\r\n\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getPCL() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + \"/getPCL\", this.getRequestOption()).subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n getExpiringPerformaVoucher() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + \"/getExpiringPerformaVoucher\", this.getRequestOption()).subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getAllExpiredPerformaBill() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + \"/getAllExpiredPerformaBill\", this.getRequestOption()).subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n\r\n loadSalesInvoiceFromSalesOrder(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/GetSODetailForSaleInvoice?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n loadSalesInvoiceFromSupplierHO(voucerNo: string,FROMCOMPANYID:string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/getHOTaxInvoiceDetail?voucherNo=${voucerNo}&fromcompanyid=${FROMCOMPANYID}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n loadSAPPurchaseInvoiceDetail(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/getSAPPurchaseInvoiceDetail?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n\r\n loadHoPerformaInvoice(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/getHOPerformaInvoice?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n rejectPerformaInvoice(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/RejectHOPerformaInvoice?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n loadHoPurchaseOrder(voucerNo: string, FromCompanyid: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/getHOPurchaseOrder?voucherNo=${voucerNo}&fromcompanyid=${FromCompanyid}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n // console.log(\"errorws\", error);\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n loadPurchaseOrderForPOCancel(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/getPurchaseOrderForPOCancel?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public getAllSalesManTypeList(refresh: boolean = false) {\r\n return this.http.get(this.apiUrl + '/getAllSalesmanTypeList', this.getRequestOption())\r\n .map(response => response.json() || [])\r\n }\r\n\r\n approvePerformaInvoice(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/ApproveHOPerformaInvoice?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n approveStockSettlement(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/saveTransaction?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n\r\n TenderTypes() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/GetTenderTypes', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public getAllExcelImportMasterList(refresh: boolean = false) {\r\n return this.http.get(this.apiUrl + '/getExcelConfigMasterList', this.getRequestOption())\r\n .map(response => response.json() || [])\r\n }\r\n\r\n getState() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getStates', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n GETTRNTYPE() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getTrnType', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getGenericGridPopUpSettings(VoucherPrefix,tag:string='') {\r\n\r\n if (VoucherPrefix == \"PP\") {\r\n return {\r\n title: \"Proforma Invoice\",\r\n apiEndpoints: `/getTrnMainPagedList/${VoucherPrefix}/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'PERFORMA NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'PARAC',\r\n title: 'CUSTOMER',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n // {\r\n // key: 'TRNMODE',\r\n // title: 'TYPE',\r\n // hidden: false,\r\n // noSearch: false\r\n // },\r\n ]\r\n };\r\n }\r\n if (VoucherPrefix == \"SO\") {\r\n return {\r\n title: \"Sales Orders\",\r\n apiEndpoints: `/getTrnMainPagedList/${VoucherPrefix}/tag`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'SONO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n }\r\n if (VoucherPrefix == \"PO\") {\r\n return {\r\n title: \"Purchase Orders\",\r\n apiEndpoints: `/getTrnMainPagedList/${VoucherPrefix}/tag`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'PONO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n\r\n }\r\n\r\n if (VoucherPrefix == \"PI\" || VoucherPrefix == \"IS\") {\r\n return {\r\n title: \"Purchase Invoices\",\r\n apiEndpoints: `/getTrnMainPagedList/${VoucherPrefix}/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'REFBILL',\r\n title: 'REFBILL.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'VCHRNO',\r\n title: 'GRNNO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n\r\n if (VoucherPrefix == \"REFBILLFORSTOCKTRANSFERAPPROVAL\") {\r\n return {\r\n title: \"Approval Invoices\",\r\n apiEndpoints: `/getRefBillForStockTransferApproval`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'GRNNO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n if (VoucherPrefix == \"BilledCustomerList\") { \r\n return {\r\n title: \"Customers\",\r\n apiEndpoints: `/getBilledCustomerPagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"customerID\",\r\n title: \"CODE\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"EMAIL\",\r\n title: \"EMAIL\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n\r\n if (VoucherPrefix == \"REFBILLOFSALESRETURN\") {\r\n return {\r\n title: \"Bill Details\",\r\n apiEndpoints: `/getTrnMainPagedList/TI/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'INVOICETYPE',\r\n title: 'INVOICE TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n }\r\n if (VoucherPrefix == \"REFBILLOFPURCHASERETURN\") {\r\n return {\r\n title: \"Bill Details\",\r\n apiEndpoints: `/getTrnMainPagedList/PI/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REFBILL',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n\r\n if (VoucherPrefix == \"REFBILLOFOPENINGSTOCK\") {\r\n return {\r\n title: \"Bill Details\",\r\n apiEndpoints: `/getTrnMainPagedList/OP/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n\r\n\r\n if (VoucherPrefix == \"itemlist\") {\r\n return {\r\n title: \"Sales Orders\",\r\n apiEndpoints: `/getTrnMainPagedList/${VoucherPrefix}/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'SONO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n }\r\n if (VoucherPrefix == \"HOLDBILLLIST\") {\r\n return {\r\n title: \"Hold Bills\",\r\n apiEndpoints: `/recallallholdbill`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'ACNAME',\r\n title: 'Customer',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'SNO',\r\n title: 'Bill No',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'DATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ,\r\n {\r\n key: 'USER',\r\n title: 'USER',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n\r\n }\r\n if (VoucherPrefix == \"RI\") {\r\n // alert(\"reache23\")\r\n return {\r\n title: \"Indent Request\",\r\n apiEndpoints: `/getTrnMainPagedList/${VoucherPrefix}/tag`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'INDENTNO',\r\n title: 'Indent No.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'DATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n };\r\n }\r\n if (VoucherPrefix == \"Transporter\") {\r\n return {\r\n title: \"Transporter Name\",\r\n apiEndpoints: `/getTransportFromMaster/${VoucherPrefix}`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'NAME',\r\n title: 'Name',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'ADDRESS',\r\n title: 'Address',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n\r\n ]\r\n };\r\n }\r\n if (VoucherPrefix == \"INTENDLIST\") {\r\n return {\r\n title: \"Intend List\",\r\n apiEndpoints: `/getAllIndentPagedListForPO`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'INDENTNO',\r\n title: 'Indent No.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'EDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n };\r\n }\r\n\r\n if(VoucherPrefix == \"APPROVEDSALESRETURN\"){\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getApprovedDamageSalesReturnForView`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'CHALANNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REMARKS',\r\n title: 'REMARKS',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n }\r\n\r\n\r\n \r\n if(VoucherPrefix == \"stockIssueViewList\"){\r\n return {\r\n title: \"Stock Issue\",\r\n apiEndpoints: `/getStockTransferBillForView`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'CHALANNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REFBILLNO',\r\n title: 'Ref. Bill',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REFTRNDATE',\r\n title: 'Ref. Date',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n }\r\n\r\n\r\n if(VoucherPrefix == \"APPROVEDSTOCKTRANSFER\"){\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getApprovedStockTransferForView`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'CHALANNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REMARKS',\r\n title: 'REMARKS',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n }\r\n\r\n if(VoucherPrefix == \"godownList\"){\r\n return {\r\n title: this.appType == 2 ? \"Godown\" : \"Warehouse\",\r\n apiEndpoints: `/getAllWarehousePagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n if(VoucherPrefix == \"warehouseType\"){\r\n return {\r\n title: \"Return Type\",\r\n apiEndpoints: `/getWarehouseTypePagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"WAREHOUSE_TYPE\",\r\n title: \"Type\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n \r\n\r\n if(VoucherPrefix == \"StockTransferForPurchaseReturn\"){\r\n return {\r\n title: \"Bill Details \",\r\n apiEndpoints: `/getApprovedStockTransferForView`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'VCHRNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'INVOICETYPE',\r\n title: 'INVOICE TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n }\r\n\r\n\r\n \r\n if (VoucherPrefix == \"getApprovedStockIssueForDebitNote\") {\r\n return {\r\n title: \"Bill Details \",\r\n apiEndpoints: `/getApprovedStockIssueForDebitNote`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'VCHRNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'INVOICETYPE',\r\n title: 'INVOICE TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n }\r\n\r\n\r\n\r\n\r\n\r\n if(VoucherPrefix == \"DamageIssueForPurchaseReturn\"){\r\n return {\r\n title: \"Bill Details \",\r\n apiEndpoints: `/getApprovedDamageSalesReturn`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'INVOICETYPE',\r\n title: 'INVOICE TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n }\r\n\r\n \r\n if(VoucherPrefix == \"SalesManList\"){\r\n return {\r\n title: \"SalesMan\",\r\n apiEndpoints: `/getSalesmanPagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"SALESMANID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n \r\n ]\r\n };\r\n\r\n }\r\n\r\n \r\n if(VoucherPrefix == \"ProductList\"){\r\n return {\r\n title: \"Product\",\r\n apiEndpoints: `/getProductCodePagedList`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"MCODE\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"DESCA\",\r\n title: \"Product\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n \r\n ]\r\n };\r\n\r\n }\r\n\r\n if(VoucherPrefix == \"ChannelList\"){\r\n return {\r\n title: \"CHANNEL\",\r\n apiEndpoints: `/getAllChanelPagedList`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ChannelCode\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ChannelName\",\r\n title: \"Channel Name\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n \r\n ]\r\n };\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"BrandList\"){\r\n return {\r\n title: \"Brand\",\r\n apiEndpoints: `/getBrandCodePagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n // {\r\n // key: \"BRANDCODE\",\r\n // title: \"Brand ID\",\r\n // hidden: false,\r\n // noSearch: false\r\n // },\r\n {\r\n key: \"BRANDNAME\",\r\n title: \"Brand\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"RetailerList\"){\r\n return {\r\n title: \"Retailers\",\r\n apiEndpoints: `/getRetailerPagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"ASMList\"){\r\n return {\r\n title: \"Area Sales Manager\",\r\n apiEndpoints: `/getASMPagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"DistributorList\"){\r\n return {\r\n title: \"Distributor\",\r\n apiEndpoints: `/getDistributorCodePagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"ImporterList\"){\r\n return {\r\n title: \"Importer\",\r\n apiEndpoints: `/getImporterCodePagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"SalesOfficerList\"){\r\n return {\r\n title: \"Sales Officers\",\r\n apiEndpoints: `/getSalesOfficerPagedList/undefined`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"ImportersCustomerList\"){\r\n return {\r\n title: \"Customers\",\r\n apiEndpoints: `/getImportersCustomerPagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"CompanyType\"){\r\n return {\r\n title: \"Company Type\",\r\n apiEndpoints: `/getCompanyTypePagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"OrgTypeCode\",\r\n title: \"Code\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"OrgTypeName\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"VoucherTypeCN\"){\r\n return {\r\n title: \"Voucher No\",\r\n apiEndpoints: `/getCNVoucherNoPagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"VCHRNO\",\r\n title: \"Voucher No\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"RSMList\"){\r\n return {\r\n title: \"Regional Sales Manager\",\r\n apiEndpoints: `/getRSMPagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"LoadChartProductList\"){\r\n return {\r\n title: \"Product\",\r\n apiEndpoints: `/getLoadChartProductCodePagedList`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"MCODE\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ITEMDESC\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n};\r\n}\r\n\r\nif(VoucherPrefix == \"LoadChartCustomerList\"){\r\n return {\r\n title: \"Customer\",\r\n apiEndpoints: `/getLoadChartCustomerPagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"CLIENTNAME\",\r\n title: \"Customer\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n};\r\n}\r\n\r\nif(VoucherPrefix == \"LoadChartVoucherList\"){\r\n return {\r\n title: \"Voucher\",\r\n apiEndpoints: `/getLoadChartVoucherPagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"VOUCHERNO\",\r\n title: \"VOUCHERNO\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n};\r\n}\r\n\r\nif(VoucherPrefix == \"BusinessUnitList\"){\r\n return {\r\n title: \"Business Unit\",\r\n apiEndpoints: `/getBusinessUnitPagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"BusinessUnit\",\r\n title: \"Business Unit\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n};\r\n}\r\n\r\nif(VoucherPrefix == \"CustomersList\"){\r\n return {\r\n title: \"Company\",\r\n apiEndpoints: `/getCustomersPagedList/`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"StockTransferRefbillList\"){\r\n return {\r\n title: \"Ref Bill\",\r\n apiEndpoints: `/getStockTransferRefbillList`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"REFBILL\",\r\n title: \"REFBILL\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"VCHRNO\",\r\n title: \"VCHRNO\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"TRNDATE\",\r\n title: \"TRNDATE\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n \r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"SettlementModeList\"){\r\n return {\r\n title: \"Settlement Mode\",\r\n apiEndpoints: `/getSettlementModeList`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"BrandsListOnly\"){\r\n return {\r\n title: \"Brand\",\r\n apiEndpoints: `/getBrandPagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"Brand\",\r\n title: \"Brand\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n};\r\n}\r\n\r\nif (VoucherPrefix == \"REFBILLOFSalesReturn\") {\r\n return {\r\n title: \"Bill Details\",\r\n apiEndpoints: `/getTrnMainPagedList/CN/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNMODE',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n}\r\n\r\nif(VoucherPrefix == \"WarehouseList\"){\r\n return {\r\n title: \"Warehouse\",\r\n apiEndpoints: `/getWarehousePagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"NAME\",\r\n title: \"Name\",\r\n hidden: false,\r\n noSearch: false\r\n }, \r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"getPIInvoiceNoList\"){\r\n return {\r\n title: \"PI Invoice No.\",\r\n apiEndpoints: `/getPIInvoiceNoList`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"REFBILL\",\r\n title: \"Invoice No\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"VCHRNO\",\r\n title: \"VCHRNO\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"TRNDATE\",\r\n title: \"TRNDATE\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n \r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"SupplierList\"){\r\n return {\r\n title: \"Supplier\",\r\n apiEndpoints: `/getAccountPagedListByPType/PA/V`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACCODE\",\r\n title: \"CODE\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"EMAIL\",\r\n title: \"EMAIL\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n};\r\n\r\n}\r\n\r\nif (VoucherPrefix == \"TI\" ) {\r\n if(tag==''){\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getTrnMainPagedList/TI/tag/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'VCHRNO',\r\n title: 'Voucher No',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n \r\n}else{\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getTrnMainPagedList/TI/${tag}/batch`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'VCHRNO',\r\n title: 'Voucher No',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n \r\n}\r\n}\r\nif (VoucherPrefix == \"DN\") {\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getTrnMainPagedList/DN/${tag}/batch`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REFORDBILL',\r\n title: 'Ref Bill.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'VCHRNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REMARKS',\r\n title: 'REMARKS',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n \r\n}\r\n\r\nif (VoucherPrefix == \"AccountListAndSupplier\") {\r\n return {\r\n title: \"Accounts\",\r\n apiEndpoints: `/getAccountLedgerAndSupplier`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'ACCODE',\r\n title: 'AC CODE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'ACNAME',\r\n title: 'A/C NAME',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n}\r\n\r\nif (VoucherPrefix == \"AccountLedgerList\") {\r\n return {\r\n title: \"Accounts\",\r\n apiEndpoints: `/getAccountPagedListByMapId/Details/party Payment Expense`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'ACCODE',\r\n title: 'AC CODE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'ACNAME',\r\n title: 'A/C NAME',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n}\r\n\r\nif (VoucherPrefix == \"AD\") {\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getTrnMainPagedList/AD/${tag}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'VCHRNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REFBILL',\r\n title: 'Ref Bill.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'BILLTO',\r\n title: 'SUPPLIER',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n \r\n}\r\n\r\nif(VoucherPrefix == \"BusinessList\"){\r\n return {\r\n title: \"Business\",\r\n apiEndpoints: `/getBusinessPagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n // {\r\n // key: \"BRANDCODE\",\r\n // title: \"Brand ID\",\r\n // hidden: false,\r\n // noSearch: false\r\n // },\r\n {\r\n key: \"BRANDNAME\",\r\n title: \"Brand\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n};\r\n\r\n}\r\n\r\nif(VoucherPrefix == \"MotherPackList\"){\r\n return {\r\n title: \"Mother Pack\",\r\n apiEndpoints: `/getMotherPackPagedList`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n // {\r\n // key: \"BRANDCODE\",\r\n // title: \"Brand ID\",\r\n // hidden: false,\r\n // noSearch: false\r\n // },\r\n {\r\n key: \"BRANDNAME\",\r\n title: \"Brand\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n};\r\n\r\n}\r\n\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getTrnMainPagedList/${VoucherPrefix}/${tag}/batch`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n \r\n {\r\n key: 'VCHRNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REMARKS',\r\n title: 'REMARKS',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n\r\n }\r\n getGenericGridPopUpSettingsForAdditionalCost(VoucherPrefix) {\r\n // var PID = this.PhiscalObj.PhiscalID;\r\n // PID = PID.replace(\"/\", \"ZZ\")\r\n if (VoucherPrefix == \"AdditionalCost\") {\r\n return {\r\n title: \"Bill Details\",\r\n apiEndpoints: `/getAdditionalCostData/AD`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n {\r\n key: 'CHALANNO',\r\n title: 'BILL NO',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REFBILL',\r\n title: 'TYPE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n }\r\n\r\n getMultiplePriceOfProductbyMCODE(condition,productCode,voucherType){\r\n if(condition == \"MultipleProductPriceList\"){\r\n \r\n\r\n var importerlandingCost = true;\r\n var importerSellingPrice = true;\r\n var distributorSetllingPrice = true; \r\n var costToCD = true;\r\n\r\n if(this.userProfiles.CompanyInfo.ORG_TYPE == 'superdistributor' && (voucherType == 3 || voucherType==24) ){\r\n importerlandingCost = false;\r\n importerSellingPrice = true;\r\n distributorSetllingPrice = true;\r\n costToCD = false;\r\n }\r\n else if(this.userProfiles.CompanyInfo.ORG_TYPE == 'superdistributor' && voucherType == 15){\r\n importerlandingCost = true;\r\n importerSellingPrice = false;\r\n distributorSetllingPrice = true;\r\n costToCD = true;\r\n } \r\n else if (this.userProfiles.CompanyInfo.ORG_TYPE == 'distributor' && (voucherType == 3 || voucherType==24) ){\r\n importerlandingCost = true;\r\n importerSellingPrice = false;\r\n distributorSetllingPrice = true;\r\n costToCD = true;\r\n }\r\n else if(this.userProfiles.CompanyInfo.ORG_TYPE == 'distributor' && voucherType == 15){\r\n importerlandingCost = true;\r\n importerSellingPrice = true;\r\n distributorSetllingPrice = false;\r\n costToCD = true;\r\n }\r\n \r\n \r\n return {\r\n title: \"Price List \",\r\n apiEndpoints: `/getMultiplePriceofProduct/${productCode}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'PRICEID',\r\n title: 'PriiceId',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'DESCA',\r\n title: 'Product Name',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n {\r\n key: 'IMPLANDINGCOST',\r\n title: 'RATE',\r\n hidden: importerlandingCost,\r\n noSearch: false,\r\n \r\n },\r\n {\r\n key: 'IMPSELLINGPRICE',\r\n title: 'Cost to CD',\r\n hidden: costToCD,\r\n noSearch: false\r\n },\r\n {\r\n key: 'IMPSELLINGPRICE',\r\n title: 'RATE',\r\n hidden: importerSellingPrice,\r\n noSearch: false\r\n },\r\n {\r\n key: 'DISTSELLINGPRICE',\r\n title: 'RATE',\r\n hidden: distributorSetllingPrice,\r\n noSearch: false\r\n },\r\n {\r\n key: 'MRP',\r\n title: 'MRP',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n \r\n ]\r\n };\r\n\r\n }\r\n\r\n }\r\n\r\n getCustomerWiseRefBillNoforSalesReturn(TRNAC){\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getTrnMainPagedListbyBILLTO/${TRNAC}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'CHALANNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REMARKS',\r\n title: 'REMARKS',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n }\r\n\r\n getGenericGridSettintForSalemanRoute(route){\r\n return {\r\n title: \"Route\",\r\n apiEndpoints: `/getPagedRouteListBySalesman/${route}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"RouteCode\",\r\n title: \"RouteCode\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"RouteName\",\r\n title: \"RouteName\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n\r\n ]\r\n }\r\n\r\n }\r\n \r\n getPagedRouteListBySalesManId(route){\r\n return {\r\n title: \"Route\",\r\n apiEndpoints: `/getPagedRouteListBySalesManId/${route}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"RouteCode\",\r\n title: \"RouteCode\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"RouteName\",\r\n title: \"RouteName\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n \r\n ]\r\n }\r\n \r\n }\r\n genericGridForReportBatch(mcode){\r\n console.log(\"mcode\",mcode)\r\n return{\r\n title: \"Batch/MRP List\",\r\n apiEndpoints: `/getBatchForReport/${mcode}`,\r\n defaultFilterIndex: 0,\r\n columns: [\r\n // {\r\n // key: \"BRANDCODE\",\r\n // title: \"Brand ID\",\r\n // hidden: false,\r\n // noSearch: false\r\n // },\r\n {\r\n key: \"BATCHCODE\",\r\n title: \"BATCHCODE\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"MRP\",\r\n title: \"MRP\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n\r\n getGridSettingForCustomerBySalesmanRoute(salemanId,route){\r\n return {\r\n title: \"Customers\",\r\n apiEndpoints: `/getPagedCustomerListBySalesmanAndRoute/${salemanId}/${route}`,\r\n defaultFilterIndex: 0,\r\n useDefinefilterValue: salemanId,\r\n columns: [\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"customerID\",\r\n title: \"CODE\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"EMAIL\",\r\n title: \"EMAIL\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n }\r\n\r\n getGridSettingForRetailerBySalesmanRoute(salemanId,route){\r\n return {\r\n title: \"Retailers\",\r\n apiEndpoints: `/getPagedRetailerListBySalesmanAndRoute/${salemanId}/${route}`,\r\n defaultFilterIndex: 0,\r\n useDefinefilterValue: salemanId,\r\n columns: [\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"EMAIL\",\r\n title: \"EMAIL\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n}\r\n\r\ngetPagedRetailerListBySalesmanAndRouteId(salemanId,route){\r\n return {\r\n title: \"Retailers\",\r\n apiEndpoints: `/getPagedRetailerListBySalesmanAndRouteId/${salemanId}/${route}`,\r\n defaultFilterIndex: 0,\r\n useDefinefilterValue: salemanId,\r\n columns: [\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"EMAIL\",\r\n title: \"EMAIL\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n}\r\ngetGridSettingForRetailerBySalesman(salemanId){\r\n return {\r\n title: \"Retailers\",\r\n apiEndpoints: `/getPagedRetailerListBySalesman/${salemanId}`,\r\n defaultFilterIndex: 0,\r\n useDefinefilterValue: salemanId,\r\n columns: [\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"customerID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"EMAIL\",\r\n title: \"EMAIL\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n}\r\n\r\ngetGridSettingForDirectPartyListImpoterWise(importerTag){\r\n return {\r\n title: \"Direct Party\",\r\n apiEndpoints: `/getDirectPartyPagedListBySalesmanAndRoute/${importerTag}`,\r\n defaultFilterIndex: 1,\r\n useDefinefilterValue: importerTag,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"CODE\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n}\r\n\r\ngetGridSettingForDirectPartyList(){\r\n return {\r\n title: \"Direct Party\",\r\n apiEndpoints: `/getDirectPartyPagedList`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"CODE\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n}\r\n\r\n CHECKTRANSPORT() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/CheckTransport', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getDistrict() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getDistrict', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n getCity() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getCity', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getAccountWiseTrnAmount(trnDate: string, companyId: string, acid: string, division: string, requestType: number = 0) {\r\n return new Observable((observer: Subscriber) => {\r\n let url = `${this.apiUrl}/getAccountWiseTrnAmount/${requestType}?trnDate=${trnDate}&companyId=${companyId}&acid=${acid}&division=${division}`;\r\n this.http\r\n .get(url, this.getRequestOption())\r\n .subscribe(\r\n res => {\r\n let data = res.json();\r\n if (data.status == 'ok') {\r\n observer.next(data);\r\n observer.unsubscribe();\r\n }\r\n else {\r\n observer.next(data)\r\n observer.unsubscribe();\r\n }\r\n },\r\n error => {\r\n observer.next({});\r\n });\r\n });\r\n }\r\n\r\n public getUniqueSAPID(value:any){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.post(`${this.apiUrl}/getSAPIDbyCategory`,value,this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\n\r\n\r\n\r\n public getSalesmanBasedUponCustomer(salesmanid){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getSalesManListByCustomer?SALESMANID=${salesmanid}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ngetUsersFromLog() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getUsersFromLog', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ngetFormNameFromLog(userID){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getFormNameFromLog?userID=${userID}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ncheckProudctMulitplePrice(productCode){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/gerProductPriceForCheck/${productCode}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n // console.log(\"error\",error)\r\n // console.log(\"firsterror\",)\r\n res.status = 'error'; res.result = error._body;\r\n \r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\n\r\ngetHostNameFromLog(userID){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getHostNameFromLog?userID=${userID}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ngetActionFromLog(userID){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getActionFromLog?userID=${userID}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n focusAnyControl(id:string)\r\n {\r\n let control= document.getElementById(id);\r\n if(control!=null){\r\n control.focus();\r\n }\r\n }\r\n\r\n\r\n maintainFocusAnyControl(id:string){\r\n let control= document.getElementById(id);\r\n if(control!=null){\r\n setTimeout(() => {\r\n control.focus();\r\n }, 3000);\r\n \r\n }\r\n }\r\n\r\n RemoveFocusFromAnyControl(id:string)\r\n {\r\n let control= document.getElementById(id);\r\n if(control!=null){\r\n control.blur();\r\n }\r\n }\r\n\r\n scrollToControlInTable(id:string)\r\n {\r\n var elmnt = document.getElementById(id);\r\n if(elmnt!=null){\r\n elmnt.scrollIntoView();\r\n }\r\n }\r\n\r\n getDataForExcel(from:any,fileName:any) {\r\n // return this.http.get(`${this.apiUrl}/getMenuItemForExcel?from=${from}`,this.getRequestOption()).map(response => response.json() || []);\r\n const type = 'application/vnd.ms-excel';\r\n const options = new RequestOptions({\r\n responseType: ResponseContentType.Blob,\r\n headers: new Headers({ 'Accept': type,\r\n Authorization: this.authService.getAuth().token\r\n })\r\n });\r\n // let opt = this.getRequestOption();\r\n // let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n // let op: RequestOptions = new RequestOptions();\r\n return this.http\r\n .get(`${this.apiUrl}/getMenuItemForExcel?from=${from}`,options)\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }),\r\n filename: fileName.reportname+`.xlsx`\r\n };\r\n return data;\r\n });\r\n}\r\n\r\ngetSalesPurchaseCount(from){\r\n return this.http.get(`${this.apiUrl}/getSalesPurchaseCount?from=${from}`,this.getRequestOption()).map(response => response.json() || []);\r\n\r\n}\r\npublic markAsRead(id : number) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject(); \r\n this.http\r\n .get(`${this.apiUrl}/notificationMarkAsRead/${id}`, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json(); \r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result; \r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result; \r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n\r\n public getStockForCheck(vchrno){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getStockForSalesReturn/?vchrno=${vchrno}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\n \r\n public getTransferStockForCheck(vchrno) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getTransferStockForApproval/?vchrno=${vchrno}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n public getPreviousApprovedStock(vchrno) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getPreviousApprovedStock/?vchrno=${vchrno}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n\r\n\r\n\r\npublic getRefBillCheck(vchrno){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getRefBillNoForCheck/${vchrno}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\nupdateBillFormats(value){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let bodyData = {BILLFORMATS:value }\r\n this.http.post(`${this.apiUrl}/updateBillFormats`,bodyData,this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\nupdateCompanyValues(value2){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let bodyData = {BILLUNITS:value2 }\r\n this.http.post(`${this.apiUrl}/updateCompanyInfo`,bodyData,this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\npublic getItemForFullBillReturn(vchrno){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getItemForFullBillReturn/?vchrno=${vchrno}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ngetConfactor(posturl, mcode) {\r\n let res = { status: \"error\", result: \"\", result2: \"\", message: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n// console.log(\"MCODE@@\",mcode)\r\n this.http\r\n .post(this.apiUrl + posturl, mcode, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n res.result2 = retData.result2;\r\n res.message = retData.message;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\npublic getBillUnits(vchrno){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getBillUnits/?vchrno=${vchrno}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\nexportAsExcelFile(json: any[], excelFileName: string): void {\r\n const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);\r\n //worksheet['!ref'] = \"A2\"\r\n XLSX.utils.decode_cell(\"A1\");\r\n const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };\r\n\r\n // XLSX.utils.sheet_add_json(worksheet, [\r\n // [\"new data\", 1, 2, 3]\r\n // ], {origin: \"A1\"});\r\n\r\n\r\n// var workbook = XLSX.utils.book_new();\r\n// var ws1 = XLSX.utils.table_to_sheet(document.getElementById('table1') as HTMLTableElement);\r\n// XLSX.utils.book_append_sheet(workbook, ws1, \"Sheet1\");\r\n\r\n const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });\r\n\r\n this.saveAsExcelFile(excelBuffer, excelFileName);\r\n\r\n// this.updatefile();\r\n\r\n}\r\n\r\nexportAsExcelFileII(json: any[], excelFileName: string): void {\r\n const header = Object.keys(json[0]); // columns name\r\n var wscols = [];\r\n for (var i = 0; i < header.length; i++) { // columns length added\r\n wscols.push({ wch: header[i].length + 5 })\r\n }\r\n const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);\r\n const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };\r\n worksheet[\"!cols\"] = wscols;\r\n const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'buffer' });\r\n this.saveAsExcelFile(excelBuffer, excelFileName);\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\nnewFile(){\r\n\r\n /* generate a new workbook with the first three rows */\r\nvar ws = XLSX.utils.aoa_to_sheet([\r\n\t[\"aaaaaa\"],\r\n\t[\"bbbbb\"],\r\n\t[\"cccccc\"]\r\n]);\r\n\r\n/* this array controls the column order in the generated sheet */\r\nvar header = [\"x\", \"y\", \"z\"];\r\n\r\n// /* add row objects to sheet starting from cell A6 */\r\n// XLSX.utils.sheet_add_json(ws, [\r\n// \t{x:1, y:2, z:3},\r\n// \t{x:435, y:345, z:54}\r\n// ], {header:header, origin:\"A6\"});\r\n\r\n// /* append two more rows without header */\r\n// XLSX.utils.sheet_add_json(ws, [\r\n// \t{x:345, y:345, z:345},\r\n// \t{x:345, y:3, z:345}\r\n// ], {header:header, origin:-1, skipHeader:true});\r\n\r\n}\r\n\r\n\r\nupdatefile(){\r\n var Heading = [\r\n [\"Employee Details\"],\r\n [\"Emp Name\", \"Emp Sal\"]\r\n ];\r\n var Data = [\r\n {name:\"xyz\", sal:1000},\r\n {name:\"abc\", sal:2000}\r\n ];\r\n var ws = XLSX.utils.aoa_to_sheet(Heading);\r\n // XLSX.utils.sheet_add_json(ws, Data, {\r\n // header:[\"name\", \"sal\"],\r\n // skipHeader:true,\r\n // origin:-1\r\n // });\r\n \r\n var wb = XLSX.utils.book_new();\r\n XLSX.utils.book_append_sheet(wb, ws, \"SheetJS\");\r\n var wbout = XLSX.write(wb, {bookType:'xlsx', type:'buffer'});\r\n // saveAs(new Blob([wbout],{type:\"application/octet-stream\"}), \"issue946.xlsx\");\r\n this.saveAsExcelFile(wbout, \"test\");\r\n\r\n}\r\n\r\n\r\n\r\n saveAsExcelFile(buffer: any, fileName: string): void {\r\n const data: Blob = new Blob([buffer], {\r\n type: this.EXCEL_TYPE\r\n });\r\n FileSaver.saveAs(data, fileName+this.EXCEL_EXTENSION);\r\n}\r\n\r\n\r\n\r\nformateCell(){\r\n var ws = XLSX.utils.aoa_to_sheet([\r\n [\"aaaaaa\"],\r\n [\"bbbbb\"],\r\n [\"cccccc\"]\r\n ]);\r\n \r\n}\r\n\r\n\r\n\r\ngetGenericGridSettingForTaxCancel(){\r\n return {\r\n title: \"Vouchers\",\r\n apiEndpoints: `/getTrnMainPagedListForTaxCancel/TI`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: 'TRNDATE',\r\n title: 'DATE',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'CHALANNO',\r\n title: 'VOUCHER NO.',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'NETAMNT',\r\n title: 'AMOUNT',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: 'REMARKS',\r\n title: 'REMARKS',\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n}\r\ngetSalesmanRouteList() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getSalesmanRouteList', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\ngetRouteNameBySalesmanandroutecode(salesman,routecode) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl }/getRouteNamebySalesmanandRouteCode?salesmanId=${salesman}&routeCode=${routecode}`,this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\ngetSalesmanFromRouteCode(routecode) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl }/getSalesmanFromRouteCode?routeCode=${routecode}`,this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\npublic getRouteListBasedUponSalesman(salesmanid){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getRouteBySalesMan?SALESMANID=${salesmanid}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\ngetRefbillForUnselablePurchaseReturn(){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getRefBillForUnselablePurchaseReturn`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\npublic getCustomerListBasedUponRouteAndSalesman(data){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n const dta = { SALESMANID: data.salesManId, RouteCode: data.route };\r\n this.http.post(`${this.apiUrl}/getCustomerBySalesmanAndRoute`,dta, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\n\r\n\r\npublic saveDamageSalesReturnToTMP(mode: string, trnmain: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: trnmain };\r\n this.http\r\n .post(this.apiUrl + \"/saveSalesReturnDamageToTMP\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n }\r\n },\r\n error => {\r\n var er = error.json();\r\n returnSubject.next(er);\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\nresetExcelColumnFormat(value){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let bodyData = {ReportName:value }\r\n this.http.post(`${this.apiUrl}/resetExcelColumnFormat`,bodyData,this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\npublic SaveApprovedStockTransfer(mode: string, trnmain: any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { mode: mode, data: trnmain };\r\n this.http\r\n .post(this.apiUrl + \"/saveApprovedStockTransfer\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n }\r\n },\r\n error => {\r\n var er = error.json();\r\n returnSubject.next(er);\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ngetSalesmanListWithCustomer(){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getSalesmanListWithCustomer`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ngetPreviousSavedBillSalesman(){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getPreviousSavedBillSalesman`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\ngetTransportDetail() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getTransportDetail', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n MaunalSync(){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/SyncService`, this.getRequestOption())\r\n .subscribe(response => {\r\n // console.log(\"CheckDATA\",response)\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n AutoSync(){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/AutoSyncService`, this.getRequestOption())\r\n .subscribe(response => {\r\n // console.log(\"CheckDATA\",response)\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getVehicleNoDetail() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getVehicleNoDetail', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n getDriverNameDetail() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + '/getDriverNameDetail', this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public getRefBillNoCount(REFBILLNO) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/getRefBillNoCount?REFBILL=${REFBILLNO}`, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\npublic saveBackupHistory(status:any,remarks:any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {status:status,remarks:remarks};\r\n // console.log(\"Sales man \" + bodyData);\r\n this.http\r\n .post(this.apiUrl + \"/saveBackupHistory\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\ngetOwnCustomerIDForSelfBill(voucerNo: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(\r\n `${this.apiUrl}/getOwnCustomerIDForSelfBill?voucherNo=${voucerNo}`,\r\n this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n \r\npublic saveFiscalYear(fiscalData: any,StartDate_BS:any,EndDate_BS:any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { data: fiscalData,StartDateInBS:StartDate_BS,EndDateInBS:EndDate_BS};\r\n this.http\r\n .post(this.apiUrl + \"/saveFiscalYear\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n // console.log(retData);\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\npublic getAllInvoiceData(printParams) {\r\n let bodyData:{};\r\n // console.log(\"@@printParams\",printParams)\r\n if(printParams.VoucherPrefix == 'TI' && printParams.title == 'Tax Invoice'){\r\n if(printParams.ORGTYPE == \"superdistributor\"){\r\n bodyData = {\r\n \"filename\": printParams.filename,\r\n \"Parameters\": [{\"voucherno\":printParams.VCHRNO, \"rowsnumber\":printParams.rownumber,\"companyname\":printParams.NAME, \"companyaddress\":printParams.ADDRESS , \r\n \"division\":printParams.INITIAL,\"phiscalid\":printParams.PhiscalID,\"companyid\":printParams.COMPANYID,\"numtowords\":printParams.numtowords,\r\n \"p1\":printParams.panno1,\"p2\":printParams.panno2,\"p3\":printParams.panno3,\"p4\":printParams.panno4,\"p5\":printParams.panno5,\"p6\":printParams.panno6,\"p7\":printParams.panno7,\"p8\":printParams.panno8,\"p9\":printParams.panno9,\r\n \"title\":printParams.title ,\"caption\": printParams.caption,\r\n \"phone1\":printParams.phone1,\"phone2\":printParams.phone2,\"email\":printParams.EMAIL},\r\n {\"voucherno\":printParams.VCHRNO, \"rowsnumber\":printParams.rownumber,\"companyname\":printParams.NAME, \"companyaddress\":printParams.ADDRESS , \r\n \"division\":printParams.INITIAL,\"phiscalid\":printParams.PhiscalID,\"companyid\":printParams.COMPANYID,\"numtowords\":printParams.numtowords,\r\n \"p1\":printParams.panno1,\"p2\":printParams.panno2,\"p3\":printParams.panno3,\"p4\":printParams.panno4,\"p5\":printParams.panno5,\"p6\":printParams.panno6,\"p7\":printParams.panno7,\"p8\":printParams.panno8,\"p9\":printParams.panno9,\r\n \"title\":'Invoice' ,\"caption\": ' ',\r\n \"phone1\":printParams.phone1,\"phone2\":printParams.phone2,\"email\":printParams.EMAIL},\r\n {\"voucherno\":printParams.VCHRNO, \"rowsnumber\":printParams.rownumber,\"companyname\":printParams.NAME, \"companyaddress\":printParams.ADDRESS , \r\n \"division\":printParams.INITIAL,\"phiscalid\":printParams.PhiscalID,\"companyid\":printParams.COMPANYID,\"numtowords\":printParams.numtowords,\r\n \"p1\":printParams.panno1,\"p2\":printParams.panno2,\"p3\":printParams.panno3,\"p4\":printParams.panno4,\"p5\":printParams.panno5,\"p6\":printParams.panno6,\"p7\":printParams.panno7,\"p8\":printParams.panno8,\"p9\":printParams.panno9,\r\n \"title\":'Invoice' ,\"caption\": ' ',\r\n \"phone1\":printParams.phone1,\"phone2\":printParams.phone2,\"email\":printParams.EMAIL},\r\n {\"voucherno\":printParams.VCHRNO, \"rowsnumber\":printParams.rownumber,\"companyname\":printParams.NAME, \"companyaddress\":printParams.ADDRESS , \r\n \"division\":printParams.INITIAL,\"phiscalid\":printParams.PhiscalID,\"companyid\":printParams.COMPANYID,\"numtowords\":printParams.numtowords,\r\n \"p1\":printParams.panno1,\"p2\":printParams.panno2,\"p3\":printParams.panno3,\"p4\":printParams.panno4,\"p5\":printParams.panno5,\"p6\":printParams.panno6,\"p7\":printParams.panno7,\"p8\":printParams.panno8,\"p9\":printParams.panno9,\r\n \"title\":'Invoice' ,\"caption\": ' ',\r\n \"phone1\":printParams.phone1,\"phone2\":printParams.phone2,\"email\":printParams.EMAIL},\r\n ],\r\n \"IsSameDataQuery\": true\r\n };\r\n }else if(printParams.ORGTYPE == \"distributor\"){\r\n bodyData = {\r\n \"filename\": printParams.filename,\r\n \"Parameters\": [{\"voucherno\":printParams.VCHRNO, \"rowsnumber\":printParams.rownumber,\"companyname\":printParams.NAME, \"companyaddress\":printParams.ADDRESS , \r\n \"division\":printParams.INITIAL,\"phiscalid\":printParams.PhiscalID,\"companyid\":printParams.COMPANYID,\"numtowords\":printParams.numtowords,\r\n \"p1\":printParams.panno1,\"p2\":printParams.panno2,\"p3\":printParams.panno3,\"p4\":printParams.panno4,\"p5\":printParams.panno5,\"p6\":printParams.panno6,\"p7\":printParams.panno7,\"p8\":printParams.panno8,\"p9\":printParams.panno9,\r\n \"title\":printParams.title ,\"caption\": printParams.caption,\r\n \"phone1\":printParams.phone1,\"phone2\":printParams.phone2,\"email\":printParams.EMAIL},\r\n {\"voucherno\":printParams.VCHRNO, \"rowsnumber\":printParams.rownumber,\"companyname\":printParams.NAME, \"companyaddress\":printParams.ADDRESS ,\r\n \"division\":printParams.INITIAL,\"phiscalid\":printParams.PhiscalID,\"companyid\":printParams.COMPANYID,\"numtowords\":printParams.numtowords,\r\n \"p1\":printParams.panno1,\"p2\":printParams.panno2,\"p3\":printParams.panno3,\"p4\":printParams.panno4,\"p5\":printParams.panno5,\"p6\":printParams.panno6,\"p7\":printParams.panno7,\"p8\":printParams.panno8,\"p9\":printParams.panno9,\r\n \"title\":'Invoice' ,\"caption\": ' ',\r\n \"phone1\":printParams.phone1,\"phone2\":printParams.phone2,\"email\":printParams.EMAIL},\r\n ],\r\n \"IsSameDataQuery\": true\r\n };\r\n }\r\n \r\n const type = 'application/pdf';\r\nconst options = new RequestOptions({\r\n responseType: ResponseContentType.Blob,\r\n headers: new Headers({ 'Accept': type,\r\n Authorization: this.authService.getAuth().token\r\n })\r\n });\r\n return this.http\r\n .post(this.apiUrl + \"/MultiparameterPdf\", bodyData, options)\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }) \r\n };\r\n return data;\r\n });\r\n }else{\r\n \r\n \r\n let bodyData = {\r\n \"filename\": printParams.filename,\r\n \"Parameter\": {\"voucherno\":printParams.VCHRNO, \"rowsnumber\":printParams.rownumber,\"companyname\":printParams.NAME, \"companyaddress\":printParams.ADDRESS , \r\n \"division\":printParams.INITIAL,\"phiscalid\":printParams.PhiscalID,\"companyid\":printParams.COMPANYID,\"numtowords\":printParams.numtowords,\r\n \"p1\":printParams.panno1,\"p2\":printParams.panno2,\"p3\":printParams.panno3,\"p4\":printParams.panno4,\"p5\":printParams.panno5,\"p6\":printParams.panno6,\"p7\":printParams.panno7,\"p8\":printParams.panno8,\"p9\":printParams.panno9,\r\n \"title\":printParams.title ,\"caption\": printParams.caption,\r\n \"phone1\":printParams.phone1,\"phone2\":printParams.phone2,\"email\":printParams.EMAIL}\r\n };\r\n \r\nconst type = 'application/pdf';\r\nconst options = new RequestOptions({\r\n responseType: ResponseContentType.Blob,\r\n headers: new Headers({ 'Accept': type,\r\n Authorization: this.authService.getAuth().token\r\n })\r\n });\r\n return this.http\r\n .post(this.apiUrl + \"/Pdf\", bodyData, options)\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }) \r\n };\r\n return data;\r\n });\r\n}\r\n\r\n} \r\n\r\npublic getPrintFileName(voucherprefix: string,companyid:string,billformats:string) {\r\n let bodyData = { voucherprefix: voucherprefix,companyid:companyid,billformats:billformats };\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getPrintFileName\", bodyData, this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\ngetAccountNameByTrnac(trnac : string){\r\n let returnSubject : Subject=new Subject();\r\n this.http.get(this.apiUrl+'/getAccountNameFromTrnAc/'+trnac,this.getRequestOption()).subscribe(\r\n res=>{\r\n let data = res.json();\r\n // console.log(\"checkResult\",data);\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n )\r\n return returnSubject;\r\n\r\n}\r\n\r\ngetGenericGridSettingForSalesOfficer(asm){\r\n return {\r\n title: \"Sales Officers\",\r\n apiEndpoints: `/getSalesOfficerPagedList/${asm}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ID\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n \r\n ]\r\n };\r\n\r\n }\r\n\r\n getGenericGridSettingForSubChannel(parentchannelcode){\r\n return {\r\n title: \"SUB-CHANNEL\",\r\n apiEndpoints: `/getAllSubChannelPagedList/${parentchannelcode}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ChannelCode\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ChannelName\",\r\n title: \"Channel Name\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n \r\n ]\r\n};\r\n\r\n }\r\n\r\n getGenericGridSettingForASM(importercode){\r\n return {\r\n title: \"Area Sales Manager\",\r\n apiEndpoints: `/getASMPagedListAccImpCode/${importercode}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"NAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n \r\n ]\r\n };\r\n\r\n }\r\n\r\n getGenericGridSettingForChannelAccCode(importercode){\r\n return {\r\n title: \"CHANNEL\",\r\n apiEndpoints: `/getAllChannelPagedListAccCode/${importercode}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ChannelCode\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ChannelName\",\r\n title: \"Channel Name\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n \r\n ]\r\n};\r\n\r\n }\r\n\r\n getGenericGridSettingForSubChannelAccCode(importercode,channelcode){\r\n return {\r\n title: \"SUB CHANNEL\",\r\n apiEndpoints: `/getAllSubChannelPagedListAccCode/${importercode}/${channelcode}`,\r\n defaultFilterIndex: 1,\r\n columns: [\r\n {\r\n key: \"ChannelCode\",\r\n title: \"ID\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ChannelName\",\r\n title: \"Channel Name\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n \r\n ]\r\n};\r\n\r\n }\r\n \r\n\r\npublic getNumberToWords(vchrno,division,phiscalid,companyid) {\r\n let bodyData = { vchrno : vchrno,division : division,phiscalid : phiscalid,companyid : companyid };\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .post(\r\n this.apiUrl + \"/getNumberToWords\", bodyData, this.getRequestOption()\r\n )\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\nloadVoucherWiseBillUnitsBillFormats(voucherprefix: string) {\r\n let bodyData = { VOUCHERPREFIX: voucherprefix};\r\n return this.http\r\n .post(this.apiUrl + \"/loadVoucherWiseBillUnitsBillFormats\", bodyData, this.getRequestOption())\r\n .map(data => data.json()).share()\r\n}\r\n\r\nupdateVoucherWiseBillUnitsBillFormats(billunits,billformats,voucherprefix: string) {\r\n let bodyData = { BILLUNITS:billunits,BILLFORMATS:billformats,VOUCHERPREFIX: voucherprefix};\r\n return this.http\r\n .post(this.apiUrl + \"/updateVoucherWiseBillUnitsBillFormats\", bodyData, this.getRequestOption())\r\n .map(data => data.json()).share()\r\n}\r\n\r\npublic getBillFormat(voucherno: string) {\r\n let bodyData = { voucherno: voucherno};\r\n return this.http\r\n .post(this.apiUrl + \"/getBillFormat\", bodyData, this.getRequestOption())\r\n .map(data => data.json()).share()\r\n}\r\n\r\ngetGridSettingForRetailerListImporterWise(importerTag){\r\n return {\r\n title: \"Retailers\",\r\n apiEndpoints: `/getRetailerPagedListByImporter/${importerTag}`,\r\n defaultFilterIndex: 1,\r\n useDefinefilterValue: importerTag,\r\n columns: [\r\n {\r\n key: \"customerID\",\r\n title: \"CODE\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n}\r\n\r\ngetGridSettingForVATNOListImporterWise(importerTag){\r\n return {\r\n title: \"VAT No\",\r\n apiEndpoints: `/getVatnoPagedListByImporter/${importerTag}`,\r\n defaultFilterIndex: 1,\r\n useDefinefilterValue: importerTag,\r\n columns: [\r\n {\r\n key: \"ACNAME\",\r\n title: \"NAME\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"VATNO\",\r\n title: \"VATNO\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"ADDRESS\",\r\n title: \"ADDRESS\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n ]\r\n };\r\n}\r\nValidateDate(date: string) {\r\n var dateFieldArray = date.split('/');\r\n var year = parseInt(dateFieldArray[2]);\r\n var month = parseInt(dateFieldArray[1]) - 1;\r\n var day = parseInt(dateFieldArray[0]);\r\n var d = new Date(year, month, day);\r\n if (d.getFullYear() == year && d.getMonth() == month && d.getDate() == day) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nchangeIMsDateToDate(date) {\r\n var dateFieldArray = date.split('/');\r\n var year = dateFieldArray[2];\r\n var month = dateFieldArray[1];\r\n var day = dateFieldArray[0];\r\n var d = `${year}-${month}-${day}`\r\n return d;\r\n}\r\ngetSubGroupForQuickAccountMaster(acid) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let bodydata = { acid: acid }\r\n this.http.post(`${this.apiUrl}/getSubGroupForQuickAccountMaster`, bodydata, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\npublic saveSubLedgerMaster(mode: string, data: any) {\r\n let res = { status: \"error\", result: \"\" }\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ 'Content-Type': 'application/json' });\r\n let op: RequestOptions = new RequestOptions()\r\n let bodyData = { mode: mode, data: data };\r\n console.log(\"company item\" + bodyData);\r\n this.http.post(this.apiUrl + \"/saveSubLedgerMaster\", bodyData, this.getRequestOption())\r\n .subscribe(data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n res.status = \"error1\"; res.result = retData.result;\r\n console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error2\", res.result = error;\r\n console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n\r\n}\r\ncustomDateFormate(date: string) {\r\n var dateFieldArray = date.split('-');\r\n var year = dateFieldArray[0];\r\n var month = dateFieldArray[1];\r\n var day = dateFieldArray[2];\r\n var d = `${day}/${month}/${year}`;\r\n return d;\r\n}\r\npublic ValidateBatchWiseRate(batchno : string,rate: number){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let body = {batchno : batchno,rate : rate}\r\n this.http.post(this.apiUrl + \"/ValidateBatchWiseRate\", body, this.getRequestOption())\r\n .subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n \r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n\r\ngetCNPopupSettingForStockTransfer() {\r\nreturn {\r\ntitle: \"Voucher No\",\r\napiEndpoints: `/getCNforStockTransfer/${'CN'}`,\r\ndefaultFilterIndex: 0,\r\ncolumns: [\r\n {\r\n key: \"VCHRNO\",\r\n title: \"Voucher No\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"REFBILL\",\r\n title: \"Ref. Bill\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"TRNDATE\",\r\n title: \"Transaction Date\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"BILLTO\",\r\n title: \"Customer\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n]\r\n};\r\n\r\n\r\n}\r\ngetAllChalanSeries(vType: string) {\r\n return this.http.get(`${this.apiUrl}/getChalanSeriesByVoucherType?vType=${vType}`, this.getRequestOption());\r\n}\r\npublic getAllNEWCostCenter() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .get(this.apiUrl + \"/getAllNEWCostCenterList\", this.getRequestOption())\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\nsaveBarchTransfer(value){\r\n let bodyData = { mode: 'NEW', data: value };\r\n return this.http\r\n .post(this.apiUrl + \"/saveBranchTransfer\", bodyData, this.getRequestOption())\r\n .map(data => data.json()).share()\r\n}\r\nnullToZeroConverter(value) {\r\n if (\r\n value === undefined ||\r\n value == null ||\r\n value === '' ||\r\n value === 'Infinity' ||\r\n value === 'NaN' ||\r\n isNaN(parseFloat(value))\r\n ) {\r\n return 0;\r\n }\r\n return parseFloat(value);\r\n}\r\n\r\n\r\npublic getBatchOfItem(vchrno: any,mcode:any) {\r\n let res = { status: 'error', result: \"\" }\r\n let returnSubject: Subject = new Subject();\r\n let bodyData = { vchrno: vchrno,mcode:mcode };\r\n this.http.post(this.apiUrl + \"/getBatchOfItem\", bodyData, this.getRequestOption())\r\n .subscribe(data => {\r\n let retData = data.json();\r\n if (retData.status = \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = \"error2\",\r\n res.result = error;\r\n console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n });\r\n return returnSubject;\r\n}\r\n\r\ngetBatchidVoucherwise(VCHRNO: string) {\r\n let res = { status: 'error', result: \"\" }\r\n let returnSubject: Subject = new Subject();\r\n let bodyData = { VCHRNO: VCHRNO };\r\n this.http.post(this.apiUrl + \"/getBatchidVoucherwise\", bodyData, this.getRequestOption())\r\n .subscribe(data => {\r\n let retData = data.json();\r\n if (retData.status = \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = \"error2\",\r\n res.result = error;\r\n console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n });\r\n return returnSubject;\r\n}\r\n\r\ngetAllPhiscalYear() {\r\n return this.http.get(`${this.apiUrl}/getAllPhiscalYear`, this.getRequestOption());\r\n}\r\ngetSavedVoucherNo(vchrno:string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/checkPreviousSavedVoucher?vchrno=${vchrno}`, this.getRequestOption()).subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n);\r\nreturn returnSubject;\r\n}\r\n\r\npublic saveDistributorResign(mode: string, Account: any,form:string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n // console.log(\"about to save\")\r\n let opt = this.getRequestOption();\r\n // console.log(opt.headers.toJSON());\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {data: Account,formType:form};\r\n // console.log(\"serviceData--\" + JSON.stringify(bodyData));\r\n this.http\r\n .post(this.apiUrl + \"/saveDistributorResign\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\n public getItemListBrandWise(BrandData) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = { BrandData:BrandData };\r\n this.http\r\n .post(this.apiUrl + \"/getItemListBrandWise\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n // public getpriceformula(menuCode,formulaType) {\r\n // return this.http.get(`${this.apiUrl}/pricecalculator/getpriceformula?mcode=${menuCode}&FormulaType=${formulaType}`, this.getRequestOption())\r\n // .map(data => data.json())\r\n // .share();}\r\n\r\n public saveImporterPurchaseCosting(ImporterCostingList: any={}) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {ImporterCostingList:ImporterCostingList};\r\n this.http\r\n .post(this.apiUrl + \"/saveImporterPurchaseCosting\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n public discardNotification(refno: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let bodyData ={refno:refno};\r\n this.http\r\n .post(this.apiUrl + \"/discardNotification\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n public toBSDate(adDate: string): string {\r\n console.log(\"toBSDate\",adDate)\r\n if (adDate) {\r\n const bsDate = (window as any).ad2bs(adDate, \"YYYY-MM-DD\");\r\n if (bsDate)\r\n return bsDate.day.toString().padStart(2, '0') + '/' + bsDate.month.toString().padStart(2, '0') + '/' + bsDate.year;\r\n }\r\n }\r\n \r\n public toADDate(bsDate): string {\r\n console.log(\"toADDAte\",bsDate)\r\n if (bsDate) {\r\n const adDate = (window as any).bs2ad(bsDate, \"DD/MM/YYYY\");\r\n if (adDate)\r\n return adDate.year + '-' + adDate.month.toString().padStart(2, '0') + '-' + adDate.day.toString().padStart(2, '0');\r\n }\r\n }\r\n\r\n checkUrcValidate(urc,companyId,sm,route) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(this.apiUrl + `/checkUrcValidate?urc=${urc}&&companyid=${companyId}&&route=${route}&&salesmanid=${sm}`, this.getRequestOption()).subscribe(response => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n \r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nexport class HotkeyConfig {\r\n [key: string]: string[];\r\n}\r\nexport class ConfigModel {\r\n hotkeys: HotkeyConfig;\r\n}\r\nexport class Command {\r\n name: string;\r\n combo: string;\r\n ev: KeyboardEvent;\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/repositories/masterRepo.service.ts","export * from './masterRepo.service';\r\nexport * from './MockmasterRepo.service';\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/repositories/index.ts","import { ElementRef, Injectable, ViewChild } from \"@angular/core\";\r\nimport { Router, NavigationStart } from \"@angular/router\";\r\nimport { Observable, Subject, Subscription } from \"rxjs\";\r\nimport { of } from \"rxjs/observable/of\";\r\nimport { runInThisContext } from \"vm\";\r\nimport { MasterRepo } from \"../../repositories\";\r\n\r\n@Injectable()\r\nexport class AlertService {\r\n private subject = new Subject();\r\n private showHideSubject = new Subject();\r\n private keepAfterNavigationChange = false;\r\n public autoDisplay: boolean = true;\r\n public emitShowHideSubject = new Subject();\r\n\r\n constructor(private router: Router) {\r\n // clear alert message on route change\r\n router.events.subscribe(event => {\r\n if (event instanceof NavigationStart) {\r\n if (this.keepAfterNavigationChange) {\r\n // only keep for a single location change\r\n this.keepAfterNavigationChange = false;\r\n } else {\r\n // clear alert\r\n this.subject.next();\r\n }\r\n }\r\n });\r\n }\r\n\r\n success(message: string, autoDisplay = true) {\r\n return new Promise((resolve, reject) => {\r\n this.autoDisplay = autoDisplay;\r\n this.subject.next({ type: \"success\", text: message });\r\n resolve();\r\n \r\n }); \r\n }\r\n\r\n error(message: string, autoDisplay = false) {\r\n return new Promise((resolve, reject) => {\r\n this.autoDisplay = autoDisplay; \r\n this.subject.next({ type: \"error\", text: message });\r\n this.show();\r\n resolve();\r\n \r\n\r\n }); \r\n }\r\n\r\n warning(message: string, autoDisplay = false) {\r\n return new Promise((resolve, reject) => {\r\n this.autoDisplay = autoDisplay;\r\n this.subject.next({ type: \"warning\", text: message });\r\n this.show()\r\n resolve();\r\n });\r\n }\r\n\r\n info(message: string, autoDisplay = false) {\r\n return new Promise((resolve, reject) => {\r\n this.autoDisplay = autoDisplay;\r\n this.subject.next({ type: \"info\", text: message });\r\n this.show();\r\n resolve();\r\n });\r\n }\r\n\r\n getMessage(): Observable {\r\n return this.subject.asObservable();\r\n }\r\n\r\n getShowHide(): Observable {\r\n return this.showHideSubject.asObservable();\r\n }\r\n\r\n show() {\r\n this.showHideSubject.next(true);\r\n }\r\n\r\n hide() {\r\n this.showHideSubject.next(false);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/alert/alert.service.ts","import { Injectable } from '@angular/core';\r\nimport { Subject } from 'rxjs/Subject';\r\n@Injectable()\r\nexport class GlobalState {\r\n private _data = new Subject();\r\n private _dataStream$ = this._data.asObservable();\r\n //sag\r\n private _globalSettings: Map> = new Map>();\r\n private _subscriptions: Map> = new Map>();\r\n\r\n constructor() {\r\n this._dataStream$.subscribe((data) => this._onEvent(data));\r\n }\r\n\r\n notifyDataChanged(event, value) {\r\n\r\n let current = this._data[event];\r\n if (current !== value) {\r\n this._data[event] = value;\r\n\r\n this._data.next({\r\n event: event,\r\n data: this._data[event]\r\n });\r\n }\r\n }\r\n\r\n subscribe(event: string, callback: Function) {\r\n let subscribers = this._subscriptions.get(event) || [];\r\n subscribers.push(callback);\r\n\r\n this._subscriptions.set(event, subscribers);\r\n }\r\n\r\n _onEvent(data: any) {\r\n let subscribers = this._subscriptions.get(data['event']) || [];\r\n\r\n subscribers.forEach((callback) => {\r\n callback.call(null, data['data']);\r\n });\r\n\r\n }\r\n\r\n setGlobalSetting(key: string, items: Array) {\r\n this._globalSettings.set(key, items);\r\n }\r\n getGlobalSetting(key: string): Array {\r\n return this._globalSettings.get(key);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/global.state.ts","module.exports = \"\\r\\n.modal1 {\\r\\n display: block;\\r\\n margin-top: 40px;\\r\\n height: 440px;\\r\\n width: 800px;\\r\\n position: fixed;\\r\\n float: right;\\r\\n margin-left: 220px;\\r\\n background-color: rgba(0, 0, 0, 0);\\r\\n left: 0;\\r\\n top: 0;\\r\\n z-index: 1;\\r\\n }\\r\\n \\r\\n /* Modal Content */\\r\\n .modal-content {\\r\\n background-color: #fefefe;\\r\\n margin: auto;\\r\\n padding: 20px;\\r\\n border: 1px solid #888;\\r\\n /* width: 70%; */\\r\\n /* position: fixed; */\\r\\n height: -webkit-fill-available;\\r\\n margin-left: 35pc;\\r\\n margin-top: 10pc;\\r\\n }\\r\\n \\r\\n /* The Close Button */\\r\\n .close {\\r\\n color: #FF0000;\\r\\n float: right;\\r\\n font-size: 28px;\\r\\n font-weight: bold;\\r\\n }\\r\\n \\r\\n .close:hover,\\r\\n .close:focus {\\r\\n color: #FF0000;\\r\\n text-decoration: none;\\r\\n cursor: pointer;\\r\\n }\\r\\n \\r\\n /* pagination */\\r\\n .pagination {\\r\\n display: inline-block;\\r\\n }\\r\\n \\r\\n .pagination a {\\r\\n color: black;\\r\\n float: left;\\r\\n padding: 8px 16px;\\r\\n text-decoration: none;\\r\\n }\\r\\n \\r\\n .pagination a.active {\\r\\n background-color: #4CAF50;\\r\\n color: white;\\r\\n }\\r\\n \\r\\n .pagination a:hover:not(.active) {\\r\\n background-color: #ddd;\\r\\n }\\r\\n \\r\\n /* tooltip */\\r\\n #MyTable {\\r\\n border-style: solid;\\r\\n border-color: black;\\r\\n border-width: 2px\\r\\n }\\r\\n \\r\\n #MyTable td {\\r\\n border-style: solid;\\r\\n border-color: black;\\r\\n border-width: 1px;\\r\\n padding: 3px;\\r\\n }\\r\\n \\r\\n .CellWithComment {\\r\\n position: relative;\\r\\n }\\r\\n \\r\\n .CellComment {\\r\\n margin-top: 20px;\\r\\n display: none;\\r\\n position: absolute;\\r\\n z-index: 100;\\r\\n border: 1px;\\r\\n background-color: white;\\r\\n border-style: solid;\\r\\n border-width: 1px;\\r\\n padding: 3px;\\r\\n color: #655e5e;\\r\\n top: 20px;\\r\\n background: #eef1f2;\\r\\n width: 180px;\\r\\n text-align: center;\\r\\n border-radius: 10px;\\r\\n font-size: 12px;\\r\\n font-family: cursive;\\r\\n padding: 0px;\\r\\n line-height: 20px;\\r\\n }\\r\\n \\r\\n .CellWithComment:hover span.CellComment {\\r\\n display: block;\\r\\n }\\r\\n \\r\\n /* .table tr.active td {\\r\\n background-color:#123456 !important;\\r\\n color: white;\\r\\n } */\\r\\n \\r\\n .table tr.active td {\\r\\n background-color:#123456 !important;\\r\\n color: white;\\r\\n }\\r\\n .highlighted\\r\\n {\\r\\n background: silver;\\r\\n color: black;\\r\\n }\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/pStyle.css\n// module id = 17\n// module chunks = 22","import { NgModule, ModuleWithProviders } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ReactiveFormsModule, FormsModule } from '@angular/forms';\r\nimport { RouterModule } from '@angular/router';\r\nimport { NgUploaderModule } from 'ngx-uploader';\r\nimport {BusyModule} from 'angular2-busy';\r\nimport {MdInputModule,MdAutocompleteModule,MdCheckboxModule,MdDatepickerModule,MdSelectModule,MaterialModule,MdDialogModule,MdNativeDateModule, MATERIAL_SANITY_CHECKS,ConnectedOverlayPositionChange} from '@angular/material';\r\n\r\nimport {\r\n BaThemeConfig\r\n} from './theme.config';\r\n\r\nimport {\r\n BaThemeConfigProvider\r\n} from './theme.configProvider';\r\n\r\nimport {\r\n BaAmChart,\r\n BaBackTop,\r\n BaCard,\r\n BaChartistChart,\r\n BaCheckbox,\r\n BaContentTop,\r\n BaFullCalendar,\r\n BaMenuItem,\r\n BaMenu,\r\n BaMsgCenter,\r\n BaMultiCheckbox,\r\n BaPageTop,\r\n BaPictureUploader,\r\n BaSidebar\r\n \r\n} from './components';\r\n\r\nimport { BaCardBlur } from './components/baCard/baCardBlur.directive';\r\n\r\nimport {\r\n BaScrollPosition,\r\n BaSlimScroll,\r\n BaThemeRun\r\n} from './directives';\r\n\r\nimport {\r\n BaAppPicturePipe,\r\n BaKameleonPicturePipe,\r\n BaProfilePicturePipe,\r\n TwoDigitNumber\r\n} from './pipes';\r\n\r\nimport {\r\n BaImageLoaderService,\r\n BaMenuService,\r\n BaThemePreloader,\r\n BaThemeSpinner\r\n} from './services';\r\n\r\nimport {\r\n EmailValidator,\r\n EqualPasswordsValidator,\r\n EditPasswordValidator\r\n} from './validators';\r\nimport { AuthService } from '../common/services/permission';\r\n\r\nconst NGA_COMPONENTS = [\r\n BaAmChart,\r\n BaBackTop,\r\n BaCard,\r\n BaChartistChart,\r\n BaCheckbox,\r\n BaContentTop,\r\n BaFullCalendar,\r\n BaMenuItem,\r\n BaMenu,\r\n BaMsgCenter,\r\n BaMultiCheckbox,\r\n BaPageTop,\r\n BaPictureUploader,\r\n BaSidebar\r\n];\r\n\r\nconst NGA_DIRECTIVES = [\r\n BaScrollPosition,\r\n BaSlimScroll,\r\n BaThemeRun,\r\n BaCardBlur\r\n];\r\n\r\nconst NGA_PIPES = [\r\n BaAppPicturePipe,\r\n BaKameleonPicturePipe,\r\n BaProfilePicturePipe,\r\n TwoDigitNumber\r\n];\r\n\r\nconst NGA_SERVICES = [\r\n BaImageLoaderService,\r\n BaThemePreloader,\r\n BaThemeSpinner,\r\n BaMenuService\r\n];\r\n\r\nconst NGA_VALIDATORS = [\r\n EmailValidator,\r\n EqualPasswordsValidator,\r\n EditPasswordValidator\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...NGA_PIPES,\r\n ...NGA_DIRECTIVES,\r\n ...NGA_COMPONENTS,\r\n \r\n ],\r\n imports: [\r\n CommonModule,\r\n RouterModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n NgUploaderModule,MdInputModule,MdSelectModule,MdAutocompleteModule,\r\n MdCheckboxModule,MaterialModule,MdDatepickerModule,MdDialogModule,MdNativeDateModule,BusyModule,\r\n \r\n ],\r\n exports: [\r\n ...NGA_PIPES,\r\n ...NGA_DIRECTIVES,FormsModule,CommonModule,\r\n ReactiveFormsModule,\r\n ...NGA_COMPONENTS,MdInputModule,MdSelectModule,MdAutocompleteModule,\r\n MdCheckboxModule,MaterialModule,MdDatepickerModule,BusyModule,\r\n ]\r\n})\r\nexport class NgaModule {\r\n static forRoot(): ModuleWithProviders {\r\n return {\r\n ngModule: NgaModule,\r\n providers: [\r\n BaThemeConfigProvider,\r\n BaThemeConfig, \r\n ...NGA_VALIDATORS,\r\n ...NGA_SERVICES,\r\n \r\n ],\r\n };\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/theme/nga.module.ts","export * from './setting.service';\r\nexport * from './common.service';\r\nexport * from './AppSettings';\r\nexport * from './IndexedDbWrapper';\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/index.ts","import { Injectable, OnInit, OnDestroy } from '@angular/core'\r\nimport { CACHE_CONSTANT, CacheService } from \"./cacheService.service\";\r\nimport { Http, Headers, Response, RequestOptions } from '@angular/http';\r\nimport { Subscription } from 'rxjs/subscription';\r\nimport { CookieService } from 'angular2-cookie/core';\r\n\r\n@Injectable()\r\nexport class AuthService implements OnInit, OnDestroy {\r\n cache_constant: CACHE_CONSTANT = {};\r\n private _subscriptions: Array = [];\r\n constructor(private cacheService: CacheService, private _cookieService: CookieService) {\r\n\r\n }\r\n ngOnInit() {\r\n \r\n }\r\n\r\n isAuthorized(routeInstruction: any) {\r\n let profile = this.getUserProfile();\r\n return this.isAuthenticated(profile);\r\n }\r\n removeAuth(): void {\r\n this.cacheService.remove('USER_PROFILE');\r\n this.cacheService.remove('TOKEN');\r\n\r\n }\r\n isAuthenticated(profile: any) {\r\n return !!profile;\r\n }\r\n setAuth(auth: any) {\r\n this.cacheService.set('USER_PROFILE', auth.profile);\r\n this.cacheService.set('TOKEN', auth.token);\r\n this.cacheService.set('setting', auth.setting);\r\n //this.setting.appSetting.setSetting(auth.setting);\r\n }\r\n\r\n setSessionVariable(key: string, value: any) {\r\n if (this.cacheService.exist(key))\r\n this.cacheService.remove(key);\r\n this.cacheService.set(key, value);\r\n\r\n }\r\n\r\n getSessionVariable(key: string) {\r\n if (!this.cacheService.exist(key)) {\r\n return null;\r\n }\r\n let sessionVariable = this.cacheService.get(key);\r\n return sessionVariable;\r\n }\r\n removeSessionVariable(key: string) {\r\n this.cacheService.remove(key);\r\n }\r\n\r\n getAuth(): any {\r\n let auth: any = {\r\n profile: this.cacheService.get('USER_PROFILE'),\r\n token: this.cacheService.get('TOKEN'),\r\n\r\n };\r\n return auth;\r\n }\r\n\r\n getCurrentCompanyId(): any {\r\n let compnyId = 0;\r\n var profile = this.cacheService.get('USER_PROFILE');\r\n if(profile)\r\n {\r\n compnyId = profile.CompanyInfo.COMPANYID ? profile.CompanyInfo.COMPANYID : 0;\r\n }\r\n return compnyId;\r\n }\r\n\r\n\r\n getUserProfile(): any {\r\n if (!this.cacheService.exist('USER_PROFILE')) {\r\n return null;\r\n }\r\n let userProfile = this.cacheService.get('USER_PROFILE');\r\n return userProfile;\r\n }\r\n\r\n checkUserRight(right: string) {\r\n let user_profile: any = this.getUserProfile();\r\n let user_rights: any;\r\n var result: any[];\r\n if (user_profile) {\r\n user_rights = user_profile.userRights;\r\n if (user_rights) {\r\n result = user_rights[right]\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n ///function for canactivate menu\r\n public getMenuRight(menu: string, right: string): any { \r\n var result = { list: false, right: false }; \r\n if (menu == \"\") return result;\r\n let user_profile: any = this.getUserProfile();\r\n let menu_rights: any[] = [];\r\n\r\n var list: boolean = false;\r\n var mRight: boolean = false;\r\n if (user_profile) {\r\n menu_rights = user_profile.menuRights;\r\n if (menu_rights) {\r\n for (var m in menu_rights) {\r\n if (menu_rights[m].menu == menu) {\r\n if (menu_rights[m].right.length > 0) { list = true; }\r\n for (var r in menu_rights[m].right) {\r\n\r\n if (menu_rights[m].right[r] == right) {\r\n this.canActive = true;\r\n mRight = true\r\n\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n result = { list: list, right: mRight };\r\n return result;\r\n }\r\n\r\n public canActive: boolean = false;\r\n checkMenuRight(menu: string, right: string) {\r\n let user_profile: any = this.getUserProfile();\r\n let menu_rights: any[] = [];\r\n var result = false;\r\n if (user_profile) {\r\n menu_rights = user_profile.menuRights;\r\n if (menu_rights) {\r\n for (var m in menu_rights) {\r\n if (menu_rights[m].menu == menu) {\r\n for (var r in menu_rights[m].right) {\r\n if (menu_rights[m].right[r] == right) {\r\n this.canActive = result;\r\n result = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n getSetting() {\r\n if (!this.cacheService.exist('setting')) {\r\n return undefined;\r\n }\r\n let setting = this.cacheService.get('setting');\r\n return setting;\r\n }\r\n\r\n getCookie() {\r\n var cookie = this._cookieService.get(\"imsposcookie\");\r\n\r\n var j\r\n if (!cookie) {\r\n\r\n return undefined\r\n }\r\n\r\n return JSON.parse(cookie);\r\n\r\n }\r\n getRequestOption() {\r\n let headers: Headers = new Headers({ 'Content-type': 'application/json', 'Authorization': this.getAuth().token })\r\n return new RequestOptions({ headers: headers });\r\n }\r\n ngOnDestroy() {\r\n this._subscriptions.forEach(sub => {\r\n sub.unsubscribe();\r\n });\r\n }\r\n\r\n // ClientTerminalValidation(){\r\n // var CT= this._cookieService.get(\"imsposcookie\");\r\n // if(CT==null){return false;}\r\n // else{\r\n // }\r\n // }\r\n PhiscalObj:any={};\r\n userProfile: any = {};\r\n getPhiscalInfo(){\r\n this.userProfile = this.getUserProfile();\r\n if(!this.userProfile) return;\r\n if(!this.userProfile.CompanyInfo) return;\r\n this.PhiscalObj.tabID = sessionStorage.tabID ? sessionStorage.tabID : sessionStorage.tabID = Math.random();\r\n this.PhiscalObj.PhiscalID = sessionStorage.PhiscalID ? sessionStorage.PhiscalID : sessionStorage.PhiscalID =this.userProfile.CompanyInfo.PhiscalID;\r\n this.PhiscalObj.BeginDate = sessionStorage.BeginDate ? sessionStorage.BeginDate : sessionStorage.BeginDate =this.userProfile.CompanyInfo.FBDATE;\r\n this.PhiscalObj.EndDate = sessionStorage.EndDate ? sessionStorage.EndDate : sessionStorage.EndDate =this.userProfile.CompanyInfo.FEDATE;\r\n this.PhiscalObj.PhiscalName = sessionStorage.PhiscalName ? sessionStorage.PhiscalName : sessionStorage.PhiscalName =this.userProfile.CompanyInfo.PHISCALNAME;\r\n return this.PhiscalObj;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/permission/authService.service.ts","export * from './permission.service';\r\nexport * from './userToken.service';\r\nexport * from './guard.service';\r\nexport * from './sessionStorage.service';\r\n\r\nexport * from './authService.service';\r\nexport * from './cacheService.service';\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/permission/index.ts","\r\nimport { Injectable } from \"@angular/core\";\r\nimport { Router, NavigationStart } from \"@angular/router\";\r\nimport { Observable, Subject } from \"rxjs\";\r\n@Injectable()\r\nexport class SpinnerService {\r\n private showHideSpinnerSubject = new Subject();\r\n private keepAfterNavigationChange = false;\r\n\r\n constructor(private router: Router) {\r\n // clear alert message on route change\r\n router.events.subscribe(event => {\r\n if (event instanceof NavigationStart) {\r\n if (this.keepAfterNavigationChange) {\r\n // only keep for a single location change\r\n this.keepAfterNavigationChange = false;\r\n this.showHideSpinnerSubject.next(true);\r\n }\r\n else {\r\n // clear loading\r\n this.showHideSpinnerSubject.next(false);\r\n }\r\n }\r\n });\r\n }\r\n\r\n getSpinnerShowHide(): Observable {\r\n return this.showHideSpinnerSubject.asObservable();\r\n }\r\n show(loadingMessage : string) {\r\n this.showHideSpinnerSubject.next({text: loadingMessage, isLoading : true}); \r\n }\r\n hide() {\r\n this.showHideSpinnerSubject.next({text: \"\", isLoading : false});\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/spinner/spinner.service.ts","module.exports = (__webpack_require__(5))(124);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/BehaviorSubject.js from dll-reference vendor_lib\n// module id = 26\n// module chunks = 22","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n Injector,\r\n HostListener,\r\n OnChanges,\r\n ElementRef,\r\n ViewChild\r\n} from \"@angular/core\";\r\nimport { PagedListingComponentBase } from \"../../../paged-list-component-base\";\r\nimport { MasterRepo } from \"../../repositories\";\r\nimport { TransactionService } from \"../../Transaction Components/transaction.service\";\r\nimport { ActivatedRoute } from \"@angular/router\";\r\n\r\n@Component({\r\n selector: \"generic-popup-grid\",\r\n template: require('./generic-popup-grid.component.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')]\r\n})\r\nexport class GenericPopUpComponent extends PagedListingComponentBase\r\n implements OnChanges {\r\n /** List Declaration */\r\n\r\n requestUrl: string = \"\";\r\n\r\n isActive: boolean = false;\r\n itemList: any[] = [];\r\n selectedRowIndex: number = 0;\r\n tabindex: string = \"list\";\r\n\r\n //for transaction filter\r\n billTo: string = \"\";\r\n isForCancelOrder: boolean = false;\r\n\r\n /** Output */\r\n\r\n @Output() onPopUpClose = new EventEmitter();\r\n @Output() onItemDoubleClick = new EventEmitter();\r\n\r\n /** Input */\r\n\r\n @Input() popupsettings: GenericPopUpSettings;\r\n @Input() summary: string;\r\n @ViewChild('inputBox') inputBox:ElementRef\r\n @ViewChild('body') body:ElementRef\r\n @ViewChild('option') option:ElementRef;\r\n\r\n constructor(public injector: Injector, private masterService: MasterRepo,\r\n public _trnMainService: TransactionService,\r\n private route: ActivatedRoute\r\n\r\n ) {\r\n super(injector);\r\n }\r\n\r\n show(billTo: string = \"\", isForCancelOrder: boolean = false) { \r\n if(this._trnMainService.customerEvent==true){ \r\n setTimeout(() => {\r\n //this.option.nativeElement.focus();\r\n this.inputBox.nativeElement.focus()\r\n }, 10); \r\n }else{\r\n setTimeout(() => {\r\n //this.option.nativeElement.focus();\r\n this.inputBox.nativeElement.focus()\r\n }, 10); \r\n }\r\n\r\n this.summary = null;\r\n this.billTo = billTo;\r\n this.isForCancelOrder = isForCancelOrder;\r\n this.itemList = [];\r\n this.isActive = true;\r\n this.selectedRowIndex = 0;\r\n setTimeout(() => {\r\n this.setFilterOption();\r\n this.refreshPage();\r\n this.refresh(); \r\n }, 100) \r\n }\r\n\r\n setFilterOption(){\r\n if(this.popupsettings && this.popupsettings.columns.length){\r\n let filterIndex = this.popupsettings.defaultFilterIndex ? this.popupsettings.defaultFilterIndex : 0;\r\n if(this.popupsettings.columns.length <= filterIndex) return; \r\n \r\n // this.filterValue = \"\";\r\n this.filterOption = this.popupsettings.columns[filterIndex].key; \r\n \r\n }\r\n }\r\n\r\n getData() {\r\n this.summary = null;\r\n this.selectedRowIndex = 0;\r\n\r\n let apiEndpoints = this.popupsettings.apiEndpoints;\r\n let apiUrl = `${this.apiUrl}${apiEndpoints}?currentPage=${\r\n this.pageNumber\r\n }&maxResultCount=${this.pageSize}`;\r\n\r\n if (this.billTo && this.billTo != \"\" && this.billTo != null && this.billTo != undefined) {\r\n apiUrl = apiUrl + `&billTo=${this.billTo}`;\r\n }\r\n if (this.isForCancelOrder) {\r\n apiUrl = apiUrl + `&isForCancelOrder=${this.isForCancelOrder}`;\r\n }\r\n\r\n this.requestUrl = this.getFilterOption(apiUrl);\r\n\r\n return this._http\r\n .get(this.requestUrl, this.masterService.getRequestOption())\r\n .map(res => res.json() || [])\r\n .subscribe(res => {\r\n \r\n this.totalItems = res ? res.totalCount : 0;\r\n this.itemList = res ? res.data : [];\r\n\r\n this.itemList.forEach(function (item) {\r\n if (item.TRNDATE != null && item.TRNDATE != undefined) {\r\n item.TRNDATE = item.TRNDATE.toString().substring(0, 10);\r\n }\r\n if (item.DATE != null && item.DATE != undefined) {\r\n item.DATE = item.DATE.toString().substring(0, 10);\r\n }\r\n });\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n\r\n if (\r\n this.itemList.length > 0 &&\r\n this.selectedRowIndex == 0 &&\r\n this.itemList[this.selectedRowIndex].itemSummary\r\n ) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n });\r\n }\r\n\r\n hide() {\r\n this.itemList = [];\r\n this.pageNumber = 1;\r\n this.totalItems = 0;\r\n this.isActive = false;\r\n }\r\n\r\n triggerSearch() {\r\n if (\r\n this.filterOption == null ||\r\n this.filterOption == undefined ||\r\n this.filterOption == \"\"\r\n )\r\n return;\r\n if (\r\n this.filterValue == null ||\r\n this.filterValue == undefined ||\r\n this.filterValue == \"\"\r\n )\r\n return;\r\n\r\n this.refreshPage();\r\n this.refresh();\r\n }\r\n\r\n singleClick(index) {\r\n this.selectedRowIndex = index;\r\n this.summary = this.itemList[index].itemSummary;\r\n }\r\n\r\n doubleClick($event) {\r\n this.onItemDoubleClick.emit($event);\r\n this.hide();\r\n }\r\n\r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n // @debounce(10)\r\n updown($event: KeyboardEvent) {\r\n if(!this.isActive) return true;\r\n if ($event.code == \"ArrowDown\") {\r\n $event.preventDefault();\r\n\r\n this.selectedRowIndex++;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n this.calculateTotalPages();\r\n if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber < this.totalPages\r\n ) {\r\n\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n this.selectedRowIndex = 0;\r\n this.itemListClosed();\r\n } else if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber == this.totalPages\r\n ) {\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n }\r\n } else if ($event.code == \"ArrowUp\") {\r\n $event.preventDefault();\r\n this.selectedRowIndex--;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n if (this.selectedRowIndex == -1 && this.pageNumber > 1) {\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n this.itemListClosed();\r\n } else if (this.selectedRowIndex == -1 && this.pageNumber == 1) {\r\n this.selectedRowIndex = 0;\r\n }\r\n } else if (\r\n ($event.code == \"Enter\" || $event.code == \"NumpadEnter\") &&\r\n this.selectedRowIndex >= 0 &&\r\n this.selectedRowIndex < this.itemList.length\r\n ) {\r\n $event.preventDefault();\r\n if(this.filterOption==\"BARCODE\")\r\n {}\r\n else{\r\n this.onItemDoubleClick.emit(this.itemList[this.selectedRowIndex]);\r\n this.hide();\r\n this.itemListClosed();\r\n }\r\n } else if ($event.code == \"Escape\" && this.route.snapshot.url[0].path != 'addsientry') {\r\n $event.preventDefault();\r\n this.hide();\r\n this.itemListClosed();\r\n } else if ($event.code == \"ArrowRight\") {\r\n $event.preventDefault();\r\n this.calculateTotalPages();\r\n if (this.pageNumber >= this.totalPages) {\r\n this.pageNumber = this.totalPages;\r\n return;\r\n }\r\n\r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n } else if ($event.code == \"ArrowLeft\") {\r\n $event.preventDefault();\r\n if (this.pageNumber <= 1) {\r\n this.pageNumber = 1;\r\n return;\r\n }\r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n\r\n }\r\n }\r\n\r\n itemListClosed() {\r\n this.onPopUpClose.emit();\r\n }\r\n\r\n ngOnChanges(changes: any) {\r\n this.popupsettings = changes.popupsettings.currentValue;\r\n }\r\n\r\n scrollToTop(){\r\n this.body.nativeElement.scrollTop=0;\r\n }\r\n}\r\n\r\nexport class GenericPopUpSettings {\r\n title: string;\r\n apiEndpoints: string;\r\n columns: ColumnSettings[] = [];\r\n defaultFilterIndex : number = 0;\r\n}\r\n\r\nexport class ColumnSettings {\r\n key: string;\r\n title: string;\r\n hidden: boolean = false;\r\n noSearch: boolean = false;\r\n}\r\n\r\nexport function debounce(delay: number): MethodDecorator {\r\n return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {\r\n\r\n const original = descriptor.value;\r\n const key = `__timeout__${propertyKey}`;\r\n\r\n descriptor.value = function (...args) {\r\n clearTimeout(this[key]);\r\n this[key] = setTimeout(() => original.apply(this, args), delay);\r\n };\r\n\r\n return descriptor;\r\n };\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/generic-grid/generic-popup-grid.component.ts","module.exports = (__webpack_require__(5))(12);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/Subject.js from dll-reference vendor_lib\n// module id = 29\n// module chunks = 22","import { ImporterPriceCalc, TAcList } from './Account.interface';\r\nimport { Product } from \"./ProductItem\";\r\nexport interface TrnMain {\r\n Mode: string;\r\n NextVno: string;\r\n TotalWithIndDiscount: number;\r\n guid: string;\r\n ReplaceIndividualWithFlatDiscount: number;\r\n TOTALINDDISCOUNT: number;\r\n TOTALLOYALTY: number;\r\n TOTALPROMOTION: number;\r\n TOTALFLATDISCOUNT: number;\r\n COSTCENTER: string;\r\n RECEIVEBY: string;\r\n STATUS: number;\r\n CONFIRMEDBY: string;\r\n CONFIRMEDTIME: string;\r\n PhiscalID: string;\r\n Stamp: number;\r\n Customer_Count: number;\r\n DBUSER: string;\r\n HOSTID: string;\r\n ORDERS: number;\r\n REFORDBILL: string;\r\n INDDIS: number;\r\n CREBATE: number;\r\n CREDIT: number;\r\n DUEDATE: Date | string;\r\n TRNAC: string;\r\n PARAC: string;\r\n TRNACName: string;\r\n PARTRNAMNT: number;\r\n RETTO: string;\r\n REFBILL: string;\r\n CHEQUENO: string;\r\n CHEQUEDATE: Date | string;\r\n EDATE: Date | string;\r\n POST: number;\r\n POSTUSER: string;\r\n FPOSTUSER: string;\r\n SHIFT: string;\r\n EXPORT: number;\r\n CHOLDER: string;\r\n CARDNO: string;\r\n EditUser: string;\r\n MEMBERNO: string;\r\n MEMBERNAME: string;\r\n EDITED: number;\r\n VMODE: number;\r\n BILLTOTEL: string;\r\n BILLTOMOB: string;\r\n TRN_DATE: Date | string;\r\n BS_DATE: string;\r\n STAX: number;\r\n TOTALCASH: number;\r\n TOTALCREDIT: number;\r\n TOTALCREDITCARD: number;\r\n TOTALGIFTVOUCHER: number;\r\n CardTranID: string;\r\n ReturnVchrID: string;\r\n TranID: number;\r\n VoucherStatus: boolean;\r\n PRESCRIBEBY: string;\r\n DISPENSEBY: string;\r\n Longitude: string;\r\n Latitude: string;\r\n MobileNo: string;\r\n DeliveryDate: Date | string;\r\n DeliveryAddress: string;\r\n DeliveryTime: string;\r\n DeliveryMiti: string;\r\n OrderNo: string;\r\n ADJWARE: string;\r\n BATCHNO: string;\r\n BATCHNAME: string;\r\n DPSNO: string;\r\n EDITTIME: string;\r\n EID: string;\r\n EXTRACHARGE: string;\r\n ISSUEWARE: string;\r\n ADVANCE: number;\r\n VoucherType: VoucherTypeEnum;\r\n VoucherAbbName: string;\r\n VoucherName: string;\r\n VoucherPrefix: string;\r\n NextNumber: number;\r\n VCHRNO: string;\r\n CHALANNO: string;\r\n DIVISION: string;\r\n TRNDATE: Date | string;\r\n BSDATE: string;\r\n TRNTIME: string;\r\n TOTAMNT: number;\r\n DCAMNT: number;\r\n DCRATE: number;\r\n VATAMNT: number;\r\n NETAMNT: number;\r\n TRNMODE: string;\r\n TAXABLE: number;\r\n NONTAXABLE: number;\r\n BILLTO: string;\r\n BILLTOADD: string;\r\n TRNUSER: string;\r\n TERMINAL: string;\r\n TENDER: number;\r\n CHANGE: number;\r\n ROUNDOFF: number;\r\n NETWITHOUTROUNDOFF: number;\r\n ServiceCharge: number;\r\n IsTable: boolean;\r\n IsVATBill: boolean;\r\n VATBILL: number;\r\n REMARKS: string;\r\n VoucherNumber: number;\r\n MWAREHOUSE: string;\r\n TrntranList: Trntran[];\r\n AdditionTranList: Trntran[];\r\n ProdList: TrnProd[];\r\n AdditionProdList: TrnProd[];\r\n FCurrency: string;\r\n EXRATE: number;\r\n TOTALDISCOUNT: number;\r\n TOTALDISCOUNT_VATINCLUDED:number;\r\n AdditionalCostJson:string;\r\n \r\n CREDITDAYS: number;\r\n InvAmount: number;\r\n DiscRate: number;\r\n RoundOffAmount: number;\r\n ManualDiscount: number;\r\n BRANCH: string;\r\n BALANCE: number;\r\n TOTALQTY: number;\r\n TOTALWEIGHT: number;\r\n AdditionalObj: TrnMain_AdditionalInfo\r\n SHIPNAME: string;\r\n INVOICETYPE: string;\r\n TRNTYPE: string;\r\n TenderList: TBillTender[];\r\n PARTY_ORG_TYPE: string;\r\n HOLDBILLID: number;\r\n TransporterEway:Transporter_Eway;\r\n IsAccountBase : boolean;\r\n hasShipName:boolean;\r\n tag:string;\r\n CUS_FIX_DISCOUNT_PER:number;\r\n DmsSchemesApplied:any\r\n SALESMANID:string;\r\n SALESMAN:string;\r\n CUS_Remote_Discount:number; \r\n totalAlternateQuantity: number;\r\n totalBaseQuantity: number; \r\n ROUTE:string;\r\n salesmanName:string;\r\n TOTALPRIMARYDISCOUNT: number;\r\n TOTALSECONDARYDISCOUNT: number;\r\n TOTALLIQUIDATIONDISCOUNT: number;\r\n TOTALQPSDISCOUNT:number;\r\n SETTLEMENTMODE:string;\r\n StockTempVchrno : string\r\n isSelfBill : boolean;\r\n CNDN_MODE : number;\r\n CHALANNOPREFIX: any;\r\n isOneisToManyvchr : boolean;\r\n TOTALALLDISCOUNT:number; //to get TOTAL DISCOUNT(IND+SCHEME+FLAT...)\r\n IMPORTDETAILS: IMPORT_DETAILS;\r\n gstInfoOfAccount: any;\r\n DOPARTIALSALESRETURN:number;\r\n DOFULLRETURN:number;\r\n dataOrigin:string;\r\n}\r\nexport interface TrnProd {\r\n INDDISCOUNT: number;\r\n FLATDISCOUNT: number;\r\n NETAMOUNT: number;\r\n LOYALTY: number;\r\n PROMOTION: number;\r\n ISSERVICECHARGE: number;\r\n ISVAT: number;\r\n ADDTIONALROW: number;\r\n COSTCENTER: string;\r\n VCHRNO: string;\r\n CHALANNO: string;\r\n DIVISION: string;\r\n MCODE: string;\r\n UNIT: string;\r\n Quantity: number;\r\n RealQty: number;\r\n AltQty: number;\r\n RATE: number;\r\n AMOUNT: number;\r\n DISCOUNT: number;\r\n VAT: number;\r\n REALRATE: number;\r\n EXPORT: number;\r\n IDIS: string;\r\n OPQTY: number;\r\n REALQTY_IN: number;\r\n ALTQTY_IN: number;\r\n WAREHOUSE: string;\r\n REFBILLQTY: number;\r\n SPRICE: number;\r\n EXPDATE: Date | string;\r\n REFOPBILL: number;\r\n ALTUNIT: string;\r\n TRNAC: string;\r\n PRATE: number;\r\n VRATE: number;\r\n ALTRATE: number;\r\n VPRATE: number;\r\n VSRATE: number;\r\n TAXABLE: number;\r\n NONTAXABLE: number;\r\n SQTY: number;\r\n REMARKS: string;\r\n INVRATE: number;\r\n EXRATE: number;\r\n NCRATE: number;\r\n CRATE: number;\r\n SNO: number;\r\n CUSTOM: number;\r\n WEIGHT: number;\r\n DRATE: number;\r\n CARTON: number;\r\n INVOICENO: string;\r\n ISSUENO: string;\r\n BC: string;\r\n GENERIC: string;\r\n BATCH: string;\r\n DISMODE:string;\r\n MFGDATE: Date | string;\r\n MANUFACTURER: string;\r\n SERVICETAX: number;\r\n BCODEID: number;\r\n VoucherType: number;\r\n SALESMANID: number;\r\n PhiscalID: string;\r\n STAMP: number;\r\n ITEMDESC: string;\r\n MENUCODE: string;\r\n TOTAL: number;\r\n Ptype: number;\r\n Product: Product;\r\n unitQty: UnitAndQty;\r\n Mcat: string;\r\n Mcat1: string;\r\n ITEMTYPE: string;\r\n HASITEMTYPE: number;\r\n RECEIVEDTYPE: string;\r\n inputMode: boolean;\r\n index: number;\r\n MRP: number;\r\n GODOWN: string;\r\n INDDISCOUNTRATE: number;\r\n SELECTEDITEM: any;\r\n BRANCH: string;\r\n Supplier: string;\r\n STOCK: number;\r\n ALLSCHEME: any;\r\n BATCHSCHEME: any;\r\n PrimaryDiscount: number;\r\n SecondaryDiscount: number;\r\n LiquiditionDiscount: number;\r\n BasePrimaryDiscount: number;\r\n BaseSecondaryDiscount: number;\r\n BaseLiquiditionDiscount: number;\r\n QpsDiscount : number;\r\n ALTUNITObj: any;\r\n ALTRATE2: number;\r\n RATE2: number;\r\n GSTRATE: number;\r\n CONFACTOR: number;\r\n ALTCONFACTOR:number;\r\n ACNAME: string;\r\n GSTRATE_ONLYFORSHOWING: number;\r\n VAT_ONLYFORSHOWING: number;\r\n PClist:any[];\r\n INDIVIDUALDISCOUNT_WITHVAT:number;\r\n IsApproveStockSettlement:boolean;\r\n ALTMRP:number;\r\n BASEQUANTITY:number;\r\n ALTERNATEQUANTIY:number;\r\n BASEUNIT:string;\r\n ALTERNATEUNIT:string;\r\n PWEIGHT:number; \r\n PRICEID:string;\r\n SHELFLIFE:number;\r\n Weighable:string;\r\n FixedDiscount:number;\r\n RemoteDiscount:number;\r\n isApproved:number;\r\n backgroundcolor:string; \r\n SCHEMENO: string;\r\n SCHEMESAPPLIED:string;\r\n PISTOCK:number;\r\n OPSTOCK:number;\r\n BATCHID:string; //0531 BATCHID comment \r\n ProrataDis:number;\r\n ADDITIONAL_SCHEME: number;\r\n EXCLUSIVE_SCHEME: number;\r\n ImporterPriceCalcList:ImporterPriceCalc;\r\n Total:number;\r\n CostPerUnit:number;\r\n IsCostingSaved:boolean;\r\n HS_Code:string;\r\n}\r\n\r\nexport class Trntran {\r\n\r\n ACNAME: string;\r\n SubledgerTranList: TSubLedgerTran[];\r\n AccountItem: TAcList;\r\n VCHRNO: string;\r\n CHALANNO: string;\r\n DIVISION: string;\r\n A_ACID: string;\r\n DRAMNT: number;\r\n CRAMNT: number;\r\n B_ACID: string;\r\n NARATION: string;\r\n TOACID: string;\r\n NARATION1: string;\r\n VoucherType: VoucherTypeEnum;\r\n ChequeNo: string;\r\n ChequeDate: string;\r\n CostCenter: string;\r\n MultiJournalSno: number;\r\n PhiscalID: string;\r\n SNO: number;\r\n ROWMODE: string;\r\n acType: string;\r\n hasDebit: boolean;\r\n hasCredit: boolean;\r\n drBGColor: string;\r\n crBGColor: string;\r\n drColor: string;\r\n crColor: string;\r\n inputMode: boolean;\r\n editMode: boolean;\r\n acitem: any;//to hold the select acount Item value;\r\n PartyDetails : PartyOpeningDetail[] = [];\r\n SL_ACID:string;\r\n SL_ACNAME:string;\r\n disableSubLedger:boolean;\r\n}\r\n\r\nexport class PartyOpeningDetail {\r\n VCHRNO : string;\r\n DIVISION : string;\r\n REFVNO : string;\r\n ACID : string;\r\n REFDATE : string;\r\n AMOUNT : number;\r\n CLRAMOUNT : number;\r\n DUEAMT : number;\r\n DUEDATE : string;\r\n REFSNO : string;\r\n PHISCALID : string;\r\n STAMP : string\r\n}\r\n\r\n\r\nexport interface TSubLedgerTran {\r\n SNO: number;\r\n VCHRNO: string;\r\n CHALANNO: string;\r\n DIVISION: string;\r\n A_ACID: string;\r\n DRAMNT: number;\r\n CRAMNT: number;\r\n B_ACID: string;\r\n NARATION: string;\r\n TOACID: string;\r\n VoucherType: VoucherTypeEnum;\r\n PhiscalID: string;\r\n MultiJournalSno: number;\r\n SubledgerItem: TSubLedger;\r\n ACNAME: string;\r\n Amount: number;\r\n ROWMODE: string;\r\n inputMode: boolean;\r\n editMode: boolean;\r\n}\r\nexport interface TSubLedger {\r\n SERIAL: number;\r\n ACID: string;\r\n ACCODE: string;\r\n ACNAME: string;\r\n PARENT: string;\r\n TYPE: string;\r\n OPBAL: number;\r\n MAPID: string;\r\n IsBasicAc: number;\r\n ADDRESS: string;\r\n PHONE: string;\r\n FAX: string;\r\n EMAIL: string;\r\n VATNO: string;\r\n PType: string;\r\n CRLIMIT: number;\r\n CRPERIOD: number;\r\n SALEREF: number;\r\n LEVELS: number;\r\n FLGNEW: number;\r\n COMMON: number;\r\n PATH: string;\r\n INITIAL: string;\r\n}\r\n\r\nexport interface UnitAndQty {\r\n Unit: string;\r\n Qty: number;\r\n Rate: number;\r\n BaseUnit: string;\r\n BaseQty: number;\r\n BaseRate: number;\r\n ConversionFactor: number;\r\n}\r\n\r\nexport interface AlternateUnit {\r\n SNO: number;\r\n MCODE: string;\r\n ALTUNIT: string;\r\n CONFACTOR: number;\r\n RATE: number;\r\n ISDEFAULT: number;\r\n ISDEFAULTPRATE: number;\r\n BRCODE: string;\r\n RATE_A: number;\r\n RATE_B: number;\r\n RATE_C: number;\r\n RATE_D: number;\r\n PRATE: number;\r\n ISDISCONTINUE: number;\r\n\r\n}\r\nexport interface CostCenter {\r\n CostCenterName: string;\r\n DIVISION: string;\r\n Parent: string;\r\n TYPE: string;\r\n}\r\n\r\nexport interface Division {\r\n INITIAL: string;\r\n NAME: string;\r\n REMARKS: string;\r\n MAIN: string;\r\n COMNAME: string;\r\n COMADD: string;\r\n}\r\nexport interface Warehouse {\r\n NAME: string;\r\n ADDRESS: string;\r\n PHONE: string;\r\n REMARKS: string;\r\n ISDEFAULT: boolean;\r\n IsAdjustment: number;\r\n AdjustmentAcc: string;\r\n ISVIRTUAL: number;\r\n VIRTUAL_PARENT: string;\r\n DIVISION: string;\r\n WarehouseType: string;\r\n // WID: number;\r\n}\r\n\r\nexport interface TrnSchemeApplied{\r\n VCHRNO:string; \r\n DIVISION:string; \r\n PhiscalID:string; \r\n SchemeNo:string; \r\n SchemePercent:number; \r\n SchemeAmount :number;\r\n CompanyId:string; \r\n \r\n}\r\n\r\nexport interface Branch {\r\n COMPANYID: string;\r\n companyAlias: string;\r\n name: string;\r\n type: string;\r\n chanel: string;\r\n margin: string;\r\n remarks: string;\r\n PARENTBRANCHID: string;\r\n}\r\n\r\nexport enum VoucherTypeEnum {\r\n Default = 0,\r\n Sales = 1,\r\n SalesReturn = 2,\r\n Purchase = 3,\r\n PurchaseReturn = 4,\r\n StockIssue = 5,\r\n StockReceive = 6,\r\n BranchTransferIn = 7,\r\n BranchTransferOut = 8,\r\n StockSettlement = 9,\r\n Stockadjustment = 10,\r\n Receipe = 11,\r\n Journal = 12,\r\n Delivery = 13,\r\n TaxInvoice = 14,\r\n CreditNote = 15,\r\n DebitNote = 16,\r\n PaymentVoucher = 17,\r\n ReceiveVoucher = 18,\r\n PurchaseOrder = 19,\r\n SalesOrder = 20,\r\n DeliveryReturn = 21,\r\n AccountOpeningBalance = 22,\r\n PartyOpeningBalance = 23,\r\n OpeningStockBalance = 24,\r\n SubLedgerOpeningBalance = 25,\r\n GoodsReceived = 26,\r\n PerformaSalesInvoice = 57,\r\n PurchaseOrderCancel = 58,\r\n RequestIndent = 59,\r\n StockSettlementEntryApproval = 60,\r\n TaxInvoiceCancel = 61,\r\n ContraVoucher = 62,\r\n CreditNoteApproval = 65,\r\n LoadSheet = 70,\r\n StockSample = 71,\r\n SelfBill = 72,\r\n ReverseSalesRetrun = 38,\r\n CancelProforma = 73,\r\n CapitalVoucher = 64,\r\n BatchTransfer = 74,\r\n AdditionalCost = 66\r\n}\r\n\r\nexport interface VoucherSatus {\r\n vouchertype: VoucherTypeEnum;\r\n VCHRNO: string;\r\n DIVISION: string;\r\n PhiscalID: string;\r\n BillMode: string;\r\n}\r\n\r\nexport interface DialogInfo {\r\n TRANSACTION: String;\r\n PARAC: string;\r\n DIVISION: any;\r\n DELEVERYLIST: String;\r\n SALESMODE: String;\r\n WARRENTYTODATE: Date;\r\n}\r\nexport interface TrnMain_AdditionalInfo {\r\n VCHRNO: string;\r\n STAMP: number;\r\n SHIPNAME: string;\r\n SHIPNAMEVIEW:string,\r\n TRNTYPE: string;\r\n CFORM: string;\r\n PAYMENTTYPE: string;\r\n RETURNMODE: string;\r\n PAYMENTMODE: string;\r\n PAYMENTTERMS: string;\r\n INVNO: string;\r\n INVDATE: Date;\r\n INVAMOUNT: number;\r\n TOTALGST: number;\r\n TOTALEXTRACESS: string;\r\n FREIGHT: string;\r\n CREDITDAYS: string;\r\n SOSTOCKSTATUS: string;\r\n INVOICETYPE: string;\r\n COUPONBALANCE: string;\r\n BILLFORMATS: string;\r\n BILLUNITS: string;\r\n VEHICLENO: string;\r\n RECEIVEDDATE: Date | string;\r\n RETURNTYPE: string;\r\n WAREHOUSETYPE: string;\r\n DUEDATE: Date | string;\r\n CUSTOMERTYPE:string;\r\n disableProductSelection:boolean;\r\n ROUTE:string;\r\n\r\n}\r\nexport class TenderObj {\r\n CREDIT: number;\r\n CHEQUE: number;\r\n CASH: number;\r\n WALLET: number;\r\n CARD: number;\r\n COUPON: number;\r\n CASHAMT: number;\r\n CARDAMT: number;\r\n CARDNO: string;\r\n CARDNAME: string;\r\n APPROVALCODE: string;\r\n CARDHOLDERNAME: string;\r\n CREDITAMT: number;\r\n CHEQUEAMT: number;\r\n CHEQUENO: string;\r\n DATE: Date;\r\n BANK: string;\r\n TOTAL: number;\r\n OUTSTANDING: string;\r\n ADVANCE: number;\r\n TENDERAMT: string;\r\n BALANCE: number;\r\n LOYALTYAMT: number;\r\n COUPONNAME: string;\r\n COUPONAMT: number;\r\n WALLETAMT: number;\r\n WALLETTYPE: string;\r\n WALLETCARDNO: string;\r\n TRNMODE: string;\r\n REMARKS: string;\r\n ACID: string;\r\n\r\n}\r\n\r\nexport class TBillTender {\r\n VCHRNO: string;\r\n DIVISION: string;\r\n TRNMODE: string;\r\n ACCOUNT: string;\r\n REMARKS: string;\r\n SN: number;\r\n AMOUNT: number;\r\n PHISCALID: string;\r\n CHANGE: number;\r\n STAMP: number;\r\n guid: string;\r\n TRANSACTIONID: string;\r\n OTP: string;\r\n PROVIDERNAME: string;\r\n PROVIDERACCOUNT: string;\r\n SALESMANID: number;\r\n // added by bzu\r\n CARDNO: string\r\n APPROVALCODE: string;\r\n CARDHOLDERNAME: string;\r\n}\r\n\r\nexport interface ExcelImportConfig {\r\n ImportName: string;\r\n ColumnName: string;\r\n SNO: number;\r\n ColumnSize: string;\r\n DataType: boolean;\r\n ColumnValue: number;\r\n Mandatory: string;\r\n AddToSheet: number;\r\n}\r\nexport interface Transporter_Eway {\r\n ID: number;\r\n VCHRNO: string;\r\n TRANSPORTER: string;\r\n VEHICLENO: string;\r\n PERSON: string;\r\n VEHICLENAME: string;\r\n DRIVERNAME:string;\r\n DRIVERNO: string;\r\n TOTALBOX: string;\r\n MODE: string;\r\n LRNO: string;\r\n LRDATE: Date;\r\n STAMP: Date;\r\n DISTANCE: number;\r\n EWAYNO: string;\r\n TOTALWEIGHT:number;\r\n COMPANYID:String;\r\n}\r\nexport interface IMPORT_DETAILS {\r\n DOCUMENTNO: string;\r\n LCNUM: string;\r\n TOTALVAT: number;\r\n TOTALQTY: number;\r\n TOTALTAXABLE: number;\r\n TOTALNONTAXABLE: number;\r\n NETAMOUNT: number;\r\n prodList: IMPORT_DETAILS_PROD[]\r\n\r\n}\r\n\r\nexport interface IMPORT_DETAILS_PROD {\r\n ITEMNAME: string;\r\n QUANTITY:number\r\n TAXABLE: number;\r\n NONTAXABLE: number;\r\n VAT: number;\r\n NETAMOUNT: number;\r\n}\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/interfaces/TrnMain.ts","module.exports = (__webpack_require__(5))(0);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/Observable.js from dll-reference vendor_lib\n// module id = 32\n// module chunks = 22","module.exports = \"/**\\r\\n * Applies styles for users in high contrast mode. Note that this only applies\\r\\n * to Microsoft browsers. Chrome can be included by checking for the `html[hc]`\\r\\n * attribute, however Chrome handles high contrast differently.\\r\\n */\\n/* Theme for the ripple elements.*/\\n/** The mixins below are shared between md-menu and md-select */\\n/**\\r\\n * This mixin adds the correct panel transform styles based\\r\\n * on the direction that the menu panel opens.\\r\\n */\\n/* stylelint-disable material/no-prefixes */\\n/* stylelint-enable */\\n/**\\r\\n * This mixin contains shared option styles between the select and\\r\\n * autocomplete components.\\r\\n */\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/_theming.scss\n// module id = 34\n// module chunks = 22","module.exports = (__webpack_require__(5))(13);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/Subscription.js from dll-reference vendor_lib\n// module id = 45\n// module chunks = 22","module.exports = (__webpack_require__(5))(207);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/Rx.js from dll-reference vendor_lib\n// module id = 46\n// module chunks = 22","export { BaMenuService } from './services';\r\nexport * from './theme.constants';\r\nexport * from './theme.configProvider';\r\nexport * from './theme.config';\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/theme/index.ts","import { Injectable, OnInit, OnDestroy, ViewChild } from '@angular/core';\r\nimport { Http, Headers, Response, RequestOptions } from '@angular/http';\r\nimport { CacheService, UserToken, AuthService } from '../../common/services/permission';\r\nimport { Subscription } from 'rxjs/subscription';\r\nimport { Subject } from 'rxjs/subject';\r\nimport { GlobalState } from '../../global.state';\r\nimport { Router } from '@angular/router';\r\nimport { Item } from \"../../common/interfaces/index\";\r\nimport { IndexedDbWrapper } from \"../../common/services\";\r\nimport { ModalDirective } from 'ng2-bootstrap';\r\n@Injectable()\r\nexport class LoginService implements OnInit, OnDestroy {\r\n private _subscriptions: Array = [];\r\n private apiUrl: string;\r\n UsersObj: any={};\r\n sendMail = true;\r\n securityCode = true;\r\n newPassword = true;\r\n searchUser = true;\r\n loginpage = true\r\n email: any;\r\n username:any;\r\n counter:number=0;\r\n constructor(private http: Http, private gblstate: GlobalState, private authSerice: AuthService, private router: Router, private dbWrapper: IndexedDbWrapper) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n }\r\n userProfile: Subject;\r\n mockLogin(username: string, password: string) {\r\n\r\n }\r\n login(username: string, password: string) {\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n return this.http.post(this.apiUrl + '/jwt', { username: username, password: password }, option)\r\n .map((response: Response) => {\r\n // login successful if there's a jwt token in the response\r\n let user = response.json();\r\n if (user && user.token) {\r\n // store user details and jwt token in local storage to keep user logged in between page refreshes\r\n this.authSerice.setAuth(user)\r\n\r\n // console.log(user);\r\n this.gblstate.setGlobalSetting(\"LoggedIn\", [true])\r\n // console.log(this.gblstate.getGlobalSetting(\"LoggedIn\"))\r\n this.gblstate.setGlobalSetting(\"userName\", [username])\r\n this.gblstate.setGlobalSetting(\"View-Permission\", ['Divisions', 'smartTables', 'addDivision']);\r\n // console.log(this.gblstate.getGlobalSetting(\"View-Permission\"))\r\n\r\n this.authSerice.setSessionVariable(\"LastProductChangeDateLocal\", new Date('1990-01-01T00:00:00'));\r\n this.authSerice.setSessionVariable(\"LastProductStockCheckDateLocal\", new Date('1990-01-01T00:00:00'));\r\n // this.dbWrapper.dbHelper.getMaxDate('PRODUCT', 'EDATE', (evt) => { \r\n // console.log({maxdate: evt});\r\n // if (evt) { \r\n // let maxDate = new Date((evt).EDATE);\r\n // this.authSerice.setSessionVariable(\"LastProductChangeDateLocal\",maxDate);\r\n // console.log({MaxDate: maxDate});\r\n // }\r\n // }).catch((error) =>\r\n // {\r\n // console.error({MaxFunctionError : error});\r\n // });\r\n\r\n\r\n }\r\n });\r\n }\r\n\r\n logout() {\r\n // remove user from local storage to log user out\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let reqOptions = this.authSerice.getRequestOption();\r\n let sub = this.http.get(this.apiUrl + \"/logout\", reqOptions)\r\n .subscribe(res => {\r\n let data = res.json();\r\n if (data.status == 'ok') {\r\n //this.router.navigate(['login']);\r\n }\r\n }, error => { \r\n // console.log({ logoutError: error });\r\n }\r\n )\r\n this._subscriptions.push(sub);\r\n this.authSerice.removeAuth();\r\n window.sessionStorage.removeItem('currentUser');\r\n this.gblstate.notifyDataChanged(\"LoggedIn\", false);\r\n this.gblstate.setGlobalSetting(\"LoggedIn\", [false]);\r\n this.gblstate.setGlobalSetting(\"userName\", ['']);\r\n this.gblstate.setGlobalSetting(\"View-Permission\", []);\r\n\r\n //this.cacheService.remove('currentUser');\r\n\r\n\r\n }\r\n\r\n ngOnDestroy() {\r\n this._subscriptions.forEach(sub => { sub.unsubscribe(); })\r\n }\r\n public getRequestOption() {\r\n let headers: Headers = new Headers({ 'Content-type': 'application/json', 'Authorization': this.authSerice.getAuth().token })\r\n // console.log({ headers: headers });\r\n return new RequestOptions({ headers: headers });\r\n }\r\n\r\n ForgetPwd(username: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n // console.log(this.apiUrl);\r\n // console.log({ username: username });\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n this.http.post(this.apiUrl + '/jwtForget', { username: username }, option)\r\n .subscribe((response: Response) => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n\r\n }\r\n sendEmail(Email: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n // console.log(this.apiUrl);\r\n // console.log({ username: Email });\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n this.http.post(this.apiUrl + '/SendEmail', { username: Email }, option)\r\n .subscribe((response: Response) => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n \r\n \r\n emailCode(RandomNumber: string,NewPassword:string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n return this.http.post(this.apiUrl + '/emailno', { RandomNumber: RandomNumber,username:this.username }, option)\r\n .map((response: Response) => {\r\n let user = response.json();\r\n if (user && user.token) {\r\n this.authSerice.setAuth(user)\r\n this.updatePassword(NewPassword,this.username) \r\n }\r\n else{\r\n // this.DialogMessage = \"Incorrect Code. Please try again\"\r\n alert(\"Incorrect Code. Please try again\")\r\n this.counter++;\r\n if(this.counter == 3){\r\n // this.DialogMessage = \"3 Incorrect Attempts, Retry after 15 minutes!\"\r\n alert(\"3 Incorrect Attempts, Retry after 15 minutes!\")\r\n this.saveDisableOTPEntryTime(this.username).subscribe(res=>{\r\n })\r\n }\r\n }\r\n \r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n \r\n }\r\n updatePassword(password: string, username: string) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n this.http.post(this.apiUrl + '/changePasswordFromLogin', {newPassword: password, username: this.username}, this.getRequestOption())\r\n .subscribe((response: Response) => {\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n alert(\"Password changed successful\")\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n localStorage.clear();\r\n this.loginpage = true;\r\n this.securityCode = false;\r\n this.sendMail = false;\r\n this.newPassword = false;\r\n }\r\n else {\r\n alert(\"error on changing password\")\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n localStorage.clear();\r\n }\r\n }, error => {\r\n alert(\"error on changing password\")\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n localStorage.clear();\r\n }\r\n );\r\n return returnSubject;\r\n\r\n }\r\n\r\n public saveDisableLoginTime(username: string) {\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n return this.http\r\n .post(this.apiUrl + \"/saveDisableLoginTime/\" + username, option)\r\n .map(data => data.json()).share()\r\n }\r\n\r\n public getDisableLoginTime(username: string) {\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n return this.http\r\n .post(this.apiUrl + \"/getDisableLoginTime/\" + username, option)\r\n .map(data => data.json()).share()\r\n }\r\n\r\n public saveDisableOTPEntryTime(username: string) {\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n return this.http\r\n .post(this.apiUrl + \"/saveDisableOTPEntryTime/\" + username, option)\r\n .map(data => data.json()).share()\r\n }\r\n\r\n public getDisableOTPEntryTime(username: string) {\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n return this.http\r\n .post(this.apiUrl + \"/getDisableOTPEntryTime/\" + username, option)\r\n .map(data => data.json()).share()\r\n }\r\n\r\n getTokenAfterSendEmail(username: string, password: string) {\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let header = new Headers({ 'content-type': 'application/json' });\r\n let option = new RequestOptions({ headers: header })\r\n // return;\r\n return this.http\r\n .post(this.apiUrl + '/getTokenAfterSendEmail', { username: username, password: password }, option)\r\n .map(data => data.json()).share()\r\n }\r\n\r\n public checkLoginDay(year: string,month: string) {\r\n let arr = this.gblstate.getGlobalSetting(\"apiUrl\");\r\n if (arr) { this.apiUrl = arr[0] }\r\n let bodyData = {year: year,month:month};\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http\r\n .post(this.apiUrl + \"/checkLoginDay\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/login/loginService.service.ts","module.exports = (__webpack_require__(5))(446);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/add/operator/debounceTime.js from dll-reference vendor_lib\n// module id = 55\n// module chunks = 22","module.exports = (__webpack_require__(5))(460);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/add/operator/filter.js from dll-reference vendor_lib\n// module id = 56\n// module chunks = 22","import {NgaModule} from '../../../theme/nga.module';\r\nimport {Component, Inject} from '@angular/core';\r\nimport {MdDialogRef, MD_DIALOG_DATA} from '@angular/material';\r\nimport { Observable } from \"rxjs/Observable\";\r\n\r\nexport interface DialogInfo{\r\n header: string;\r\n message: Observable;\r\n}\r\n\r\n@Component({\r\n selector:'result-dialog',\r\n template:`\r\n
\r\n
\r\n
\r\n
×
\r\n

{{heading}}

\r\n
\r\n \r\n
\r\n
\r\n {{message$|async}}\r\n
\r\n
\r\n
\r\n`\r\n})\r\nexport class MessageDialog{\r\n heading: string = \"Information\";\r\n message$: Observable;\r\n\r\n constructor(public dialogref:MdDialogRef, @Inject(MD_DIALOG_DATA) public data: DialogInfo){\r\n // console.log({data: data});\r\n this.heading = data.header;\r\n this.message$ = data.message;\r\n }\r\n\r\n public authResult(res){\r\n // console.log({messageDialog:res})\r\n this.dialogref.close(res);\r\n }\r\n \r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/modaldialogs/messageDialog/messageDialog.component.ts","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n Injector,\r\n HostListener,\r\n OnChanges,\r\n ElementRef,\r\n ViewChild\r\n } from \"@angular/core\";\r\n import { PagedListingComponentBase } from \"../../../paged-list-component-base\";\r\n import { MasterRepo } from \"../../repositories\";\r\n import { TransactionService } from \"../../Transaction Components/transaction.service\";\r\nimport { ActivatedRoute } from \"@angular/router\";\r\n \r\n @Component({\r\n selector: \"new-generic-popup-grid\",\r\n template: require('./new-generic-popup-grid.component.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')]\r\n })\r\n export class NewGenericPopUpComponent extends PagedListingComponentBase\r\n implements OnChanges {\r\n [x: string]: any;\r\n /** List Declaration */\r\n \r\n requestUrl: string = \"\";\r\n activeUrlPath:string = \"\"; \r\n isActive: boolean = false;\r\n itemList: any[] = [];\r\n selectedRowIndex: number = 0;\r\n tabindex: string = \"list\";\r\n \r\n //for transaction filtera\r\n billTo: string = \"\";\r\n isForCancelOrder: boolean = false;\r\n \r\n /** Output */\r\n \r\n @Output() onPopUpClose = new EventEmitter();\r\n @Output() onItemDoubleClick = new EventEmitter();\r\n \r\n /** Input */\r\n \r\n @Input() popupsettings: NewGenericPopUpSettings;\r\n @Input() summary: string;\r\n @ViewChild('inputBox') inputBox:ElementRef\r\n @ViewChild('body') body:ElementRef;\r\n @ViewChild('option') option:ElementRef;\r\n \r\n\r\n constructor(public injector: Injector, private masterService: MasterRepo,\r\n public _trnMainService: TransactionService,\r\n private route: ActivatedRoute\r\n ) {\r\n super(injector);\r\n this.activeUrlPath = route.snapshot.url[0].path;\r\n }\r\n \r\n \r\n\r\n show(billTo: string = \"\", isForCancelOrder: boolean = false) { \r\n if(this._trnMainService.customerEvent==true){ \r\n setTimeout(() => {\r\n //this.option.nativeElement.focus();\r\n this.inputBox.nativeElement.focus();\r\n }, 100);\r\n\r\n\r\n }\r\n \r\n this.summary = null;\r\n this.billTo = billTo;\r\n this.isForCancelOrder = isForCancelOrder;\r\n this.itemList = [];\r\n this.isActive = true;\r\n this.selectedRowIndex = 0;\r\n setTimeout(() => {\r\n this.setFilterOption();\r\n this.refreshPage();\r\n this.refresh(); \r\n }, 100) \r\n\r\n }\r\n \r\n setFilterOption(){\r\n if(this.popupsettings && this.popupsettings.columns.length){\r\n let filterIndex = this.popupsettings.defaultFilterIndex ? this.popupsettings.defaultFilterIndex : 0;\r\n if(this.popupsettings.columns.length <= filterIndex) return; \r\n this.filterValue = this.popupsettings.useDefinefilterValue;\r\n this.filterOption = this.popupsettings.columns[filterIndex].key; \r\n \r\n }\r\n }\r\n \r\n getData() {\r\n this.summary = null;\r\n this.selectedRowIndex = 0; \r\n let apiEndpoints = this.popupsettings.apiEndpoints;\r\n let apiUrl = `${this.apiUrl}${apiEndpoints}?currentPage=${\r\n this.pageNumber\r\n }&maxResultCount=${this.pageSize}`;\r\n \r\n if (this.billTo && this.billTo != \"\" && this.billTo != null && this.billTo != undefined) {\r\n apiUrl = apiUrl + `&billTo=${this.billTo}`;\r\n }\r\n if (this.isForCancelOrder) {\r\n apiUrl = apiUrl + `&isForCancelOrder=${this.isForCancelOrder}`;\r\n }\r\n \r\n this.requestUrl = this.getFilterOption(apiUrl);\r\n \r\n return this._http\r\n .get(this.requestUrl, this.masterService.getRequestOption())\r\n .map(res => res.json() || [])\r\n .subscribe(res => {\r\n this.totalItems = res ? res.totalCount : 0;\r\n this.itemList = res ? res.data : [];\r\n \r\n this.itemList.forEach(function (item) {\r\n if (item.TRNDATE != null && item.TRNDATE != undefined) {\r\n item.TRNDATE = item.TRNDATE.toString().substring(0, 10);\r\n }\r\n if (item.DATE != null && item.DATE != undefined) {\r\n item.DATE = item.DATE.toString().substring(0, 10);\r\n }\r\n });\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n \r\n if (\r\n this.itemList.length > 0 &&\r\n this.selectedRowIndex == 0 &&\r\n this.itemList[this.selectedRowIndex].itemSummary\r\n ) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n });\r\n }\r\n \r\n hide() {\r\n this.itemList = [];\r\n this.pageNumber = 1;\r\n this.totalItems = 0;\r\n this.isActive = false;\r\n }\r\n \r\n triggerSearch() {\r\n if(this.filterOption == 'DESCA'){\r\n this.masterService.defaultProductValue=0;\r\n }else if(this.filterOption =='MENUCODE' ||this.filterOption =='MCODE' ){\r\n this.masterService.defaultProductValue=1;\r\n }else if(this.filterOption=='BATCH'){\r\n this.masterService.defaultProductValue=2;\r\n }\r\n if (\r\n this.filterOption == null ||\r\n this.filterOption == undefined ||\r\n this.filterOption == \"\"\r\n )\r\n return;\r\n if (\r\n this.filterValue == null ||\r\n this.filterValue == undefined ||\r\n this.filterValue == \"\"\r\n )\r\n return;\r\n // this.masterService.defaultProductValue = this.filterOption;\r\n this.refreshPage();\r\n this.refresh();\r\n }\r\n \r\n singleClick(index) {\r\n this.selectedRowIndex = index;\r\n this.summary = this.itemList[index].itemSummary;\r\n }\r\n \r\n doubleClick($event) {\r\n this.onItemDoubleClick.emit($event);\r\n this.hide();\r\n }\r\n \r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n @debounce(10)\r\n updown($event: KeyboardEvent) {\r\n if(!this.isActive) return true;\r\n if ($event.code == \"ArrowDown\") {\r\n $event.preventDefault();\r\n this.selectedRowIndex++;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n this.calculateTotalPages();\r\n if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber < this.totalPages\r\n ) {\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n this.selectedRowIndex = 0;\r\n this.itemListClosed();\r\n } else if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber == this.totalPages\r\n ) {\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n }\r\n } else if ($event.code == \"ArrowUp\") {\r\n $event.preventDefault();\r\n this.selectedRowIndex--;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n if (this.selectedRowIndex == -1 && this.pageNumber > 1) {\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n this.itemListClosed();\r\n } else if (this.selectedRowIndex == -1 && this.pageNumber == 1) {\r\n this.selectedRowIndex = 0;\r\n }\r\n } else if (\r\n ($event.code == \"Enter\" || $event.code == \"NumpadEnter\") &&\r\n this.selectedRowIndex >= 0 &&\r\n this.selectedRowIndex < this.itemList.length\r\n ) {\r\n $event.preventDefault();\r\n if(this.filterOption==\"BARCODE\")\r\n {}\r\n else{\r\n this.onItemDoubleClick.emit(this.itemList[this.selectedRowIndex]);\r\n this.hide();\r\n this.itemListClosed();\r\n }\r\n } else if ($event.code == \"Escape\" && this.route.snapshot.url[0].path != 'addsientry') {\r\n $event.preventDefault();\r\n this.hide();\r\n this.itemListClosed();\r\n } else if ($event.code == \"ArrowRight\") {\r\n $event.preventDefault();\r\n this.calculateTotalPages();\r\n if (this.pageNumber >= this.totalPages) {\r\n this.pageNumber = this.totalPages;\r\n return;\r\n }\r\n \r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n } else if ($event.code == \"ArrowLeft\") {\r\n $event.preventDefault();\r\n if (this.pageNumber <= 1) {\r\n this.pageNumber = 1;\r\n return;\r\n }\r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n \r\n }\r\n }\r\n \r\n itemListClosed() {\r\n this.onPopUpClose.emit();\r\n }\r\n \r\n ngOnChanges(changes: any) {\r\n this.popupsettings = changes.popupsettings.currentValue;\r\n }\r\n\r\n scrollToTop(){\r\n this.body.nativeElement.scrollTop=0;\r\n }\r\n }\r\n \r\n export class NewGenericPopUpSettings {\r\n title: string;\r\n apiEndpoints: string;\r\n columns: ColumnSettings[] = [];\r\n defaultFilterIndex : number = 0;\r\n useDefinefilterValue: string;\r\n }\r\n \r\n export class ColumnSettings {\r\n key: string;\r\n title: string;\r\n hidden: boolean = false;\r\n noSearch: boolean = false;\r\n }\r\n \r\n export function debounce(delay: number): MethodDecorator {\r\n return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {\r\n \r\n const original = descriptor.value;\r\n const key = `__timeout__${propertyKey}`;\r\n \r\n descriptor.value = function (...args) {\r\n clearTimeout(this[key]);\r\n this[key] = setTimeout(() => original.apply(this, args), delay);\r\n };\r\n \r\n return descriptor;\r\n };\r\n }\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/new-generic-grid/new-generic-popup-grid.component.ts","import { Injector, OnInit, HostListener } from \"@angular/core\";\r\nimport { AppComponentBase } from \"./app-component-base\";\r\n\r\nexport class PagedResultDto {\r\n items: any[];\r\n totalCount: number;\r\n}\r\n\r\nexport class EntityDto {\r\n id: number;\r\n}\r\n\r\nexport class PagedRequestDto {\r\n skipCount: number;\r\n maxResultCount: number;\r\n}\r\n\r\nexport abstract class PagedListingComponentBase extends AppComponentBase\r\n implements OnInit {\r\n public pageSize: number = 10;\r\n public pageNumber: number = 1;\r\n public totalPages: number = 1;\r\n public totalItems: number;\r\n public gridSummary: string;\r\n public isTableLoading = false;\r\n\r\n filterValue: string = \"\";\r\n filterOption: string = \"\"; \r\n\r\n constructor(injector: Injector) {\r\n super(injector);\r\n }\r\n\r\n ngOnInit() {}\r\n\r\n refreshPage() {\r\n this.pageNumber = 1;\r\n this.totalPages = 1;\r\n }\r\n\r\n refresh(): void {\r\n this.getData();\r\n }\r\n\r\n onPageChange(value) {\r\n this.pageNumber = value ? value : 1;\r\n this.refresh();\r\n }\r\n\r\n getFilterOption(url: string): string {\r\n let filter = [];\r\n if (\r\n this.filterOption == null ||\r\n this.filterOption == undefined ||\r\n this.filterOption == \"\"\r\n )\r\n return url;\r\n if (\r\n this.filterValue == null ||\r\n this.filterValue == undefined ||\r\n this.filterValue == \"\"\r\n )\r\n return url;\r\n filter.push({ Field: this.filterOption, Value: this.filterValue });\r\n return `${url}&filters=${JSON.stringify(filter)}`;\r\n }\r\n\r\n abstract getData();\r\n\r\n calculateTotalPages(){\r\n this.totalPages = Math.ceil(this.totalItems / this.pageSize); \r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/paged-list-component-base.ts","export * from './baImageLoader';\r\nexport * from './baMenu';\r\nexport * from './baThemePreloader';\r\nexport * from './baThemeSpinner';\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/theme/services/index.ts","import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';\r\nimport { AuthService } from \"./authService.service\";\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs/Observable';\r\nimport { Permissions } from './permission.service';\r\nimport { UserToken } from './userToken.service';\r\nimport { GlobalState } from '../../../global.state';\r\nimport { MasterRepo } from \"../../repositories/index\";\r\nimport { MdDialog, MdDialogRef } from \"@angular/material\";\r\nimport { BehaviorSubject } from \"rxjs/BehaviorSubject\";\r\nimport { MessageDialog } from \"../../../pages/modaldialogs/messageDialog/messageDialog.component\";\r\n\r\n@Injectable()\r\nexport class CanActivateTeam implements CanActivate {\r\n viewPermission: Array = [];\r\n constructor(private permission: Permissions, private userToken: UserToken, private gblstate: GlobalState, private _authService: AuthService,\r\n private masterService: MasterRepo, private router: Router, public dialog: MdDialog) {\r\n this.viewPermission = gblstate.getGlobalSetting(\"View-Permission\") || [];\r\n\r\n }\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot\r\n ): Observable | Promise | boolean {\r\n \r\n // return true;\r\n \r\n var messageSubject: BehaviorSubject = new BehaviorSubject(\"\")\r\n var message$: Observable = messageSubject.asObservable();\r\n var LoggedIn = this._authService.getAuth()\r\n if (!(LoggedIn && LoggedIn.profile)) {\r\n //this.router.navigate(['login']);\r\n \r\n messageSubject.next(\"You are not logged In . Please login in\");\r\n var dialogref = this.dialog.open(MessageDialog, { hasBackdrop: true, data: { header: 'Information', message: message$ } });\r\n setTimeout(() => {\r\n dialogref.close();\r\n \r\n }, 2000);\r\n return false;\r\n }\r\n else {\r\n var sub = this.masterService.checkUserValid().subscribe(res => {\r\n if (res == false) {\r\n messageSubject.next(\"Invalid User\");\r\n var dialogref = this.dialog.open(MessageDialog, { hasBackdrop: true, data: { header: 'Information', message: message$ } });\r\n setTimeout(() => {\r\n dialogref.close();\r\n return false;\r\n }, 2000);\r\n return false;\r\n }\r\n })\r\n }\r\n \r\n let viewToOpen = route.routeConfig.path;\r\n // var path:string;\r\n var path: string = route.url[0].path;\r\n\r\n if ((LoggedIn && LoggedIn.profile) && path == 'dashboard') {\r\n return true;\r\n }\r\n \r\n // if(route.params[]) {}\r\n if (route.params[\"vt\"] != null && route.params[\"vt\"] == 18) {\r\n path = \"incomevoucher\";\r\n } else if (route.params[\"vt\"] != null && route.params[\"vt\"] == 17) {\r\n path = \"expensesvoucher\";\r\n } else if (route.params[\"vt\"] != null && route.params[\"vt\"] == 15) {\r\n path = \"creditnote\";\r\n } else if (route.params[\"vt\"] != null && route.params[\"vt\"] == 16) {\r\n path = \"debitnote\";\r\n } else if (route.params[\"pf\"] != null && route.params[\"pf\"] == \"DN\") {\r\n path = \"debitnoteitembase\";\r\n } else if (route.params[\"pf\"] != null && route.params[\"pf\"] == \"CN\") {\r\n path = \"creditnoteitembase\";\r\n } else {\r\n path = route.url[0].path\r\n }\r\n\r\n // path = route.url[0].path;\r\n var right: string = route.params[\"mode\"];\r\n if (right == undefined) right = \"list\";\r\n var result = this._authService.getMenuRight(path, right)\r\n \r\n if (!path) {\r\n if (result.list == true) {\r\n return true;\r\n }\r\n }\r\n else{\r\n if(result.right==true){\r\n return true;\r\n }\r\n else{\r\n if(right=='list'){\r\n if(result.list==true){\r\n return true;\r\n }\r\n \r\n }\r\n }\r\n }\r\n messageSubject.next(\"You are not authorize for this operation\");\r\n var dialogref = this.dialog.open(MessageDialog, { hasBackdrop: true, data: { header: 'Information', message: message$ } });\r\n setTimeout(() => {\r\n dialogref.close();\r\n return false;\r\n }, 2000);\r\n\r\n // if (this._authService.checkMenuRight(path, route.params[\"mode\"]) == true && route.url[0] != null && route.url[1] != null) {\r\n // // if (this.viewPermission.find((x) => x.toUpperCase() == viewToOpen.toUpperCase())) {\r\n\r\n // return true;\r\n // }\r\n\r\n\r\n // if(this._authService.checkMenuRight(path, route.params[\"mode\"]) == false && route.url[0] != null && route.url[1] == null) {\r\n // // if (this.viewPermission.find((x) => x.toUpperCase() == viewToOpen.toUpperCase())) {\r\n // // return true;\r\n // // }\r\n\r\n // return true;\r\n // }\r\n\r\n }\r\n}\r\n\r\n\r\n\r\n/*\r\n@NgModule({\r\n imports: [\r\n RouterModule.forRoot([\r\n {\r\n path: 'team/:id',\r\n component: TeamCmp,\r\n canActivate: [CanActivateTeam]\r\n }\r\n ])\r\n ],\r\n providers: [CanActivateTeam, UserToken, Permissions]\r\n})\r\nclass AppModule {}\r\n\r\n*/\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/permission/guard.service.ts","import { Injectable } from \"@angular/core\";\r\nimport { Router, NavigationStart } from \"@angular/router\";\r\n\r\n@Injectable()\r\nexport class PreventNavigationService { \r\n private preventToNavigate : boolean = false;\r\n\r\n constructor(private router: Router) {\r\n // clear alert message on route change\r\n router.events.subscribe(event => {\r\n if (event instanceof NavigationStart) {\r\n //this.preventToNavigate = false;\r\n }\r\n }); \r\n }\r\n \r\n getCurrentPreventStatus() : boolean {\r\n return this.preventToNavigate;\r\n }\r\n\r\n preventNavigation(isNavigationPrevent : boolean = true){\r\n this.preventToNavigate = isNavigationPrevent;\r\n } \r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/navigation-perventor/navigation-perventor.service.ts","import { Injectable } from '@angular/core';\r\nimport { Http, Response, RequestOptions } from '@angular/http';\r\nimport { AuthService } from \"./permission/authService.service\";\r\nimport {AppSettings} from './AppSettings';\r\n//import {UserSettings} from './AppSettings';\r\ninterface Dictionary {\r\n [index: string]: any\r\n}\r\n\r\n\r\n\r\n@Injectable()\r\nexport class SettingService {\r\n appSetting:AppSettings\r\n\r\n private cacheSetting;\r\n constructor(private authService:AuthService,private apSetting:AppSettings) {\r\n //get settings from application cache\r\n this.appSetting=apSetting;\r\n let userProfile = authService.getUserProfile()\r\n this.cacheSetting = authService.getSetting();\r\n //this.appSetting.setSetting(this.cacheSetting);\r\n \r\n\r\n }\r\n/*\r\n private setSetingValues(){\r\n if(this.cacheSetting==undefined){\r\n return;\r\n }\r\n for(var prop in this.setting){\r\n if(this.setting.hasOwnProperty(prop)){\r\n let val = this.cacheSetting[this.setting[prop].dbName];\r\n if(val!==undefined){\r\n this.setting[this.setting[prop].dbName].value = val;\r\n \r\n }\r\n }\r\n }\r\n }\r\n private getValue(obj: any,prop:string,defaultValue:any){\r\n if(typeof obj === undefined ){\r\n return defaultValue;\r\n }\r\n if(obj[prop] === undefined){\r\n return defaultValue;\r\n }\r\n return (obj[prop]);\r\n }\r\n */\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/setting.service.ts","export const IMAGES_ROOT = 'assets/img/';\r\n\r\nexport const layoutSizes = {\r\n resWidthCollapseSidebar: 1200,\r\n resWidthHideSidebar: 500\r\n};\r\n\r\nexport const layoutPaths = {\r\n images: {\r\n root: IMAGES_ROOT,\r\n profile: IMAGES_ROOT + 'app/profile/',\r\n amMap: 'assets/img/theme/vendor/ammap/',\r\n amChart: 'assets/img/theme/vendor/amcharts/dist/amcharts/images/'\r\n }\r\n};\r\n\r\nexport class colorHelper {\r\n static shade = (color, weight) => {\r\n return colorHelper.mix('#000000', color, weight);\r\n };\r\n\r\n static tint = (color, weight) => {\r\n return colorHelper.mix('#ffffff', color, weight);\r\n };\r\n\r\n static hexToRgbA = (hex, alpha) => {\r\n let c;\r\n if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {\r\n c = hex.substring(1).split('');\r\n if (c.length == 3) {\r\n c = [c[0], c[0], c[1], c[1], c[2], c[2]];\r\n }\r\n c = '0x' + c.join('');\r\n return 'rgba(' + [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') + ',' + alpha + ')';\r\n }\r\n throw new Error('Bad Hex');\r\n };\r\n\r\n static mix = (color1, color2, weight) => {\r\n\r\n let d2h = (d) => d.toString(16);\r\n let h2d = (h) => parseInt(h, 16);\r\n\r\n let result = \"#\";\r\n for (let i = 1; i < 7; i += 2) {\r\n let color1Part = h2d(color1.substr(i, 2));\r\n let color2Part = h2d(color2.substr(i, 2));\r\n let resultPart = d2h(Math.floor(color2Part + (color1Part - color2Part) * (weight / 100.0)));\r\n result += ('0' + resultPart).slice(-2);\r\n }\r\n return result;\r\n };\r\n}\r\n\r\nexport const isMobile = () => (/android|webos|iphone|ipad|ipod|blackberry|windows phone/).test(navigator.userAgent.toLowerCase());\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/theme/theme.constants.ts","module.exports = \" .uiInterstitialContent {\\r\\n margin-bottom: 15px;\\r\\n }\\r\\n\\r\\n .phl {\\r\\n padding-left: 20px;\\r\\n padding-right: 20px;\\r\\n }\\r\\n\\r\\n .ptm {\\r\\n padding-top: 10px;\\r\\n }\\r\\n .topborder {\\r\\n border-bottom: none;\\r\\n border-left: none;\\r\\n border-right: none;\\r\\n}\\r\\n\\r\\n.uiBoxGray {\\r\\n background-color: #f2f2f2;\\r\\n border: 1px solid #ccc;\\r\\n}\\r\\n.clearfix:after {\\r\\n clear: both;\\r\\n content: \\\".\\\";\\r\\n display: block;\\r\\n font-size: 0;\\r\\n height: 0;\\r\\n line-height: 0;\\r\\n visibility: hidden;\\r\\n}\\r\\n._ohf {\\r\\n float: right;\\r\\n}\\r\\n\\r\\n.rfloat {\\r\\n float: right;\\r\\n}\\r\\n.uiButtonConfirm {\\r\\n background-color: #4267b2;\\r\\n border-color: #29487d;\\r\\n}\\r\\n\\r\\n.uiButton, .uiButtonSuppressed:active, .uiButtonSuppressed:focus, .uiButtonSuppressed:hover {\\r\\n background-color: #f6f7f9;\\r\\n border: 1px solid #ced0d4;\\r\\n}\\r\\n.uiButton {\\r\\n border-radius: 2px;\\r\\n cursor: pointer;\\r\\n display: inline-block;\\r\\n font-size: 12px;\\r\\n -webkit-font-smoothing: antialiased;\\r\\n font-weight: bold;\\r\\n line-height: 18px;\\r\\n padding: 2px 6px;\\r\\n text-align: center;\\r\\n text-decoration: none;\\r\\n text-shadow: none;\\r\\n vertical-align: top;\\r\\n white-space: nowrap;\\r\\n}\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/login/forgetPassword.css\n// module id = 108\n// module chunks = 22","module.exports = (__webpack_require__(5))(437);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/add/operator/catch.js from dll-reference vendor_lib\n// module id = 115\n// module chunks = 22","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n Injector,\r\n HostListener,\r\n OnChanges,\r\n ElementRef,\r\n ViewChild\r\n } from \"@angular/core\";\r\n import { PagedListingComponentBase } from \"../../../paged-list-component-base\";\r\n import { MasterRepo } from \"../../repositories\";\r\n import { TransactionService } from \"../../Transaction Components/transaction.service\";\r\nimport { ActivatedRoute } from \"@angular/router\";\r\n \r\n @Component({\r\n selector: \"multiple-price-popup-grid\",\r\n template: require('./multiple-price-popup-grid.component.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')]\r\n })\r\n export class MultiplePricePopUpComponent extends PagedListingComponentBase\r\n implements OnChanges {\r\n [x: string]: any;\r\n /** List Declaration */\r\n \r\n requestUrl: string = \"\";\r\n \r\n isActive: boolean = false;\r\n itemList: any[] = [];\r\n selectedRowIndex: number = 0;\r\n tabindex: string = \"list\";\r\n \r\n //for transaction filter\r\n billTo: string = \"\";\r\n isForCancelOrder: boolean = false;\r\n \r\n /** Output */\r\n \r\n @Output() onPopUpClose = new EventEmitter();\r\n @Output() onItemDoubleClick = new EventEmitter();\r\n \r\n /** Input */\r\n \r\n @Input() popupsettings: NewGenericPopUpSettings;\r\n @Input() summary: string;\r\n @ViewChild('inputBox') inputBox:ElementRef\r\n @ViewChild('body') body:ElementRef;\r\n\r\n constructor(public injector: Injector, private masterService: MasterRepo,\r\n public _trnMainService: TransactionService,\r\n private route: ActivatedRoute\r\n ) {\r\n super(injector);\r\n }\r\n \r\n \r\n\r\n show(billTo: string = \"\", isForCancelOrder: boolean = false) { \r\n // if(this._trnMainService.customerEvent==true){ \r\n setTimeout(() => {\r\n this.inputBox.nativeElement.focus()\r\n }, 500); \r\n\r\n \r\n // }\r\n \r\n this.summary = null;\r\n this.billTo = billTo;\r\n this.isForCancelOrder = isForCancelOrder;\r\n this.itemList = [];\r\n this.isActive = true;\r\n this.selectedRowIndex = 0;\r\n setTimeout(() => {\r\n this.setFilterOption();\r\n this.refreshPage();\r\n this.refresh(); \r\n }, 100) \r\n }\r\n \r\n setFilterOption(){\r\n if(this.popupsettings && this.popupsettings.columns.length){\r\n let filterIndex = this.popupsettings.defaultFilterIndex ? this.popupsettings.defaultFilterIndex : 0;\r\n if(this.popupsettings.columns.length <= filterIndex) return; \r\n this.filterValue = this.popupsettings.useDefinefilterValue;\r\n this.filterOption = this.popupsettings.columns[filterIndex].key; \r\n }\r\n }\r\n \r\n getData() {\r\n this.summary = null;\r\n this.selectedRowIndex = 0; \r\n let apiEndpoints = this.popupsettings.apiEndpoints;\r\n let apiUrl = `${this.apiUrl}${apiEndpoints}?currentPage=${\r\n this.pageNumber\r\n }&maxResultCount=${this.pageSize}`;\r\n \r\n if (this.billTo && this.billTo != \"\" && this.billTo != null && this.billTo != undefined) {\r\n apiUrl = apiUrl + `&billTo=${this.billTo}`;\r\n }\r\n if (this.isForCancelOrder) {\r\n apiUrl = apiUrl + `&isForCancelOrder=${this.isForCancelOrder}`;\r\n }\r\n \r\n this.requestUrl = this.getFilterOption(apiUrl);\r\n \r\n return this._http\r\n .get(this.requestUrl, this.masterService.getRequestOption())\r\n .map(res => res.json() || [])\r\n .subscribe(res => {\r\n this.totalItems = res ? res.totalCount : 0;\r\n this.itemList = res ? res.data : [];\r\n \r\n this.itemList.forEach(function (item) {\r\n if (item.TRNDATE != null && item.TRNDATE != undefined) {\r\n item.TRNDATE = item.TRNDATE.toString().substring(0, 10);\r\n }\r\n if (item.DATE != null && item.DATE != undefined) {\r\n item.DATE = item.DATE.toString().substring(0, 10);\r\n }\r\n });\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n \r\n if (\r\n this.itemList.length > 0 &&\r\n this.selectedRowIndex == 0 &&\r\n this.itemList[this.selectedRowIndex].itemSummary\r\n ) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n });\r\n }\r\n \r\n hide() {\r\n this.itemList = [];\r\n this.pageNumber = 1;\r\n this.totalItems = 0;\r\n this.isActive = false;\r\n }\r\n \r\n triggerSearch() {\r\n if (\r\n this.filterOption == null ||\r\n this.filterOption == undefined ||\r\n this.filterOption == \"\"\r\n )\r\n return;\r\n if (\r\n this.filterValue == null ||\r\n this.filterValue == undefined ||\r\n this.filterValue == \"\"\r\n )\r\n return;\r\n \r\n this.refreshPage();\r\n this.refresh();\r\n }\r\n \r\n singleClick(index) {\r\n this.selectedRowIndex = index;\r\n this.summary = this.itemList[index].itemSummary;\r\n }\r\n \r\n doubleClick($event) {\r\n this.onItemDoubleClick.emit($event);\r\n this.hide();\r\n }\r\n \r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n @debounce(10)\r\n updown($event: KeyboardEvent) {\r\n if(!this.isActive) return true;\r\n if ($event.code == \"ArrowDown\") {\r\n $event.preventDefault();\r\n this.body.nativeElement.scrollTop=this.body.nativeElement.scrollTop+20;\r\n this.selectedRowIndex++;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n this.calculateTotalPages();\r\n if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber < this.totalPages\r\n ) {\r\n this.scrollToTop();\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n this.selectedRowIndex = 0;\r\n this.itemListClosed();\r\n } else if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber == this.totalPages\r\n ) {\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n }\r\n } else if ($event.code == \"ArrowUp\") {\r\n $event.preventDefault();\r\n if(this.body.nativeElement.scrollTop>0){\r\n this.body.nativeElement.scrollTop=this.body.nativeElement.scrollTop-15;\r\n }\r\n this.selectedRowIndex--;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n if (this.selectedRowIndex == -1 && this.pageNumber > 1) {\r\n this.body.nativeElement.scrollTop=this.body.nativeElement.scrollTop+200;\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n this.itemListClosed();\r\n } else if (this.selectedRowIndex == -1 && this.pageNumber == 1) {\r\n this.selectedRowIndex = 0;\r\n }\r\n } else if (\r\n ($event.code == \"Enter\" || $event.code == \"NumpadEnter\") &&\r\n this.selectedRowIndex >= 0 &&\r\n this.selectedRowIndex < this.itemList.length\r\n ) {\r\n $event.preventDefault();\r\n if(this.filterOption==\"BARCODE\")\r\n {}\r\n else{\r\n this.onItemDoubleClick.emit(this.itemList[this.selectedRowIndex]);\r\n this.hide();\r\n this.itemListClosed();\r\n }\r\n } else if ($event.code == \"Escape\" && this.route.snapshot.url[0].path != 'addsientry') {\r\n $event.preventDefault();\r\n this.hide();\r\n this.itemListClosed();\r\n } else if ($event.code == \"ArrowRight\") {\r\n $event.preventDefault();\r\n this.calculateTotalPages();\r\n if (this.pageNumber >= this.totalPages) {\r\n this.pageNumber = this.totalPages;\r\n return;\r\n }\r\n \r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n } else if ($event.code == \"ArrowLeft\") {\r\n $event.preventDefault();\r\n if (this.pageNumber <= 1) {\r\n this.pageNumber = 1;\r\n return;\r\n }\r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n \r\n }\r\n }\r\n \r\n itemListClosed() {\r\n this.onPopUpClose.emit();\r\n }\r\n \r\n ngOnChanges(changes: any) {\r\n this.popupsettings = changes.popupsettings.currentValue;\r\n }\r\n\r\n scrollToTop(){\r\n this.body.nativeElement.scrollTop=0;\r\n }\r\n }\r\n \r\n export class NewGenericPopUpSettings {\r\n title: string;\r\n apiEndpoints: string;\r\n columns: ColumnSettings[] = [];\r\n defaultFilterIndex : number = 0;\r\n useDefinefilterValue: string;\r\n }\r\n \r\n export class ColumnSettings {\r\n key: string;\r\n title: string;\r\n hidden: boolean = false;\r\n noSearch: boolean = false;\r\n }\r\n \r\n export function debounce(delay: number): MethodDecorator {\r\n return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {\r\n \r\n const original = descriptor.value;\r\n const key = `__timeout__${propertyKey}`;\r\n \r\n descriptor.value = function (...args) {\r\n clearTimeout(this[key]);\r\n this[key] = setTimeout(() => original.apply(this, args), delay);\r\n };\r\n \r\n return descriptor;\r\n };\r\n }\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/multiple-price-popup/multiple-price-popup-grid.component.ts","import { Http, RequestOptions, Headers } from \"@angular/http\";\r\nimport { Injectable } from \"@angular/core\"; \r\nimport { Subject } from \"rxjs/subject\"; \r\nimport { AuthService } from \"../../services/permission\";\r\nimport { GlobalState } from \"../../../global.state\";\r\n@Injectable()\r\nexport class NotificationService {\r\n\r\n idForUPdate:any;\r\n\r\n constructor(\r\n private http: Http,\r\n private authService: AuthService,\r\n private state: GlobalState\r\n ) {}\r\n\r\n private get apiUrl(): string {\r\n let url = this.state.getGlobalSetting(\"apiUrl\");\r\n let apiUrl = \"\";\r\n\r\n if (!!url && url.length > 0) {\r\n apiUrl = url[0];\r\n }\r\n return apiUrl;\r\n }\r\n getNotificationCount() {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject(); \r\n this.http\r\n .get(this.apiUrl + \"/getNotificationCount\", this.getRequestOption())\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject; \r\n }\r\n\r\n public markAsRead(id : number) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject(); \r\n this.http\r\n .get(`${this.apiUrl}/notificationMarkAsRead/${id}`, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json(); \r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result; \r\n this.idForUPdate = null;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result; \r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n\r\n\r\n markAsReadAfterSave(){\r\n return this.markAsRead(this.idForUPdate);\r\n }\r\n\r\n private getRequestOption() {\r\n let headers: Headers = new Headers({\r\n \"Content-type\": \"application/json\",\r\n Authorization: this.authService.getAuth().token\r\n });\r\n return new RequestOptions({ headers: headers });\r\n }\r\n\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/notification/notification.service.ts","import { MasterRepo } from './../../common/repositories/masterRepo.service';\r\nimport { CookieService } from 'angular2-cookie/core';\r\nimport { Component, OnInit, Output, EventEmitter, Input, ViewChild } from '@angular/core';\r\nimport { FormGroup, AbstractControl, FormBuilder, Validators } from '@angular/forms';\r\n\r\nimport 'style-loader!./login.scss';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport { AuthService } from '../../common/services/permission';\r\nimport { LoginService } from './loginService.service';\r\nimport { Http } from '@angular/http';\r\nimport { ModalDirective } from 'ng2-bootstrap';\r\nimport { AlertService } from '../../common/services/alert/alert.service';\r\nimport * as moment from 'moment';\r\n\r\nexport var var1: string;\r\n//import {getmac} from 'getmac';\r\n@Component({\r\n selector: 'login',\r\n template: require('./login.html'),\r\n providers: [Http]\r\n})\r\nexport class Login implements OnInit {\r\n @Output('signedIn') signedIn = new EventEmitter();\r\n @Input('toUrl')\r\n set toUrl(value: string) {\r\n this._toUrl = value;\r\n // console.log({ toUrl: value });\r\n }\r\n @Output() filterData = new EventEmitter();\r\n private _toUrl: string = '';\r\n public form: FormGroup;\r\n public email: AbstractControl;\r\n public password: AbstractControl;\r\n public submitted: boolean = false;\r\n public submitButtonStatus: boolean = true;\r\n public appType;\r\n returnUrl: string;\r\n signOut;\r\n @ViewChild('childModal') childModal: ModalDirective;\r\n DialogMessage: string = \" \"\r\n SendMail = true;\r\n SearchUser = true;\r\n securityCode = true;\r\n newPassword = true;\r\n userProfile: any = {};\r\n LoginButtonStatus :boolean = true;\r\n failedAttempt:number=0;\r\n\r\n constructor(public masterService: MasterRepo,fb: FormBuilder, \r\n private route: ActivatedRoute, \r\n private router: Router, \r\n private loginService: LoginService,\r\n private _cookieService: CookieService,\r\n public _authService: AuthService\r\n ) {\r\n this.appType=this.masterService.appType\r\n\r\n try {\r\n this.form = fb.group({\r\n 'email': ['', Validators.compose([Validators.required, Validators.minLength(2)])],\r\n 'password': ['', Validators.compose([Validators.required, Validators.minLength(4)])]\r\n });\r\n\r\n this.email = this.form.controls['email'];\r\n this.password = this.form.controls['password'];\r\n } catch (ex) {\r\n // console.log(ex);\r\n alert(ex);\r\n }\r\n\r\n \r\n\r\n }\r\n ngOnInit() {\r\n try {\r\n // console.log(\"login\");\r\n let logout = this.route.snapshot.params['logout'];\r\n // console.log(logout);\r\n this.returnUrl = this.route.snapshot.params['returnUrl'] || '/';\r\n // console.log({ retUrl1: this.returnUrl });\r\n\r\n if (logout) {\r\n // console.log(\"log out\");\r\n this.onLogOut();\r\n }\r\n //console.log(this.returnUrl);\r\n } catch (ex) {\r\n // console.log({ loginOnintError: ex });\r\n //alert(ex);\r\n }\r\n this.SendMail = false;\r\n this.SearchUser = false;\r\n this.loginService.sendMail = false;\r\n this.securityCode = false;\r\n this.loginService.securityCode = false;\r\n this.loginService.newPassword = false\r\n this.loginService.searchUser = false;\r\n this.loginService.loginpage = true;\r\n \r\n }\r\n public onSubmit(values: Object): void {\r\n try {\r\n this.submitted = true;\r\n // console.log({ valid: this.form.valid, url: this.returnUrl });\r\n if (this.form.valid) {\r\n this.submitButtonStatus = false;\r\n this.LoginButtonStatus = false;\r\n this.loginService.getDisableLoginTime(this.email.value).subscribe(res=>{\r\nif(res.status == \"ok\"){\r\n // console.log(\"rsult\",res.result)\r\n // if(res.result.length == 0)return;\r\n if(res.result.length && res.result && res.result[0].MINUTES && res.result[0].MINUTES < 15){\r\n this.submitButtonStatus = true;\r\n this.LoginButtonStatus = true;\r\n this.DialogMessage = `Retry in ${15 - res.result[0].MINUTES} minutes !!`;\r\n // return this.DialogMessage;\r\n this.childModal.show();\r\n setTimeout(() => {\r\n this.childModal.hide();\r\n }, 4000)\r\n }else{\r\n this.loginService.login(this.email.value, this.password.value)\r\n .subscribe(\r\n data => {\r\n this.userProfile = this._authService.getUserProfile();\r\n var currentYear = new Date().getUTCFullYear().toString();\r\n var currentMonth = (new Date().getMonth()+1).toString();\r\n if(this.userProfile.CompanyInfo.ORG_TYPE.toUpperCase()==\"DISTRIBUTOR\"){\r\n this.loginService.checkLoginDay(currentYear,currentMonth).subscribe(res=>{\r\n if(res.status==\"ok\"){\r\n if (this._toUrl != '') {\r\n this.signedIn.emit(\"logged In\");\r\n this.submitButtonStatus = true;\r\n this.LoginButtonStatus = true;\r\n \r\n }\r\n else {\r\n \r\n if (this.returnUrl == \"/\")\r\n // var cookie = this._cookieService.get(\"imsposcookie\");\r\n // console.log(cookie);\r\n // if (cookie != null) { \r\n this.returnUrl = \"/pages/dashboard\"\r\n this.router.navigate([this.returnUrl]);\r\n this.submitButtonStatus = true;\r\n this.LoginButtonStatus = true;\r\n let today_date=new Date().toJSON().split('T')[0];\r\n // console.log(\"@@today_Date\",today_date);\r\n \r\n \r\n var tomorrow = moment(this.userProfile.CompanyInfo.FEDATE).add(1, 'days');\r\n var tomorrow_Date=tomorrow.format('YYYY-MM-DD')\r\n // console.log(\"tomorrow_Date\",tomorrow_Date,today_date);\r\n \r\n // if(today_date == tomorrow_Date){\r\n // if(this.userProfile.CompanyInfo.FBDATE.split('T')[0] != tomorrow_Date){\r\n // // alert(\"reached\")\r\n // this.masterService.showfiscalPopup=true;\r\n // }\r\n // }\r\n console.log(\"ORG_TYPE\",this.userProfile.CompanyInfo.ORG_TYPE)\r\n if(this.userProfile.CompanyInfo.ORG_TYPE.toUpperCase()!=\"CENTRAL\"){\r\n let todayDate = new Date();\r\n \r\n let addedDate = moment(this.userProfile.CompanyInfo.FEDATE.substring(0,10)).add(1,'days');\r\n let fiscalYearEndDateInDateFormat = new Date(addedDate.toString());\r\n if(fiscalYearEndDateInDateFormat.getTime() < todayDate.getTime()){\r\n this.masterService.showfiscalPopup=true;\r\n }\r\n }\r\n \r\n \r\n \r\n \r\n // console.log(\"Cookies != null\")\r\n // var J = JSON.parse(cookie);\r\n // return J;\r\n // }\r\n // else {\r\n // this.DialogMessage = \"Cookies not found. Please register this terminal\"\r\n // this.childModal.show();\r\n // setTimeout(() => {\r\n // this.childModal.hide();\r\n // }, 4000)\r\n // this.router.navigate([\"/pages/dashboard\"]);\r\n // this.returnUrl = \"/pages/dashboard\"\r\n // }\r\n }\r\n } else {\r\n let erroris = JSON.parse(res.result._body).result;\r\n this.DialogMessage = erroris;\r\n this.childModal.show();\r\n setTimeout(() => {\r\n this.childModal.hide();\r\n }, 4000)\r\n return;\r\n }\r\n }, error => {\r\n let erroris = JSON.parse(error._body).result;\r\n this.DialogMessage = erroris;\r\n this.childModal.show();\r\n setTimeout(() => {\r\n this.childModal.hide();\r\n }, 4000)\r\n return;\r\n })\r\n }else {\r\n \r\n if (this.returnUrl == \"/\")\r\n // var cookie = this._cookieService.get(\"imsposcookie\");\r\n // console.log(cookie);\r\n // if (cookie != null) { \r\n this.returnUrl = \"/pages/dashboard\"\r\n this.router.navigate([this.returnUrl]);\r\n this.submitButtonStatus = true;\r\n this.LoginButtonStatus = true;\r\n let today_date=new Date().toJSON().split('T')[0];\r\n // console.log(\"@@today_Date\",today_date);\r\n \r\n \r\n var tomorrow = moment(this.userProfile.CompanyInfo.FEDATE).add(1, 'days');\r\n var tomorrow_Date=tomorrow.format('YYYY-MM-DD')\r\n // console.log(\"tomorrow_Date\",tomorrow_Date,today_date);\r\n \r\n // if(today_date == tomorrow_Date){\r\n // if(this.userProfile.CompanyInfo.FBDATE.split('T')[0] != tomorrow_Date){\r\n // // alert(\"reached\")\r\n // this.masterService.showfiscalPopup=true;\r\n // }\r\n // }\r\n console.log(\"ORG_TYPE\",this.userProfile.CompanyInfo.ORG_TYPE)\r\n if(this.userProfile.CompanyInfo.ORG_TYPE.toUpperCase()!=\"CENTRAL\"){\r\n let todayDate = new Date();\r\n \r\n let addedDate = moment(this.userProfile.CompanyInfo.FEDATE.substring(0,10)).add(1,'days');\r\n let fiscalYearEndDateInDateFormat = new Date(addedDate.toString());\r\n if(fiscalYearEndDateInDateFormat.getTime() < todayDate.getTime()){\r\n this.masterService.showfiscalPopup=true;\r\n }\r\n }\r\n \r\n\r\n \r\n \r\n // console.log(\"Cookies != null\")\r\n // var J = JSON.parse(cookie);\r\n // return J;\r\n // }\r\n // else {\r\n // this.DialogMessage = \"Cookies not found. Please register this terminal\"\r\n // this.childModal.show();\r\n // setTimeout(() => {\r\n // this.childModal.hide();\r\n // }, 4000)\r\n // this.router.navigate([\"/pages/dashboard\"]);\r\n // this.returnUrl = \"/pages/dashboard\"\r\n // }\r\n }\r\n },\r\n error => {\r\n // console.log(\"@@error\",JSON.parse(error._body))\r\n let erroris=JSON.parse(error._body).result;\r\n this.failedAttempt++;\r\n this.submitButtonStatus = true;\r\n this.LoginButtonStatus = true;\r\n // this.DialogMessage = \"!!Invalid Username Or Password!!!\"\r\n this.DialogMessage = erroris;\r\n\r\n if(this.failedAttempt == 5){\r\n this.DialogMessage = \"5 Incorrect Attempts, Retry after 15 minutes!\"\r\n // this.LoginButtonStatus = false;\r\n this.loginService.saveDisableLoginTime(this.email.value).subscribe(res=>{\r\n\r\n })\r\n // setTimeout(() => {\r\n // this.LoginButtonStatus = true;\r\n // this.failedAttempt=0;\r\n // }, 900000)\r\n }\r\n\r\n this.childModal.show();\r\n setTimeout(() => {\r\n this.childModal.hide();\r\n }, 4000)\r\n\r\n\r\n\r\n // error = JSON.parse(error._body);\r\n // if (error.result == \"No User\"){\r\n // this.DialogMessage = \"!!Invalid Username Or Password!!!\"\r\n // this.childModal.show();\r\n // setTimeout(() => {\r\n // this.childModal.hide();\r\n // }, 4000)\r\n // }\r\n // else{\r\n\r\n // this.DialogMessage = \"Connection String Error!!!!\"\r\n // this.childModal.show();\r\n // setTimeout(() => {\r\n // this.childModal.hide();\r\n // }, 4000)\r\n // }\r\n this.submitted = false;\r\n }\r\n )\r\n } \r\n}\r\n },\r\n error =>{\r\n }\r\n )\r\n // your code goes here\r\n // console.log(values);\r\n }\r\n } catch (ex) {\r\n // console.log(ex);\r\n alert(ex);\r\n }\r\n }\r\n\r\n public onLogOut(): void {\r\n this.loginService.logout();\r\n }\r\n ForgetPassword() {\r\n this.loginService.searchUser = true;\r\n this.loginService.loginpage = false;\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/login/login.component.ts","import { Injectable } from '@angular/core';\r\n\r\nimport { BaThemeConfigProvider } from './theme.configProvider';\r\nimport { colorHelper } from './theme.constants';\r\n\r\n@Injectable()\r\nexport class BaThemeConfig {\r\n\r\n constructor(private _baConfig: BaThemeConfigProvider) {\r\n }\r\n\r\n config() {\r\n this._baConfig.changeTheme({ name: 'mint' });\r\n \r\n let colorScheme = {\r\n primary: '#209e91',\r\n info: '#2dacd1',\r\n success: '#90b900',\r\n warning: '#dfb81c',\r\n danger: '#e85656',\r\n };\r\n \r\n this._baConfig.changeColors({\r\n default: '#4e4e55',\r\n defaultText: '#e2e2e2',\r\n border: '#dddddd',\r\n borderDark: '#aaaaaa',\r\n \r\n primary: colorScheme.primary,\r\n info: colorScheme.info,\r\n success: colorScheme.success,\r\n warning: colorScheme.warning,\r\n danger: colorScheme.danger,\r\n \r\n primaryLight: colorHelper.tint(colorScheme.primary, 30),\r\n infoLight: colorHelper.tint(colorScheme.info, 30),\r\n successLight: colorHelper.tint(colorScheme.success, 30),\r\n warningLight: colorHelper.tint(colorScheme.warning, 30),\r\n dangerLight: colorHelper.tint(colorScheme.danger, 30),\r\n \r\n primaryDark: colorHelper.shade(colorScheme.primary, 15),\r\n infoDark: colorHelper.shade(colorScheme.info, 15),\r\n successDark: colorHelper.shade(colorScheme.success, 15),\r\n warningDark: colorHelper.shade(colorScheme.warning, 15),\r\n dangerDark: colorHelper.shade(colorScheme.danger, 15),\r\n \r\n dashboard: {\r\n blueStone: '#005562',\r\n surfieGreen: '#0e8174',\r\n silverTree: '#6eba8c',\r\n gossip: '#b9f2a1',\r\n white: '#10c4b5',\r\n },\r\n \r\n custom: {\r\n dashboardPieChart: colorHelper.hexToRgbA('#aaaaaa', 0.8),\r\n dashboardLineChart: '#6eba8c',\r\n },\r\n });\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/theme/theme.config.ts","import { Injectable } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { colorHelper } from './theme.constants';\r\n\r\n@Injectable()\r\nexport class BaThemeConfigProvider {\r\n\r\n private basic: any;\r\n private colorScheme: any;\r\n private dashboardColors: any;\r\n private conf: any;\r\n\r\n constructor() {\r\n this.basic = {\r\n default: '#ffabff',\r\n defaultText: '#ffffff',\r\n border: '#dddddd',\r\n borderDark: '#aaaaaa',\r\n };\r\n\r\n // main functional color scheme\r\n this.colorScheme = {\r\n primary: '#ffabff',\r\n info: '#40daf1',\r\n success: '#8bd22f',\r\n warning: '#e7ba08',\r\n danger: '#f95372',\r\n };\r\n\r\n // dashboard colors for charts\r\n this.dashboardColors = {\r\n blueStone: '#40daf1',\r\n surfieGreen: '#00abff',\r\n silverTree: '#1b70ef',\r\n gossip: '#3c4eb9',\r\n white: '#ffffff',\r\n };\r\n\r\n this.conf = {\r\n theme: {\r\n name: 'ng2',\r\n },\r\n colors: {\r\n default: this.basic.default,\r\n defaultText: this.basic.defaultText,\r\n border: this.basic.border,\r\n borderDark: this.basic.borderDark,\r\n\r\n primary: this.colorScheme.primary,\r\n info: this.colorScheme.info,\r\n success: this.colorScheme.success,\r\n warning: this.colorScheme.warning,\r\n danger: this.colorScheme.danger,\r\n\r\n primaryLight: colorHelper.tint(this.colorScheme.primary, 30),\r\n infoLight: colorHelper.tint(this.colorScheme.info, 30),\r\n successLight: colorHelper.tint(this.colorScheme.success, 30),\r\n warningLight: colorHelper.tint(this.colorScheme.warning, 30),\r\n dangerLight: colorHelper.tint(this.colorScheme.danger, 30),\r\n\r\n primaryDark: colorHelper.shade(this.colorScheme.primary, 15),\r\n infoDark: colorHelper.shade(this.colorScheme.info, 15),\r\n successDark: colorHelper.shade(this.colorScheme.success, 15),\r\n warningDark: colorHelper.shade(this.colorScheme.warning, 15),\r\n dangerDark: colorHelper.shade(this.colorScheme.danger, 15),\r\n\r\n dashboard: {\r\n blueStone: this.dashboardColors.blueStone,\r\n surfieGreen: this.dashboardColors.surfieGreen,\r\n silverTree: this.dashboardColors.silverTree,\r\n gossip: this.dashboardColors.gossip,\r\n white: this.dashboardColors.white,\r\n },\r\n\r\n custom: {\r\n dashboardPieChart: colorHelper.hexToRgbA(this.basic.defaultText, 0.8),\r\n dashboardLineChart: this.basic.defaultText,\r\n }\r\n }\r\n };\r\n }\r\n\r\n get() {\r\n return this.conf;\r\n }\r\n\r\n changeTheme(theme: any) {\r\n _.merge(this.get().theme, theme);\r\n }\r\n\r\n changeColors(colors: any) {\r\n _.merge(this.get().colors, colors);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/theme/theme.configProvider.ts","module.exports = (__webpack_require__(5))(452);\n\n\n//////////////////\n// WEBPACK FOOTER\n// delegated ./node_modules/rxjs/add/operator/distinctUntilChanged.js from dll-reference vendor_lib\n// module id = 195\n// module chunks = 22","// Angular 2\r\n// rc2 workaround\r\nimport { enableDebugTools, disableDebugTools } from '@angular/platform-browser';\r\nimport { enableProdMode, ApplicationRef } from '@angular/core';\r\n// Environment Providers\r\nlet PROVIDERS: any[] = [\r\n // common env directives\r\n];\r\n\r\n// Angular debug tools in the dev console\r\n// https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md\r\nlet _decorateModuleRef = function identity(value: T): T { return value; };\r\n\r\nif ('production' === ENV || 'renderer' === ENV) {\r\n // Production\r\n //by sagun\r\n //disableDebugTools();\r\n enableProdMode();\r\n\r\n PROVIDERS = [\r\n ...PROVIDERS,\r\n // custom providers in production\r\n ];\r\n\r\n} else {\r\n\r\n _decorateModuleRef = (modRef: any) => {\r\n const appRef = modRef.injector.get(ApplicationRef);\r\n const cmpRef = appRef.components[0];\r\n\r\n let _ng = (window).ng;\r\n enableDebugTools(cmpRef);\r\n (window).ng.probe = _ng.probe;\r\n (window).ng.coreTokens = _ng.coreTokens;\r\n return modRef;\r\n };\r\n\r\n // Development\r\n PROVIDERS = [\r\n ...PROVIDERS,\r\n // custom providers in development\r\n ];\r\n\r\n}\r\n\r\nexport const decorateModuleRef = _decorateModuleRef;\r\n\r\nexport const ENV_PROVIDERS = [\r\n ...PROVIDERS\r\n];\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/environment.ts","import { NgModule, ModuleWithProviders } from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { ModalModule } from \"ngx-bootstrap\";\r\nimport { GenericPopUpComponent } from \"./generic-popup-grid.component\";\r\nimport { MasterRepo } from \"../../repositories\";\r\nimport { NgaModule } from \"../../../theme/nga.module\";\r\nimport { NgxPaginationModule } from \"ngx-pagination\";\r\nimport { TransactionService } from \"../../Transaction Components/transaction.service\";\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n\r\n ModalModule.forRoot(),\r\n NgaModule,\r\n ModalModule.forRoot(),\r\n NgxPaginationModule\r\n ],\r\n declarations: [GenericPopUpComponent],\r\n exports: [GenericPopUpComponent]\r\n})\r\nexport class GenericPopupGridModule {\r\n static forRoot(): ModuleWithProviders {\r\n return {\r\n ngModule: GenericPopupGridModule,\r\n providers: [MasterRepo,TransactionService]\r\n };\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/generic-grid/generic-popup-grid.module.ts","import { Observable } from 'rxjs/Observable';\r\nimport { BehaviorSubject } from 'rxjs/BehaviorSubject';\r\n// data for additional cost\r\nexport interface Cost {\r\n sno: number;\r\n costAc: TAcList;\r\n creditAc: string;\r\n remarks: string;\r\n amount: number;\r\n byQuanty: boolean;\r\n mcode: string;\r\n GCOSTMODE: string;\r\n CostingType: string;\r\n desca: string;\r\n batch:string;\r\n batchid:string;\r\n}\r\n//data for productwise cost\r\nexport interface prodCost {\r\n mcode: string;\r\n menucode: string;\r\n desca: string;\r\n unit: string;\r\n quantity: number;\r\n rate: number;\r\n amount: number;\r\n exchageRate: number;\r\n nAmount: number;\r\n listAdditionalCost: Cost[];\r\n batch: string;\r\n batchid:string;\r\n CostPerUnit:number;\r\n Total:number;\r\n // refno:string;\r\n // suppliername:string;\r\n // refInvNo:string;\r\n}\r\nexport interface costdetails {\r\n CostPerUnit:number;\r\n Total:number;\r\n quantity:number;\r\n}\r\n\r\nimport { Injectable } from '@angular/core'\r\nimport { IMPORT_DETAILS, IMPORT_DETAILS_PROD, TrnMain, Trntran } from \"../../../../common/interfaces/TrnMain\";\r\nimport { PREFIX } from \"../../../../common/interfaces/Prefix.interface\";\r\nimport { IDivision } from \"../../../../common/interfaces/commonInterface.interface\";\r\nimport { MasterRepo } from \"../../../../common/repositories/masterRepo.service\";\r\nimport { TAcList } from \"../../../../common/interfaces/Account.interface\";\r\nimport { importdocument } from '../../../../common/interfaces/AddiitonalCost.interface';\r\nimport { SpinnerService } from '../../../../common/services/spinner/spinner.service';\r\nimport { TransactionService } from '../../../../common/Transaction Components/transaction.service';\r\nimport { Column } from 'primeng/primeng';\r\nimport { Subject } from 'rxjs/Subject';\r\nimport { xor } from 'lodash';\r\n// import { TransactionService } from '../../../../common/Transaction Components/transaction.service';\r\n\r\n@Injectable()\r\nexport class OthersAdditionalCostService {\r\n TrnMainObj: TrnMain = {};\r\n pageHeading: string;\r\n prefix: PREFIX = {};\r\n division: IDivision = {};\r\n addtionalCostList: prodCost[] = [];// to hold the list of product along with cost\r\n costList: Cost[] = [];//to hold the list of all the costs\r\n costdetail:any = [];\r\n TrnMainList: TrnMain[] = [];\r\n header: any[] = [];\r\n public ReturnDataObjectSubject = new Subject<{}>();\r\n public ObservableReturnData = this.ReturnDataObjectSubject.asObservable();\r\n // [{ TITLE: 'MENUCODE', MAPPINGNAME: 'menucode' }, \r\n // { TITLE: 'Description', MAPPINGNAME: 'desca' }, \r\n // { TITLE: 'UNIT', MAPPINGNAME: 'unit' }, \r\n // { TITLE: 'RATE', MAPPINGNAME: 'rate' }, \r\n // {TITLE: 'QTY', MAPPINGNAME: 'quantity' }, \r\n // { TITLE: 'GROSS Amt', MAPPINGNAME: 'amount' },\r\n // {TITLE :'Total', MAPPINGNAME:'total'},\r\n // {TITLE :'Cost Per Unit', MAPPINGNAME:'costperunit'}];\r\n\r\n getDivision: any;\r\n loadedTrnmain: TrnMain = {};\r\n trnmainBehavior: BehaviorSubject = new BehaviorSubject({})\r\n loadDataObservable: Observable = this.trnmainBehavior.asObservable();\r\n addCostTotAmount: any = 0;\r\n public viewDate = new Subject();\r\n IMPORTDETAILS: IMPORT_DETAILS={};\r\n IMPORT_DETAILS_PROD : IMPORT_DETAILS_PROD[]=[]\r\n constructor(public masterService: MasterRepo, private loadingService: SpinnerService) {\r\n\r\n }\r\n public loadPurchase(vchrno: string, division: string, phiscalid: string) {\r\n let postData = { VCHRNO: vchrno, DIVISION: division, PHISCALID: phiscalid }\r\n this.masterService.getList(postData, '/getViewVoucher').subscribe(data => {\r\n if (data.status == 'ok') {\r\n // //console.log(\"LoadPurchase1\", data)\r\n this.addtionalCostList.push(data.result.prodList);\r\n // //console.log(\"LoadPurchase\", this.addtionalCostList)\r\n }\r\n // this.addtionalCostList.push(data);\r\n\r\n\r\n })\r\n }\r\n loadAdditionalCost(value) {\r\n \r\n this.loadingService.show(\"please wait. Getting purchase invoice data..\")\r\n // this.additionalCostService.loadPurchase(value,this.form.value.DIVISION.INITIAL,this.phiscalid)\r\n let VCHR = value.VCHRNO\r\n let division = value.DIVISION;\r\n let phiscalid =value.PhiscalID;\r\n // //console.log(\"vchr,Div,Phis\", VCHR, division, phiscalid,this.masterService.PhiscalObj.phiscalID,this.masterService.userProfile);\r\n\r\n // this._trnMainService.trnmainBehavior= new BehaviorSubject({});\r\n // this._trnMainService.loadData(VCHR, division, phiscalid);\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(data => {\r\n if (data.status==\"ok\") {\r\n try {\r\n\r\n this.masterService.loadedTrnmain = data.result;\r\n // if(this.masterService.userSetting.EnableRateEditInAddCosting == 1){\r\n // this.IMPORTDETAILS = data.result.IMPORTDETAILS;\r\n // }\r\n \r\n var returnDataList = JSON.parse(data.result.AdditionalCostJson)\r\n // alert(\"kk\")\r\n console.log(\"Inside the view of Additional cost\") \r\n console.log(\"returnDataList\", returnDataList)\r\n this.addtionalCostList = [];\r\n this.costdetail = [];\r\n this.addtionalCostList = JSON.parse(data.result.AdditionalCostJson)\r\n this.costdetail = JSON.parse(data.result.AdditionalCostJson)\r\n this.costList = [];\r\n this.loadedTrnmain.TOTAMNT = (Math.round((0) * 100))/100;\r\n this.addCostTotAmount = 0;\r\n var addPurchaseObj: prodCost = {};\r\n // this.addtionalCostList.push(returnDataList);\r\n // returnDataList.forEach(element => {\r\n // let acs1: prodCost = {\r\n // mcode: \"\", menucode: \"\", desca: \"\", unit: \"\",\r\n // quantity: 0, rate: 0, amount: 0, nAmount: 0, batch: \"\", batchid: \"\",\r\n // CostPerUnit:0,Total:0\r\n // }\r\n // acs1.mcode = element.mcode,\r\n // acs1.menucode = element.menucode,\r\n // acs1.desca = element.desca,\r\n // acs1.unit = element.unit,\r\n // acs1.batch = element.batch,\r\n // acs1.rate = element.rate,\r\n // acs1.quantity = element.quantity,\r\n // acs1.amount = element.amount,\r\n // acs1.nAmount = element.nAmount,\r\n // // acs1.batchid = vchrnodatalist && vchrnodatalist.length > 0 && vchrnodatalist.filter(x => x.mcode == element.mcode && x.batch == element.batch)[0].batchid,\r\n // acs1.listAdditionalCost = element.listAdditionalCost,\r\n // acs1.CostPerUnit = element.CostPerUnit,\r\n // acs1.Total = element.Total,\r\n // // console.log(\"@@_acs1\", acs1)\r\n \r\n // });\r\n var nobatchid = returnDataList.filter(x => x.batchid == null);\r\n console.log(\"@@nobatchid\", nobatchid)\r\n // if (nobatchid.length > 0) {\r\n // var vchrnodatalist = [];\r\n // this.masterService.getBatchidVoucherwise(data.result.REFBILL).subscribe(\r\n // (res: any) => {\r\n // console.log(\"@@res\", res)\r\n // if (res.status == \"ok\") {\r\n // console.log(\"@@res\", res.result)\r\n // vchrnodatalist = res.result;\r\n \r\n // console.log(\"@@1after_resultacs\", this.addtionalCostList)\r\n\r\n // this.addtionalCostList[0].listAdditionalCost = returnDataList[0].listAdditionalCost;\r\n // for (let i of returnDataList) {\r\n // this.costList = i.listAdditionalCost;\r\n // this.loadedTrnmain.TOTAMNT += i.amount;\r\n\r\n // }\r\n // console.log(\"CheckCkec\", this.costList)\r\n // if (data.result.ImportDocument) {\r\n // this.masterService.importDocumentDetailsObj = data.result.ImportDocument;\r\n // this.masterService.importDocumentDetailsObj.PPNO = data.result.IMPORTDETAILS.DOCUMENTNO;\r\n // this.masterService.importDocumentDetailsObj.LCNO = data.result.IMPORTDETAILS.LCNUM;\r\n // }\r\n\r\n // this.masterService.RefObj.Refno = data.result.REFBILL;\r\n // this.masterService.RefObj.InvoiceNo = data.result.REFORDBILL;\r\n // this.masterService.RefObj.SupplierName = data.result.BILLTO;\r\n // this.loadingService.hide();\r\n // this.generateCostDetailsFromData();\r\n // this.viewDate.next();\r\n // this.ReturnDataObjectSubject.next(data.result);\r\n // return;\r\n // }else{\r\n // }\r\n // },\r\n // error =>{\r\n // console.log(\"err\",error);\r\n // }\r\n // )\r\n // }else{\r\n \r\n // var result = returnDataList.filter((elem1, i) => returnDataList.some((elem2, j) => (elem2.mcode === elem1.mcode)\r\n // && (elem2.batchid == elem1.batchid) && j !== i));\r\n // console.log(\"@@view_result:\", result);\r\n // let acs1: prodCost = { mcode: \"\", menucode: \"\", desca: \"\", unit: \"\",\r\n // quantity: 0, rate: 0,amount: 0, nAmount: 0, batch:\"\",batchid:\"\" }\r\n // if(result.length>0){\r\n // result.forEach(element => {\r\n // acs1.mcode=element.mcode,\r\n // acs1.menucode=element.menucode,\r\n // acs1.desca=element.desca,\r\n // acs1.unit=element.unit,\r\n // acs1.batch=element.batch,\r\n // acs1.rate=element.rate,\r\n // acs1.quantity=element.quantity+acs1.quantity,\r\n // acs1.amount=element.amount+acs1.amount,\r\n // acs1.nAmount=element.nAmount+acs1.nAmount,\r\n // acs1.batchid=element.batchid,\r\n // element.listAdditionalCost=element.listAdditionalCost\r\n // });\r\n // console.log(\"@@after_resultacs\",result)\r\n // this.addtionalCostList.push(acs1);\r\n // this.addtionalCostList[0].listAdditionalCost = result[0].listAdditionalCost;\r\n\r\n \r\n // var result2 = data.result.ProdList.filter((elem1, i) => result.some((elem2, j) => (elem2.mcode != elem1.mcode || elem2.batchid != elem1.batchid) && j !== i));\r\n // if(result2.length > 0 ){\r\n // console.log(\"@@view_mcodediff_ac2\")\r\n // for (let i of data.result.ProdList) {\r\n // var acs: prodCost = {\r\n // mcode: i.MCODE, menucode: i.MENUCODE, desca: i.ITEMDESC, unit: i.UNIT,\r\n // quantity: i.REALQTY_IN, \r\n // rate: i.CRATE?i.CRATE:i.RATE,\r\n // amount: i.CRATE?i.CRATE *i.REALQTY_IN : i.AMOUNT, \r\n // nAmount: i.NETAMOUNT, batch:i.BATCH, batchid:i.BATCHID\r\n // };\r\n // this.addtionalCostList.push(acs);\r\n // }\r\n // }\r\n // }\r\n // }\r\n\r\n this.loadedTrnmain.TOTAMNT =0;\r\n for (let i of returnDataList) {\r\n addPurchaseObj.mcode = i.mcode;\r\n addPurchaseObj.menucode = i.menucode;\r\n addPurchaseObj.desca = i.desca;\r\n addPurchaseObj.unit = i.unit;\r\n addPurchaseObj.quantity = i.quantity;\r\n addPurchaseObj.rate = i.rate;\r\n addPurchaseObj.amount = i.amount;\r\n addPurchaseObj.nAmount = i.nAmount;\r\n // this._additionalCostService.addtionalCostList.push(addPurchaseObj)\r\n this.costList = i.listAdditionalCost;\r\n this.loadedTrnmain.TOTAMNT +=this.nullToZeroConverter(i.amount);\r\n\r\n }\r\n console.log(\"CheckCkec\", this.costList)\r\n // for (let i of returnDataList) {\r\n // var acs: prodCost = {\r\n // mcode: i.mcode, menucode: i.menucode, desca: i.desca, unit: i.unit,\r\n // quantity: i.quantity, rate: i.rate, amount: i.amount, nAmount: i.nAmount, batch:i.batch\r\n // };\r\n // this.addtionalCostList.push(acs);\r\n\r\n // }\r\n // var returnDataList = JSON.parse(data.result.AdditionalCostJson)\r\n\r\n //console.log(\"checkData444\",data.result)\r\n if (data.result.ImportDocument) {\r\n this.masterService.importDocumentDetailsObj = data.result.ImportDocument;\r\n this.masterService.importDocumentDetailsObj.PPNO = data.result.IMPORTDETAILS.DOCUMENTNO;\r\n this.masterService.importDocumentDetailsObj.LCNO = data.result.IMPORTDETAILS.LCNUM;\r\n \r\n }\r\n\r\n this.masterService.RefObj.Refno = data.result.REFBILL;\r\n this.masterService.RefObj.InvoiceNo = data.result.REFORDBILL;\r\n this.masterService.RefObj.SupplierName = data.result.BILLTO;\r\n // //console.log(\"checkData$$$$$$$$$\",this.masterService.importDocumentDetailsObj,this.masterService.RefObj)\r\n if(this.addtionalCostList.length==0 && nobatchid.length == 0){\r\n this.addtionalCostList = JSON.parse(data.result.AdditionalCostJson)\r\n\r\n for (let x of this.addtionalCostList[0].listAdditionalCost) {\r\n this.addCostTotAmount = this.addCostTotAmount + x.amount;\r\n }\r\n }\r\n\r\n // for(let o of this.addtionalCostList){\r\n // for(let p of o.listAdditionalCost){\r\n\r\n // //Debit Account Recalculation\r\n // let x: Trntran = {};\r\n // x.A_ACID = p.costAc.ACID;\r\n // x.AccountItem = p.costAc;\r\n // x.DRAMNT = p.amount;\r\n // x.CRAMNT = 0;\r\n // x.PartyDetails = [];\r\n // x.ROWMODE = \"new\";\r\n // x.inputMode = true;\r\n // x.acitem = p;\r\n // this.masterService.AdditionalCostTrnTran.push(x);\r\n // // this.addCostTotAmount += p.amount;\r\n\r\n\r\n // //Credit Account Recalculation\r\n // let y: any = {};\r\n // y.A_ACID = p.costAc.ACID;\r\n // y.AccountItem = p.creditAc;\r\n // y.DRAMNT = 0;\r\n // y.CRAMNT = p.amount;\r\n // y.PartyDetails = [];\r\n // y.ROWMODE = \"new\";\r\n // y.inputMode = true;\r\n // y.acitem =p.creditAc;\r\n // this.masterService.AdditionalCostTrnTran.push(y);\r\n\r\n\r\n // }\r\n // }\r\n this.loadingService.hide();\r\n\r\n this.generateCostDetailsFromData()\r\n this.viewDate.next();\r\n this.ReturnDataObjectSubject.next(data.result)\r\n\r\n }\r\n\r\n catch (ex) { }\r\n\r\n }\r\n else {\r\n alert(\"Cannot Get Data from Bill no.\")\r\n }\r\n\r\n\r\n })\r\n\r\n\r\n }\r\n public CancelPI() {\r\n this.addtionalCostList = [];\r\n }\r\n\r\n public onAddCost(cdata: Cost) {\r\n var cst: Cost = {\r\n mcode: cdata.mcode,batch: cdata.batch, sno: null, amount: cdata.amount,\r\n costAc: cdata.costAc, creditAc: cdata.creditAc, byQuanty: cdata.byQuanty,\r\n remarks: cdata.remarks, listAdditionalCost: [], GCOSTMODE: cdata.GCOSTMODE, CostingType: cdata.CostingType, desca: cdata.desca,batchid: cdata.batchid\r\n }\r\n console.log(\"PO*%\", cst,cdata)\r\n // for(let i of this.addtionalCostList)\r\n this.costList.push(cst)\r\n // console.log(\"ADDCOSTS\", this.costList, this.addtionalCostList)\r\n // all ok till here\r\n this.addCostTotAmount = this.addCostTotAmount + cst.amount;\r\n \r\n // EDIT MODE //VIEW MODE\r\n for(let i of this.addtionalCostList){\r\n i.listAdditionalCost = this.costList\r\n }\r\n\r\n // NEW MODE\r\n // this.addtionalCostList.forEach(cost => {\r\n\r\n // if (cost.listAdditionalCost == null) { cost.listAdditionalCost = []; };\r\n // // //console.log(\"Adds\")\r\n // if (cdata.mcode) {\r\n // if (cost.mcode == cdata.mcode) {\r\n // cst.amount = cdata.amount;\r\n // cost.listAdditionalCost.push(cst);\r\n // }\r\n // else {\r\n // // cost.listAdditionalCost=[];\r\n // cost.listAdditionalCost.push(cst);\r\n // }\r\n // }\r\n // else {\r\n // if (cdata.byQuanty) {\r\n // // cst.amount = (cdata.amount/totcost.quantity)* cost.quantity\r\n // cost.listAdditionalCost.push(cst);\r\n // }\r\n // else {\r\n // // cst.amount = (cdata.amount/totcost.amount) * cost.amount\r\n // if (cost.listAdditionalCost && cost.listAdditionalCost.length > 0)\r\n // cost.listAdditionalCost.push(cst);\r\n // else {\r\n // cost.listAdditionalCost = [];\r\n // cost.listAdditionalCost.push(cst);\r\n // }\r\n // }\r\n // }\r\n\r\n // })\r\n\r\n\r\n\r\n if (cdata.mcode) {\r\n var indProd = this.addtionalCostList.find(x => x.mcode == cdata.mcode)\r\n if (indProd) {\r\n cst.amount = cdata.amount;\r\n }\r\n }\r\n // //console.log(\"checkAddData\",this.addtionalCostList)\r\n this.generateCostDetails()\r\n }\r\n\r\n public onDeleteCost(cdata: Cost) {\r\n this.addtionalCostList.forEach(cost => {\r\n var i = cost.listAdditionalCost.findIndex(x => x.costAc == cdata.costAc)\r\n cost.listAdditionalCost.splice(i, 1);\r\n })\r\n }\r\n DeleteDynamicColumn(Columnname: any) {\r\n\r\n // console.log(\"CheckValue\",Columnname,this.addtionalCostList)\r\n if (this.addtionalCostList) {\r\n for (let i of this.addtionalCostList) {\r\n delete i[Columnname];\r\n\r\n }\r\n }\r\n for(let i of this.addtionalCostList){\r\n i.listAdditionalCost = this.costList\r\n }\r\n this.generateCostDetails()\r\n\r\n //23\r\n\r\n // key = costing\r\n\r\n // for (let i of this.addtionalCostList) {\r\n // for (let cost of this.costList) { //4 wota\r\n\r\n // let fixedKeys = [\"unit\",\r\n // \"rate\",\r\n // \"quantity\",\r\n // \"nAmount\",\r\n // \"menucode\",\r\n // \"mcode\",\r\n // \"desca\",\r\n // \"batch\",\r\n // \"amount\",\r\n // \"Total\",\r\n // \"listAdditionalCost\",\r\n // \"CostPerUnit\", cost.costAc.ACNAME]\r\n // let keysArray = Object.keys(i);\r\n // keysArray.forEach(key => {\r\n // if (fixedKeys.indexOf(key) > -1) {\r\n\r\n // } else {\r\n // delete i[key];\r\n // }\r\n // });\r\n // }\r\n // }\r\n\r\n // console.log(\"2\", this.addtionalCostList)\r\n\r\n\r\n\r\n\r\n // }\r\n\r\n\r\n }\r\n\r\n public generateCostDetails(): any[] {\r\n\r\n let detailCost: any[] = [];\r\n let tot = { amount: 0, quantity: 0 }\r\n this.addtionalCostList.forEach(pdata => {\r\n\r\n // tot.amount = pdata.amount + tot.amount;\r\n tot.quantity = pdata.quantity + tot.quantity;\r\n\r\n })\r\n // //console.log(\"AdditionalCostss\", tot, this.addtionalCostList);\r\n this.addtionalCostList.forEach(prod => {\r\n\r\n let cst = Object.assign({}, prod);\r\n // prod.refno = this.masterService.RefObj.Refno;\r\n // prod.refInvNo = this.masterService.RefObj.InvoiceNo;\r\n // prod.suppliername = this.masterService.RefObj.SupplierName;\r\n\r\n prod.listAdditionalCost.forEach(cost => {\r\n\r\n if (cost.mcode && cost.batch) {\r\n if (cost.mcode == cst.mcode && cost.batch == cst.batch) {\r\n cst[cost.costAc.ACNAME] = cost.amount;\r\n }\r\n else {\r\n // cst[cost.costAc.ACNAME] = 0;\r\n }\r\n }\r\n if (cost.mcode == undefined) {\r\n cst[cost.costAc.ACNAME] = 0;\r\n }\r\n\r\n if (!cost.mcode && cost.byQuanty == true) {\r\n cst[cost.costAc.ACNAME] = Math.round(cost.amount * (cst.quantity / tot.quantity) * 100) / 100\r\n }\r\n if (!cost.mcode && cost.byQuanty != true) {\r\n //cst[cost.costAc.ACNAME] = Math.round(cost.amount * (cst.amount / tot.amount) * 100) / 100;\r\n }\r\n\r\n })\r\n // //console.log(\"checkvalue\",prod.listAdditionalCost,cst.mcode)\r\n // prod.listAdditionalCost.forEach(x=>{\r\n // if(x.mcode!=cst.mcode){\r\n // cst[x.costAc.ACNAME] = 0;\r\n // }\r\n // })\r\n // console.log(\"ChecKMide\",this._transactionService.TrnMainObj.Mode)\r\n // if( this._transactionService.TrnMainObj.Mode.toUpperCase() != 'VIEW'){\r\n cst['Total'] = 0\r\n cst['CostPerUnit'] = 0\r\n cst['Total'] = Math.round(this.getTotal(cst) * 100) / 100;\r\n cst['CostPerUnit'] = (this.getCostPerUnit(cst) * 100) / 100; //remove roundoff to save without roundoff\r\n // }\r\n\r\n // cst['Total Cost Per Unit']\r\n // //console.log(\"Check Total Costy\", cst['Total'],cst)\r\n detailCost.push(cst);\r\n\r\n })\r\n // for(let i of this.addtionalCostList){\r\n // for(let y of i.listAdditionalCost){\r\n // if(y.)\r\n // }\r\n // }\r\n\r\n this.getCostingDetailHeader(detailCost[0]);\r\n console.log('Generate$$$', detailCost);\r\n this.costdetail = detailCost;\r\n return detailCost;\r\n\r\n }\r\n public generateCostDetailsFromData(): any[] {\r\n // console.log(\"AdditionalCostService\", this.addtionalCostList, this.costList, this.costdetail)\r\n let detailCost: any[] = [];\r\n let tot = { amount: 0, quantity: 0 }\r\n this.addtionalCostList.forEach(pdata => {\r\n\r\n // tot.amount = pdata.amount + tot.amount;\r\n tot.quantity = pdata.quantity + tot.quantity;\r\n\r\n })\r\n this.addtionalCostList.forEach(prod => {\r\n\r\n let cst = Object.assign({}, prod);\r\n prod.listAdditionalCost.forEach(cost => {\r\n\r\n if (cost.mcode && cost.batch) {\r\n if (cost.mcode == cst.mcode && cost.batch == cst.batch) {\r\n cst[cost.costAc.ACNAME] = cost.amount;\r\n }\r\n else {\r\n // cst[cost.costAc.ACNAME] = 0;\r\n }\r\n }\r\n if (cost.mcode == undefined) {\r\n cst[cost.costAc.ACNAME] = 0;\r\n }\r\n\r\n if (!cost.mcode && cost.byQuanty == true) {\r\n cst[cost.costAc.ACNAME] = Math.round(cost.amount * (cst.quantity / tot.quantity) * 100) / 100\r\n }\r\n if (!cost.mcode && cost.byQuanty != true) {\r\n //cst[cost.costAc.ACNAME] = Math.round(cost.amount * (cst.amount / tot.amount) * 100) / 100;\r\n }\r\n\r\n })\r\n\r\n // cst['Total'] = Math.round(this.getTotal(cst) * 100) / 100;\r\n // cst['CostPerUnit'] = Math.round(this.getCostPerUnit(cst) * 100) / 100;\r\n\r\n detailCost.push(cst);\r\n\r\n })\r\n // for(let i of this.addtionalCostList){\r\n // for(let y of i.listAdditionalCost){\r\n // if(y.)\r\n // }\r\n // }\r\n this.getCostingDetailHeader(detailCost[0]);\r\n // console.log('Generate$$$', detailCost);\r\n this.costdetail = detailCost;\r\n\r\n return detailCost;\r\n\r\n }\r\n\r\n getTotal(cst: any): number {\r\n let total = 0;\r\n Object.keys(cst).forEach((key: any) => {\r\n // //console.log(\"CheckLOG\",typeof cst[key])\r\n\r\n if (key == \"desca\" || key == \"listAdditionalCost\" || key == \"mcode\" || key == \"menucode\" || key == \"nAmount\" || key == \"quantity\" || key == \"rate\" || key == \"unit\" || key == \"batch\" || key == \"batchid\") { }\r\n else {\r\n\r\n total = total + cst[key];\r\n\r\n\r\n\r\n\r\n }\r\n });\r\n // //console.log(\"CheckGetTotrla\",total);\r\n return total\r\n }\r\n\r\n getCostPerUnit(cst: any): number {\r\n let cpu = Number(Number(cst['Total']) / Number(cst['quantity']))\r\n return cpu;\r\n }\r\n\r\n getCostingDetailHeader(FirstObject) {\r\n console.log(\"##FirstObject\",FirstObject)\r\n if (FirstObject == null) { return; }\r\n this.header = [];\r\n this.header = [\r\n { TITLE: 'Item Code', MAPPINGNAME: 'menucode', Alignment: 'left' },\r\n { TITLE: 'Item Name', MAPPINGNAME: 'desca', Alignment: 'left' },\r\n { TITLE: 'Batch', MAPPINGNAME: 'batch', Alignment: 'left' },\r\n // { TITLE: 'UNIT', MAPPINGNAME: 'unit' }, \r\n // { TITLE: 'RATE', MAPPINGNAME: 'rate' }, \r\n { TITLE: 'QTY', MAPPINGNAME: 'quantity', Alignment: 'right' },\r\n { TITLE: 'Amount', MAPPINGNAME: 'amount', Alignment: 'right' }];\r\n\r\n let total = 0;\r\n\r\n\r\n Object.keys(FirstObject).forEach((key: any) => {\r\n\r\n if (key == \"amount\" || key == \"desca\" || key == \"listAdditionalCost\" || key == \"mcode\" || key == \"menucode\" || key == \"nAmount\" || key == \"quantity\" || key == \"rate\" || key == \"unit\") {\r\n\r\n }\r\n else {\r\n if(key !=\"Refno\"){\r\n let val = \"unset\";\r\n this.header.forEach(h => { if (h.MAPPINGNAME == key) { val = \"set\"; } });\r\n //prevent duplicate entry in header\r\n if (val == \"unset\") {\r\n this.header.push({ TITLE: key, MAPPINGNAME: key, Alignment: 'right' });\r\n // console.log(this.header)\r\n }\r\n }\r\n }\r\n });\r\n\r\n }\r\n loadData(VCHR, division, phiscalid) {\r\n //return new Observable((observer: Subscriber) => {\r\n this.masterService.LoadTransaction(VCHR, division, phiscalid).subscribe(data => {\r\n if (data.status == 'ok') {\r\n this.TrnMainObj = data.result;\r\n\r\n this.trnmainBehavior.next(this.TrnMainObj);\r\n }\r\n }, error => {\r\n console.log({ \"Load Data Error\": error });\r\n this.trnmainBehavior.complete();\r\n }, () => this.trnmainBehavior.complete());\r\n //});\r\n\r\n }\r\n\r\n saveAdditionalCost() {\r\n //alert(\"AC Service!!\");\r\n this.masterService.saveAdditionalCost(this.addtionalCostList)\r\n .subscribe(res => {\r\n //console.log(\"working!!!\",res);\r\n })\r\n }\r\n\r\n nullToZeroConverter(value) {\r\n\r\n if (\r\n value == undefined ||\r\n value == null ||\r\n value == \"\" ||\r\n value == \"Infinity\" ||\r\n value == \"NaN\" ||\r\n value === undefined ||\r\n isNaN(parseFloat(value))\r\n ) {\r\n return 0;\r\n }\r\n \r\n return parseFloat(value);\r\n }\r\n\r\n\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/Others/components/AdditionalCost/addtionalCost.service.ts","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n OnChanges,\r\n ElementRef,\r\n ViewChild\r\n} from \"@angular/core\";\r\nimport { FileUploaderService } from \"./file-uploader-popup.service\";\r\nimport { AlertService } from \"../../services/alert/alert.service\";\r\nimport { SpinnerService } from \"../../services/spinner/spinner.service\";\r\nimport { VoucherTypeEnum, TrnMain } from \"../../interfaces\";\r\nimport { TransactionService } from \"../../Transaction Components/transaction.service\";\r\nimport { MasterRepo } from \"../../repositories/masterRepo.service\";\r\n\r\n@Component({\r\n selector: \"file-uploader-popup\",\r\n template: require('./file-uploader-popup.component.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')]\r\n})\r\nexport class FileUploaderPopupComponent implements OnChanges {\r\n\r\n @ViewChild(\"fileSelect\") fileSelect: ElementRef;\r\n \r\n /** List Declaration */ \r\n selectedFileNames : string[] = []; \r\n isActive: boolean = false; \r\n dragging : boolean = false;\r\n voucherType: VoucherTypeEnum;\r\n TrnMainObj: TrnMain = {};\r\n /** Output */\r\n\r\n @Output() onPopUpClose = new EventEmitter(); \r\n @Output() onUploaded = new EventEmitter();\r\n\r\n /** Input */\r\n\r\n @Input() popupsettings: FileUploaderPopUpSettings;\r\n @Input() summary : string;\r\n\r\n constructor(\r\n private fileImportService: FileUploaderService,\r\n private alertService: AlertService,\r\n private loadingService: SpinnerService,\r\n public _trnMainService: TransactionService,\r\n public masterService: MasterRepo,\r\n \r\n ) { \r\n this.TrnMainObj = _trnMainService.TrnMainObj;\r\n this.voucherType = this.TrnMainObj.VoucherType;\r\n }\r\n\r\n fileList: FileList = null;\r\n onFileChange($event) {\r\n this.fileList = $event.target.files;\r\n this.setSelectedFileNames();\r\n }\r\n\r\n setSelectedFileNames(){\r\n this.selectedFileNames = []; \r\n if(this.fileList == null){\r\n return;\r\n } \r\n for(let i = 0; i < this.fileList.length; i++){\r\n this.selectedFileNames.push(this.fileList[i].name)\r\n } \r\n }\r\n\r\n deleteSelectedItem(){\r\n // this.fileList.splice(i, 1);\r\n this.setSelectedFileNames();\r\n }\r\n\r\n onDragOver($event){\r\n this.dragging = true; \r\n $event.preventDefault();\r\n }\r\n\r\n onDrop($event){\r\n this.dragging = false; \r\n this.fileList = this.popupsettings.allowMultiple? $event.dataTransfer.files : $event.dataTransfer.files;\r\n this.setSelectedFileNames();\r\n $event.preventDefault();\r\n }\r\n\r\n clearFile(){\r\n this.fileList = null;\r\n }\r\n\r\n importConfig() { \r\n if (this.fileList == null || this.fileList.length == 0) {\r\n this.alertService.info(\"Please Select File.\");\r\n return;\r\n }\r\n if (this.fileList.length > 0) { \r\n let formData: FormData = new FormData();\r\n\r\n for(let i=0; i < this.fileList.length; i++){\r\n let file: File = this.fileList[i];\r\n formData.append(`file_${i}`, file, file.name);\r\n } \r\n\r\n this.loadingService.show(\"Uploading. Please Wait...\");\r\n this.fileImportService.importSelectedFiles(this.popupsettings.uploadEndpoints ,formData)\r\n .subscribe(\r\n res => {\r\n // alert('HI');\r\n console.log(\"@@RES\",res);\r\n this.loadingService.hide();\r\n this.onUploaded.emit(res)\r\n this.hide();\r\n },\r\n error => {\r\n this.alertService.error(error);\r\n this.loadingService.hide();\r\n this.onUploaded.emit(null)\r\n }\r\n );\r\n }\r\n }\r\n\r\n downloadSample(){ \r\n this.loadingService.show(\"Downloading Sample. Please Wait...\");\r\n this.fileImportService.downloadSampleFile(this.popupsettings.sampleFileUrl, \"PO_SampleFile\")\r\n .subscribe(\r\n data => {\r\n this.loadingService.hide();\r\n this.downloadFile(data);\r\n },\r\n (error) => {\r\n this.alertService.error(error);\r\n this.loadingService.hide();\r\n }\r\n );\r\n }\r\n\r\n downloadFile(response: any) {\r\n const element = document.createElement('a');\r\n element.href = URL.createObjectURL(response.content);\r\n element.download = response.filename;\r\n document.body.appendChild(element);\r\n element.click(); \r\n}\r\n\r\n show() { \r\n this.fileSelect.nativeElement.value = null;\r\n this.selectedFileNames = [];\r\n this.fileList = null;\r\n this.isActive = true; \r\n } \r\n\r\n hide() { \r\n this.fileSelect.nativeElement.value = null;\r\n this.isActive = false;\r\n } \r\n \r\n popupClose() {\r\n this.onPopUpClose.emit();\r\n this.hide();\r\n this.masterService.showadditionalcost = true;\r\n // this.masterService.disableAdditionalCost = false;\r\n }\r\n\r\n ngOnChanges(changes: any) {\r\n if(!changes.popupsettings){\r\n return;\r\n } \r\n }\r\n}\r\n\r\nexport class FileUploaderPopUpSettings {\r\n title: string;\r\n uploadEndpoints: string;\r\n sampleFileUrl : string;\r\n allowMultiple : boolean = false;\r\n acceptFormat : string = \"*\";\r\n note:string;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/file-uploader/file-uploader-popup.component.ts","import { NgModule } from '@angular/core'\r\nimport { NgaModule } from \"../../theme/nga.module\";\r\nimport { ModalModule } from 'ng2-bootstrap';\r\nimport {NgxPaginationModule} from 'ngx-pagination';\r\nimport { Ng2SearchPipeModule } from '../../node_modules/ng2-search-filter';\r\nimport { PoplistComponent } from './PopItemList/PopItems.component';\r\nimport { FocusDirective } from './focus.directive';\r\nimport { PopBatchComponent } from './PopBatchList/PopBatch.component';\r\nimport { PopCategoryComponent } from './PopupCategoryList/PopCategory.component';\r\n//import { FilterPipe, SortByPipe } from '../../theme/directives/pipes/pipes';\r\nimport { PopItemGrpComponent } from './PopupItemGrpList/PopItemGrp.component';\r\nimport { PopSchemeChooserComponent } from './PopScheme/popscheme';\r\nimport { PopPartyChooserComponent } from './PopPartyList/popPartyList';\r\nimport { GenericPopUpComponent } from './generic-grid/generic-popup-grid.component';\r\n \r\n\r\n// import { PopupitemlistComponent } from './PopupItemList.componet';\r\n@NgModule({\r\n imports: [\r\n NgaModule,ModalModule.forRoot(),\r\n NgxPaginationModule,\r\n Ng2SearchPipeModule,\r\n // Ng2SmartTableModule\r\n ],\r\n declarations: [PoplistComponent,FocusDirective,PopBatchComponent,PopCategoryComponent,\r\n PopItemGrpComponent,PopSchemeChooserComponent\r\n // ,FilterPipe\r\n // , SortByPipe,\r\n , PopPartyChooserComponent\r\n \r\n ], \r\n exports: [\r\n PoplistComponent,PopBatchComponent,PopCategoryComponent,\r\n PopItemGrpComponent,PopSchemeChooserComponent\r\n // ,FilterPipe\r\n // , SortByPipe,\r\n ,PopPartyChooserComponent \r\n ],\r\n providers: []\r\n\r\n})\r\n\r\nexport class popupListModule {\r\n \r\n }\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/popuplist.module.ts","import { Component, Input } from '@angular/core';\r\n// import {DecimalPipe} from '@angular/common';\r\nimport { AuthService } from '../../services/permission';\r\nimport * as moment from 'moment'\r\nimport { TransactionService } from '../../Transaction Components/transaction.service';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { DecimalPipe } from '@angular/common';\r\nimport { DateFormatter } from 'ng2-bootstrap';\r\nimport { AlternateUnitTabComponent } from '../../../pages/masters/components/ProductMaster/AlternateUnitTabComponent';\r\nimport { TwoDigitNumber } from '../../../theme/pipes';\r\nimport { settings } from 'cluster';\r\nimport { Console } from 'console';\r\n\r\n\r\n@Component(\r\n {\r\n\r\n selector: 'print-invoice',\r\n template: `
`,\r\n providers: [AuthService]\r\n }\r\n)\r\n\r\nexport class PrintInvoiceComponent {\r\n private companyProfile: any\r\n private userProfile: any\r\n private customerInfo: any\r\n private invoiceType: any\r\n public activeurlpath: string;\r\n public qtyCheckForPrint: boolean = false;\r\n public billformat: any;\r\n public duedate: any;\r\n public title: any;\r\n public mode: any;\r\n public VATresult: any;\r\n\r\n\r\n public totalQuantity: number = 0\r\n public totalNumberOfQuantity: number = 0\r\n public totalCase: number = 0;\r\n public totalEach: number = 0;\r\n arrayIndex: number = 0;\r\n noOfInvoiceForA5: number = 0;\r\n today = new Date();\r\n date = this.today.getFullYear() + '-' + (this.today.getMonth() + 1) + '-' + this.today.getDate();\r\n time = this.today.getHours() + \":\" + this.today.getMinutes() + \":\" + this.today.getSeconds();\r\n dateTime = this.date + ' ' + this.time;\r\n\r\n constructor(private _authService: AuthService, private _transactionService: TransactionService) {\r\n this.userProfile = this._authService.getUserProfile()\r\n this.companyProfile = this.userProfile.CompanyInfo\r\n }\r\n\r\n limitDecimal(value: number) {\r\n return new DecimalPipe('en-US').transform(value, '1.2-2')\r\n }\r\n\r\n changetoUpperCase(value: string) {\r\n return value.toUpperCase();\r\n }\r\n\r\n printInvoice(invoiceData, customerInfo, invoiceType, activeurlpath, billformat, unit, title, mode, caption) {\r\n this.arrayIndex = 0;\r\n this.noOfInvoiceForA5 = Math.ceil((this._transactionService.nullToZeroConverter(invoiceData.ProdList.length)) / 9);\r\n\r\n if (unit == \"CASE\") {\r\n this.qtyCheckForPrint = true;\r\n } else {\r\n this.qtyCheckForPrint = false;\r\n }\r\n\r\n this.invoiceType = invoiceType;\r\n if (customerInfo == null) {\r\n customerInfo = [];\r\n }\r\n if (customerInfo[0] == null) {\r\n customerInfo.push({});\r\n }\r\n this.customerInfo = customerInfo;\r\n this.activeurlpath = activeurlpath;\r\n\r\n this.calCTotalAmountOfItem(invoiceData)\r\n this.calcVAT(invoiceData)\r\n\r\n this.duedate = this._transactionService.transformDatetoMMddYY(invoiceData.AdditionalObj.DUEDATE)\r\n\r\n this.title = title;\r\n this.mode = mode;\r\n\r\n let vat = this.companyProfile.VAT;\r\n this.VATresult = vat.split(\"\");\r\n if(billformat==null || billformat==undefined){\r\n billformat='HALF';\r\n }\r\n \r\n if (billformat=='FULL') {\r\n let popupWin;\r\n let tableData = ``\r\n if(this.invoiceType == \"TI\" && (this.activeurlpath == 'addsientry' || this.activeurlpath == 'shelfbill')){\r\n console.log(\"mode1\",mode,title)\r\n if(mode==\"NEW\"){\r\n title=\"Tax Invoice\";\r\n caption=\"\";\r\n }\r\n }\r\n let head = this.head(invoiceData, billformat, title, mode, caption)\r\n let headinvoice = this.head(invoiceData, billformat, \"Invoice\", mode, caption)\r\n let body = this.body(invoiceData, billformat, unit)\r\n let footer = this.footer(invoiceData, billformat)\r\n let tableDataInvoice = tableData + headinvoice + body + footer + `
`\r\n tableData = tableData + head + body + footer + ``\r\n popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');\r\n if (popupWin.outerWidth < screen.availWidth || popupWin.outerHeight < screen.availHeight)\r\n {\r\n popupWin.moveTo(0,0);\r\n popupWin.resizeTo(screen.availWidth, screen.availHeight);\r\n }\r\n popupWin.document.write(` \r\n \r\n \r\n ${tableData}\r\n \r\n `\r\n );\r\n if (this.invoiceType == \"TI\" && (this.activeurlpath == 'addsientry' || this.activeurlpath == 'shelfbill') && this.mode == 'NEW' && this.title == 'Tax Invoice') {\r\n popupWin.document.write(` \r\n \r\n \r\n \r\n ${tableDataInvoice}\r\n \r\n `\r\n );\r\n if(this.companyProfile.ORG_TYPE == 'superdistributor'){\r\n popupWin.document.write(` \r\n \r\n \r\n \r\n ${tableDataInvoice}\r\n \r\n \r\n `\r\n );\r\n popupWin.document.write(` \r\n \r\n \r\n \r\n ${tableDataInvoice}\r\n \r\n `\r\n );\r\n }\r\n\r\n \r\n }\r\n popupWin.document.close();\r\n }\r\n\r\n if (billformat=='HALF') {\r\n let popupWin;\r\n let tableDataforHalfPrint = ``\r\n let tableDataTIfullprint = `
`\r\n if(this.invoiceType == \"TI\" && (this.activeurlpath == 'addsientry' || this.activeurlpath == 'shelfbill')){\r\n console.log(\"mode2\",mode,title)\r\n if(mode==\"NEW\"){\r\n title=\"Tax Invoice\";\r\n caption=\"\";\r\n }\r\n }\r\n \r\n let head = this.head(invoiceData, billformat, title, mode, caption)\r\n let headinvoice = this.head(invoiceData, billformat, \"Invoice\", mode, caption)\r\n let body = this.body(invoiceData, billformat, unit)\r\n let footer = this.footer(invoiceData, billformat)\r\n let tableDataInvoice_forTIHalf = tableDataforHalfPrint + headinvoice + body + footer + `
`\r\n let tableDataInvoice_forTIFull = tableDataTIfullprint + headinvoice + body + footer + ``\r\n tableDataforHalfPrint = tableDataforHalfPrint + head + body + footer + ``\r\n tableDataTIfullprint = tableDataTIfullprint + head + body + footer + ``\r\n\r\n if ((this.invoiceType == \"PP\" || this.invoiceType == \"PI\" || (this.invoiceType == \"DN\" && this.activeurlpath == \"add-debitnote-itembase\") || (this.invoiceType == \"CN\" && this.activeurlpath == \"add-creditnote-itembase\") ||\r\n this.activeurlpath == \"canceladdsientry\" || this.activeurlpath == 'add-stock-issue' || this.invoiceType == \"OP\" ||\r\n (this.invoiceType == \"TI\" && billformat == 'HALF' && (this.activeurlpath == 'addsientry' || this.activeurlpath == 'shelfbill') || (this.invoiceType == \"RR\" && this.activeurlpath == \"Reverse-Sales-Return\")))) {\r\n\r\n\r\n popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');\r\n if (popupWin.outerWidth < screen.availWidth || popupWin.outerHeight < screen.availHeight)\r\n {\r\n popupWin.moveTo(0,0);\r\n popupWin.resizeTo(screen.availWidth, screen.availHeight);\r\n }\r\n popupWin.document.write(` \r\n \r\n \r\n ${tableDataforHalfPrint}\r\n \r\n `\r\n );\r\n if (this.invoiceType == \"TI\" && (this.activeurlpath == 'addsientry' || this.activeurlpath == 'shelfbill') && this.mode == 'NEW' && this.title == 'Tax Invoice') {\r\n popupWin.document.write(` \r\n \r\n \r\n \r\n ${tableDataInvoice_forTIHalf}\r\n \r\n `\r\n );\r\n if(this.companyProfile.ORG_TYPE == 'superdistributor'){\r\n popupWin.document.write(` \r\n \r\n \r\n \r\n ${tableDataInvoice_forTIHalf}\r\n \r\n `\r\n );\r\n \r\n popupWin.document.write(` \r\n \r\n \r\n \r\n ${tableDataInvoice_forTIHalf}\r\n \r\n `\r\n );\r\n }\r\n }\r\n popupWin.document.close();\r\n }\r\n\r\n // if (this.invoiceType == \"TI\" && billformat == 'FULL' && this.activeurlpath == 'addsientry') {\r\n // popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');\r\n // if (popupWin.outerWidth < screen.availWidth || popupWin.outerHeight < screen.availHeight)\r\n // {\r\n // popupWin.moveTo(0,0);\r\n // popupWin.resizeTo(screen.availWidth, screen.availHeight);\r\n // }\r\n // popupWin.document.write(` \r\n // \r\n // \r\n // ${tableDataTIfullprint}\r\n // \r\n // `\r\n // );\r\n // if (this.activeurlpath == 'addsientry' && this.mode == 'NEW' && this.title == 'Tax Invoice' && billformat == 'FULL') {\r\n // popupWin.document.write(` \r\n // \r\n // \r\n // \r\n // ${tableDataInvoice_forTIFull}\r\n // \r\n // `\r\n // );\r\n // }\r\n // popupWin.document.close();\r\n // }\r\n }\r\n }\r\n\r\n transformDate(date) {\r\n return moment(date).format('DD/MM/YYYY')\r\n }\r\n\r\n isDrCr(dr, cr) {\r\n if (dr > 0) {\r\n return 'DR'\r\n } else if (cr > 0) {\r\n return 'CR'\r\n }\r\n\r\n }\r\n calCTotalAmountOfItem(invoiceData: any) {\r\n this.totalCase = 0;\r\n this.totalNumberOfQuantity = 0;\r\n this.totalEach = 0;\r\n this.totalNumberOfQuantity = this.totalQuantity\r\n for (let i in invoiceData.ProdList) {\r\n this.totalNumberOfQuantity = this.totalNumberOfQuantity + invoiceData.ProdList[i].RealQty;\r\n this.totalCase = this.totalCase + invoiceData.ProdList[i].ALTERNATEQUANTIY;\r\n this.totalEach = this.totalEach + invoiceData.ProdList[i].BASEQUANTITY;\r\n }\r\n // if (this.companyProfile.ORG_TYPE == 'distributor') {\r\n\r\n let totaldiscount = 0; \r\n for (let x of invoiceData.ProdList) {\r\n\r\n totaldiscount = x.FDISCOUNT; \r\n x.INDDISCOUNT = totaldiscount; //need to show ind+flat discount in ind column\r\n }\r\n // invoiceData.ProdList.forEach(x => {\r\n // // x.INDDISCOUNT=x.FDISCOUNT + x.PrimaryDiscount + x.SecondaryDiscount + x.LiquiditionDiscount + x.QpsDiscount\r\n // });\r\n // }\r\n }\r\n\r\n public totalVAT: number = 0\r\n public VATamount: number = 0\r\n calcVAT(invoiceData: any) {\r\n\r\n this.VATamount = this.totalVAT\r\n for (let i in invoiceData.ProdList) {\r\n this.VATamount = this.VATamount + invoiceData.ProdList[i].VAT\r\n }\r\n }\r\n\r\n head(data, billformat, title, mode, caption): string {\r\n console.log(\"@@VoucherType,INVOICETYPE,ACTIVERURL,BILLFORMAT,title,caption\",this._transactionService.TrnMainObj.VoucherType,this.invoiceType,this.activeurlpath,billformat,title,caption)\r\n var header = \"\"\r\n var row = \"\"\r\n //Reset arrayIndex for multiple calls\r\n this.arrayIndex = 0\r\n if (this.invoiceType == \"TI\" && (this.activeurlpath == 'addsientry' || this.activeurlpath == 'shelfbill') && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0)\r\n {\r\n header = header + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${caption}\r\n \r\n \r\n ${title}\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Mobile No. : ${this.customerInfo[0].MOBILE == null ? '' : this.customerInfo[0].MOBILE}\r\n Invoice Miti\r\n : ${data.BSDATE} ${data.TRNTIME}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n \r\n \r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n Due Date\r\n :  ${data.AdditionalObj.DUEDATE == null ? ' ' : this.transformDate(data.AdditionalObj.DUEDATE)}  ${this._transactionService.subtractDates(this._transactionService.transformDatetoMMddYY(new Date()), this.duedate)} Days\r\n \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n \r\n `\r\n }\r\n else\r\n {\r\n header = header + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${caption}\r\n \r\n \r\n ${title}\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Mobile No. : ${this.customerInfo[0].MOBILE == null ? '' : this.customerInfo[0].MOBILE}\r\n Invoice Miti\r\n : ${data.BSDATE} ${data.TRNTIME}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n \r\n \r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n Due Date\r\n :  ${data.AdditionalObj.DUEDATE == null ? ' ' : this.transformDate(data.AdditionalObj.DUEDATE)}  ${this._transactionService.subtractDates(this._transactionService.transformDatetoMMddYY(new Date()), this.duedate)} Days\r\n \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n \r\n ` \r\n }\r\n } else if (this.invoiceType == \"TI\" && (this.activeurlpath == 'addsientry' || this.activeurlpath == 'shelfbill') && billformat == 'HALF') {\r\n\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n ${caption}\r\n \r\n \r\n ${title}\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Mobile No. : ${this.customerInfo[0].MOBILE == null ? '' : this.customerInfo[0].MOBILE}\r\n Invoice Miti\r\n : ${data.BSDATE} ${data.TRNTIME}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n \r\n \r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n Due Date\r\n :  ${data.AdditionalObj.DUEDATE == null ? ' ' : this.transformDate(data.AdditionalObj.DUEDATE)}  ${this._transactionService.subtractDates(this._transactionService.transformDatetoMMddYY(new Date()), this.duedate)} Days\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].RealQty}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n console.log(\"Reached inside\",this._transactionService.userSetting.SHOWPRINTBY);\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n  \r\n \r\n
\r\n\r\n `} else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n
`\r\n }\r\n } else{\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${caption}\r\n \r\n \r\n ${title}\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Mobile No. : ${this.customerInfo[0].MOBILE == null ? '' : this.customerInfo[0].MOBILE}\r\n Invoice Miti\r\n : ${data.BSDATE} ${data.TRNTIME}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n \r\n \r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n Due Date\r\n :  ${data.AdditionalObj.DUEDATE == null ? ' ' : this.transformDate(data.AdditionalObj.DUEDATE)}  ${this._transactionService.subtractDates(this._transactionService.transformDatetoMMddYY(new Date()), this.duedate)} Days\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].RealQty}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n \r\n `\r\n \r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n
\r\n \r\n ` \r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n
\r\n \r\n ` }\r\n }\r\n \r\n }\r\n return row;\r\n } else if (this.invoiceType == \"PP\" && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PROFORMA INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PROFORMA INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }\r\n } else if (this.invoiceType == \"PP\" && (billformat == 'HALF')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PROFORMA INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].RealQty}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n \r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n
\r\n \r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n
\r\n\r\n `}\r\n }\r\n return row;\r\n }else{\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PROFORMA INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n Invoice No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Transport:\r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].RealQty}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n \r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n
\r\n \r\n `\r\n } else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n
\r\n\r\n `}\r\n }\r\n return row;\r\n }}\r\n else if (this.invoiceType == \"PI\" && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PURCHASE INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n PI No.\r\n : ${data.VCHRNO}\r\n\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Invoice No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BSDATE}\r\n \r\n \r\n \r\n Received Date\r\n : ${data.AdditionalObj.RECEIVEDDATE == null ? ' ' : this.transformDate(data.AdditionalObj.RECEIVEDDATE)}\r\n \r\n \r\n \r\n Vehicle No.: ${data.AdditionalObj.VEHICLENO == null ? ' ' : data.AdditionalObj.VEHICLENO}\r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PURCHASE INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n PI No.\r\n : ${data.VCHRNO}\r\n\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Invoice No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BSDATE}\r\n \r\n \r\n \r\n Received Date\r\n : ${data.AdditionalObj.RECEIVEDDATE == null ? ' ' : this.transformDate(data.AdditionalObj.RECEIVEDDATE)}\r\n \r\n \r\n \r\n Vehicle No.: ${data.AdditionalObj.VEHICLENO == null ? ' ' : data.AdditionalObj.VEHICLENO}\r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }}\r\n else if (this.invoiceType == \"PI\" && (billformat == 'HALF')) {\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PURCHASE INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n PI No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Invoice No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${this.customerInfo[0] == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BSDATE}\r\n \r\n \r\n \r\n Vehicle No.: ${data.AdditionalObj.VEHICLENO == null ? ' ' : data.AdditionalObj.VEHICLENO}\r\n Mode of Payment: ${data.TRNMODE} Received Date\r\n : ${data.AdditionalObj.RECEIVEDDATE == null ? ' ' : this.transformDate(data.AdditionalObj.RECEIVEDDATE)}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n\r\n
\r\n\r\n\r\n `\r\n }else{\r\n \r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n\r\n
\r\n\r\n\r\n `}\r\n } else{\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n PURCHASE INVOICE\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n PI No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Invoice No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${this.customerInfo[0] == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BSDATE}\r\n \r\n \r\n \r\n Vehicle No.: ${data.AdditionalObj.VEHICLENO == null ? ' ' : data.AdditionalObj.VEHICLENO}\r\n Mode of Payment: ${data.TRNMODE} Received Date\r\n : ${data.AdditionalObj.RECEIVEDDATE == null ? ' ' : this.transformDate(data.AdditionalObj.RECEIVEDDATE)}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n
\r\n \r\n \r\n ` \r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n\r\n
\r\n\r\n\r\n `}\r\n }}\r\n return row;\r\n } else if ((this.invoiceType == \"DN\" && this.activeurlpath == \"add-debitnote-itembase\") && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n Debit Note\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n D.N. No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFORDBILL?data.REFORDBILL:''}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BSDATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Mode of Return: ${data.TRNMODE}\r\n Invoice Amount\r\n : ${data.NETAMNT}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n Debit Note\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n D.N. No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFORDBILL?data.REFORDBILL:''}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Mode of Return: ${data.TRNMODE}\r\n Invoice Amount\r\n : ${data.NETAMNT}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }} else if ((this.invoiceType == \"DN\" && this.activeurlpath == \"add-debitnote-itembase\") && (billformat == 'HALF')) {\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n Debit Note\r\n \r\n \r\n M/S           : ${this.customerInfo[0] == null ? '' : data.BILLTO}\r\n D.N. No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${this.customerInfo[0] == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFORDBILL?data.REFORDBILL:''}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Mode of Return: ${data.TRNMODE}\r\n Invoice Amount\r\n : ${data.NETAMNT}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n\r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n\r\n
\r\n\r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n\r\n
\r\n\r\n `}\r\n }else{\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n Debit Note\r\n \r\n \r\n M/S           : ${this.customerInfo[0] == null ? '' : data.BILLTO}\r\n D.N. No.\r\n : ${data.VCHRNO}\r\n \r\n Address     : ${this.customerInfo[0] == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFORDBILL?data.REFORDBILL:''}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n \r\n Mode of Return: ${data.TRNMODE}\r\n Invoice Amount\r\n : ${data.NETAMNT}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n\r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n\r\n
\r\n\r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n\r\n
\r\n\r\n `}\r\n }}\r\n return row;\r\n } else if ((this.invoiceType == \"CN\" && this.activeurlpath == \"add-creditnote-itembase\") && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n Credit Note\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n Credit Note\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }} else if ((this.invoiceType == \"CN\" && this.activeurlpath == \"add-creditnote-itembase\") && (billformat == 'HALF')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n Credit Note\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n\r\n
\r\n\r\n `\r\n } else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n\r\n
\r\n\r\n `}\r\n }\r\n return row;\r\n }else{\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n Credit Note\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n\r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n\r\n
\r\n\r\n `}\r\n }\r\n return row;\r\n }} else if (this.activeurlpath == 'canceladdsientry' && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n BILL CANCEL\r\n \r\n \r\n M/S           : ${this.customerInfo[0] == null ? '' : data.BILLTO}\r\n \r\n  \r\n \r\n \r\n Address     : ${this.customerInfo[0] == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${this.customerInfo[0] == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n BILL CANCEL\r\n \r\n \r\n M/S           : ${this.customerInfo[0] == null ? '' : data.BILLTO}\r\n \r\n  \r\n \r\n \r\n Address     : ${this.customerInfo[0] == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${this.customerInfo[0] == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }}\r\n else if (this.activeurlpath == 'canceladdsientry' && (billformat == 'HALF')) {\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n BILL CANCEL\r\n \r\n \r\n M/S           : ${this.customerInfo[0] == null ? '' : data.BILLTO}\r\n \r\n  \r\n \r\n \r\n Address     : ${this.customerInfo[0] == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${this.customerInfo[0] == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total ${this.qtyCheckForPrint == true ? 'Cases' : 'Eaches'}:        ${this.limitDecimal(this.totalEach)} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n\r\n
\r\n\r\n `\r\n }\r\n row = row + `\r\n \r\n \r\n  \r\n Total ${this.qtyCheckForPrint == true ? 'Cases' : 'Eaches'}:        ${this.limitDecimal(this.totalEach)} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n
\r\n\r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n BILL CANCEL\r\n \r\n \r\n M/S           : ${this.customerInfo[0] == null ? '' : data.BILLTO}\r\n \r\n  \r\n \r\n \r\n Address     : ${this.customerInfo[0] == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${this.customerInfo[0] == null ? '' : data.BILLTOTEL}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total ${this.qtyCheckForPrint == true ? 'Cases' : 'Eaches'}:        ${this.limitDecimal(this.totalEach)} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n\r\n
\r\n\r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total ${this.qtyCheckForPrint == true ? 'Cases' : 'Eaches'}:        ${this.limitDecimal(this.totalEach)} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n
\r\n\r\n `}\r\n }}\r\n return row;\r\n } else if ((this.activeurlpath == 'add-stock-issue') && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n STOCK TRANSFER\r\n \r\n \r\n M/S           : ${this.companyProfile.NAME}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n\r\n \r\n Address     : ${this.companyProfile.ADDRESS}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No.: ${this.companyProfile.TELA}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${this.companyProfile.VAT}\r\n From Godown\r\n : Main Warehouse}\r\n \r\n \r\n \r\n To Godown\r\n : ${data.BILLTOADD}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Case\r\n Each\r\n MRP\r\n Rate\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n STOCK TRANSFER\r\n \r\n \r\n M/S           : ${this.companyProfile.NAME}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n\r\n \r\n Address     : ${this.companyProfile.ADDRESS}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No.: ${this.companyProfile.TELA}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n PAN/VAT\r\n No.   : ${this.companyProfile.VAT}\r\n From Godown\r\n : Main Warehouse}\r\n \r\n \r\n \r\n To Godown\r\n : ${data.BILLTOADD}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Case\r\n Each\r\n Rate\r\n Amount\r\n \r\n \r\n `\r\n }} else if (this.activeurlpath == 'add-stock-issue' && (billformat == 'HALF')) {\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n STOCK TRANSFER\r\n \r\n \r\n M/S           : ${this.companyProfile.NAME}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n Address     : ${this.companyProfile.ADDRESS}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No.: ${this.companyProfile.TELA}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${this.companyProfile.VAT}\r\n From Godown\r\n : Main Warehouse\r\n \r\n \r\n \r\n To Godown\r\n : ${data.BILLTOADD}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Case\r\n Each\r\n MRP\r\n Rate\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${data.ProdList[this.arrayIndex].ALTERNATEQUANTIY}\r\n ${data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n\r\n
\r\n\r\n `\r\n }else{\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n\r\n
\r\n\r\n `}\r\n }else{\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n STOCK TRANSFER\r\n \r\n \r\n M/S           : ${this.companyProfile.NAME}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n Address     : ${this.companyProfile.ADDRESS}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n Phone No.: ${this.companyProfile.TELA}\r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${this.companyProfile.VAT}\r\n From Godown\r\n : Main Warehouse\r\n \r\n \r\n \r\n To Godown\r\n : ${data.BILLTOADD}\r\n \r\n \r\n \r\n Transport: \r\n Mode of Payment: ${data.TRNMODE}\r\n \r\n   \r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Case\r\n Each\r\n\r\n Rate\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${data.ProdList[this.arrayIndex].ALTERNATEQUANTIY}\r\n ${data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n \r\n
\r\n \r\n ` \r\n }\r\n else{\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n\r\n
\r\n\r\n ` }\r\n }}\r\n return row;\r\n }\r\n else if (this.invoiceType == \"OP\" && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n OPENING STOCK\r\n \r\n \r\n \r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Case\r\n Each\r\n MRP\r\n Rate\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n OPENING STOCK\r\n \r\n \r\n \r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Case\r\n Each\r\n Rate\r\n Amount\r\n \r\n \r\n `\r\n }} else if (this.invoiceType == \"OP\" && (billformat == 'HALF')) {\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n OPENING STOCK\r\n \r\n \r\n \r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Case\r\n Each\r\n MRP\r\n Rate\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${data.ProdList[this.arrayIndex].ALTERNATEQUANTIY}\r\n ${data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n  \r\n Taxable Amount:${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n
\r\n \r\n `\r\n } else{\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n  \r\n Taxable Amount:${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n\r\n
\r\n\r\n `}\r\n }else{\r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n OPENING STOCK\r\n \r\n \r\n \r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Invoice Miti\r\n : ${data.BS_DATE}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Case\r\n Each\r\n Rate\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${data.ProdList[this.arrayIndex].ALTERNATEQUANTIY}\r\n ${data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1 ){\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n  \r\n Taxable Amount:${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n\r\n
\r\n\r\n `\r\n }else{\r\n row = row + `\r\n \r\n  \r\n Total:\r\n  Cases: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n  \r\n Taxable Amount:${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n\r\n
\r\n\r\n `}\r\n }}\r\n return row;\r\n }else if ((this.invoiceType == \"RR\" && this.activeurlpath == \"Reverse-Sales-Return\") && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n Credit Note Reverse\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }else{\r\n header = header +\r\n `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ${title}\r\n \r\n \r\n Credit Note Reverse\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No.\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date: ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n \r\n `\r\n }}else if ((this.invoiceType == \"RR\" && this.activeurlpath == \"Reverse-Sales-Return\") && (billformat == 'HALF')) {\r\n for (let i = 1; i <= this.noOfInvoiceForA5; i++) {\r\n var j = 1;\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){ \r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n Credit Note Reverse\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n Quantity\r\n Unit\r\n MRP\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n } if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n
\r\n \r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n
\r\n\r\n `}\r\n }else{ \r\n row = row + `\r\n \r\n \r\n ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n ${this.companyProfile.ADDRESS}
\r\n Phone No: ${this.companyProfile.TELA},${this.companyProfile.TELB}
\r\n Email:${this.companyProfile.EMAIL == null ? '' : this.companyProfile.EMAIL}
\r\n \r\n \r\n  \r\n \r\n PAN/VAT No.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\r\n ${title}\r\n \r\n \r\n Credit Note Reverse\r\n \r\n \r\n M/S           : ${data.BILLTO == null ? '' : data.BILLTO}\r\n C.N. No.\r\n : ${data.VCHRNO}\r\n \r\n \r\n Address     : ${data.BILLTOADD == null ? '' : data.BILLTOADD}\r\n Ref Bill No\r\n : ${data.REFBILL}\r\n \r\n \r\n Phone No. : ${this.customerInfo[0].PHONE == null ? '' : this.customerInfo[0].PHONE}\r\n Transaction Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n PAN/VAT\r\n NO.: ${data.BILLTOTEL == null ? '' : data.BILLTOTEL}\r\n Invoice Date\r\n : ${this.transformDate(data.TRNDATE)}\r\n \r\n \r\n \r\n Return Mode: ${data.TRNMODE}\r\n Invoice Miti\r\n : ${data.BS_DATE} ${data.TRNTIME}\r\n \r\n \r\n Sr#\r\n HS Code\r\n Code\r\n Description\r\n Batch\r\n MRP\r\n Quantity\r\n Unit\r\n Rate\r\n Discount\r\n Amount\r\n \r\n `\r\n for (j; j <= 9; j++) {\r\n if (this.arrayIndex < this._transactionService.nullToZeroConverter(data.ProdList.length)) {\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(this.arrayIndex) + 1}\r\n ${data.ProdList[this.arrayIndex].HS_Code?data.ProdList[this.arrayIndex].HS_Code:''}\r\n ${data.ProdList[this.arrayIndex].MCODE}\r\n ${data.ProdList[this.arrayIndex].ITEMDESC}\r\n ${data.ProdList[this.arrayIndex].BATCH}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[this.arrayIndex].ALTERNATEQUANTIY : data.ProdList[this.arrayIndex].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[this.arrayIndex].RATE * data.ProdList[this.arrayIndex].ALTCONFACTOR) : this.limitDecimal(data.ProdList[this.arrayIndex].RATE)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[this.arrayIndex].FAMOUNT)}\r\n \r\n\r\n `\r\n\r\n }\r\n this.arrayIndex = this.arrayIndex + 1;\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n
\r\n \r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n  \r\n Total Quantity:   ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n
\r\n\r\n `}\r\n }}\r\n return row;\r\n }\r\n return header\r\n }\r\n\r\n\r\n body(data, billformat, unit): string {\r\n var row = \"\"\r\n\r\n if ((this.invoiceType == \"TI\" || this.invoiceType == \"PP\")\r\n && ( billformat == 'FULL')) {\r\n \r\n for (let i in data.ProdList) {\r\n // console.log(\"CheckRateonly\", (data.ProdList[i].RATE * data.ProdList[i].ALTCONFACTOR, data.ProdList[i].RATE, data.ProdList[i].ALTCONFACTOR))\r\n \r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat==0){\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(i) + 1}\r\n ${data.ProdList[i].HS_Code?data.ProdList[i].HS_Code:''}\r\n ${data.ProdList[i].MCODE}\r\n ${data.ProdList[i].ITEMDESC}\r\n ${data.ProdList[i].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[i].ALTERNATEQUANTIY : data.ProdList[i].RealQty}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[i].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[i].RATE * data.ProdList[i].ALTCONFACTOR) : this.limitDecimal(data.ProdList[i].RATE)}\r\n ${this.limitDecimal(data.ProdList[i].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[i].FAMOUNT)}\r\n \r\n `\r\n }\r\n else{\r\n\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(i) + 1}\r\n ${data.ProdList[i].HS_Code?data.ProdList[i].HS_Code:''}\r\n ${data.ProdList[i].MCODE}\r\n ${data.ProdList[i].ITEMDESC}\r\n ${data.ProdList[i].BATCH}\r\n ${this.limitDecimal(data.ProdList[i].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[i].ALTERNATEQUANTIY : data.ProdList[i].RealQty}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[i].RATE * data.ProdList[i].ALTCONFACTOR) : this.limitDecimal(data.ProdList[i].RATE)}\r\n ${this.limitDecimal(data.ProdList[i].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[i].FAMOUNT)}\r\n \r\n ` \r\n }\r\n }\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n } else if ((this.invoiceType == \"PI\" || (this.invoiceType == \"DN\" && this.activeurlpath == \"add-debitnote-itembase\") || (this.invoiceType == \"CN\" && this.activeurlpath == \"add-creditnote-itembase\")\r\n || this.activeurlpath == 'canceladdsientry' || (this.invoiceType == \"RR\" && this.activeurlpath == \"Reverse-Sales-Return\")) && (billformat == 'FULL')) {\r\n for (let i in data.ProdList) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat==0){\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(i) + 1}\r\n ${data.ProdList[i].HS_Code?data.ProdList[i].HS_Code:''}\r\n ${data.ProdList[i].MCODE}\r\n ${data.ProdList[i].ITEMDESC}\r\n ${data.ProdList[i].BATCH}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[i].ALTERNATEQUANTIY : data.ProdList[i].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.limitDecimal(data.ProdList[i].MRP)}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[i].RATE * data.ProdList[i].ALTCONFACTOR) : this.limitDecimal(data.ProdList[i].RATE)}\r\n ${this.limitDecimal(data.ProdList[i].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[i].FAMOUNT)}\r\n \r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(i) + 1}\r\n ${data.ProdList[i].HS_Code?data.ProdList[i].HS_Code:''}\r\n ${data.ProdList[i].MCODE}\r\n ${data.ProdList[i].ITEMDESC}\r\n ${data.ProdList[i].BATCH}\r\n ${this.limitDecimal(data.ProdList[i].MRP)}\r\n ${this.qtyCheckForPrint == true ? data.ProdList[i].ALTERNATEQUANTIY : data.ProdList[i].BASEQUANTITY}\r\n ${this.qtyCheckForPrint == true ? 'Case' : 'Each'}\r\n ${this.qtyCheckForPrint == true ? this.limitDecimal(data.ProdList[i].RATE * data.ProdList[i].ALTCONFACTOR) : this.limitDecimal(data.ProdList[i].RATE)}\r\n ${this.limitDecimal(data.ProdList[i].INDDISCOUNT)}\r\n ${this.limitDecimal(data.ProdList[i].FAMOUNT)}\r\n \r\n `\r\n }}\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n \r\n else if (( this.activeurlpath == 'add-stock-issue' || this.invoiceType == \"OP\") && (billformat == 'FULL')) {\r\n for (let i in data.ProdList) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat==0){\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(i) + 1}\r\n ${data.ProdList[i].HS_Code?data.ProdList[i].HS_Code:''}\r\n ${data.ProdList[i].MCODE}\r\n ${data.ProdList[i].ITEMDESC}\r\n ${data.ProdList[i].BATCH}\r\n ${data.ProdList[i].ALTERNATEQUANTIY}\r\n ${data.ProdList[i].BASEQUANTITY}\r\n ${this.limitDecimal(data.ProdList[i].MRP)}\r\n ${this.limitDecimal(data.ProdList[i].RATE)}\r\n ${this.limitDecimal(data.ProdList[i].FAMOUNT)}\r\n \r\n `\r\n }else{\r\n row = row + `\r\n \r\n \r\n ${this._transactionService.nullToZeroConverter(i) + 1}\r\n ${data.ProdList[i].HS_Code?data.ProdList[i].HS_Code:''}\r\n ${data.ProdList[i].MCODE}\r\n ${data.ProdList[i].ITEMDESC}\r\n ${data.ProdList[i].BATCH}\r\n ${this.limitDecimal(data.ProdList[i].MRP)}\r\n ${data.ProdList[i].ALTERNATEQUANTIY}\r\n ${data.ProdList[i].BASEQUANTITY}\r\n ${this.limitDecimal(data.ProdList[i].RATE)}\r\n ${this.limitDecimal(data.ProdList[i].FAMOUNT)}\r\n \r\n `\r\n }}\r\n row = row + `\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n `\r\n }\r\n return \"\" + row + \"\"\r\n }\r\n\r\n\r\n footer(data, billformat): string {\r\n\r\n var footer = \"\"\r\n if ((this.invoiceType == \"TI\" || this.invoiceType == \"PP\" ) && billformat == 'FULL') {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){ \r\n footer = footer + `\r\n k\r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n`} else{\r\n footer = footer + `\r\n \r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n`\r\n} \r\n }else{\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1 ){\r\n footer = footer + `\r\n \r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n`}\r\nelse{\r\n footer = footer + `\r\n \r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalNumberOfQuantity} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Discount              :\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n`\r\n}\r\n }\r\n } else if (((this.invoiceType == \"DN\" && this.activeurlpath == \"add-debitnote-itembase\") || (this.invoiceType == \"CN\" && this.activeurlpath == \"add-creditnote-itembase\") || this.invoiceType == \"PI\" || this.activeurlpath == \"canceladdsientry\" || (this.invoiceType == \"RR\" && this.activeurlpath == \"Reverse-Sales-Return\")) && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1 ){\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n `}else{\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n `\r\n }\r\n }else{\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n `} else{\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total Quantity:  ${this.qtyCheckForPrint == true ? this.totalCase : this.totalEach} \r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n Remarks:\r\n Discount              :\r\n \r\n \r\n ${data.REMARKS == null ? '' : data.REMARKS}\r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n `\r\n }\r\n }\r\n } else if ((this.activeurlpath == 'add-stock-issue' || this.invoiceType == \"OP\") && (billformat == 'FULL')) {\r\n if(this._transactionService.userSetting.UseNewHtmlPrintFormat == 0){\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total:\r\n  Case: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n \r\n `\r\n }else{\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total:\r\n  Case: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n \r\n \r\n `}\r\n }else{\r\n if(this._transactionService.userSetting.SHOWPRINTBY == 1){\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total:\r\n  Case: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n  Printed By: ${this.userProfile.username}\r\n \r\n \r\n \r\n `}else{\r\n footer = footer +\r\n `\r\n \r\n \r\n \r\n  \r\n Total:\r\n  Case: ${this.totalCase}\r\n  Eaches: ${this.totalEach}\r\n Gross Amount   :${this.limitDecimal(data.TOTAMNT)}\r\n \r\n \r\n \r\n  \r\n Taxable Amount: ${this.limitDecimal(data.TAXABLE)}\r\n \r\n \r\n \r\n  \r\n VAT 13%             :\r\n \r\n \r\n Amount Payable In\r\n Words:-\r\n Rounded Off       :\r\n \r\n \r\n ${this.changetoUpperCase(this._transactionService.digitToWord(data.NETAMNT))}\r\n Net Amount       :${this.limitDecimal(data.NETAMNT)}\r\n \r\n \r\n Note:\r\n For ${this.companyProfile.NAME}\r\n \r\n \r\n \r\n 1. Goods once sold will not be returned.\r\n \r\n  \r\n \r\n \r\n \r\n 2. Interest will be charged @ of bank rule if payment is not made within due date mentioned\r\n above.\r\n \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n Authorized Signatory\r\n \r\n \r\n ****Bill can not be reprinted****\r\n \r\n\r\n \r\n \r\n `\r\n }\r\n }\r\n }\r\n\r\n return footer\r\n }\r\n\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/Invoice/print-invoice/print-invoice.component.ts","import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, HostListener } from '@angular/core';\r\nimport { MasterRepo } from '../../repositories';\r\nimport { TrnProd, VoucherTypeEnum } from '../../interfaces';\r\nimport { TransactionService } from '../../Transaction Components/transaction.service';\r\nimport { forEach } from '@angular/router/src/utils/collection';\r\n\r\n@Component(\r\n {\r\n selector: 'PBatchList',\r\n template: require('./PopBatch.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')],\r\n\r\n }\r\n)\r\nexport class PopBatchComponent {\r\n /** Input/Output/Viewchild */\r\n //@Input('voucherType') voucherType:VoucherTypeEnum;\r\n @Input() title: string;\r\n @Input() tabindex;\r\n @Input() inputSearch: string;\r\n @Output() dbClickEvent = new EventEmitter();\r\n @Output() BatchClosedClick = new EventEmitter();\r\n @Output() searchItem = new EventEmitter();\r\n @Output() returnBatchValue = new EventEmitter();\r\n @Output() multiBatchScheme=new EventEmitter();\r\n @ViewChild(\"BatchEntry\") _BE: ElementRef;\r\n @ViewChild(\"SearchBox\") _Search: ElementRef;\r\n @ViewChild(\"datatable\") datatable:ElementRef;\r\n \r\n /** Object Declaration */\r\n selectPopupRowList: Function;\r\n selectedRow: number;\r\n selectedRowIndex: number;\r\n isFocus: boolean = true;\r\n orgType:any;\r\n\r\n /** List Declaration */\r\n p: number[] = [];\r\n setClickedRow: Function;\r\n BatchObj: any={};\r\n BatchList:any[]=[];\r\n @Input() BList:any[]=[];\r\n unitList: any[] = [];\r\n @Input() voucherType:any;\r\n @Input() activerowIndex:number;\r\n @Input() AlternateUnits:any[]=[];\r\n constructor(private masterService: MasterRepo,private _trnMainService: TransactionService) {\r\n // this.masterService.getAllUnitList().subscribe(data => {\r\n // this.unitList.push(data);\r\n // })\r\n this.orgType=this._trnMainService.userProfile.CompanyInfo.ORG_TYPE;\r\n this.selectedRowIndex=0;\r\n this.setClickedRow = function (index) {\r\n this.selectedRow = index;\r\n }\r\n // var DummyData = [{ \"BC\": '1234', \"EXPDATE\": '03/18/2020', \"MFGDATE\": '03/18/2018', \"SP\": '500', \"Stock\": 24, \"MP\": \"350\" },\r\n // { \"BC\": '2738', \"EXPDATE\": '03/18/2025', \"MFGDATE\": '03/18/2018', \"SP\": '500', \"Stock\": 2429, \"MP\": \"350\" },\r\n // { \"BC\": '4885', \"EXPDATE\": '02/12/2021', \"MFGDATE\": '03/19/2019', \"SP\": '400', \"Stock\": 2400, \"MP\": \"250\" },\r\n // { \"BC\": '6905', \"EXPDATE\": '07/13/2019', \"MFGDATE\": '07/13/2018', \"SP\": '750', \"Stock\": 2241, \"MP\": \"550\" },\r\n // { \"BC\": '1239', \"EXPDATE\": '08/28/2020', \"MFGDATE\": '03/28/2017', \"SP\": '1100', \"Stock\": 1124, \"MP\": \"800\" },\r\n // { \"BC\": '4993', \"EXPDATE\": '09/08/2019', \"MFGDATE\": '03/08/2020', \"SP\": '200', \"Stock\": 2402, \"MP\": \"150\" },\r\n // { \"BC\": '1944', \"EXPDATE\": '012/22/2022', \"MFGDATE\": '03/18/2019', \"SP\": '100', \"Stock\": 343, \"MP\": \"50\" }]\r\n // this.BList=DummyData;\r\n }\r\n ngAfterViewInit() {\r\n // document.getElementById('batchFilterPopup').focus();\r\n \r\n // if(this.voucherType==3){\r\n // this.AlternateUnits= this._trnMainService.TrnMainObj.ProdList[this.activerowIndex].Product.AlternateUnits;\r\n // let defaultunit=this._trnMainService.TrnMainObj.ProdList[this.activerowIndex].Product.AlternateUnits.filter(x=>x.ISDEFAULT==1)[0];\r\n // if(defaultunit!=null){\r\n // this.BatchObj.UNIT = defaultunit.ALTUNIT;\r\n // this.BatchObj.PPrice=defaultunit.PRATE;\r\n // this.BatchObj.SPrice=defaultunit.RATE;\r\n // } \r\n // }\r\n }\r\n ngOnInit() {\r\n this._Search.nativeElement.focus();\r\n }\r\n SelectUnit()\r\n{\r\n this.BatchObj.UNIT = this.BatchObj.ALTUNITObj.ALTUNIT;\r\n this.BatchObj.PRATE=this.BatchObj.ALTUNITObj.PRATE;\r\n this.BatchObj.SRATE=this.BatchObj.ALTUNITObj.RATE;\r\n // this._trnMainService.TrnMainObj.ProdList[i].unitQty={};\r\n // this.TrnMainObj.ProdList[i].unitQty.BaseUnit=this.TrnMainObj.ProdList[i].SELECTEDITEM.BASEUNIT;\r\n // this.TrnMainObj.ProdList[i].unitQty.ConversionFactor=selectedunit.CONFACTOR;\r\n // this.TrnMainObj.ProdList[i].unitQty.Unit=selectedunit.ALTUNIT;\r\n // this.TrnMainObj.ProdList[i].unitQty.Rate=selectedunit.PRATE;\r\n // this.TrnMainObj.ProdList[i].ALTRATE=selectedunit.PRATE;\r\n // this.TrnMainObj.ProdList[i].ALTUNIT=selectedunit.ALTUNIT;\r\n // this.TrnMainObj.ProdList[i].REALRATE=this.TrnMainObj.ProdList[i].PRATE=selectedunit.PRATE/selectedunit.CONFACTOR;\r\n // this.TrnMainObj.ProdList[i].UNIT=selectedunit.ALTUNIT;\r\n}\r\n pagingChange(value) {\r\n this.p[this.tabindex] = value;\r\n }\r\n setFocus() {\r\n // this._BE.nativeElement.focus();\r\n }\r\n SearchList(value) {\r\n // this.itemChanged(value);\r\n\r\n }\r\n\r\n\r\n\r\n PopupItemListRowClick(index) {\r\n this.selectedRowIndex = index;\r\n }\r\n \r\n itemBatchClosed() {\r\n this.BatchClosedClick.emit();\r\n }\r\n keydownClick() {\r\n\r\n }\r\n AddNewBatch() {\r\n // this.BatchList=this.BList;\r\n setTimeout(()=>{\r\n // this._BE.nativeElement.focus();\r\n },50)\r\n \r\n }\r\n\r\n tabClick() {\r\n this.returnBatchValue.emit(this.BatchObj);\r\n }\r\n clickPlusButton(){\r\n this.tabClick()\r\n }\r\n clickButtonClick() {\r\n if (this.BatchObj.BATCH == null) {\r\n alert(\"Please enter Batch no.\");\r\n // this.childModal.show();\r\n // this.DialogMessage=\"Please enter Batch no.\";\r\n // setTimeout(()=>{\r\n // this.childModal.hide();\r\n // },500)\r\n\r\n return;\r\n }\r\n else if(this.BatchObj.MFGDATE>this.BatchObj.EXPIRY\r\n ){\r\n alert(\"Manufacture date cannot be greater than Expiry date!!\")\r\n // this.childModal.show();\r\n // this.DialogMessage=\"Manufacture date cannot be greater than Expiry date!\";\r\n // setTimeout(()=>{\r\n // this.childModal.hide();\r\n // },1500)\r\n return;\r\n }\r\n else if(this.BatchObj.SRATE>this.BatchObj.MRP){\r\n // this.childModal.show();\r\n // this.DialogMessage=\"SP cannot be greater than MRP!\";\r\n // setTimeout(()=>{\r\n // this.childModal.hide();\r\n // },800)\r\n // alert(\"SP cannot be greater than MRP!\")\r\n // return;\r\n }\r\n else if(this.BatchObj.MFGDATE==null || this.BatchObj.EXPIRY == null){\r\n alert(\"MFGDate and ExpDate cannot be empty!\")\r\n // this.childModal.show();\r\n // this.DialogMessage=\"MFGDate and ExpDate cannot be empty!\";\r\n // setTimeout(()=>{\r\n // this.childModal.hide();\r\n // },800)\r\n return;\r\n }\r\n this.tabClick()\r\n \r\n \r\n }\r\n RowClickEvent(index)\r\n {\r\n \r\n this.selectedRowIndex=index;\r\n }\r\n dblClickBatchObj(value) {\r\n // if(value.SchemeRateType==2){\r\n // if(value.tQuantity==null || value.tQuantity<=0)\r\n // {\r\n // alert(\"Invalid Quantity Detected in selected batch. Please enter valid quantity..\");\r\n // return;\r\n // }\r\n // if(value.STOCK< value.tQuantity)\r\n // {\r\n // alert(\"Invalid Quantity Detected in selected batch. Quantity exceed the stock..\");\r\n // return;\r\n // }\r\n // if((value.SCHEME.minQty+value.SCHEME.schemeDisRate)>value.tQuantity)\r\n // { \r\n // if(confirm(\"Enter quantity not contain scheme.Do you want to continue?\")==false){\r\n // return;\r\n // }\r\n // }\r\n // }\r\n this.dbClickEvent.emit(value)\r\n \r\n }\r\n MultiBatchEntryClicked()\r\n {\r\n var filteredList= this.BList.filter(x=>x.tQuantity>0);\r\n var firstBatch=filteredList[0];\r\n if(firstBatch==null){alert(\"Row with valid Quantity not detected...\");return;}\r\n if(filteredList.filter(x=>x.SCHEME.schemeID!=firstBatch.SCHEME.schemeID)[0]!=null)\r\n {\r\n alert(\"Can not Choose multi batch of different Scheme...\");\r\n return;\r\n }\r\n if(filteredList.filter(x=>x.STOCK{totaltQty+=q.tQuantity;});\r\n }\r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n onKeydown($event: KeyboardEvent)\r\n {\r\n this.setFocus();\r\n if(this.selectedRowIndex==null)this.selectedRowIndex=0;\r\n \r\n if($event.code===\"ArrowDown\")\r\n { \r\n this.datatable.nativeElement.scrollTop=this.datatable.nativeElement.scrollTop+8;\r\n this.selectedRowIndex=this.selectedRowIndex+1;\r\n if(this.selectedRowIndex>(this.BList.length-1))this.selectedRowIndex=this.BList.length-1;\r\n }\r\n else if($event.code===\"ArrowUp\")\r\n {\r\n if(this.datatable.nativeElement.scrollTop>0){\r\n this.datatable.nativeElement.scrollTop=this.datatable.nativeElement.scrollTop-5;\r\n }\r\n this.selectedRowIndex=this.selectedRowIndex-1;\r\n if(this.selectedRowIndex<0)this.selectedRowIndex=0;\r\n }\r\n if($event.code===\"Enter\" || $event.code===\"NumpadEnter\")\r\n {\r\n if(this.selectedRowIndex!=null)\r\n {\r\n if(this.BList[this.selectedRowIndex]!=null){\r\n this.dblClickBatchObj(this.BList[this.selectedRowIndex]);\r\n }\r\n }\r\n }\r\n\r\n \r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/PopBatchList/PopBatch.component.ts","import { CookieService } from 'angular2-cookie/core';\r\nimport { Injectable } from '@angular/core';\r\nimport { AuthService } from \"./permission/index\";\r\nimport { MasterRepo } from '../repositories';\r\n@Injectable()\r\nexport class AppSettings {\r\n //not in main api, need to add\r\n enableACCodeFocus = false;\r\n enableACNameFocus = true\r\n enableDateChange = true;\r\n public appType;\r\n //\r\n public get UserwiseDivision(){\r\n return this.getSettingFromCache('UserwiseDivision',1);\r\n }\r\n public get DivisionWiseWarehouse(){\r\n return this.getSettingFromCache('DivisionWiseWarehouse',1);\r\n }\r\n public get MembershipMode() {\r\n return this.getSettingFromCache('MembershipMode', 0)\r\n }\r\n public get CentralisedMembership() {\r\n return this.getSettingFromCache('CentralisedMembership', 0)\r\n }\r\n public get TERMINALWISESALESAC() {\r\n return this.getSettingFromCache('TERMINALWISESALESAC', 0)\r\n }\r\n public get TERMINALVCHR() {\r\n return this.getSettingFromCache('TERMINALVCHR', 0)\r\n }\r\n public get WeightedAverageCalc() {\r\n return this.getSettingFromCache('WeightedAverageCalc', 0)\r\n }\r\n public get SaveReceipeInProd() {\r\n return this.getSettingFromCache('SaveReceipeInProd', 0)\r\n }\r\n public get BarcodeInBilling() {\r\n return this.getSettingFromCache('BarcodeInBilling', 0)\r\n }\r\n public get ShowBSDate() {\r\n return this.getSettingFromCache('ShowBSDate', 0)\r\n } false\r\n public get IsTouchDisplay() {\r\n return this.getSettingFromCache('IsTouchDisplay', true)\r\n }\r\n public get RMode() {\r\n return this.getSettingFromCache('RMode', 1)\r\n }\r\n public get VATRate() {\r\n return this.getSettingFromCache('VATRate', 0.13)\r\n }\r\n public get ServiceTaxRate() {\r\n return this.getSettingFromCache('ServiceTaxRate', 0.1)\r\n }\r\n public get RoundOffPrecision() {\r\n return this.getSettingFromCache('RoundOffPrecision', 0)\r\n }\r\n public get TotPrintCharPerLine() {\r\n return this.getSettingFromCache('TotPrintCharPerLine', 48)\r\n }\r\n public get AbbInvoiceLimitAmount() {\r\n return this.getSettingFromCache('AbbInvoiceLimitAmount', 5000)\r\n }\r\n public get SalesAc() {\r\n return this.getSettingFromCache('SalesAc', 'DI01001')\r\n }\r\n public get PurchaseAc() {\r\n return this.getSettingFromCache('PurchaseAc', 'DE01002')\r\n }\r\n public get SalesReturnAc() {\r\n return this.getSettingFromCache('SalesReturnAc', 'DI01002')\r\n }\r\n public get PurchaseReturnAc() {\r\n return this.getSettingFromCache('PurchaseReturnAc', 'DE01003')\r\n }\r\n public get CashAc() {\r\n return this.getSettingFromCache('CashAc', 'AT01002')\r\n }\r\n public get VATAc() {\r\n return this.getSettingFromCache('VATAc', 'LB01003')\r\n }\r\n public get DiscountAc() {\r\n return this.getSettingFromCache('DiscountAc', 'IE01001')\r\n }\r\n public get RoundOffAc() {\r\n return this.getSettingFromCache('RoundOffAc', 'IE72697')\r\n }\r\n public get ServiceTaxAc() {\r\n return this.getSettingFromCache('ServiceTaxAc', 'LB77830V')\r\n }\r\n public get GblMemberShipMode() {\r\n return this.getSettingFromCache('GblMemberShipMode', 0)\r\n }\r\n public get GblCentralMembership() {\r\n return this.getSettingFromCache('GblCentralMembership', 0)\r\n }\r\n public get GblBarcodeWiseBilling() {\r\n return this.getSettingFromCache('GblBarcodeWiseBilling', true)\r\n }\r\n public get GblSaveReceipeInProd() {\r\n return this.getSettingFromCache('GblSaveReceipeInProd', 0)\r\n }\r\n public get EnableIndItemSalesManTag() {\r\n return this.getSettingFromCache('EnableIndItemSalesManTag', false)\r\n }\r\n public get GblShowBSDate() {\r\n return this.getSettingFromCache('GblShowBSDate', true)\r\n }\r\n public get GblTerminalWiseVoucher() {\r\n return this.getSettingFromCache('GblTerminalWiseVoucher', 0)\r\n }\r\n public get GblTerminalWiseSalesAc() {\r\n return this.getSettingFromCache('GblTerminalWiseSalesAc', 0)\r\n }\r\n public get Parent_Code_Of_RMD_ACLIST_For_SalesTerminal() {\r\n return this.getSettingFromCache('Parent_Code_Of_RMD_ACLIST_For_SalesTerminal', 'GOD')\r\n }\r\n public get GblProductWiseServiceCharge() {\r\n return this.getSettingFromCache('GblProductWiseServiceCharge', 0)\r\n }\r\n public get GblReplaceIndividualWithFlat() {\r\n return this.getSettingFromCache('GblReplaceIndividualWithFlat', 0)\r\n }\r\n public get GblSaveSeperateDiscountAccountInPurchase() {\r\n return this.getSettingFromCache('GblSaveSeperateDiscountAccountInPurchase', 0)\r\n }\r\n public get GblWeightedAverageCalc() {\r\n return this.getSettingFromCache('GblWeightedAverageCalc', 0)\r\n }\r\n public get GblShowSubledger() {\r\n\r\n return this.getSettingFromCache('GblShowSubledger', 1)\r\n }\r\n public get enableSubLedger() {\r\n return this.getSettingFromCache('enableSubLedger', false)\r\n }\r\n public get MultiWarehousePerTransaction() {\r\n return this.getSettingFromCache('MultiWarehousePerTransaction', 0)\r\n }\r\n public get AccountForBalancingOpeningBalance() {\r\n return this.getSettingFromCache('AccountForBalancingOpeningBalance', 'AT01002')\r\n }\r\n public get MultiplePurchaseAccount() {\r\n return this.getSettingFromCache('MultiplePurchaseAccount', 0)\r\n }\r\n public get GblShowPurchaseTypeAccount() {\r\n return this.getSettingFromCache('GblShowPurchaseTypeAccount', 0)\r\n }\r\n\r\n public get ShowBarcodeField() {\r\n return this.getSettingFromCache('ShowBarcodeField', 1)\r\n }\r\n public get GblEnableMCat1() {\r\n return this.getSettingFromCache('GblEnableMCat1', 0)\r\n }\r\n public get GblEnableMaxSQty() {\r\n return this.getSettingFromCache('GblEnableMaxSQty', 0)\r\n }\r\n public get GblItemWiseWarehouse() {\r\n return this.getSettingFromCache('GblItemWiseWarehouse', 0)\r\n }\r\n public get GblManualCode() {\r\n return this.getSettingFromCache('GblManualCode', 0)\r\n }\r\n public get GblDuplicateItem() {\r\n return this.getSettingFromCache('GblDuplicateItem', 0)\r\n }\r\n public get GblDuplicateGroup() {\r\n return this.getSettingFromCache('GblDuplicateGroup', 0)\r\n }\r\n public get GblEnableRateDiscount() {\r\n return this.getSettingFromCache('GblEnableRateDiscount', 1)\r\n }\r\n public get GblMultiBrandModel() {\r\n return this.getSettingFromCache('GblMultiBrandModel', 0)\r\n }\r\n public get GblEnableBarcodeDetails() {\r\n return this.getSettingFromCache('GblEnableBarcodeDetails', 0)\r\n }\r\n public get GblDivisionWiseBarcodeListing() {\r\n return this.getSettingFromCache('GblDivisionWiseBarcodeListing', 0)\r\n }\r\n public get GblAUTOBARCODEFROMPURCHASE() {\r\n return this.getSettingFromCache('GblAUTOBARCODEFROMPURCHASE', 0)\r\n }\r\n public get enableCostCenter() {\r\n return this.getSettingFromCache('enableCostCenter', true)\r\n }\r\n public get enableChequeInEntry() {\r\n return this.getSettingFromCache('enableChequeInEntry', false)\r\n }\r\n\r\n public get enableBranch() {\r\n return this.getSettingFromCache('enableBranch', true)\r\n }\r\n public get ENABLEMULTICURRENCY() {\r\n return this.getSettingFromCache('ENABLEMULTICURRENCY', 0)\r\n }\r\n public get DefaultDivision() {\r\n if(this.UserwiseDivision==1){\r\n return this.getUserSettingFromCache(\"userDivision\",'');\r\n }\r\n let Cookie = this.authservice.getCookie();\r\n let div\r\n if(Cookie!=null){\r\n let div= Cookie.Division\r\n } \r\n if(div){\r\n return div;\r\n }\r\n return this.getSettingFromCache('DefaultDivision','MMX');\r\n }\r\n public get DefaultWarehouse() {\r\n \r\n if(this.DivisionWiseWarehouse==1){\r\n return this.getUserSettingFromCache('userWarehouse','');\r\n }\r\n\r\n let Cookie = this.authservice.getCookie();\r\n let war;\r\n if(Cookie!=null){war= Cookie.Warehouse}\r\n if(war) {\r\n return war\r\n }\r\n return this.getSettingFromCache('DefaultWarehouse', 'Main Warehouse')\r\n }\r\n public get userDivisionList(){\r\n var defDiv= this.DefaultDivision;\r\n return this.getUserSettingFromCache(\"divisions\",[defDiv]);\r\n }\r\n public get userWarehouseList(){\r\n var defware = this.DefaultWarehouse;\r\n return this.getUserSettingFromCache('warehouses',[defware]);\r\n }\r\n public get AppSalesBillType() {\r\n return this.getSettingFromCache('AppSalesBillType', 0)\r\n }\r\n public get AppWithServiceTax() {\r\n return this.getSettingFromCache('AppWithServiceTax', 0)\r\n }\r\n public get AppServiceTaxType() {\r\n return this.getSettingFromCache('AppServiceTaxType', 1)\r\n }\r\n public get DivisionWiseSalesBillNo() {\r\n return this.getSettingFromCache('DivisionWiseSalesBillNo', false)\r\n }\r\n public get CouterWiseSalesBillNo() {\r\n return this.getSettingFromCache('CouterWiseSalesBillNo', false)\r\n }\r\n public get GblDisplayServiceTax() {\r\n return this.getSettingFromCache('GblDisplayServiceTax', 0)\r\n }\r\n public get GblDisplayVAT() {\r\n return this.getSettingFromCache('GblDisplayVAT', false)\r\n }\r\n public get GblVatName() {\r\n return this.getSettingFromCache('GblVatName', 'GST')\r\n }\r\n public get GblRateMode() {\r\n return this.getSettingFromCache('GblRateMode', 0)\r\n }\r\n public get EnableVoucherSeries() {\r\n return this.getSettingFromCache('EnableVoucherSeries', 0)\r\n }\r\n public get EnableMultiFiscalYear() {\r\n return this.getSettingFromCache('EnableMultiFiscalYear', false)\r\n }\r\n public get GblEnableServiceCharge() {\r\n return this.getSettingFromCache('GblEnableServiceCharge', 0)\r\n }\r\n public get EnableRepeatedProduct() {\r\n return this.getSettingFromCache('EnableRepeatedProduct', 0)\r\n }\r\n public get EnableZeroRate() {\r\n return this.getSettingFromCache('EnableZeroRate', 0)\r\n }\r\n public get EnableCompulsoryBarcode() {\r\n return this.getSettingFromCache('EnableCompulsoryBarcode', 0)\r\n }\r\n public get EnablePurchaseBillCorrection() {\r\n return this.getSettingFromCache('EnablePurchaseBillCorrection', 0)\r\n }\r\n public get EnableCompulsoryPartyInTransaction() {\r\n return this.getSettingFromCache('EnableCompulsoryPartyInTransaction', 1)\r\n }\r\n public get EnableProductCondition() {\r\n return this.getSettingFromCache('EnableProductCondition', 0)\r\n }\r\n public get EnableCostCenter() {\r\n return this.getSettingFromCache('EnableCostCenter', 0)\r\n }\r\n public get GblShowItemButtons() {\r\n return this.getSettingFromCache('GblShowItemButtons', false)\r\n }\r\n public get HasExpiryDateInItem() {\r\n return this.getSettingFromCache('HasExpiryDateInItem', 0)\r\n }\r\n\r\n public get HasItemTypeInItem() {\r\n return this.getSettingFromCache('HasItemTypeInItem', 0)\r\n }\r\n public get ConsumptionAccount() {\r\n return this.getSettingFromCache('ConsumptionAccount', 'DE15507V')\r\n } \r\n public get SALESTYPE() {\r\n return this.getSettingFromCache('SALESTYPE', 'counter')\r\n } \r\n public get directCashCounterSales() {\r\n return this.getSettingFromCache('directCashCounterSales', 0)\r\n } \r\n \r\n public get APPTYPE() {\r\n return this.getSettingFromCache('APPTYPE', 0)\r\n } \r\n constructor(private authservice: AuthService) { \r\n\r\n\r\n }\r\n\r\n // public get DefaultWarehouse(){\r\n // return this.Request.CookieService\r\n // }\r\n // if (Request.Cookies[\"UserSettings\"] != null)\r\n // {\r\n // string userSettings;\r\n // if (Request.Cookies[\"UserSettings\"][\"Font\"] != null)\r\n // { userSettings = Request.Cookies[\"UserSettings\"][\"Font\"]; }\r\n // }\r\n setSetting(settings) {\r\n for (var property in this) {\r\n if (this.hasOwnProperty(property)) {\r\n this[property] = settings[property];\r\n }\r\n }\r\n }\r\n\r\n getSettingFromCache(prop: string, defaultvalue: any) {\r\n let setting = this.authservice.getSetting();\r\n if (setting) {\r\n var ret = setting[prop];\r\n return ret;\r\n }\r\n return defaultvalue;\r\n\r\n }\r\n\r\n getUserSettingFromCache(prop:string,defaultvalue:any){\r\n let userProfile =this.authservice.getUserProfile();\r\n if(userProfile){\r\n var ret =userProfile[prop];\r\n return ret;\r\n }\r\n return defaultvalue;\r\n }\r\n getSettingFromCookie(prop:string,defaultvalue:any){\r\n\r\n let Cookie = this.authservice.getCookie();\r\n if(Cookie){\r\n var ret = Cookie.prop[prop];\r\n return ret;\r\n }\r\n return defaultvalue;\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/AppSettings.ts","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { NgaModule } from '../../theme/nga.module';\r\n\r\nimport { LoginCopy } from './login.componentcopy';\r\nimport {Login} from './login.component'\r\nimport { routing } from './login.routing';\r\nimport { ModalModule } from 'ng2-bootstrap';\r\nimport {SearchUserComponent} from './searchUser.component';\r\nimport {SendEmailComponent} from './sendEmail.component';\r\nimport {enterSecurityComp} from './enterSecurityCode.component';\r\nimport {NewPasswordComp} from './newPassword.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormsModule,\r\n NgaModule,\r\n routing,\r\n ModalModule.forRoot()\r\n ],\r\n declarations: [Login,LoginCopy,SearchUserComponent,SendEmailComponent,enterSecurityComp,NewPasswordComp \r\n ],\r\n exports:[Login,LoginCopy,SendEmailComponent]\r\n})\r\nexport class LoginModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/login/login.module.ts","import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, HostListener } from '@angular/core';\r\nimport { MasterRepo } from '../../repositories';\r\nimport { TransactionService } from '../../Transaction Components/transaction.service';\r\nimport { BatchStock } from '../../interfaces';\r\nimport { resolve } from 'dns';\r\n\r\n@Component(\r\n {\r\n selector: 'PItemList',\r\n template: require('./PopItems.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')],\r\n\r\n }\r\n)\r\nexport class PoplistComponent {\r\n selectedRowIndex:number=0;\r\n summary:string;\r\n constructor(private masterService: MasterRepo,public _trnMainService: TransactionService) {\r\n \r\n \r\n }\r\n ngAfterViewInit(){\r\n // this.setFocus();\r\n }\r\n ngOnInit() {\r\n // this.renderer.invokeElementMethod(this.hostElement.nativeElement, 'focus');\r\n }\r\n hide()\r\n {\r\n this.masterService.PlistTitle=\"\";\r\n }\r\n doubleClick(item)\r\n {\r\n \r\n this.masterService\r\n .masterPostmethod(\"/getbatchWithAlternateUnitList\", item)\r\n .subscribe(\r\n res => {\r\n if (res.status == \"ok\") {\r\n \r\n \r\n let item=JSON.parse(res.result); \r\n let index=this._trnMainService.TrnMainObj.ProdList.findIndex(x=>x.MCODE==item.MCODE);\r\n \r\n if(index<0)\r\n {\r\n this._trnMainService.addRow();\r\n this._trnMainService.assignValueToProdFromBarcode(item,this._trnMainService.TrnMainObj.ProdList.findIndex(x=>x.MCODE==null));\r\n }\r\n else\r\n {\r\n let alreadyExistingitem= this._trnMainService.TrnMainObj.ProdList[index];\r\n this._trnMainService.TrnMainObj.ProdList[index].Quantity+=1;\r\n this._trnMainService.RealQuantitySet(index, alreadyExistingitem.CONFACTOR);\r\n // this._trnMainService.CalculateNormalNew(index);\r\n this._trnMainService.ReCalculateBillWithNormal();\r\n }\r\n this._trnMainService.BarcodeFromScan=\"\";\r\n this.masterService.PlistTitle=\"\";\r\n document.getElementById(\"itembarcode\").focus();\r\n }\r\n \r\n \r\n else {\r\n alert(res.result);\r\n }\r\n },\r\n error => {\r\n }\r\n );\r\n }\r\n singleClick(index)\r\n {\r\n this.selectedRowIndex = index;\r\n this.summary=this._trnMainService.ItemsListForMultiItemBarcode[index].itemSummary;\r\n }\r\n\r\n \r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n updown($event: KeyboardEvent) { \r\n if (\r\n $event.code == \"ArrowDown\" &&\r\n this.selectedRowIndex < this._trnMainService.ItemsListForMultiItemBarcode.length -1\r\n ) {\r\n $event.preventDefault();\r\n this.selectedRowIndex++;\r\n if(this._trnMainService.ItemsListForMultiItemBarcode[this.selectedRowIndex]!=null){\r\n this.summary=this._trnMainService.ItemsListForMultiItemBarcode[this.selectedRowIndex].itemSummary;\r\n }\r\n } else if ($event.code == \"ArrowUp\" && this.selectedRowIndex-1 > -1) {\r\n $event.preventDefault();\r\n this.selectedRowIndex--; \r\n if(this._trnMainService.ItemsListForMultiItemBarcode[this.selectedRowIndex]!=null){\r\n this.summary=this._trnMainService.ItemsListForMultiItemBarcode[this.selectedRowIndex].itemSummary;\r\n }\r\n } else if ( \r\n $event.code == \"Enter\" &&\r\n this.selectedRowIndex >= 0 &&\r\n this.selectedRowIndex < this._trnMainService.ItemsListForMultiItemBarcode.length \r\n ) { \r\n $event.preventDefault();\r\n this.doubleClick(this._trnMainService.ItemsListForMultiItemBarcode[this.selectedRowIndex]);\r\n this.hide();\r\n \r\n }\r\n else if ($event.code == \"Escape\") { \r\n $event.preventDefault(); \r\n this.hide();\r\n \r\n }\r\n\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/PopItemList/PopItems.component.ts","import { AbstractControl, ValidationErrors } from \"@angular/forms\"\r\n\r\nexport const PasswordStrengthValidator = function (control: AbstractControl): ValidationErrors | null {\r\n\r\n let value: string = control.value || '';\r\n let msg = \"\";\r\n if (!value) {\r\n return null\r\n }\r\n\r\n let upperCaseCharacters = /[A-Z]+/g;\r\n let lowerCaseCharacters = /[a-z]+/g;\r\n let numberCharacters = /[0-9]+/g;\r\n let specialCharacters = /[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+/;\r\n if (upperCaseCharacters.test(value) === false || lowerCaseCharacters.test(value) === false || numberCharacters.test(value) === false || specialCharacters.test(value) === false) {\r\n return {\r\n passwordStrength: 'Password must contain at least one uppercase letter, one lowercase letter, one number, one special characters.'\r\n }\r\n\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/userManager/components/userManger/password-strength-validators.component.ts","import {AuthService} from '../../../common/services/permission/authService.service';\r\nimport {Injectable} from '@angular/core';\r\nimport {Router, Routes} from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { BehaviorSubject } from 'rxjs/BehaviorSubject';\r\nimport { Subject } from 'rxjs';\r\nimport { Headers, Http, Response, RequestOptions } from '@angular/http';\r\nimport { GlobalState } from '../../../global.state';\r\n\r\n\r\n@Injectable()\r\nexport class BaMenuService {\r\n menuItems = new BehaviorSubject([]);\r\n\r\n protected _currentMenuItem = {};\r\n showchangePasswordPopUp:boolean;\r\n public userProfile;\r\n\r\n\r\n\r\n constructor(\r\n private _router:Router,\r\n private _authService:AuthService,\r\n private http: Http,\r\n private state: GlobalState\r\n ) {\r\n this.userProfile = this._authService.getUserProfile();\r\n }\r\n\r\n /**\r\n * Updates the routes in the menu\r\n *\r\n * @param {Routes} routes Type compatible with app.menu.ts\r\n */\r\n public updateMenuByRoutes(routes: Routes) {\r\n let convertedRoutes = this.convertRoutesToMenus(_.cloneDeep(routes));\r\n this.menuItems.next(convertedRoutes);\r\n\r\n }\r\n\r\n public convertRoutesToMenus(routes:Routes):any[] {\r\n let items = this._convertArrayToItems(routes);\r\n return this._skipEmpty(items);\r\n }\r\n\r\n public getCurrentItem():any {\r\n return this._currentMenuItem;\r\n }\r\n\r\n public selectMenuItem(menuItems:any[]):any[] {\r\n let items = [];\r\n \r\n menuItems.forEach((item) => {\r\n this._selectItem(item);\r\n\r\n if (item.selected) {\r\n this._currentMenuItem = item;\r\n }\r\n\r\n if (item.children && item.children.length > 0) {\r\n item.children = this.selectMenuItem(item.children);\r\n }\r\n // let user_profile = this._authService.getUserProfile();\r\n // if (user_profile.menuRights.filter(res => res.menu == item.route.path).length != 0) {\r\n // items.push(item);\r\n // }\r\n items.push(item);\r\n });\r\n // console.log(\"finalitems\",items)\r\n return items;\r\n \r\n }\r\n\r\n protected _skipEmpty(items:any[]):any[] {\r\n let menu = [];\r\n items.forEach((item) => {\r\n let menuItem;\r\n if (item.skip) {\r\n if (item.children && item.children.length > 0) {\r\n menuItem = item.children;\r\n }\r\n } else {\r\n menuItem = item;\r\n }\r\n\r\n if (menuItem) {\r\n menu.push(menuItem);\r\n }\r\n });\r\n\r\n return [].concat.apply([], menu);\r\n }\r\n\r\n protected _convertArrayToItems(routes:any[], parent?:any):any[] {\r\n let items = [];\r\n routes.forEach((route) => {\r\n items.push(this._convertObjectToItem(route, parent));\r\n });\r\n return items;\r\n }\r\n\r\n protected _convertObjectToItem(object, parent?:any):any {\r\n let item:any = {};\r\n if (object.data && object.data.menu) {\r\n // this is a menu object\r\n item = object.data.menu;\r\n item.route = object;\r\n delete item.route.data.menu;\r\n } else {\r\n item.route = object;\r\n item.skip = true;\r\n }\r\n\r\n // we have to collect all paths to correctly build the url then\r\n if (Array.isArray(item.route.path)) {\r\n item.route.paths = item.route.path;\r\n } else {\r\n item.route.paths = parent && parent.route && parent.route.paths ? parent.route.paths.slice(0) : ['/'];\r\n if (!!item.route.path) item.route.paths.push(item.route.path);\r\n }\r\n\r\n if (object.children && object.children.length > 0) {\r\n item.children = this._convertArrayToItems(object.children, item);\r\n }\r\n\r\n let prepared = this._prepareItem(item);\r\n\r\n // if current item is selected or expanded - then parent is expanded too\r\n if ((prepared.selected || prepared.expanded) && parent) {\r\n parent.expanded = true;\r\n }\r\n\r\n return prepared;\r\n }\r\n\r\n protected _prepareItem(object:any):any {\r\n if (!object.skip) {\r\n object.target = object.target || '';\r\n object.pathMatch = object.pathMatch || 'full';\r\n return this._selectItem(object);\r\n }\r\n\r\n return object;\r\n }\r\n\r\n protected _selectItem(object:any):any {\r\n object.selected = this._router.isActive(this._router.createUrlTree(object.route.paths), object.pathMatch === 'full');\r\n return object;\r\n }\r\n\r\n changePassword(paswordResetObj:any){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.post(this.apiUrl + '/changePassword',paswordResetObj, this._authService.getRequestOption())\r\n .map(res=> res.json())\r\n .subscribe(data => {\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\nMaunalSync(){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/SyncService`, this._authService.getRequestOption())\r\n .subscribe(response => {\r\n // console.log(\"CheckDATA\",response)\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\nAutoSync(){\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n this.http.get(`${this.apiUrl}/AutoSyncService`, this.getRequestOption())\r\n .subscribe(response => {\r\n // console.log(\"CheckDATA\",response)\r\n let data = response.json();\r\n if (data.status == 'ok') {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n else {\r\n returnSubject.next(data)\r\n returnSubject.unsubscribe();\r\n }\r\n }, error => {\r\n res.status = 'error'; res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\npublic saveBackupHistory(status:any,remarks:any) {\r\n let res = { status: \"error\", result: \"\" };\r\n let returnSubject: Subject = new Subject();\r\n let opt = this.getRequestOption();\r\n let hd: Headers = new Headers({ \"Content-Type\": \"application/json\" });\r\n let op: RequestOptions = new RequestOptions();\r\n let bodyData = {status:status,remarks:remarks};\r\n // console.log(\"Sales man \" + bodyData);\r\n this.http\r\n .post(this.apiUrl + \"/saveBackupHistory\", bodyData, this.getRequestOption())\r\n .subscribe(\r\n data => {\r\n let retData = data.json();\r\n if (retData.status == \"ok\") {\r\n res.status = \"ok\";\r\n res.result = retData.result;\r\n // console.log(res);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n } else {\r\n res.status = \"error1\";\r\n res.result = retData.result;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n (res.status = \"error2\"), (res.result = error);\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n}\r\n\r\npublic getRequestOption() {\r\n let headers: Headers = new Headers({\r\n \"Content-type\": \"application/json\",\r\n Authorization: this._authService.getAuth().token\r\n });\r\n // console.log({ headers: headers });\r\n return new RequestOptions({ headers: headers });\r\n}\r\n\r\npublic getList(data, url) {\r\n // console.log({ getlist: data });\r\n return this.http\r\n .post(this.apiUrl + url, data, this.getRequestOption())\r\n .map(data => data.json())\r\n .share();\r\n}\r\n\r\npublic get apiUrl(): string {\r\n let url = this.state.getGlobalSetting(\"apiUrl\");\r\n let apiUrl = \"\";\r\n if (!!url && url.length > 0) {\r\n apiUrl = url[0];\r\n }\r\n return apiUrl;\r\n}\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/theme/services/baMenu/baMenu.service.ts","import { Component, OnInit } from \"@angular/core\";\r\nimport { ImporterPriceCalc } from \"../../interfaces/Account.interface\";\r\nimport { MasterRepo } from \"../../repositories\";\r\nimport { TransactionService } from \"../transaction.service\";\r\n\r\n@Component({\r\n selector: \"pricecalc-selector\",\r\n styles: [require('./price-calculatorpopup.component.css')],\r\n template: require('./price-calculatorpopup.component.html')\r\n})\r\n\r\nexport class PriceCalculatorPopupComponent implements OnInit {\r\n isActive: boolean = false;\r\n currentIndex: number = 0;\r\n public priceFormula: any;\r\n\r\n constructor(public masterService: MasterRepo, private _trnMainService: TransactionService) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n show(index) {\r\n this.currentIndex = index;\r\n if (!this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ImporterPriceCalcList) {\r\n // this.masterService.getpriceformula(this._trnMainService.TrnMainObj.ProdList[this.currentIndex].MCODE, 'A').subscribe((res) => {\r\n // this.priceFormula = JSON.parse(res.result)\r\n // var newPriceCalc = {};\r\n // this.priceFormula.PriceDetail.forEach(x => {\r\n // if (x.DESCRIPTION == 'UPCMR') {\r\n // newPriceCalc.UPCMR_Rate = x.RATE;\r\n // newPriceCalc.UPCMR_Amount = x.AMOUNT;\r\n // }\r\n // if (x.DESCRIPTION == 'Excise Duty(ED) on transaction value') {\r\n // newPriceCalc.ExciseDuty_Rate = x.RATE.replace(\"%\",\"\");\r\n // newPriceCalc.ExciseDuty_Amount = x.AMOUNT;\r\n // } if (x.DESCRIPTION == 'Insurance') {\r\n // newPriceCalc.Insurance_Rate = x.RATE.replace(\"%\",\"\");;\r\n // newPriceCalc.Insurance_Amount = x.AMOUNT;\r\n // }\r\n // if (x.DESCRIPTION == 'Assessable value for Custom duty(CD)') {\r\n // newPriceCalc.AssesableCustomDuty_Rate = x.RATE;\r\n // newPriceCalc.AssesableCustomDuty_Amount = x.AMOUNT;\r\n // } if (x.DESCRIPTION == 'Custom Duty') {\r\n // newPriceCalc.CustomDuty_Rate = x.RATE.replace(\"%\",\"\");;\r\n // newPriceCalc.CustomDuty_Amount = x.AMOUNT;\r\n // } if (x.DESCRIPTION == 'Assessable value for Anta Shulka(KG)') {\r\n // newPriceCalc.AssesableAntaShulka_Rate = x.RATE;\r\n // newPriceCalc.AssesableAntaShulka_Amount = x.AMOUNT;\r\n // } if (x.DESCRIPTION == 'Anta Shulka(Per Kg)') {\r\n // newPriceCalc.AntaShulka_Rate = x.RATE.replace(\"%\",\"\");;\r\n // newPriceCalc.AntaShulka_Amount = x.AMOUNT;\r\n // } if (x.DESCRIPTION == 'Service Charge') {\r\n // newPriceCalc.ServiceCharge_Rate = x.RATE;\r\n // newPriceCalc.ServiceCharge_Amount = x.AMOUNT;\r\n // } if (x.DESCRIPTION == 'Cost before VAT') {\r\n // newPriceCalc.CostBeforeVAT_Rate = x.RATE;\r\n // newPriceCalc.CostBeforeVAT_Amount = x.AMOUNT;\r\n // }\r\n // if (x.DESCRIPTION == 'First Point VAT') {\r\n // newPriceCalc.FirstPointVAT_Rate = x.RATE.replace(\"%\",\"\");;\r\n // newPriceCalc.FirstPointVAT_Amount = x.AMOUNT;\r\n // }\r\n // if (x.DESCRIPTION == 'Landed Cost To Importer') {\r\n // newPriceCalc.LandedCostImporter_Rate = x.RATE;\r\n // newPriceCalc.LandedCostImporter_Amount = x.AMOUNT;\r\n // }\r\n // newPriceCalc.UPCMR_ImporterRate = 0;\r\n // newPriceCalc.CustomerServiceDuty_Amount = 0;\r\n // this.isActive = true;\r\n // });\r\n // this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ImporterPriceCalcList.push(newPriceCalc);\r\n // }, error => {\r\n // })\r\n // console.log(\"@@YET\",index)\r\n this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ImporterPriceCalcList = {};\r\n // var newPriceCalc = {};\r\n // this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ImporterPriceCalcList.TotalInvoiceData_ImporterRate=0;\r\n // this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ImporterPriceCalcList.TotalInvoiceData_ImporterRate=this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ALTRATE * this._trnMainService.TrnMainObj.ProdList[this.currentIndex].Quantity;\r\n // // newPriceCalc.CustomDuty_Amount=0;\r\n // // newPriceCalc.ExciseDuty_Amount=0;\r\n // // newPriceCalc.CustomerServiceDuty_Amount=0;\r\n // // this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ImporterPriceCalcList.push(newPriceCalc);\r\n // this.isActive = true;\r\n }\r\n this.isActive = true;\r\n }\r\n\r\n close() {\r\n this.isActive = false;\r\n }\r\n\r\n calculateCostings(currentIndex) {\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.AssesableCustomDuty_ImporterRate =\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.TotalInvoiceData_ImporterRate) +\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.ExciseDuty_ImporterRate) +\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.Insurance_ImporterRate);\r\n\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.AssesableAntaShulka_ImporterRate =\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.CustomDuty_ImporterRate) +\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.AssesableCustomDuty_ImporterRate);\r\n\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.CostBeforeVAT_ImporterRate =\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.AssesableAntaShulka_ImporterRate) +\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.ServiceCharge_ImporterRate) +\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.Others_ImporterRate) +\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.AntaShulka_ImporterRate);\r\n\r\n if (this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.InvoiceQty_ImporterRate > 0) {\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.LandedCostPerRate_ImporterRate =\r\n this._trnMainService.nullToReturnZero(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.CostBeforeVAT_ImporterRate) /\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.InvoiceQty_ImporterRate;\r\n } else {\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.LandedCostPerRate_ImporterRate = 0;\r\n }\r\n }\r\n\r\n saveCosting(currentIndex) {\r\n this.calculateCostings(currentIndex);\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.MCODE = this._trnMainService.TrnMainObj.ProdList[currentIndex].MCODE;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.ITEMDESC = this._trnMainService.TrnMainObj.ProdList[currentIndex].ITEMDESC;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.BATCH = this._trnMainService.TrnMainObj.ProdList[currentIndex].BATCH;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.BATCHID = this._trnMainService.TrnMainObj.ProdList[currentIndex].BATCHID;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.VCHRNO = this._trnMainService.TrnMainObj.ProdList[currentIndex].VCHRNO;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.MODE = \"ADD\";\r\n if (this._trnMainService.TrnMainObj.ProdList[currentIndex].IsCostingSaved == true) {\r\n if (confirm(\"Costing is already done for this item. Do you want to continue?\")) {\r\n this.saveImporterPurchaseCosting(currentIndex);\r\n }\r\n } else {\r\n this.saveImporterPurchaseCosting(currentIndex);\r\n }\r\n }\r\n\r\n saveImporterPurchaseCosting(currentIndex) {\r\n this.masterService.saveImporterPurchaseCosting(this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList)\r\n .subscribe(data => {\r\n if (data.status == 'ok') {\r\n this.isActive = false;\r\n if (this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.MODE == \"ADD\") {\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].IsCostingSaved = true;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].backgroundcolor = \"lightgreen\";\r\n } else {\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].IsCostingSaved = false;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].backgroundcolor = \"white\";\r\n this._trnMainService.TrnMainObj.ProdList[this.currentIndex].ImporterPriceCalcList = null;\r\n }\r\n }\r\n error => {\r\n alert(error);\r\n }\r\n });\r\n }\r\n\r\n deleteCosting(currentIndex) {\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.MCODE = this._trnMainService.TrnMainObj.ProdList[currentIndex].MCODE;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.ITEMDESC = this._trnMainService.TrnMainObj.ProdList[currentIndex].ITEMDESC;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.BATCH = this._trnMainService.TrnMainObj.ProdList[currentIndex].BATCH;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.BATCHID = this._trnMainService.TrnMainObj.ProdList[currentIndex].BATCHID;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.VCHRNO = this._trnMainService.TrnMainObj.ProdList[currentIndex].VCHRNO;\r\n this._trnMainService.TrnMainObj.ProdList[currentIndex].ImporterPriceCalcList.MODE = \"DELETE\";\r\n\r\n if (this._trnMainService.TrnMainObj.ProdList[currentIndex].IsCostingSaved == true) {\r\n if (confirm(\"Do you want to remove the data?\")) {\r\n this.saveImporterPurchaseCosting(currentIndex);\r\n }\r\n }\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/Transaction Components/pricecalculator/price-calculatorpopup.component.ts","import { Http, Response, RequestOptions, Headers } from \"@angular/http\";\r\nimport { Injectable } from \"@angular/core\";\r\nimport { Subject } from \"rxjs/subject\";\r\nimport \"rxjs/Rx\";\r\nimport { AuthService } from \"../../services/permission\";\r\nimport { ActivatedRoute } from \"@angular/router\";\r\nimport { GlobalState } from \"../../../global.state\";\r\n\r\n@Injectable()\r\nexport class FileUploaderService {\r\n constructor(\r\n private http: Http,\r\n private activatedRoute: ActivatedRoute,\r\n private authService: AuthService,\r\n private state: GlobalState\r\n ) {}\r\n private get apiUrl(): string {\r\n let url = this.state.getGlobalSetting(\"apiUrl\");\r\n let apiUrl = \"\";\r\n\r\n if (!!url && url.length > 0) {\r\n apiUrl = url[0];\r\n }\r\n return apiUrl;\r\n }\r\n\r\n public downloadSampleFile(downloadUrl: string, filename: string = \"download\") {\r\n return this.http\r\n .get(this.apiUrl + `${downloadUrl}`, this.getRequestOption())\r\n .map((response: Response) => {\r\n let data = {\r\n content: new Blob([(response)._body], {\r\n type: response.headers.get(\"Content-Type\")\r\n }),\r\n filename: `${filename}.csv`\r\n };\r\n return data;\r\n });\r\n }\r\n\r\n importSelectedFiles(importUrl: string, model: any) {\r\n let res = { status: \"error\", result: \"error\" };\r\n let returnSubject: Subject = new Subject();\r\n\r\n this.http\r\n .post(this.apiUrl + `${importUrl}`, model, this.getRequestOption())\r\n .subscribe(\r\n response => {\r\n let data = response.json();\r\n if (data.status == \"ok\") {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n } else {\r\n returnSubject.next(data);\r\n returnSubject.unsubscribe();\r\n }\r\n },\r\n error => {\r\n res.status = \"error\";\r\n res.result = error;\r\n returnSubject.next(res);\r\n returnSubject.unsubscribe();\r\n }\r\n );\r\n return returnSubject;\r\n }\r\n \r\n private getRequestOption() {\r\n let headers: Headers = new Headers({ \r\n Authorization: this.authService.getAuth().token\r\n });\r\n return new RequestOptions({ headers: headers });\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/file-uploader/file-uploader-popup.service.ts","import { Component, OnInit, HostListener, ElementRef, ViewChild, Input} from '@angular/core';\r\nimport { IMPORT_DETAILS_PROD } from '../../interfaces/TrnMain';\r\nimport { MasterRepo } from '../../repositories/masterRepo.service';\r\nimport { AlertService } from '../../services/alert/alert.service';\r\nimport { SpinnerService } from '../../services/spinner/spinner.service';\r\nimport { TransactionService } from '../../Transaction Components/transaction.service';\r\n\r\n\r\n@Component({\r\n selector: 'import-purchase-details',\r\n template: require('./import-purchase-details.component.html'),\r\n styles: [require('./import-purchase-details.component.css')],\r\n})\r\nexport class ImportPurchaseDetails implements OnInit {\r\n isActive:boolean;\r\n // @ViewChild ('DocumentNo') DocumentNo:ElementRef;\r\n @Input() tranMode: string;\r\n productList: any = [];\r\n importrowindex: number = 0;\r\n \r\n constructor(\r\n public masterservice: MasterRepo,\r\n public _trnMainService: TransactionService, \r\n public spinnerService:SpinnerService,\r\n public alertservice: AlertService\r\n ) {\r\n if (_trnMainService.TrnMainObj.IMPORTDETAILS == null) {\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS = {};\r\n }\r\n }\r\n\r\n ngOnInit() {\r\n // console.log(\"MODE IMPOR DETAILS\",this.tranMode);\r\n }\r\n\r\n onclear() {\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS = {};\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList = [];\r\n\r\n this.addRow();\r\n}\r\n\r\n closeDialog() {\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS = {};\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList = [];\r\n this.isActive=false;\r\n // this.importDetailsArray = [];\r\n }\r\n\r\n show() {\r\n this.isActive = true;\r\n // setTimeout(() => {\r\n // this.DocumentNo.nativeElement.focus();\r\n // }, 10);\r\n setTimeout(()=>{\r\n document.getElementById(\"documentno\").focus();\r\n },500);\r\n \r\n if((!this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList) || (!this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList.length) || (this._trnMainService.TrnMainObj.IMPORTDETAILS == null)){\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS = {};\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList = [];\r\n this.addRow();\r\n\r\n }\r\n\r\n this.productList = this._trnMainService.TrnMainObj.ProdList.filter(x=> x.MCODE != null && x.MENUCODE != null);\r\n console.log(\"product list\", this.productList);\r\n}\r\n\r\nhide() {\r\n this.isActive = false;\r\n}\r\n\r\nok(){\r\n \r\n this.isActive = false;\r\n}\r\n\r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n handleKeyDownboardEvent($event: KeyboardEvent) {\r\n if ($event.code == \"Escape\") {\r\n $event.preventDefault();\r\n this.closeDialog();\r\n } \r\n }\r\n\r\n addRow(){\r\n try{\r\n console.log(\"add row\");\r\n var newRow = {};\r\n // let item = this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList.filter( x=> x.ITEMNAME == \"\" || x.ITEMNAME == null || x.ITEMNAME == undefined)\r\n // if(item.length > 0) return;\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList.push(newRow);\r\n }catch(ex){\r\n console.log(ex);\r\n alert(ex);\r\n }\r\n }\r\n\r\n rowClick(index){\r\n this.importrowindex = index;\r\n }\r\n \r\n nextRow(index){\r\n if (this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].ITEMNAME == \"\" || this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].ITEMNAME == null || this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].ITEMNAME == undefined) {\r\n this.alertservice.error(\"Item Description is missing\");\r\n return;\r\n \r\n }\r\n if (this.masterservice.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].QUANTITY) == 0) {\r\n this.alertservice.error(\"Quantity is missing\");\r\n return;\r\n \r\n }\r\n if (this.masterservice.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].NONTAXABLE) == 0) {\r\n if (this.masterservice.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].TAXABLE) == 0) {\r\n this.alertservice.error(\"Taxable amount is missing\");\r\n return;\r\n \r\n }\r\n if (this.masterservice.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].VAT) == 0) {\r\n this.alertservice.error(\"Vat amount is missing\");\r\n return;\r\n \r\n }\r\n \r\n }\r\n if (this.masterservice.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList[index].NETAMOUNT) == 0) {\r\n this.alertservice.error(\"Net Amount is missing\");\r\n return;\r\n \r\n }\r\n\r\n this.RecalculateImportDetails();\r\n \r\n this.addRow();\r\n let nextindex = this.importrowindex+1;\r\n setTimeout(() => {\r\n document.getElementById('importItemname'+nextindex).focus();\r\n }, 200);\r\n }\r\n\r\n enterName(i){\r\n setTimeout(() => {\r\n document.getElementById(\"importQty\"+i).focus();\r\n }, 200);\r\n }\r\n\r\n\r\n RecalculateImportDetails(){\r\n try{\r\n if (this._trnMainService.TrnMainObj.IMPORTDETAILS && this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList.length) {\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALQTY = 0\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALTAXABLE = 0;\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALNONTAXABLE = 0\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALVAT = 0;\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.NETAMOUNT = 0;\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList.forEach(x => {\r\n x.NETAMOUNT = this._trnMainService.nullToZeroConverter(x.NONTAXABLE) + this._trnMainService.nullToZeroConverter(x.TAXABLE) + this._trnMainService.nullToZeroConverter(x.VAT);\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALQTY = this._trnMainService.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALQTY) + this._trnMainService.nullToZeroConverter(x.QUANTITY);\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALTAXABLE = this._trnMainService.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALTAXABLE) + this._trnMainService.nullToZeroConverter(x.TAXABLE);\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALNONTAXABLE = this._trnMainService.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALNONTAXABLE) + this._trnMainService.nullToZeroConverter(x.NONTAXABLE);\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALVAT = this._trnMainService.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.TOTALVAT) + this._trnMainService.nullToZeroConverter(x.VAT);\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.NETAMOUNT = this._trnMainService.nullToZeroConverter(this._trnMainService.TrnMainObj.IMPORTDETAILS.NETAMOUNT) + this._trnMainService.nullToZeroConverter(x.NETAMOUNT);\r\n })\r\n }\r\n\r\n } catch(error){\r\n this.alertservice.error('Error in import details calculation: '+ error);\r\n }\r\n\r\n }\r\n\r\n onNonTaxableChange() {\r\n this.RecalculateImportDetails();\r\n }\r\n onTaxableChange() {\r\n this.RecalculateImportDetails();\r\n }\r\n onVatChange() {\r\n this.RecalculateImportDetails();\r\n }\r\n onQuantityChange() {\r\n this.RecalculateImportDetails();\r\n }\r\n\r\n deleteRow(index){\r\n if(confirm(\"Are you sure you want to delete this row ?\")){\r\n this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList.splice(index,1);\r\n if(this._trnMainService.TrnMainObj.IMPORTDETAILS.prodList.length === 0){\r\n this.addRow();\r\n }\r\n }\r\n }\r\n\r\n saveImportDetails(){\r\n console.log(\"save clicked\", this._trnMainService.TrnMainObj.Mode);\r\n console.log(this._trnMainService.TrnMainObj.VCHRNO, this._trnMainService.TrnMainObj.PARAC);\r\n console.log(\"import details\", this._trnMainService.TrnMainObj.IMPORTDETAILS);\r\n // console.log(\"import details array list\", this.importDetailsArray);\r\n let bodyData = {\r\n VCHRNO: this._trnMainService.TrnMainObj.VCHRNO,\r\n SUPPLIER: this._trnMainService.TrnMainObj.PARAC,\r\n DOCUMENTNO: this._trnMainService.TrnMainObj.IMPORTDETAILS.DOCUMENTNO,\r\n LCNUM: this._trnMainService.TrnMainObj.IMPORTDETAILS.LCNUM,\r\n NETAMOUNT: this._trnMainService.TrnMainObj.IMPORTDETAILS.NETAMOUNT,\r\n // NONTAXABLE: this._trnMainService.TrnMainObj.IMPORTDETAILS.NONTAXABLE,\r\n // TAXABLE: this._trnMainService.TrnMainObj.IMPORTDETAILS.TAXABLE,\r\n // VAT: this._trnMainService.TrnMainObj.IMPORTDETAILS.VAT\r\n }\r\n // this.spinnerService.show(\"Saving import details.....\")\r\n // this.masterservice.saveImportDetail(bodyData).subscribe( res=>{\r\n // if(res.status == \"ok\"){\r\n // this.spinnerService.hide();\r\n // this.alertservice.success(\"Import details saved Successfully !\");\r\n // setTimeout(()=>{\r\n // this.hide();\r\n // },1200);\r\n // }else{\r\n // this.spinnerService.hide();\r\n\r\n // this.alertservice.error(res.result);\r\n // }\r\n \r\n // }, error=>{\r\n // this.spinnerService.hide();\r\n // this.alertservice.error(error);\r\n // });\r\n }\r\n }\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/import-purchase-details/import-purchase-details.component.ts","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n Injector,\r\n HostListener,\r\n OnChanges,\r\n ElementRef,\r\n ViewChild\r\n } from \"@angular/core\";\r\n import { PagedListingComponentBase } from \"../../../paged-list-component-base\";\r\n import { MasterRepo } from \"../../repositories\";\r\n import { TransactionService } from \"../../Transaction Components/transaction.service\";\r\nimport { ActivatedRoute } from \"@angular/router\";\r\n \r\n @Component({\r\n selector: \"new-generic-popup-approved-grid\",\r\n template: require('./new-generic-popup-grid-approved.component.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')]\r\n })\r\n export class NewGenericPopUpApprovedComponent extends PagedListingComponentBase\r\n implements OnChanges {\r\n [x: string]: any;\r\n /** List Declaration */\r\n \r\n requestUrl: string = \"\";\r\n activeUrlPath:string = \"\"; \r\n isActive: boolean = false;\r\n itemList: any[] = [];\r\n selectedRowIndex: number = 0;\r\n tabindex: string = \"list\";\r\n \r\n //for transaction filter\r\n billTo: string = \"\";\r\n isForCancelOrder: boolean = false;\r\n \r\n /** Output */\r\n \r\n @Output() onPopUpClose = new EventEmitter();\r\n @Output() onItemDoubleClick = new EventEmitter();\r\n \r\n /** Input */\r\n \r\n @Input() popupsettings: NewGenericPopUpSettings;\r\n @Input() summary: string;\r\n @ViewChild('inputBox') inputBox:ElementRef\r\n @ViewChild('option') option:ElementRef\r\n \r\n constructor(public injector: Injector, private masterService: MasterRepo,\r\n public _trnMainService: TransactionService,\r\n private route: ActivatedRoute\r\n ) {\r\n super(injector);\r\n this.activeUrlPath = route.snapshot.url[0].path;\r\n }\r\n \r\n \r\n\r\n show(billTo: string = \"\", isForCancelOrder: boolean = false) { \r\n if(this._trnMainService.customerEvent==true){ \r\n setTimeout(() => {\r\n this.option.nativeElement.focus()\r\n }, 500); \r\n\r\n \r\n }\r\n \r\n this.summary = null;\r\n this.billTo = billTo;\r\n this.isForCancelOrder = isForCancelOrder;\r\n this.itemList = [];\r\n this.isActive = true;\r\n this.selectedRowIndex = 0;\r\n setTimeout(() => {\r\n this.setFilterOption();\r\n this.refreshPage();\r\n this.refresh(); \r\n }, 100) \r\n }\r\n \r\n setFilterOption(){\r\n if(this.popupsettings && this.popupsettings.columns.length){\r\n let filterIndex = this.popupsettings.defaultFilterIndex ? this.popupsettings.defaultFilterIndex : 0;\r\n if(this.popupsettings.columns.length <= filterIndex) return; \r\n this.filterValue = this.popupsettings.useDefinefilterValue;\r\n this.filterOption = this.popupsettings.columns[filterIndex].key; \r\n }\r\n }\r\n \r\n getData() {\r\n this.summary = null;\r\n this.selectedRowIndex = 0; \r\n let apiEndpoints = this.popupsettings.apiEndpoints;\r\n let apiUrl = `${this.apiUrl}${apiEndpoints}?currentPage=${\r\n this.pageNumber\r\n }&maxResultCount=${this.pageSize}`;\r\n \r\n if (this.billTo && this.billTo != \"\" && this.billTo != null && this.billTo != undefined) {\r\n apiUrl = apiUrl + `&billTo=${this.billTo}`;\r\n }\r\n if (this.isForCancelOrder) {\r\n apiUrl = apiUrl + `&isForCancelOrder=${this.isForCancelOrder}`;\r\n }\r\n \r\n this.requestUrl = this.getFilterOption(apiUrl);\r\n \r\n return this._http\r\n .get(this.requestUrl, this.masterService.getRequestOption())\r\n .map(res => res.json() || [])\r\n .subscribe(res => {\r\n this.totalItems = res ? res.totalCount : 0;\r\n this.itemList = res ? res.data : [];\r\n \r\n this.itemList.forEach(function (item) {\r\n if (item.TRNDATE != null && item.TRNDATE != undefined) {\r\n item.TRNDATE = item.TRNDATE.toString().substring(0, 10);\r\n }\r\n if (item.DATE != null && item.DATE != undefined) {\r\n item.DATE = item.DATE.toString().substring(0, 10);\r\n }\r\n });\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n \r\n if (\r\n this.itemList.length > 0 &&\r\n this.selectedRowIndex == 0 &&\r\n this.itemList[this.selectedRowIndex].itemSummary\r\n ) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n });\r\n }\r\n \r\n hide() {\r\n this.itemList = [];\r\n this.pageNumber = 1;\r\n this.totalItems = 0;\r\n this.isActive = false;\r\n }\r\n \r\n triggerSearch() {\r\n //console.log(\"@@FilterValue changed\",this.filterOption, this.masterService.defaultProductValue);\r\n if(this.filterOption == 'DESCA'){\r\n this.masterService.defaultProductValue=0;\r\n }else if(this.filterOption =='MENUCODE' ||this.filterOption=='MCODE'){\r\n this.masterService.defaultProductValue=1;\r\n }else if(this.filterOption=='BATCH'){\r\n this.masterService.defaultProductValue=2;\r\n }\r\n \r\n if (\r\n this.filterOption == null ||\r\n this.filterOption == undefined ||\r\n this.filterOption == \"\"\r\n )\r\n return;\r\n if (\r\n this.filterValue == null ||\r\n this.filterValue == undefined ||\r\n this.filterValue == \"\"\r\n )\r\n return;\r\n \r\n this.refreshPage();\r\n this.refresh();\r\n }\r\n \r\n singleClick(index) {\r\n this.selectedRowIndex = index;\r\n this.summary = this.itemList[index].itemSummary;\r\n }\r\n \r\n doubleClick($event) {\r\n this.onItemDoubleClick.emit($event);\r\n this.hide();\r\n }\r\n \r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n @debounce(10)\r\n updown($event: KeyboardEvent) {\r\n if(!this.isActive) return true;\r\n if ($event.code == \"ArrowDown\") {\r\n $event.preventDefault();\r\n this.selectedRowIndex++;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n this.calculateTotalPages();\r\n if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber < this.totalPages\r\n ) {\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n this.selectedRowIndex = 0;\r\n this.itemListClosed();\r\n } else if (\r\n this.selectedRowIndex == this.itemList.length &&\r\n this.pageNumber == this.totalPages\r\n ) {\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n }\r\n } else if ($event.code == \"ArrowUp\") {\r\n $event.preventDefault();\r\n this.selectedRowIndex--;\r\n if (this.itemList[this.selectedRowIndex] != null) {\r\n this.summary = this.itemList[this.selectedRowIndex].itemSummary;\r\n }\r\n if (this.selectedRowIndex == -1 && this.pageNumber > 1) {\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n this.selectedRowIndex = this.itemList.length - 1;\r\n this.itemListClosed();\r\n } else if (this.selectedRowIndex == -1 && this.pageNumber == 1) {\r\n this.selectedRowIndex = 0;\r\n }\r\n } else if (\r\n ($event.code == \"Enter\" || $event.code == \"NumpadEnter\") &&\r\n this.selectedRowIndex >= 0 &&\r\n this.selectedRowIndex < this.itemList.length\r\n ) {\r\n $event.preventDefault();\r\n if(this.filterOption==\"BARCODE\")\r\n {}\r\n else{\r\n this.onItemDoubleClick.emit(this.itemList[this.selectedRowIndex]);\r\n this.hide();\r\n this.itemListClosed();\r\n }\r\n } else if ($event.code == \"Escape\" && this.route.snapshot.url[0].path != 'addsientry') {\r\n $event.preventDefault();\r\n this.hide();\r\n this.itemListClosed();\r\n } else if ($event.code == \"ArrowRight\") {\r\n $event.preventDefault();\r\n this.calculateTotalPages();\r\n if (this.pageNumber >= this.totalPages) {\r\n this.pageNumber = this.totalPages;\r\n return;\r\n }\r\n \r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber + 1;\r\n this.refresh();\r\n } else if ($event.code == \"ArrowLeft\") {\r\n $event.preventDefault();\r\n if (this.pageNumber <= 1) {\r\n this.pageNumber = 1;\r\n return;\r\n }\r\n this.selectedRowIndex = 0;\r\n this.pageNumber = this.pageNumber - 1;\r\n this.refresh();\r\n \r\n }\r\n }\r\n \r\n itemListClosed() {\r\n this.onPopUpClose.emit();\r\n }\r\n \r\n ngOnChanges(changes: any) {\r\n this.popupsettings = changes.popupsettings.currentValue;\r\n }\r\n }\r\n \r\n export class NewGenericPopUpSettings {\r\n title: string;\r\n apiEndpoints: string;\r\n columns: ColumnSettings[] = [];\r\n defaultFilterIndex : number = 0;\r\n useDefinefilterValue: string;\r\n }\r\n \r\n export class ColumnSettings {\r\n key: string;\r\n title: string;\r\n hidden: boolean = false;\r\n noSearch: boolean = false;\r\n }\r\n \r\n export function debounce(delay: number): MethodDecorator {\r\n return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {\r\n \r\n const original = descriptor.value;\r\n const key = `__timeout__${propertyKey}`;\r\n \r\n descriptor.value = function (...args) {\r\n clearTimeout(this[key]);\r\n this[key] = setTimeout(() => original.apply(this, args), delay);\r\n };\r\n \r\n return descriptor;\r\n };\r\n }\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/new-generic-grid-approved/new-generic-popup-grid-approved.component.ts","import { Component, Output, EventEmitter, Injector } from \"@angular/core\";\r\nimport { PagedListingComponentBase } from \"../../../paged-list-component-base\";\r\nimport { GenericPopUpSettings } from \"../generic-grid/generic-popup-grid.component\";\r\nimport { Headers, RequestOptions } from \"@angular/http\";\r\nimport { NotificationService } from \"./notification.service\";\r\nimport { Router } from \"@angular/router\";\r\nimport { TransactionService } from \"../../Transaction Components/transaction.service\";\r\nimport { MasterRepo } from \"../../repositories/masterRepo.service\";\r\n\r\n@Component({\r\n selector: \"notification-popup-grid\",\r\n template: require('./notification-popup-grid.component.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')]\r\n})\r\nexport class NotificationPopUpComponent extends PagedListingComponentBase {\r\n /** List Declaration */\r\n\r\n isActive: boolean = false;\r\n itemList: any[] = [];\r\n selectedRowIndex: number = 0;\r\n tabindex: string = \"list\";\r\n idForUpdate:any;\r\n\r\n /** Output */\r\n\r\n @Output() onPopUpClose = new EventEmitter();\r\n @Output() onItemDoubleClick = new EventEmitter();\r\n @Output() notificationCountUpdate = new EventEmitter();\r\n\r\n /** Input */\r\n\r\n popupsettings: GenericPopUpSettings;\r\n\r\n constructor(\r\n public injector: Injector,\r\n private notificationService: NotificationService,\r\n private router: Router,\r\n private masterService: MasterRepo,\r\n private transacationservice:TransactionService\r\n ) {\r\n super(injector);\r\n this.popupsettings = {\r\n title: \"All Notifications\",\r\n apiEndpoints: `/getAllNotificationPagedList`,\r\n defaultFilterIndex : 0,\r\n columns: [\r\n {\r\n key: \"MESSAGE\",\r\n title: \"Details\",\r\n hidden: false,\r\n noSearch: false\r\n },\r\n {\r\n key: \"TIMESTAMP\",\r\n title: \"Notification At\",\r\n hidden: false,\r\n noSearch: false\r\n }\r\n ]\r\n };\r\n\r\n this.refreshPage();\r\n this.refresh();\r\n }\r\n\r\n show() {\r\n this.isActive = true;\r\n this.selectedRowIndex = 0;\r\n }\r\n\r\n getNotificationCount() {\r\n this.notificationService.getNotificationCount().subscribe(\r\n result => {\r\n let count = Number(result) ? Number(result) : 0;\r\n this.notificationCountUpdate.emit(count);\r\n },\r\n error => {\r\n this.notificationCountUpdate.emit(0);\r\n }\r\n );\r\n }\r\n\r\n markAsRead(item) {\r\n\r\n this.masterService.setShowSalesmanListPopup(false);\r\n this.notificationService.idForUPdate = item.ID; \r\n\r\n this.hide();\r\n this.redirectToBestRoute(item);\r\n if (item.ISSEEN) return;\r\n\r\n // this.notificationService\r\n // .markAsRead(item.ID)\r\n // .subscribe(result => {}, error => {});\r\n // this.onItemDoubleClick.emit(item);\r\n // this.hide();\r\n }\r\n\r\n redirectToBestRoute(item) {\r\n let caseString = \"\";\r\n let parentNotificationId = 0;\r\n let status = 0;\r\n let isDownloaded = 0;\r\n if (item) {\r\n caseString = item.TYPE;\r\n parentNotificationId = item.PARENTNOTIFICATIONID;\r\n status =\r\n item.ISAPPROVED ||\r\n item.ISAPPROVED == null ||\r\n item.ISAPPROVED == undefined\r\n ? 0\r\n : 1;\r\n isDownloaded =\r\n item.ISDOWNLOADED ||\r\n item.ISDOWNLOADED == 0 ||\r\n item.ISDOWNLOADED == null ||\r\n item.ISDOWNLOADED == undefined\r\n ? 0\r\n : 1;\r\n }\r\n\r\n switch (caseString) {\r\n case \"PERFORMA\": {\r\n //statements;\r\n\r\n if (\r\n parentNotificationId == 0 ||\r\n parentNotificationId == undefined ||\r\n parentNotificationId == null\r\n ) {\r\n //redirect to performa\r\n this.router.navigate(\r\n [\"/pages/transaction/sales/performa-invoice\"],\r\n {\r\n queryParams: {\r\n voucher: item.REFNO,\r\n status: status,\r\n downloaded: isDownloaded,\r\n fromNotification: true\r\n }\r\n }\r\n );\r\n } else {\r\n this.router.navigate(\r\n [\"/pages/transaction/sales/addsientry\"],\r\n { queryParams: { voucher: item.REFNO, downloaded: isDownloaded , fromNotification: true } }\r\n );\r\n //redirect to sales -- approved\r\n }\r\n break;\r\n }\r\n case \"PURCHASEORDER\": {\r\n //statements;\r\n if (\r\n parentNotificationId == 0 ||\r\n parentNotificationId == undefined ||\r\n parentNotificationId == null\r\n ) {\r\n //redirect to performa\r\n this.router.navigate(\r\n [\"/pages/transaction/sales/sales-order\"],\r\n {\r\n queryParams: {\r\n voucher: item.REFNO,\r\n fromcompanyid: item.FROMCOMPANY,\r\n status: status,\r\n downloaded: isDownloaded,\r\n fromNotification: true\r\n }\r\n }\r\n );\r\n } \r\n break;\r\n }\r\n case \"SALES\": {\r\n //statements;\r\n if (\r\n parentNotificationId == 0 ||\r\n parentNotificationId == undefined ||\r\n parentNotificationId == null\r\n ) {\r\n //redirect to performa\r\n this.router.navigate(\r\n [\"/pages/transaction/purchases/add-purchase-invoice\"],\r\n {\r\n queryParams: {\r\n voucher: item.REFNO,\r\n fromcompanyid: item.FROMCOMPANY,\r\n status: status,\r\n downloaded: isDownloaded,\r\n fromNotification: true\r\n \r\n }\r\n }\r\n );\r\n } \r\n break;\r\n }\r\n case \"SALESORDER\": {\r\n //statements;\r\n if (\r\n parentNotificationId == 0 ||\r\n parentNotificationId == undefined ||\r\n parentNotificationId == null\r\n ) {\r\n //redirect to performa\r\n this.router.navigate(\r\n [\"/pages/transaction/sales/addsientry\"],\r\n {\r\n queryParams: {\r\n voucher: item.REFNO,\r\n fromcompanyid: item.FROMCOMPANY,\r\n status: status,\r\n downloaded: isDownloaded,\r\n fromNotification: true\r\n \r\n }\r\n }\r\n );\r\n } \r\n break;\r\n }\r\n case \"DebitNote\": {\r\n //statements;\r\n\r\n if (\r\n parentNotificationId == 0 ||\r\n parentNotificationId == undefined ||\r\n parentNotificationId == null\r\n ) {\r\n //redirect to performa\r\n this.router.navigate(\r\n [\"/pages/transaction/sales/add-creditnote-itembase\"],\r\n {\r\n queryParams: {\r\n voucher: item.REFNO,\r\n fromcompanyid: item.FROMCOMPANY,\r\n status: status,\r\n downloaded: isDownloaded,\r\n fromNotification: true\r\n \r\n }\r\n }\r\n );\r\n } \r\n break;\r\n }\r\n case \"CUSTOMER\": {\r\n //statements;\r\n if (\r\n parentNotificationId == 0 ||\r\n parentNotificationId == undefined ||\r\n parentNotificationId == null\r\n ) {\r\n //redirect to performa\r\n this.router.navigate(\r\n [\"/pages/masters/PartyLedger/Customer\",\r\n {\r\n ACID: item.REFNO,\r\n fromcompanyid: item.FROMCOMPANY,\r\n PType:item.PTYPE,\r\n isGroup: 0,\r\n status: status,\r\n downloaded: isDownloaded,\r\n fromNotification: true,\r\n returnUrl: this.router.url \r\n \r\n \r\n }]\r\n );\r\n } \r\n break;\r\n }\r\n default: {\r\n //statements;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n getData() {\r\n this.selectedRowIndex = 0;\r\n let apiUrl = `${this.apiUrl}${\r\n this.popupsettings.apiEndpoints\r\n }?currentPage=${this.pageNumber}&maxResultCount=${this.pageSize}`;\r\n apiUrl = this.getFilterOption(apiUrl);\r\n return this._http\r\n .get(apiUrl, this.getRequestOption())\r\n .map(res => res.json() || [])\r\n .subscribe(res => {\r\n this.totalItems = res ? res.totalCount : 0;\r\n this.itemList = res ? res.data : [];\r\n });\r\n }\r\n\r\n hide() {\r\n this.pageNumber = 1;\r\n this.totalItems = 0;\r\n this.isActive = false;\r\n }\r\n\r\n triggerSearch() {\r\n if (\r\n this.filterOption == null ||\r\n this.filterOption == undefined ||\r\n this.filterOption == \"\"\r\n )\r\n return;\r\n if (\r\n this.filterValue == null ||\r\n this.filterValue == undefined ||\r\n this.filterValue == \"\"\r\n )\r\n return;\r\n\r\n this.refreshPage();\r\n this.refresh();\r\n }\r\n\r\n singleClick(index) {\r\n this.selectedRowIndex = index;\r\n }\r\n\r\n doubleClick($event) {\r\n this.masterService.disableQuantityEdit = true;\r\n\r\n this.markAsRead($event);\r\n }\r\n\r\n // @HostListener(\"document : keydown\", [\"$event\"])\r\n // updown($event: KeyboardEvent) {\r\n // if (\r\n // $event.code == \"ArrowDown\" &&\r\n // this.selectedRowIndex < this.pageSize - 1\r\n // ) {\r\n // $event.preventDefault();\r\n // this.selectedRowIndex++;\r\n // }\r\n // else if ($event.code == \"ArrowDown\") {\r\n // $event.preventDefault();\r\n // this.selectedRowIndex = 0;\r\n // this.pageNumber = this.pageNumber + 1;\r\n // }\r\n // else if ($event.code == \"ArrowUp\" && this.selectedRowIndex - 1 > -1) {\r\n // $event.preventDefault();\r\n // this.selectedRowIndex--;\r\n // }\r\n // else if ($event.code == \"ArrowUp\") {\r\n // $event.preventDefault();\r\n // this.selectedRowIndex = 0;\r\n // this.pageNumber = this.pageNumber > 0 ? this.pageNumber -1 : this.pageNumber\r\n // }\r\n // else if (\r\n // $event.code == \"Enter\" &&\r\n // this.selectedRowIndex >= 0 &&\r\n // this.selectedRowIndex < this.itemList.length - 1\r\n // ) {\r\n // $event.preventDefault();\r\n\r\n // let itemIndex = ((this.pageNumber - 1) * this.pageSize) + (this.selectedRowIndex)\r\n // this.onItemDoubleClick.emit(this.itemList[this.selectedRowIndex]);\r\n // this.hide();\r\n // this.itemListClosed();\r\n // }\r\n // }\r\n\r\n itemListClosed() {\r\n this.onPopUpClose.emit();\r\n }\r\n\r\n public getRequestOption() {\r\n let token = localStorage.getItem(\"TOKEN\");\r\n let headers: Headers = new Headers({\r\n \"Content-type\": \"application/json\",\r\n Authorization: token ? token.replace(/['\"]+/g, \"\") : \"\"\r\n });\r\n return new RequestOptions({ headers: headers });\r\n }\r\n\r\n toggle() {\r\n if (this.isActive) {\r\n this.hide();\r\n } else {\r\n this.getNotificationCount();\r\n this.refresh();\r\n this.show();\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/notification/notification-popup-grid.component.ts","import {\r\n Component,\r\n Output,\r\n EventEmitter,\r\n Injector,\r\n HostListener\r\n} from \"@angular/core\";\r\nimport { debounce } from \"../generic-grid/generic-popup-grid.component\";\r\nimport { TransactionService } from \"../../Transaction Components/transaction.service\";\r\nimport { VoucherTypeEnum, PartyOpeningDetail } from \"../../interfaces\";\r\nimport { AlertService } from \"../../services/alert/alert.service\";\r\n\r\n@Component({\r\n selector: \"party-opening-details-popup\",\r\n template: require('./party-opening-details-popup.component.html'),\r\n styles: [require('../../../pages/Style.css'), require('../pStyle.css')]\r\n})\r\nexport class PartyOpeningDetailsPopUpComponent {\r\n isActive: boolean = false;\r\n currentIndex: number = 0;\r\n acType: string = \"\";\r\n\r\n @Output() onPopUpClose = new EventEmitter();\r\n @Output() onOkClick = new EventEmitter();\r\n\r\n voucherType: VoucherTypeEnum;\r\n\r\n constructor(\r\n public _trnMainService: TransactionService,\r\n private alertService : AlertService \r\n ) {\r\n this.voucherType = this._trnMainService.TrnMainObj.VoucherType;\r\n }\r\n\r\n show(index: number, acType: string) {\r\n this.currentIndex = index;\r\n this.acType = acType;\r\n\r\n if (\r\n !this._trnMainService.TrnMainObj.TrntranList[this.currentIndex]\r\n .PartyDetails ||\r\n this._trnMainService.TrnMainObj.TrntranList[this.currentIndex]\r\n .PartyDetails.length == 0\r\n ) {\r\n this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].PartyDetails = [];\r\n this.addRow();\r\n }\r\n this.isActive = true;\r\n }\r\n\r\n addRow(index: number = -1) {\r\n if (index != -1) {\r\n let current = this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].PartyDetails[index];\r\n if (current.REFVNO == \"\") {\r\n this.alertService.info(\"Voucher No is Required.\");\r\n return;\r\n } else if (current.AMOUNT <= 0 || current.CLRAMOUNT < 0) {\r\n this.alertService.info(\"AMOUNT and CLEAR AMOUNT is required and can not be less than 0.\");\r\n return;\r\n }\r\n else if ((current.AMOUNT - current.CLRAMOUNT) <= 0) {\r\n this.alertService.info(\"Amount Should be Greater than Clear Amount.\");\r\n return;\r\n } \r\n }\r\n\r\n\r\n if(index != -1 && this._trnMainService.TrnMainObj.TrntranList[this.currentIndex].PartyDetails.length > index+1){\r\n return true; \r\n } \r\n \r\n var newItem = Object.assign({}, {\r\n VCHRNO: this._trnMainService.TrnMainObj.VCHRNO,\r\n DIVISION: this._trnMainService.TrnMainObj.DIVISION,\r\n REFVNO: \"\",\r\n ACID: this._trnMainService.TrnMainObj.TrntranList[this.currentIndex]\r\n .AccountItem.ACID,\r\n REFDATE: (new Date()).toString().substring(0,10),\r\n AMOUNT: 0,\r\n CLRAMOUNT: 0,\r\n DUEDATE: (new Date()).toString().substring(0,10),\r\n REFSNO: \"\",\r\n PHISCALID: this._trnMainService.TrnMainObj.PhiscalID\r\n });\r\n this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].PartyDetails.push(newItem);\r\n }\r\n\r\n onAmountChange(i : number) {\r\n\r\n if(i != -1){\r\n this._trnMainService.TrnMainObj.TrntranList[this.currentIndex].PartyDetails[i].DUEAMT\r\n = this._trnMainService.TrnMainObj.TrntranList[this.currentIndex].PartyDetails[i].AMOUNT \r\n - this._trnMainService.TrnMainObj.TrntranList[this.currentIndex].PartyDetails[i].CLRAMOUNT;\r\n } \r\n\r\n let dueTotal = this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].PartyDetails.reduce(\r\n (sum, x) =>\r\n sum +\r\n (this._trnMainService.nullToZeroConverter(x.AMOUNT) -\r\n this._trnMainService.nullToZeroConverter(x.CLRAMOUNT)),\r\n 0\r\n );\r\n\r\n this._trnMainService.TrnMainObj.TrntranList[this.currentIndex].CRAMNT = 0;\r\n this._trnMainService.TrnMainObj.TrntranList[this.currentIndex].DRAMNT = 0;\r\n if (this.acType == \"drAmt\") {\r\n this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].DRAMNT = dueTotal;\r\n } else if (this.acType == \"crAmt\") {\r\n this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].CRAMNT = dueTotal;\r\n }\r\n }\r\n\r\n deleteRow(index: number) {\r\n this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].PartyDetails.splice(index, 1);\r\n if (\r\n this._trnMainService.TrnMainObj.TrntranList[this.currentIndex]\r\n .PartyDetails.length == 0\r\n ) {\r\n this.addRow();\r\n }\r\n this.onAmountChange(-1);\r\n }\r\n\r\n hide() {\r\n this.validateDetailEntry();\r\n this.onAmountChange(-1);\r\n this.currentIndex = 0;\r\n this.acType = \"\";\r\n this.isActive = false;\r\n this.onPopUpClose.emit(true);\r\n }\r\n\r\n validateDetailEntry() {\r\n for (\r\n var i = 0;\r\n i <\r\n this._trnMainService.TrnMainObj.TrntranList[this.currentIndex]\r\n .PartyDetails.length;\r\n i++\r\n ) {\r\n let current = this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].PartyDetails[i];\r\n if (\r\n current.REFVNO == \"\" ||\r\n current.AMOUNT <= 0 ||\r\n current.CLRAMOUNT < 0 ||\r\n (current.AMOUNT - current.CLRAMOUNT) <= 0\r\n ) {\r\n this._trnMainService.TrnMainObj.TrntranList[\r\n this.currentIndex\r\n ].PartyDetails.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n } \r\n\r\n @HostListener(\"document : keydown\", [\"$event\"])\r\n @debounce(20)\r\n updown($event: KeyboardEvent) {\r\n if (!this.isActive) return true;\r\n if ($event.code == \"Escape\") {\r\n $event.preventDefault();\r\n this.hide();\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/popupLists/party-opening-details-popup/party-opening-details-popup.component.ts","import { SessionStorage } from \"./sessionStorage.service\";\r\nimport { Injectable } from '@angular/core'\r\nexport class CACHE_CONSTANT {\r\n USER_PROFILE:string\r\n TOKEN: string\r\n};\r\n\r\n@Injectable()\r\nexport class CacheService {\r\n constructor(){\r\n \r\n }\r\n\r\n remove(key: string) {\r\n // window.sessionStorage.removeItem(key);\r\n if (this.exist) localStorage.removeItem(key)\r\n //SessionStorage.remove(key);\r\n }\r\n exist(key: string): boolean {\r\n return localStorage.getItem(key) != null\r\n // return window.sessionStorage.getItem(key) != null;\r\n //return sessionStorage.exist(key);\r\n }\r\n get(key: string): any {\r\n // console.log(\"get\",key)\r\n if (!this.exist(key)) {\r\n return null;\r\n }\r\n // let data: any = window.sessionStorage.getItem(key);\r\n let data: any = localStorage.getItem(key);\r\n return JSON.parse(data);\r\n //return sessionStorage.get(key);\r\n }\r\n set(key: string, data: any): any {\r\n // window.sessionStorage.setItem(key, JSON.stringify(data));\r\n localStorage.setItem(key, JSON.stringify(data));\r\n //return sessionStorage.set(key, data);\r\n }\r\n\r\n checkUserRight(right:string){\r\n // let user_profile:any=window.sessionStorage.getItem('USER_PROFILE')\r\n let user_profile:any= localStorage.getItem('USER_PROFILE')\r\n let user_rights:any;\r\n var result;\r\n if(user_profile){\r\n user_rights = user_profile.userRights;\r\n if(user_rights){\r\n result =user_rights[right]\r\n }\r\n }\r\n return result;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/permission/cacheService.service.ts","import {UserToken} from './userToken.service';\r\nimport {Injectable} from '@angular/core'\r\n@Injectable()\r\nexport class Permissions {\r\n constructor(){\r\n\r\n }\r\n canActivate(user: UserToken, id: string): boolean {\r\n return true;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/permission/permission.service.ts","import {Injectable} from '@angular/core'\r\n@Injectable()\r\nexport class UserToken {\r\n constructor(){\r\n\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/common/services/permission/userToken.service.ts","import {Component, Output, EventEmitter} from \"@angular/core\";\r\nimport { MasterRepo } from \"../../../../common/repositories\";\r\nimport { TransactionService } from \"../../../../common/Transaction Components/transaction.service\";\r\n\r\n\r\n\r\n@Component({\r\n selector: \"popup-addnewcust\",\r\n template: require('./AddCustomerPopup.html'),\r\n styles: [require('../../../../pages/Style.css'), require('../../../../common/popupLists/pStyle.css')],\r\n})\r\nexport class AddNewCustomerPopUpComponent {\r\n @Output('okClicked') okClicked = new EventEmitter();\r\n isActive:boolean=false;\r\n CustObj:any={};\r\n StateList:any[]=[];\r\n constructor(public masterService: MasterRepo, public _trnMainService: TransactionService) {\r\n this.CustObj={};\r\n this.CustObj.GEO=\"WALK-IN\";\r\n this.CustObj.CTYPE=\"RETAIL INVOICE\";\r\n masterService.getState().subscribe(res => {\r\n if (res.status == 'ok') {\r\n this.StateList = res.result;\r\n this.CustObj.STATE=_trnMainService.userProfile.CompanyInfo.STATE;\r\n \r\n }\r\n })\r\n }\r\n\r\n show() {\r\n this.isActive = true;\r\n \r\n }\r\n\r\n hide() {\r\n\r\n this.isActive = false;\r\n }\r\n\r\n OK() {\r\n this.okClicked.emit(this.CustObj);\r\n \r\n\r\n }\r\n \r\n}\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/Sales/components/salesinvoice/AddCustomerPopup.ts","import {\r\n Component, Output, EventEmitter, ViewChild, ElementRef\r\n} from \"@angular/core\";\r\nimport { FormBuilder } from \"@angular/forms\";\r\nimport { MasterRepo } from \"../../../../common/repositories\";\r\nimport { TransactionService } from \"../../../../common/Transaction Components/transaction.service\";\r\nimport { GenericPopUpSettings, GenericPopUpComponent } from \"../../../../common/popupLists/generic-grid/generic-popup-grid.component\";\r\nimport { SpinnerService } from \"../../../../common/services/spinner/spinner.service\";\r\nimport { AuthService } from \"../../../../common/services/permission\";\r\n\r\n@Component({\r\n selector: \"Transport-Popup\",\r\n template: require('./Transport-popup.html'),\r\n styles: [require('../../../../pages/Style.css'), require('../../../../common/popupLists/pStyle.css')],\r\n})\r\nexport class TransportPopupComponent {\r\n @Output('okClicked') okClicked = new EventEmitter();\r\n @ViewChild(\"Transporter\") Transporter: ElementRef;\r\n @ViewChild(\"genericGrid\") genericGrid: GenericPopUpComponent;\r\n isActive: boolean = false;\r\n TransportObj: any = {};\r\n gridPopupSettings: GenericPopUpSettings = new GenericPopUpSettings();\r\n userProfile: any;\r\n constructor(private fb: FormBuilder, private masterService: MasterRepo,\r\n private loadingService: SpinnerService, private _trnMainService: TransactionService,\r\n private authservice: AuthService) {\r\n this.TransportObj.MODE = \"paid\";\r\n this.gridPopupSettings = this.masterService.getGenericGridPopUpSettings('Transporter');\r\n if(_trnMainService.TrnMainObj.TransporterEway==null)\r\n {\r\n this._trnMainService.TrnMainObj.TransporterEway={};\r\n }\r\n this.userProfile = this.authservice.getUserProfile();\r\n }\r\n\r\n show() {\r\n this.isActive = true;\r\n this._trnMainService.TrnMainObj.TransporterEway.TOTALWEIGHT=this._trnMainService.TrnMainObj.TOTALWEIGHT;\r\n }\r\n\r\n hide() {\r\n this.isActive = false;\r\n this._trnMainService.TrnMainObj.TransporterEway={};\r\n }\r\n ok() {\r\n this._trnMainService.TrnMainObj.TransporterEway.COMPANYID = this.userProfile.CompanyInfo.COMPANYID\r\n this.isActive = false;\r\n }\r\n onEnterTransporter() {\r\n this.loadingService.show(\"Getting data, please wait...\");\r\n this.masterService.CHECKTRANSPORT().subscribe(res => {\r\n console.log(\"resa\", res)\r\n if (res.status == 'ok') {\r\n this.loadingService.hide();\r\n if (res.result.length > 1) {\r\n this.genericGrid.show()\r\n }\r\n else {\r\n var a = res.result[0];\r\n this._trnMainService.TrnMainObj.TransporterEway.TRANSPORTER = a.NAME;\r\n }\r\n }\r\n })\r\n }\r\n onItemDoubleClick(event) {\r\n\r\n this._trnMainService.TrnMainObj.TransporterEway.TRANSPORTER = event.NAME;\r\n }\r\n\r\n\r\n}\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/Sales/components/salesinvoice/Transport-popup.component.ts","import {\r\n Component, Output, EventEmitter, ViewChild, ElementRef\r\n} from \"@angular/core\";\r\nimport { FormGroup, FormBuilder, Validators } from \"@angular/forms\";\r\nimport { MasterRepo } from \"../../../../common/repositories\";\r\nimport { VoucherMasterActionComponent } from \"../../../../common/Transaction Components/voucher-master-action.component\";\r\nimport { TransactionService } from \"../../../../common/Transaction Components/transaction.service\";\r\nimport { TenderObj, TBillTender, TrnMain } from \"../../../../common/interfaces\";\r\nimport { HotkeysService, Hotkey } from \"angular2-hotkeys\";\r\n\r\n\r\n\r\n@Component({\r\n selector: \"generic-popup-Tender\",\r\n template: require('./generic-popup-Tender.html'),\r\n styles: [require('../../../../pages/Style.css'), require('../../../../common/popupLists/pStyle.css')],\r\n})\r\nexport class GenericPopUpTenderComponent {\r\n @Output('okClicked') okClicked = new EventEmitter();\r\n // @ViewChild(\"CASHAMT_Native\") CASHAMT_Native : ElementRef;\r\n // @ViewChild(\"CARDAMT_Native\") CARDAMT_Native : ElementRef;\r\n // @ViewChild(\"CHEQUEAMT_Native\") CHEQUEAMT_Native : ElementRef;\r\n // @ViewChild(\"COUPONAMT_Native\") COUPONAMT_Native : ElementRef;\r\n // @ViewChild(\"WALLETAMT_Native\") WALLETAMT_Native : ElementRef;\r\n BillTenderList: TBillTender[] = [];\r\n TendersaveList: TenderObj[] = [];\r\n CardName: any[] = [];\r\n walletList: any[] = [];\r\n couponList: any[] = [];\r\n cardList: any[] = [];\r\n isActive: boolean = false;\r\n PaymentMode: string;\r\n calculateTenderAmt: number;\r\n TrnmainObj: TrnMain = {};\r\n tenderObj: TenderObj = {};\r\n form: FormGroup;\r\n\r\n constructor(private fb: FormBuilder, public masterService: MasterRepo, public _trnMainService: TransactionService,\r\n private _hotkeysService: HotkeysService) {\r\n\r\n this.masterService.TenderTypes().subscribe(res => {\r\n if (res.status == 'ok') {\r\n // alert(\"reached\")\r\n\r\n this.walletList = res.result.Wallet;\r\n this.couponList = res.result.Coupon;\r\n this.cardList = res.result.Card;\r\n // console.log(\"CheckNameee\", res, this.walletList, this.couponList, this.cardList)\r\n\r\n }\r\n });\r\n this.form = this.fb.group({\r\n CASH: [0],\r\n CREDIT: [0],\r\n CHEQUE: [0],\r\n WALLET: [0],\r\n CARD: [0],\r\n COUPON: [0],\r\n CASHAMT: [0],\r\n CARDAMT: [0],\r\n CARDNO: [''],\r\n CARDNAME: [''],\r\n APPROVALCODE: [''],\r\n CARDHOLDERNAME: [''],\r\n CREDITAMT: [0],\r\n CHEQUEAMT: [0],\r\n CHEQUENO: [''],\r\n DATE: [''],\r\n BANK: [''],\r\n TOTAL: [0],\r\n OUTSTANDING: [''],\r\n ADVANCE: [0],\r\n TENDERAMT: [''],\r\n BALANCE: [0],\r\n LOYALTYAMT: [0],\r\n COUPONNAME: [''],\r\n COUPONAMT: [0],\r\n WALLETAMT: [0],\r\n WALLETTYPE: [''],\r\n WALLETCARDNO: [''],\r\n\r\n\r\n });\r\n this.mixmode = false;\r\n this.masterService.masterGetmethod(\"/gettransactionmodes\").subscribe(\r\n res => {\r\n if (res.status == \"ok\") {\r\n this._trnMainService.paymentmodelist = res.result;\r\n this.Cash();\r\n } else {\r\n console.log(\"error on getting paymentmode \" + res.result);\r\n }\r\n },\r\n error => {\r\n console.log(\"error on getting paymentmode \", error);\r\n }\r\n );\r\n }\r\n ngOnInit() {\r\n this.setHotKeyFunction();\r\n }\r\n\r\n show() {\r\n this.isActive = true;\r\n this.TrnmainObj = this._trnMainService.TrnMainObj;\r\n this.form.patchValue({\r\n TOTAL: this.TrnmainObj.NETAMNT,\r\n BALANCE: this.TrnmainObj.NETAMNT,\r\n // LOYALTYAMT: this.TrnmainObj.NETAMNT\r\n })\r\n // console.log(\"NETAMT\",this._trnMainService.TrnMainObj.NETAMNT,this.NETAMT)\r\n }\r\n\r\n hide() {\r\n\r\n this.isActive = false;\r\n this.ValueInitilize();\r\n }\r\n validateSelectedPaymentModes(value) {\r\n // console.log(\"value\", value, this.TenderSaveObj)\r\n if (value == \"Cash\") {\r\n return true;\r\n }\r\n else if (value == \"Card\") {\r\n if (this.TenderSaveObj.CARDNO == \"\" || this.TenderSaveObj.CARDAMT == 0 || this.TenderSaveObj.CARDHOLDERNAME == \"\" || this.TenderSaveObj.CARDNAME == \"\") {\r\n alert(\"Please fill required card nformation.\")\r\n return false;\r\n }\r\n else\r\n return true;\r\n }\r\n else if (value == \"Coupon\") {\r\n if (this.TenderSaveObj.COUPONNAME == \"\") {\r\n alert(\"Please fill required coupon Information.\")\r\n return false;\r\n }\r\n else\r\n return true;\r\n }\r\n else if (value == \"Wallet\") {\r\n if (this.TenderSaveObj.WALLETCARDNO == \"\" || this.TenderSaveObj.WALLETTYPE == \"\") {\r\n alert(\"Please fill required wallet Information.\")\r\n return false;\r\n }\r\n else\r\n return true;\r\n }\r\n else if (value == \"Cheque\") {\r\n if (this.TenderSaveObj.CHEQUENO == \"\" && this.TenderSaveObj.BANK == \"\") {\r\n alert(\"Please fill required cheque Information.\")\r\n return false;\r\n }\r\n else\r\n return true;\r\n }\r\n }\r\n TenderSaveObj: TenderObj = {}\r\n // var TenderSaveObj = Object.assign({}, this.form.value);\r\n OK() {\r\n if (this.calculateTenderAmt > this.TrnmainObj.NETAMNT) {\r\n alert(\"Tender amount is Greater than NetAmount!\")\r\n return;\r\n }\r\n else if (this.calculateTenderAmt < this.TrnmainObj.NETAMNT) {\r\n alert(\"Tender amount is Less than NetAmount!\")\r\n return;\r\n }\r\n\r\n else {\r\n this.BillTenderList = [];\r\n\r\n this.TenderSaveObj = this.form.value;\r\n var amount = 0;\r\n if (this.TenderSaveObj.CASHAMT > 0) {\r\n\r\n this.tenderObj.TRNMODE = \"Cash\";\r\n var Validate = this.validateSelectedPaymentModes(this.tenderObj.TRNMODE)\r\n if (Validate == false) return;\r\n if (this.TenderSaveObj.CASHAMT != this._trnMainService.TrnMainObj.NETAMNT) {\r\n this._trnMainService.TrnMainObj.TRNMODE = \"Mix\";\r\n }\r\n else {\r\n this._trnMainService.TrnMainObj.TRNMODE = this.tenderObj.TRNMODE;\r\n\r\n }\r\n\r\n amount = this.TenderSaveObj.CASHAMT;\r\n this.tenderObj.ACID = this.PaymentModeAcidObj.CashID;\r\n\r\n this.AddTender(this.tenderObj, amount);\r\n }\r\n if (this.TenderSaveObj.CARDAMT > 0) {\r\n this.tenderObj.TRNMODE = \"Card\";\r\n var Validate = this.validateSelectedPaymentModes(this.tenderObj.TRNMODE)\r\n if (Validate == false) return;\r\n if (this.TenderSaveObj.CARDAMT != this._trnMainService.TrnMainObj.NETAMNT) {\r\n this._trnMainService.TrnMainObj.TRNMODE = \"Mix\";\r\n }\r\n else {\r\n this._trnMainService.TrnMainObj.TRNMODE = this.tenderObj.TRNMODE;\r\n }\r\n\r\n this.tenderObj.REMARKS = this.TenderSaveObj.CARDNAME;\r\n amount = this.TenderSaveObj.CARDAMT;\r\n this.tenderObj.ACID = this.PaymentModeAcidObj.CardID;\r\n this.AddTender(this.tenderObj, amount);\r\n\r\n }\r\n // -------------------** Credit might needed on DB and SD ** -----------------\r\n // if (TenderSaveObj.CREDITAMT > 0) {\r\n // this.tenderObj.TRNMODE = \"Credit\"\r\n // amount = TenderSaveObj.CREDITAMT\r\n // this.AddTender(this.tenderObj, amount);\r\n // }\r\n if (this.TenderSaveObj.CHEQUEAMT > 0) {\r\n this.tenderObj.TRNMODE = \"Cheque\";\r\n var Validate = this.validateSelectedPaymentModes(this.tenderObj.TRNMODE)\r\n if (Validate == false) return;\r\n if (this.TenderSaveObj.CHEQUEAMT != this._trnMainService.TrnMainObj.NETAMNT) {\r\n this._trnMainService.TrnMainObj.TRNMODE = \"Mix\";\r\n }\r\n else {\r\n this._trnMainService.TrnMainObj.TRNMODE = this.tenderObj.TRNMODE;\r\n\r\n }\r\n this._trnMainService.TrnMainObj.CHEQUENO = this.TenderSaveObj.CHEQUENO;\r\n this._trnMainService.TrnMainObj.CHEQUEDATE = this.TenderSaveObj.DATE;\r\n amount = this.TenderSaveObj.CHEQUEAMT;\r\n this.tenderObj.REMARKS = this.TenderSaveObj.BANK;\r\n // this.tenderObj.ACID= this.PaymentModeAcidObj.ChequeID;\r\n this.AddTender(this.tenderObj, amount);\r\n }\r\n if (this.TenderSaveObj.COUPONAMT > 0) {\r\n this.tenderObj.TRNMODE = \"Coupon\";\r\n var Validate = this.validateSelectedPaymentModes(this.tenderObj.TRNMODE)\r\n if (Validate == false) return;\r\n if (this.TenderSaveObj.COUPONAMT != this._trnMainService.TrnMainObj.NETAMNT) {\r\n this._trnMainService.TrnMainObj.TRNMODE = \"Mix\";\r\n }\r\n else {\r\n this._trnMainService.TrnMainObj.TRNMODE = this.tenderObj.TRNMODE;\r\n\r\n }\r\n amount = this.TenderSaveObj.COUPONAMT;\r\n this.tenderObj.REMARKS = this.TenderSaveObj.COUPONNAME;\r\n this.tenderObj.ACID = this.PaymentModeAcidObj.CouponID;\r\n this.AddTender(this.tenderObj, amount);\r\n }\r\n if (this.TenderSaveObj.WALLETAMT > 0) {\r\n this.tenderObj.TRNMODE = \"Wallet\";\r\n var Validate = this.validateSelectedPaymentModes(this.tenderObj.TRNMODE)\r\n if (Validate == false) return;\r\n if (this.TenderSaveObj.WALLETAMT != this._trnMainService.TrnMainObj.NETAMNT) {\r\n this._trnMainService.TrnMainObj.TRNMODE = \"Mix\";\r\n }\r\n else {\r\n this._trnMainService.TrnMainObj.TRNMODE = this.tenderObj.TRNMODE;\r\n\r\n }\r\n this.tenderObj.ACID = this.PaymentModeAcidObj.WalletID;\r\n amount = this.TenderSaveObj.WALLETAMT;\r\n this.tenderObj.REMARKS = this.TenderSaveObj.WALLETTYPE;\r\n\r\n\r\n this.AddTender(this.tenderObj, amount);\r\n }\r\n this.okClicked.emit(this.BillTenderList);\r\n this.ValueInitilize()\r\n\r\n }\r\n\r\n }\r\n getTRNACFromTender() {\r\n\r\n }\r\n\r\n AddTender(TenderObj, Amount) {\r\n let BillObj: TBillTender = {}\r\n console.log(\"tendercheck\",TenderObj);\r\n BillObj.TRNMODE = TenderObj.TRNMODE;\r\n BillObj.VCHRNO = this.TrnmainObj.VCHRNO;\r\n BillObj.DIVISION = this.TrnmainObj.DIVISION;\r\n BillObj.REMARKS = TenderObj.REMARKS, TenderObj.CARDNO;\r\n BillObj.AMOUNT = Amount;\r\n BillObj.ACCOUNT = TenderObj.ACID;\r\n BillObj.CARDNO = TenderObj.CARDNO;\r\n BillObj.APPROVALCODE = TenderObj.ApprovalCode;\r\n BillObj.CARDHOLDERNAME = TenderObj.CARDHOLDERNAME;\r\n this.BillTenderList.push(BillObj);\r\n // console.log('CheckTender', this.BillTenderList)\r\n }\r\n\r\n changeCardAmt(value) {\r\n\r\n this.form.patchValue({\r\n CARD: this._trnMainService.nullToZeroConverter(value),\r\n })\r\n // this.calculateTenderAmt = this._trnMainService.nullToZeroConverter(this.calculateTenderAmt)+ this._trnMainService.nullToZeroConverter(this.form.value.CARD);\r\n this.addAllAmount();\r\n this.validateTenderAmt();\r\n // console.log(\"cardvalue\", value, this.calculateTenderAmt);\r\n\r\n }\r\n changeChequeAmt(value) {\r\n this.form.patchValue({\r\n CHEQUE: this._trnMainService.nullToZeroConverter(value),\r\n })\r\n this.addAllAmount();\r\n //this.calculateTenderAmt =this._trnMainService.nullToZeroConverter(this.calculateTenderAmt)+ this._trnMainService.nullToZeroConverter(this.form.value.CHEQUE);\r\n this.validateTenderAmt();\r\n }\r\n\r\n changeCashAmt(value) {\r\n this.form.patchValue({\r\n CASH: this._trnMainService.nullToZeroConverter(value),\r\n })\r\n this.addAllAmount();\r\n // this.calculateTenderAmt =this._trnMainService.nullToZeroConverter(this.calculateTenderAmt)+ this._trnMainService.nullToZeroConverter(this.form.value.CASH);\r\n this.validateTenderAmt();\r\n }\r\n\r\n changeCreditAmt(value) {\r\n this.form.patchValue({\r\n CREDIT: this._trnMainService.nullToZeroConverter(value),\r\n\r\n })\r\n this.addAllAmount();\r\n // this.calculateTenderAmt =this._trnMainService.nullToZeroConverter(this.calculateTenderAmt)+ this._trnMainService.nullToZeroConverter(this.form.value.CREDIT);\r\n this.validateTenderAmt();\r\n }\r\n\r\n changeCouponAmt(value) {\r\n this.form.patchValue({\r\n COUPON: this._trnMainService.nullToZeroConverter(value),\r\n\r\n })\r\n this.addAllAmount();\r\n // this.calculateTenderAmt =this._trnMainService.nullToZeroConverter(this.calculateTenderAmt)+ this._trnMainService.nullToZeroConverter(this.form.value.COUPON);\r\n this.validateTenderAmt();\r\n }\r\n\r\n changeWalletAmt(value) {\r\n this.form.patchValue({\r\n WALLET: this._trnMainService.nullToZeroConverter(value),\r\n\r\n })\r\n this.addAllAmount();\r\n // this.calculateTenderAmt =this._trnMainService.nullToZeroConverter(this.calculateTenderAmt)+ this._trnMainService.nullToZeroConverter(this.form.value.WALLET);\r\n this.validateTenderAmt();\r\n }\r\n\r\n validateTenderAmt() {\r\n // if (this.calculateTenderAmt > this.TrnmainObj.NETAMNT) {\r\n // alert(\"Tender amount is Greater than NetAmount!\")\r\n\r\n // }\r\n this.form.patchValue({\r\n TENDERAMT: this.calculateTenderAmt,\r\n })\r\n this.BalanceAmt();\r\n }\r\n BalanceAmt() {\r\n this.form.patchValue({\r\n BALANCE: this.form.value.TOTAL - this.form.value.TENDERAMT\r\n })\r\n }\r\n // this.CASHAMT_Native.nativeElement.focus() \r\n Cash() { this.PaymentMode = \"cash\"; this.onpaymentmodechange('Cash'); }\r\n Card() { this.PaymentMode = \"card\"; this.onpaymentmodechange('Card') }\r\n Cheque() { this.PaymentMode = \"cheque\"; this.onpaymentmodechange('Cheque'); }\r\n Coupon() { this.PaymentMode = \"coupon\"; this.onpaymentmodechange('Coupon'); }\r\n Wallet() { this.PaymentMode = \"wallet\"; this.onpaymentmodechange('Wallet'); }\r\n EnterAmt() {\r\n this.CheckMixModeEnter()\r\n switch (this.PaymentMode) {\r\n\r\n case \"cash\":\r\n if (this.mixmode == true) {\r\n this.form.patchValue({\r\n CASHAMT: this.TrnmainObj.NETAMNT - this.form.value.TENDERAMT\r\n })\r\n }\r\n else {\r\n this.form.patchValue({\r\n CASHAMT: this.TrnmainObj.NETAMNT\r\n })\r\n }\r\n\r\n return;\r\n case \"card\":\r\n if (this.mixmode == true) {\r\n this.form.patchValue({\r\n CARDAMT: this.TrnmainObj.NETAMNT - this.form.value.TENDERAMT\r\n })\r\n }\r\n else {\r\n this.form.patchValue({\r\n CARDAMT: this.TrnmainObj.NETAMNT\r\n\r\n })\r\n }\r\n\r\n return;\r\n case \"cheque\":\r\n if (this.mixmode == true) {\r\n this.form.patchValue({\r\n CHEQUEAMT: this.TrnmainObj.NETAMNT - this.form.value.TENDERAMT\r\n })\r\n }\r\n else {\r\n this.form.patchValue({\r\n CHEQUEAMT: this.TrnmainObj.NETAMNT\r\n })\r\n }\r\n\r\n\r\n return;\r\n case \"coupon\":\r\n if (this.mixmode == true) {\r\n this.form.patchValue({\r\n COUPONAMT: this.TrnmainObj.NETAMNT - this.form.value.TENDERAMT\r\n })\r\n }\r\n else {\r\n this.form.patchValue({\r\n COUPONAMT: this.TrnmainObj.NETAMNT\r\n })\r\n }\r\n\r\n return;\r\n case \"wallet\":\r\n if (this.mixmode == true) {\r\n this.form.patchValue({\r\n WALLETAMT: this.TrnmainObj.NETAMNT - this.form.value.TENDERAMT\r\n })\r\n }\r\n else {\r\n this.form.patchValue({\r\n WALLETAMT: this.TrnmainObj.NETAMNT\r\n })\r\n }\r\n\r\n return;\r\n }\r\n\r\n this.BalanceAmt();\r\n }\r\n mixmode = false;\r\n CheckMixModeEnter() {\r\n if (this.form.value.TENDERAMT == this.form.value.NetAmount)\r\n return;\r\n this.form.value.NetAmount != this.form.value.TENDERAMT ? this.mixmode = true : this.mixmode = false;\r\n\r\n }\r\n ValueInitilize() {\r\n this.form.patchValue({\r\n CASH: 0,\r\n CREDIT: 0,\r\n CHEQUE: 0,\r\n WALLET: 0,\r\n CARD: 0,\r\n COUPON: 0,\r\n CASHAMT: 0,\r\n CARDAMT: 0,\r\n CARDNO: '',\r\n CARDNAME: '',\r\n APPROVALCODE: '',\r\n CARDHOLDERNAME: '',\r\n CREDITAMT: 0,\r\n CHEQUEAMT: 0,\r\n CHEQUENO: '',\r\n DATE: '',\r\n BANK: '',\r\n TOTAL: 0,\r\n OUTSTANDING: '',\r\n ADVANCE: '',\r\n TENDERAMT: 0,\r\n BALANCE: 0,\r\n LOYALTYAMT: 0,\r\n COUPONNAME: 0,\r\n COUPONAMT: 0,\r\n WALLETAMT: 0,\r\n WALLETTYPE: '',\r\n WALLETCARDNO: ''\r\n })\r\n }\r\n\r\n\r\n PaymentModeAcidObj: any = {};\r\n pushPaymentACID(value, selectedMode) {\r\n // console.log(\"AAA\", selectedMode)\r\n if (selectedMode == null) {\r\n return;\r\n }\r\n if (value == 'Cash') {\r\n this.PaymentModeAcidObj.CashID = selectedMode.ACID\r\n }\r\n if (value == 'Card') {\r\n this.PaymentModeAcidObj.CardID = selectedMode.ACID\r\n }\r\n if (value == 'Cheque') {\r\n this.PaymentModeAcidObj.ChequeID = selectedMode.ACID\r\n }\r\n if (value == 'Coupon') {\r\n this.PaymentModeAcidObj.CouponID = selectedMode.ACID\r\n }\r\n if (value == 'Wallet') {\r\n this.PaymentModeAcidObj.WalletID = selectedMode.ACID\r\n }\r\n }\r\n onpaymentmodechange(value) {\r\n // console.log(\"paymentcheck\", this._trnMainService.userProfile.CompanyInfo.ORG_TYPE, this._trnMainService.paymentmodelist);\r\n this._trnMainService.paymentAccountList = [];\r\n if (\r\n this._trnMainService.paymentmodelist == null ||\r\n this._trnMainService.paymentmodelist.length == 0\r\n ) {\r\n alert(\"Payment Modes not found\");\r\n return;\r\n }\r\n\r\n var selectedmode = this._trnMainService.paymentmodelist.filter(\r\n x =>\r\n (x.MODE == null ? \"\" : x.MODE).toUpperCase() ==\r\n // this._trnMainService.TrnMainObj.TRNMODE.toUpperCase()\r\n value.toUpperCase()\r\n )[0];\r\n // console.log(\"CheckaSelectedMode\", selectedmode)\r\n if (selectedmode == null) {\r\n console.log(\"Selected Mode not found...\");\r\n return;\r\n }\r\n this.pushPaymentACID(value, selectedmode);\r\n let modetype = selectedmode.MODETYPE;\r\n\r\n if (selectedmode.ACID != null && selectedmode.ACID != \"\") {\r\n this._trnMainService.TrnMainObj.TRNAC = selectedmode.ACID;\r\n } else {\r\n this._trnMainService.TrnMainObj.TRNAC = null;\r\n }\r\n\r\n if (modetype != null && modetype.toUpperCase() == \"LIST\") {\r\n this.masterService\r\n .masterGetmethod(\r\n \"/getpaymentmodelist/\" + value\r\n )\r\n .subscribe(\r\n res => {\r\n if (res.status == \"ok\") {\r\n this._trnMainService.paymentAccountList = JSON.parse(res.result);\r\n //console.log(\"accountlist\",this.AccountList);\r\n } else {\r\n console.log(\"error on getting paymentmode \" + res.result);\r\n }\r\n },\r\n error => {\r\n console.log(\"error on getting paymentmode \", error);\r\n }\r\n );\r\n }\r\n }\r\n addAllAmount() {\r\n this.calculateTenderAmt =\r\n this._trnMainService.nullToZeroConverter(this.form.value.COUPON) + this._trnMainService.nullToZeroConverter(this.form.value.WALLET) +\r\n this._trnMainService.nullToZeroConverter(this.form.value.CASH) + this._trnMainService.nullToZeroConverter(this.form.value.CHEQUE) + this._trnMainService.nullToZeroConverter(this.form.value.CARD);\r\n }\r\n\r\n setHotKeyFunction() {\r\n this._hotkeysService.add(\r\n new Hotkey(\r\n \"a\",\r\n (event: KeyboardEvent): boolean => {\r\n event.preventDefault();\r\n this.Cash();\r\n return false;\r\n }\r\n )\r\n );\r\n\r\n this._hotkeysService.add(\r\n new Hotkey(\r\n \"s\",\r\n (event: KeyboardEvent): boolean => {\r\n event.preventDefault();\r\n this.Card()\r\n return false;\r\n }\r\n )\r\n );\r\n \r\n this._hotkeysService.add(\r\n new Hotkey(\r\n \"f\",\r\n (event: KeyboardEvent): boolean => {\r\n event.preventDefault();\r\n this.Coupon()\r\n return false;\r\n }\r\n )\r\n );\r\n this._hotkeysService.add(\r\n new Hotkey(\r\n \"g\",\r\n (event: KeyboardEvent): boolean => {\r\n event.preventDefault();\r\n this.Wallet()\r\n return false;\r\n }\r\n )\r\n );\r\n this._hotkeysService.add(\r\n new Hotkey(\r\n \"o\",\r\n (event: KeyboardEvent): boolean => {\r\n event.preventDefault();\r\n this.OK()\r\n return false;\r\n }\r\n )\r\n );\r\n this._hotkeysService.add(\r\n new Hotkey(\r\n \"c\",\r\n (event: KeyboardEvent): boolean => {\r\n event.preventDefault();\r\n this.hide()\r\n return false;\r\n }\r\n )\r\n );\r\n }\r\n\r\n}\r\n\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/Sales/components/salesinvoice/generic-popup-Tender.component.ts","import { LoginService } from './loginService.service';\r\nimport { Component, Input, Output, EventEmitter, OnInit, ViewChild } from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { FormGroup, FormControl, FormBuilder, Validators, AbstractControl } from '@angular/forms';\r\nimport { Subscription } from \"rxjs/Subscription\";\r\nimport { ModalDirective } from 'ng2-bootstrap';\r\n\r\n@Component(\r\n {\r\n selector: 'SearchUser',\r\n template: require('./searchUser.component.html'),\r\n styles: [require('./forgetPassword.css')],\r\n }\r\n)\r\nexport class SearchUserComponent {\r\n public form: FormGroup;\r\n public email: AbstractControl;\r\n SendMail = true;\r\n DialogMessage: string = \" \";\r\n @ViewChild('childModal') childModal: ModalDirective;\r\n constructor(fb: FormBuilder, private route: ActivatedRoute, private router: Router, private loginService: LoginService) {\r\n this.form = fb.group({\r\n 'email': ['', Validators.compose([Validators.required, Validators.minLength(2)])],\r\n });\r\n this.email = this.form.controls['email'];\r\n this.SendMail = false;\r\n\r\n }\r\n SearchUser() {\r\n if (this.email.value == '') {\r\n alert(\"Please enter your username\")\r\n return\r\n }\r\n else {\r\n this.DialogMessage = \"Searching Account...\"\r\n this.childModal.show();\r\n this.loginService.username = this.email.value;\r\n this.loginService.ForgetPwd(this.email.value)\r\n .subscribe(\r\n data => {\r\n // console.log('saDATA', data)\r\n if (data.status == \"notfound\") {\r\n this.DialogMessage = \"Account not found\"\r\n this.childModal.show();\r\n setTimeout(() => {\r\n this.childModal.hide();\r\n }, 1000)\r\n this.form.patchValue({ email: \"\", })\r\n\r\n }\r\n else {\r\n if(data.result == null || data.result == ''){\r\n this.DialogMessage = \"Cannot find Email address. Please contact Adminstrator!\"\r\n this.childModal.show();\r\n setTimeout(() => {\r\n this.childModal.hide();\r\n }, 1000)\r\n }\r\n else{\r\n setTimeout(() => {\r\n this.childModal.hide();\r\n this.loginService.UsersObj = data;\r\n this.SendMail = this.loginService.sendMail = true;\r\n }, 2000)\r\n }\r\n \r\n\r\n }\r\n\r\n });\r\n }\r\n }\r\n Cancel() {\r\n this.loginService.loginpage = true;\r\n }\r\n clickedEnter(){\r\n this.SearchUser();\r\n }\r\n\r\n hideChildModal(){\r\n this.childModal.hide();\r\n this.loginService.UsersObj = {};\r\n this.loginService.loginpage = true;\r\n this.loginService.sendMail = false;\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/login/searchUser.component.ts","import { LoginService } from './loginService.service';\r\nimport { Component, Input, Output, EventEmitter, OnInit, ViewChild } from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { FormGroup, FormControl, FormBuilder, Validators, AbstractControl } from '@angular/forms';\r\nimport { Subscription } from \"rxjs/Subscription\";\r\nimport { ModalDirective } from 'ng2-bootstrap';\r\n@Component(\r\n {\r\n selector: 'SendEmail',\r\n template: require('./sendEmail.component.html'),\r\n styles: [require('./forgetPassword.css')],\r\n }\r\n)\r\nexport class SendEmailComponent {\r\n securityCode=true;\r\n email:any;\r\n constructor(fb: FormBuilder, private route: ActivatedRoute, private router: Router, private loginService: LoginService) {\r\n this.securityCode=false;\r\n this.email=this.loginService.UsersObj.result;\r\n // console.log(\"this Eai\",this.email)\r\n }\r\n sendmail(){\r\n this.loginService.securityCode=true;\r\n this.loginService.sendEmail(this.email).subscribe(res=>{\r\n \r\n // this.loginService.getTokenAfterSendEmail('','')\r\n // .subscribe(res=>{\r\n // if(res && res.token){\r\n // this.loginService.securityCode=true;\r\n // }\r\n // })\r\n })\r\n \r\n this.loginService.email=this.email;\r\n // console.log(\"SendMail\",this.email);\r\n }\r\n Cancel(){\r\n this.loginService.loginpage=true;\r\n this.loginService.sendMail=false;\r\n }\r\n Nolonger(){\r\n alert(\"If you dont have access to the email. Please contact your adminstration for new password.\")\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/login/sendEmail.component.ts","import { NgaModule } from '../../../theme/nga.module';\r\nimport { Component, Inject } from '@angular/core';\r\nimport { MdDialogRef, MD_DIALOG_DATA, MdDialog } from '@angular/material';\r\nimport { Observable } from \"rxjs/Observable\";\r\nimport { MasterRepo } from \"../../../common/repositories/masterRepo.service\";\r\nimport { DialogInfo } from \"../../../common/interfaces/TrnMain\";\r\nimport { MessageDialog } from \"../messageDialog/messageDialog.component\";\r\n\r\n\r\n@Component({\r\n selector: 'dispatch-dialog',\r\n template: `\r\n
\r\n
\r\n
\r\n
×
\r\n

Dispatch List

\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Voucher No.DivisionTrn. A/CFiscal YearDateMiti
{{d.VCHRNO}}{{d.DIVISION}}{{d.TRNAC}}{{d.PhiscalID}}{{d.TRNDATE}}{{d.BSDATE}}
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n`,\r\n styles: [`\r\n tr th{\r\n padding: 5px 2px;\r\n cursor: default;\r\n font-weight: bold;\r\n background-color: #FFFFFF;\r\n }\r\n\r\n tr td{\r\n padding: 0px 2px;\r\n border-top: 0px;\r\n line-height: 31px;\r\n }\r\n\r\n tbody tr:hover {\r\n background-color: #e0e0e0;\r\n }\r\n .table tr.active td {\r\n background-color:#123456 !important;\r\n color: white;\r\n}\r\n`]\r\n})\r\nexport class DispatchDialog {\r\n dispatchList: Array = [];\r\n selectedRow: any;\r\n selectedRowIndex = -1;\r\n constructor(public dialogref: MdDialogRef, @Inject(MD_DIALOG_DATA) public data: DialogInfo, private masterService: MasterRepo,public dialog: MdDialog) {\r\n let response: Array = [];\r\n if (data) {\r\n // let dialogRef = this.dialog.open(MessageDialog, { hasBackdrop: true, data: {header:'Loading...',message:'Loading Data Please wait...'} });\r\n this.masterService.getSalesModeList(data).subscribe(res => {\r\n if (res.status == \"ok\") {\r\n\r\n response = res.result;\r\n if (data.PARAC && data.SALESMODE=='delivery') {\r\n response = response.filter(x => x.PARAC == data.PARAC);\r\n\r\n }\r\n this.dispatchList = response;\r\n // dialogRef.close();\r\n }\r\n }, error => {\r\n this.masterService.resolveError(error, \"dispatchDialog - getDispatchList\");\r\n });\r\n\r\n\r\n\r\n }\r\n\r\n }\r\n\r\n rowClick(row, index) {\r\n this.selectedRow = row;\r\n this.selectedRowIndex = index;\r\n }\r\n onsubmit() {\r\n this.dispatchResult('ok');\r\n }\r\n public dispatchResult(res) {\r\n this.dialogref.close({ status: res, selectedRow: this.selectedRow });\r\n }\r\n\r\n}\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/modaldialogs/dispatchDialog/dispatchDialog.component.ts","export * from './logindialog/logindialog.component'\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/modaldialogs/index.ts","import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';\r\nimport { MasterRepo } from \"./../common/repositories/masterRepo.service\";\r\nimport { Routes } from '@angular/router';\r\n\r\nimport { BaMenuService } from '../theme';\r\nimport { PAGES_MENU_NESTLE } from './pages.menu';\r\nimport { NotificationPopUpComponent } from '../common/popupLists/notification/notification-popup-grid.component';\r\n\r\n@Component({\r\n selector: 'pages',\r\n template: `\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{notificationCount}}\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n `\r\n})\r\nexport class Pages implements OnInit, AfterViewInit {\r\n\r\n @ViewChild(\"notification\") notification: NotificationPopUpComponent;\r\n notificationCount: number = 0;\r\n isActive: boolean = false;\r\n public appType;\r\n\r\n constructor(\r\n private masterRepService: MasterRepo,\r\n private _menuService: BaMenuService\r\n ) {\r\n this.appType = this.masterRepService.appType;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.getNotificationCount();\r\n }\r\n\r\n ngOnInit() {\r\n // if (this.appType == 2) {\r\n this._menuService.updateMenuByRoutes(PAGES_MENU_NESTLE);\r\n // } else {\r\n //this._menuService.updateMenuByRoutes(PAGES_MENU);\r\n // }\r\n this.masterRepService.getCurrentDate().subscribe(date => { });\r\n }\r\n\r\n toggleNotificationPopup() {\r\n this.masterRepService.disableQuantityEdit = true;\r\n \r\n this.notification.toggle();\r\n }\r\n\r\n getNotificationCount() {\r\n this.notification.getNotificationCount();\r\n }\r\n\r\n updateNotificationCount(count) {\r\n // console.log(\"notification Count\",count)\r\n this.notificationCount = count;\r\n }\r\n\r\n updateNotification() {\r\n this.notification.refresh();\r\n }\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// node_modules/angular2-template-loader!./src/app/pages/pages.component.ts","module.exports = \"
\\r\\n
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n

Sign in

\\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

Information

\\r\\n
\\r\\n
\\r\\n {{DialogMessage}}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/login/login.html\n// module id = 498\n// module chunks = 22","// style-loader: Adds some css to the DOM by adding a \\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
{{printData?.COMPANYNAME}}
Branch Office:{{printData?.COMPANYADDRESS}}
Tel:{{printData?.TELA}}Fax:0
VAT No.:{{printData?.VAT}}Tax Invoice
{{printCopyCaption}}
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Bill Number:{{printData?.TRNMAIN?.VCHRNO}}Date: {{printData?.TRNMAIN?.TRNDATE.substring(0,10)}}   [{{printData?.TRNMAIN?.BSDATE}}]   {{printData?.TRNMAIN?.TRNTIME}}
Ref. Bill Number:{{printData?.TRNMAIN?.REFBILL}}Remarks: {{printData?.TRNMAIN?.REMARKS}}
Customer Name:{{printData?.TRNMAIN?.BILLTO}} BillType:
Customer Address:{{printData?.TRNMAIN?.BILLTOADD}} Due Date:{{printData?.TRNMAIN?.DUEDATE}}
Vat Reg. No:{{printData?.TRNMAIN?.BILLTOTEL}} Due Miti:{{printData?.TRNMAIN?.DUEDATE}}
   Payment :  {{printData?.TRNMAIN?.TRNMODE}}
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Sno:Part Number:Particulars:Qty.RateAmount
{{item?.SNO}}{{item?.MCODE}}{{item?.ITEMDESC}} {{item?.Quantity}}{{item?.REALRATE}}{{item?.AMOUNT | twoDigitNumber}}
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
 Total:{{printData?.TRNMAIN?.TOTAMNT | twoDigitNumber}}
 Discount:{{printData?.TRNMAIN?.DCAMNT | twoDigitNumber}}
 Service Charge:00
 Taxable Amount:{{printData?.TRNMAIN?.TAXABLE | twoDigitNumber}}
 VAT 13%:{{printData?.TRNMAIN?.VATAMNT | twoDigitNumber}}
 Rounded off:{{printData?.TRNMAIN?.ROUNDOFF | twoDigitNumber}}
In words : Rupees {{_transactionService.digitToWord(_transactionService.TrnMainObj.NETAMNT)}}Grand Total:{{printData?.TRNMAIN?.NETAMNT | twoDigitNumber}}
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n

Terms and Conditions:

\\r\\n
  
\\r\\n

1.Please pay via A/C payee Cheques/Drafts only.

\\r\\n
 
\\r\\n

2.Endoresement of payment should be its reliasation only.

\\r\\n
 
Received By Checked by
Printed By : {{printData?.TRNMAIN?.TRNUSER}}
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
{{printData?.COMPANYNAME}}
Branch Office:{{printData?.COMPANYADDRESS}}
Tel:{{printData?.TELA}}Fax:0
VAT No.:{{printData?.VAT}} {{InvoiceType}}
{{printCopyCaption}}
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Bill Number:{{printData?.TRNMAIN?.VCHRNO}}Date: {{printData?.TRNMAIN?.TRNDATE.substring(0,10)}}   [{{printData?.TRNMAIN?.BSDATE}}]   {{printData?.TRNMAIN?.TRNTIME}}
Ref. Bill Number:{{printData?.TRNMAIN?.REFBILL}}Remarks: {{printData?.TRNMAIN?.REMARKS}}
Customer Name:{{printData?.TRNMAIN?.BILLTO}} BillType:
Customer Address:{{printData?.TRNMAIN?.BILLTOADD}} Due Date:{{printData?.TRNMAIN?.DUEDATE}}
Vat Reg. No:{{printData?.TRNMAIN?.BILLTOTEL}} Due Miti:{{printData?.TRNMAIN?.DUEDATE}}
   Payment :  {{printData?.TRNMAIN?.TRNMODE}}
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Sno:Part Number:Particulars:Qty.RateAmount
{{item?.SNO}}{{item?.MCODE}}{{item?.ITEMDESC}} {{item?.Quantity}}{{item?.REALRATE}}{{item?.AMOUNT | twoDigitNumber}}
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
 Total:{{printData?.TRNMAIN?.TOTAMNT | twoDigitNumber}}
 Discount:{{printData?.TRNMAIN?.DCAMNT | twoDigitNumber}}
 Service Charge:00
 Taxable Amount:{{printData?.TRNMAIN?.TAXABLE | twoDigitNumber}}
 VAT 13%:{{printData?.TRNMAIN?.VATAMNT | twoDigitNumber}}
 Rounded off:{{printData?.TRNMAIN?.ROUNDOFF | twoDigitNumber}}
In words : Rupees {{_transactionService.digitToWord(_transactionService.TrnMainObj.NETAMNT)}}Grand Total:{{printData?.TRNMAIN?.NETAMNT | twoDigitNumber}}
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n

Terms and Conditions:

\\r\\n
  
\\r\\n

1.Please pay via A/C payee Cheques/Drafts only.

\\r\\n
 
\\r\\n

2.Endoresement of payment should be its reliasation only.

\\r\\n
 
   
Received By Checked by
Printed By : {{printData?.TRNMAIN?.TRNUSER}}
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Invoice/invoicePrint.component.html\n// module id = 861\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n

 

\\r\\n

{{printData?.COMPANYNAME}}

\\r\\n

{{printData?.COMPANYADDRESS}}

\\r\\n

PAN : {{printData?.VAT}}

\\r\\n

{{InvoiceType}}

\\r\\n

{{printCopyCaption}}

\\r\\n

\\r\\n

 

\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
Customer Name:{{printData?.TRNMAIN?.BILLTO}}Bill Number:{{printData?.TRNMAIN?.VCHRNO}}
Address:{{printData?.TRNMAIN?.BILLTOADD}}  BIll Date:{{printData?.TRNMAIN?.TRNDATE}}   [{{printData?.TRNMAIN?.BSDATE}}]
Ref. Job Sheet# {{printData?.TRNMAIN?.BILLTOTEL}}Model:X40Ref. IMEI:{{printData?.TRNMAIN?.REFBILLQTY}}
         
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
Sno:Part Number:Particulars:Rate.QuantityTotal
{{item.SNO}}{{item.MCODE}}{{item.ITEMDESC}} {{item.RATE| twoDigitNumber}}{{item.Quantity}}{{item.AMOUNT| twoDigitNumber}}
\\r\\n
\\r\\n

\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
 Total:{{printData?.TRNMAIN?.TOTAMNT | twoDigitNumber}}
 Discount:{{printData?.TRNMAIN?.DCAMNT | twoDigitNumber}}
 Service Charge00.00
 Final Amount{{printData?.TRNMAIN?.NETAMNT | twoDigitNumber}}
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
 Tax : 13.00%   
    
Cashier: {{printData?.TRNMAIN?.TRNUSER}} Signature:
Time   :   {{printData?.TRNMAIN?.TRNTIME}}
\\r\\n\\r\\n

 

\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Invoice/purchasePrint.component.html\n// module id = 862\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n\\r\\n\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/InventoryParameters.html\n// module id = 863\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n Case\\r\\n \\r\\n \\r\\n Each\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n
S.No.CodeDescriptionBatchNo\\r\\n Exp Date\\r\\n CaseEachCaseEachRateAmtDis%Dis AmtSupplierF. DisS. DisR. DisMRPVATNet AmtApproval FlagApprovalRemarks
{{i+1}}\\r\\n {{tList.MENUCODE?tList.MENUCODE:tList.MCODE}}\\r\\n\\r\\n \\r\\n \\r\\n Press ENTER or TAB to\\r\\n Select Item and Add Alphabet to Search\\r\\n {{tList.ITEMDESC}}\\r\\n \\r\\n \\r\\n \\r\\n press ENTER or TAB to\\r\\n Select Batch{{tList.BATCH}}{{tList.EXPDATE | date: 'dd-MM-yyyy'}}{{tList.ALTERNATEQUANTIY}}\\r\\n {{tList.BASEQUANTITY}}\\r\\n \\r\\n \\r\\n press ENTER or TAB to\\r\\n Select Batch\\r\\n \\r\\n {{_trnMainService.nullToZeroConverter(tList.ALTRATE) | twoDigitNumber}}\\r\\n \\r\\n {{_trnMainService.nullToZeroConverter(tList.AMOUNT) | twoDigitNumber}}\\r\\n \\r\\n {{tList.INDDISCOUNTRATE |twoDigitNumber }}\\r\\n {{tList.INDDISCOUNTRATE |twoDigitNumber }}\\r\\n \\r\\n {{tList.INDDISCOUNT |twoDigitNumber }}\\r\\n \\r\\n {{tList.ACNAME}}\\r\\n {{_trnMainService.nullToZeroConverter(tList.PrimaryDiscount)|twoDigitNumber}}\\r\\n {{_trnMainService.nullToZeroConverter(tList.SecondaryDiscount)|twoDigitNumber}}\\r\\n {{_trnMainService.nullToZeroConverter(tList.LiquiditionDiscount) |twoDigitNumber}}\\r\\n \\r\\n {{tList.MRP|twoDigitNumber}}\\r\\n {{_trnMainService.nullToZeroConverter(tList.VAT) |twoDigitNumber}}\\r\\n {{_trnMainService.nullToZeroConverter(tList.NETAMOUNT)|twoDigitNumber}}\\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

Information

\\r\\n
\\r\\n
\\r\\n {{DialogMessage}}\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/ProductInsert.html\n// module id = 864\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.TRNDATE | date: 'dd-MM-yyyy' }}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.AdditionalObj.DUEDATE | date: 'dd-MM-yyyy' }}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

Sales Return Type

\\r\\n
\\r\\n
\\r\\n
\\r\\n Full Bill Return
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/TrnMainParameters.html\n// module id = 865\n// module chunks = 22","module.exports = \"
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/VATnoEntry.component.html\n// module id = 866\n// module chunks = 22","module.exports = \" \\r\\n \\r\\n\\r\\n {{appType==2?'PRINT F8':'F8 Print'}}\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

Available Printing Device Supported

\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n Cannon printer [A4]
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/account-master-action.component.html\n// module id = 867\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n

Total:

\\r\\n
\\r\\n \\r\\n {{ _trnMainService.drTotal}} Dr.\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {{ _trnMainService.crTotal }} Cr.\\r\\n \\r\\n \\r\\n \\r\\n {{ _trnMainService.drTotal }} Dr.\\r\\n\\r\\n {{ _trnMainService.crTotal }} Cr. \\r\\n \\r\\n [ {{ _trnMainService.differenceAmount }}\\r\\n ]\\r\\n  \\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/account-voucher-summary.component.html\n// module id = 868\n// module chunks = 22","module.exports = \" \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/opening-balance-action.component.html\n// module id = 869\n// module chunks = 22","module.exports = \".picecalc-container {\\r\\n position: absolute;\\r\\n /* top: 20%; */\\r\\n width: 25%;\\r\\n background: white;\\r\\n left: 38%;\\r\\n border: 3px solid black;\\r\\n}\\r\\n\\r\\n.table>tbody>tr>td {\\r\\n line-height: 30px !important;\\r\\n font-size: 12px;\\r\\n}\\r\\n\\r\\n.table>thead>tr>th {\\r\\n line-height: 5px !important;\\r\\n background: #209e91;\\r\\n font-size: 14px;\\r\\n font-weight: bold;\\r\\n}\\r\\n\\r\\ntable tr:nth-child(odd) td {\\r\\n /* background: #add8e6; */\\r\\n}\\r\\n\\r\\ntable tr:nth-child(even) td {\\r\\n background: #fff;\\r\\n}\\r\\n\\r\\ninput{\\r\\n border: 1px solid #cbcbcb;\\r\\n border-radius: 3px;\\r\\n height: 3vh;\\r\\n color: black;\\r\\n text-align: right;\\r\\n padding-right: 5px;\\r\\n}\\r\\n\\r\\n.desc-class{\\r\\n text-align: left !important;\\r\\n}\\r\\n\\r\\n.header-class{\\r\\n color: white;\\r\\n text-align: center;\\r\\n}\\r\\n\\r\\n.number-class{\\r\\n text-align: right;\\r\\n}\\r\\n\\r\\n.popup-showmore{\\r\\n top:-30%;\\r\\n}\\r\\n\\r\\n.popup-regular{\\r\\n top: 10%;\\r\\n}\\r\\n\\r\\n.product-details {\\r\\n font-size: 14px;\\r\\n font-weight: bold;\\r\\n margin-left: 5%;\\r\\n}\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/pricecalculator/price-calculatorpopup.component.css\n// module id = 870\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
Total Invoice Value
Excise Duty
Insurance
Assesable Value for Custom Duty
Custom Duty
Assesable Value for Anta Shulka
Anta Shulka
Service Charge
Others
Cost Before VAT
Invoice Qty
Landed Cost Per Rate
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/pricecalculator/price-calculatorpopup.component.html\n// module id = 871\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n Settlement Mode\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/trnmain-branch.component.html\n// module id = 872\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/trnmain-note-itembase-entry.component.html\n// module id = 873\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n press ENTER or TAB to Select Supplier\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n  \\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.TRN_DATE | date: 'dd-MM-yyyy' }}\\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.TRN_DATE | date: 'dd-MM-yyyy' }}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n  Unit\\r\\n      \\r\\n           Case\\r\\n            Each\\r\\n       \\r\\n
\\r\\n \\r\\n  Bill Format\\r\\n      \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.VCHRNO }}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.TRN_DATE | date: 'dd-MM-yyyy'}}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.AdditionalObj.RECEIVEDDATE | date: 'dd-MM-yyyy' }}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.REFBILL }}\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n {{ _trnMainService.TrnMainObj.REFORDBILL }}\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/trnmain-purchase.component.html\n// module id = 874\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n {{_transactionService.TrnMainObj.VCHRNO}}\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
{{EntryDate.DATE3}}
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n  A.D \\r\\n  B.S\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n  A.D \\r\\n \\r\\n  B.S\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n {{EntryDate.PhiscalADDate}}\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n {{VoucherEntry.DATE1}}\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n Exclude Transaction in Tax Report\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/trnmain-voucher-entry.component.html\n// module id = 875\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n
SNo.Ledger A/C\\r\\n Sub Ledger A/C\\r\\n \\r\\n Dr Amount\\r\\n \\r\\n Amount\\r\\n \\r\\n Cr Amount\\r\\n \\r\\n Amount\\r\\n \\r\\n Adjustment\\r\\n Cost CenterNarrationTrn TypeTrn ModeReceipt ModePay Mode\\r\\n NumberDate\\r\\n
\\r\\n \\r\\n {{ i + 1 }}.\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n {{ t.AccountItem?.ACNAME }}\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n {{ t.SL_ACNAME }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n {{ t.CostCenter }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
{{ t.NARATION }}
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
{{ t.ChequeNo }}
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
SNo.Subledger NameDr AmountCr Amount
{{ i + 1 }}.\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n {{ sl.SubledgerItem.ACNAME }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n {{ sl.DRAMNT }}\\r\\n
\\r\\n
\\r\\n {{ sl.CRAMNT }}\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n ( {{ sl.NARATION }} )\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
SNo.Subledger NameDr AmountCr Amount
\\r\\n \\r\\n \\r\\n {{ tList.AccountItem?.ACNAME }}:\\r\\n
\\r\\n {{ j + 1 }}.\\r\\n \\r\\n {{ sList.SubledgerItem.ACNAME }}\\r\\n \\r\\n {{ sList.DRAMNT }}\\r\\n \\r\\n {{ sList.CRAMNT }}\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n Party Type:\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/trntran-voucher-entry.component.html\n// module id = 876\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n

{{modeTitle}} {{_trnMainService.pageHeading}}

\\r\\n

Add Additional Cost

\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n A.D.\\r\\n B.S.\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n A.D. \\r\\n B.S.\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n Show More! \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/voucher-date.component.html\n// module id = 877\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n Excel Upload\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n VIEW F4\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n SAVE F6\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n SALESMAN F2\\r\\n\\r\\n\\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

Available Printing Device Supported

\\r\\n
\\r\\n
\\r\\n \\r\\n POS Printer
\\r\\n Cannon\\r\\n Printer [Full Print(A4)]
\\r\\n \\r\\n \\r\\n POS Printer
\\r\\n Cannon\\r\\n Printer [Half Print(A5)]
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

Available Schemes

\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n
SCHEME APPLYSCHEME NOSCHEMETYPEBUDGETPRORATAQPSAREABUDGETABOVEQTYUNITVALUEVALUETYPEDISCOUNTAMOUNTR
\\r\\n \\r\\n {{item.schemeno}} {{item.schemetype}} {{item.budget}} {{item.prorata}} {{item.qps}} {{item.areabudget}} {{item.aboveqty}} {{item.unit}} {{item.value}} {{item.valuetype}} {{item.discountamount | twoDigitNumber}} {{item.SCHEMETYPE}}
\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/voucher-master-action.component.html\n// module id = 878\n// module chunks = 22","module.exports = \"\\r\\nShow Detail [F1]\\r\\nHide Detail [F1]\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/voucher-master-toggler.component.html\n// module id = 879\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/voucher-message-remarks.component.html\n// module id = 880\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n {{_trnMainService.voucherNoHeader}}:\\r\\n {{ _trnMainService.TrnMainObj.CHALANNO }}\\r\\n \\r\\n \\r\\n Bill Date:\\r\\n \\r\\n {{ _trnMainService.TrnMainObj.TRN_DATE | date: \\\"dd-MM-yyyy\\\" }}\\r\\n \\r\\n \\r\\n \\r\\n BS Date:\\r\\n \\r\\n {{ _trnMainService.TrnMainObj.BS_DATE}}\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n Dis%\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Dis Amount:\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Total Disc\\r\\n \\r\\n {{ _trnMainService.TrnMainObj.TOTALDISCOUNT | twoDigitNumber }}\\r\\n \\r\\n \\r\\n {{_trnMainService.TrnMainObj.TOTALDISCOUNT_VATINCLUDED | twoDigitNumber}}\\r\\n \\r\\n \\r\\n \\r\\n Round off Amount:\\r\\n \\r\\n \\r\\n \\r\\n Taxable Amount:\\r\\n {{ _trnMainService.TrnMainObj.TAXABLE | twoDigitNumber }}\\r\\n \\r\\n \\r\\n \\r\\n Total {{appType==2?'VAT:':'GST:'}}\\r\\n {{ _trnMainService.TrnMainObj.VATAMNT | twoDigitNumber }}\\r\\n \\r\\n \\r\\n Rounding Adj:\\r\\n {{ _trnMainService.TrnMainObj.ROUNDOFF | twoDigitNumber }}\\r\\n \\r\\n \\r\\n Net Amount:\\r\\n {{ _trnMainService.TrnMainObj.NETWITHOUTROUNDOFF | twoDigitNumber }}\\r\\n \\r\\n \\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/voucher-sidebar-billdetail.component.html\n// module id = 881\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
Total Quantity: {{ _trnMainService.TrnMainObj.totalAlternateQuantity | twoDigitNumber }} Case
\\r\\n
Total Quantity: {{ _trnMainService.TrnMainObj.totalBaseQuantity | twoDigitNumber }} Each
\\r\\n
\\r\\n
\\r\\n
Total Weight: {{ _trnMainService.TrnMainObj.TOTALWEIGHT | twoDigitNumber }} Kg
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
Taxable Amount: {{ _trnMainService.TrnMainObj.TAXABLE | twoDigitNumber }} \\r\\n
\\r\\n
\\r\\n
\\r\\n
Total VAT: {{ _trnMainService.TrnMainObj.VATAMNT | twoDigitNumber }}
\\r\\n
\\r\\n
\\r\\n
Net Amt: {{ _trnMainService.TrnMainObj.NETWITHOUTROUNDOFF | twoDigitNumber }}
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/Transaction Components/voucher-total-area.component.html\n// module id = 882\n// module chunks = 22","module.exports = \"
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/nepali-date-picker/nepali-date-picker.component.html\n// module id = 883\n// module chunks = 22","module.exports = \"
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n

Batch Info.

\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Batch No.MfgExpSTOCK[CASE]STOCK[EACH]MRPLanding Cost
\\r\\n {{BObject.BATCH}}{{BObject.MFGDATE | date}}{{BObject.EXPIRY |date}}{{BObject.CASE}}{{BObject.EACH}}{{BObject.MRP | number : '1.2-2' }}{{BObject.CaseLandingCost | number : '1.2-2' }}{{BObject.IMPSELLINGPRICE | number : '1.2-2' }}
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/PopBatchList/PopBatch.html\n// module id = 884\n// module chunks = 22","module.exports = \"\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n PRODUCTS\\r\\n

\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
DESCRIPTION CODE STOCKMRP
{{ item.DESCA }} {{ item.MENUCODE }} {{ item.STOCK }} {{ item.MRP }}
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/PopItemList/PopItems.html\n// module id = 885\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n

{{masterService.partyPopUpHeaderText}}

\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
NameCodeAddressEmail
{{itemObj.ACNAME}}{{itemObj.ACCODE}}{{itemObj.ADDRESS}}{{itemObj.EMAIL}}
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/PopPartyList/popPartyList.html\n// module id = 886\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n

{{title}}

\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Scheme NameScheme TypeDiscountDis. Type
{{itemObj.schemeName}}{{itemObj.schemeType}}{{itemObj.discountRateType==2?'Buy '+ itemObj.minQty + 'Get '+itemObj.schemeDisRate +' free': itemObj.schemeDisRate}}{{itemObj.discountRateType==0?'%':itemObj.discountRateType==1?'Amount':itemObj.discountRateType==2?'Quantity':'Type Not Found'}}
\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/PopScheme/popscheme.html\n// module id = 887\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n

{{title}}

\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
Name
\\r\\n {{CObject.MENUCAT}}
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/PopupCategoryList/PopCategory.html\n// module id = 888\n// module chunks = 22","module.exports = \"
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n

{{title}}

\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n New Batch :\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n
Batch No.MFGExpiryUnitCost PriceSell Price
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {{BatchObj.PRATE}}\\r\\n \\r\\n \\r\\n {{BatchObj.SRATE}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n Existing Batch :\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Batch No.ExpiryMfrSell PriceStockMRP
\\r\\n {{BObject.BCODE}}{{BObject.EXPIRY | date}}{{BObject.MFGDATE |date}}\\r\\n {{BObject.SRATE |twoDigitNumber}}{{BObject.STOCK}}{{BObject.MRP}}
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/PopupItemGrpList/PopItemGrp.html\n// module id = 889\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n {{ popupsettings.title }}\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n Choose a File or Drag it Here.\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Clear\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n Browse\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n Upload\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
Note
\\r\\n
\\r\\n
\\r\\n

\\r\\n Download the sample template to get started.\\r\\n

\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
SN.Filename
\\r\\n {{ i + 1 }}\\r\\n {{ item }}
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/file-uploader/file-uploader-popup.component.html\n// module id = 890\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n {{ popupsettings.title }}\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
{{ item.title }}
\\r\\n
\\r\\n {{ itemObj[item.key] }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/generic-grid/generic-popup-grid.component.html\n// module id = 891\n// module chunks = 22","module.exports = \".importdetail_container {\\r\\n position: fixed !important;\\r\\n transform: translate(-50px, -50px);\\r\\n /* min-height: calc(100vh - 60px); */\\r\\n background: #ffffff;\\r\\n z-index: 99999;\\r\\n width: 80%;\\r\\n top: 20.5%;\\r\\n left: 14%;\\r\\n }\\r\\n \\r\\n .page-title {\\r\\n text-align: center;\\r\\n }\\r\\n \\r\\n .form-control {\\r\\n font-size: 12px;\\r\\n height: 25px;\\r\\n }\\r\\n \\r\\n .button-group {\\r\\n position: absolute;\\r\\n right: 3%;\\r\\n top: 3%;\\r\\n }\\r\\n \\r\\n .card-body {\\r\\n line-height: 0.4rem;\\r\\n padding: 0px 10px;\\r\\n }\\r\\n \\r\\n .table td,\\r\\n.table th {\\r\\n padding: 2px 4px 5px 4px !important;\\r\\n}\\r\\n\\r\\ntbody td{\\r\\n border: 1px solid #e6e6e6;\\r\\n padding-left: 2px;\\r\\n}\\r\\n\\r\\n th {\\r\\n font-size: 13px;\\r\\n padding-left: 2px;\\r\\n}\\r\\n\\r\\ntd {\\r\\n font-size: 13px;\\r\\n}\\r\\n\\r\\ntable\\r\\ninput,select{\\r\\n width: 95%;\\r\\n margin-left: 2px;\\r\\n}\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/import-purchase-details/import-purchase-details.component.css\n// module id = 892\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n
IMPORT DOCUMENT DETAILS
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n
Sn.Item NameQtyTaxableNon-TaxableVATNet amount
{{i+1}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
TOTAL\\r\\n {{_trnMainService.TrnMainObj.IMPORTDETAILS.TOTALQTY}} \\r\\n {{_trnMainService.TrnMainObj.IMPORTDETAILS.TOTALTAXABLE}} \\r\\n {{_trnMainService.TrnMainObj.IMPORTDETAILS.TOTALNONTAXABLE}}\\r\\n {{_trnMainService.TrnMainObj.IMPORTDETAILS.TOTALVAT}}\\r\\n {{_trnMainService.TrnMainObj.IMPORTDETAILS.NETAMOUNT}}
\\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/import-purchase-details/import-purchase-details.component.html\n// module id = 893\n// module chunks = 22","module.exports = \"\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n {{ popupsettings.title }}\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
{{ item.title }}
\\r\\n
\\r\\n {{ itemObj[item.key] }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/multiple-price-popup/multiple-price-popup-grid.component.html\n// module id = 894\n// module chunks = 22","module.exports = \"\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n {{ popupsettings.title }}\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
{{ item.title }}
\\r\\n
\\r\\n {{ itemObj[item.key] }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/new-generic-grid-approved/new-generic-popup-grid-approved.component.html\n// module id = 895\n// module chunks = 22","module.exports = \"\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n {{ popupsettings.title }}\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
{{ item.title }}
\\r\\n
\\r\\n {{ itemObj[item.key] }}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/new-generic-grid/new-generic-popup-grid.component.html\n// module id = 896\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n

\\r\\n {{ popupsettings.title }}\\r\\n

\\r\\n
\\r\\n
\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n

    \\r\\n {{itemObj.MESSAGE}} \\r\\n

    \\r\\n \\r\\n

    {{itemObj.TIMESTAMP | date:'medium'}}

    \\r\\n

    OUTLETNAME: {{itemObj.ACNAME}}     SALESMANNAME: {{itemObj.SALESMANNAME}}

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n No notifications\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/notification/notification-popup-grid.component.html\n// module id = 897\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n Party Opening Details\\r\\n

\\r\\n
\\r\\n 0\\\"\\r\\n >\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
SN.VOUCHER No.VOUCHER DATEAMTCLEAR AMTDUE AMTDUE DATE
{{ i + 1 }}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n Invalid Configuration detected.\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/popupLists/party-opening-details-popup/party-opening-details-popup.component.html\n// module id = 898\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {{ displayHeading }}\\r\\n

\\r\\n
\\r\\n
\\r\\n

{{ displayMessage }}

\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/services/alert/directives/alert.component.html\n// module id = 899\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {{ displayHeading }}\\r\\n

\\r\\n
\\r\\n
\\r\\n

{{ displayMessage }}

\\r\\n
\\r\\n
\\r\\n \\r\\n OK\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/services/navigation-perventor/directives/navigation-preventor.component.html\n// module id = 900\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

{{ displayMessage }}

\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/common/services/spinner/directives/spinner.component.html\n// module id = 901\n// module chunks = 22","module.exports = \"\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n  \\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
Gross Amount \\r\\n \\r\\n\\r\\n \\r\\n
Taxable Amount \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n
Non Taxable Amount \\r\\n \\r\\n \\r\\n
VAT Amount \\r\\n \\r\\n \\r\\n
Net Amount \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/Purchases/components/DebitNoteAccountWise/FooterwithIncludedVAT.component.html\n// module id = 902\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n New Customer\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/Sales/components/salesinvoice/AddCustomerPopup.html\n// module id = 903\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n

\\r\\n Transporter Info\\r\\n

\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/Sales/components/salesinvoice/Transport-popup.html\n// module id = 904\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n

\\r\\n Tender\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/Sales/components/salesinvoice/generic-popup-Tender.html\n// module id = 905\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Enter Security Code

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
Please check your email for a message with your code. Your code is 6 numbers long.
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
We sent your code to:
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n Password must be at least 6 characters long.\\r\\n
\\r\\n
\\r\\n {{form.controls['NEWPASSWORD'].errors['passwordStrength']}}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Didn't get a code?

\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

Information

\\r\\n
\\r\\n
\\r\\n {{DialogMessage}}\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/login/enterSecurityCode.component.html\n// module id = 906\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Choose a new password

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
A strong password is a combination of letters and punctuation marks!\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n Password must be at least 6 characters long.\\r\\n
\\r\\n
\\r\\n {{form.controls['NEWPASSWORD'].errors['passwordStrength']}}\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n Please do not close this tab!\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

Information

\\r\\n
\\r\\n
\\r\\n {{DialogMessage}}\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/login/newPassword.component.html\n// module id = 907\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Find Your Account

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
Please enter your username to search for your account.
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n

Information

\\r\\n
\\r\\n
\\r\\n {{DialogMessage}}\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/login/searchUser.component.html\n// module id = 908\n// module chunks = 22","module.exports = \"\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n

Get Six-Digit Code to Log In

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
we want to send your code so you can log in.
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n No longer have access to these?\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/login/sendEmail.component.html\n// module id = 909\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n
\\r\\n
×
\\r\\n

Dispatch List

\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
SNoVoucherNo.DivisionDateMitiTrn A/c
\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/modaldialogs/GRNDialog/GRNPopUp.html\n// module id = 910\n// module chunks = 22","module.exports = \".md-dialog-container {\\r\\n height: auto !important; \\r\\n width:auto !important;\\r\\n overflow: hidden !important;\\r\\n box-shadow: 0px !important;\\r\\n}\\r\\n\\r\\n\\r\\n.mat-dialog-container{\\r\\n background: transparent !important;\\r\\n box-shadow: none !important;\\r\\n margin-left: auto;\\r\\n margin-right: auto;\\r\\n overflow: hidden !important;\\r\\n height: 350px !important;\\r\\n \\r\\n}\\r\\n\\r\\n.auth-main{\\r\\n position: inherit !important;\\r\\n display: inherit !important;\\r\\n}\\r\\n.cdk-overlay-pane, .md-overlay-pane { height: auto !important; }\\r\\n.cdk-overlay-pane, .md-overlay-pane { flex: 1 1 0; }\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/pages/modaldialogs/logindialog/logindialog.component.css\n// module id = 911\n// module chunks = 22","module.exports = \"
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baAmChart/baAmChart.html\n// module id = 912\n// module chunks = 22","module.exports = \"
\\r\\n
\\r\\n

{{title}}

\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baCard/baCard.html\n// module id = 913\n// module chunks = 22","module.exports = \"
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baChartistChart/baChartistChart.html\n// module id = 914\n// module chunks = 22","module.exports = \"
\\r\\n \\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baCheckbox/baCheckbox.html\n// module id = 915\n// module chunks = 22","module.exports = \"
\\r\\n \\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baContentTop/baContentTop.html\n// module id = 916\n// module chunks = 22","module.exports = \"
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baFullCalendar/baFullCalendar.html\n// module id = 917\n// module chunks = 22","module.exports = \"\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baMenu/baMenu.html\n// module id = 918\n// module chunks = 22","module.exports = \"
  • \\r\\n\\r\\n \\r\\n {{ menuItem.title }}\\r\\n \\r\\n\\r\\n \\r\\n {{ menuItem.title }}\\r\\n \\r\\n\\r\\n \\r\\n {{ menuItem.title }}\\r\\n \\r\\n \\r\\n\\r\\n
      \\r\\n \\r\\n
    \\r\\n\\r\\n
  • \\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baMenu/components/baMenuItem/baMenuItem.html\n// module id = 919\n// module chunks = 22","module.exports = \"\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baMsgCenter/baMsgCenter.html\n// module id = 920\n// module chunks = 22","module.exports = \"
    \\r\\n \\r\\n \\r\\n
    \\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baMultiCheckbox/baMultiCheckbox.html\n// module id = 921\n// module chunks = 22","module.exports = \"
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n Change Password\\r\\n \\r\\n \\r\\n Sign Out\\r\\n \\r\\n \\r\\n Sync\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n {{ menuItem.title }}\\r\\n \\r\\n \\r\\n \\r\\n {{ menuItem.title }} \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n {{ childrenItem.title }}\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n

    Change Password

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baPageTop/baPageTop.html\n// module id = 922\n// module chunks = 22","module.exports = \"
    \\r\\n
    \\r\\n \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n Change profile Picture\\r\\n \\r\\n
    \\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baPictureUploader/baPictureUploader.html\n// module id = 923\n// module chunks = 22","module.exports = \"\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/theme/components/baSidebar/baSidebar.html\n// module id = 924\n// module chunks = 22","// style-loader: Adds some css to the DOM by adding a