mirror of
https://github.com/nikdoof/pacmanager.git
synced 2025-12-16 01:12:17 +00:00
Fixes for the import process and some strange cases where Wallets have no transactions. Also show the users' name instead of username
This commit is contained in:
@@ -23,6 +23,7 @@ def import_wallet_journal(corporation_id):
|
|||||||
except Error, e:
|
except Error, e:
|
||||||
print e
|
print e
|
||||||
else:
|
else:
|
||||||
|
if type(res.entries) == str: return None
|
||||||
entries = res.entries.SortedBy('refID', reverse=True)
|
entries = res.entries.SortedBy('refID', reverse=True)
|
||||||
if len(entries) == rowCount:
|
if len(entries) == rowCount:
|
||||||
rows = get_records(corp, fromID=entries[-1].refID)
|
rows = get_records(corp, fromID=entries[-1].refID)
|
||||||
@@ -33,12 +34,14 @@ def import_wallet_journal(corporation_id):
|
|||||||
|
|
||||||
|
|
||||||
# Process Rows
|
# Process Rows
|
||||||
rows = get_records(corp).SortedBy('refID', reverse=True)
|
rows = get_records(corp)
|
||||||
|
if rows is None: return
|
||||||
|
rows = rows.SortedBy('refID', reverse=True)
|
||||||
logging.info("Total rows: %s" % len(rows))
|
logging.info("Total rows: %s" % len(rows))
|
||||||
totals = {}
|
totals = {}
|
||||||
for record in rows:
|
for record in rows:
|
||||||
if int(record.refID) > corp.last_transaction:
|
if int(record.refID) > corp.last_transaction:
|
||||||
if int(record.refTypeID) in [int(x.trim()) for x in managerconf.get('pac.tax_refids', '85,99').split(',')]:
|
if int(record.refTypeID) in [int(x.strip()) for x in managerconf.get('pac.tax_refids', '85,99').split(',')]:
|
||||||
#print record.refID, int(record.refTypeID), record.amount
|
#print record.refID, int(record.refTypeID), record.amount
|
||||||
dt = datetime.fromtimestamp(record.date).replace(tzinfo=utc)
|
dt = datetime.fromtimestamp(record.date).replace(tzinfo=utc)
|
||||||
if not totals.has_key('%s-%s' % (dt.year, dt.month)):
|
if not totals.has_key('%s-%s' % (dt.year, dt.month)):
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for obj in object_list %}
|
{% for obj in object_list %}
|
||||||
<tr><td><a href="{% url corporation-detail obj.pk %}">{{ obj.name }}</a></td><td>{% if obj.contact %}{{ obj.contact.username }}{% else %}<a href="{% url corporation-updatecontact obj.pk %}">Assign Contact</a>{% endif %}</td><td>{{ obj.ceo }}</td><td>{{ obj.tax_rate }}%</td><td><span class="{% if obj.balance >= 0 %}positive{% else %}negative{% endif %}">{{ obj.balance|intcomma }} ISK</span></td></tr>
|
<tr><td><a href="{% url corporation-detail obj.pk %}">{{ obj.name }}</a></td><td>{% if obj.contact %}{{ obj.contact.first_name }}{% else %}<a href="{% url corporation-updatecontact obj.pk %}">Assign Contact</a>{% endif %}</td><td>{{ obj.ceo }}</td><td>{{ obj.tax_rate }}%</td><td><span class="{% if obj.balance >= 0 %}positive{% else %}negative{% endif %}">{{ obj.balance|intcomma }} ISK</span></td></tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr><th colspan="4">Total Outstanding</th><th><span class="{% if total >= 0 %}positive{% else %}negative{% endif %}"><b>{{ total|intcomma }} ISK</b></span></th></tr>
|
<tr><th colspan="4">Total Outstanding</th><th><span class="{% if total >= 0 %}positive{% else %}negative{% endif %}"><b>{{ total|intcomma }} ISK</b></span></th></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user