Difference between revisions of "Module Customers Invoices (developer)"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
m (Import interlang links (links to translated versions of this page in other languages) from Multi Language Manager table.)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<!-- BEGIN origin interlang links -->
 +
<!-- You can edit this section but do NOT remove these comments
 +
    Links below will be automatically replicated on translated pages by PolyglotBot -->
 +
[[fr:Module_Factures_Clients_(développeur)]]
 +
[[es:Módulo_Facturas_a_clientes_(desarrollador)]]
 +
<!-- END interlang links -->
 +
 
[[Category:Invoices]]
 
[[Category:Invoices]]
 
{{TemplateDocDevEn}}
 
{{TemplateDocDevEn}}
 +
{{TemplateModEN Developer}}
 
{{BasculeDevUserEn|
 
{{BasculeDevUserEn|
name=Invoice|  
+
name=Invoice|
 +
num=30|
 
devdoc=This page|
 
devdoc=This page|
userdoc=[[Customers Invoices]]|}}
+
userdoc=[[Module Customers Invoices]]|}}
  
 
= Feature =
 
= Feature =
{{ToTranslate}}
+
The invoice module is to manage the following entities:
Le module Facture permet de gérer dans Dolibarr les entités suivantes:
+
* Customer invoices
* Factures clients
+
* Lines of customer invoices
* Lignes de factures
+
* Predefined invoices
Les factures fournisseurs sont gérées par le module Fournisseur.
+
The suppliers invoices are managed by the [[Module Suppliers (developer)]].
  
Les arrondis de calcul de TVA doivent se faire "au plus près".
+
Rounding of VAT lines is done by the rule "the nearest".
  
Exemple:
+
Example:
  
de 0,0000 à 0,0049 --> 0,00
+
for 0,0000 to 0,0049 --> 0,00
  
de 0,0050 à 0,0099 --> 0,01
+
for 0,0050 to 0,0099 --> 0,01
 
 
''Number : 30''
 
  
 
= Entity Invoice =
 
= Entity Invoice =
 
{{TemplateDocDevEntityEn|
 
{{TemplateDocDevEntityEn|
class=htdocs/facture.class.php}}
+
class=htdocs/compta/facture/class/facture.class.php}}
  
 
'''Business rules''':
 
'''Business rules''':
* Une facture a plusieurs lignes de factures
+
* An invoice has several invoice lines
* Il est possible de rattacher 1 à n contacts à une facture
+
* You can attach 1 to n contacts to an invoice
* A compléter...
+
* To complete...
  
'''Cycle de vie''':
+
'''Life cycle''':
  
* Une facture peut être créée en mode brouillon (Provoque appel du trigger BILL_CREATE)
+
* An invoice can be created as a draft (This calls trigger BILL_CREATE)
* Une facture peut être modifiée (Provoque appel du trigger BILL_UPDATE)
+
* An invoice can be modified (This calls trigger BILL_UPDATE)
* Une facture peut être validée (Provoque appel du trigger BILL_VALIDATE)
+
* An invoice can be validated (This calls trigger BILL_VALIDATE)
* Une facture peut recevoir un paiement
+
* An invoice can receive one or more payments
* Une facture peut être classée abandonnée ou payée (Provoque appel du trigger BILL_CANCEL ou BILL_UPDATE)
+
* An invoice can be closed by status Abandoned or Payed (This calls trigger BILL_CANCEL or BILL_UPDATE)
  
= Entité Ligne de Facture =
+
= Entity Invoice line =
 
{{TemplateDocDevEntityEn|
 
{{TemplateDocDevEntityEn|
class=htdocs/facture.class.php}}
+
class=htdocs/compta/facture/class/facture.class.php}}
 +
 
 +
* An invoice line has type product or service (you have to choose if both module [[Products]] and [[ServicesEn|Services]] are activated).
 +
* An invoice line represents a product/service in an invoice (with a unit price, a qty, a vat and a discount)
 +
* Each invoice has between 1 and n invoice lines
  
* Une ligne de facture représente un produit dans une facture
+
= Entity Predefined invoice =
* Chaque facture a 1 à n lignes de produits
+
{{TemplateDocDevEntityEn|
 +
class=htdocs/compta/facture/class/facture-rec.class.php}}
  
 
= Permissions =
 
= Permissions =
Line 62: Line 74:
 
* [[Table llx facture_rec|llx_facture_rec]]
 
* [[Table llx facture_rec|llx_facture_rec]]
 
* [[Facturedet_rec_(Table_SQL)|llx_facturedet_rec]]
 
* [[Facturedet_rec_(Table_SQL)|llx_facturedet_rec]]
 +
 +
= Constants =
 +
* FACTURE_ADDON_PDF
 +
* FACTURE_ADDON
 +
* FAC_FORCE_DATE_VALIDATION
 +
 +
= Scripts =
 +
* [[Script rebuild_merge_pdf.php|rebuild_merge_pdf.php]]
 +
* [[Script email_unpaid_invoices_to_representatives.php|email_unpaid_invoices_to_representatives.php]]

Latest revision as of 13:21, 23 July 2019

Invoice
Numero/ID of module 30
User doc. of module Module Customers Invoices
Developer doc. of module This page

Feature

The invoice module is to manage the following entities:

  • Customer invoices
  • Lines of customer invoices
  • Predefined invoices

The suppliers invoices are managed by the Module Suppliers (developer).

Rounding of VAT lines is done by the rule "the nearest".

Example:

for 0,0000 to 0,0049 --> 0,00

for 0,0050 to 0,0099 --> 0,01

Entity Invoice

The PHP class to use to manipulate such object is file htdocs/compta/facture/class/facture.class.php.

It contains CRUD methods to create (C), read (R), update (U) and delete (D) this object.

Business rules:

  • An invoice has several invoice lines
  • You can attach 1 to n contacts to an invoice
  • To complete...

Life cycle:

  • An invoice can be created as a draft (This calls trigger BILL_CREATE)
  • An invoice can be modified (This calls trigger BILL_UPDATE)
  • An invoice can be validated (This calls trigger BILL_VALIDATE)
  • An invoice can receive one or more payments
  • An invoice can be closed by status Abandoned or Payed (This calls trigger BILL_CANCEL or BILL_UPDATE)

Entity Invoice line

The PHP class to use to manipulate such object is file htdocs/compta/facture/class/facture.class.php.

It contains CRUD methods to create (C), read (R), update (U) and delete (D) this object.

  • An invoice line has type product or service (you have to choose if both module Products and Services are activated).
  • An invoice line represents a product/service in an invoice (with a unit price, a qty, a vat and a discount)
  • Each invoice has between 1 and n invoice lines

Entity Predefined invoice

The PHP class to use to manipulate such object is file htdocs/compta/facture/class/facture-rec.class.php.

It contains CRUD methods to create (C), read (R), update (U) and delete (D) this object.

Permissions

  • ->facture->lire
  • ->facture->creer
  • ->facture->modifier
  • ->facture->valider
  • ->facture->envoyer
  • ->facture->paiment
  • ->facture->supprimer
  • ->facture->facture->export

Tables SQL

Constants

  • FACTURE_ADDON_PDF
  • FACTURE_ADDON
  • FAC_FORCE_DATE_VALIDATION

Scripts