Custom Codes for different purposes
Configuration
Field |
Description |
Code Name |
|
Description |
|
Start date |
Start date for the Report / Code |
End date |
End date for the Report / Code |
Branch
|
|
Code
Field |
Description |
Type of Code |
Options:
- ---------
- Bonus
- Report
- Web Page
- Executed by a Signal
- Benefits
- Source Code Class
|
Class/Action name |
Options:
- ---------
- CustomClass
- MakeBill
- InvoiceSellMake
- CreditNoteMake
- DebitNoteMake
- ShoppingMake
- ShoppingAdjNoteMake
- ConstructPayRollByEmployee
- AccountPayRoll
- Rips
- RipsWithoutInvoice
- SelectRipsToProcess
- RipsDoctorAndCompany
|
Custom attributes |
To store the values of other attributes that are necessary within the code. To access this dictionary in code: custom_report.custom_attrs.get('attribute_name') |
Schema for Custom Attributes |
To define the scheme of the extra fields. The values of the fields defined here are stored in 'custom_attrs'. Schemas could have the attributes 'label' (text), 'help_text' (text), 'required' (boolean), 'type' (BooleanField, IntegerField, CharField, ChoiceField, etc) and 'choices' (with type ChoiceField). Schemas must be defined in a list, and the key nameof the list must be 'fields' |
Python code |
If it's a Custom Report: you must declare a function called 'get_report()' that returns an instance of type Django File.
If it's a Custom Bonus: you must declare a function called 'get_bonus()' that return the class that builds the bonus.
If it's a Custom Benefit: you must declare a function called 'get_benefit_value()' that return the 'BenefitValue' class that builds Benefit values.
In admin is available: request, custom_report, branch, start_date, end_date. |
Custom codes
It has the following related modules and may be of interest to you:
Déjanos tus comentarios