-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Generate a "livre des recettes"
- Loading branch information
1 parent
f603281
commit c9f5576
Showing
4 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
body { | ||
font-family: sans-serif; | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
} | ||
|
||
table { | ||
width: 100%; | ||
max-width: 1200px; | ||
margin: auto; | ||
|
||
font-size: 90%; | ||
|
||
border: 1px solid black; | ||
border-collapse: collapse; | ||
} | ||
|
||
.cell { | ||
padding: 5px; | ||
|
||
border: 1px solid black; | ||
} | ||
|
||
.cell--date { | ||
width: 100px; | ||
} | ||
|
||
.cell--ref { | ||
width: 125px; | ||
} | ||
|
||
.cell--nature { | ||
width: 125px; | ||
} | ||
|
||
.cell--amount { | ||
width: 100px; | ||
} | ||
|
||
td.cell--amount { | ||
text-align: right; | ||
} | ||
|
||
.cell--type { | ||
width: 100px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="fr"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="initial-scale=1.0" /> | ||
<link rel="stylesheet" href="<?= url_static('print.css') ?>"> | ||
|
||
<title><?= $title ?></title> | ||
</head> | ||
|
||
<body> | ||
<h1><?= $title ?></h1> | ||
|
||
<?= $this->safe('content') ?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php $this->layout('print.phtml', ['title' => 'Livre des recettes']); ?> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th class="cell cell--date">Date</th> | ||
<th class="cell cell--ref">Référence</th> | ||
<th class="cell cell--customer">Client</th> | ||
<th class="cell cell--nature">Nature</th> | ||
<th class="cell cell--amount">Montant</th> | ||
<th class="cell cell--type">Règlement</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<?php foreach (array_reverse($payments) as $payment): ?> | ||
<?php if (!$payment->completed_at) { continue; } ?> | ||
|
||
<tr> | ||
<td class="cell cell--date"> | ||
<?= format_date($payment->completed_at, '%d/%m/%Y') ?> | ||
</td> | ||
|
||
<td class="cell cell--ref"> | ||
<?= $payment->invoice_number ?> | ||
</td> | ||
|
||
<td class="cell cell--customer"> | ||
<?= $payment->address_first_name . ' ' . $payment->address_last_name ?> | ||
</td> | ||
|
||
<td class="cell cell--nature"> | ||
<?php if ($payment->type === 'subscription' && $payment->frequency === 'month'): ?> | ||
abo. mensuel | ||
<?php elseif ($payment->type === 'subscription' && $payment->frequency === 'year'): ?> | ||
abo. annuel | ||
<?php elseif ($payment->type === 'common_pot'): ?> | ||
cagnotte | ||
<?php elseif ($payment->type === 'credit'): ?> | ||
crédit | ||
<?php else: ?> | ||
heu non… | ||
<?php endif; ?> | ||
</td> | ||
|
||
<td class="cell cell--amount"> | ||
<?php if ($payment->type === 'credit'): ?> | ||
-<?= $payment->amount / 100 ?> | ||
<?php else: ?> | ||
<?= $payment->amount / 100 ?> | ||
<?php endif; ?> | ||
</td> | ||
|
||
<td class="cell cell--type"> | ||
<?php if ($payment->payment_intent_id): ?> | ||
CB | ||
<?php else: ?> | ||
virement | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
<?php endforeach; ?> | ||
</tbody> | ||
</table> |