package models

type Tenantsales struct {
	Salesid            int                  `json:"salesid" gorm:"Primary_Key"`
	Transactiondate    string               `json:"transactiondate"`
	Duedate            string               `json:"duedate"`
	Applocationid      int                  `json:"applocationid"`
	Invoiceid          string               `json:"invoiceid"`
	Invoiceno          string               `json:"invoiceno"`
	Tenantid           int                  `json:"tenantid"`
	Pricingtypeid      int                  `json:"pricingtypeid"`
	Pricingtype        string               `json:"pricingtype"`
	Tenantname         string               `json:"tenantname"`
	Contactperson      string               `json:"contactperson"`
	Address            string               `json:"address"`
	Suburb             string               `json:"suburb"`
	City               string               `json:"city"`
	State              string               `json:"state"`
	Itemcount          int                  `json:"itemcount"`
	Salesamount        float32              `json:"salesamount"`
	Discountpercent    float32              `json:"discountpercent"`
	Discountamt        float32              `json:"discountamt"`
	Taxpercent         float32              `json:"taxpercent"`
	Taxamount          float32              `json:"taxamount"`
	Totalamount        float32              `json:"totalamount"`
	Billstatus         int                  `json:"billstatus"`
	Billcancel         int                  `json:"billcancel"`
	Remarks            string               `json:"remarks"`
	Referenceno        string               `json:"referenceno"`
	Referencedate      string               `json:"referencedate" gorm:"default:NULL"`
	Paymentremarks     string               `json:"paymentremarks"`
	Status             string               `json:"status" gorm:"default:pending"`
	Tenantsalesdetails []Tenantsalesdetails `json:"tenantsalesdetails"  gorm:"ForeignKey:salesid"`
}

type Tenantsalesdetails struct {
	Salesdetailid int     `json:"salesdetailid" gorm:"Primary_Key"`
	Salesid       int     `json:"salesid" `
	Tenantid      int     `json:"tenantid"`
	Particulars   string  `json:"particulars"`
	Fromdate      string  `json:"fromdate"`
	Todate        string  `json:"todate"`
	Pricingtypeid int     `json:"pricingtypeid"`
	Pricingtype   string  `json:"pricingtype"`
	Baserate      float32 `json:"baserate"`
	Quantity      float32 `json:"quantity"`
	Amount        float32 `json:"amount"`
	Othercharges  float32 `json:"othercharges"`
	Taxpercent    float32 `json:"taxpercent"`
	Taxamount     float32 `json:"taxamount"`
	Totalamount   float32 `json:"totalamount"`
	Billstatus    int     `json:"billstatus" gorm:"<-:false"`
	Orderheaderid int     `json:"orderheaderid" gorm:"<-:false"`
	Orderid       string  `json:"orderid" gorm:"<-:false"`
	Orderdate     string  `json:"orderdate" gorm:"<-:false"`
	Pickup        string  `json:"pickup" gorm:"<-:false"`
	Drop          string  `json:"drop" gorm:"<-:false"`
}

type InvoiceOrders struct {
	Deliveries int `json:"deliveries"`
	Kms        int `json:"kms"`
	Actualkms  int `json:"actualkms"`
}

type InvoiceInsight struct {
	Total            float32 `json:"total"`
	Totalcount       int     `json:"totalcount"`
	Pending          float32 `json:"pending"`
	Pendingcount     int     `json:"pendingcount"`
	Pendingpercent   float32 `json:"pendingpercent"`
	Confirmed        float32 `json:"confirmed"`
	Confirmedcount   int     `json:"confirmedcount"`
	Confirmedpercent float32 `json:"confirmedpercent"`
	Paid             float32 `json:"paid"`
	Paidcount        int     `json:"paidcount"`
	Paidpercent      float32 `json:"paidpercent"`
	Overduecount     int     `json:"overduecount"`
	Overdue          float32 `json:"overdue"`
	Overduepercent   float32 `json:"overduepercent"`
}

type InvoiceStatus struct {
	Salesid        int    `json:"salesid" gorm:"Primary_Key"`
	Referenceno    string `json:"Referenceno"`
	Referencedate  string `json:"referencedate"`
	Billstatus     int    `json:"billstatus"`
	Paymentremarks string `json:"paymentremarks"`
}
