add payments, invoice

This commit is contained in:
2024-03-06 15:59:14 +05:30
parent 211e55a373
commit d9dcda0724
6 changed files with 343 additions and 4 deletions

View File

@@ -259,6 +259,8 @@ open class Vendor : BaseTenantModel() {
this.address = updatedVendor.address
this.rating = updatedVendor.rating
this.contacts = updatedVendor.contacts
this.outstanding = updatedVendor.outstanding
this.asOnWhichDate = updatedVendor.asOnWhichDate
}
var name: String = ""
@@ -266,9 +268,12 @@ open class Vendor : BaseTenantModel() {
var gstNumber: String = ""
var address: String = ""
var rating: Double = 0.0
var outstanding: Double?=0.0
var asOnWhichDate: LocalDate?=null
@DbJsonB
var contacts: List<ContactPerson> = mutableListOf()
}
@Entity
@@ -457,4 +462,48 @@ open class OutgoingInventory : BaseTenantModel() {
var person: String? = null
var vehicle: String? = null
}
enum class InvoiceStatus{
PAID_FULL, PAID_SOME, PAID_NONE, ALL
}
@Entity
open class Invoice : BaseTenantModel() {
fun patchValues(updated : Invoice) {
this.date = updated.date
this.number = updated.number
this.totalAmount = updated.totalAmount
this.poNum = updated.poNum
this.products = updated.products
this.vendor = updated.vendor
this.status = updated.status
}
var number: String = ""
var date: LocalDate?=null
var totalAmount : Double=0.0
var poNum:String?=null
@DbJsonB
var products: List<POProducts> ?= null
@ManyToOne
var vendor: Vendor? = null
@Enumerated(EnumType.STRING)
var status:InvoiceStatus?=null
}
@Entity
open class Payment : BaseTenantModel() {
fun patchValues(updated : Payment){
this.refNumber = updated.refNumber
this.amount = updated.amount
this.date = updated.date
this.remark = updated.remark
this.vendor = updated.vendor
}
var refNumber:String=""
var amount:Double=0.0
var date:LocalDate?=null
var remark:String?= null
@ManyToOne
var vendor:Vendor?=null
}