Revision: 4022 Author: hans URL: http://bknr.net/trac/changeset/4022
Set download-only flag in contracts when creating, don't compare price after it has been created.
U trunk/projects/bos/m2/m2.lisp U trunk/projects/bos/web/sponsor-handlers.lisp U trunk/projects/bos/web/tags.lisp
Modified: trunk/projects/bos/m2/m2.lisp =================================================================== --- trunk/projects/bos/m2/m2.lisp 2008-10-28 10:24:22 UTC (rev 4021) +++ trunk/projects/bos/m2/m2.lisp 2008-10-30 15:31:22 UTC (rev 4022) @@ -325,8 +325,7 @@ (* (length (contract-m2s contract)) +price-per-m2+))
(defmethod contract-download-only-p ((contract contract)) - (or (contract-download-only contract) - (< (contract-price contract) *mail-amount*))) + (contract-download-only contract))
(deftransaction contract-set-download-only-p (contract newval) (setf (contract-download-only contract) newval))
Modified: trunk/projects/bos/web/sponsor-handlers.lisp =================================================================== --- trunk/projects/bos/web/sponsor-handlers.lisp 2008-10-28 10:24:22 UTC (rev 4021) +++ trunk/projects/bos/web/sponsor-handlers.lisp 2008-10-30 15:31:22 UTC (rev 4022) @@ -114,7 +114,8 @@ (format-date-time (get-universal-time)) (user-login (bknr.web:bknr-session-user))) :date (date-to-universal date) - :download-only (not want-print)))) + :download-only (or (< (* +price-per-m2+ numsqm) *mail-amount*) + (not want-print))))) (contract-issue-cert contract name :address address :language language) (send-to-postmaster #'mail-backoffice-sponsor-data contract numsqm country email name address language (all-request-params)) (when (and email
Modified: trunk/projects/bos/web/tags.lisp =================================================================== --- trunk/projects/bos/web/tags.lisp 2008-10-28 10:24:22 UTC (rev 4021) +++ trunk/projects/bos/web/tags.lisp 2008-10-30 15:31:22 UTC (rev 4022) @@ -81,7 +81,8 @@ (language (request-language)) (sponsor (make-sponsor :language language)) (contract (make-contract sponsor numsqm - :download-only download-only + :download-only (or (< (* +price-per-m2+ numsqm) *mail-amount*) + download-only) :expires (+ (if manual-transfer bos.m2::*manual-contract-expiry-time* bos.m2::*online-contract-expiry-time*)