| Line 1073... |
Line 1073... |
| 1073 |
}
|
1073 |
}
|
| 1074 |
// Month-end credit notes (shown before the interest line): all CN types EXCEPT RETURNS (returns come from
|
1074 |
// Month-end credit notes (shown before the interest line): all CN types EXCEPT RETURNS (returns come from
|
| 1075 |
// returnorderinfo via the billing query). MARGINS = scheme/margin credit; CN_CANCELLATION = debit (reverses a
|
1075 |
// returnorderinfo via the billing query). MARGINS = scheme/margin credit; CN_CANCELLATION = debit (reverses a
|
| 1076 |
// MARGINS CN). Any CN→raw-scheme or cross-period timing difference lands in the reconciling diff line below.
|
1076 |
// MARGINS CN). Any CN→raw-scheme or cross-period timing difference lands in the reconciling diff line below.
|
| 1077 |
if (YearMonth.from(date).atEndOfMonth().equals(date)) {
|
1077 |
if (YearMonth.from(date).atEndOfMonth().equals(date)) {
|
| 1078 |
List<CreditNote> creditNotes = creditNoteRepository.selectAll(customRetailer.getPartnerId(), YearMonth.from(date));
|
1078 |
List<CreditNote> creditNotes = creditNoteRepository.selectByMarginMonth(customRetailer.getPartnerId(), YearMonth.from(date));
|
| 1079 |
if (creditNotes != null) {
|
1079 |
if (creditNotes != null) {
|
| 1080 |
for (CreditNote creditNote : creditNotes) {
|
1080 |
for (CreditNote creditNote : creditNotes) {
|
| 1081 |
// RETURNS are sourced from returnorderinfo (billing query), not from the CN; skip them here.
|
1081 |
// RETURNS are sourced from returnorderinfo (billing query), not from the CN; skip them here.
|
| 1082 |
if (creditNote.getType() == CreditNoteType.RETURNS) {
|
1082 |
if (creditNote.getType() == CreditNoteType.RETURNS) {
|
| 1083 |
continue;
|
1083 |
continue;
|