Some of these changes are considered to be breaking and were marked with (BREAKING). Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Fixed a race condition when paying invoices, by using DB locks. (hopefully)
- Fixed a case when issuing Invoices (occuring from a paid Proforma) would ignore the customer's
payment_due_date
field - Fixed documents
due_date
being set even in draft, which was incorrect. Now it will only be set after the document has been issued. (WARNING) - Fixed
transaction_xe_rate
andtransaction_xe_date
not being properly set in some cases. (WARNING) - Changed how sums in the transaction currency are calculated. Now, only the exchange rate is only applied to the base unit_price, instead of individually to each sums (before VAT, VAT only). This can result in small differences due to different rounding. (WARNING).
- Transactions will automatically save when they transition to another state (
transaction.settle()
will also calltransaction.save()
). (WARNING) - Transactions will automatically be validated upon save (
transaction.save()
will also calltransaction.full_clean()
). (WARNING) - MeteredFeatureUnitsLogs can now be annotated. This is a way to separate units from different sources, that use the same metered feature.
- BillingLogs can now be created/edited/deleted from the admin Subscription view. (WARNING)
- Replaced MeteredFeatureUnitsLogs
start_date
andend_date
fields withstart_datetime
andend_datetime
(BREAKING):- The precission is limited to seconds for practical reasons, meaning microseconds will be stripped. A full day used
to be represented by
2022-05-01
to2022-05-01
, now it will be represented by2022-05-01T00:00:00Z
to2022-05-01T23:59:59Z
. (BREAKING) - They are now made editable from the admin view.
- They are no longer restricted to the billing interval, but may form any interval inside the billing interval (e.g. half a day during a daily billed subscription). The only restriction is intervals from different related MFULs may not overlap. (WARNING)
- The precission is limited to seconds for practical reasons, meaning microseconds will be stripped. A full day used
to be represented by
- Added a crude setting (
SILVER_DEFAULT_UNIT_PRICE_DECIMALS
) for specifying how many decimals the entry unit_price should be quantized to.
- The API endpoints regarding MeteredFeatureUnitsLogs were reworked, to address some inconsistencies (sometimes
count
was used instead ofconsumed_units
), and also to include the above mentioned changes. - An
end_log
field (bool
) may be used to modify the targeted MeteredFeatureUnitLog's end_date into the provideddate
. This should help with a usecase when sending units gathered from different time intervals, which should not be mixed together (for some arbitrary reason). - The Subscription reference is now allowed to be changed, even after the subscription has been activated.
- Expose django-silver as a pytest plugin to fix tests when installed as package. Fixtures wouldn't be detected otherwise.
- Added Python>=3.7,<3.9 and Django>3.1,<3.3 support. Older versions are dropped. (BREAKING)
- Bumped some other dependencies versions.
- Proforma API fields
archived_provider
andarchived_customer
now correctly return JSON objects rather than stringified JSON objects
- PaymentMethod
encrypt_data
anddecrypt_data
methods are now type hinted. (WARNING).decrypt_data
will no longer catchesInvalidToken
exception and returnsNone
, but will instead let the exception pass.
- Fixed issue in autocomplete views where user.is_authenticated is no longer a function call and instead an attribute
Some of these changes are considered to be breaking and were marked with (BREAKING)
Invoice
andProforma
fieldsarchived_provider
andarchived_customer
are now represented as JSON instead of a string. (BREAKING)- Decimal numbers are now always properly typed as string. (BREAKING)
- Rewrote some tests using pytest and specs.
- Not specifying
transaction_xe_rate
when creating documents no longer results in an internal error. number
andseries
are no longer required when creating a document.
proforma_series
is now included in thearchived_provider
field for invoices as well.
- Remove Subscription state field direct modification protection. This fixes admin subscription creation / editing and Subscription.refresh_from_db. Regarding the removed protection, just don't modify the field directly, use the state transition methods instead.
- The Subscription state field is properly marked as read-only now. You couldn't modify it before anyway.
- Make some admin fields dropdowns searchable.
- Fixed a possible crash when generating documents for subscriptions with the trial period spanning over multiple billing cycles.
This release contains security changes that were marked below with (SECURITY). It is advised to upgrade to the latest version of django-silver.
- Escape user-inputable text before marking it as safe in admin. (SECURITY)
- Fix result handling error for a case of successful actions.
- Fix transaction admin error.
- Allow searching for Invoices and Proformas by "series-number" in admin.
- Fixed Transaction admin changelist query performance.
- Improved Plan admin changelist query performance.
- Added the possibility to create storno invoices.
- Separate totals per currency in the provider monthly totals report (admin action).
- Scrolling horizontally is no longer required to view the entire Invoice and Proforma admin lists for 1920px wide resolutions.
- Improve admin experience by adding direct links to resources in listings.
- Improved filtering, ordering and searching in admin for documents.
This is a beta release. It's not recommended to use it in production environments.
- Added Django2.2 compatibility
This is a beta release. It's not recommended to use it in production environments.
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Added Django2.0 and Django2.1 compatibility
- If you are using Python2.7 and Django 1.11 you'll probably have to manually pin
django-filters==1.1
in your project's requirements. (WARNING) - Transaction objects are now automatically cleaned before saving. (WARNING)
- The following API query params will no longer allow partial lookups (exact match is required now):
currency
,sales_tax_name
. (WARNING) - The following API query params will no longer allow case insensitive lookups:
state
,reference
. (WARNING) - Starting with a future release all API query params will probably require exact, case sensitive matching.
- Fixed BillingLog invoice field not being updated post creation. (migration fix included)
- Fixed PDF file download in admin.
- Fix PDF file upload for Google Storage.
- Don't use evil mock.assert_* functions.
- Fixed documents PDF generation.
- Added classifiers for Python 3.5 and 3.6 in setup.py.
- Fixed typo and obsolete keys in users endpoint API documentation
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Added Python 3.5 and 3.6 compatibility while maintaining Python 2.7 compatibility for now. (WARNING)
- Fixed not being able to later settle a transaction related to a manually paid document.
- Removed pytz dependency.
- Bumped cryptography version.
- Fixed a bug where a canceled subscription would not be billed if the plan was billed up to a date later than the cancel date.
- Fixed Transaction return_url being quoted because of a new version of furl, which has also been pinned to known working versions.
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Subscription's meta field now defaults to an empty dict. (WARNING)
- Added cancel_date to SubscriptionSerializer.
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Dropped Django 1.8 support, meaning only Django 1.11 is currently supported. (WARNING)
- PDF generate method will no longer mark the
PDF
object as clean if the file is not saved (through theupload
method) (WARNING) - Fixed a potential bug, involving the same
PDF
object and multiple threads, where thePDF
mark_as_dirty
method would fail to work properly.
- Make sure to use the plan currency when generating documents.
- Also store plan and metered feature amounts separately in Billing Logs.
- Increase phone number limits to 32, since there are a lot of phone formats.
- Small admin interface improvements for payment methods and transactions
- Solved archived customer bug. In some cases, the
name
attribute of an archived customer could be pass to the BillingEntity contructor, resulting in a 500 error (since BillingEntity) doesn't have aname
argument. - Fix DocumentAutocomplete bug. DocumentAutocomplete would fail if a
-
is pressent in query.
- Pin html5lib to 1.0b8 since this is a stable version working with xhtml2pdf
Some of these changes are considered to be breaking and were marked with (BREAKING)
- Implementations of payment processors don't have to call the
process
method on the transaction anymore. A new method calledprocess_transaction
has been added for actionable PaymentProcessors which tries to call the transactionprocess
method. This has been done to avoid a case of duplicate transactions. (BREAKING)
- Fixed some tests that were behaving differently when run inside a parent application.
- Use a custom working xhtml2pdf version for pdf generation
- Add
SILVER_SHOW_PDF_STORAGE_URL
option. IfFalse
,pdf_url
for document endpoints, will display an url to a view that will redirect to the actual document url. This is a small optimization in case you are using external document storages (like S3 or Google Storage), because it can take up to 1-2 seconds for them to generate secrets token for secured urls. By default it isTrue
which mean that the old behaviour is still up.
- Reduce query numbers for some API endpoints (
/plans
,/customers/subscriptions
) and admin
- Remove django-xhtml2pdf
- Adapt pdf generation for Django 1.8 and 1.11
Add deleted customer and id filters on document list endpoint.
Some of these changes are considered to be breaking and were marked with (BREAKING)
- Invoice and Proforma are now Proxy models of the BillingDocumentBase model, which is no longer
abstract. This allows for an easier aggregation in the /documents API endpoint. Both models should
still be usable as before and BillingDocumentBase instances should automatically be assigned
their concrete class, depending on their
kind
field. (BREAKING)
- Add
_total
and_total_in_transaction_currency
to document base.
- Optimize document view queries (30% speed improvement).
- Optimize document view queries (37% speed improvement).
- Fixed subscription end of billing cycle cancel date.
- Added development requirements via
setup.py
.
- Fixed updateable_buckets end_date not being the bucket_end_date for a canceled subscription.
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Fixed not being able to create Metered Feature Units Logs through the API if the subscription is canceled but not past the cancel_date.
- Updateable buckets past the subscription cancel date are no longer valid. (WARNING)
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Old PDFs are no longer deleted on PDF regeneration. (WARNING)
- Fixed execute_transactions task name.
- Added some missing fields to Provider and Plan in admin.
- Fixed execute_transactions task name.
- Added 'cycle_billing_duration' field to the Provider and Plan model, with both fields being optional, and the Plan one having priority over the Provider one. This field can be used to ensure that the billing date doesn't pass a certain date. Billing documents can still be generated after that day during the billing cycle, but their billing date will appear to be the end of the cycle billing duration.
V-----------billing cycle--------------V
[===============|=================|====]
^-cycle billing-^ ^
|---duration----| billing date
^
last possible billing date
Generating after the <last possible billing date> during this <billing cycle>
is possible but will use the <last possible billing date> as the <billing date>.
- Added a
created_at
field to BillingLog. - Display
plan_billed_up_to
,metered_features_billed_up_to
andcreated_at
BillingLog fields in admin. - Fixed
generate_after
field not being properly considered when generating documents. - Fixed being able to generate documents for a canceled subscription during the cancel_date day. The right behavior is generating the documents after the cancel_date.
Version 0.3.0 and 0.3.1 were published with errors. Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Celery and Redis are no longer a requirement, as the django commands and celery tasks that are supposed to be run periodically now have equivalents in both versions. Using celery tasks is still the recommended way to go.
- Refactored a fair part of the logic responsible for automatic billing documents generation.
This change might affect the way in which trial periods are handled, but it was necessary as the
old code was really hard to maintain and even understand in some places.
To allow configuring the billing cycles, the following fields were added to the Provider and Plan models,
with the Plan ones being optional and having priority over the Provider ones: (WARNING)
generate_documents_on_trial_end
separate_cycles_during_trial
prebill_plan
- BillingLog now has two additional date fields (
plan_billed_up_to
andmetered_features_billed_up_to
) that better describe what was already billed. An attempt to populate the existing Billing Logs with these fields was made through a migration, but it's possible that certain billing cycles involving trial periods might be off. Make sure to double check the next wave of automatically generated documents. (WARNING) - A clear example of behavior change is that generating a canceled subscription's invoice will no longer wait for the next months invoices to be generated even if the customer has consolidated billing.
- Removed versioneer. Going back to good old manual versioning.
Version 0.2.15 was published with errors.
- Added a total field to BillingLog, to store the amount a subscription has been billed with.
- Fixed API pagination headers.
Versions 0.2.9 to 0.2.11 were published with errors.
- Silver now supports both Django 1.8 and 1.11.
- Added an Admin action that allows marking PDFs for generation.
- Transactions and Payment Methods are now ordered by default descendingly by id.
Some of these changes are considered to be breaking and were marked with (BREAKING)
- The PDFs for Invoices and Proformas are now generated asynchronously using Celery tasks. Redis is required for locking. (BREAKING)
- PDFs now have their own model, therefore a migration has been created, which unfortunately fails to migrate the file url. (BREAKING) A way to fix this would be to regenerate and re-upload the PDFs. Another way that should work would be to set the PDF.pdf_file.name value from the old Invoice.pdf_file.name.
- Added a setting that allows automatically creating transaction when a payment method is verified.
- Added an actions API endpoint for transactions, that currently allows canceling a transaction.
- Round all totals with 2 decimals.
- Properly validate the transaction amount against the document's total_in_transaction_currency field.
- Admin UI usability improvements
- Fix the sum of the entries of an invoice not always corresponding to the invoice's total because of rounding.
- Only use active and verified payment methods to execute transactions.
- Some fixes regarding the automatic transaction creation logic.
- Removed default value for document's transaction_currency. (WARNING)
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Added total_in_transaction_currency field to Invoice and Proforma serializers.
- Created template blocks for Issuer and Customer in transaction_form.html template. (WARNING)
Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Admin UI fixes and usability improvements.
- Billing documents transaction_xe_date will have the same value as issue_date by default. (WARNING)
- Other currency related fixes.
- Added valid_until and display_info fields to PaymentMethod model.
- Added total_in_transaction_currency field to DocumentSerializer.
- Added transaction_currency field to the Document model.
Some of these changes were part of 0.1.5b (2016-11-18) Some of these changes that were considered to be potentially breaking were marked with (WARNING).
- Added payments models, logic and API endpoints.
- Split models into separate files. (WARNING)
- Added a readonly documents API endpoint, exposing both Invoices and Proformas.
- Split customer name field into two fields: first_name and last_name. (WARNING)
- Fixed pycountry dependency.
- Added docker build support.
- Added versioneer for version management.
- Other small fixes and improvements
- Adapt silver to pep8 standard #328
- Replace django-international with pycontry #329
- Minor issue related to subscription #320
- Api filtering by multiple references #323
- generate_docs accept string and datetime #318
- Catch untreated exception when paying related documents #315
- Avoid documents transition double signal triggering.
- Fix draft documents number #312
- Removed pinned versions from requirements.txt #310
- Fix some unicode issues #304
- Added subscription state change logs
- Upgraded to Django 1.8.9
- Remove debug traces
- Fix setup.py
- Initial release