diff --git a/backend/api/viewsets/credit_transfer.py b/backend/api/viewsets/credit_transfer.py index ebfd80fe7..818d70a60 100644 --- a/backend/api/viewsets/credit_transfer.py +++ b/backend/api/viewsets/credit_transfer.py @@ -56,7 +56,8 @@ def get_queryset(self): CreditTransferStatuses.REJECTED, CreditTransferStatuses.VALIDATED ])) | - Q(debit_from_id=request.user.organization.id)) + Q(debit_from_id=request.user.organization.id) + ).exclude(status__in=[CreditTransferStatuses.DELETED]) return queryset def get_serializer_class(self): diff --git a/frontend/src/credits/CreditTransfersEditContainer.js b/frontend/src/credits/CreditTransfersEditContainer.js index 6b27fa473..86f6b122e 100644 --- a/frontend/src/credits/CreditTransfersEditContainer.js +++ b/frontend/src/credits/CreditTransfersEditContainer.js @@ -151,8 +151,8 @@ const CreditTransfersEditContainer = (props) => { submitOrSave('DRAFT'); }; - const handleSubmit = () => { - submitOrSave('SUBMITTED'); + const handleSubmit = (type) => { + submitOrSave(type); }; const refreshDetails = () => { diff --git a/frontend/src/credits/components/CreditTransfersForm.js b/frontend/src/credits/components/CreditTransfersForm.js index dd4d12a61..a41d33958 100644 --- a/frontend/src/credits/components/CreditTransfersForm.js +++ b/frontend/src/credits/components/CreditTransfersForm.js @@ -36,20 +36,21 @@ const CreditTransfersForm = (props) => { submission, } = props; const [showModal, setShowModal] = useState(false); + const [modalType, setModalType] = useState({ type: '', buttonText: '', message: '' }); const submitTooltip = 'You must acknowledge the three confirmation checkboxes prior to submitting this transfer.'; const modal = ( { setShowModal(false); }} - handleSubmit={() => { setShowModal(false); handleSubmit(); }} + handleSubmit={() => { setShowModal(false); handleSubmit(modalType.type); }} modalClass="w-75" showModal={showModal} - confirmClass="button primary" - icon={} + confirmClass={modalType === 'SUBMITTED' ? 'button primary' : 'btn-outline-danger'} + icon={modalType === 'SUBMITTED' ? : } >


-

Submit credit transfer notice to trade partner? +

{modalType.message}



@@ -61,6 +62,16 @@ const CreditTransfersForm = (props) => {