Skip to content
Snippets Groups Projects
Commit a45ad978 authored by Marjolaine Bodin's avatar Marjolaine Bodin
Browse files

Merge branch '839-fix_transport_organization_update' into 'main'

Resolve "Update transport organization"

Closes #839

See merge request !736
parents 0b76ed3a a41e409a
Branches 841-give-support-to-folders-in-the-gallery
No related tags found
1 merge request!736Resolve "Update transport organization"
Pipeline #229451 passed
...@@ -175,6 +175,11 @@ export function ParcelTransportOrganisation({ ...@@ -175,6 +175,11 @@ export function ParcelTransportOrganisation({
body: { body: {
...parcel, ...parcel,
isReimbursed: e.currentTarget.checked, isReimbursed: e.currentTarget.checked,
returnParcelInformation: {
returnType: undefined,
forwarderName: undefined,
plannedPickupDate: undefined,
},
}, },
}); });
if (e.currentTarget.checked) { if (e.currentTarget.checked) {
...@@ -198,7 +203,7 @@ export function ParcelTransportOrganisation({ ...@@ -198,7 +203,7 @@ export function ParcelTransportOrganisation({
reference={reference} reference={reference}
/> />
)} )}
{parcel.returnAddress && paidByFacility !== true && ( {parcel.returnAddress && (
<> <>
<Row className="mt-1"> <Row className="mt-1">
<Col> <Col>
...@@ -214,13 +219,15 @@ export function ParcelTransportOrganisation({ ...@@ -214,13 +219,15 @@ export function ParcelTransportOrganisation({
label={`I will prepare the transport documents using my forwarder account, and ${facilityName} will organise the return using the return documents I prepared (daily pickups from ${facilityName} exist for ${faciltyTransporters}).`} label={`I will prepare the transport documents using my forwarder account, and ${facilityName} will organise the return using the return documents I prepared (daily pickups from ${facilityName} exist for ${faciltyTransporters}).`}
name="radio-parcel-papers-included" name="radio-parcel-papers-included"
id="radio-parcel-papers-included" id="radio-parcel-papers-included"
checked={parcelPapersManaged} checked={!paidByFacility && parcelPapersManaged}
onChange={(e) => { onChange={(e) => {
setParcelPapersManaged(e.currentTarget.checked); setParcelPapersManaged(e.currentTarget.checked);
setPaidByFacility(false);
setPickup(!e.currentTarget.checked); setPickup(!e.currentTarget.checked);
mutate({ mutate({
body: { body: {
...parcel, ...parcel,
isReimbursed: false,
returnParcelInformation: { returnParcelInformation: {
returnType: RETURN_PARCEL_TYPE_MANAGE, returnType: RETURN_PARCEL_TYPE_MANAGE,
forwarderName: undefined, forwarderName: undefined,
...@@ -241,13 +248,15 @@ export function ParcelTransportOrganisation({ ...@@ -241,13 +248,15 @@ export function ParcelTransportOrganisation({
label={`I will prepare the transport documents using my forwarder account, and I will organise the return directly with the fowarder (if not ${faciltyTransporters}).`} label={`I will prepare the transport documents using my forwarder account, and I will organise the return directly with the fowarder (if not ${faciltyTransporters}).`}
name="radio-parcel-papers-oganized" name="radio-parcel-papers-oganized"
id="radio-parcel-papers-oganized" id="radio-parcel-papers-oganized"
checked={pickup} checked={!paidByFacility && pickup}
onChange={(e) => { onChange={(e) => {
setPickup(e.currentTarget.checked); setPickup(e.currentTarget.checked);
setPaidByFacility(false);
setParcelPapersManaged(!e.currentTarget.checked); setParcelPapersManaged(!e.currentTarget.checked);
mutate({ mutate({
body: { body: {
...parcel, ...parcel,
isReimbursed: false,
returnParcelInformation: { returnParcelInformation: {
returnType: RETURN_PARCEL_TYPE_ORGANIZE, returnType: RETURN_PARCEL_TYPE_ORGANIZE,
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment