Skip to content

Commit

Permalink
refs #97 better strip owers on import
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Jul 21, 2022
1 parent 5e64485 commit 9ec670e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Service/ProjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5434,7 +5434,7 @@ public function importCsvProject(string $path, string $userId): array {
];
}
} elseif ($currentSection === 'members') {
$name = $data[$columns['name']];
$name = trim($data[$columns['name']]);
$weight = $data[$columns['weight']];
$active = $data[$columns['active']];
$color = $data[$columns['color']];
Expand Down Expand Up @@ -5614,7 +5614,8 @@ public function importCsvProject(string $path, string $userId): array {
$payerId = $memberNameToId[$bill['payer_name']];
$owerIds = [];
foreach ($bill['owers'] as $owerName) {
$owerIds[] = $memberNameToId[$owerName];
$strippedOwer = trim($owerName);
$owerIds[] = $memberNameToId[$strippedOwer];
}
$owerIdsStr = implode(',', $owerIds);
$addBillResult = $this->addBill(
Expand Down

0 comments on commit 9ec670e

Please sign in to comment.