|
@@ -87,14 +87,18 @@
|
|
|
(declare (ignorable user address))
|
|
(declare (ignorable user address))
|
|
|
*default-asset-account*)
|
|
*default-asset-account*)
|
|
|
|
|
|
|
|
|
|
+(defun not-empty (str)
|
|
|
|
|
+ (unless (string= str "")
|
|
|
|
|
+ str))
|
|
|
|
|
+
|
|
|
(defun cheque->entry (c)
|
|
(defun cheque->entry (c)
|
|
|
(let ((total-sum (agets c "totalSum"))
|
|
(let ((total-sum (agets c "totalSum"))
|
|
|
(date (local-time:timestamp-to-universal
|
|
(date (local-time:timestamp-to-universal
|
|
|
(local-time:parse-timestring (agets c "dateTime") )))
|
|
(local-time:parse-timestring (agets c "dateTime") )))
|
|
|
- (user (or (agets c "retailPlace")
|
|
|
|
|
- (agets c "user")
|
|
|
|
|
|
|
+ (user (or (not-empty (agets c "retailPlace"))
|
|
|
|
|
+ (not-empty (agets c "user"))
|
|
|
(format nil "ИНН ~A" (agets c "userInn"))))
|
|
(format nil "ИНН ~A" (agets c "userInn"))))
|
|
|
- (address (agets c "retailPlaceAddress"))
|
|
|
|
|
|
|
+ (address (not-empty (agets c "retailPlaceAddress")))
|
|
|
(items (agets c "items")))
|
|
(items (agets c "items")))
|
|
|
(pta-ledger:make-entry
|
|
(pta-ledger:make-entry
|
|
|
:date date
|
|
:date date
|