Skip to content

Commit

Permalink
VCST-1306: Incomplete quote proposal warning (#115)
Browse files Browse the repository at this point in the history
feat: Adds Incomplete quote proposal warning if quote doesn't have either any items or with a zero total.
  • Loading branch information
OlegoO authored Jun 17, 2024
1 parent 46c2eb5 commit e4a9a35
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"quotes": {
"main-menu-title": "Kostenvoranschläge",
"main-menu-title": "Kostenvoranschläge",
"blades": {
"quotes-assets": {
"subtitle": "Anhänge",
Expand Down Expand Up @@ -123,10 +123,14 @@
"reason": "Ein Grund, hier abzubrechen..."
}
},
"proposal-delete": {
"proposal-submit": {
"title": "Vorschlag bestätigen",
"message": "Nur begrenzte Änderungen sind verfügbar, nachdem der Antrag gesendet wurde. Sind Sie sicher, dass Sie diesen Vorschlag an den Kunden schicken möchten?"
},
"proposal-submit-with-warning": {
"title": "Unvollständiger Angebotsvorschlag",
"message": "Achtung: Das Angebot enthält entweder keine Artikel oder hat einen Gesamtwert von Null. Bitte stellen Sie sicher, dass alle Artikel aufgelistet und mit den richtigen Preisen versehen sind, bevor Sie fortfahren. Möchten Sie wirklich fortfahren?"
},
"hold-confirmation": {
"title": "Warteschleifen Bestätigung",
"message-release": "Bist du sicher, dass die Pausierung aus diesem Angebot freigeben willst?",
Expand All @@ -142,4 +146,4 @@
"add-item": "Artikel hinzufügen"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@
"reason": "Please enter reason here..."
}
},
"proposal-delete": {
"proposal-submit": {
"title": "Confirm proposal",
"message": "After you send a proposal, you will not be able to modify some parts of your quote. Are you sure you want to proceed?"
"message": "Once you submit your proposal, certain parts of your quote will be locked and cannot be modified. Are you sure you want to proceed?"
},
"proposal-submit-with-warning": {
"title": "Incomplete quote proposal",
"message": "Warning: The quote doesn't have either any items or with a zero total. Please ensure that all items are listed and priced appropriately before proceeding. Are you sure you want to proceed?"
},
"hold-confirmation": {
"title": "Confirm put on hold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,14 @@
}

},
"proposal-delete": {
"proposal-submit": {
"title": "Подтверждение предложения",
"message": "После отправления предложения будут доступны лишь незначительные правки. Вы действительно хотите отправить это предложение покупателю?"
},
"proposal-submit-with-warning": {
"title": "Неполное предложение",
"message": "Предупреждение: Ваша квота будет отправлена ​​без каких-либо позиций или с нулевой общей суммой. Пожалуйста, убедитесь, что все позиции перечислены и оценены надлежащим образом, прежде чем продолжить. Вы уверены, что хотите продолжить?"
},
"hold-confirmation": {
"title": "Ожидание подтверждения",
"message-release": "Вы уверены, что хотите исключить это из квоты?",
Expand All @@ -145,7 +149,7 @@
},
"module": {
"VirtoCommerce.Quote": {
"description": "Экспорт/Импорт запросов котировок (RFQ)"
"description": "Экспорт/Импорт запросов котировок (RFQ)"
}
}
}
}
44 changes: 32 additions & 12 deletions src/VirtoCommerce.QuoteModule.Web/Scripts/blades/quote-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ angular.module('virtoCommerce.quoteModule')
'platformWebApp.bladeNavigationService', 'platformWebApp.settings', 'platformWebApp.dialogService', 'platformWebApp.metaFormsService',
'virtoCommerce.quoteModule.quotes', 'virtoCommerce.customerModule.members',
function ($scope, bladeNavigationService, settings, dialogService, metaFormsService, quotes, members) {

const QuoteProposalSentStatus = 'Proposal sent';

var blade = $scope.blade;

var onHoldCommand = {
Expand Down Expand Up @@ -148,21 +151,38 @@ angular.module('virtoCommerce.quoteModule')
{
name: "quotes.commands.submit-proposal", icon: 'fa fa-check-square-o',
executeMethod: function () {
var dialog = {
id: "confirmDelete",
title: "quotes.dialogs.proposal-delete.title",
message: "quotes.dialogs.proposal-delete.message",
callback: function (ok) {
if (ok) {
blade.currentEntity.status = 'Proposal sent';
saveChanges();
if (blade.currentEntity.items.length === 0 ||
blade.currentEntity.totals.grandTotalInclTax === 0) {
var warningDialog = {
id: "submitProposalWithWarning",
title: "quotes.dialogs.proposal-submit-with-warning.title",
message: "quotes.dialogs.proposal-submit-with-warning.message",
callback: function (ok) {
if (ok) {
blade.currentEntity.status = QuoteProposalSentStatus;
saveChanges();
}
}
}
};
dialogService.showConfirmationDialog(dialog);
};
dialogService.showWarningDialog(warningDialog);
}
else {
var confirmationDialog = {
id: "submitProposal",
title: "quotes.dialogs.proposal-submit.title",
message: "quotes.dialogs.proposal-submit.message",
callback: function (ok) {
if (ok) {
blade.currentEntity.status = QuoteProposalSentStatus;
saveChanges();
}
}
};
dialogService.showConfirmationDialog(confirmationDialog);
}
},
canExecuteMethod: function () {
return blade.origEntity && blade.origEntity.status !== 'Proposal sent';
return blade.origEntity && blade.origEntity.status !== QuoteProposalSentStatus;
},
permission: blade.updatePermission
},
Expand Down

0 comments on commit e4a9a35

Please sign in to comment.