{"version":3,"sources":["1Initializers.js","2base.js","changeorderdatatables.js","changeordereditviews.js","changeorderlistviews.js","changeordermodels.js","changeordersettingsviews.js","commitmentdatatables.js","commitmenteditviews.js","commitmentlistviews.js","commitmentmanagementviews.js","commitmentmodels.js","commitmentsettingsviews.js"],"names":["PJQ","collections","commitments","models","views","modules","routes","route","name","callback","projectId","projectWall","initProjectNavigator","parseInt","commitmentId","view","changeOrderId","invoiceId","params","app","session","user","parametersObject","_","size","trim","helpers","urlHelpers","queryStringToObject","response","inviteResponse","router","signInNavigate","cacheRoute","addRoutes","BaseDataTable","dataTables","DataTable","extend","defaults","language","zeroRecords","isHideSearch","dom","events","click .btn-copy-phone","click .btn-copy-fax","click .btn-copy-cell","click .btn-copy-email","beforeDataTableRender","this","options","rowCallback","row","data","childDataTables","contextMenuOptions","actions","getContextMenuItems","isHideNoActions","onRowDoubleClick","bind","editRow","settings","rowsPerPage","indexOf","pageLength","orderBy","columns","columnsDefault","each","getColumns","column","index","columnData","order","orderAscending","colReorder","fixedColumnsLeft","realtime","createdRow","orderByChanged","afterDataTableRenderChild","getRowChildTable","childOpts","getRowChildData","setRowStyle","status","isBlacklisted","statusChanged","statuses","cleanup","undelegateEvents","$","el","empty","getIsRootView","dataIndex","ChangeOrderDataTable","emptyTable","subTemplates","header","templating","Template","constants","COMMITMENTS","toggleRowClass","click .view-commitment","getDefaultFilter","statusIds","userSettings","get","afterSearch","afterHeaderRender","inputs","Selectpicker","defaultValue","isIntChoices","isMultiple","noneSelectedText","onChange","value","setFilter","changeOrderFilterType","STATUS_FILTER","getFilterData","statusFilter","getFilter","filter","contains","_this","includeAllColumns","arguments","length","undefined","canViewCommitments","project","hasPermission","includeColumns","customFields","customField","push","title","width","orderable","searchable","defaultContent","render","type","isAdmin","exObj","erp","getERPBadge","columnName","changeOrderStatusNames","Date","dateHelpers","getDateString","dateFormats","DATE","DATE_TIME","titleSettings","companyName","className","formatHelpers","formatCurrency","getGrandTotal","startsWith","fieldValue","getCustomFieldValue","customFieldType","BOOLEAN","CHOICE","choices","choice","find","join","DATETIME","INTEGER","toLocaleString","MONEY","parseFloat","numbersOnly","PERCENT","toFixed","toString","visible","viewCommitmentClicked","e","getRow","currentTarget","closest","viewCommitment","CommitmentEditModal","model","Commitment","id","ChangeOrderEditModal","BaseModal","template","maxWidth","fromChangeRequest","isShowCloseButton","onSave","noop","onDelete","click .btn-view-commitment","click .btn-add-line-item","click .btn-close","click .btn-submit","click .btn-save-email","click .btn-save","click .btn-delete","click .btn-push-erp","click .btn-undo-push-erp","click .btn-unlink-erp","click .btn-export","click .btn-email","click .nav-link","click .btn-copy-markups","click .btn-view-history","beforeModalCreated","_beforeModalCreated","_asyncToGenerator","_regeneratorRuntime","mark","_callee","customFieldValues","wrap","_context","prev","next","isFetched","fetchCommitmentChangeOrderFieldSettings","coreFieldSettings","sent","fetchCommitmentChangeOrderCustomFields","fetchCommitmentChangeOrderSettings","fetchCostCodes","costCodes","fetchCostTypes","costTypes","fetchUnitsOfMeasure","unitsOfMeasure","fieldNumber","fieldTypeId","fieldType","ChangeOrder","description","commitment","commitmentNumber","contractedContact","contractedContactId","invoiceContact","invoiceContactId","accountingMethod","statusId","primeContracts","changeOrderStatus","DRAFT","lineItems","isNew","fetch","fetchERPIntegration","erpIntegration","getSetting","fetchERPObject","stop","apply","beforeRender","canEdit","canEditLineItems","canDelete","canEditStatus","disabledStatuses","fnGetGreaterStatuses","st","isContractedContact","contact","isSubmitting","APPROVED","VOID","invoices","syncStatus","erpSyncStatus","integrations","syncStatuses","REVIEWING","SYNCED","renderData","activeView","checkFieldVisible","checkFieldRequired","unCopiedMarkupsCount","getUnCopiedMarkups","afterRender","_this2","activateView","stopListening","markupItems","listenTo","markup","lineItem","_markup$lineItem","findWhere","appliedMarkupId","set","remove","updateCounts","lineItemsView","renderERP","renderGeneral","renderLineItems","renderMarkups","text","item","GENERAL","LINEITEMS","INVOICES","PAYMENTS","MARKUPS","activeViewChanged","target","hash","replace","tab","_this3","Binder","$el","useDecimalPercentFields","watchElements","map","disabled","statusPicker","newStatus","oldStatus","save","success","notifications","notify","successNotify","message","setValue","contractCompanyPicker","contacts","ContactsSelectInput","selectedContact","canViewContacts","displayContactsBlock","Datepicker","datepickerOptions","format","datePicker","defaultDate","newDate","reviewerPicker","reviewer","shouldHideContacts","context","contexts","PROJECTCONTACTS","isSingleChoice","receivedFromPicker","receivedFrom","customFieldsForm","CustomFieldsForm","isEdit","collection","fieldValues","isDirty","fileUploader","files","FileUploaderGrid","attachments","canUpload","useApiV2","canView","previewImageDimension","onSuccess","file","attachment","destroy","budget","LineItemsView","lineItemModel","ChangeOrderLineItem","canChangeAccountingMethod","showBilling","financialMarkups","enableTax","showSubTotal","showGrandTotal","onAccountingMethodChanged","onLineItemChange","onLineItemAdd","onLineItemDelete","removeModal","_this4","commitmentMarkup","some","copyMarkups","_this5","maxSort","max","copiedMarkup","FinancialMarkup","percent","isVertical","isCompounding","costCodeIds","costTypeIds","appliedCostCodeId","appliedCostTypeId","isApplied","sortOrder","add","trigger","markupsView","FinancialMarkupsList","$erp","isERPSynced","SYNC_COMMITMENTS","html","canPush","disablePushReason","renderERPButtons","pushSupported","hasAvailableAction","PUSH_COMMITMENT_CHANGE_ORDERS","canPushChanges","unlinkSupported","UNLINK_COMMITMENT_CHANGE_ORDERS","pushERP","_this6","pushCommitmentChangeOrder","undoPushERP","_this7","undoPush","unlinkERP","_this8","modals","YesNo","body","onYes","loader","Loader","unlinkCommitmentChangeOrder","viewHistory","_viewHistory","_callee2","historyItems","history","_context2","date","person","action","ChangeOrderHistory","HistoryTimelineModal","subTitle","items","exportChangeOrder","_this9","downloadFile","generateEndpoint","endpoint","isAPIv2","hasChanged","fieldName","fieldSettings","saveEmail","_this10","email","savePush","_this11","submitChangeOrder","submit","result","saveChangeOrder","_this12","validate","isValid","inputHelpers","setInputError","$changeReason","$invoicedDate","$dueDate","$description","clearError","showError","_this13","prevObject","scrollTop","newMarkupLines","getChanged","toJSON","error","errorNotify","responseJSON","deleteChangeOrder","DeleteCancel","_this$options$project","_this$options$project2","projectName","subject","concat","ComposeEmailModal","share","close","SaveDontSave","onDontSave","ChangeOrdersList","BaseView","click .btn-settings","click .btn-add-change-order","click .btn-view-change-order","click .btn-delete-change-order","click .btn-pull-erp","beforeFirstRender","_beforeFirstRender","_callee3","_context3","ChangeOrders","costCodeId","costTypeId","fetchCommitmentChangeOrderUserSettings","canAdd","renderView","off","on","changeOrder","initChangeOrder","viewChangeOrder","renderERPButton","pullSupported","PULL_COMMITMENT_CHANGE_ORDERS","pullERP","pullCommitmentChangeOrders","res","reset","dataTable","getDataTableInstance","rowId","headerData","getSettings","CHANGE_ORDERS","fixedColumnsRight","columnOrderChanged","afterDataTableRender","onClick","exportChangeOrderList","parameter","getTimezoneOffset","newChangeOrder","viewChangeOrderClicked","deleteChangeOrderClicked","removeRow","editSettings","ChangeOrderSettingsModal","changeOrdersView","ModalViewChangeOrders","SelectCommitmentChangeOrdersModal","headerSubText","change .select-change-order","click .btn-cancel","_beforeModalCreated2","_callee4","_context4","selectedChangeOrders","_this14","filterStatuses","isArray","includes","isNumber","selectChangeOrder","not","prop","selectedChangeOrder","dtChangeOrder","attr","onChangeOrderSelected","addClass","removeClass","reject","selChangeOrder","cancel","onCancel","BaseModel","idAttribute","arr","parse","ChangeOrderLineItems","ChangeOrderAttachments","invoicing","PayableInvoices","FinancialMarkups","Contact","beforeSave","signature","ajax","Request","post","done","fail","syncERP","prototype","call","makeERPUrl","integration","toEmails","ccEmails","xhr","err","getSubTotal","ChangeOrderHistoryItem","actionNames","getActionName","_this$actionNames$thi","getDescription","fromStatus","from","toStatus","to","BaseLineItem","ChangeOrderAttachment","File","ChangeOrderCustomField","CustomField","ChangeOrderSettings","Settings","ChangeOrderUserSettings","attributes","viewSettings","setting","ChangeOrderFieldSetting","BaseCollection","getTotalAmountsByStatus","changeOrderStatusBuckets","bucket","total","Files","ChangeOrderCustomFields","ChangeOrderFieldSettings","minWidth","change .select-column","click .btn-edit-company-default","click button.settings-save","defaultStatusFilter","selectedColumns","defaultFilterSelectPicker","currentView","selectView","editCompanySettings","forCompany","show","hide","columnSelected","sender","fnOnSave","settingTemp","slice","columnTemp","CommitmentDataTable","defaultFilter","filterType","TYPE_FILTER","isGrouped","typeFilter","_this15","commitmentStatusNames","commitmentTypeNames","_row$get","formatPercent","_row$get2","_row$get3","_row$get4","retainage","groups","parentDataTable","LineItemDataTable","CommitmentLineItems","onEditLineItem","onDeleteLineItem","parentData","AMOUNT","formatDecimal","unitOfMeasure","group","costType","commitmentType","click .copy-to-billto","click .copy-to-shipto","click .btn-new-change-order","click .btn-new-invoice","click .btn-view-invoice","change .input-coi-required","change .input-w9-required","change .input-lien-waiver-required","click .btn-submit-for-review","click .btn-sign-submit","keydown .input-percent","change .input-percent","click .btn-view-payment","_beforeModalCreated3","_callee5","_this$options$contrac","_context5","fetchCommitmentFieldSettings","fetchCommitmentTerms","terms","fetchCommitmentCustomFields","fetchCommitmentSettings","invoiceSettings","fetchPayableInvoiceSettings","uploadCustomFields","PURCHASE_ORDER","commitmentStatus","billTo","shipTo","defaultWorkRetainagePercent","defaultMaterialRetainagePercent","hasEditPermission","canEditDates","canUploadAttachments","canViewChangeOrders","canAddChangeOrders","canViewInvoices","canAddInvoices","SUBCONTRACT_COMPLETE","SUBCONTRACT_OUT_FOR_BID","OUT_FOR_SIGNATURE","PURCHASE_ORDER_PROCESSING","SUBCONTRACT_TERMINATED","SUBCONTRACT_VOID","PURCHASE_ORDER_CLOSED","SUBMITTED","hasPendingInvoice","invoice","payableInvoiceStatus","COMPLETE","_this16","window","testModel","_markup$lineItem2","renderChangeOrders","renderInvoices","renderPayments","changeOrders","payments","CHANGEORDERS","HISTORY","_this17","SUBCONTRACT","PURCHASE_ORDER_PARTIALLY_RECEIVED","PURCHASE_ORDER_RECEIVED","defaultTerm","termsPicker","newTermsId","hideUsers","invoiceContactPicker","commitmentCustomFieldsForm","_sTo","bTo","country","billToStatePicker","StatePicker","state","billToCountryPicker","CountryPicker","statePicker","zipInput","enableInternational","preferences","hasPref","preferenceTypes","ENABLE_INTERNATIONAL_COUNTRIES","inputMaskPhone","sTo","shipToStatePicker","shipToCountryPicker","$att","$coi","coiAttachments","coiUploader","renderCOIApproval","$w9","w9Attachments","w9Uploader","renderW9Approval","$lien","lienWaiverAttachments","lienWaiverUploader","renderLienWaiverApproval","$signed","signedDocumentAttachments","signedDocumentUploader","$affidavit","affidavitAttachments","affidavitUploader","$executed","executedDocumentAttachments","executedDocumentUploader","renderUploadCustomFields","customFieldUploaders","field","$upload","customFieldAttachments","attachmentsCollection","CommitmentAttachments","uploader","newAttachment","uploadId","customFieldAttachment","coiApproval","ButtonGroup","colorInactiveButtons","buttonClasses","buttons","label","colorClass","w9Approval","lienWaiverApproval","val","_this18","CommitmentLineItem","billedToDate","approvedChanges","onApprovedChangesClicked","onBilledToDateClicked","copyToHelper","_this19","fromDescription","toDescription","fnContinue","contactName","address1","address2","city","zip","phone","fax","toLowerCase","getValue","toUpperCase","sCountry","bCountry","SelectContactsModal","CONTACTS","changeOrdersDataTable","paging","isShown","hasFooter","getERPIcon","renderFooter","amt","newInvoice","viewInvoice","addRow","onChangeOrderAdd","refresh","onChangeOrderDelete","cid","viewPaymentClicked","paymentsDataTable","viewPayment","payment","InvoicePaymentModal","isPayable","dateReceived","_PJQ$constants$invoic","paymentMethods","viewInvoiceClicked","invoicesDataTable","EditPayableInvoiceModal","onInvoiceAdd","deleteInvoice","payableInvoiceStatusNames","getRetainage","$workRetainage","$materialRetainage","$terms","$startDate","$estimatedCompletionDate","$actualCompletionDate","$contractDate","$signedContractDate","$letterOfIntentDate","$approvalLetterDate","$issuedOnDate","$executedOnDate","$returnedOnDate","$inclusions","$exclusions","$deliveryDate","$paymentTerms","$shipVia","$shipToCompany","$shipToContact","$shipToAddress1","$shipToCity","$shipToZip","$billToCompany","$billToContact","$billToAddress1","$billToCity","$billToZip","_this20","assignedTo","deleteCommitment","_this21","saveCommitment","_this22","validateForSubmit","scrollEl","scrollIntoView","submitForReview","_this23","signAndSubmit","_this24","signatures","SignatureSubmitModal","onSubmit","_this$options$project3","_this$options$project4","canVoid","fnRenderButtons","PUSH_COMMITMENTS","UNLINK_COMMITMENTS","canPushWithoutVendorSynced","PUSH_COMMITMENTS_WITH_VENDOR","fetchCompanyERPObject","erpObject","externalId","_this25","pushCommitment","_this26","_this27","unlinkCommitment","_viewHistory2","_callee6","cType","_context6","History","exportCommitment","_this28","CommitmentsList","click .new-po","click .new-subcontract","click .btn-delete-commitment","_beforeFirstRender2","_callee7","_context7","Commitments","fetchCommitmentUserSettings","isChangeOrdersAdmin","initCommitment","PULL_COMMITMENTS","PULL_COMMITMENTS_DOC_CLERK_REQUIRED","IS_DOCUMENT_CLERK","pullCommitments","onPageSizeChange","enableColumnResize","columnWidthCookie","cookies","COMMITMENT_LIST_COLUMNS_WIDTH","exportList","CommitmentSettingsModal","commitmentsView","newCommitment","hasClass","onCommitmentSave","onCommitmentDelete","deleteCommitmentClicked","ModalViewCommitments","SelectCommitmentsModal","selectedCommitmentId","change .select-commitment","_beforeModalCreated4","_callee8","_context8","selectedCommitment","selectedCommitments","hasSelected","isSelected","_this29","selectCommitment","dtCommitment","onCommitmentSelected","selCommitment","CommitmentManagement","commitmentTotals","invoiceTotals","INVOICING","shown.bs.tab .nav-tabs","invoicesView","activateTab","renderStats","totals","$totals","renderSubTemplate","pending","PENDING","projected","PROJECTED","committed","COMMITTED","draft","reviewing","approved","complete","revise","REVISE","commitmentStatusBuckets","renderChangeOrdersView","renderInvoicesView","renderCommitmentsView","isActivating","tabActivated","vw","activeTab","navigate","fnRender","PayableInvoicesList","getActiveTab","updateTotalsCount","$commitmentSpan","$changeOrdersSpan","$invoicesSpan","PayableInvoicePayments","providers","QBO","HistoryItem","signed","_this$actionNames$thi2","CommitmentAttachment","CustomFieldChoice","Term","FieldSetting","CommitmentUserSettings","withLineItems","CustomFields","CustomFieldChoices","Terms","FieldSettings","defaultTypeFilter"],"mappings":"m6NAAAA,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AAA,YAEApX,OAAA,WAEA,IAAAsc,EAAA1nB,EAAAsC,KAAA,WACA,mBAAAX,KAAAC,QAAAwJ,QACAzJ,KAAAC,QAAAwJ,SACAzJ,KAAA0V,eACA1V,MAEAA,KAAA4D,aAAAoM,IAAA,8BAAAhQ,KAAAC,QAAAg+B,mBACAj+B,KAAA4D,aAAAoM,IAAA,gCAAAhQ,KAAAC,QAAAmlB,qBAEA/mB,EAAA+C,KAAApB,KAAAC,QAAA2D,aAAAvF,EAAAsC,KAAA,SAAAqlB,GACA3nB,EAAA+C,KAAApB,KAAA4D,aAAAC,IAAA,gBAAAxF,EAAAsC,KAAA,SAAA2jB,GACA,GAAA0B,EAAAnoB,OAAAymB,EAAAzmB,KAAA,CACAymB,EAAAxjB,YAAAklB,EAAAllB,YAEA,IAAAI,EAAA,EAAA7C,EAAAC,KAAAgmB,EAAApjB,SAAAojB,EAAApjB,QAAA+kB,QAAA3B,EAAAnjB,eAAA8kB,QAGA5nB,EAAA+C,KAAA4kB,EAAA9kB,QAAA7C,EAAAsC,KAAA,SAAAW,GACAA,EAAAkH,SACA,IAAAtH,EAAAH,QAAAO,EAAAE,aACAN,EAAAyE,KAAArE,EAAAE,aAGA,IAAAN,EAAAH,QAAAO,EAAAE,cACAN,EAAA7C,EAAAyG,OAAA5D,EAAA7C,EAAAsC,KAAA,SAAAulB,GACA,OAAAA,GAAA5kB,EAAAE,YACAxB,SAEAA,OAEAskB,EAAApjB,QAAAA,IAEAlB,QACAA,OAEAA,KAAA4D,aAAAkO,KAAA,KAAA,CACAC,QAAA1T,EAAAsC,KAAA,WACAolB,KACA/lB","file":"app.js","sourcesContent":["PJQ.collections.commitments = PJQ.collections.commitments ? PJQ.collections.commitments : {};\nPJQ.models.commitments = PJQ.models.commitments ? PJQ.models.commitments : {};\nPJQ.views.commitments = PJQ.views.commitments ? PJQ.views.commitments : {};\n\nPJQ.modules.commitments = {\n routes: [\n {\n route: 'projects/:projectId/commitments',\n name: 'commitments',\n callback: function (projectId) {\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\");\n }\n },\n {\n route: 'projects/:projectId/commitments/:commitmentId',\n name: 'commitment',\n callback: function (projectId, commitmentId) {\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\", {\n commitmentId: parseInt(commitmentId)\n });\n }\n },\n {\n route: 'projects/:projectId/commitments/changeorders',\n name: 'commitmentchangeorders',\n callback: function (projectId) {\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\", {\n view: 'changeorders'\n });\n }\n },\n {\n route: 'projects/:projectId/commitmentchangeorders',\n name: 'commitmentchangeorders',\n callback: function (projectId) {\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\", {\n view: 'changeorders'\n });\n }\n },\n {\n route: 'projects/:projectId/commitmentchangeorders/:changeOrderId',\n name: 'commitmentchangeorder',\n callback: function (projectId, changeOrderId) {\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\", {\n changeOrderId: parseInt(changeOrderId)\n });\n }\n },\n {\n route: 'projects/:projectId/commitments/invoices',\n name: 'payableinvoices',\n callback: function (projectId) {\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\", {\n view: 'invoices'\n });\n }\n },\n {\n route: 'projects/:projectId/payableinvoices',\n name: 'payableinvoices',\n callback: function (projectId) {\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\", {\n view: 'invoices'\n });\n }\n },\n {\n route: 'projects/:projectId/payableinvoices/:invoiceId',\n name: 'payableinvoice',\n callback: function (projectId, invoiceId, params) {\n if (PJQ.app.session.user == null) {\n PJQ.app.router.signInNavigate({\n cacheRoute: true\n });\n return;\n }\n\n let parametersObject = null;\n if (params && _.size(params.trim()) > 0) {\n parametersObject = PJQ.helpers.urlHelpers.queryStringToObject(params);\n }\n let response = parametersObject ? parametersObject.response : null;\n\n PJQ.modules.projectWall.initProjectNavigator(parseInt(projectId), \"commitments\", {\n invoiceId: parseInt(invoiceId),\n inviteResponse: response\n });\n }\n }\n ]\n};\n\nPJQ.app.addRoutes(PJQ.modules.commitments.routes);\n","PJQ.views.commitments.BaseDataTable = PJQ.views.dataTables.DataTable.extend({\n\tdefaults: {\n\t\tlanguage: {\n\t\t\tzeroRecords: \"No Results Available\"\n\t\t},\n\t\tisHideSearch: true,\n\t\tdom: '<\"top\"p<\"clear\">>rt<\"bottom\"p<\"clear\">>'\n\t},\n\tevents: {\n\t\t'click .btn-copy-phone': 'copyPhone',\n\t\t'click .btn-copy-fax': 'copyPhone',\n\t\t'click .btn-copy-cell': 'copyPhone',\n\t\t'click .btn-copy-email': 'copyEmail'\n\t},\n\tbeforeDataTableRender: function () {\n\t\tlet self = this;\n\t\tthis.options.rowCallback = function (row, data) {\n\t\t};\n\n\t\tthis.options.childDataTables = [];\n\n\t\tthis.options.contextMenuOptions = {\n\t\t\tactions: this.getContextMenuItems(),\n\t\t\tisHideNoActions: true\n\t\t};\n\n\t\tif(this.options.onRowDoubleClick == null){\n\t\t\tthis.options.onRowDoubleClick = _.bind(function (row) {\n\t\t\t\tif (row.data()) {\n\t\t\t\t\tthis.editRow(row);\n\t\t\t\t}\n\t\t\t}, this);\n\t\t}\n\n\t\tif (this.options.settings) {\n\t\t\t// enable paging for grids that have a setting for it / are not subgrids\n\t\t\tif (this.options.settings.rowsPerPage !== 0 && this.options.view.indexOf('-') === -1)\n\t\t\t\tthis.options.pageLength = this.options.settings.rowsPerPage;\n\t\t\telse\n\t\t\t\tthis.options.pageLength = 2147483646;\n\n\t\t\tif (this.options.settings.orderBy !== 'sortOrder') {\n\t\t\t\tif (_.size(this.options.settings.columns) === 0) {\n\t\t\t\t\tif (_.size(this.options.settings.columnsDefault) > 0) {\n\t\t\t\t\t\tthis.options.settings.orderBy = this.options.settings.columnsDefault[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (this.options.settings.columns.indexOf(this.options.settings.orderBy) === -1) {\n\t\t\t\t\tthis.options.settings.orderBy = this.options.settings.columns[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\t_.each(this.getColumns(false, this.options.view), _.bind(function (column, index) {\n\t\t\t\tif (column.columnData === this.options.settings.orderBy) {\n\t\t\t\t\tthis.options.order = [[index, this.options.settings.orderAscending ? 'asc' : 'desc']];\n\t\t\t\t}\n\t\t\t}, this));\n\n\t\t\tlet fixedColumnsLeft = 0;\n\t\t\tthis.options.colReorder = {\n\t\t\t\tfixedColumnsLeft: fixedColumnsLeft,\n\t\t\t\trealtime: false\n\t\t\t};\n\t\t}\n\n\t\tthis.options.createdRow = _.bind(this.createdRow, this);\n\n\t\tif (typeof this.options.beforeDataTableRender === 'function') {\n\t\t\tthis.options.beforeDataTableRender();\n\t\t}\n\t},\n\torderByChanged: function () {\n\t},\n\tafterDataTableRenderChild: function () {\n\t},\n\tgetRowChildTable: function (childOpts) {\n\t},\n\tgetRowChildData: function (row) {\n\t},\n\tsetRowStyle: function (row, status, isBlacklisted) {\n\t},\n\tgetContextMenuItems: function () {\n\t},\n\teditRow: function (row) {\n\t},\n\tstatusChanged: function (statuses) {\n\t},\n\tgetColumns: function () {\n\t},\n\tcleanup: function () {\n\t\tthis.undelegateEvents();\n\t\t$(this.el).empty();\n\t},\n\tgetIsRootView: function () {\n\t\treturn (this.options.view.indexOf('-') === -1);\n\t},\n\tcreatedRow: function (row, data, dataIndex) {\n\t}\n});","PJQ.views.commitments.ChangeOrderDataTable = PJQ.views.dataTables.DataTable.extend({\r\n defaults: {\r\n language: {\r\n emptyTable: 'No Change Orders have been created yet',\r\n zeroRecords: \"No Change Orders matched the search criteria\"\r\n },\r\n subTemplates: {\r\n header: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'data-table-header-change-orders')\r\n },\r\n toggleRowClass: '.change-order-toggle-row'\r\n },\r\n events: {\r\n 'click .view-commitment': 'viewCommitmentClicked'\r\n },\r\n beforeDataTableRender: function () {\r\n this.options.pageLength = this.options.settings ? this.options.settings.rowsPerPage : 10;\r\n },\r\n getDefaultFilter: function () {\r\n return _.size(this.options.statusIds) > 0 ? this.options.statusIds : this.options.userSettings.get('defaultStatusFilter');\r\n },\r\n afterSearch: function () {\r\n if (typeof this.options.afterSearch === 'function') {\r\n this.options.afterSearch();\r\n }\r\n },\r\n afterHeaderRender: function () {\r\n new PJQ.inputs.Selectpicker({\r\n el: this.$('.change-orders-status-filter'),\r\n defaultValue: this.getDefaultFilter(),\r\n isIntChoices: true,\r\n isMultiple: true,\r\n noneSelectedText: 'No Filters',\r\n onChange: _.bind(function (value) {\r\n this.setFilter(PJQ.constants.commitments.changeOrderFilterType.STATUS_FILTER, value);\r\n }, this)\r\n });\r\n this.setFilter(PJQ.constants.commitments.changeOrderFilterType.STATUS_FILTER, this.getDefaultFilter());\r\n },\r\n getFilterData: function () {\r\n let statusFilter = this.getFilter(PJQ.constants.commitments.changeOrderFilterType.STATUS_FILTER);\r\n if (_.size(statusFilter) === 0) {\r\n return this.options.data;\r\n }\r\n\r\n return _.filter(this.options.data, function (row) {\r\n return (_.size(statusFilter) === 0 || _.contains(statusFilter, row.get('statusId')));\r\n });\r\n },\r\n getColumns: function (includeAllColumns = false) {\r\n this.options.canViewCommitments = PJQ.app.session.project.hasPermission('commitments.canView');\r\n\r\n let columns = [],\r\n includeColumns = ['status', 'commitment', 'contractedContact.companyName', 'number', 'changeReason', 'description', 'contractDate', 'invoicedDate', 'dueDate', 'createdOn', 'amount', 'markupAmount', 'taxAmount', 'grandTotal'];\r\n\r\n if (this.options.customFields) {\r\n _.each(this.options.customFields.models, _.bind(function (customField) {\r\n includeColumns.push('fieldValue' + customField.get('fieldNumber'));\r\n }, this));\r\n }\r\n\r\n if (!includeAllColumns) {\r\n if (this.options.settings && _.size(this.options.settings.columns) > 0)\r\n includeColumns = this.options.settings.columns;\r\n else\r\n includeColumns = this.options.settings && this.options.settings.columnsDefault ? this.options.settings.columnsDefault : includeColumns;\r\n\r\n columns.push({\r\n \"columnData\": \"childData\",\r\n \"data\": null,\r\n \"title\": \"\",\r\n \"width\": \"20px\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"defaultContent\": '',\r\n \"render\": (data, type, row) => {\r\n if (!this.options.isAdmin) {\r\n return \"\";\r\n }\r\n\r\n let exObj = row.get('externalObject');\r\n if (exObj == null) {\r\n return '';\r\n }\r\n\r\n return PJQ.helpers.erp.getERPBadge(exObj.status, exObj);\r\n }\r\n });\r\n }\r\n\r\n _.each(includeColumns, _.bind(function (columnName) {\r\n switch (columnName) {\r\n case 'status':\r\n columns.push({\r\n \"columnData\": \"status\",\r\n \"data\": \"attributes.statusId\",\r\n \"title\": \"Status\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.constants.commitments.changeOrderStatusNames[row.get('statusId')]\r\n }, this)\r\n });\r\n break;\r\n case 'commitment':\r\n columns.push({\r\n \"columnData\": \"commitment\",\r\n \"title\": \"Commitment\",\r\n \"data\": \"attributes.commitmentNumber\",\r\n \"orderable\": true,\r\n \"render\": _.bind(function (data, type, row) {\r\n if (type === 'sort' || type === 'type') {\r\n return row.get('commitmentNumber');\r\n }\r\n\r\n if (this.options.canViewCommitments) {\r\n return '' + row.get('commitmentNumber') + '';\r\n }\r\n return data;\r\n }, this)\r\n },);\r\n break;\r\n case 'number':\r\n columns.push({\r\n \"columnData\": \"number\",\r\n \"data\": \"attributes.number\",\r\n \"title\": \"Number\",\r\n \"render\": _.bind(function (data, type, row) {\r\n if (type === 'sort' || type === 'type') {\r\n return row.get('number');\r\n }\r\n\r\n return '' + row.get('number') + '';\r\n }, this)\r\n });\r\n break;\r\n case 'changeReason':\r\n columns.push({\r\n \"columnData\": \"changeReason\",\r\n \"data\": \"attributes.changeReason\",\r\n \"title\": \"Change Reason\"\r\n });\r\n break;\r\n case 'description':\r\n columns.push({\r\n \"columnData\": \"description\",\r\n \"data\": \"attributes.description\",\r\n \"title\": \"Description\"\r\n });\r\n break;\r\n case 'contractDate':\r\n columns.push({\r\n \"columnData\": \"contractDate\",\r\n \"data\": \"attributes.contractDate\",\r\n \"title\": 'Contract Date',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'invoicedDate':\r\n columns.push({\r\n \"columnData\": \"invoicedDate\",\r\n \"data\": \"attributes.invoicedDate\",\r\n \"title\": 'Invoiced Date',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'dueDate':\r\n columns.push({\r\n \"columnData\": \"dueDate\",\r\n \"data\": \"attributes.dueDate\",\r\n \"title\": 'Due Date',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'createdOn':\r\n columns.push({\r\n \"columnData\": \"createdOn\",\r\n \"data\": \"attributes.createdOn\",\r\n \"title\": 'Created',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE_TIME);\r\n }, this)\r\n });\r\n break;\r\n case 'contractedContact.companyName':\r\n columns.push({\r\n \"columnData\": \"contractedContact.companyName\",\r\n \"title\": \"Company\",\r\n \"titleSettings\": \"Contracted Company\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return row.get('contractedContact') ? row.get('contractedContact').companyName : 'N/A';\r\n }, this)\r\n });\r\n break;\r\n case 'amount':\r\n columns.push({\r\n \"columnData\": \"amount\",\r\n \"data\": \"attributes.amount\",\r\n \"width\": \"10%\",\r\n \"title\": \"Amount\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('amount'));\r\n }, this)\r\n });\r\n break;\r\n case 'taxAmount':\r\n columns.push({\r\n \"columnData\": \"taxAmount\",\r\n \"data\": \"attributes.taxAmount\",\r\n \"title\": \"Tax\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(data);\r\n }, this)\r\n });\r\n break;\r\n case 'markupAmount':\r\n columns.push({\r\n \"columnData\": \"markupAmount\",\r\n \"data\": \"attributes.markupAmount\",\r\n \"title\": \"Markup\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(data);\r\n }, this)\r\n });\r\n break;\r\n case 'grandTotal':\r\n columns.push({\r\n \"columnData\": \"grandTotal\",\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Grand Total\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.getGrandTotal());\r\n }, this)\r\n });\r\n break;\r\n default:\r\n if (columnName.startsWith('fieldValue')) {\r\n _.each(this.options.customFields.models, function (customField) {\r\n if (columnName === 'fieldValue' + customField.get('fieldNumber')) {\r\n columns.push({\r\n \"columnData\": 'fieldValue' + customField.get('fieldNumber'),\r\n \"title\": customField.get('name'),\r\n \"render\": function (data, type, row) {\r\n let fieldValue = row.getCustomFieldValue(customField.get('id'));\r\n fieldValue = (fieldValue !== null) ? fieldValue : '';\r\n switch (customField.get('fieldTypeId')) {\r\n case PJQ.constants.commitments.customFieldType.BOOLEAN:\r\n if (fieldValue != null)\r\n fieldValue = fieldValue ? 'Yes' : 'No';\r\n break;\r\n case PJQ.constants.commitments.customFieldType.CHOICE:\r\n let choices = [];\r\n // convert single choice value into array so that the logic below can work for both types.\r\n if (typeof fieldValue === 'number')\r\n fieldValue = [fieldValue];\r\n\r\n _.each(customField.choices.models, _.bind(function (choice) {\r\n if (_.find(fieldValue, function (value) {\r\n return value === choice.get('id');\r\n }))\r\n choices.push(choice.get('name'));\r\n }, this));\r\n\r\n fieldValue = choices.join((', '));\r\n break;\r\n case PJQ.constants.commitments.customFieldType.DATE:\r\n if (fieldValue) {\r\n if (type !== 'sort' && type !== 'type')\r\n fieldValue = PJQ.helpers.dateHelpers.getDateString(new Date(fieldValue), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }\r\n if (fieldValue === undefined)\r\n fieldValue = '';\r\n\r\n break;\r\n case PJQ.constants.commitments.customFieldType.DATETIME:\r\n if (fieldValue) {\r\n if (type !== 'sort' && type !== 'type')\r\n fieldValue = PJQ.helpers.dateHelpers.getDateString(new Date(fieldValue), PJQ.helpers.dateHelpers.dateFormats.DATE_TIME);\r\n }\r\n if (fieldValue === undefined)\r\n fieldValue = '';\r\n\r\n break;\r\n case PJQ.constants.commitments.customFieldType.INTEGER:\r\n if (type !== 'sort' && type !== 'type' && fieldValue) {\r\n fieldValue = parseInt(fieldValue).toLocaleString();\r\n }\r\n break;\r\n case PJQ.constants.commitments.customFieldType.MONEY:\r\n if (type === 'sort' || type === 'type') {\r\n if (fieldValue && fieldValue !== '$')\r\n fieldValue = parseFloat(PJQ.helpers.formatHelpers.numbersOnly(fieldValue, true));\r\n else\r\n fieldValue = 0;\r\n } else {\r\n fieldValue = PJQ.helpers.formatHelpers.formatCurrency(parseInt(PJQ.helpers.formatHelpers.numbersOnly(fieldValue)));\r\n }\r\n break;\r\n case PJQ.constants.commitments.customFieldType.PERCENT:\r\n if (type === 'sort' || type === 'type') {\r\n if (fieldValue && fieldValue !== '$')\r\n fieldValue = parseFloat(PJQ.helpers.formatHelpers.numbersOnly(fieldValue, true)).toFixed(2);\r\n else\r\n fieldValue = 0;\r\n } else {\r\n fieldValue = fieldValue ? fieldValue.toString() + '%' : '';\r\n }\r\n\r\n break;\r\n }\r\n\r\n return fieldValue;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n break;\r\n }\r\n }, this));\r\n\r\n if (!includeAllColumns) {\r\n columns.push({\r\n \"title\": '',\r\n \"render\": _.bind(function (data, type, row) {\r\n return '
';\r\n }, this),\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"width\": \"90px\",\r\n \"className\": \"text-center\",\r\n \"visible\": true\r\n });\r\n }\r\n\r\n return columns;\r\n },\r\n viewCommitmentClicked: function (e) {\r\n let row = this.getRow((e.currentTarget).closest('tr'));\r\n this.viewCommitment(row.data().get('commitmentId'));\r\n },\r\n viewCommitment: function (commitmentId) {\r\n new PJQ.views.commitments.CommitmentEditModal({\r\n model: new PJQ.models.commitments.Commitment({\r\n id: commitmentId\r\n })\r\n });\r\n }\r\n});","PJQ.views.commitments.ChangeOrderEditModal = PJQ.views.BaseModal.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-change-order-edit'),\r\n width: '95%',\r\n maxWidth: 1500,\r\n model: null,\r\n fromChangeRequest: null,\r\n isShowCloseButton: true,\r\n onSave: _.noop(),\r\n onDelete: _.noop()\r\n },\r\n events: {\r\n 'click .btn-view-commitment': 'viewCommitment',\r\n 'click .btn-add-line-item': 'addLineItem',\r\n 'click .btn-close': 'close',\r\n 'click .btn-submit': 'submitChangeOrder',\r\n 'click .btn-save-email': 'saveEmail',\r\n 'click .btn-save': 'saveChangeOrder',\r\n 'click .btn-delete': 'deleteChangeOrder',\r\n 'click .btn-push-erp': 'pushERP',\r\n 'click .btn-undo-push-erp': 'undoPushERP',\r\n 'click .btn-unlink-erp': 'unlinkERP',\r\n 'click .btn-export': 'exportChangeOrder',\r\n 'click .btn-email': 'email',\r\n 'click .nav-link': 'activeViewChanged',\r\n 'click .btn-copy-markups': 'copyMarkups',\r\n 'click .btn-view-history': 'viewHistory'\r\n },\r\n beforeModalCreated: async function () {\r\n this.isFetched = false;\r\n\r\n this.options.project = this.options.project ? this.options.project : PJQ.app.session.project;\r\n this.coreFieldSettings = await this.options.project.fetchCommitmentChangeOrderFieldSettings();\r\n this.customFields = await this.options.project.fetchCommitmentChangeOrderCustomFields();\r\n this.settings = await this.options.project.fetchCommitmentChangeOrderSettings();\r\n this.costCodes = await this.options.project.fetchCostCodes();\r\n this.costTypes = await this.options.project.fetchCostTypes();\r\n this.unitsOfMeasure = await this.options.project.fetchUnitsOfMeasure();\r\n\r\n if (this.model == null) {\r\n let customFieldValues = [];\r\n _.each(this.customFields.models, function (model, index) {\r\n let value = model.get('defaultValue') ? model.get('defaultValue') : '';\r\n if (model.get('fieldType') === 'CHOICE') {\r\n value = parseInt(value);\r\n }\r\n customFieldValues.push({\r\n fieldNumber: model.get('fieldNumber'),\r\n fieldTypeId: model.get('fieldTypeId'),\r\n fieldType: model.get('fieldType'),\r\n isMultiple: model.get('isMultiple'),\r\n value: value,\r\n id: model.get('id')\r\n })\r\n }, this);\r\n\r\n this.model = new PJQ.models.commitments.ChangeOrder({\r\n description: this.options.fromChangeRequest ? this.options.fromChangeRequest.get('description') : '',\r\n commitmentId: this.options.commitment.id,\r\n commitmentNumber: this.options.commitment.get('number'),\r\n contractedContact: this.options.commitment.contractedContact,\r\n contractedContactId: this.options.commitment.get('contractedContactId'),\r\n invoiceContact: this.options.commitment.contractedContact,\r\n invoiceContactId: this.options.commitment.get('invoiceContactId'),\r\n accountingMethod: this.options.commitment.get('accountingMethod'),\r\n projectId: this.options.commitment.get('projectId'),\r\n statusId: PJQ.constants.primeContracts.changeOrderStatus.DRAFT,\r\n lineItems: this.options.lineItems,\r\n customFieldValues: customFieldValues\r\n });\r\n }\r\n\r\n if (!this.model.isNew()) {\r\n await this.model.fetch();\r\n }\r\n\r\n this.erpIntegration = await PJQ.app.session.fetchERPIntegration();\r\n if (this.erpIntegration != null && this.erpIntegration.getSetting('syncProjects')) {\r\n await this.options.project.fetchERPObject();\r\n }\r\n\r\n if (this.options.commitment == null) {\r\n this.options.commitment = new PJQ.models.commitments.Commitment({\r\n id: this.model.get('commitmentId')\r\n });\r\n }\r\n\r\n if (!this.options.commitment.isFetched) {\r\n await this.options.commitment.fetch();\r\n }\r\n\r\n this.isFetched = true;\r\n this.render();\r\n },\r\n beforeRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n this.options.canEdit = this.options.project.hasPermission('commitmentChangeOrders.canEdit');\r\n this.options.canEditLineItems = this.options.canEdit;\r\n this.options.canViewCommitments = this.options.project.hasPermission('commitments.canView');\r\n this.options.isAdmin = this.options.project.hasPermission('commitmentChangeOrders.isAdmin');\r\n this.options.canDelete = this.options.isAdmin;\r\n this.options.canEditStatus = this.options.isAdmin;\r\n\r\n this.options.disabledStatuses = null;\r\n let fnGetGreaterStatuses = (statusId) => {\r\n return _.filter(PJQ.constants.commitments.changeOrderStatus, (st) => {\r\n return st < statusId;\r\n });\r\n },\r\n status = this.model.get('statusId');\r\n\r\n let isContractedContact = PJQ.app.session.contact && PJQ.app.session.contact.id === this.model.get('contractedContactId');\r\n this.options.isSubmitting = isContractedContact && status === PJQ.constants.commitments.changeOrderStatus.DRAFT;\r\n\r\n if (status === PJQ.constants.commitments.changeOrderStatus.DRAFT) {\r\n this.options.canEdit = isContractedContact || PJQ.app.session.project.hasPermission('commitmentChangeOrders.canEdit');\r\n this.options.canEditLineItems = this.options.canEdit;\r\n this.options.canDelete = this.options.isAdmin;\r\n } else if (status === PJQ.constants.commitments.changeOrderStatus.APPROVED) {\r\n this.options.canEditLineItems = false;\r\n this.options.canEdit = PJQ.app.session.project.hasPermission('commitmentChangeOrders.canEdit');\r\n this.options.canDelete = false;\r\n } else if (status === PJQ.constants.commitments.changeOrderStatus.VOID) {\r\n this.options.canEditLineItems = false;\r\n this.options.canEdit = false;\r\n this.options.canDelete = true;\r\n } else {\r\n this.options.canEdit = PJQ.app.session.project.hasPermission('commitmentChangeOrders.canEdit');\r\n this.options.canEditLineItems = this.options.canEdit;\r\n this.options.canDelete = this.options.isAdmin;\r\n }\r\n\r\n if (_.size(this.model.invoices.models) > 0) {\r\n this.options.canEditLineItems = false;\r\n }\r\n\r\n if (this.model.invoices.models.length > 0) {\r\n this.options.disabledStatuses = fnGetGreaterStatuses(PJQ.constants.commitments.changeOrderStatus.APPROVED);\r\n this.options.canEditLineItems = false;\r\n this.options.canDelete = false;\r\n }\r\n\r\n if (this.erpIntegration != null) {\r\n let syncStatus = this.model.erpSyncStatus();\r\n if (syncStatus === PJQ.constants.integrations.erp.syncStatuses.REVIEWING\r\n || syncStatus === PJQ.constants.integrations.erp.syncStatuses.APPROVED\r\n || syncStatus === PJQ.constants.integrations.erp.syncStatuses.SYNCED\r\n ) {\r\n this.options.disabledStatuses = fnGetGreaterStatuses(PJQ.constants.commitments.changeOrderStatus.APPROVED);\r\n this.options.canEdit = false;\r\n this.options.canEditLineItems = false;\r\n this.options.canDelete = false;\r\n }\r\n }\r\n },\r\n renderData: function () {\r\n return {\r\n model: this.model,\r\n customFields: this.customFields,\r\n erpIntegration: this.erpIntegration,\r\n canEditLineItems: this.options.canEditLineItems,\r\n canEdit: this.options.canEdit,\r\n canDelete: this.options.canDelete,\r\n isAdmin: this.options.isAdmin,\r\n isSubmitting: this.options.isSubmitting,\r\n canViewCommitments: this.options.canViewCommitments,\r\n isFetched: this.isFetched,\r\n activeView: this.options.activeView,\r\n views: this.views,\r\n checkFieldVisible: _.bind(this.checkFieldVisible, this),\r\n checkFieldRequired: _.bind(this.checkFieldRequired, this),\r\n unCopiedMarkupsCount: _.size(this.getUnCopiedMarkups())\r\n }\r\n },\r\n afterRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n this.activateView(this.options.activeView);\r\n\r\n this.stopListening(this.model.markupItems);\r\n this.listenTo(this.model.markupItems, 'update', (markup) => {\r\n if(markup && markup.get('delete') && (markup.lineItem || markup.get('lineItemId'))){\r\n let lineItem = markup.lineItem ?? this.model.lineItems.findWhere({appliedMarkupId: markup.id});\r\n if(lineItem){\r\n if(lineItem.get('id') > 0){\r\n lineItem.set('delete', true);\r\n } else {\r\n this.model.lineItems.remove(lineItem);\r\n }\r\n }\r\n }\r\n\r\n this.updateCounts();\r\n this.lineItemsView.render();\r\n });\r\n\r\n this.stopListening(this.model);\r\n this.listenTo(this.model, 'change:statusId', () => {\r\n this.renderERP();\r\n });\r\n this.stopListening(this.model.lineItems);\r\n this.listenTo(this.model.lineItems, 'update', () => {\r\n this.renderERP();\r\n });\r\n this.renderERP();\r\n\r\n // we just render everything right away\r\n // if performance becomes an issue, we can render these when their tabs are activated\r\n this.renderGeneral();\r\n this.renderLineItems();\r\n this.renderMarkups();\r\n this.updateCounts();\r\n },\r\n updateCounts: function () {\r\n this.$('.count-line-items').text(_.size(_.filter(this.model.lineItems.models, (item) => {\r\n return !item.get('delete');\r\n })));\r\n this.$('.count-markups').text(_.size(_.filter(this.model.markupItems.models, function (item) {\r\n return !item.get('delete');\r\n })));\r\n },\r\n views: {\r\n GENERAL: 'CCO_General',\r\n LINEITEMS: 'CCO_LineItems',\r\n INVOICES: 'CCO_Invoices',\r\n PAYMENTS: 'CCO_Payments',\r\n MARKUPS: 'CCO_Markups'\r\n },\r\n activeViewChanged: function (e) {\r\n let view = e.target.hash ? e.target.hash.replace('#', '') : null;\r\n this.activateView(view);\r\n },\r\n activateView: function (view) {\r\n switch (view) {\r\n case this.views.LINEITEMS:\r\n case this.views.INVOICES:\r\n case this.views.PAYMENTS:\r\n case this.views.MARKUPS:\r\n // do nothing\r\n break;\r\n default:\r\n view = this.views.GENERAL;\r\n break;\r\n }\r\n this.$('.nav-link[href=\"#' + view + '\"]').tab('show');\r\n this.options.activeView = view;\r\n },\r\n renderGeneral: function () {\r\n new PJQ.Binder(this.$el, this.model, {\r\n canEdit: !this.options.canEdit ? false : null,\r\n useDecimalPercentFields: true,\r\n watchElements: [\r\n 'input',\r\n 'textarea'\r\n ]\r\n });\r\n\r\n let choices = _.map(PJQ.constants.commitments.changeOrderStatus, (st) => {\r\n return {\r\n id: st,\r\n name: PJQ.constants.commitments.changeOrderStatusNames[st],\r\n disabled: this.options.disabledStatuses != null && this.options.disabledStatuses.indexOf(st) > -1\r\n }\r\n });\r\n this.statusPicker = new PJQ.inputs.Selectpicker({\r\n el: this.$('.select-status'),\r\n choices: choices,\r\n isIntChoices: true,\r\n defaultValue: this.model.get('statusId'),\r\n canEdit: this.options.canEditStatus,\r\n onChange: (newStatus) => {\r\n let oldStatus = this.model.get('statusId');\r\n if (newStatus === oldStatus) {\r\n return;\r\n }\r\n\r\n this.model.set('statusId', newStatus);\r\n if (!this.model.isNew()) {\r\n this.save((success) => {\r\n if (success) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Change Order saved successfully'\r\n });\r\n } else {\r\n this.model.set('statusId', oldStatus);\r\n this.statusPicker.setValue(oldStatus);\r\n }\r\n })\r\n } else {\r\n this.render();\r\n }\r\n }\r\n });\r\n\r\n this.contractCompanyPicker = new PJQ.views.contacts.ContactsSelectInput({\r\n el: this.$('.contracted-company'),\r\n selectedContact: this.model.contractedContact,\r\n canViewContacts: this.options.project.hasPermission('projectContacts.canView'),\r\n canEdit: false,\r\n displayContactsBlock: true\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.change-order-due-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('dueDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('dueDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.change-order-invoiced-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('invoicedDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('invoicedDate', newDate);\r\n }, this)\r\n });\r\n\r\n this.reviewerPicker = new PJQ.views.contacts.ContactsSelectInput({\r\n el: this.$('.change-order-reviewer'),\r\n selectedContact: this.model.reviewer,\r\n canViewContacts: this.options.project.hasPermission('projectContacts.canView'),\r\n shouldHideContacts: true,\r\n canEdit: this.options.canEdit && this.options.isAdmin,\r\n displayContactsBlock: true,\r\n context: PJQ.constants.contacts.contexts.PROJECTCONTACTS,\r\n isSingleChoice: true,\r\n onChange: _.bind(function (selectedContact) {\r\n this.model.reviewer = selectedContact;\r\n this.model.set('reviewerId', selectedContact ? selectedContact.id : null);\r\n }, this)\r\n });\r\n\r\n this.receivedFromPicker = new PJQ.views.contacts.ContactsSelectInput({\r\n el: this.$('.change-order-received-from'),\r\n selectedContact: this.model.receivedFrom,\r\n canViewContacts: this.options.project.hasPermission('projectContacts.canView'),\r\n canEdit: this.options.canEdit && this.options.isAdmin,\r\n displayContactsBlock: true,\r\n context: PJQ.constants.contacts.contexts.PROJECTCONTACTS,\r\n isSingleChoice: true,\r\n onChange: _.bind(function (selectedContact) {\r\n this.model.receivedFrom = selectedContact;\r\n this.model.set('receivedFromId', selectedContact ? selectedContact.id : null);\r\n }, this)\r\n });\r\n\r\n if (_.size(this.customFields) > 0) {\r\n this.customFieldsForm = new PJQ.views.customFields.CustomFieldsForm({\r\n el: this.$('.change-order-custom-fields'),\r\n isEdit: this.options.canEdit,\r\n isAdmin: this.options.isAdmin,\r\n collection: this.customFields,\r\n fieldValues: this.model.get('customFieldValues'),\r\n onChange: _.bind(function () {\r\n this.model.isDirty = true;\r\n }, this)\r\n });\r\n }\r\n\r\n if (this.checkFieldVisible('attachments')) {\r\n this.fileUploader = new PJQ.views.files.FileUploaderGrid({\r\n el: this.$('.cco-file-uploader'),\r\n collection: this.model.attachments,\r\n canUpload: this.options.canEdit,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.canEdit && this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n }\r\n },\r\n renderLineItems() {\r\n if(this.lineItemsView){\r\n this.lineItemsView.remove();\r\n }\r\n\r\n this.lineItemsView = new PJQ.views.budget.LineItemsView({\r\n el: this.$('.cco-line-items'),\r\n collection: this.model.lineItems,\r\n lineItemModel: PJQ.models.commitments.ChangeOrderLineItem,\r\n canEdit: this.options.isSubmitting || this.options.canEditLineItems,\r\n canDelete: this.options.isSubmitting || this.options.canEditLineItems,\r\n accountingMethod: this.model.get('accountingMethod'),\r\n canChangeAccountingMethod: this.options.canEditLineItems,\r\n commitmentId: this.model.get('commitmentId'),\r\n commitment: this.options.commitment,\r\n showBilling: this.model.get('statusId') === PJQ.constants.commitments.changeOrderStatus.APPROVED,\r\n financialMarkups: this.model.markupItems,\r\n enableTax: true,\r\n showSubTotal: true,\r\n showGrandTotal: true,\r\n onAccountingMethodChanged: _.bind(function (value) {\r\n this.model.set('accountingMethod', value);\r\n }, this),\r\n onLineItemChange: _.bind(function () {\r\n this.model.isDirty = true;\r\n }, this),\r\n onLineItemAdd: _.bind(function () {\r\n this.model.isDirty = true;\r\n this.updateCounts();\r\n }, this),\r\n onLineItemDelete: _.bind(function () {\r\n this.model.isDirty = true;\r\n this.updateCounts();\r\n }, this)\r\n });\r\n },\r\n viewCommitment: function () {\r\n this.removeModal();\r\n new PJQ.views.commitments.CommitmentEditModal({\r\n model: new PJQ.models.commitments.Commitment({\r\n id: this.model.get('commitmentId')\r\n })\r\n });\r\n },\r\n getUnCopiedMarkups: function () {\r\n if (this.model == null || this.model.markupItems == null\r\n || this.options.commitment == null || this.options.commitment.markupItems == null) {\r\n return [];\r\n }\r\n\r\n return _.filter(this.options.commitment.markupItems.models, (commitmentMarkup) => {\r\n return !_.some(this.model.markupItems.models, (markup) => {\r\n return markup.get('percent') === commitmentMarkup.get('percent')\r\n && markup.get('name') === commitmentMarkup.get('name')\r\n && markup.get('isVertical') === commitmentMarkup.get('isVertical')\r\n && markup.get('isCompounding') === commitmentMarkup.get('isCompounding');\r\n });\r\n });\r\n },\r\n copyMarkups: function () {\r\n let maxSort = 1;\r\n if (_.size(this.model.markupItems.models) > 0) {\r\n maxSort = _.max(this.model.markupItems.models, (markup) => {\r\n return markup.get('sortOrder');\r\n });\r\n }\r\n _.each(this.getUnCopiedMarkups(), (markup) => {\r\n let copiedMarkup = new PJQ.financialMarkups.models.FinancialMarkup({\r\n percent: markup.get('percent'),\r\n name: markup.get('name'),\r\n isVertical: markup.get('isVertical'),\r\n isCompounding: markup.get('isCompounding'),\r\n costCodeIds: markup.get('costCodeIds'),\r\n costTypeIds: markup.get('costTypeIds'),\r\n appliedCostCodeId: markup.get('appliedCostCodeId'),\r\n appliedCostTypeId: markup.get('appliedCostTypeId'),\r\n isApplied: markup.get('isApplied'),\r\n sortOrder: ++maxSort,\r\n isDirty: true\r\n });\r\n\r\n this.model.markupItems.add(copiedMarkup);\r\n if(copiedMarkup.get('appliedCostCodeId') && copiedMarkup.get('appliedCostTypeId')){\r\n this.model.markupItems.trigger('appliedMarkupChanged', copiedMarkup);\r\n }\r\n });\r\n this.render();\r\n },\r\n renderMarkups: function () {\r\n if (!this.options.isAdmin) {\r\n return;\r\n }\r\n\r\n this.markupsView = new PJQ.financialMarkups.views.FinancialMarkupsList({\r\n el: this.$('.cco-markups'),\r\n collection: this.model.markupItems,\r\n canEdit: this.options.canEditLineItems\r\n });\r\n },\r\n renderERP: function () {\r\n let $erp = this.$('.erp-sync');\r\n if (!this.options.isAdmin || this.erpIntegration == null || !this.options.project.isERPSynced()\r\n || false === this.erpIntegration.getSetting(PJQ.constants.integrations.settings.SYNC_COMMITMENTS)) {\r\n $erp.remove();\r\n return;\r\n }\r\n\r\n this.$('.erp-badge').html(PJQ.helpers.erp.getERPBadge(this.model.erpSyncStatus(), this.model.get('externalObject')));\r\n\r\n let canPush = true,\r\n disablePushReason = \"\";\r\n if (_.size(this.model.lineItems.models) === 0 || this.model.get('statusId') !== PJQ.constants.commitments.changeOrderStatus.APPROVED) {\r\n canPush = false;\r\n disablePushReason = \"Change Order must be approved and have line items\";\r\n }\r\n\r\n if (!this.options.commitment.isERPSynced()) {\r\n canPush = false;\r\n disablePushReason = \"The commitment for this change order must be synced for this commitment can be pushed\";\r\n }\r\n\r\n PJQ.helpers.erp.renderERPButtons($erp, {\r\n status: this.model.erpSyncStatus(),\r\n pushSupported: this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PUSH_COMMITMENT_CHANGE_ORDERS),\r\n canPush: canPush,\r\n canPushChanges: false,\r\n disablePushReason: disablePushReason,\r\n unlinkSupported: this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.UNLINK_COMMITMENT_CHANGE_ORDERS),\r\n });\r\n },\r\n pushERP: function (callback) {\r\n if (!this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PUSH_COMMITMENT_CHANGE_ORDERS)) {\r\n return;\r\n }\r\n\r\n this.save((success) => {\r\n if (success) {\r\n this.erpIntegration.pushCommitmentChangeOrder(this.model, () => {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Order pushed to ERP'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n if (callback && typeof callback === 'function') {\r\n callback();\r\n } else {\r\n this.render();\r\n }\r\n });\r\n }\r\n });\r\n },\r\n undoPushERP: function () {\r\n if (this.model.erpSyncStatus() === PJQ.constants.integrations.erp.syncStatuses.REVIEWING) {\r\n this.erpIntegration.undoPush(this.model, () => {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Order removed from ERP approval'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n this.render();\r\n });\r\n }\r\n },\r\n unlinkERP: function () {\r\n new PJQ.views.modals.YesNo({\r\n header: \"Unlink from ERP\",\r\n body: \"Are you sure you want to unlink this Commitment Change Order from your ERP system?\",\r\n onYes: () => {\r\n let loader = new PJQ.Loader(this.$('.modal-content'));\r\n this.erpIntegration.unlinkCommitmentChangeOrder(this.model, (success) => {\r\n if (success) {\r\n loader.remove();\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Order unlinked from ERP'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n this.render();\r\n }\r\n });\r\n }\r\n });\r\n },\r\n viewHistory: async function () {\r\n let historyItems = [{\r\n date: this.model.get('createdOn'),\r\n person: this.model.get('createdBy'),\r\n action: 'Change Order Created'\r\n }];\r\n\r\n let history = new PJQ.collections.commitments.ChangeOrderHistory({}, {\r\n changeOrderId: this.model.id\r\n });\r\n new PJQ.views.history.HistoryTimelineModal({\r\n collection: history,\r\n subTitle: 'Commitment Change Order #' + this.model.get('number'),\r\n items: historyItems\r\n });\r\n },\r\n exportChangeOrder: function () {\r\n let callback = () => {\r\n PJQ.files.downloadFile(PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders',\r\n value: this.model.get('id')\r\n },\r\n {\r\n endpoint: 'export',\r\n }\r\n ]), {isAPIv2: true});\r\n };\r\n if (this.options.canEdit && this.model.hasChanged()) {\r\n this.save((success) => {\r\n if (success) {\r\n callback();\r\n }\r\n });\r\n } else {\r\n callback();\r\n }\r\n },\r\n checkFieldVisible: function (fieldName) {\r\n if (this.coreFieldSettings) {\r\n let fieldSettings = this.coreFieldSettings.findWhere({fieldName: fieldName});\r\n if (fieldSettings != null) {\r\n return fieldSettings.get('isVisible');\r\n }\r\n }\r\n return true;\r\n },\r\n checkFieldRequired: function (fieldName) {\r\n if (this.coreFieldSettings) {\r\n let fieldSettings = this.coreFieldSettings.findWhere({fieldName: fieldName});\r\n if (fieldSettings != null) {\r\n return fieldSettings.get('isRequired');\r\n }\r\n }\r\n return false;\r\n },\r\n saveEmail: function () {\r\n this.save((success) => {\r\n if (success) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Order saved successfully'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function')\r\n this.options.onSave(this.model);\r\n\r\n this.email();\r\n }\r\n });\r\n },\r\n savePush: function () {\r\n this.save((success) => {\r\n if (success) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Order saved successfully'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function')\r\n this.options.onSave(this.model);\r\n\r\n this.pushERP(() => {\r\n this.removeModal()\r\n });\r\n }\r\n });\r\n },\r\n submitChangeOrder: function () {\r\n this.model.submit(null, _.bind(function (result) {\r\n if (result) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Change Order submitted successfully'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function')\r\n this.options.onSave(this.model);\r\n\r\n this.removeModal();\r\n }\r\n }, this));\r\n },\r\n saveChangeOrder: function () {\r\n let isNew = this.model.isNew();\r\n this.save((success) => {\r\n if (success) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Order saved successfully'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function')\r\n this.options.onSave(this.model, isNew);\r\n\r\n this.removeModal();\r\n }\r\n });\r\n },\r\n validate: function () {\r\n let isValid = true;\r\n\r\n if (this.customFieldsForm != null && !this.customFieldsForm.validate())\r\n isValid = false;\r\n\r\n PJQ.helpers.inputHelpers.setInputError(this.$('.input-number'), true);\r\n if ((!this.model.isNew() || this.checkFieldRequired('number')) && _.size(this.model.get('number')) === 0) {\r\n isValid = false;\r\n PJQ.helpers.inputHelpers.setInputError(this.$('.input-number'), false);\r\n }\r\n\r\n if (this.checkFieldRequired('reviewer')) {\r\n if (!this.reviewerPicker.validate()) {\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('receivedFromId')) {\r\n if (!this.receivedFromPicker.validate()) {\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('changeReason')) {\r\n let $changeReason = this.$('.change-reason');\r\n PJQ.helpers.inputHelpers.setInputError($changeReason, true);\r\n if (_.size(this.model.get('changeReason')) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($changeReason, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('invoicedDate')) {\r\n let $invoicedDate = this.$('.change-order-invoiced-date');\r\n PJQ.helpers.inputHelpers.setInputError($invoicedDate, true);\r\n if (this.model.get('invoicedDate') == null || this.model.get('invoicedDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($invoicedDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('dueDate')) {\r\n let $dueDate = this.$('.change-order-due-date');\r\n PJQ.helpers.inputHelpers.setInputError($dueDate, true);\r\n if (this.model.get('dueDate') == null || this.model.get('dueDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($dueDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('description')) {\r\n let $description = this.$('.change-order-description');\r\n PJQ.helpers.inputHelpers.setInputError($description, true);\r\n if (_.size(this.model.get('description')) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($description, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('attachments')) {\r\n this.fileUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.attachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.fileUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (!isValid) {\r\n this.activateView(this.views.GENERAL);\r\n return isValid;\r\n }\r\n\r\n if (!this.lineItemsView.validate()) {\r\n isValid = false;\r\n this.activateView(this.views.LINEITEMS);\r\n return isValid;\r\n }\r\n\r\n return isValid;\r\n },\r\n save: function (callback) {\r\n if (!this.validate()) {\r\n this.$('.modal').prevObject.scrollTop(0);\r\n if (typeof callback === 'function') {\r\n callback(false);\r\n }\r\n return;\r\n }\r\n\r\n let newMarkupLines = this.model.lineItems.filter(function (lineItem) {\r\n return lineItem.markup && lineItem.isNew();\r\n });\r\n\r\n if(_.size(newMarkupLines) > 0) {\r\n this.model.lineItems.remove(newMarkupLines);\r\n }\r\n\r\n this.model.save({\r\n customFields: this.customFieldsForm != null ? this.customFieldsForm.getChanged() : null,\r\n reviewer: this.reviewer ? this.reviewer.toJSON() : null,\r\n receivedFrom: this.receivedFrom ? this.receivedFrom.toJSON() : null,\r\n lineItems: this.model.lineItems.toJSON()\r\n }, {\r\n success: () => {\r\n this.render();\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n this.options.project.trigger('commitmentCOChanged', this.model);\r\n if (typeof callback === 'function') {\r\n callback(true);\r\n }\r\n },\r\n error: (data) => {\r\n if (typeof callback === 'function') {\r\n callback(false);\r\n }\r\n PJQ.notifications.notify.errorNotify({\r\n message: data.responseJSON.error\r\n });\r\n }\r\n });\r\n\r\n return true;\r\n },\r\n deleteChangeOrder: function () {\r\n let changeOrderId = this.model.id;\r\n new PJQ.views.modals.DeleteCancel({\r\n header: \"Confirm Delete\",\r\n body: \"Are you sure you want to delete this change order?\",\r\n onDelete: _.bind(function () {\r\n this.model.destroy({\r\n success: _.bind(function () {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Change order deleted successfully'\r\n });\r\n\r\n if (typeof this.options.onDelete === 'function')\r\n this.options.onDelete(changeOrderId);\r\n\r\n this.removeModal();\r\n }, this)\r\n });\r\n }, this)\r\n });\r\n },\r\n email: function () {\r\n let projectName = this.options.project?.get('projectName')?.trim();\r\n let subject = `A Change Order has been shared with you ${projectName && _.size(projectName) > 0 ? `for ${projectName}` : ''}`;\r\n new PJQ.views.email.ComposeEmailModal({\r\n header: \"Email Commitment Change Order\",\r\n project: PJQ.app.session.project,\r\n subject: subject,\r\n onSave: _.bind(function (data) {\r\n this.model.share(data, _.bind(function () {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Order email sent'\r\n });\r\n }, this));\r\n }, this)\r\n });\r\n },\r\n close: function () {\r\n if (this.model.hasChanged() && this.options.canEdit) {\r\n new PJQ.views.modals.SaveDontSave({\r\n header: \"Unsaved Changes\",\r\n body: \"Do you want to save changes?\",\r\n onSave: _.bind(function () {\r\n this.saveChangeOrder();\r\n this.removeModal();\r\n }, this),\r\n onDontSave: _.bind(function () {\r\n this.removeModal();\r\n }, this)\r\n });\r\n } else {\r\n this.removeModal();\r\n }\r\n }\r\n});","PJQ.views.commitments.ChangeOrdersList = PJQ.views.BaseView.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'commitment-change-orders-list'),\r\n changeOrderId: null\r\n },\r\n events: {\r\n 'click .btn-settings': 'editSettings',\r\n 'click .btn-add-change-order': 'newChangeOrder',\r\n 'click .btn-view-change-order': 'viewChangeOrderClicked',\r\n 'click .btn-delete-change-order': 'deleteChangeOrderClicked',\r\n 'click .btn-export': 'exportChangeOrderList',\r\n 'click .btn-pull-erp': 'pullERP',\r\n },\r\n beforeFirstRender: async function () {\r\n this.isFetched = false;\r\n\r\n this.options.project = this.options.project ? this.options.project : PJQ.app.session.project;\r\n\r\n if (this.collection == null) {\r\n this.collection = new PJQ.collections.commitments.ChangeOrders(null, {\r\n projectId: this.options.project.get('projectId'),\r\n costCodeId: this.options.costCodeId ? this.options.costCodeId : null,\r\n costTypeId: this.options.costTypeId ? this.options.costTypeId : null\r\n });\r\n }\r\n\r\n if (!this.collection.isFetched) {\r\n await this.collection.fetch();\r\n }\r\n\r\n this.userSettings = await PJQ.app.session.fetchCommitmentChangeOrderUserSettings();\r\n this.customFields = await this.options.project.fetchCommitmentChangeOrderCustomFields();\r\n this.erpIntegration = await PJQ.app.session.fetchERPIntegration();\r\n\r\n if (this.erpIntegration != null && this.erpIntegration.getSetting('syncProjects')) {\r\n await this.options.project.fetchERPObject();\r\n }\r\n\r\n this.isFetched = true;\r\n this.render();\r\n },\r\n beforeRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n this.options.canAdd = this.options.project.hasPermission('commitmentChangeOrders.canAdd');\r\n this.options.canViewCommitments = this.options.project.hasPermission('commitments.canView');\r\n this.options.isAdmin = this.options.project.hasPermission('commitmentChangeOrders.isAdmin');\r\n },\r\n renderData: function () {\r\n return {\r\n collection: this.collection,\r\n isFetched: this.isFetched\r\n }\r\n },\r\n afterRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n this.renderView();\r\n\r\n PJQ.app.session.project.off('commitmentCOChanged');\r\n PJQ.app.session.project.on('commitmentCOChanged', function (changeOrder) {\r\n this.collection.add(changeOrder);\r\n this.render();\r\n }, this);\r\n\r\n if (this.options.changeOrderId > 0) {\r\n let initChangeOrder = this.collection.get(this.options.changeOrderId);\r\n if (initChangeOrder != null) {\r\n this.viewChangeOrder(initChangeOrder);\r\n this.options.changeOrderId = null;\r\n }\r\n }\r\n },\r\n renderERPButton: function () {\r\n let $erp = this.$('.erp-sync')\r\n if (!this.options.isAdmin || this.erpIntegration == null || !this.erpIntegration.getSetting(PJQ.constants.integrations.settings.SYNC_COMMITMENTS) || !this.options.project || !this.options.project.isERPSynced()) {\r\n $erp.remove();\r\n return;\r\n }\r\n\r\n let pullSupported = this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PULL_COMMITMENT_CHANGE_ORDERS);\r\n PJQ.helpers.erp.renderERPButtons($erp, {\r\n pushSupported: false,\r\n pullSupported: pullSupported\r\n });\r\n },\r\n pullERP: function () {\r\n if (this.options.project != null && this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PULL_COMMITMENT_CHANGE_ORDERS)) {\r\n this.erpIntegration.pullCommitmentChangeOrders(this.options.project, _.bind(function (res) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment Change Orders successfully pulled from ERP'\r\n });\r\n\r\n this.collection.reset(res);\r\n this.render();\r\n }, this));\r\n }\r\n },\r\n renderView: function () {\r\n if (this.dataTable) {\r\n this.dataTable.remove();\r\n this.dataTable = null;\r\n }\r\n\r\n this.dataTable = this.getDataTableInstance();\r\n },\r\n getDataTableInstance: function () {\r\n return new PJQ.views.commitments.ChangeOrderDataTable({\r\n el: this.$('.change-orders-data'),\r\n rowId: \"cid\",\r\n data: this.collection.models,\r\n statusIds: this.options.statusIds,\r\n isAdmin: this.options.isAdmin,\r\n headerData: _.bind(function () {\r\n return {\r\n project: this.options.project,\r\n canAdd: this.options.canAdd,\r\n isAdmin: this.options.isAdmin\r\n };\r\n }, this),\r\n userSettings: this.userSettings,\r\n canViewCommitments: this.options.canViewCommitments,\r\n settings: this.userSettings.getSettings(PJQ.constants.commitments.view.CHANGE_ORDERS),\r\n order: [[1, 'asc']],\r\n colReorder: {\r\n fixedColumnsLeft: 1,\r\n fixedColumnsRight: 1,\r\n realtime: false\r\n },\r\n columnOrderChanged: _.bind(function () {\r\n this.userSettings.save();\r\n }, this),\r\n onRowDoubleClick: _.bind(function (row) {\r\n this.viewChangeOrder(row.data());\r\n }, this),\r\n afterDataTableRender: _.bind(function () {\r\n if (PJQ.app.session.erpIntegration && PJQ.app.session.erpIntegration.id > 0) {\r\n this.renderERPButton();\r\n }\r\n }, this),\r\n contextMenuOptions: {\r\n actions: [\r\n {\r\n name: 'View',\r\n onClick: _.bind(function (row) {\r\n this.viewChangeOrder(row.data());\r\n }, this)\r\n }\r\n ]\r\n }\r\n });\r\n },\r\n exportChangeOrderList: function () {\r\n PJQ.files.downloadFile(PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: PJQ.app.session.project.id\r\n },\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n },\r\n {\r\n endpoint: 'export'\r\n }\r\n ], [\r\n {\r\n parameter: 'timeZoneOffset',\r\n value: new Date().getTimezoneOffset()\r\n }\r\n ]), {isAPIv2: true});\r\n },\r\n newChangeOrder: function (e) {\r\n this.viewChangeOrder();\r\n },\r\n viewChangeOrderClicked: function (e) {\r\n let row = this.dataTable.getRow($(e.currentTarget).closest('tr'));\r\n this.viewChangeOrder(row.data());\r\n },\r\n viewChangeOrder: function (changeOrder) {\r\n let isNew = changeOrder == null\r\n new PJQ.views.commitments.ChangeOrderEditModal({\r\n model: changeOrder,\r\n onSave: _.bind(function (changeOrder) {\r\n if (isNew) {\r\n this.collection.add(changeOrder);\r\n }\r\n this.renderView();\r\n }, this),\r\n onDelete: _.bind(function (changeOrder) {\r\n this.collection.remove(changeOrder);\r\n this.renderView();\r\n }, this)\r\n });\r\n },\r\n deleteChangeOrderClicked: function (e) {\r\n let row = this.dataTable.getRow($(e.currentTarget).closest('tr'));\r\n this.deleteChangeOrder(row);\r\n },\r\n deleteChangeOrder: function (row) {\r\n if (row != null) {\r\n let changeOrder = row.data();\r\n if (changeOrder != null) {\r\n new PJQ.views.modals.DeleteCancel({\r\n header: \"Delete Change Order\",\r\n body: \"Are you sure you want to delete this Change Order?\",\r\n onDelete: _.bind(function () {\r\n changeOrder.destroy({\r\n success: _.bind(function () {\r\n this.dataTable.removeRow(row);\r\n if (typeof this.options.onDelete === 'function') {\r\n this.options.onDelete(changeOrder);\r\n }\r\n }, this)\r\n });\r\n }, this)\r\n });\r\n }\r\n }\r\n },\r\n editSettings: function () {\r\n new PJQ.views.commitments.ChangeOrderSettingsModal({\r\n changeOrdersView: this,\r\n onSave: _.bind(function () {\r\n this.renderView();\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Settings updated successfully'\r\n });\r\n }, this)\r\n });\r\n }\r\n});\r\n\r\nPJQ.views.commitments.ModalViewChangeOrders = PJQ.views.BaseModal.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-view-change-orders'),\r\n maxWidth: 1000,\r\n isShowCloseButton: true,\r\n onSave: _.noop,\r\n isAdmin: true\r\n },\r\n events: {},\r\n beforeModalCreated: function () {\r\n\r\n },\r\n renderData: function () {\r\n return {\r\n model: this.model\r\n }\r\n },\r\n afterRender: function () {\r\n if (this.model != null) {\r\n new PJQ.views.commitments.ChangeOrdersList({\r\n el: this.$('.modal-body'),\r\n model: this.model,\r\n costCodeId: this.model.get('costCodeId'),\r\n costTypeId: this.model.get('costTypeId'),\r\n project: this.options.project,\r\n statusIds: this.options.statusIds\r\n })\r\n }\r\n },\r\n});\r\n\r\nPJQ.views.commitments.SelectCommitmentChangeOrdersModal = PJQ.views.BaseModal.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-select-commitment-change-orders'),\r\n width: '60%',\r\n maxWidth: 700,\r\n onSave: _.noop,\r\n headerSubText: null\r\n },\r\n events: {\r\n \"change .select-change-order\": \"selectChangeOrder\",\r\n \"click .btn-save\": \"save\",\r\n \"click .btn-cancel\": \"cancel\"\r\n },\r\n beforeModalCreated: async function () {\r\n this.isFetched = false;\r\n this.options.isAdmin = PJQ.app.session.project.hasPermission('commitmentChangeOrders.isAdmin');\r\n this.selectedChangeOrders = [];\r\n\r\n if (this.collection == null) {\r\n this.collection = new PJQ.collections.commitments.ChangeOrders(null, {\r\n projectId: this.options.project.get('projectId')\r\n });\r\n }\r\n\r\n if (!this.collection.isFetched) {\r\n await this.collection.fetch();\r\n }\r\n\r\n this.isFetched = true;\r\n this.render();\r\n },\r\n renderData: function () {\r\n return {\r\n headerSubText: this.options.headerSubText,\r\n isSingleChoice: this.options.isSingleChoice\r\n }\r\n },\r\n afterRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n let data;\r\n if (_.size(this.options.filterStatuses) > 0) {\r\n data = _.filter(this.collection.models, (model) => {\r\n let statusId = model.get('statusId');\r\n\r\n if (_.isArray(this.options.filterStatuses)) {\r\n return _.includes(this.options.filterStatuses, statusId);\r\n } else if (_.isNumber(this.options.filterStatuses)) {\r\n return this.options.filterStatuses === statusId;\r\n }\r\n\r\n return false;\r\n\r\n });\r\n } else {\r\n data = this.collection.models;\r\n }\r\n\r\n this.dataTable = new PJQ.views.dataTables.DataTable({\r\n el: this.$('.cco-table'),\r\n data: data,\r\n isHideSearch: true,\r\n order: [],\r\n columns: [{\r\n \"data\": \"attributes.isSelected\",\r\n \"title\": \"\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"render\": _.bind(function (data) {\r\n return ('
');\r\n }, this)\r\n },\r\n {\r\n \"data\": \"attributes.number\",\r\n \"title\": \"Number\",\r\n \"orderable\": true\r\n },\r\n {\r\n \"columnData\": \"attributes.contractedContact.companyName\",\r\n \"title\": \"Company\",\r\n \"titleSettings\": \"Contracted Company\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return row.get('contractedContact') ? row.get('contractedContact').companyName : 'N/A';\r\n }, this)\r\n },\r\n {\r\n \"data\": \"attributes.description\",\r\n \"title\": \"Description\",\r\n \"orderable\": false\r\n },\r\n {\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Amount\",\r\n \"orderable\": false,\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(data);\r\n }, this)\r\n }],\r\n dom: '<\"top\"<\"clear\">>rt<\"bottom\"p<\"clear\">>'\r\n });\r\n },\r\n selectChangeOrder: function (e) {\r\n let target = $(e.currentTarget),\r\n changeOrder = this.dataTable.getRow(target.closest('tr')).data();\r\n\r\n if (this.options.isSingleChoice) {\r\n this.$('.select-cco').not(target).text('Select').prop('checked', false);\r\n if (changeOrder.get('isSelected')) {\r\n changeOrder.set('isSelected', false);\r\n this.selectedChangeOrder = null;\r\n } else {\r\n changeOrder.set('isSelected', true);\r\n this.selectedChangeOrder = changeOrder;\r\n this.collection.get(changeOrder.id);\r\n _.each(this.collection.models, _.bind(function (dtChangeOrder) {\r\n if (changeOrder.id !== dtChangeOrder.id)\r\n dtChangeOrder.set('isSelected', false);\r\n }, this));\r\n }\r\n this.$('.btn-save').attr('disabled', this.selectedChangeOrder == null);\r\n\r\n if (typeof this.options.onChangeOrderSelected === 'function') {\r\n this.options.onChangeOrderSelected(this.selectedChangeOrder);\r\n }\r\n } else {\r\n if (changeOrder.get('isSelected')) {\r\n target.text('Select').addClass('btn-primary').removeClass('btn-secondary');\r\n changeOrder.set('isSelected', false);\r\n this.selectedChangeOrders = _.reject(this.selectedChangeOrders, function (selChangeOrder) {\r\n return selChangeOrder.id === changeOrder.id;\r\n });\r\n } else {\r\n target.text('Deselect').addClass('btn-secondary').removeClass('btn-primary');\r\n changeOrder.set('isSelected', true);\r\n this.selectedChangeOrders.push(changeOrder);\r\n }\r\n this.$('.btn-save').attr('disabled', this.selectedChangeOrders == null);\r\n\r\n if (typeof this.options.onChangeOrderSelected === 'function') {\r\n this.options.onChangeOrderSelected(this.selectedChangeOrders);\r\n }\r\n }\r\n },\r\n cancel: function () {\r\n if (this.options.onCancel) {\r\n this.options.onCancel();\r\n }\r\n this.removeModal();\r\n },\r\n save: function () {\r\n if (this.options.onSave) {\r\n this.options.onSave(this.selectedChangeOrder ? this.selectedChangeOrder : this.selectedChangeOrders);\r\n this.removeModal();\r\n }\r\n }\r\n});","//Models\r\nPJQ.models.commitments.ChangeOrder = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id',\r\n endpoint: function () {\r\n let arr = [];\r\n if (this.isNew()) {\r\n arr.push({\r\n endpoint: 'projects',\r\n value: this.get('projectId')\r\n });\r\n }\r\n arr.push({\r\n endpoint: 'commitmentchangeorders',\r\n value: this.id\r\n });\r\n return PJQ.helpers.urlHelpers.generateEndpoint(arr);\r\n },\r\n parse: function (model) {\r\n if (!model)\r\n return model;\r\n\r\n if (model.commitment) {\r\n this.commitment = model.commitment;\r\n }\r\n\r\n this.lineItems = new PJQ.collections.commitments.ChangeOrderLineItems(model.lineItems);\r\n this.attachments = new PJQ.collections.commitments.ChangeOrderAttachments(model.attachments);\r\n this.invoices = new PJQ.collections.invoicing.PayableInvoices(model.invoices);\r\n\r\n this.markupItems = new PJQ.financialMarkups.collections.FinancialMarkups(model ? model.markupItems : null);\r\n\r\n if (model && model.contractedContact) {\r\n if (model.contractedContact instanceof PJQ.models.BaseModel) {\r\n this.contractedContact = model.contractedContact;\r\n } else {\r\n this.contractedContact = new PJQ.models.contacts.Contact(model.contractedContact);\r\n }\r\n }\r\n\r\n if (model && model.reviewer) {\r\n if (model.reviewer instanceof PJQ.models.BaseModel) {\r\n this.reviewer = model.reviewer;\r\n } else {\r\n this.reviewer = new PJQ.models.contacts.Contact(model.reviewer);\r\n }\r\n }\r\n\r\n if (model && model.receivedFrom) {\r\n if (model.receivedFrom instanceof PJQ.models.BaseModel) {\r\n this.receivedFrom = model.receivedFrom;\r\n } else {\r\n this.receivedFrom = new PJQ.models.contacts.Contact(model.receivedFrom);\r\n }\r\n }\r\n\r\n return model;\r\n },\r\n beforeSave: function () {\r\n let newMarkupLines = this.lineItems.filter(function (lineItem) {\r\n return lineItem.markup && lineItem.isNew();\r\n });\r\n this.lineItems.remove(newMarkupLines);\r\n\r\n this.set({\r\n lineItems: this.lineItems.toJSON(),\r\n attachments: this.attachments.toJSON(),\r\n markupItems: this.markupItems.toJSON()\r\n });\r\n },\r\n submit: function (signature, callback) {\r\n this.beforeSave();\r\n new PJQ.ajax.Request({\r\n endpoint: this.endpoint() + '/submit',\r\n isAPIv2: true,\r\n data: this.toJSON()\r\n }).post().done(_.bind(function (response) {\r\n if (typeof callback === 'function') {\r\n this.set(this.parse(response));\r\n callback(true);\r\n }\r\n }, this)).fail(_.bind(function (response) {\r\n if (typeof callback === 'function') {\r\n callback(false);\r\n }\r\n }, this));\r\n },\r\n syncERP: function (callback) {\r\n return PJQ.models.commitments.Commitment.prototype.syncERP.call(this, callback);\r\n },\r\n unlinkERP: function (callback) {\r\n return PJQ.models.commitments.Commitment.prototype.unlinkERP.call(this, callback);\r\n },\r\n makeERPUrl: function (integration) {\r\n return PJQ.models.commitments.Commitment.prototype.makeERPUrl.call(this, integration);\r\n },\r\n share: function (data, callback) {\r\n new PJQ.ajax.Request({\r\n endpoint: this.endpoint() + '/email',\r\n isAPIv2: true,\r\n data: {\r\n subject: data != null ? data.subject : null,\r\n body: data != null ? data.body : null,\r\n toEmails: data != null ? data.toEmails : null,\r\n ccEmails: data != null ? data.ccEmails : null,\r\n }\r\n }).post().done(_.bind(function (response) {\r\n callback();\r\n }, this)).fail(_.bind(function (xhr, err, result) {\r\n //todo: error\r\n }, this));\r\n },\r\n getSubTotal: function () {\r\n return this.get('amount') + this.get('markupAmount');\r\n },\r\n getGrandTotal: function () {\r\n return this.getSubTotal() + this.get('taxAmount');\r\n }\r\n});\r\n\r\nPJQ.models.commitments.ChangeOrderHistoryItem = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n actionNames: {\r\n 'status': 'Status Changed',\r\n 'submit': 'Submitted',\r\n 'email': 'Email Sent'\r\n },\r\n getActionName: function () {\r\n return this.actionNames[this.get('action')] ?? this.get('action');\r\n },\r\n getDescription: function () {\r\n switch (this.get('action')) {\r\n case 'status':\r\n let fromStatus = this.get('data').from,\r\n toStatus = this.get('data').to;\r\n if (fromStatus == null || toStatus == null) {\r\n return '';\r\n }\r\n\r\n return '' + PJQ.constants.commitments.changeOrderStatusNames[fromStatus] + '' + PJQ.constants.commitments.changeOrderStatusNames[toStatus];\r\n case 'email':\r\n let to = this.get('data').to;\r\n if (_.size(to) === 0) {\r\n return '';\r\n }\r\n\r\n return 'To: ' + to.join(', ');\r\n default:\r\n return '';\r\n }\r\n }\r\n});\r\n\r\nPJQ.models.commitments.ChangeOrderLineItem = PJQ.models.budget.BaseLineItem.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id'\r\n});\r\n\r\nPJQ.models.commitments.ChangeOrderAttachment = PJQ.models.files.File.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id'\r\n});\r\n\r\nPJQ.models.commitments.ChangeOrderCustomField = PJQ.models.customFields.CustomField.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n },\r\n {\r\n endpoint: 'customfields',\r\n value: this.get('id')\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.models.commitments.ChangeOrderSettings = PJQ.models.budget.Settings.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'settingId',\r\n endpoint: function () {\r\n if (this.options.projectId > 0) {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n },\r\n {\r\n endpoint: 'settings'\r\n }\r\n ]);\r\n }\r\n\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n },\r\n {\r\n endpoint: 'settings'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.models.commitments.ChangeOrderUserSettings = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'settingId',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n },\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'user'\r\n }\r\n ]);\r\n },\r\n getSettings: function (view) {\r\n return _.find(this.attributes.viewSettings, _.bind(function (setting) {\r\n return setting.view === view;\r\n }, this));\r\n }\r\n});\r\n\r\nPJQ.models.commitments.ChangeOrderFieldSetting = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'settingId',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'fields',\r\n value: this.id ? this.id : 'commitmentchangeorders'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\n//Collections\r\nPJQ.collections.commitments.ChangeOrders = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.ChangeOrder,\r\n endpoint: function () {\r\n let params = [];\r\n if (this.options.costCodeId && this.options.costTypeId) {\r\n params.push({\r\n parameter: 'costCodeId',\r\n value: this.options.costCodeId\r\n }, {\r\n parameter: 'costTypeId',\r\n value: this.options.costTypeId\r\n });\r\n }\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n }\r\n ], params);\r\n },\r\n getTotalAmountsByStatus: function () {\r\n let result = {};\r\n _.each(PJQ.constants.commitments.changeOrderStatusBuckets, function (bucket) {\r\n let total = 0;\r\n _.each(this.models, function (commitment) {\r\n if (bucket.statuses.indexOf(commitment.get('statusId')) !== -1) {\r\n total += commitment.get('amount');\r\n }\r\n });\r\n result[bucket.name] = total;\r\n }, this);\r\n return result;\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.ChangeOrderHistory = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.ChangeOrderHistoryItem,\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders',\r\n value: this.options.changeOrderId\r\n },\r\n {\r\n endpoint: 'history'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.ChangeOrderLineItems = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.ChangeOrderLineItem,\r\n endpoint: function () {\r\n let params = [];\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders',\r\n value: this.options.changeOrderId\r\n },\r\n {\r\n endpoint: 'lineitems'\r\n }\r\n ], params);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.ChangeOrderAttachments = PJQ.collections.files.Files.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.ChangeOrderAttachment,\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders',\r\n value: this.options.changeOrderId\r\n },\r\n {\r\n endpoint: 'attachments'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.ChangeOrderCustomFields = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.ChangeOrderCustomField,\r\n endpoint: function () {\r\n if (this.options.projectId > 0) {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n },\r\n {\r\n endpoint: 'customfields'\r\n }\r\n ]);\r\n }\r\n\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitmentchangeorders'\r\n },\r\n {\r\n endpoint: 'customfields'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.ChangeOrderFieldSettings = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.ChangeOrderFieldSetting,\r\n endpoint: function () {\r\n if (this.options.projectId > 0) {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'fields',\r\n value: 'commitmentchangeorders'\r\n }\r\n ]);\r\n\r\n }\r\n\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'fields',\r\n value: 'commitmentchangeorders'\r\n }\r\n ]);\r\n }\r\n});\r\n","PJQ.views.commitments.ChangeOrderSettingsModal = PJQ.views.BaseModal.extend({\n defaults: {\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-commitment-change-order-settings'),\n minWidth: '600px',\n },\n events: {\n 'change .select-column': 'columnSelected',\n 'click .btn-edit-company-default': 'editCompanySettings',\n 'click button.settings-save': 'onSave'\n },\n beforeModalCreated: function () {\n this.userSettings = this.options.changeOrdersView.userSettings;\n },\n beforeRender: function () {\n // copy userSettings for our UI; we only update global userSettings object on save.\n this.options.userSettings = [];\n\n this.options.defaultStatusFilter = this.userSettings.get('defaultStatusFilter');\n _.each(this.userSettings.attributes.viewSettings, _.bind(function (setting) {\n let columns = this.options.changeOrdersView.dataTable.getColumns(true),\n selectedColumns = (_.size(setting.columns) > 0) ? setting.columns : setting.columnsDefault;\n _.each(columns, _.bind(function (column) {\n column.visible = selectedColumns.indexOf(column.columnData) !== -1\n }, this));\n\n this.options.userSettings.push({\n view: setting.view,\n rowsPerPage: setting.rowsPerPage,\n columns: columns\n });\n }, this));\n },\n renderData: function () {\n return {\n userSettings: this.userSettings\n }\n },\n afterRender: function () {\n this.defaultFilterSelectPicker = new PJQ.inputs.Selectpicker({\n el: this.$('.select-filter-default'),\n isIntChoices: true,\n isMultiple: true,\n defaultValue: this.userSettings.get('defaultStatusFilter'),\n onChange: _.bind(function (value) {\n this.options.defaultStatusFilter = value\n }, this)\n });\n\n this.rowsPerPage = new PJQ.inputs.Selectpicker({\n el: this.$('select.rows-per-page'),\n isIntChoices: true,\n onChange: _.bind(function (value) {\n this.currentView.rowsPerPage = value;\n }, this)\n });\n\n this.selectView(PJQ.constants.commitments.view.CHANGE_ORDERS);\n },\n editCompanySettings: function () {\n this.userSettings = new PJQ.models.commitments.ChangeOrderUserSettings(null, {\n forCompany: true\n });\n this.userSettings.fetch({\n success: _.bind(function () {\n this.render();\n }, this)\n });\n },\n selectView: function (view) {\n this.currentView = _.find(this.options.userSettings, _.bind(function (setting) {\n return setting.view === view;\n }, this));\n\n if (view.indexOf('-') === -1) {\n this.rowsPerPage.setValue(this.currentView.rowsPerPage);\n this.$('div.rows-per-page').show();\n }\n else\n this.$('div.rows-per-page').hide();\n\n if (this.dataTable) {\n this.dataTable.undelegateEvents();\n $(this.dataTable.el).empty();\n }\n\n this.dataTable = new PJQ.views.dataTables.DataTable({\n el: this.$('div.select-columns-datatable'),\n data: this.currentView.columns,\n isHideSearch: true,\n pageLength: 6,\n order: [],\n columns: [\n {\"data\": \"title\", \"title\": \"Column\", \"orderable\": false},\n {\n \"data\": \"visible\",\n \"title\": \"Show\",\n \"orderable\": false,\n \"searchable\": false,\n \"render\": _.bind(function (data) {\n return ('
');\n }, this),\n \"width\": '10%'\n }\n ],\n dom: '<\"top\"<\"clear\">>rt<\"bottom\"p<\"clear\">>'\n });\n\n },\n columnSelected: function (sender) {\n this.dataTable.dataTable.row($(sender.currentTarget).closest('tr')).data().visible = $(sender.currentTarget).prop('checked');\n },\n onSave: function () {\n let fnOnSave = _.bind(function () {\n if (typeof this.options.onSave === 'function')\n this.options.onSave();\n this.removeModal();\n }, this);\n\n this.userSettings.set('defaultStatusFilter', this.options.defaultStatusFilter);\n\n _.each(this.options.userSettings, _.bind(function (settingTemp) {\n _.each(this.userSettings.get('viewSettings'), _.bind(function (setting) {\n if (settingTemp.view === setting.view) {\n setting.rowsPerPage = settingTemp.rowsPerPage;\n\n let columns = _.size(setting.columns) > 0 ? setting.columns.slice() : setting.columnsDefault.slice();\n\n // update columns\n _.each(settingTemp.columns, _.bind(function (column) {\n if (column.visible) {\n if (columns.indexOf(column.columnData) === -1)\n columns.push(column.columnData);\n }\n else {\n if (columns.indexOf(column.columnData) !== -1)\n columns = _.filter(columns, _.bind(function (columnTemp) {\n return columnTemp != column.columnData;\n }, this));\n }\n }, this));\n\n setting.columns = columns;\n }\n }, this));\n }, this));\n\n this.userSettings.save(null, {\n success: _.bind(function () {\n fnOnSave();\n }, this)\n });\n },\n});","PJQ.views.commitments.CommitmentDataTable = PJQ.views.dataTables.DataTable.extend({\r\n defaults: {\r\n language: {\r\n emptyTable: 'No Commitments have been created yet',\r\n zeroRecords: \"No Commitments matched the search criteria\"\r\n },\r\n subTemplates: {\r\n header: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'data-table-header-commitments')\r\n },\r\n toggleRowClass: '.commitment-toggle-row'\r\n },\r\n events: {\r\n 'click .view-commitment': 'viewCommitmentClicked',\r\n },\r\n beforeDataTableRender: function () {\r\n this.options.pageLength = this.options.settings ? this.options.settings.rowsPerPage : 10;\r\n },\r\n getDefaultFilter: function () {\r\n let defaultFilter = {};\r\n defaultFilter[PJQ.constants.commitments.filterType.TYPE_FILTER] = this.options.userSettings.get('defaultCommitmentTypeFilter');\r\n defaultFilter[PJQ.constants.commitments.filterType.TYPE_FILTER] = _.map(defaultFilter[PJQ.constants.commitments.filterType.TYPE_FILTER], function (type) {\r\n return type * -1;\r\n });\r\n defaultFilter[PJQ.constants.commitments.filterType.STATUS_FILTER] = _.size(this.options.statusIds) > 0 ? this.options.statusIds : this.options.userSettings.get('defaultCommitmentStatusFilter');\r\n return defaultFilter;\r\n },\r\n afterSearch: function () {\r\n if (typeof this.options.afterSearch === 'function') {\r\n this.options.afterSearch();\r\n }\r\n },\r\n afterHeaderRender: function () {\r\n new PJQ.inputs.Selectpicker({\r\n el: this.$('.commitments-filter'),\r\n defaultValue: this.getDefaultFilter(),\r\n isGrouped: true,\r\n isIntChoices: true,\r\n isMultiple: true,\r\n noneSelectedText: 'No Filters',\r\n onChange: _.bind(function (value) {\r\n _.each(value, _.bind(function (value, filter) {\r\n if (filter === PJQ.constants.commitments.filterType.TYPE_FILTER) {\r\n value = _.map(value, function (type) {\r\n return type * -1;\r\n });\r\n }\r\n this.setFilter(filter, value);\r\n }, this));\r\n }, this)\r\n });\r\n _.each(this.getDefaultFilter(), function (value, filter) {\r\n if (filter === PJQ.constants.commitments.filterType.TYPE_FILTER) {\r\n value = _.map(value, function (type) {\r\n return type * -1;\r\n });\r\n }\r\n this.setFilter(filter, value);\r\n }, this)\r\n },\r\n getFilterData: function () {\r\n let typeFilter = this.getFilter(PJQ.constants.commitments.filterType.TYPE_FILTER),\r\n statusFilter = this.getFilter(PJQ.constants.commitments.filterType.STATUS_FILTER);\r\n if (_.size(typeFilter) === 0 && _.size(statusFilter) === 0) {\r\n return this.options.data;\r\n }\r\n\r\n return _.filter(this.options.data, function (row) {\r\n return (_.size(typeFilter) === 0 || _.contains(typeFilter, row.get('commitmentType'))) && (_.size(statusFilter) === 0 || _.contains(statusFilter, row.get('statusId')));\r\n });\r\n },\r\n getColumns: function (includeAllColumns = false) {\r\n let columns = [],\r\n includeColumns = ['createdOn', 'commitmentType', 'number', 'title', 'description', 'commitmentStatus', 'deliveryDate', 'startDate', 'estimatedCompletionDate', 'actualCompletionDate', 'contractDate', 'signedContractReceivedDate', 'executionDate', 'issuedOnDate', 'returnedDate', 'letterOfIntentDate', 'approvalLetterDate', 'paymentTerms', 'shipVia', 'inclusions', 'exclusions', 'contractedContact.companyName', 'status', 'amount', 'markupAmount', 'taxAmount', 'defaultWorkRetainage', 'defaultMaterialRetainage', 'currentRetainage', 'grandTotal', 'approvedChanges', 'contractTotal', 'progressAmount', 'amountRemaining'];\r\n if (this.options.customFields) {\r\n _.each(this.options.customFields.models, _.bind(function (customField) {\r\n includeColumns.push('fieldValue' + customField.get('fieldNumber'));\r\n }, this));\r\n }\r\n\r\n if (!includeAllColumns) {\r\n if (_.size(this.options.settings.columns) > 0)\r\n includeColumns = this.options.settings.columns;\r\n else\r\n includeColumns = this.options.settings.columnsDefault;\r\n\r\n columns.push({\r\n \"columnData\": \"erpObject\",\r\n \"data\": null,\r\n \"title\": \"\",\r\n \"width\": \"20px\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"defaultContent\": '',\r\n \"render\": (data, type, row) => {\r\n if (!this.options.isAdmin) {\r\n return \"\";\r\n }\r\n\r\n let exObj = row.get('externalObject');\r\n if (exObj == null) {\r\n return '';\r\n }\r\n\r\n return PJQ.helpers.erp.getERPBadge(exObj.status, exObj);\r\n }\r\n });\r\n }\r\n\r\n _.each(includeColumns, _.bind(function (columnName) {\r\n switch (columnName) {\r\n case 'status':\r\n columns.push({\r\n \"columnData\": \"status\",\r\n \"data\": \"attributes.statusId\",\r\n \"title\": \"Status\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.constants.commitments.commitmentStatusNames[row.get('statusId')]\r\n }, this)\r\n });\r\n break;\r\n case 'commitmentType':\r\n columns.push({\r\n \"columnData\": \"commitmentType\",\r\n \"data\": \"attributes.commitmentType\",\r\n \"title\": \"Type\",\r\n \"width\": \"110px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.constants.commitments.commitmentTypeNames[row.get('commitmentType')]\r\n }, this)\r\n });\r\n break;\r\n case 'number':\r\n columns.push({\r\n \"columnData\": \"number\",\r\n \"data\": \"attributes.number\",\r\n \"title\": \"Number\",\r\n \"render\": _.bind(function (data, type, row) {\r\n if (type === 'sort' || type === 'type') {\r\n return row.get('number');\r\n }\r\n\r\n return '' + row.get('number') + '';\r\n }, this)\r\n });\r\n break;\r\n case 'title':\r\n columns.push({\r\n \"columnData\": \"title\",\r\n \"data\": \"attributes.title\",\r\n \"title\": \"Title\"\r\n });\r\n break;\r\n case 'description':\r\n columns.push({\r\n \"columnData\": \"description\",\r\n \"data\": \"attributes.description\",\r\n \"title\": \"Description\"\r\n });\r\n break;\r\n case 'createdOn':\r\n columns.push({\r\n \"columnData\": \"createdOn\",\r\n \"data\": \"attributes.createdOn\",\r\n \"title\": 'Created',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE_TIME);\r\n }, this)\r\n });\r\n break;\r\n case 'deliveryDate':\r\n columns.push({\r\n \"columnData\": \"deliveryDate\",\r\n \"data\": \"attributes.deliveryDate\",\r\n \"title\": 'Delivery',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'startDate':\r\n columns.push({\r\n \"columnData\": \"startDate\",\r\n \"data\": \"attributes.startDate\",\r\n \"title\": 'Start',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'estimatedCompletionDate':\r\n columns.push({\r\n \"columnData\": \"estimatedCompletionDate\",\r\n \"data\": \"attributes.estimatedCompletionDate\",\r\n \"title\": 'Est. Complete',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'actualCompletionDate':\r\n columns.push({\r\n \"columnData\": \"actualCompletionDate\",\r\n \"data\": \"attributes.actualCompletionDate\",\r\n \"title\": 'Act. Complete',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'contractDate':\r\n columns.push({\r\n \"columnData\": \"contractDate\",\r\n \"data\": \"attributes.contractDate\",\r\n \"title\": 'Contract Date',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'signedContractReceivedDate':\r\n columns.push({\r\n \"columnData\": \"signedContractReceivedDate\",\r\n \"data\": \"attributes.signedContractReceivedDate\",\r\n \"title\": 'Signed Date',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'executionDate':\r\n columns.push({\r\n \"columnData\": \"executionDate\",\r\n \"data\": \"attributes.executionDate\",\r\n \"title\": 'Execution Date',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'issuedOnDate':\r\n columns.push({\r\n \"columnData\": \"issuedOnDate\",\r\n \"data\": \"attributes.issuedOnDate\",\r\n \"title\": 'Issued On',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'returnedDate':\r\n columns.push({\r\n \"columnData\": \"returnedDate\",\r\n \"data\": \"attributes.returnedDate\",\r\n \"title\": 'Returned On',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'letterOfIntentDate':\r\n columns.push({\r\n \"columnData\": \"letterOfIntentDate\",\r\n \"data\": \"attributes.letterOfIntentDate\",\r\n \"title\": 'Letter of Intent',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'approvalLetterDate':\r\n columns.push({\r\n \"columnData\": \"approvalLetterDate\",\r\n \"data\": \"attributes.approvalLetterDate\",\r\n \"title\": 'Approval Letter',\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(data) === 0) {\r\n return '';\r\n } else if (type === 'sort' || type === 'type') {\r\n return data ? new Date(data) : null;\r\n }\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(data), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n });\r\n break;\r\n case 'paymentTerms':\r\n columns.push({\r\n \"columnData\": \"paymentTerms\",\r\n \"data\": \"attributes.paymentTerms\",\r\n \"title\": \"Payment Terms\"\r\n });\r\n break;\r\n case 'shipVia':\r\n columns.push({\r\n \"columnData\": \"shipVia\",\r\n \"data\": \"attributes.shipVia\",\r\n \"title\": \"Shipping Info\"\r\n });\r\n break;\r\n case 'inclusions':\r\n columns.push({\r\n \"columnData\": \"inclusions\",\r\n \"data\": \"attributes.inclusions\",\r\n \"title\": \"Inclusions\"\r\n });\r\n break;\r\n case 'exclusions':\r\n columns.push({\r\n \"columnData\": \"exclusions\",\r\n \"data\": \"attributes.exclusions\",\r\n \"title\": \"Exclusions\"\r\n });\r\n break;\r\n case 'contractedContact.companyName':\r\n columns.push({\r\n \"columnData\": \"contractedContact.companyName\",\r\n \"title\": \"Company\",\r\n \"titleSettings\": \"Contracted Company\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return row.get('contractedContact') ? row.get('contractedContact').companyName : 'N/A';\r\n }, this)\r\n });\r\n break;\r\n case 'amount':\r\n columns.push({\r\n \"columnData\": \"amount\",\r\n \"data\": \"attributes.amount\",\r\n \"width\": \"150px\",\r\n \"title\": \"Amount\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('amount'));\r\n }, this)\r\n });\r\n break;\r\n case 'taxAmount':\r\n columns.push({\r\n \"columnData\": \"taxAmount\",\r\n \"data\": \"attributes.taxAmount\",\r\n \"title\": \"Tax\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(data);\r\n }, this)\r\n });\r\n break;\r\n case 'markupAmount':\r\n columns.push({\r\n \"columnData\": \"markupAmount\",\r\n \"data\": \"attributes.markupAmount\",\r\n \"title\": \"Markup\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(data);\r\n }, this)\r\n });\r\n break;\r\n case 'defaultWorkRetainage':\r\n columns.push({\r\n \"columnData\": \"defaultWorkRetainagePercent\",\r\n \"data\": \"attributes.defaultWorkRetainagePercent\",\r\n \"width\": \"150px\",\r\n \"title\": \"Default Work Retainage\",\r\n \"className\": \"text-align-right\",\r\n \"render\": (data, type, row) => {\r\n return PJQ.helpers.formatHelpers.formatPercent(row.get('defaultWorkRetainagePercent') ?? 0);\r\n }\r\n });\r\n break;\r\n case 'defaultMaterialRetainage':\r\n columns.push({\r\n \"columnData\": \"defaultMaterialRetainagePercent\",\r\n \"data\": \"attributes.defaultMaterialRetainagePercent\",\r\n \"width\": \"150px\",\r\n \"title\": \"Default Material Retainage\",\r\n \"className\": \"text-align-right\",\r\n \"render\": (data, type, row) => {\r\n return PJQ.helpers.formatHelpers.formatPercent(row.get('defaultMaterialRetainagePercent') ?? 0);\r\n }\r\n });\r\n break;\r\n case 'currentRetainage':\r\n columns.push({\r\n \"columnData\": \"currentRetainage\",\r\n \"data\": \"attributes.retainageAmount\",\r\n \"width\": \"150px\",\r\n \"title\": \"Current Retainage\",\r\n \"className\": \"text-align-right\",\r\n \"render\": (data, type, row) => {\r\n let retainage = (row.get('retainageAmount') ?? 0) - (row.get('retainageReleasedAmount') ?? 0);\r\n if (type === 'sort' || type === 'type') {\r\n return retainage;\r\n }\r\n return PJQ.helpers.formatHelpers.formatCurrency(retainage);\r\n }\r\n });\r\n break;\r\n case 'grandTotal':\r\n columns.push({\r\n \"columnData\": \"grandTotal\",\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Grand Total\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.getGrandTotal());\r\n }, this)\r\n });\r\n break;\r\n case 'approvedChanges':\r\n columns.push({\r\n \"columnData\": \"approvedChanges\",\r\n \"data\": \"attributes.approvedChanges\",\r\n \"width\": \"150px\",\r\n \"title\": \"Approved Changes\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('approvedChanges'));\r\n }, this)\r\n });\r\n break;\r\n case 'contractTotal':\r\n columns.push({\r\n \"columnData\": \"contractTotal\",\r\n \"data\": \"attributes.amount\",\r\n \"width\": \"150px\",\r\n \"title\": \"Contract Total\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('amount') + row.get('approvedChanges'));\r\n }, this)\r\n });\r\n break;\r\n case 'progressAmount':\r\n columns.push({\r\n \"columnData\": \"progressAmount\",\r\n \"data\": \"attributes.progressAmount\",\r\n \"width\": \"150px\",\r\n \"title\": \"Billed to Date\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('progressAmount'));\r\n }, this)\r\n });\r\n break;\r\n case 'amountRemaining':\r\n columns.push({\r\n \"columnData\": \"amountRemaining\",\r\n \"data\": \"attributes.amountRemaining\",\r\n \"width\": \"150px\",\r\n \"title\": \"Amount Remaining\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('amount') + row.get('approvedChanges') - row.get('progressAmount'));\r\n }, this)\r\n });\r\n break;\r\n default:\r\n if (columnName.startsWith('fieldValue')) {\r\n _.each(this.options.customFields.models, function (customField) {\r\n if (columnName === 'fieldValue' + customField.get('fieldNumber')) {\r\n columns.push({\r\n \"columnData\": 'fieldValue' + customField.get('fieldNumber'),\r\n \"title\": customField.get('name'),\r\n \"className\": [PJQ.constants.commitments.customFieldType.INTEGER, PJQ.constants.commitments.customFieldType.MONEY, PJQ.constants.commitments.customFieldType.PERCENT].indexOf(customField.get('fieldTypeId')) !== -1 ? \"text-align-right\" : \"\",\r\n \"render\": function (data, type, row) {\r\n let fieldValue = row.getCustomFieldValue(customField.get('id'));\r\n fieldValue = (fieldValue !== null) ? fieldValue : '';\r\n switch (customField.get('fieldTypeId')) {\r\n case PJQ.constants.commitments.customFieldType.BOOLEAN:\r\n if (fieldValue != null)\r\n fieldValue = fieldValue ? 'Yes' : 'No';\r\n break;\r\n case PJQ.constants.commitments.customFieldType.CHOICE:\r\n let choices = [];\r\n // convert single choice value into array so that the logic below can work for both types.\r\n if (typeof fieldValue === 'number')\r\n fieldValue = [fieldValue];\r\n\r\n _.each(customField.choices.models, _.bind(function (choice) {\r\n if (_.find(fieldValue, function (value) {\r\n return value === choice.get('id');\r\n }))\r\n choices.push(choice.get('name'));\r\n }, this));\r\n\r\n fieldValue = choices.join((', '));\r\n break;\r\n case PJQ.constants.commitments.customFieldType.DATE:\r\n if (fieldValue) {\r\n if (type !== 'sort' && type !== 'type')\r\n fieldValue = PJQ.helpers.dateHelpers.getDateString(new Date(fieldValue), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }\r\n if (fieldValue === undefined)\r\n fieldValue = '';\r\n\r\n break;\r\n case PJQ.constants.commitments.customFieldType.DATETIME:\r\n if (fieldValue) {\r\n if (type !== 'sort' && type !== 'type')\r\n fieldValue = PJQ.helpers.dateHelpers.getDateString(new Date(fieldValue), PJQ.helpers.dateHelpers.dateFormats.DATE_TIME);\r\n }\r\n if (fieldValue === undefined)\r\n fieldValue = '';\r\n\r\n break;\r\n case PJQ.constants.commitments.customFieldType.INTEGER:\r\n if (type !== 'sort' && type !== 'type' && fieldValue) {\r\n fieldValue = parseInt(fieldValue).toLocaleString();\r\n }\r\n break;\r\n case PJQ.constants.commitments.customFieldType.MONEY:\r\n if (type === 'sort' || type === 'type') {\r\n if (fieldValue && fieldValue !== '$')\r\n fieldValue = parseFloat(PJQ.helpers.formatHelpers.numbersOnly(fieldValue, true));\r\n else\r\n fieldValue = 0;\r\n } else {\r\n fieldValue = PJQ.helpers.formatHelpers.formatCurrency(parseInt(PJQ.helpers.formatHelpers.numbersOnly(fieldValue)));\r\n }\r\n break;\r\n case PJQ.constants.commitments.customFieldType.PERCENT:\r\n if (type === 'sort' || type === 'type') {\r\n if (!fieldValue)\r\n fieldValue = 0;\r\n } else {\r\n fieldValue = fieldValue ? PJQ.helpers.formatHelpers.formatCurrency(parseInt(PJQ.helpers.formatHelpers.numbersOnly(fieldValue)), 2, false) + '%' : '';\r\n }\r\n break;\r\n }\r\n\r\n return fieldValue;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n break;\r\n }\r\n }, this));\r\n\r\n if (!includeAllColumns) {\r\n columns.push({\r\n \"title\": '',\r\n \"render\": _.bind(function (data, type, row) {\r\n return '
';\r\n }, this),\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"width\": \"90px\",\r\n \"className\": \"text-center\",\r\n \"visible\": true\r\n });\r\n }\r\n\r\n return columns;\r\n },\r\n getRowChildTable: function (childOpts) {\r\n childOpts.costTypes = this.options.costTypes;\r\n childOpts.unitsOfMeasure = this.options.unitsOfMeasure;\r\n childOpts.groups = this.options.groups;\r\n childOpts.parentDataTable = this;\r\n childOpts.dom = 't';\r\n return new PJQ.views.commitments.LineItemDataTable(childOpts);\r\n },\r\n getRowChildData: function (row) {\r\n return new PJQ.collections.commitments.CommitmentLineItems(null, {\r\n commitmentId: row.data().id\r\n });\r\n }\r\n});\r\n\r\nPJQ.views.commitments.LineItemDataTable = PJQ.views.commitments.BaseDataTable.extend({\r\n defaults: {\r\n language: {\r\n zeroRecords: \"No Line Items Added\"\r\n },\r\n canEdit: false,\r\n onEditLineItem: _.noop,\r\n onDeleteLineItem: _.noop\r\n },\r\n getColumns: function (includeAllColumns = false) {\r\n let columns = [],\r\n includeColumns;\r\n if (this.options.parentData && this.options.parentData.get('accountingMethod') === PJQ.constants.budget.accountingMethod.AMOUNT)\r\n includeColumns = ['group', 'costTypeDescription', 'description', 'amount', 'billedToDate', 'amountRemaining'];\r\n else\r\n includeColumns = ['group', 'costTypeDescription', 'description', 'quantity', 'unitOfMeasure', 'unitPrice', 'amount', 'billedToDate', 'amountRemaining'];\r\n\r\n _.each(includeColumns, _.bind(function (columnName) {\r\n switch (columnName) {\r\n case 'description':\r\n columns.push({\r\n \"columnData\": \"description\",\r\n \"data\": \"attributes.description\",\r\n \"title\": \"Description\"\r\n\r\n });\r\n break;\r\n case 'quantity':\r\n columns.push({\r\n \"columnData\": \"quantity\",\r\n \"data\": \"attributes.quantity\",\r\n \"width\": \"8%\",\r\n \"title\": \"Units\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatDecimal(row.get('quantity'), 2);\r\n }, this)\r\n });\r\n break;\r\n case 'unitOfMeasure':\r\n columns.push({\r\n \"columnData\": \"unitOfMeasure\",\r\n \"data\": \"attributes.unitId\",\r\n \"orderable\": (!this.options.canEdit),\r\n \"title\": \"Unit\",\r\n \"width\": \"5%\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let unitOfMeasure = this.options.unitsOfMeasure.get(row.get('unitId'));\r\n return unitOfMeasure ? unitOfMeasure.get('code') : '';\r\n }, this)\r\n });\r\n break;\r\n case 'unitPrice':\r\n columns.push({\r\n \"columnData\": \"unitPrice\",\r\n \"data\": \"attributes.unitPrice\",\r\n \"width\": \"10%\",\r\n \"title\": \"Unit Price\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('unitPrice'));\r\n }, this)\r\n });\r\n break;\r\n case 'amount':\r\n columns.push({\r\n \"columnData\": \"amount\",\r\n \"data\": \"attributes.amount\",\r\n \"width\": \"10%\",\r\n \"title\": \"Amount\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('amount'));\r\n }, this)\r\n });\r\n break;\r\n case 'billedToDate':\r\n columns.push({\r\n \"columnData\": \"billedToDate\",\r\n \"data\": \"attributes.billedToDate\",\r\n \"width\": \"10%\",\r\n \"title\": \"Billed\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('billedToDate'));\r\n }, this)\r\n });\r\n break;\r\n case 'amountRemaining':\r\n columns.push({\r\n \"columnData\": \"amountRemaining\",\r\n \"data\": \"attributes.amountRemaining\",\r\n \"width\": \"10%\",\r\n \"title\": \"Amount Remaining\",\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('amount') - row.get('billedToDate'));\r\n }, this)\r\n });\r\n break;\r\n case 'group':\r\n columns.push({\r\n \"columnData\": \"group\",\r\n \"title\": \"Cost Code\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let group = this.options.groups.get(row.get('groupId'));\r\n return group ? group.get('groupName') : '';\r\n }, this)\r\n });\r\n break;\r\n case 'costType':\r\n columns.push({\r\n \"columnData\": \"costType\",\r\n \"title\": \"Type Code\",\r\n \"titleSettings\": \"Cost Type\",\r\n \"width\": \"8%\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let costType = this.options.costTypes.get(row.get('costTypeId'));\r\n return costType ? costType.get('code') : '';\r\n }, this)\r\n });\r\n break;\r\n case 'costTypeDescription':\r\n columns.push({\r\n \"columnData\": \"costTypeDescription\",\r\n \"title\": \"Type\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let costType = this.options.costTypes.get(row.get('costTypeId'));\r\n return costType ? costType.get('name') : '';\r\n }, this)\r\n });\r\n break;\r\n }\r\n }, this));\r\n\r\n if (!includeAllColumns && this.options.canEdit) {\r\n columns.push({\r\n \"title\": '',\r\n \"render\": _.bind(function (data, type, row) {\r\n\r\n let html = '
';\r\n html += '';\r\n\r\n if (PJQ.app.session.project.hasPermission('commitments.canEdit'))\r\n html += '';\r\n\r\n html += '
';\r\n\r\n return html;\r\n }, this),\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"width\": \"90px\",\r\n \"className\": \"text-center\",\r\n \"visible\": true\r\n });\r\n }\r\n\r\n return columns;\r\n }\r\n});\r\n","PJQ.views.commitments.CommitmentEditModal = PJQ.views.BaseModal.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-commitment-edit'),\r\n width: '95%',\r\n maxWidth: 1500,\r\n model: null,\r\n fromChangeRequest: null,\r\n commitmentType: null,\r\n isShowCloseButton: true,\r\n onSave: _.noop(),\r\n onDelete: _.noop()\r\n },\r\n events: {\r\n 'click .copy-to-billto': 'copyToHelper',\r\n 'click .copy-to-shipto': 'copyToHelper',\r\n 'click .btn-new-change-order': 'newChangeOrder',\r\n 'click .btn-view-change-order': 'viewChangeOrderClicked',\r\n 'click .btn-new-invoice': 'newInvoice',\r\n 'click .btn-view-invoice': 'viewInvoiceClicked',\r\n 'click .btn-delete': 'deleteCommitment',\r\n 'click .btn-close': 'close',\r\n 'change .input-coi-required': 'renderCOIApproval',\r\n 'change .input-w9-required': 'renderW9Approval',\r\n 'change .input-lien-waiver-required': 'renderLienWaiverApproval',\r\n 'click .btn-save-email': 'saveEmail',\r\n 'click .btn-save': 'saveCommitment',\r\n 'click .btn-submit-for-review': 'submitForReview',\r\n 'click .btn-sign-submit': 'signAndSubmit',\r\n 'click .btn-push-erp': 'pushERP',\r\n 'click .btn-undo-push-erp': 'undoPushERP',\r\n 'click .btn-unlink-erp': 'unlinkERP',\r\n 'click .btn-export': 'exportCommitment',\r\n 'click .btn-email': 'email',\r\n 'keydown .input-percent': 'numbersOnly',\r\n 'change .input-percent': 'formatPercent',\r\n 'click .nav-link': 'activeViewChanged',\r\n 'click .btn-view-payment': 'viewPaymentClicked',\r\n 'click .btn-view-history': 'viewHistory'\r\n },\r\n beforeModalCreated: async function () {\r\n this.isFetched = false;\r\n\r\n this.options.project = this.options.project ? this.options.project : PJQ.app.session.project;\r\n this.coreFieldSettings = await this.options.project.fetchCommitmentFieldSettings();\r\n this.terms = await this.options.project.fetchCommitmentTerms();\r\n this.customFields = await this.options.project.fetchCommitmentCustomFields();\r\n this.settings = await this.options.project.fetchCommitmentSettings();\r\n\r\n this.invoiceSettings = null;\r\n if (this.options.project.hasPermission('payableInvoices.canView')) {\r\n this.invoiceSettings = await this.options.project.fetchPayableInvoiceSettings();\r\n }\r\n\r\n this.costCodes = await this.options.project.fetchCostCodes();\r\n this.costTypes = await this.options.project.fetchCostTypes();\r\n this.unitsOfMeasure = await this.options.project.fetchUnitsOfMeasure();\r\n this.erpIntegration = await PJQ.app.session.fetchERPIntegration();\r\n this.uploadCustomFields = _.filter(this.customFields.models, function (model) {\r\n return model.get('fieldTypeId') === 13;\r\n }, this);\r\n\r\n if (this.erpIntegration != null && this.erpIntegration.getSetting('syncProjects')) {\r\n await this.options.project.fetchERPObject();\r\n }\r\n\r\n if (this.model == null) {\r\n let customFieldValues = [];\r\n _.each(this.customFields.models, function (model, index) {\r\n let value = model.get('defaultValue') ? model.get('defaultValue') : '';\r\n if (model.get('fieldType') === 'CHOICE') {\r\n value = parseInt(value);\r\n }\r\n customFieldValues.push({\r\n fieldNumber: model.get('fieldNumber'),\r\n fieldTypeId: model.get('fieldTypeId'),\r\n fieldType: model.get('fieldType'),\r\n isMultiple: model.get('isMultiple'),\r\n value: value,\r\n id: model.get('id')\r\n })\r\n }, this);\r\n\r\n this.model = new PJQ.models.commitments.Commitment({\r\n accountingMethod: this.settings.get('defaultAccountingMethod'),\r\n contractedContact: this.options.contractedContact ?? null,\r\n commitmentType: this.options.commitmentType ? this.options.commitmentType : PJQ.constants.commitments.commitmentType.PURCHASE_ORDER,\r\n title: this.options.fromChangeRequest ? this.options.fromChangeRequest.get('title') : '',\r\n description: this.options.fromChangeRequest ? this.options.fromChangeRequest.get('description') : '',\r\n projectId: PJQ.app.session.project.id,\r\n statusId: PJQ.constants.commitments.commitmentStatus.DRAFT,\r\n billTo: {},\r\n shipTo: {},\r\n lineItems: this.options.lineItems,\r\n customFieldValues: customFieldValues\r\n });\r\n }\r\n\r\n if (this.model.isNew()) {\r\n this.model.set({\r\n defaultWorkRetainagePercent: this.settings.get('defaultWorkRetainagePercent'),\r\n defaultMaterialRetainagePercent: this.settings.get('defaultMaterialRetainagePercent'),\r\n })\r\n }\r\n\r\n if (!this.model.isNew() && this.options.fetch !== false) {\r\n await this.model.fetch();\r\n }\r\n\r\n this.isFetched = true;\r\n this.render();\r\n },\r\n beforeRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n this.options.hasEditPermission = this.options.project.hasPermission('commitments.canEdit');\r\n this.options.canEdit = this.options.hasEditPermission;\r\n this.options.canEditDates = this.options.hasEditPermission;\r\n this.options.canUploadAttachments = this.options.canEdit;\r\n this.options.canEditLineItems = this.options.project.hasPermission('commitments.canEditLineItems');\r\n this.options.canViewChangeOrders = this.options.project.hasPermission('commitmentChangeOrders.canView');\r\n this.options.canAddChangeOrders = this.options.project.hasPermission('commitmentChangeOrders.canAdd');\r\n this.options.canViewInvoices = this.options.project.hasPermission('payableInvoices.canView');\r\n this.options.canAddInvoices = this.options.project.hasPermission('payableInvoices.canAdd');\r\n this.options.isAdmin = this.options.project.hasPermission('commitments.isAdmin');\r\n this.options.canDelete = this.options.isAdmin;\r\n this.options.canEditStatus = this.options.isAdmin;\r\n\r\n this.options.disabledStatuses = null;\r\n let fnGetGreaterStatuses = (statusId) => {\r\n return _.filter(PJQ.constants.commitments.commitmentStatus, (st) => {\r\n return st < statusId;\r\n });\r\n },\r\n status = this.model.get('statusId');\r\n if (status === PJQ.constants.commitments.commitmentStatus.APPROVED ||\r\n status === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_COMPLETE) {\r\n this.options.canAddChangeOrders = PJQ.app.session.project.hasPermission('commitmentChangeOrders.canAdd');\r\n this.options.canAddInvoices = PJQ.app.session.project.hasPermission('payableInvoices.canAdd');\r\n } else {\r\n this.options.canAddChangeOrders = false\r\n this.options.canAddInvoices = false;\r\n }\r\n\r\n let isContractedContact = (PJQ.app.session.contact && PJQ.app.session.contact.id === this.model.get('contractedContactId')) ||\r\n (this.model.contractedContact != null && PJQ.app.session.user.id === this.model.contractedContact.get('userId'));\r\n this.options.isSubmitting = isContractedContact && (status === PJQ.constants.commitments.commitmentStatus.DRAFT\r\n || status === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_OUT_FOR_BID\r\n || status === PJQ.constants.commitments.commitmentStatus.OUT_FOR_SIGNATURE);\r\n\r\n if (status === PJQ.constants.commitments.commitmentStatus.DRAFT) {\r\n this.options.canEdit = isContractedContact || this.options.hasEditPermission;\r\n this.options.canEditDates = this.options.canEdit;\r\n this.options.canUploadAttachments = this.options.canEdit;\r\n this.options.canEditLineItems = PJQ.app.session.project.hasPermission('commitments.canEditLineItems');\r\n } else if (status === PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_PROCESSING\r\n || status === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_OUT_FOR_BID) {\r\n this.options.canUploadAttachments = isContractedContact || this.options.canEdit;\r\n this.options.canEditLineItems = isContractedContact || PJQ.app.session.project.hasPermission('commitments.canEditLineItems');\r\n } else if (status === PJQ.constants.commitments.commitmentStatus.OUT_FOR_SIGNATURE) {\r\n this.options.canUploadAttachments = isContractedContact || this.options.canEdit;\r\n this.options.canEditLineItems = this.options.isAdmin;\r\n } else if (status === PJQ.constants.commitments.commitmentStatus.APPROVED\r\n || status === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_COMPLETE\r\n || status === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_TERMINATED\r\n || status === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_VOID\r\n || status === PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_CLOSED) {\r\n this.options.canEditLineItems = false;\r\n this.options.canDelete = false;\r\n } else if (status === PJQ.constants.commitments.commitmentStatus.SUBMITTED) {\r\n this.options.canEditLineItems = false;\r\n }\r\n\r\n if (this.model.invoices.models.length > 0) {\r\n this.options.disabledStatuses = fnGetGreaterStatuses(PJQ.constants.commitments.commitmentStatus.APPROVED);\r\n this.options.canEditLineItems = false;\r\n }\r\n\r\n if (this.erpIntegration != null) {\r\n let syncStatus = this.model.erpSyncStatus();\r\n if (syncStatus === PJQ.constants.integrations.erp.syncStatuses.REVIEWING\r\n || syncStatus === PJQ.constants.integrations.erp.syncStatuses.APPROVED\r\n || syncStatus === PJQ.constants.integrations.erp.syncStatuses.SYNCED\r\n ) {\r\n this.options.disabledStatuses = fnGetGreaterStatuses(PJQ.constants.commitments.commitmentStatus.APPROVED);\r\n this.options.canEdit = false;\r\n this.options.canEditLineItems = false;\r\n this.options.canDelete = false;\r\n this.options.isSubmitting = false;\r\n }\r\n }\r\n },\r\n renderData: function () {\r\n return {\r\n model: this.model,\r\n erpIntegration: this.erpIntegration,\r\n customFields: this.customFields,\r\n canViewChangeOrders: this.options.canViewChangeOrders,\r\n canAddChangeOrders: this.options.canAddChangeOrders,\r\n canViewInvoices: this.options.canViewInvoices,\r\n canAddInvoices: this.options.canAddInvoices,\r\n isSubmitting: this.options.isSubmitting,\r\n canEdit: this.options.canEdit,\r\n canUploadAttachments: this.options.canUploadAttachments,\r\n canEditLineItems: this.options.canEditLineItems,\r\n canDelete: this.options.canDelete,\r\n isAdmin: this.options.isAdmin,\r\n isFetched: this.isFetched,\r\n activeView: this.options.activeView,\r\n views: this.views,\r\n terms: this.terms,\r\n settings: this.settings,\r\n invoiceSettings: this.invoiceSettings,\r\n checkFieldVisible: _.bind(this.checkFieldVisible, this),\r\n checkFieldRequired: _.bind(this.checkFieldRequired, this),\r\n uploadCustomFields: this.uploadCustomFields,\r\n hasPendingInvoice: this.model && this.model.invoices.models.length > 0 && null != _.find(this.model.invoices.models, (invoice) => {\r\n return invoice.get('statusId') !== PJQ.constants.invoicing.payableInvoiceStatus.APPROVED\r\n && invoice.get('statusId') !== PJQ.constants.invoicing.payableInvoiceStatus.COMPLETE;\r\n })\r\n }\r\n },\r\n afterRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n window.testModel = this.model;\r\n\r\n this.activateView(this.options.activeView);\r\n\r\n this.stopListening(this.model.markupItems);\r\n this.listenTo(this.model.markupItems, 'update', (markup) => {\r\n if (markup && markup.get('delete') && (markup.lineItem || markup.get('lineItemId'))) {\r\n let lineItem = markup.lineItem ?? this.model.lineItems.findWhere({appliedMarkupId: markup.id});\r\n\r\n if (lineItem) {\r\n if (lineItem.get('id') > 0) {\r\n lineItem.set('delete', true);\r\n } else {\r\n this.model.lineItems.remove(lineItem);\r\n }\r\n }\r\n }\r\n\r\n this.updateCounts();\r\n this.lineItemsView.render();\r\n });\r\n\r\n this.stopListening(this.model);\r\n this.listenTo(this.model, 'change:statusId', () => {\r\n this.renderERP();\r\n });\r\n this.stopListening(this.model.lineItems);\r\n this.listenTo(this.model.lineItems, 'update', () => {\r\n this.renderERP();\r\n });\r\n this.renderERP();\r\n\r\n this.renderGeneral();\r\n\r\n this.renderLineItems();\r\n if (!this.model.isNew()) {\r\n if (this.options.canViewChangeOrders) {\r\n this.renderChangeOrders();\r\n }\r\n if (this.options.canViewInvoices) {\r\n this.renderInvoices();\r\n this.renderPayments();\r\n }\r\n }\r\n this.renderMarkups();\r\n this.updateCounts();\r\n },\r\n updateCounts: function () {\r\n this.$('.count-line-items').text(_.size(_.filter(this.model.lineItems.models, (item) => {\r\n return !item.get('delete');\r\n })));\r\n this.$('.count-change-orders').text(_.size(this.model.changeOrders.models));\r\n this.$('.count-invoices').text(_.size(this.model.invoices.models));\r\n this.$('.count-payments').text(_.size(this.model.payments.models));\r\n this.$('.count-markups').text(_.size(_.filter(this.model.markupItems.models, function (item) {\r\n return !item.get('delete');\r\n })));\r\n },\r\n views: {\r\n GENERAL: 'C_General',\r\n LINEITEMS: 'C_LineItems',\r\n CHANGEORDERS: 'C_ChangeOrders',\r\n INVOICES: 'C_Invoices',\r\n PAYMENTS: 'C_Payments',\r\n MARKUPS: 'C_Markups',\r\n HISTORY: 'C_History'\r\n },\r\n activeViewChanged: function (e) {\r\n let view = e.target.hash ? e.target.hash.replace('#', '') : null;\r\n this.activateView(view);\r\n },\r\n activateView: function (view) {\r\n switch (view) {\r\n case this.views.LINEITEMS:\r\n case this.views.CHANGEORDERS:\r\n case this.views.INVOICES:\r\n case this.views.PAYMENTS:\r\n case this.views.MARKUPS:\r\n // do nothing\r\n break;\r\n default:\r\n view = this.views.GENERAL;\r\n break;\r\n }\r\n\r\n this.$('.nav-link[href=\"#' + view + '\"]').tab('show');\r\n this.options.activeView = view;\r\n },\r\n renderGeneral: function () {\r\n new PJQ.Binder(this.$('.general-pane'), this.model, {\r\n canEdit: !this.options.canEdit ? false : null,\r\n useDecimalPercentFields: true,\r\n watchElements: [\r\n 'input',\r\n 'textarea'\r\n ]\r\n });\r\n\r\n let choices = [];\r\n _.each(PJQ.constants.commitments.commitmentStatus, (st) => {\r\n if (this.model.get('commitmentType') === PJQ.constants.commitments.commitmentType.SUBCONTRACT\r\n && (st === PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_PROCESSING\r\n || st === PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_PARTIALLY_RECEIVED\r\n || st === PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_RECEIVED\r\n || st === PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_CLOSED)) {\r\n return;\r\n } else if (this.model.get('commitmentType') === PJQ.constants.commitments.commitmentType.PURCHASE_ORDER\r\n && (st === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_OUT_FOR_BID\r\n || st === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_COMPLETE\r\n || st === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_TERMINATED\r\n || st === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_VOID)) {\r\n return;\r\n }\r\n\r\n choices.push({\r\n id: st,\r\n name: PJQ.constants.commitments.commitmentStatusNames[st],\r\n disabled: this.options.disabledStatuses != null && this.options.disabledStatuses.indexOf(st) > -1\r\n });\r\n });\r\n this.statusPicker = new PJQ.inputs.Selectpicker({\r\n el: this.$('.select-status'),\r\n choices: choices,\r\n isIntChoices: true,\r\n defaultValue: this.model.get('statusId'),\r\n canEdit: this.options.canEditStatus,\r\n onChange: (newStatus) => {\r\n let oldStatus = this.model.get('statusId');\r\n if (newStatus === oldStatus) {\r\n return;\r\n }\r\n\r\n this.model.set('statusId', newStatus);\r\n if (!this.model.isNew()) {\r\n this.save((success) => {\r\n if (success) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment saved successfully'\r\n });\r\n } else {\r\n this.model.set('statusId', oldStatus);\r\n this.statusPicker.setValue(oldStatus);\r\n }\r\n })\r\n } else {\r\n this.render();\r\n }\r\n }\r\n });\r\n\r\n let defaultTerm = _.find(this.terms.models, function (model) {\r\n return model.get('isDefault');\r\n }, this);\r\n if (this.model.isNew() && defaultTerm != null && defaultTerm.id > 0) {\r\n this.model.set('termsId', defaultTerm.id);\r\n }\r\n this.termsPicker = new PJQ.inputs.Selectpicker({\r\n el: this.$('.select-terms'),\r\n isIntChoices: true,\r\n defaultValue: this.model.get('termsId'),\r\n noneSelectedText: this.options.canEdit && this.options.isAdmin ? 'Select Value' : 'Not Selected',\r\n canEdit: this.options.canEdit && this.options.isAdmin,\r\n onChange: _.bind(function (newTermsId) {\r\n this.model.set('termsId', newTermsId ? newTermsId : 0);\r\n }, this)\r\n });\r\n\r\n this.contractCompanyPicker = new PJQ.views.contacts.ContactsSelectInput({\r\n el: this.$('.contracted-company'),\r\n selectedContact: this.model.contractedContact,\r\n canViewContacts: this.options.project.hasPermission('projectContacts.canView'),\r\n canEdit: !this.model.isERPSynced() && (this.options.canEdit && this.options.isAdmin),\r\n hideUsers: true,\r\n displayContactsBlock: true,\r\n context: PJQ.constants.contacts.contexts.PROJECTCONTACTS,\r\n isSingleChoice: true,\r\n onChange: _.bind(function (selectedContact) {\r\n this.model.contractedContact = selectedContact;\r\n this.model.set('contractedContactId', selectedContact ? selectedContact.id : null);\r\n }, this)\r\n });\r\n\r\n this.invoiceContactPicker = new PJQ.views.contacts.ContactsSelectInput({\r\n el: this.$('.invoice-contact'),\r\n selectedContact: this.model.invoiceContact,\r\n canViewContacts: this.options.project.hasPermission('projectContacts.canView'),\r\n canEdit: this.options.canEdit && this.options.isAdmin,\r\n displayContactsBlock: true,\r\n context: PJQ.constants.contacts.contexts.PROJECTCONTACTS,\r\n hideUsers: true,\r\n isSingleChoice: true,\r\n onChange: _.bind(function (selectedContact) {\r\n this.model.invoiceContact = selectedContact;\r\n this.model.set('invoiceContactId', selectedContact ? selectedContact.id : null);\r\n }, this)\r\n });\r\n\r\n if (_.size(this.customFields) > 0) {\r\n this.commitmentCustomFieldsForm = new PJQ.views.customFields.CustomFieldsForm({\r\n el: this.$('.commitment-custom-fields'),\r\n canEdit: this.options.canEdit,\r\n isAdmin: this.options.isAdmin,\r\n collection: this.customFields,\r\n fieldValues: this.model.get('customFieldValues'),\r\n onChange: _.bind(function () {\r\n this.model.isDirty = true;\r\n }, this)\r\n });\r\n }\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.start-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('startDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('startDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.est-complete-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('estimatedCompletionDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('estimatedCompletionDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.act-complete-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('actualCompletionDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('actualCompletionDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.contract-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('contractDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('contractDate', newDate);\r\n }, this)\r\n });\r\n\r\n if (this.model.get('commitmentType') === PJQ.constants.commitments.commitmentType.PURCHASE_ORDER) {\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.delivery-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('deliveryDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('deliveryDate', newDate);\r\n }, this)\r\n });\r\n\r\n let bTo = this.model.get('billTo');\r\n if (bTo == null) {\r\n bTo = {};\r\n }\r\n\r\n if (_.size(bTo.country) === 0) {\r\n bTo.country = 'US';\r\n }\r\n\r\n this.billToStatePicker = new PJQ.inputs.StatePicker({\r\n el: this.$('.billto-state'),\r\n country: bTo.country,\r\n defaultValue: bTo.state,\r\n size: 20,\r\n onChange: (value) => {\r\n let billTo = this.model.get('billTo');\r\n billTo.state = value;\r\n this.model.set('billTo', billTo);\r\n }\r\n });\r\n\r\n this.billToCountryPicker = new PJQ.inputs.CountryPicker({\r\n el: this.$('.billto-country'),\r\n defaultValue: bTo.country,\r\n statePicker: this.billToStatePicker,\r\n zipInput: this.$('.billto-zip'),\r\n enableInternational: this.options.project.preferences.hasPref(PJQ.constants.preferenceTypes.ENABLE_INTERNATIONAL_COUNTRIES),\r\n size: 20,\r\n onChange: (value) => {\r\n let billTo = this.model.get('billTo');\r\n billTo.country = value;\r\n this.model.set('billTo', billTo);\r\n }\r\n });\r\n\r\n PJQ.helpers.inputHelpers.inputMaskPhone(this.$('input.billto-phone'));\r\n PJQ.helpers.inputHelpers.inputMaskPhone(this.$('input.billto-fax'));\r\n\r\n let sTo = this.model.get('shipTo');\r\n if (sTo == null) {\r\n sTo = {};\r\n }\r\n\r\n if (_.size(sTo.country) === 0) {\r\n sTo.country = 'US';\r\n }\r\n\r\n this.shipToStatePicker = new PJQ.inputs.StatePicker({\r\n el: this.$('.shipto-state'),\r\n country: sTo.country,\r\n defaultValue: sTo.state,\r\n size: 20,\r\n onChange: (value) => {\r\n let shipTo = this.model.get('shipTo');\r\n shipTo.state = value;\r\n this.model.set('shipTo', shipTo);\r\n }\r\n });\r\n\r\n this.shipToCountryPicker = new PJQ.inputs.CountryPicker({\r\n el: this.$('.shipto-country'),\r\n defaultValue: sTo?.country,\r\n statePicker: this.shipToStatePicker,\r\n zipInput: this.$('.shipto-zip'),\r\n enableInternational: this.options.project.preferences.hasPref(PJQ.constants.preferenceTypes.ENABLE_INTERNATIONAL_COUNTRIES),\r\n size: 20,\r\n onChange: (value) => {\r\n let shipTo = this.model.get('shipTo');\r\n shipTo.country = value;\r\n this.model.set('shipTo', shipTo);\r\n }\r\n });\r\n\r\n PJQ.helpers.inputHelpers.inputMaskPhone(this.$('input.shipto-phone'));\r\n PJQ.helpers.inputHelpers.inputMaskPhone(this.$('input.shipto-fax'));\r\n }\r\n\r\n if (this.model.get('commitmentType') === PJQ.constants.commitments.commitmentType.SUBCONTRACT) {\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.signed-contract-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('signedContractReceivedDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('signedContractReceivedDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.execution-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('executionDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('executionDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.issued-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('issuedOnDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('issuedOnDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.returned-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('returnedDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('returnedDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.letter-intent-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('letterOfIntentDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('letterOfIntentDate', newDate);\r\n }, this)\r\n });\r\n\r\n new PJQ.inputs.Datepicker({\r\n el: this.$('.approval-letter-date'),\r\n canEdit: this.options.canEdit,\r\n datepickerOptions: {\r\n format: PJQ.helpers.dateHelpers.dateFormats.datePicker.DATE,\r\n defaultDate: this.model.get('approvalLetterDate')\r\n },\r\n onChange: _.bind(function (newDate) {\r\n this.model.set('approvalLetterDate', newDate);\r\n }, this)\r\n });\r\n }\r\n\r\n if (this.checkFieldVisible('attachments')) {\r\n let $att = this.$('.commitment-file-uploader');\r\n if (_.size(this.model.attachments.models) === 0 && !this.options.canUploadAttachments) {\r\n $att.closest('.upload-outer').hide();\r\n } else {\r\n this.fileUploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $att,\r\n collection: this.model.attachments,\r\n canUpload: this.options.canUploadAttachments,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n this.fileUploader.clearError();\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n }\r\n }\r\n\r\n if (this.checkFieldVisible('coiAttachments')) {\r\n let $coi = this.$('.coi-file-uploader');\r\n if (_.size(this.model.coiAttachments.models) === 0 && !this.options.canUploadAttachments) {\r\n $coi.closest('.upload-outer').hide();\r\n } else {\r\n this.coiUploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $coi,\r\n collection: this.model.coiAttachments,\r\n canUpload: this.options.canUploadAttachments,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n this.coiUploader.clearError();\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n this.renderCOIApproval();\r\n }\r\n }\r\n\r\n if (this.checkFieldVisible('w9Attachments')) {\r\n let $w9 = this.$('.w9-file-uploader');\r\n if (_.size(this.model.w9Attachments.models) === 0 && !this.options.canUploadAttachments) {\r\n $w9.closest('.upload-outer').hide();\r\n } else {\r\n this.w9Uploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $w9,\r\n collection: this.model.w9Attachments,\r\n canUpload: this.options.canUploadAttachments,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n this.w9Uploader.clearError();\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n this.renderW9Approval();\r\n }\r\n }\r\n\r\n if (this.checkFieldVisible('lienWaiverAttachments')) {\r\n let $lien = this.$('.lien-waiver-file-uploader');\r\n if (_.size(this.model.lienWaiverAttachments.models) === 0 && !this.options.canUploadAttachments) {\r\n $lien.closest('.upload-outer').hide();\r\n } else {\r\n this.lienWaiverUploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $lien,\r\n collection: this.model.lienWaiverAttachments,\r\n canUpload: this.options.canUploadAttachments,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n this.lienWaiverUploader.clearError();\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n this.renderLienWaiverApproval();\r\n }\r\n }\r\n\r\n if (this.checkFieldVisible('signedDocumentAttachments')) {\r\n let $signed = this.$('.signed-file-uploader');\r\n if (_.size(this.model.signedDocumentAttachments.models) === 0 && !this.options.canUploadAttachments) {\r\n $signed.closest('.upload-outer').hide();\r\n } else {\r\n this.signedDocumentUploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $signed,\r\n collection: this.model.signedDocumentAttachments,\r\n canUpload: this.options.canUploadAttachments,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n this.signedDocumentUploader.clearError();\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n }\r\n }\r\n\r\n if (this.checkFieldVisible('affidavitAttachments')) {\r\n let $affidavit = this.$('.affidavit-file-uploader');\r\n if (_.size(this.model.affidavitAttachments.models) === 0 && !this.options.canUploadAttachments) {\r\n $affidavit.closest('.upload-outer').hide();\r\n } else {\r\n this.affidavitUploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $affidavit,\r\n collection: this.model.affidavitAttachments,\r\n canUpload: this.options.canUploadAttachments,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n this.affidavitUploader.clearError();\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n }\r\n }\r\n\r\n if (this.checkFieldVisible('executedDocumentAttachments')) {\r\n let $executed = this.$('.executed-file-uploader'),\r\n canUpload = this.options.canUploadAttachments && this.options.isAdmin;\r\n if (_.size(this.model.executedDocumentAttachments.models) === 0 && !canUpload) {\r\n $executed.closest('.upload-outer').hide();\r\n } else {\r\n this.executedDocumentUploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $executed,\r\n collection: this.model.executedDocumentAttachments,\r\n canUpload: canUpload,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n this.executedDocumentUploader.clearError();\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n attachment.set('delete', true);\r\n } else {\r\n attachment.destroy();\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n }\r\n }\r\n\r\n if (_.size(this.uploadCustomFields) > 0) {\r\n this.renderUploadCustomFields();\r\n }\r\n },\r\n renderUploadCustomFields: function () {\r\n this.customFieldUploaders = [];\r\n _.each(this.uploadCustomFields, function (field) {\r\n let type = 'cf-' + field.id,\r\n $upload = this.$(\".\" + type + '-file-uploader'),\r\n canUpload = this.options.canUploadAttachments && (!field.get('isAdminEdit') || this.options.isAdmin),\r\n customFieldAttachments = _.filter(this.model.customFieldAttachments.models, function (attachment) {\r\n return attachment.get('type') === type;\r\n });\r\n\r\n if (_.size(customFieldAttachments) === 0 && !canUpload) {\r\n $upload.closest('.upload-outer').hide();\r\n return;\r\n }\r\n\r\n let attachmentsCollection = new PJQ.collections.commitments.CommitmentAttachments(customFieldAttachments);\r\n let uploader = new PJQ.views.files.FileUploaderGrid({\r\n el: $upload,\r\n collection: attachmentsCollection,\r\n canUpload: canUpload,\r\n useApiV2: true,\r\n canView: false,\r\n canDelete: this.options.isAdmin,\r\n previewImageDimension: 150,\r\n onSuccess: _.bind(function (file) {\r\n this.model.isDirty = true;\r\n uploader.clearError();\r\n\r\n let newAttachment = _.find(attachmentsCollection.models, function (attachment) {\r\n return attachment.get('uploadId') === file.uploadId;\r\n });\r\n\r\n if (newAttachment != null) {\r\n newAttachment.set('type', type);\r\n this.model.customFieldAttachments.add(newAttachment);\r\n }\r\n }, this),\r\n onDelete: _.bind(function (attachment, callback) {\r\n if (attachment.get('id') > 0) {\r\n let customFieldAttachment = this.model.customFieldAttachments.findWhere({id: attachment.get('id')});\r\n\r\n attachment.set('delete', true);\r\n if (customFieldAttachment != null) {\r\n customFieldAttachment.set('delete', true);\r\n }\r\n } else {\r\n let customFieldAttachment = this.model.customFieldAttachments.findWhere({uploadId: attachment.get('uploadId')});\r\n\r\n attachment.destroy();\r\n if (customFieldAttachment != null) {\r\n this.model.customFieldAttachments.remove(customFieldAttachment);\r\n }\r\n }\r\n\r\n this.model.isDirty = true;\r\n callback();\r\n }, this)\r\n });\r\n this.customFieldUploaders.push(uploader);\r\n }, this);\r\n },\r\n renderCOIApproval: function () {\r\n if (this.coiApproval != null) {\r\n this.coiApproval.remove();\r\n }\r\n if (this.model.get('isCOIRequired')) {\r\n this.coiApproval = new PJQ.inputs.ButtonGroup({\r\n el: this.$('.coi-approval'),\r\n canEdit: this.options.canEdit && this.options.isAdmin,\r\n colorInactiveButtons: false,\r\n buttonClasses: 'wd-120p',\r\n buttons: [\r\n {\r\n label: \"Not Reviewed\",\r\n value: null,\r\n colorClass: \"light\"\r\n },\r\n {\r\n label: \"Rejected\",\r\n value: false,\r\n colorClass: \"danger\"\r\n },\r\n {\r\n label: \"Approved\",\r\n value: true,\r\n colorClass: \"success\"\r\n }\r\n ],\r\n defaultValue: this.model.get('isCOIApproved'),\r\n onChange: _.bind(function (value) {\r\n this.model.set('isCOIApproved', value);\r\n }, this)\r\n });\r\n }\r\n },\r\n renderW9Approval: function () {\r\n if (this.w9Approval != null) {\r\n this.w9Approval.remove();\r\n }\r\n if (this.model.get('isW9Required')) {\r\n this.w9Approval = new PJQ.inputs.ButtonGroup({\r\n el: this.$('.w9-approval'),\r\n canEdit: this.options.canEdit && this.options.isAdmin,\r\n colorInactiveButtons: false,\r\n buttonClasses: 'wd-120p',\r\n buttons: [\r\n {\r\n label: \"Not Reviewed\",\r\n value: null,\r\n colorClass: \"light\"\r\n },\r\n {\r\n label: \"Rejected\",\r\n value: false,\r\n colorClass: \"danger\"\r\n },\r\n {\r\n label: \"Approved\",\r\n value: true,\r\n colorClass: \"success\"\r\n }\r\n ],\r\n defaultValue: this.model.get('isW9Approved'),\r\n onChange: _.bind(function (value) {\r\n this.model.set('isW9Approved', value);\r\n }, this)\r\n });\r\n }\r\n },\r\n renderLienWaiverApproval: function () {\r\n if (this.lienWaiverApproval != null) {\r\n this.lienWaiverApproval.remove();\r\n }\r\n if (this.model.get('isLienWaiverRequired')) {\r\n this.lienWaiverApproval = new PJQ.inputs.ButtonGroup({\r\n el: this.$('.lien-waiver-approval'),\r\n canEdit: this.options.canEdit && this.options.isAdmin,\r\n colorInactiveButtons: false,\r\n buttonClasses: 'wd-120p',\r\n buttons: [\r\n {\r\n label: \"Not Reviewed\",\r\n value: null,\r\n colorClass: \"light\"\r\n },\r\n {\r\n label: \"Rejected\",\r\n value: false,\r\n colorClass: \"danger\"\r\n },\r\n {\r\n label: \"Approved\",\r\n value: true,\r\n colorClass: \"success\"\r\n }\r\n ],\r\n defaultValue: this.model.get('isLienWaiverApproved'),\r\n onChange: _.bind(function (value) {\r\n this.model.set('isLienWaiverApproved', value);\r\n }, this)\r\n });\r\n }\r\n },\r\n formatPercent: function (e) {\r\n $(e.currentTarget).val(PJQ.helpers.formatHelpers.formatPercent($(e.currentTarget).val()));\r\n },\r\n numbersOnly: function (e) {\r\n return PJQ.helpers.inputHelpers.numbersOnly(e, true, true);\r\n },\r\n checkFieldVisible: function (fieldName) {\r\n if (this.coreFieldSettings) {\r\n let fieldSettings = this.coreFieldSettings.findWhere({fieldName: fieldName});\r\n if (fieldSettings != null) {\r\n return fieldSettings.get('isVisible');\r\n }\r\n }\r\n return true;\r\n },\r\n checkFieldRequired: function (fieldName) {\r\n if (this.coreFieldSettings) {\r\n let fieldSettings = this.coreFieldSettings.findWhere({fieldName: fieldName});\r\n if (fieldSettings != null) {\r\n return fieldSettings.get('isRequired');\r\n }\r\n }\r\n return false;\r\n },\r\n renderLineItems() {\r\n if (this.lineItemsView) {\r\n this.lineItemsView.remove();\r\n }\r\n\r\n this.lineItemsView = new PJQ.views.budget.LineItemsView({\r\n el: this.$('.commitment-line-items'),\r\n collection: this.model.lineItems,\r\n lineItemModel: PJQ.models.commitments.CommitmentLineItem,\r\n accountingMethod: this.model.get('accountingMethod'),\r\n canEdit: this.options.canEditLineItems,\r\n canDelete: this.options.canEditLineItems,\r\n canChangeAccountingMethod: this.options.isSubmitting || this.options.canEditLineItems,\r\n financialMarkups: this.model.markupItems,\r\n enableTax: true,\r\n billedToDate: this.options.canViewInvoices && this.model.invoices != null ? () => {\r\n let res = 0;\r\n _.each(this.model.invoices.models, function (invoice) {\r\n if (invoice.get('statusId') === PJQ.constants.invoicing.payableInvoiceStatus.APPROVED\r\n || invoice.get('statusId') === PJQ.constants.invoicing.payableInvoiceStatus.COMPLETE) {\r\n res += invoice.getGrandTotal();\r\n }\r\n });\r\n return res;\r\n } : null,\r\n showBilling: this.model.get('statusId') === PJQ.constants.commitments.commitmentStatus.APPROVED || this.model.get('statusId') === PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_COMPLETE,\r\n approvedChanges: this.model.get('approvedChanges'),\r\n onApprovedChangesClicked: () => {\r\n this.activateView(this.views.CHANGEORDERS);\r\n },\r\n onBilledToDateClicked: () => {\r\n this.activateView(this.views.INVOICES);\r\n },\r\n showSubTotal: true,\r\n showGrandTotal: true,\r\n onAccountingMethodChanged: _.bind(function (value) {\r\n this.model.set('accountingMethod', value);\r\n }, this),\r\n onLineItemChange: _.bind(function () {\r\n this.model.isDirty = true;\r\n }, this),\r\n onLineItemAdd: _.bind(function () {\r\n this.updateCounts();\r\n }, this),\r\n onLineItemDelete: _.bind(function () {\r\n this.updateCounts();\r\n }, this)\r\n });\r\n },\r\n copyToHelper: function (e) {\r\n let from = $(e.currentTarget).data('from'),\r\n to = $(e.currentTarget).data('to'),\r\n contact = {},\r\n fromDescription = '',\r\n toDescription = '',\r\n fnContinue = () => {\r\n new PJQ.views.modals.YesNo({\r\n header: 'Copy to ' + toDescription,\r\n body: 'Are you sure you want to overwrite the ' + toDescription + ' based on the ' + fromDescription + '?',\r\n onYes: _.bind(function () {\r\n\r\n this.model.attributes[to].companyName = contact.companyName;\r\n this.model.attributes[to].contactName = contact.contactName;\r\n this.model.attributes[to].address1 = contact.address1;\r\n this.model.attributes[to].address2 = contact.address2;\r\n this.model.attributes[to].city = contact.city;\r\n this.model.attributes[to].state = contact.state;\r\n this.model.attributes[to].zip = contact.zip;\r\n this.model.attributes[to].country = contact.country;\r\n this.model.attributes[to].phone = contact.phone;\r\n this.model.attributes[to].fax = contact.fax;\r\n this.model.attributes[to].email = contact.email;\r\n\r\n this.$('.' + to.toLowerCase() + '-companyname').val(contact.companyName);\r\n this.$('.' + to.toLowerCase() + '-contactname').val(contact.contactName);\r\n this.$('.' + to.toLowerCase() + '-address1').val(contact.address1);\r\n this.$('.' + to.toLowerCase() + '-address2').val(contact.address2);\r\n this.$('.' + to.toLowerCase() + '-city').val(contact.city);\r\n this.$('.' + to.toLowerCase() + '-phone').val(contact.phone);\r\n this.$('.' + to.toLowerCase() + '-fax').val(contact.fax);\r\n this.$('.' + to.toLowerCase() + '-email').val(contact.email);\r\n\r\n if (to === 'billTo')\r\n this.billToCountryPicker.setValue(contact.country);\r\n else if (to === 'shipTo')\r\n this.shipToCountryPicker.setValue(contact.country);\r\n\r\n if (to === 'billTo')\r\n this.billToStatePicker.setValue(contact.state);\r\n else if (to === 'shipTo')\r\n this.shipToStatePicker.setValue(contact.state);\r\n\r\n this.$('.' + to.toLowerCase() + '-zip').val(contact.zip);\r\n }, this),\r\n });\r\n };\r\n\r\n switch (from) {\r\n case 'shipTo':\r\n fromDescription = 'Ship To';\r\n contact.companyName = this.$('.shipto-companyname').val();\r\n contact.contactName = this.$('.shipto-contactname').val();\r\n contact.address1 = this.$('.shipto-address1').val();\r\n contact.address2 = this.$('.shipto-address2').val();\r\n contact.city = this.$('.shipto-city').val();\r\n contact.state = this.shipToStatePicker.getValue().toUpperCase();\r\n contact.zip = this.$('.shipto-zip').val();\r\n\r\n let sCountry = this.shipToCountryPicker.getValue().toUpperCase();\r\n contact.country = _.size(sCountry) === 0 ? 'US' : sCountry;\r\n contact.phone = this.$('.shipto-phone').val();\r\n contact.fax = this.$('.shipto-fax').val();\r\n contact.email = this.$('.shipto-email').val();\r\n break;\r\n case 'billTo':\r\n fromDescription = 'Bill To';\r\n contact.companyName = this.$('.billto-companyname').val();\r\n contact.contactName = this.$('.billto-contactname').val();\r\n contact.address1 = this.$('.billto-address1').val();\r\n contact.address2 = this.$('.billto-address2').val();\r\n contact.city = this.$('.billto-city').val();\r\n contact.state = this.billToStatePicker.getValue().toUpperCase();\r\n contact.zip = this.$('.billto-zip').val();\r\n\r\n let bCountry = this.billToCountryPicker.getValue().toUpperCase();\r\n contact.country = _.size(bCountry) === 0 ? 'US' : bCountry;\r\n contact.phone = this.$('.billto-phone').val();\r\n contact.fax = this.$('.billto-fax').val();\r\n contact.email = this.$('.billto-email').val();\r\n break;\r\n case 'project':\r\n fromDescription = 'Project';\r\n contact.address1 = PJQ.app.session.project.get('address1');\r\n contact.address2 = PJQ.app.session.project.get('address2');\r\n contact.city = PJQ.app.session.project.get('city');\r\n contact.state = PJQ.app.session.project.get('state');\r\n contact.zip = PJQ.app.session.project.get('zip');\r\n contact.country = PJQ.app.session.project.get('country');\r\n break;\r\n }\r\n\r\n switch (to) {\r\n case 'shipTo':\r\n toDescription = 'Ship To';\r\n break;\r\n case 'billTo':\r\n toDescription = 'Bill To';\r\n break;\r\n }\r\n\r\n if (from === 'addressBook') {\r\n fromDescription = 'Address Book';\r\n\r\n new PJQ.views.contacts.SelectContactsModal({\r\n context: PJQ.constants.contacts.contexts.CONTACTS,\r\n isSingleChoice: true,\r\n onSave: _.bind(function (data) {\r\n contact.companyName = data.get('companyName');\r\n contact.contactName = data.get('contactName');\r\n contact.address1 = data.get('address1');\r\n contact.address2 = data.get('address2');\r\n contact.city = data.get('city');\r\n contact.state = data.get('state');\r\n contact.zip = data.get('zip');\r\n\r\n let country = data.get('country');\r\n contact.country = _.size(country) === 0 ? 'US' : country;\r\n contact.phone = data.get('phone');\r\n contact.fax = data.get('fax');\r\n contact.email = data.get('email');\r\n\r\n fnContinue();\r\n }, this)\r\n });\r\n } else\r\n fnContinue();\r\n },\r\n renderChangeOrders: function () {\r\n if (this.model.isNew()) {\r\n return;\r\n }\r\n\r\n this.changeOrdersDataTable = new PJQ.views.dataTables.DataTable({\r\n el: this.$('.commitment-change-orders'),\r\n data: this.model.changeOrders.models,\r\n isHideSearch: true,\r\n language: {\r\n emptyTable: this.options.canAddChangeOrders ? 'Click \"New Change Order\" to create a Commitment Change Order' : 'No change orders have been created'\r\n },\r\n paging: false,\r\n contextMenuOptions: {\r\n actions: [\r\n {\r\n name: 'View',\r\n onClick: _.bind(function (row) {\r\n this.viewChangeOrder(row.data());\r\n }, this),\r\n isShown: _.bind(function (row) {\r\n return this.options.canViewChangeOrders;\r\n }, this)\r\n }\r\n ]\r\n },\r\n order: [1, 'asc'],\r\n hasFooter: true,\r\n columns: [\r\n {\r\n \"columnData\": \"\",\r\n \"data\": null,\r\n \"title\": \"\",\r\n \"width\": \"20px\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"defaultContent\": '',\r\n \"render\": function (data, type, row) {\r\n return PJQ.helpers.erp.getERPIcon(row.erpSyncStatus());\r\n }\r\n }, {\r\n \"data\": \"attributes.number\",\r\n \"title\": \"Number\",\r\n \"render\": _.bind(function (data, type, row) {\r\n if (type === 'sort') {\r\n return row.id;\r\n }\r\n\r\n return '' + data + ''\r\n }, this)\r\n }, {\r\n \"data\": \"attributes.description\",\r\n \"title\": \"Description\",\r\n }, {\r\n \"columnData\": \"createdOn\",\r\n \"data\": \"attributes.createdOn\",\r\n \"title\": 'Created',\r\n \"width\": '120px',\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(row.get('createdOn')), PJQ.helpers.dateHelpers.dateFormats.DATE_TIME);\r\n }, this)\r\n }, {\r\n \"data\": \"attributes.invoicedDate\",\r\n \"title\": 'Invoiced Date',\r\n \"width\": '120px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(row.get('invoicedDate')) === 0) {\r\n return '';\r\n }\r\n\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(row.get('invoicedDate')), PJQ.helpers.dateHelpers.dateFormats.DATE);\r\n }, this)\r\n }, {\r\n \"data\": \"attributes.dueDate\",\r\n \"title\": 'Due Date',\r\n \"width\": '120px',\r\n \"render\": _.bind(function (data, type, row) {\r\n if (_.size(row.get('dueDate')) === 0) {\r\n return '';\r\n }\r\n\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(row.get('dueDate')), PJQ.helpers.dateHelpers.dateFormats.DATE);\r\n }, this)\r\n }, {\r\n \"data\": \"attributes.statusId\",\r\n \"title\": \"Status\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.constants.commitments.changeOrderStatusNames[row.get('statusId')];\r\n }, this)\r\n }, {\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Grand Total\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.getGrandTotal());\r\n }, this),\r\n \"renderFooter\": function (data) {\r\n let amt = 0;\r\n _.each(data, function (changeOrder) {\r\n amt += changeOrder.getGrandTotal();\r\n });\r\n return PJQ.helpers.formatHelpers.formatCurrency(amt);\r\n }\r\n }, {\r\n \"data\": \"\",\r\n \"title\": \"\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"width\": \"80px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let html = '
'\r\n if (this.options.canViewChangeOrders) {\r\n html += ''\r\n }\r\n return html + '
';\r\n }, this)\r\n }],\r\n dom: '<\"top\"<\"clear\">>rt<\"bottom\"p<\"clear\">>',\r\n onRowDoubleClick: _.bind(function (row) {\r\n this.viewChangeOrder(row.data());\r\n }, this)\r\n });\r\n },\r\n newChangeOrder: function () {\r\n this.viewChangeOrder();\r\n },\r\n newInvoice: function () {\r\n this.viewInvoice();\r\n },\r\n viewChangeOrderClicked: function (e) {\r\n let target = $(e.currentTarget),\r\n row = this.changeOrdersDataTable.getRow(target.closest('tr'));\r\n this.viewChangeOrder(row.data());\r\n },\r\n viewChangeOrder: function (changeOrder) {\r\n this.removeModal();\r\n new PJQ.views.commitments.ChangeOrderEditModal({\r\n commitment: this.model,\r\n model: changeOrder,\r\n onSave: _.bind(function (changeOrder, isNew) {\r\n if (isNew) {\r\n this.model.changeOrders.add(changeOrder);\r\n this.changeOrdersDataTable.addRow(changeOrder);\r\n\r\n if (typeof this.options.onChangeOrderAdd === 'function') {\r\n this.options.onChangeOrderAdd(changeOrder);\r\n }\r\n } else {\r\n this.changeOrdersDataTable.refresh();\r\n }\r\n this.model.set('changeOrders', this.model.changeOrders.toJSON());\r\n this.updateCounts();\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n }, this),\r\n onDelete: _.bind(function (changeOrderId) {\r\n this.changeOrdersDataTable.render();\r\n this.model.set('changeOrders', this.model.changeOrders.toJSON());\r\n\r\n if (typeof this.options.onChangeOrderDelete === 'function') {\r\n this.options.onChangeOrderDelete(changeOrderId);\r\n }\r\n this.updateCounts();\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n }, this)\r\n });\r\n },\r\n deleteChangeOrder: function (changeOrder) {\r\n let row = this.changeOrdersDataTable.getRow(changeOrder.cid),\r\n changeOrderId = row.data().id;\r\n new PJQ.views.modals.DeleteCancel({\r\n header: \"Delete Change Order\",\r\n body: \"Are you sure you want to delete this change order?\",\r\n onDelete: _.bind(function () {\r\n this.model.changeOrders.remove(changeOrder);\r\n this.model.set('changeOrders', this.model.changeOrders.toJSON());\r\n changeOrder.destroy({\r\n success: _.bind(function () {\r\n this.changeOrdersDataTable.removeRow(row);\r\n\r\n if (typeof this.options.onChangeOrderDelete === 'function') {\r\n this.options.onChangeOrderDelete(changeOrderId);\r\n }\r\n this.updateCounts();\r\n }, this)\r\n });\r\n }, this)\r\n });\r\n },\r\n viewPaymentClicked: function (e) {\r\n let target = $(e.currentTarget),\r\n row = this.paymentsDataTable.getRow(target.closest('tr'));\r\n this.viewPayment(row.data());\r\n },\r\n viewPayment: function (payment) {\r\n this.removeModal();\r\n new PJQ.views.invoicing.InvoicePaymentModal({\r\n model: payment,\r\n isPayable: true,\r\n onSave: _.bind(function (payment, isNew) {\r\n if (isNew) {\r\n let invoice = this.model.invoices.get(payment.get('invoiceId'));\r\n if (invoice != null) {\r\n invoice.payments.add(payment);\r\n }\r\n\r\n this.paymentsDataTable.addRow(invoice);\r\n }\r\n this.updateCounts();\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n }, this),\r\n onDelete: _.bind(function () {\r\n this.updateCounts();\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n }, this),\r\n });\r\n },\r\n renderPayments: function () {\r\n if (this.model.isNew() || !this.invoiceSettings.get('enablePayments')) {\r\n return;\r\n }\r\n\r\n this.paymentsDataTable = new PJQ.views.dataTables.DataTable({\r\n el: this.$('.c-payments'),\r\n data: this.model.payments.models,\r\n isHideSearch: true,\r\n language: {\r\n emptyTable: 'No Payments have been created yet',\r\n zeroRecords: \"No Payments matched the search criteria\"\r\n },\r\n paging: false,\r\n order: [1, 'asc'],\r\n hasFooter: true,\r\n columns: [{\r\n \"columnData\": \"\",\r\n \"data\": null,\r\n \"title\": \"\",\r\n \"width\": \"20px\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"defaultContent\": '',\r\n \"render\": function (data, type, row) {\r\n if (row.isERPSynced()) {\r\n return PJQ.helpers.erp.getERPIcon(row.erpSyncStatus());\r\n }\r\n return '';\r\n }\r\n },\r\n {\r\n \"title\": \"#\",\r\n \"data\": \"attributes.number\",\r\n \"render\": _.bind(function (data, type, row) {\r\n if (type === 'sort') {\r\n return row.id;\r\n }\r\n\r\n return '' + data + ''\r\n }, this)\r\n },\r\n {\r\n \"title\": \"Check #\",\r\n \"data\": \"attributes.checkNumber\"\r\n },\r\n {\r\n \"title\": 'Received',\r\n \"data\": \"\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let dateReceived = row.get('dateReceived');\r\n if (_.size(dateReceived) === 0) {\r\n return '';\r\n }\r\n\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(dateReceived), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n },\r\n {\r\n \"title\": \"Payment Method\",\r\n \"data\": \"attributes.paymentMethod\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.constants.invoicing.paymentMethods.find(item => item.toLowerCase() === data.toLowerCase()) ?? '';\r\n }, this)\r\n },\r\n {\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Amount\",\r\n \"render\": (data, type, row) => {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.get('amount'));\r\n },\r\n \"renderFooter\": function (data) {\r\n let amt = 0;\r\n _.each(data, function (payment) {\r\n amt += payment.get('amount');\r\n });\r\n return PJQ.helpers.formatHelpers.formatCurrency(amt);\r\n }\r\n },\r\n {\r\n \"data\": \"\",\r\n \"title\": \"\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"width\": \"80px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let html = '
'\r\n if (this.options.canViewInvoices) {\r\n html += ''\r\n }\r\n return html + '
';\r\n }, this)\r\n }],\r\n dom: '<\"top\"<\"clear\">>rt<\"bottom\"p<\"clear\">>',\r\n contextMenuOptions: {\r\n actions: [\r\n {\r\n name: 'View',\r\n onClick: _.bind(function (row) {\r\n this.viewPayment(row.data());\r\n }, this),\r\n isShown: _.bind(function (row) {\r\n return this.options.canViewInvoices;\r\n }, this)\r\n }\r\n ]\r\n },\r\n onRowDoubleClick: _.bind(function (row) {\r\n this.viewPayment(row.data());\r\n }, this)\r\n });\r\n },\r\n viewInvoiceClicked: function (e) {\r\n let target = $(e.currentTarget),\r\n row = this.invoicesDataTable.getRow(target.closest('tr'));\r\n this.viewInvoice(row.data());\r\n },\r\n viewInvoice: function (invoice) {\r\n this.removeModal();\r\n new PJQ.views.invoicing.EditPayableInvoiceModal({\r\n commitment: this.model,\r\n model: invoice,\r\n onSave: _.bind(function (invoice, isNew) {\r\n if (isNew) {\r\n this.model.invoices.add(invoice);\r\n this.invoicesDataTable.addRow(invoice);\r\n\r\n if (typeof this.options.onInvoiceAdd === 'function') {\r\n this.options.onInvoiceAdd(invoice);\r\n }\r\n }\r\n this.updateCounts();\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n }, this),\r\n onDelete: _.bind(function () {\r\n this.updateCounts();\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n }, this)\r\n });\r\n },\r\n deleteInvoice: function (invoice) {\r\n let row = this.invoicesDataTable.getRow(invoice.cid);\r\n new PJQ.views.modals.DeleteCancel({\r\n header: \"Delete Invoice\",\r\n body: \"Are you sure you want to delete this Invoice?\",\r\n onDelete: _.bind(function () {\r\n invoice.destroy({\r\n success: _.bind(function () {\r\n this.invoicesDataTable.removeRow(row);\r\n this.updateCounts();\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n }, this)\r\n });\r\n }, this)\r\n });\r\n },\r\n renderInvoices: function () {\r\n if (this.model.isNew()) {\r\n return;\r\n }\r\n\r\n this.invoicesDataTable = new PJQ.views.dataTables.DataTable({\r\n el: this.$('.commitment-invoices'),\r\n data: this.model.invoices.models,\r\n isHideSearch: true,\r\n language: {\r\n emptyTable: 'No Invoices have been created yet',\r\n zeroRecords: \"No Invoices matched the search criteria\"\r\n },\r\n paging: false,\r\n order: [1, 'asc'],\r\n hasFooter: true,\r\n columns: [\r\n {\r\n \"columnData\": \"\",\r\n \"data\": null,\r\n \"title\": \"\",\r\n \"width\": \"20px\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"defaultContent\": '',\r\n \"render\": function (data, type, row) {\r\n return PJQ.helpers.erp.getERPIcon(row.erpSyncStatus());\r\n }\r\n }, {\r\n \"title\": \"#\",\r\n \"data\": \"attributes.number\",\r\n \"render\": _.bind(function (data, type, row) {\r\n if (type === 'sort') {\r\n return row.id;\r\n }\r\n\r\n return '' + data + ''\r\n }, this)\r\n },\r\n {\r\n \"title\": 'Billing Period',\r\n \"data\": \"\",\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n let periodStart = PJQ.helpers.dateHelpers.getDateString(new Date(row.get('startDate')), PJQ.helpers.dateHelpers.dateFormats.DATE, true),\r\n periodEnd = PJQ.helpers.dateHelpers.getDateString(new Date(row.get('endDate')), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n\r\n return (periodStart) + ' - ' + (periodEnd);\r\n }, this)\r\n },\r\n {\r\n \"title\": 'Due Date',\r\n \"data\": \"\",\r\n \"width\": '90px',\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.dateHelpers.getDateString(new Date(row.get('billingDate')), PJQ.helpers.dateHelpers.dateFormats.DATE, true);\r\n }, this)\r\n },\r\n {\r\n \"data\": \"\",\r\n \"title\": \"Status\",\r\n \"width\": \"100px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.constants.invoicing.payableInvoiceStatusNames[row.get('statusId')]\r\n }, this)\r\n },\r\n {\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Retainage\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.getRetainage());\r\n }, this),\r\n \"renderFooter\": function (data) {\r\n let amt = 0;\r\n _.each(data, function (invoice) {\r\n amt += invoice.getRetainage();\r\n });\r\n return PJQ.helpers.formatHelpers.formatCurrency(amt);\r\n }\r\n },\r\n {\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Grand Total\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.getGrandTotal());\r\n }, this),\r\n \"renderFooter\": function (data) {\r\n let amt = 0;\r\n _.each(data, function (invoice) {\r\n amt += invoice.getGrandTotal();\r\n });\r\n return PJQ.helpers.formatHelpers.formatCurrency(amt);\r\n }\r\n },\r\n {\r\n \"data\": \"\",\r\n \"title\": \"\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"width\": \"80px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n let html = '
'\r\n if (this.options.canViewInvoices) {\r\n html += ''\r\n }\r\n // if (PJQ.app.session.project.hasPermission('payableInvoices.isAdmin')) {\r\n // html += ''\r\n // }\r\n return html + '
';\r\n }, this)\r\n }],\r\n dom: '<\"top\"<\"clear\">>rt<\"bottom\"p<\"clear\">>',\r\n contextMenuOptions: {\r\n actions: [\r\n {\r\n name: 'View',\r\n onClick: _.bind(function (row) {\r\n this.viewInvoice(row.data());\r\n }, this),\r\n isShown: _.bind(function (row) {\r\n return this.options.canViewInvoices;\r\n }, this)\r\n }\r\n ]\r\n },\r\n onRowDoubleClick: _.bind(function (row) {\r\n let invoice = row.data();\r\n if (invoice != null && this.options.canViewInvoices) {\r\n invoice.fetch({\r\n success: _.bind(function () {\r\n this.viewInvoice(invoice);\r\n }, this)\r\n });\r\n }\r\n }, this)\r\n });\r\n },\r\n validate: function () {\r\n let isValid = true;\r\n PJQ.helpers.inputHelpers.setInputError(this.$('.commitment-number, .commitment-title'), true);\r\n\r\n if ((!this.model.isNew() || this.checkFieldRequired('number')) && _.size(this.model.get('number')) === 0) {\r\n isValid = false;\r\n PJQ.helpers.inputHelpers.setInputError(this.$('.commitment-number'), false);\r\n }\r\n\r\n if (!this.contractCompanyPicker.validate()) {\r\n isValid = false;\r\n }\r\n\r\n if (this.commitmentCustomFieldsForm != null && !this.commitmentCustomFieldsForm.validate())\r\n isValid = false;\r\n\r\n if (this.checkFieldRequired('invoiceContactId')) {\r\n if (!this.invoiceContactPicker.validate()) {\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('defaultWorkRetainagePercent')) {\r\n let $workRetainage = this.$('.default-work-retainage');\r\n PJQ.helpers.inputHelpers.setInputError($workRetainage, true);\r\n if (this.model.get('defaultWorkRetainagePercent') == null) {\r\n PJQ.helpers.inputHelpers.setInputError($workRetainage, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('defaultMaterialRetainagePercent')) {\r\n let $materialRetainage = this.$('.default-material-retainage');\r\n PJQ.helpers.inputHelpers.setInputError($materialRetainage, true);\r\n if (this.model.get('defaultMaterialRetainagePercent') == null) {\r\n PJQ.helpers.inputHelpers.setInputError($materialRetainage, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('termsId')) {\r\n let $terms = this.$('.select-terms');\r\n PJQ.helpers.inputHelpers.setInputError($terms, true);\r\n if (this.model.get('termsId') == null || this.model.get('termsId') === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($terms, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('description')) {\r\n let $description = this.$('.commitment-description');\r\n PJQ.helpers.inputHelpers.setInputError($description, true);\r\n if (_.size(this.model.get('description')) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($description, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('attachments')) {\r\n this.fileUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.attachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.fileUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('signedDocumentAttachments')) {\r\n this.signedDocumentUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.signedDocumentAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.signedDocumentUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('affidavitAttachments')) {\r\n this.affidavitUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.affidavitAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.affidavitUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('executedDocumentAttachments')) {\r\n this.executedDocumentUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.executedDocumentAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.executedDocumentUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.model.get('commitmentType') === PJQ.constants.commitments.commitmentType.SUBCONTRACT) {\r\n if (this.checkFieldRequired('startDate')) {\r\n let $startDate = this.$('.start-date');\r\n PJQ.helpers.inputHelpers.setInputError($startDate, true);\r\n if (this.model.get('startDate') == null || this.model.get('startDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($startDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('estimatedCompletionDate')) {\r\n let $estimatedCompletionDate = this.$('.est-complete-date');\r\n PJQ.helpers.inputHelpers.setInputError($estimatedCompletionDate, true);\r\n if (this.model.get('estimatedCompletionDate') == null || this.model.get('estimatedCompletionDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($estimatedCompletionDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('actualCompletionDate')) {\r\n let $actualCompletionDate = this.$('.act-complete-date');\r\n PJQ.helpers.inputHelpers.setInputError($actualCompletionDate, true);\r\n if (this.model.get('actualCompletionDate') == null || this.model.get('actualCompletionDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($actualCompletionDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('contractDate')) {\r\n let $contractDate = this.$('.contract-date');\r\n PJQ.helpers.inputHelpers.setInputError($contractDate, true);\r\n if (this.model.get('contractDate') == null || this.model.get('contractDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($contractDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('signedContractReceivedDate')) {\r\n let $signedContractDate = this.$('.signed-contract-date');\r\n PJQ.helpers.inputHelpers.setInputError($signedContractDate, true);\r\n if (this.model.get('signedContractReceivedDate') == null || this.model.get('signedContractReceivedDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($signedContractDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('letterOfIntentDate')) {\r\n let $letterOfIntentDate = this.$('.letter-intent-date');\r\n PJQ.helpers.inputHelpers.setInputError($letterOfIntentDate, true);\r\n if (this.model.get('letterOfIntentDate') == null || this.model.get('letterOfIntentDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($letterOfIntentDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('approvalLetterDate')) {\r\n let $approvalLetterDate = this.$('.approval-letter-date');\r\n PJQ.helpers.inputHelpers.setInputError($approvalLetterDate, true);\r\n if (this.model.get('approvalLetterDate') == null || this.model.get('approvalLetterDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($approvalLetterDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('issuedOnDate')) {\r\n let $issuedOnDate = this.$('.issued-date');\r\n PJQ.helpers.inputHelpers.setInputError($issuedOnDate, true);\r\n if (this.model.get('issuedOnDate') == null || this.model.get('issuedOnDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($issuedOnDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('executionDate')) {\r\n let $executedOnDate = this.$('.execution-date');\r\n PJQ.helpers.inputHelpers.setInputError($executedOnDate, true);\r\n if (this.model.get('executionDate') == null || this.model.get('executionDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($executedOnDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('returnedDate')) {\r\n let $returnedOnDate = this.$('.returned-date');\r\n PJQ.helpers.inputHelpers.setInputError($returnedOnDate, true);\r\n if (this.model.get('returnedDate') == null || this.model.get('returnedDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($returnedOnDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('inclusions')) {\r\n let $inclusions = this.$('.inclusions');\r\n PJQ.helpers.inputHelpers.setInputError($inclusions, true);\r\n if (_.size(this.model.get('inclusions')) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($inclusions, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('exclusions')) {\r\n let $exclusions = this.$('.exclusions');\r\n PJQ.helpers.inputHelpers.setInputError($exclusions, true);\r\n if (_.size(this.model.get('exclusions')) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($exclusions, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('coiAttachments')) {\r\n this.coiUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.coiAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.coiUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('w9Attachments')) {\r\n this.w9Uploader.clearError();\r\n let hasValidAttachment = _.find(this.model.w9Attachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.w9Uploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('lienWaiverAttachments')) {\r\n this.lienWaiverUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.lienWaiverAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.lienWaiverUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n }\r\n }\r\n } else {\r\n if (this.checkFieldRequired('deliveryDate')) {\r\n let $deliveryDate = this.$('.delivery-date');\r\n PJQ.helpers.inputHelpers.setInputError($deliveryDate, true);\r\n if (this.model.get('deliveryDate') == null || this.model.get('deliveryDate').length === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($deliveryDate, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('paymentTerms')) {\r\n let $paymentTerms = this.$('.payment-terms');\r\n PJQ.helpers.inputHelpers.setInputError($paymentTerms, true);\r\n if (_.size(this.model.get('paymentTerms')) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($paymentTerms, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('shipVia')) {\r\n let $shipVia = this.$('.ship-via');\r\n PJQ.helpers.inputHelpers.setInputError($shipVia, true);\r\n if (_.size(this.model.get('shipVia')) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($shipVia, false);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('shipToId')) {\r\n let $shipToCompany = this.$('.shipto-companyname'),\r\n $shipToContact = this.$('.shipto-contactname'),\r\n $shipToAddress1 = this.$('.shipto-address1'),\r\n $shipToCity = this.$('.shipto-city'),\r\n $shipToZip = this.$('.shipto-zip');\r\n PJQ.helpers.inputHelpers.setInputError($shipToCompany, true);\r\n PJQ.helpers.inputHelpers.setInputError($shipToContact, true);\r\n PJQ.helpers.inputHelpers.setInputError($shipToAddress1, true);\r\n PJQ.helpers.inputHelpers.setInputError($shipToCity, true);\r\n PJQ.helpers.inputHelpers.setInputError($shipToZip, true);\r\n\r\n if (_.size(this.model.get('shipTo').companyName) === 0 ||\r\n _.size(this.model.get('shipTo').contactName) === 0 ||\r\n _.size(this.model.get('shipTo').address1) === 0 ||\r\n _.size(this.model.get('shipTo').city) === 0 ||\r\n _.size(this.model.get('shipTo').zip) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($shipToCompany, _.size(this.model.get('shipTo').companyName) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($shipToContact, _.size(this.model.get('shipTo').contactName) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($shipToAddress1, _.size(this.model.get('shipTo').address1) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($shipToCity, _.size(this.model.get('shipTo').city) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($shipToZip, _.size(this.model.get('shipTo').zip) > 0);\r\n isValid = false;\r\n }\r\n }\r\n\r\n if (this.checkFieldRequired('billToId')) {\r\n let $billToCompany = this.$('.billto-companyname'),\r\n $billToContact = this.$('.billto-contactname'),\r\n $billToAddress1 = this.$('.billto-address1'),\r\n $billToCity = this.$('.billto-city'),\r\n $billToZip = this.$('.billto-zip');\r\n PJQ.helpers.inputHelpers.setInputError($billToCompany, true);\r\n PJQ.helpers.inputHelpers.setInputError($billToContact, true);\r\n PJQ.helpers.inputHelpers.setInputError($billToAddress1, true);\r\n PJQ.helpers.inputHelpers.setInputError($billToCity, true);\r\n PJQ.helpers.inputHelpers.setInputError($billToZip, true);\r\n\r\n if (_.size(this.model.get('billTo').companyName) === 0 ||\r\n _.size(this.model.get('billTo').contactName) === 0 ||\r\n _.size(this.model.get('billTo').address1) === 0 ||\r\n _.size(this.model.get('billTo').city) === 0 ||\r\n _.size(this.model.get('billTo').zip) === 0) {\r\n PJQ.helpers.inputHelpers.setInputError($billToCompany, _.size(this.model.get('billTo').companyName) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($billToContact, _.size(this.model.get('billTo').contactName) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($billToAddress1, _.size(this.model.get('billTo').address1) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($billToCity, _.size(this.model.get('billTo').city) > 0);\r\n PJQ.helpers.inputHelpers.setInputError($billToZip, _.size(this.model.get('billTo').zip) > 0);\r\n isValid = false;\r\n }\r\n }\r\n }\r\n\r\n if (!isValid) {\r\n this.activateView(this.views.GENERAL);\r\n return isValid;\r\n }\r\n\r\n if (!this.lineItemsView.validate()) {\r\n isValid = false;\r\n this.activateView(this.views.LINEITEMS);\r\n return isValid;\r\n }\r\n\r\n return isValid;\r\n },\r\n save: function (callback) {\r\n if (this.model.get('commitmentType') === PJQ.constants.commitments.commitmentType.PURCHASE_ORDER && this.options.canEdit) {\r\n let billTo = this.model.get('billTo') ? this.model.get('billTo') : {};\r\n billTo.companyName = this.$('.billto-companyname').val();\r\n billTo.contactName = this.$('.billto-contactname').val();\r\n billTo.address1 = this.$('.billto-address1').val();\r\n billTo.address2 = this.$('.billto-address2').val();\r\n billTo.city = this.$('.billto-city').val();\r\n billTo.zip = this.$('.billto-zip').val();\r\n billTo.phone = PJQ.helpers.formatHelpers.numbersOnly(this.$('.billto-phone').val());\r\n billTo.fax = PJQ.helpers.formatHelpers.numbersOnly(this.$('.billto-fax').val());\r\n billTo.email = this.$('.billto-email').val();\r\n this.model.set('billTo', billTo);\r\n\r\n let shipTo = this.model.get('shipTo') ? this.model.get('shipTo') : {};\r\n shipTo.companyName = this.$('.shipto-companyname').val();\r\n shipTo.contactName = this.$('.shipto-contactname').val();\r\n shipTo.address1 = this.$('.shipto-address1').val();\r\n shipTo.address2 = this.$('.shipto-address2').val();\r\n shipTo.city = this.$('.shipto-city').val();\r\n shipTo.zip = this.$('.shipto-zip').val();\r\n shipTo.phone = PJQ.helpers.formatHelpers.numbersOnly(this.$('.shipto-phone').val());\r\n shipTo.fax = PJQ.helpers.formatHelpers.numbersOnly(this.$('.shipto-fax').val());\r\n shipTo.email = this.$('.shipto-email').val();\r\n this.model.set('shipTo', shipTo);\r\n }\r\n\r\n if (!this.validate()) {\r\n this.$('.modal').prevObject.scrollTop(0);\r\n if (typeof callback === 'function') {\r\n callback(false);\r\n }\r\n return;\r\n }\r\n\r\n this.model.set('customFields', this.commitmentCustomFieldsForm != null ? this.commitmentCustomFieldsForm.getChanged() : null);\r\n\r\n this.model.save({\r\n assignedTo: this.assignedTo,\r\n invoiceContact: this.invoiceContact,\r\n lineItems: this.model.lineItems.models\r\n }, {\r\n success: () => {\r\n this.render();\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n this.options.project.trigger('commitmentChanged', this.model);\r\n if (typeof callback === 'function') {\r\n callback(true);\r\n }\r\n },\r\n error: (data) => {\r\n if (typeof callback === 'function') {\r\n callback(false);\r\n }\r\n PJQ.notifications.notify.errorNotify({\r\n message: data.responseJSON.error\r\n });\r\n }\r\n });\r\n\r\n return true;\r\n },\r\n deleteCommitment: function () {\r\n new PJQ.views.modals.DeleteCancel({\r\n header: \"Confirm Delete\",\r\n body: \"Are you sure you want to delete this commitment? All associated change orders and invoices will also be deleted.\",\r\n onDelete: _.bind(function () {\r\n this.model.destroy({\r\n success: _.bind(function () {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment deleted successfully'\r\n });\r\n\r\n if (typeof this.options.onDelete === 'function')\r\n this.options.onDelete();\r\n\r\n this.removeModal();\r\n }, this)\r\n });\r\n }, this)\r\n });\r\n },\r\n saveEmail: function () {\r\n this.save((success) => {\r\n if (success) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment saved successfully'\r\n });\r\n this.email();\r\n }\r\n });\r\n },\r\n saveCommitment: function () {\r\n this.save((success) => {\r\n if (success) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment saved successfully'\r\n });\r\n\r\n this.removeModal();\r\n }\r\n });\r\n },\r\n validateForSubmit: function () {\r\n let isValid = true,\r\n scrollEl = null;\r\n if (this.model.get('isCOIRequiredForSubmit')) {\r\n this.coiUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.coiAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.coiUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n\r\n scrollEl = scrollEl || this.coiUploader.$el[0];\r\n }\r\n }\r\n\r\n if (this.model.get('isW9RequiredForSubmit')) {\r\n this.w9Uploader.clearError();\r\n let hasValidAttachment = _.find(this.model.w9Attachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.w9Uploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n\r\n scrollEl = scrollEl || this.w9Uploader.$el[0];\r\n }\r\n }\r\n\r\n if (this.model.get('isLienWaiverRequiredForSubmit')) {\r\n this.lienWaiverUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.lienWaiverAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.lienWaiverUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n\r\n scrollEl = scrollEl || this.lienWaiverUploader.$el[0];\r\n }\r\n }\r\n\r\n if (this.model.get('isSignedDocumentsRequiredForSubmit')) {\r\n this.signedDocumentUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.signedDocumentAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.signedDocumentUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n\r\n scrollEl = scrollEl || this.signedDocumentUploader.$el[0];\r\n }\r\n }\r\n\r\n if (this.model.get('isAffidavitRequiredForSubmit')) {\r\n this.affidavitUploader.clearError();\r\n let hasValidAttachment = _.find(this.model.affidavitAttachments.models, function (model) {\r\n return !model.get('delete')\r\n }, this) != null;\r\n\r\n if (!hasValidAttachment) {\r\n this.affidavitUploader.showError('Missing attachment', 100000);\r\n isValid = false;\r\n\r\n scrollEl = scrollEl || this.affidavitUploader.$el[0];\r\n }\r\n }\r\n\r\n if (scrollEl != null && typeof scrollEl.scrollIntoView === 'function') {\r\n scrollEl.scrollIntoView();\r\n }\r\n\r\n return isValid;\r\n },\r\n submitForReview: function () {\r\n if (!this.validateForSubmit()) {\r\n return;\r\n }\r\n\r\n this.model.submit((result) => {\r\n if (result) {\r\n this.options.project.trigger('commitmentChanged', this.model);\r\n\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment submitted successfully'\r\n });\r\n\r\n this.removeModal();\r\n }\r\n });\r\n },\r\n signAndSubmit: function () {\r\n if (!this.validateForSubmit()) {\r\n return;\r\n }\r\n\r\n new PJQ.views.signatures.SignatureSubmitModal({\r\n onSubmit: (signature, callback) => {\r\n this.model.set('signature', signature);\r\n this.model.submit(() => {\r\n this.options.project.trigger('commitmentChanged', this.model);\r\n\r\n this.render();\r\n callback();\r\n\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment signed & submitted successfully'\r\n });\r\n });\r\n }\r\n });\r\n },\r\n email: function () {\r\n let projectName = this.options.project?.get('projectName')?.trim();\r\n let subject = `A Commitment has been shared with you ${projectName && _.size(projectName) > 0 ? `for ${projectName}` : ''}`;\r\n new PJQ.views.email.ComposeEmailModal({\r\n project: PJQ.app.session.project,\r\n header: \"Email Commitment\",\r\n subject: subject,\r\n onSave: _.bind(function (data) {\r\n this.model.share(data, _.bind(function () {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment email sent'\r\n });\r\n }, this));\r\n }, this)\r\n });\r\n },\r\n renderMarkups: function () {\r\n if (!this.options.isAdmin) {\r\n return;\r\n }\r\n\r\n this.markupsView = new PJQ.financialMarkups.views.FinancialMarkupsList({\r\n el: this.$('.c-markups'),\r\n collection: this.model.markupItems,\r\n canEdit: this.options.canEditLineItems,\r\n canVoid: true\r\n });\r\n },\r\n renderERP: function () {\r\n let $erp = this.$('.erp-sync');\r\n if (!this.options.isAdmin || this.erpIntegration == null || !this.options.project.isERPSynced()\r\n || false === this.erpIntegration.getSetting(PJQ.constants.integrations.settings.SYNC_COMMITMENTS)) {\r\n $erp.remove();\r\n return;\r\n }\r\n\r\n this.$('.erp-badge').html(PJQ.helpers.erp.getERPBadge(this.model.erpSyncStatus(), this.model.get('externalObject')));\r\n\r\n let canPush = true,\r\n disablePushReason = \"\",\r\n fnRenderButtons = _.bind(function () {\r\n PJQ.helpers.erp.renderERPButtons($erp, {\r\n status: this.model.erpSyncStatus(),\r\n pushSupported: this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PUSH_COMMITMENTS),\r\n canPush: canPush,\r\n canPushChanges: false,\r\n disablePushReason: disablePushReason,\r\n unlinkSupported: this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.UNLINK_COMMITMENTS),\r\n });\r\n }, this);\r\n\r\n if (_.size(this.model.lineItems.models) === 0\r\n || (this.model.get('statusId') !== PJQ.constants.commitments.commitmentStatus.APPROVED\r\n && this.model.get('statusId') !== PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_COMPLETE\r\n && this.model.get('statusId') !== PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_CLOSED)) {\r\n canPush = false;\r\n disablePushReason = \"Commitment must be approved or complete and have line items\";\r\n }\r\n\r\n let canPushWithoutVendorSynced = this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PUSH_COMMITMENTS_WITH_VENDOR);\r\n if (this.model.contractedContact && !canPushWithoutVendorSynced) {\r\n this.model.contractedContact.fetchCompanyERPObject(_.bind(function (erpObject) {\r\n if (!erpObject || _.size(erpObject.externalId) === 0) {\r\n canPush = false;\r\n disablePushReason = \"Contracted Company must be synced to ERP before this commitment can be pushed\";\r\n }\r\n fnRenderButtons();\r\n }, this));\r\n } else {\r\n fnRenderButtons();\r\n }\r\n },\r\n pushERP: function (callback) {\r\n if (!this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PUSH_COMMITMENTS)) {\r\n return;\r\n }\r\n\r\n this.save((success) => {\r\n if (success) {\r\n this.erpIntegration.pushCommitment(this.model, () => {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment pushed to ERP'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n if (callback && typeof callback === 'function') {\r\n callback();\r\n } else {\r\n this.render();\r\n }\r\n });\r\n }\r\n });\r\n },\r\n undoPushERP: function () {\r\n if (this.model.erpSyncStatus() === PJQ.constants.integrations.erp.syncStatuses.REVIEWING) {\r\n this.erpIntegration.undoPush(this.model, () => {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment removed from ERP approval'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n this.render();\r\n });\r\n }\r\n },\r\n unlinkERP: function () {\r\n new PJQ.views.modals.YesNo({\r\n header: \"Unlink from ERP\",\r\n body: \"Are you sure you want to unlink this Commitment from your ERP system? This will also unlink all Change Orders and Invoices associated with it.\",\r\n onYes: () => {\r\n let loader = new PJQ.Loader(this.$('.modal-content'));\r\n this.erpIntegration.unlinkCommitment(this.model, (success) => {\r\n if (success) {\r\n loader.remove();\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitment unlinked from ERP'\r\n });\r\n\r\n if (typeof this.options.onSave === 'function') {\r\n this.options.onSave(this.model);\r\n }\r\n\r\n this.render();\r\n }\r\n });\r\n }\r\n });\r\n },\r\n viewHistory: async function () {\r\n let cType = PJQ.constants.commitments.commitmentTypeNames[this.model.get('commitmentType')],\r\n historyItems = [{\r\n date: this.model.get('createdOn'),\r\n person: this.model.get('createdBy'),\r\n action: cType + ' Created'\r\n }];\r\n\r\n let history = new PJQ.collections.commitments.History({}, {\r\n commitmentId: this.model.id\r\n });\r\n new PJQ.views.history.HistoryTimelineModal({\r\n collection: history,\r\n subTitle: cType + ' #' + this.model.get('number'),\r\n items: historyItems\r\n });\r\n },\r\n exportCommitment: function () {\r\n let callback = () => {\r\n PJQ.files.downloadFile(PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments',\r\n value: this.model.get('id')\r\n },\r\n {\r\n endpoint: 'export',\r\n }\r\n ]), {isAPIv2: true});\r\n };\r\n if (this.options.canEdit && this.model.hasChanged()) {\r\n this.save(callback);\r\n } else {\r\n callback();\r\n }\r\n },\r\n close: function () {\r\n if (this.model.hasChanged() && this.options.canEdit) {\r\n new PJQ.views.modals.SaveDontSave({\r\n header: \"Unsaved Changes\",\r\n body: \"Do you want to save changes?\",\r\n onSave: _.bind(function () {\r\n this.saveCommitment();\r\n this.removeModal();\r\n }, this),\r\n onDontSave: _.bind(function () {\r\n this.removeModal();\r\n }, this)\r\n });\r\n } else {\r\n this.removeModal();\r\n }\r\n }\r\n});","PJQ.views.commitments.CommitmentsList = PJQ.views.BaseView.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'commitments-list'),\r\n commitmentId: null\r\n },\r\n events: {\r\n 'click .btn-settings': 'editSettings',\r\n 'click .new-po': 'newCommitment',\r\n 'click .new-subcontract': 'newCommitment',\r\n 'click .btn-view-commitment': 'viewCommitmentClicked',\r\n 'click .btn-delete-commitment': 'deleteCommitmentClicked',\r\n 'click .btn-export': 'exportList',\r\n 'click .btn-pull-erp': 'pullERP',\r\n },\r\n beforeFirstRender: async function () {\r\n this.isFetched = false;\r\n\r\n this.options.project = this.options.project ? this.options.project : PJQ.app.session.project;\r\n\r\n if (this.collection == null) {\r\n this.collection = new PJQ.collections.commitments.Commitments(null, {\r\n projectId: this.options.project.get('projectId'),\r\n costCodeId: this.options.costCodeId ? this.options.costCodeId : null,\r\n costTypeId: this.options.costTypeId ? this.options.costTypeId : null\r\n });\r\n }\r\n this.settings = await this.options.project.fetchCommitmentSettings();\r\n\r\n if (!this.collection.isFetched) {\r\n await this.collection.fetch();\r\n }\r\n\r\n this.userSettings = await PJQ.app.session.fetchCommitmentUserSettings();\r\n this.customFields = await this.options.project.fetchCommitmentCustomFields();\r\n this.erpIntegration = await PJQ.app.session.fetchERPIntegration();\r\n\r\n if (this.erpIntegration != null && this.erpIntegration.getSetting('syncProjects')) {\r\n await this.options.project.fetchERPObject();\r\n }\r\n\r\n this.isFetched = true;\r\n this.render();\r\n },\r\n beforeRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n this.options.canEdit = this.options.project.hasPermission('commitments.canEdit');\r\n this.options.isChangeOrdersAdmin = this.options.project.hasPermission('commitmentChangeOrders.isAdmin');\r\n this.options.isAdmin = this.options.project.hasPermission('commitments.isAdmin');\r\n },\r\n renderData: function () {\r\n return {\r\n isFetched: this.isFetched\r\n }\r\n },\r\n afterRender: function () {\r\n if (!this.isFetched) {\r\n return;\r\n }\r\n\r\n this.renderView();\r\n\r\n PJQ.app.session.project.off('commitmentChanged');\r\n PJQ.app.session.project.on('commitmentChanged', function (commitment) {\r\n this.collection.add(commitment);\r\n this.render();\r\n }, this);\r\n\r\n if (this.options.commitmentId > 0) {\r\n let initCommitment = this.collection.get(this.options.commitmentId);\r\n if (initCommitment != null) {\r\n this.viewCommitment(initCommitment);\r\n this.options.commitmentId = null;\r\n }\r\n }\r\n },\r\n renderERPButton: function () {\r\n let $erp = this.$('.erp-sync')\r\n if (!this.options.isAdmin || this.erpIntegration == null || !this.erpIntegration.getSetting(PJQ.constants.integrations.settings.SYNC_COMMITMENTS) || !this.options.project || !this.options.project.isERPSynced()) {\r\n $erp.remove();\r\n return;\r\n }\r\n\r\n let pullSupported = this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PULL_COMMITMENTS);\r\n if(pullSupported && this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PULL_COMMITMENTS_DOC_CLERK_REQUIRED) && !PJQ.app.session.preferences.hasPref(PJQ.constants.preferenceTypes.IS_DOCUMENT_CLERK)){\r\n pullSupported = false;\r\n }\r\n\r\n PJQ.helpers.erp.renderERPButtons($erp, {\r\n pushSupported: false,\r\n pullSupported: pullSupported\r\n });\r\n },\r\n pullERP: function () {\r\n if (this.options.project != null && this.erpIntegration.hasAvailableAction(PJQ.constants.integrations.actions.PULL_COMMITMENTS)) {\r\n this.erpIntegration.pullCommitments(this.options.project, _.bind(function (res) {\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Commitments successfully pulled from ERP'\r\n });\r\n\r\n this.collection.reset(res);\r\n this.render();\r\n }, this));\r\n }\r\n },\r\n renderView: function () {\r\n if (this.dataTable) {\r\n this.dataTable.remove();\r\n this.dataTable = null;\r\n }\r\n\r\n this.dataTable = this.getDataTableInstance();\r\n },\r\n getDataTableInstance: function () {\r\n return new PJQ.views.commitments.CommitmentDataTable({\r\n el: this.$('.commitments-data'),\r\n rowId: \"cid\",\r\n data: this.collection.models,\r\n onPageSizeChange: function (value) {\r\n // PJQ.helpers.cookieHelpers.setCookie(PJQ.constants.cookies.RFI_PAGE_LENGTH, value);\r\n },\r\n isAdmin: this.options.isAdmin,\r\n statusIds: this.options.statusIds,\r\n headerData: _.bind(function () {\r\n return {\r\n project: this.options.project,\r\n canAdd: this.options.canEdit,\r\n isAdmin: this.options.isAdmin,\r\n settings: this.settings\r\n };\r\n }, this),\r\n enableColumnResize: true,\r\n groups: this.groups,\r\n costTypes: this.costTypes,\r\n columnWidthCookie: PJQ.constants.cookies.COMMITMENT_LIST_COLUMNS_WIDTH,\r\n unitsOfMeasure: this.unitsOfMeasure,\r\n userSettings: this.userSettings,\r\n settings: this.userSettings.getSettings(PJQ.constants.commitments.view.COMMITMENTS),\r\n order: [[1, 'asc']],\r\n colReorder: {\r\n fixedColumnsLeft: 1,\r\n fixedColumnsRight: 1,\r\n realtime: false\r\n },\r\n columnOrderChanged: _.bind(function () {\r\n this.userSettings.save();\r\n }, this),\r\n onRowDoubleClick: _.bind(function (row) {\r\n this.viewCommitment(row.data());\r\n }, this),\r\n afterDataTableRender: _.bind(function () {\r\n if (PJQ.app.session.erpIntegration && PJQ.app.session.erpIntegration.id > 0) {\r\n this.renderERPButton();\r\n }\r\n }, this),\r\n contextMenuOptions: {\r\n actions: [\r\n {\r\n name: 'View',\r\n onClick: _.bind(function (row) {\r\n this.viewCommitment(row.data());\r\n }, this)\r\n },\r\n {\r\n name: 'New Change Order',\r\n isShown: _.bind(function (row) {\r\n let status = row.data().get('statusId');\r\n return this.options.isAdmin && this.options.isChangeOrdersAdmin && status !== PJQ.constants.commitments.commitmentStatus.SUBCONTRACT_TERMINATED && status !== PJQ.constants.commitments.commitmentStatus.PURCHASE_ORDER_CLOSED;\r\n }, this),\r\n onClick: _.bind(function (row) {\r\n new PJQ.views.commitments.ChangeOrderEditModal({\r\n commitment: row.data()\r\n });\r\n }, this)\r\n }\r\n ]\r\n }\r\n });\r\n },\r\n exportList: function () {\r\n PJQ.files.downloadFile(PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: PJQ.app.session.project.id\r\n },\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'export'\r\n }\r\n ], [\r\n {\r\n parameter: 'timeZoneOffset',\r\n value: new Date().getTimezoneOffset()\r\n }\r\n ]), {isAPIv2: true});\r\n },\r\n editSettings: function () {\r\n new PJQ.views.commitments.CommitmentSettingsModal({\r\n commitmentsView: this,\r\n onSave: _.bind(function () {\r\n this.renderView();\r\n PJQ.notifications.notify.successNotify({\r\n message: 'Settings updated successfully'\r\n });\r\n }, this)\r\n });\r\n },\r\n newCommitment: function (e) {\r\n let commitmentType = $(e.currentTarget).hasClass('new-po') ? PJQ.constants.commitments.commitmentType.PURCHASE_ORDER : PJQ.constants.commitments.commitmentType.SUBCONTRACT;\r\n this.viewCommitment(null, commitmentType);\r\n },\r\n viewCommitmentClicked: function (e) {\r\n let row = this.dataTable.getRow($(e.currentTarget).closest('tr'));\r\n if (row != null) {\r\n this.viewCommitment(row.data());\r\n }\r\n },\r\n viewCommitment: function (commitment, commitmentType) {\r\n let isNew = commitment == null\r\n new PJQ.views.commitments.CommitmentEditModal({\r\n model: commitment,\r\n commitmentType: commitmentType,\r\n onChangeOrderAdd: _.bind(function (changeOrder) {\r\n if (typeof this.options.onChangeOrderAdd === 'function') {\r\n this.options.onChangeOrderAdd(changeOrder);\r\n }\r\n }, this),\r\n onChangeOrderDelete: _.bind(function (changeOrderId) {\r\n if (typeof this.options.onChangeOrderDelete === 'function') {\r\n this.options.onChangeOrderDelete(changeOrderId);\r\n }\r\n }, this),\r\n onInvoiceAdd: _.bind(function (invoice) {\r\n if (typeof this.options.onChangeOrderAdd === 'function') {\r\n this.options.onInvoiceAdd(invoice);\r\n }\r\n }, this),\r\n onSave: _.bind(function (commitment) {\r\n if (isNew) {\r\n this.collection.add(commitment);\r\n }\r\n this.renderView();\r\n\r\n if (typeof this.options.onCommitmentSave === 'function') {\r\n this.options.onCommitmentSave(commitment);\r\n }\r\n }, this),\r\n onDelete: _.bind(function (commitment) {\r\n this.collection.remove(commitment);\r\n this.renderView();\r\n\r\n if (typeof this.options.onCommitmentDelete === 'function') {\r\n this.options.onCommitmentDelete(commitment);\r\n }\r\n }, this)\r\n })\r\n },\r\n deleteCommitmentClicked: function (e) {\r\n let row = this.dataTable.getRow($(e.currentTarget).closest('tr'));\r\n this.deleteCommitment(row);\r\n },\r\n deleteCommitment: function (row) {\r\n if (row != null) {\r\n let commitment = row.data();\r\n if (commitment != null) {\r\n new PJQ.views.modals.DeleteCancel({\r\n header: \"Delete Commitment\",\r\n body: \"Are you sure you want to delete this Commitment?\",\r\n onDelete: _.bind(function () {\r\n commitment.destroy({\r\n success: _.bind(function () {\r\n this.dataTable.removeRow(row);\r\n if (typeof this.options.onDelete === 'function') {\r\n this.options.onDelete(commitment);\r\n }\r\n }, this)\r\n });\r\n }, this)\r\n });\r\n }\r\n }\r\n }\r\n});\r\n\r\nPJQ.views.commitments.ModalViewCommitments = PJQ.views.BaseModal.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-view-change-orders'),\r\n maxWidth: 1000,\r\n isShowCloseButton: true,\r\n onSave: _.noop,\r\n isAdmin: true\r\n },\r\n events: {},\r\n beforeModalCreated: function () {\r\n\r\n },\r\n renderData: function () {\r\n return {\r\n model: this.model\r\n }\r\n },\r\n afterRender: function () {\r\n if (this.model != null) {\r\n new PJQ.views.commitments.CommitmentsList({\r\n el: this.$('.modal-body'),\r\n model: this.model,\r\n costCodeId: this.model.get('costCodeId'),\r\n costTypeId: this.model.get('costTypeId'),\r\n statusIds: this.options.statusIds,\r\n project: this.options.project\r\n })\r\n }\r\n },\r\n});\r\n\r\nPJQ.views.commitments.SelectCommitmentsModal = PJQ.views.BaseModal.extend({\r\n defaults: {\r\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-select-commitments'),\r\n width: '60%',\r\n maxWidth: 700,\r\n onSave: _.noop,\r\n selectedCommitmentId: null,\r\n headerSubText: null\r\n },\r\n events: {\r\n \"change .select-commitment\": \"selectCommitment\",\r\n \"click .btn-save\": \"save\",\r\n \"click .btn-cancel\": \"cancel\"\r\n },\r\n beforeModalCreated: async function () {\r\n this.isFetched = false;\r\n\r\n this.options.isAdmin = PJQ.app.session.project.hasPermission('commitments.isAdmin');\r\n\r\n this.selectedCommitment = null;\r\n this.selectedCommitments = [];\r\n\r\n if (this.collection == null) {\r\n this.collection = new PJQ.collections.commitments.Commitments(null, {\r\n projectId: this.options.project.get('projectId')\r\n });\r\n }\r\n\r\n await this.collection.fetch();\r\n\r\n if (this.options.selectedCommitmentId != null) {\r\n this.selectedCommitment = this.collection.get(this.options.selectedCommitmentId);\r\n }\r\n\r\n if (this.options.filterStatuses) {\r\n this.collection.models = _.filter(this.collection.models, function (model) {\r\n let statusId = model.get('statusId');\r\n\r\n if (_.isArray(this.options.filterStatuses)) {\r\n return _.includes(this.options.filterStatuses, statusId);\r\n } else if (_.isNumber(this.options.filterStatuses)) {\r\n return this.options.filterStatuses === statusId;\r\n }\r\n\r\n return false;\r\n\r\n }, this);\r\n }\r\n\r\n this.isFetched = true;\r\n this.render();\r\n },\r\n renderData: function () {\r\n return {\r\n headerSubText: this.options.headerSubText,\r\n isSingleChoice: this.options.isSingleChoice,\r\n hasSelected: this.options.isSingleChoice ? this.selectedCommitment != null : _.size(this.selectedCommitments) > 0\r\n }\r\n },\r\n isSelected: function (commitment) {\r\n if (this.options.isSingleChoice) {\r\n return this.selectedCommitment != null && this.selectedCommitment.cid === commitment.cid;\r\n }\r\n return this.selectedCommitments != null && this.selectedCommitments.indexOf(commitment.cid);\r\n },\r\n afterRender: function () {\r\n this.dataTable = new PJQ.views.dataTables.DataTable({\r\n el: this.$('.commitments-table'),\r\n data: this.collection.models,\r\n isHideSearch: true,\r\n order: [],\r\n columns: [{\r\n \"data\": \"attributes.isSelected\",\r\n \"title\": \"\",\r\n \"orderable\": false,\r\n \"searchable\": false,\r\n \"render\": (data, type, row) => {\r\n return ('
');\r\n }\r\n },\r\n {\r\n \"data\": \"attributes.number\",\r\n \"title\": \"Number\",\r\n \"orderable\": true\r\n },\r\n {\r\n \"data\": \"attributes.commitmentType\",\r\n \"title\": \"Type\",\r\n \"width\": \"110px\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.constants.commitments.commitmentTypeNames[row.get('commitmentType')]\r\n }, this)\r\n },\r\n {\r\n \"columnData\": \"attributes.contractedContact.companyName\",\r\n \"title\": \"Company\",\r\n \"titleSettings\": \"Contracted Company\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return row.get('contractedContact') ? row.get('contractedContact').companyName : 'N/A';\r\n }, this)\r\n },\r\n {\r\n \"data\": \"attributes.description\",\r\n \"title\": \"Description\",\r\n \"orderable\": false\r\n },\r\n {\r\n \"data\": \"attributes.amount\",\r\n \"title\": \"Grand Total\",\r\n \"orderable\": false,\r\n \"className\": \"text-align-right\",\r\n \"render\": _.bind(function (data, type, row) {\r\n return PJQ.helpers.formatHelpers.formatCurrency(row.getGrandTotal());\r\n }, this)\r\n }],\r\n dom: '<\"top\"<\"clear\">>rt<\"bottom\"p<\"clear\">>'\r\n });\r\n },\r\n selectCommitment: function (e) {\r\n let target = $(e.currentTarget),\r\n commitment = this.dataTable.getRow(target.closest('tr')).data();\r\n\r\n if (this.options.isSingleChoice) {\r\n this.$('.select-commitment').not(target).text('Select').prop('checked', false);\r\n if (commitment.get('isSelected')) {\r\n commitment.set('isSelected', false);\r\n this.selectedCommitment = null;\r\n } else {\r\n commitment.set('isSelected', true);\r\n this.selectedCommitment = commitment;\r\n this.collection.get(commitment.id);\r\n _.each(this.collection.models, _.bind(function (dtCommitment) {\r\n if (commitment.id !== dtCommitment.id)\r\n dtCommitment.set('isSelected', false);\r\n }, this));\r\n }\r\n this.$('.btn-save').attr('disabled', this.selectedCommitment == null);\r\n\r\n if (typeof this.options.onCommitmentSelected === 'function') {\r\n this.options.onCommitmentSelected(this.selectedCommitment);\r\n }\r\n } else {\r\n if (commitment.get('isSelected')) {\r\n target.text('Select').addClass('btn-primary').removeClass('btn-secondary');\r\n commitment.set('isSelected', false);\r\n this.selectedCommitments = _.reject(this.selectedCommitments, function (selCommitment) {\r\n return selCommitment.id === commitment.id;\r\n });\r\n } else {\r\n target.text('Deselect').addClass('btn-secondary').removeClass('btn-primary');\r\n commitment.set('isSelected', true);\r\n this.selectedCommitments.push(commitment);\r\n }\r\n this.$('.btn-save').attr('disabled', this.selectedCommitments == null);\r\n\r\n if (typeof this.options.onCommitmentSelected === 'function') {\r\n this.options.onCommitmentSelected(this.selectedCommitments);\r\n }\r\n }\r\n },\r\n cancel: function () {\r\n if (this.options.onCancel) {\r\n this.options.onCancel();\r\n }\r\n this.removeModal();\r\n },\r\n save: function () {\r\n if (this.options.onSave) {\r\n this.options.onSave(this.selectedCommitment ? this.selectedCommitment : this.selectedCommitments);\r\n this.removeModal();\r\n }\r\n }\r\n});","PJQ.views.commitments.CommitmentManagement = PJQ.views.BaseView.extend({\n defaults: {\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'commitment-management'),\n subTemplates: {\n commitmentTotals: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'commitment-management-totals'),\n invoiceTotals: new PJQ.templating.Template(PJQ.constants.modules.INVOICING, 'invoicing-management-totals')\n },\n commitmentId: null,\n changeOrderId: null,\n invoiceId: null,\n view: null\n },\n events: {\n 'shown.bs.tab .nav-tabs': 'tabActivated',\n 'click .btn-settings': 'settings'\n },\n beforeFirstRender: function () {\n this.options.canViewCommitments = PJQ.app.session.project.hasPermission('commitments.canView');\n this.options.canViewChangeOrders = PJQ.app.session.project.hasPermission('commitmentChangeOrders.canView');\n this.options.canViewInvoices = PJQ.app.session.project.hasPermission('payableInvoices.canView');\n this.options.isAdmin = PJQ.app.session.project.hasPermission('commitments.isAdmin')\n && PJQ.app.session.project.hasPermission('commitmentChangeOrders.isAdmin')\n && PJQ.app.session.project.hasPermission('payableInvoices.isAdmin');\n },\n renderData: function () {\n return {\n isFetched: this.isFetched,\n commitments: this.commitments,\n changeOrders: this.changeOrders,\n invoices: this.invoices,\n canViewCommitments: this.options.canViewCommitments,\n canViewChangeOrders: this.options.canViewChangeOrders,\n canViewInvoices: this.options.canViewInvoices,\n isAdmin: this.options.isAdmin\n }\n },\n afterRender: function () {\n this.commitmentsView = null;\n this.changeOrdersView = null;\n this.invoicesView = null;\n\n if (this.options.view != null) {\n this.activateTab(this.options.view);\n } else if (this.options.commitmentId > 0 && this.options.canViewCommitments) {\n this.activateTab('commitments');\n } else if (this.options.changeOrderId > 0 && this.options.canViewChangeOrders) {\n this.activateTab('changeorders');\n } else if (this.options.invoiceId > 0 && this.options.canViewInvoices) {\n this.activateTab('invoices');\n } else if (this.options.canViewCommitments) {\n this.activateTab('commitments');\n } else if (this.options.canViewChangeOrders) {\n this.activateTab('changeorders');\n } else if (this.options.canViewInvoices) {\n this.activateTab('invoices');\n }\n },\n renderStats: function () {\n let totals,\n $totals = this.$('.totals-outer');\n switch (this.activeView) {\n case 'changeorders':\n if (this.changeOrdersView == null || this.changeOrdersView.collection == null || !this.changeOrdersView.collection.isFetched) {\n $totals.empty();\n return;\n }\n\n totals = this.changeOrdersView.collection.getTotalAmountsByStatus();\n this.renderSubTemplate(false, this.options.subTemplates.commitmentTotals, $totals, {\n pending: totals[PJQ.constants.commitments.changeOrderStatusBuckets.PENDING.name],\n projected: totals[PJQ.constants.commitments.changeOrderStatusBuckets.PROJECTED.name],\n committed: totals[PJQ.constants.commitments.changeOrderStatusBuckets.COMMITTED.name]\n });\n break;\n case 'invoices':\n if (this.invoicesView == null || this.invoicesView.collection == null || !this.invoicesView.collection.isFetched) {\n $totals.empty();\n return;\n }\n\n totals = this.invoicesView.collection.getTotalAmountsByStatus();\n this.renderSubTemplate(false, this.options.subTemplates.invoiceTotals, $totals, {\n draft: totals[PJQ.constants.invoicing.payableInvoiceStatus.DRAFT],\n reviewing: totals[PJQ.constants.invoicing.payableInvoiceStatus.REVIEWING],\n approved: totals[PJQ.constants.invoicing.payableInvoiceStatus.APPROVED],\n complete: totals[PJQ.constants.invoicing.payableInvoiceStatus.COMPLETE],\n revise: totals[PJQ.constants.invoicing.payableInvoiceStatus.REVISE]\n });\n break;\n default:\n if (this.commitmentsView == null || this.commitmentsView.collection == null || !this.commitmentsView.collection.isFetched) {\n $totals.empty();\n return;\n }\n\n totals = this.commitmentsView.collection.getTotalAmountsByStatus();\n this.renderSubTemplate(false, this.options.subTemplates.commitmentTotals, $totals, {\n pending: totals[PJQ.constants.commitments.commitmentStatusBuckets.PENDING.name],\n projected: totals[PJQ.constants.commitments.commitmentStatusBuckets.PROJECTED.name],\n committed: totals[PJQ.constants.commitments.commitmentStatusBuckets.COMMITTED.name]\n });\n break;\n }\n },\n activateTab: function (tab) {\n this.activeView = tab;\n switch (tab ? tab.toLowerCase() : null) {\n case 'changeorders':\n tab = 'CCO_List';\n this.renderChangeOrdersView();\n break;\n case 'invoices':\n tab = 'PI_List';\n this.renderInvoicesView();\n break;\n default:\n tab = 'C_List';\n this.renderCommitmentsView();\n break;\n }\n\n this.isActivating = true;\n this.$('.nav-link[href=\"#' + tab + '\"]').tab('show');\n this.isActivating = false;\n\n this.renderStats();\n },\n tabActivated: function (e) {\n if(this.isActivating){\n return;\n }\n\n this.activeTab = $(e.target).attr('href');\n\n let vw;\n switch (this.activeTab) {\n case '#C_List':\n vw = 'commitments';\n break;\n case '#CCO_List':\n vw = 'changeorders';\n break;\n case '#PI_List':\n vw = 'invoices';\n break;\n }\n this.activateTab(vw);\n },\n renderCommitmentsView: function () {\n PJQ.app.router.navigate('projects/' + this.options.project.id.toString() + '/commitments', {\n trigger: false\n });\n if (this.commitmentsView == null && this.options.canViewCommitments) {\n let fnRender = _.bind(function () {\n this.commitmentsView = new PJQ.views.commitments.CommitmentsList({\n el: this.$('.commitments-pane'),\n project: PJQ.app.session.project,\n commitmentId: this.options.commitmentId,\n collection: this.commitments,\n afterRender: _.bind(this.renderStats, this),\n onCommitmentSave: _.bind(function () {\n this.renderStats();\n }, this),\n onCommitmentDelete: _.bind(function () {\n this.renderStats();\n }, this),\n onChangeOrderAdd: _.bind(function (changeOrder) {\n if (this.changeOrders != null) {\n this.changeOrders.add(changeOrder);\n\n if (this.changeOrdersView != null) {\n this.changeOrdersView.render();\n }\n }\n this.renderStats();\n }, this),\n onChangeOrderDelete: _.bind(function (changeOrderId) {\n if (this.changeOrders) {\n let changeOrder = this.changeOrders.get(changeOrderId);\n this.changeOrders.remove(changeOrder);\n\n if (this.changeOrdersView != null) {\n this.changeOrdersView.render();\n }\n this.renderStats();\n }\n }, this),\n onInvoiceAdd: _.bind(function (invoice) {\n if (this.invoices != null) {\n this.invoices.add(invoice);\n\n if (this.invoicesView != null) {\n this.invoicesView.render();\n }\n }\n }, this)\n });\n this.options.commitmentId = null;\n }, this)\n\n if (this.commitments == null) {\n this.commitments = new PJQ.collections.commitments.Commitments(null, {\n projectId: this.options.project.get('projectId')\n });\n this.commitments.fetch({\n success: _.bind(function () {\n fnRender();\n }, this)\n });\n } else {\n fnRender();\n }\n }\n },\n renderChangeOrdersView: function () {\n PJQ.app.router.navigate('projects/' + this.options.project.id.toString() + '/commitments/changeorders', {\n trigger: false\n });\n if (this.changeOrdersView == null && this.options.canViewChangeOrders) {\n let fnRender = _.bind(function () {\n this.changeOrdersView = new PJQ.views.commitments.ChangeOrdersList({\n el: this.$('.change-orders-pane'),\n project: PJQ.app.session.project,\n changeOrderId: this.options.changeOrderId,\n collection: this.changeOrders,\n afterRender: _.bind(this.renderStats, this),\n });\n this.options.changeOrderId = null;\n }, this)\n\n if (this.changeOrders == null) {\n this.changeOrders = new PJQ.collections.commitments.ChangeOrders(null, {\n projectId: this.options.project.get('projectId')\n });\n this.changeOrders.fetch({\n success: _.bind(function () {\n fnRender();\n }, this)\n });\n } else {\n fnRender();\n }\n }\n },\n renderInvoicesView: function () {\n PJQ.app.router.navigate('projects/' + this.options.project.id.toString() + '/commitments/invoices', {\n trigger: false\n });\n if (this.invoicesView == null && this.options.canViewInvoices) {\n let fnRender = _.bind(function () {\n this.invoicesView = new PJQ.views.invoicing.PayableInvoicesList({\n el: this.$('.invoices-pane'),\n project: PJQ.app.session.project,\n invoiceId: this.options.invoiceId,\n inviteResponse: this.options.inviteResponse,\n collection: this.invoices,\n afterRender: _.bind(this.renderStats, this),\n onDelete: _.bind(function (invoice) {\n this.invoices.remove(invoice);\n }, this)\n });\n this.options.invoiceId = null;\n }, this)\n\n if (this.invoices == null) {\n this.invoices = new PJQ.collections.invoicing.PayableInvoices(null, {\n project: this.options.project\n });\n this.invoices.fetch({\n success: _.bind(function () {\n fnRender();\n }, this)\n })\n } else {\n fnRender();\n }\n }\n },\n getActiveTab: function () {\n return this.$('.nav-item>.nav-link.active').attr('href');\n },\n settings: function () {\n switch (this.getActiveTab()) {\n case '#C_List':\n if (this.commitmentsView != null) {\n this.commitmentsView.editSettings();\n }\n break;\n case '#CCO_List':\n if (this.changeOrdersView != null) {\n this.changeOrdersView.editSettings();\n }\n break;\n case '#PI_List':\n if (this.invoicesView != null) {\n this.invoicesView.editSettings();\n }\n break;\n }\n },\n updateTotalsCount: function () {\n let $commitmentSpan = this.$('.commitments-total'),\n $changeOrdersSpan = this.$('.change-orders-total'),\n $invoicesSpan = this.$('.invoices-total');\n $commitmentSpan.text(_.size(this.commitments.models));\n $changeOrdersSpan.text(_.size(this.changeOrders.models));\n $invoicesSpan.text(_.size(this.invoices.models));\n }\n});","PJQ.models.commitments.Commitment = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id',\r\n endpoint: function () {\r\n let arr = [];\r\n if (this.isNew()) {\r\n arr.push({\r\n endpoint: 'projects',\r\n value: this.get('projectId')\r\n });\r\n }\r\n arr.push({\r\n endpoint: 'commitments',\r\n value: this.id\r\n });\r\n return PJQ.helpers.urlHelpers.generateEndpoint(arr);\r\n },\r\n parse: function (model) {\r\n if (!model)\r\n return model;\r\n\r\n this.attachments = new PJQ.collections.commitments.CommitmentAttachments(model.attachments);\r\n this.w9Attachments = new PJQ.collections.commitments.CommitmentAttachments(model.w9Attachments);\r\n this.coiAttachments = new PJQ.collections.commitments.CommitmentAttachments(model.coiAttachments);\r\n this.lienWaiverAttachments = new PJQ.collections.commitments.CommitmentAttachments(model.lienWaiverAttachments);\r\n this.signedDocumentAttachments = new PJQ.collections.commitments.CommitmentAttachments(model.signedDocumentAttachments);\r\n this.affidavitAttachments = new PJQ.collections.commitments.CommitmentAttachments(model.affidavitAttachments);\r\n this.executedDocumentAttachments = new PJQ.collections.commitments.CommitmentAttachments(model.executedDocumentAttachments);\r\n this.customFieldAttachments = new PJQ.collections.commitments.CommitmentAttachments(model.customFieldAttachments);\r\n\r\n this.lineItems = new PJQ.collections.commitments.CommitmentLineItems(model ? model.lineItems : null);\r\n this.changeOrders = new PJQ.collections.commitments.ChangeOrders(model ? model.changeOrders : null);\r\n this.invoices = new PJQ.collections.invoicing.PayableInvoices(model ? model.invoices : null);\r\n this.payments = new PJQ.collections.invoicing.PayableInvoicePayments(model.payments);\r\n\r\n this.markupItems = new PJQ.financialMarkups.collections.FinancialMarkups(model ? model.markupItems : null);\r\n\r\n if (model.contractedContact) {\r\n if (model.contractedContact instanceof PJQ.models.BaseModel) {\r\n this.contractedContact = model.contractedContact;\r\n } else {\r\n this.contractedContact = new PJQ.models.contacts.Contact(model.contractedContact);\r\n }\r\n }\r\n\r\n if (model.invoiceContact) {\r\n if (model.invoiceContact instanceof PJQ.models.BaseModel) {\r\n this.invoiceContact = model.invoiceContact;\r\n } else {\r\n this.invoiceContact = new PJQ.models.contacts.Contact(model.invoiceContact);\r\n }\r\n }\r\n\r\n return model;\r\n },\r\n beforeSave: function () {\r\n let newMarkupLines = this.lineItems.filter(function (lineItem) {\r\n return lineItem.markup && lineItem.isNew();\r\n });\r\n this.lineItems.remove(newMarkupLines);\r\n\r\n this.set({\r\n lineItems: this.lineItems.toJSON(),\r\n attachments: this.attachments.toJSON(),\r\n w9Attachments: this.w9Attachments.toJSON(),\r\n coiAttachments: this.coiAttachments.toJSON(),\r\n lienWaiverAttachments: this.lienWaiverAttachments.toJSON(),\r\n signedDocumentAttachments: this.signedDocumentAttachments.toJSON(),\r\n affidavitAttachments: this.affidavitAttachments.toJSON(),\r\n executedDocumentAttachments: this.executedDocumentAttachments.toJSON(),\r\n customFieldAttachments: this.customFieldAttachments.toJSON(),\r\n markupItems: this.markupItems.toJSON()\r\n });\r\n },\r\n submit: function (callback) {\r\n this.beforeSave();\r\n new PJQ.ajax.Request({\r\n endpoint: this.endpoint() + '/submit',\r\n isAPIv2: true,\r\n data: this.toJSON()\r\n }).post().done(_.bind(function (response) {\r\n this.set(this.parse(response));\r\n if (typeof callback === 'function') {\r\n callback(true);\r\n }\r\n }, this)).fail(_.bind(function (response) {\r\n if (typeof callback === 'function') {\r\n callback(false);\r\n }\r\n }, this));\r\n },\r\n makeERPUrl: function (integration) {\r\n let externalId = this.externalId();\r\n if (_.size(externalId) === 0) {\r\n return '';\r\n }\r\n\r\n switch (integration.get('name')) {\r\n case PJQ.constants.integrations.providers.QBO.name:\r\n return 'https://app.sandbox.qbo.intuit.com/app/purchaseorder?txnId=' + externalId;\r\n default:\r\n return '';\r\n }\r\n },\r\n share: function (data, callback) {\r\n new PJQ.ajax.Request({\r\n endpoint: this.endpoint() + '/email',\r\n isAPIv2: true,\r\n data: {\r\n subject: data != null ? data.subject : null,\r\n body: data != null ? data.body : null,\r\n toEmails: data != null ? data.toEmails : null,\r\n ccEmails: data != null ? data.ccEmails : null,\r\n }\r\n }).post().done(_.bind(function (response) {\r\n callback();\r\n }, this)).fail(_.bind(function (xhr, err, result) {\r\n //todo: error\r\n }, this));\r\n },\r\n getSubTotal: function () {\r\n return this.get('amount') + this.get('markupAmount');\r\n },\r\n getGrandTotal: function () {\r\n return this.getSubTotal() + this.get('taxAmount');\r\n }\r\n});\r\n\r\nPJQ.models.commitments.HistoryItem = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n actionNames: {\r\n 'status': 'Status Changed',\r\n 'submit': 'Submitted',\r\n 'signed': 'Signed & Submitted',\r\n 'email': 'Email Sent'\r\n },\r\n getActionName: function () {\r\n return this.actionNames[this.get('action')] ?? this.get('action');\r\n },\r\n getDescription: function () {\r\n switch (this.get('action')) {\r\n case 'status':\r\n let fromStatus = this.get('data').from,\r\n toStatus = this.get('data').to;\r\n if (fromStatus == null || toStatus == null) {\r\n return '';\r\n }\r\n\r\n return '' + PJQ.constants.commitments.commitmentStatusNames[fromStatus] + '' + PJQ.constants.commitments.commitmentStatusNames[toStatus];\r\n case 'email':\r\n let to = this.get('data').to;\r\n if (_.size(to) === 0) {\r\n return '';\r\n }\r\n\r\n return 'To: ' + to.join(', ');\r\n default:\r\n return '';\r\n }\r\n }\r\n});\r\n\r\nPJQ.models.commitments.CommitmentLineItem = PJQ.models.budget.BaseLineItem.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id'\r\n});\r\n\r\nPJQ.models.commitments.CommitmentAttachment = PJQ.models.files.File.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id'\r\n});\r\n\r\nPJQ.models.commitments.CustomField = PJQ.models.customFields.CustomField.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'customfields',\r\n value: this.get('id')\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.models.commitments.CustomFieldChoice = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'id',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'customfields',\r\n value: this.get('customFieldId')\r\n },\r\n {\r\n endpoint: 'choices',\r\n value: this.get('id')\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.models.commitments.Settings = PJQ.models.budget.Settings.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'settingId',\r\n endpoint: function () {\r\n if (this.options.projectId > 0) {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'settings'\r\n }\r\n ]);\r\n }\r\n\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'settings'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.models.commitments.Term = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'termsId',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'terms',\r\n value: this.id\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.models.commitments.FieldSetting = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'settingId',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'fields',\r\n value: this.id ? this.id : 'commitments'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.models.commitments.CommitmentUserSettings = PJQ.models.BaseModel.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n idAttribute: 'settingId',\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'user'\r\n }\r\n ]);\r\n },\r\n getSettings: function (view) {\r\n return _.find(this.attributes.viewSettings, _.bind(function (setting) {\r\n return setting.view === view;\r\n }, this));\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.Commitments = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.Commitment,\r\n endpoint: function () {\r\n let params = [];\r\n if (this.options.withLineItems) {\r\n params.push({\r\n parameter: 'withLineItems',\r\n value: this.options.withLineItems\r\n });\r\n }\r\n if (this.options.costCodeId && this.options.costTypeId) {\r\n params.push({\r\n parameter: 'costCodeId',\r\n value: this.options.costCodeId\r\n }, {\r\n parameter: 'costTypeId',\r\n value: this.options.costTypeId\r\n });\r\n }\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'commitments'\r\n }\r\n ], params);\r\n },\r\n getTotalAmountsByStatus: function () {\r\n let result = {};\r\n _.each(PJQ.constants.commitments.commitmentStatusBuckets, function (bucket) {\r\n let total = 0;\r\n _.each(this.models, function (commitment) {\r\n if (bucket.statuses.indexOf(commitment.get('statusId')) !== -1) {\r\n total += commitment.get('amount');\r\n }\r\n });\r\n result[bucket.name] = total;\r\n }, this);\r\n return result;\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.History = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.HistoryItem,\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments',\r\n value: this.options.commitmentId\r\n },\r\n {\r\n endpoint: 'history'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.CommitmentLineItems = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.CommitmentLineItem,\r\n endpoint: function () {\r\n let params = [];\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments',\r\n value: this.options.commitmentId\r\n },\r\n {\r\n endpoint: 'lineitems'\r\n }\r\n ], params);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.CommitmentAttachments = PJQ.collections.files.Files.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.CommitmentAttachment,\r\n endpoint: function () {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments',\r\n value: this.options.commitmentId\r\n },\r\n {\r\n endpoint: 'attachments'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.CustomFields = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.CustomField,\r\n endpoint: function () {\r\n if (this.options.projectId > 0) {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'customfields'\r\n }\r\n ]);\r\n }\r\n\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'customfields'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.CustomFieldChoices = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.CustomFieldChoice\r\n});\r\n\r\nPJQ.collections.commitments.Terms = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.Term,\r\n endpoint: function () {\r\n if (this.options.projectId > 0) {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'terms'\r\n }\r\n ]);\r\n }\r\n\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'commitments'\r\n },\r\n {\r\n endpoint: 'terms'\r\n }\r\n ]);\r\n }\r\n});\r\n\r\nPJQ.collections.commitments.FieldSettings = PJQ.collections.BaseCollection.extend({\r\n defaults: {\r\n isAPIv2: true\r\n },\r\n model: PJQ.models.commitments.FieldSetting,\r\n endpoint: function () {\r\n if (this.options.projectId > 0) {\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'projects',\r\n value: this.options.projectId\r\n },\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'fields',\r\n value: 'commitments'\r\n }\r\n ]);\r\n }\r\n\r\n return PJQ.helpers.urlHelpers.generateEndpoint([\r\n {\r\n endpoint: 'settings'\r\n },\r\n {\r\n endpoint: 'fields',\r\n value: 'commitments'\r\n }\r\n ]);\r\n }\r\n});\r\n","PJQ.views.commitments.CommitmentSettingsModal = PJQ.views.BaseModal.extend({\n defaults: {\n template: new PJQ.templating.Template(PJQ.constants.modules.COMMITMENTS, 'modal-commitment-settings'),\n minWidth: '600px',\n },\n events: {\n 'change .select-column': 'columnSelected',\n 'click .btn-edit-company-default': 'editCompanySettings',\n 'click button.settings-save': 'onSave'\n },\n beforeModalCreated: function () {\n this.userSettings = this.options.commitmentsView.userSettings;\n },\n beforeRender: function () {\n // copy userSettings for our UI; we only update global userSettings object on save.\n this.options.userSettings = [];\n\n this.options.defaultTypeFilter = this.userSettings.get('defaultTypeFilter');\n this.options.defaultStatusFilter = this.userSettings.get('defaultStatusFilter');\n _.each(this.userSettings.attributes.viewSettings, _.bind(function (setting) {\n let columns = this.options.commitmentsView.dataTable.getColumns(true),\n selectedColumns = (_.size(setting.columns) > 0) ? setting.columns : setting.columnsDefault;\n _.each(columns, _.bind(function (column) {\n column.visible = selectedColumns.indexOf(column.columnData) !== -1\n }, this));\n\n this.options.userSettings.push({\n view: setting.view,\n rowsPerPage: setting.rowsPerPage,\n columns: columns\n });\n }, this));\n },\n renderData: function () {\n return {\n userSettings: this.userSettings\n }\n },\n afterRender: function () {\n let defaultFilter = {};\n defaultFilter[PJQ.constants.commitments.filterType.TYPE_FILTER] = this.userSettings.get('defaultCommitmentTypeFilter');\n defaultFilter[PJQ.constants.commitments.filterType.TYPE_FILTER] = _.map(defaultFilter[PJQ.constants.commitments.filterType.TYPE_FILTER], function (type) {\n return type * -1;\n });\n defaultFilter[PJQ.constants.commitments.filterType.STATUS_FILTER] = this.userSettings.get('defaultCommitmentStatusFilter');\n\n this.defaultFilterSelectPicker = new PJQ.inputs.Selectpicker({\n el: this.$('.select-filter-default'),\n isIntChoices: true,\n isMultiple: true,\n isGrouped: true,\n defaultValue: defaultFilter,\n onChange: _.bind(function () {\n this.options.defaultTypeFilter = this.defaultFilterSelectPicker.getValue()[PJQ.constants.commitments.filterType.TYPE_FILTER];\n this.options.defaultTypeFilter = _.map(this.options.defaultTypeFilter, function (type) {\n return type * -1;\n });\n this.options.defaultStatusFilter = this.defaultFilterSelectPicker.getValue()[PJQ.constants.commitments.filterType.STATUS_FILTER];\n }, this)\n });\n\n this.rowsPerPage = new PJQ.inputs.Selectpicker({\n el: this.$('select.rows-per-page'),\n isIntChoices: true,\n onChange: _.bind(function (value) {\n this.currentView.rowsPerPage = value;\n }, this)\n });\n\n this.selectView(PJQ.constants.commitments.view.COMMITMENTS);\n },\n editCompanySettings: function () {\n this.userSettings = new PJQ.models.commitments.CommitmentUserSettings(null, {\n forCompany: true\n });\n this.userSettings.fetch({\n success: _.bind(function () {\n this.render();\n }, this)\n });\n },\n selectView: function (view) {\n this.currentView = _.find(this.options.userSettings, _.bind(function (setting) {\n return setting.view === view;\n }, this));\n\n if (view.indexOf('-') === -1) {\n this.rowsPerPage.setValue(this.currentView.rowsPerPage);\n this.$('div.rows-per-page').show();\n }\n else\n this.$('div.rows-per-page').hide();\n\n if (this.dataTable) {\n this.dataTable.undelegateEvents();\n $(this.dataTable.el).empty();\n }\n\n this.dataTable = new PJQ.views.dataTables.DataTable({\n el: this.$('div.select-columns-datatable'),\n data: this.currentView.columns,\n isHideSearch: true,\n pageLength: 6,\n order: [],\n columns: [\n {\"data\": \"title\", \"title\": \"Column\", \"orderable\": false},\n {\n \"data\": \"visible\",\n \"title\": \"Show\",\n \"orderable\": false,\n \"searchable\": false,\n \"render\": _.bind(function (data) {\n return ('
');\n }, this),\n \"width\": '10%'\n }\n ],\n dom: '<\"top\"<\"clear\">>rt<\"bottom\"p<\"clear\">>'\n });\n\n },\n columnSelected: function (sender) {\n this.dataTable.dataTable.row($(sender.currentTarget).closest('tr')).data().visible = $(sender.currentTarget).prop('checked');\n },\n onSave: function () {\n\n let fnOnSave = _.bind(function () {\n if (typeof this.options.onSave === 'function')\n this.options.onSave();\n this.removeModal();\n }, this);\n\n this.userSettings.set('defaultCommitmentTypeFilter', this.options.defaultTypeFilter);\n this.userSettings.set('defaultCommitmentStatusFilter', this.options.defaultStatusFilter);\n\n _.each(this.options.userSettings, _.bind(function (settingTemp) {\n _.each(this.userSettings.get('viewSettings'), _.bind(function (setting) {\n if (settingTemp.view === setting.view) {\n setting.rowsPerPage = settingTemp.rowsPerPage;\n\n let columns = _.size(setting.columns) > 0 ? setting.columns.slice() : setting.columnsDefault.slice();\n\n // update columns\n _.each(settingTemp.columns, _.bind(function (column) {\n if (column.visible) {\n if (columns.indexOf(column.columnData) === -1)\n columns.push(column.columnData);\n }\n else {\n if (columns.indexOf(column.columnData) !== -1)\n columns = _.filter(columns, _.bind(function (columnTemp) {\n return columnTemp != column.columnData;\n }, this));\n }\n }, this));\n\n setting.columns = columns;\n }\n }, this));\n }, this));\n\n this.userSettings.save(null, {\n success: _.bind(function () {\n fnOnSave();\n }, this)\n });\n },\n});"]}