---
title: Payment
slug: oip-next/bnojojyygo3sh9u0uucu0
createdAt: 2024-02-21T13:29:49.000Z
---

# Payment

## Description

L'entité payment porte les informations de paiement sélectionnées sur l'OAV. Un ou plusieurs paiements peuvent être définis sur l'OAV.

## Relations

### Ascendantes

| Entité | Propriété |
| ------ | --------- |
| Pack   | payments  |

### Descendantes

| Entité        | Propriété      |
| ------------- | -------------- |
| History       | history        |
| Relation      | issuer         |
| PaymentMethod | paymentMethods |
| Relation      | relations      |

## Liste des propriétés

| Nom        | Type             | Dernière version modifiée | Description                                                      | Getter               | Setter               | Deprecated |
| ---------- | ---------------- | ------------------------- | ---------------------------------------------------------------- | -------------------- | -------------------- | ---------- |
| amount     | `Number`         | 2.7.0                     | Montant du paiement                                              | getPaymentAmount     | setPaymentAmount     | -          |
| createdAt  | `Date`           |                           | Date de création de l'entité `Payment`                           | getPaymentCreatedAt  | Lecture seule        | -          |
| createdBy  | `String`         |                           | Utilisateur à l'origine de la création de l'entité `Payment`     | getPaymentCreatedBy  | Lecture seule        | -          |
| fiscalType | `FiscalTypeEnum` | 2.7.0                     | Type de fiscalité                                                | getPaymentFiscalType | setPaymentFiscalType | -          |
| id         | `String`         |                           | Identifiant unique de l'entité `Payment`                         | getPaymentId         | Lecture seule        | -          |
| updatedAt  | `Date`           |                           | Date de modification de l'entité `Payment`                       | getPaymentUpdatedAt  | Lecture seule        | -          |
| updatedBy  | `String`         |                           | Utilisateur à l'origine de la modification de l'entité `Payment` | getPaymentUpdatedBy  | Lecture seule        | -          |

## Enums

### FiscalTypeEnum

- `FiscalTypeEnum.82DISPO`
- `FiscalTypeEnum.82NODISP`
- `FiscalTypeEnum.ART39`
- `FiscalTypeEnum.ART39IFC`
- `FiscalTypeEnum.ART39IFCIL`
- `FiscalTypeEnum.ART39RA`
- `FiscalTypeEnum.ART82`
- `FiscalTypeEnum.ART83`
- `FiscalTypeEnum.ASSVIE`
- `FiscalTypeEnum.ASSVIE62`
- `FiscalTypeEnum.ASSVIE62PEP`
- `FiscalTypeEnum.ASSVIEPEP`
- `FiscalTypeEnum.CTRCAPI`
- `FiscalTypeEnum.EPARHAND`
- `FiscalTypeEnum.EPARRETR`
- `FiscalTypeEnum.EXPATR`
- `FiscalTypeEnum.FINCARR`
- `FiscalTypeEnum.FISCDSK`
- `FiscalTypeEnum.FISCLAS`
- `FiscalTypeEnum.FISCPRIMA`
- `FiscalTypeEnum.FISCMAD`
- `FiscalTypeEnum.FISCMAD62`
- `FiscalTypeEnum.FISCMADA`
- `FiscalTypeEnum.FISCMADA62`
- `FiscalTypeEnum.PACTE`
- `FiscalTypeEnum.PEA`
- `FiscalTypeEnum.PEAPE`
- `FiscalTypeEnum.PEE`
- `FiscalTypeEnum.PEP`
- `FiscalTypeEnum.PEPEU`
- `FiscalTypeEnum.PEPUC`
- `FiscalTypeEnum.PER`
- `FiscalTypeEnum.PERCO`
- `FiscalTypeEnum.PERE`
- `FiscalTypeEnum.PERI154B`
- `FiscalTypeEnum.PERI154BOA`
- `FiscalTypeEnum.PERI163Q`
- `FiscalTypeEnum.PERIVRSTNDEC`
- `FiscalTypeEnum.PERP`
- `FiscalTypeEnum.RENTE`
- `FiscalTypeEnum.VIEGEN`

## Exemple

```javascript
import { Entities } from '@fasstech/oip-core';
import { getOfferId } from '@fasstech/oip-core/entities/offer';
import { getPackId } from '@fasstech/oip-core/entities/pack';
import { getPaymentAmount, getPaymentFiscalType, getpaymentId, setPaymentAmount, setPaymentFiscalType } from '@fasstech/oip-core/entities/payment';
import { FiscalTypeEnum } from '@fasstech/oip-core/entities/payment/enums';
import { getProjectId } from '@fasstech/oip-core/entities/project';

(async () => {
  let ProjectEntity = await Entities('Project').get({ id: projectId });
  let OfferEntity = await Entities('Offer').create();
  let PackEntity = await Entities('Pack').create();
  const PaymentEntity = await Entities('Payment').create();
  
  setPaymentAmount(97, PaymentEntity);
  setPaymentFiscalType(FiscalTypeEnum.FISCMAD62, PaymentEntity);
  
  PackEntity = await Entities('Payment').save(PackEntity, PaymentEntity);
  OfferEntity = await Entities('Pack').save(OfferEntity, PackEntity);
  ProjectEntity = await Entities('Offer').save(ProjectEntity, OfferEntity);
  await Entities('Project').save(ProjectEntity);
  
  const ProjectEntityToTest = await Entities('Project').get({ id: getProjectId(ProjectEntity) });
  const OfferEntityToTest = await Entities('Offer').get(ProjectEntityToTest, getOfferId(OfferEntity));
  const PackEntityToTest = await Entities('Pack').get(OfferEntityToTest, getPackId(PackEntity));
  const PaymentEntityToTest = await Entities('Payment').get(PackEntityToTest, getPaymentId(PaymentEntity));
  
  getPaymentAmount(PaymentEntityToTest); // 97
  getPaymentFiscalType(PaymentEntityToTest); // FiscalTypeEnum.FISCMAD62
})();
```
