Skip to content

Commit

Permalink
[FIX] order/sign of move lines
Browse files Browse the repository at this point in the history
  • Loading branch information
hbrunn committed May 5, 2023
1 parent f033f8d commit b7e534d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions datev_import_csv_dtvf/wizard/import_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@ def create_moves_from_pivot(self, pivot, post=False): # noqa: C901
indicator = l.get("indicator", False)
if cur_date == l["date"]:
cur_move["line_ids"].append(
(0, 0, self._prepare_move_line_02(l, seq, indicator))
(0, 0, self._prepare_move_line_01(l, seq, indicator))
)
cur_move["line_ids"].append(
(0, 0, self._prepare_move_line_01(l, seq, indicator))
(0, 0, self._prepare_move_line_02(l, seq, indicator))
)
else:
# new move
Expand All @@ -360,8 +360,8 @@ def create_moves_from_pivot(self, pivot, post=False): # noqa: C901
moves.append(cur_move)
cur_move = self._prepare_move(l)
cur_move["line_ids"] = [
(0, 0, self._prepare_move_line_02(l, seq, indicator)),
(0, 0, self._prepare_move_line_01(l, seq, indicator)),
(0, 0, self._prepare_move_line_02(l, seq, indicator)),
]
cur_date = l["date"]
cur_balance += l["credit"] - l["debit"]
Expand Down Expand Up @@ -396,12 +396,12 @@ def _prepare_move_line_01(self, pivot_line, sequence, indicator):
if indicator == "S":
vals.update(
{
"credit": pivot_line["credit"],
"debit": 0.0,
"credit": 0.0,
"debit": pivot_line["debit"],
}
)
if indicator == "H":
vals.update({"credit": 0.0, "debit": pivot_line["debit"]})
vals.update({"credit": pivot_line["credit"], "debit": 0})
vals.update(
{
"name": pivot_line["name"],
Expand All @@ -417,15 +417,15 @@ def _prepare_move_line_02(self, pivot_line, sequence, indicator):
if indicator == "S":
vals.update(
{
"credit": 0.0,
"debit": pivot_line["debit"],
"credit": pivot_line["debit"],
"debit": 0,
}
)
if indicator == "H":
vals.update(
{
"credit": pivot_line["debit"],
"debit": 0.0,
"credit": 0,
"debit": pivot_line["credit"],
}
)
vals.update(
Expand Down

0 comments on commit b7e534d

Please sign in to comment.