Added paymentDescription and buyerReference
This commit is contained in:
parent
c480b2ec5e
commit
cd86300d36
|
@ -25,6 +25,9 @@ class MustangMapper {
|
|||
this.setZFItems(ArrayList(invoice.items.map { mapLineItem(it) }))
|
||||
|
||||
this.dueDate = map(invoice.dueDate)
|
||||
this.paymentTermDescription = invoice.paymentDescription
|
||||
|
||||
this.referenceNumber = invoice.buyerReference
|
||||
}
|
||||
|
||||
fun mapParty(party: Party): TradeParty = TradeParty(
|
||||
|
|
|
@ -8,7 +8,14 @@ class Invoice(
|
|||
val sender: Party,
|
||||
val recipient: Party,
|
||||
val items: List<LineItem>,
|
||||
|
||||
val dueDate: LocalDate? = null,
|
||||
val paymentDescription: String? = null,
|
||||
|
||||
/**
|
||||
* Unique reference number of the buyer, e.g. the Leitweg-ID required by German authorities (Behörden)
|
||||
*/
|
||||
val buyerReference: String? = null
|
||||
) {
|
||||
override fun toString() = "$invoicingDate $invoiceNumber to $recipient"
|
||||
}
|
|
@ -5,11 +5,13 @@ import net.codinux.invoicing.model.LineItem
|
|||
import net.codinux.invoicing.model.Party
|
||||
import java.math.BigDecimal
|
||||
import java.time.LocalDate
|
||||
import java.time.format.DateTimeFormatter
|
||||
|
||||
object DataGenerator {
|
||||
|
||||
const val InvoiceNumber = "12345"
|
||||
val InvoicingDate = LocalDate.of(2015, 10, 21)
|
||||
val DueDate = LocalDate.of(2016, 6, 15)
|
||||
|
||||
const val SenderName = "Hochwürdiger Leistungserbringer"
|
||||
const val SenderStreet = "Fun Street 1"
|
||||
|
@ -43,8 +45,10 @@ object DataGenerator {
|
|||
sender: Party = createParty(SenderName, SenderStreet, SenderPostalCode, SenderCity, SenderCountry, SenderVatId, SenderEmail, SenderPhone),
|
||||
recipient: Party = createParty(RecipientName, RecipientStreet, RecipientPostalCode, RecipientCity, RecipientCountry, RecipientVatId, RecipientEmail, RecipientPhone),
|
||||
items: List<LineItem> = listOf(createItem()),
|
||||
dueDate: LocalDate? = null
|
||||
) = Invoice(invoiceNumber, invoicingDate, sender, recipient, items, dueDate)
|
||||
dueDate: LocalDate? = DueDate,
|
||||
paymentDescription: String? = dueDate?.let { "Zahlbar ohne Abzug bis ${DateTimeFormatter.ofPattern("dd.MM.yyyy").format(dueDate)}" },
|
||||
buyerReference: String? = null
|
||||
) = Invoice(invoiceNumber, invoicingDate, sender, recipient, items, dueDate, paymentDescription, buyerReference)
|
||||
|
||||
fun createParty(
|
||||
name: String,
|
||||
|
|
Loading…
Reference in New Issue