Skip to content

Commit

Permalink
Merge pull request #84 from konsept-ch/tasks
Browse files Browse the repository at this point in the history
Tasks
  • Loading branch information
firepolo authored Feb 6, 2024
2 parents 74a3112 + c67e5b1 commit c5c31dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/pages/AgendaPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ export const AgendaPage = () => {

useEffect(() => {
if (Object.keys(selectedRoomIds).length <= 1) {
const initialSelectedRoomIds = (rooms || []).reduce(
(acc, { id, location }) => ({ ...acc, [id]: location?.name === 'CEP' }),
{ 'no-room': false }
)
const initialSelectedRoomIds = (rooms || []).reduce((acc, { id, location }) => ({ ...acc, [id]: true }), {
'no-room': true,
})

setSelectedRoomIds(initialSelectedRoomIds)
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/InscriptionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function InscriptionsPage() {
const [isMassUpdateModalVisible, setIsMassUpdateModalVisible] = useState(false)
const [selectedInscriptionId, setSelectedInscriptionId] = useState(null)
const inscriptions = useSelector(inscriptionsSelector)
const [activePredefinedFiltersById, setActivePredefinedFiltersById] = useState({ onlyWebEntries: true })
const [activePredefinedFiltersById, setActivePredefinedFiltersById] = useState({ onlyWebEntries: false })

const [updateInscriptionStatus, { isLoading: isUpdatingInscriptionStatus }] = useUpdateInscriptionStatusMutation()

Expand Down
10 changes: 7 additions & 3 deletions src/pages/ManualInvoicesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export function ManualInvoicesPage() {
name: 'Exporter pour Crésus',
action: () => {
const invoicesToExport = (selectedRowsIds.length > 0 ? invoicesData : [data]).filter(
({ id, status }) => selectedRowsIds.includes(id) && status === 'Traitée'
({ id }) => selectedRowsIds.includes(id)
)

const csvClient = Papa.unparse(
Expand Down Expand Up @@ -319,7 +319,9 @@ export function ManualInvoicesPage() {
invoiceData.customClientTitle,
invoiceData.customClientLastname,
invoiceData.customClientFirstname,
invoiceData.customClientAddress.replaceAll('\n', '\\'),
(invoiceData.organizationName === 'Compte privé'
? `${invoiceData.customClientFirstname} ${invoiceData.customClientLastname}\\`
: '') + invoiceData.customClientAddress.replaceAll('\n', '\\'),
postalAddressStreet,
postalAddressCode,
postalAddressLocality,
Expand Down Expand Up @@ -365,7 +367,9 @@ export function ManualInvoicesPage() {
invoiceData.items.map(({ amount }) => amount).join('/'),
invoiceData.items.map(({ price }) => price).join('/'),
invoiceData.items.map(({ vatCode }) => vatCode).join('/'),
invoiceData.customClientAddress.replaceAll('\n', '\\'),
(invoiceData.organizationName === 'Compte privé'
? `${invoiceData.customClientFirstname} ${invoiceData.customClientLastname}\\`
: '') + invoiceData.customClientAddress.replaceAll('\n', '\\'),
invoiceData.clientNumber,
new Date(year, 0, 1, 12, 0, 0, 0).toLocaleDateString('fr-CH'),
new Date(year, 11, 31, 12, 0, 0, 0).toLocaleDateString('fr-CH'),
Expand Down

0 comments on commit c5c31dd

Please sign in to comment.