mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
create taxes only ofr booking platform
This commit is contained in:
parent
42764ab6cc
commit
472985351a
2 changed files with 5 additions and 2 deletions
|
|
@ -58,14 +58,17 @@ func NewHost() *Host {
|
||||||
HasEndDate: true,
|
HasEndDate: true,
|
||||||
Taxes: 1.5,
|
Taxes: 1.5,
|
||||||
},
|
},
|
||||||
|
|
||||||
"Airport": {
|
"Airport": {
|
||||||
Name: "Airport",
|
Name: "Airport",
|
||||||
Price: 25.0,
|
Price: 25.0,
|
||||||
},
|
},
|
||||||
|
|
||||||
"Port": {
|
"Port": {
|
||||||
Name: "Port",
|
Name: "Port",
|
||||||
Price: 20.0,
|
Price: 20.0,
|
||||||
},
|
},
|
||||||
|
|
||||||
"Transport": {
|
"Transport": {
|
||||||
Name: "Transport",
|
Name: "Transport",
|
||||||
Price: 20.0,
|
Price: 20.0,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"github.com/rjNemo/rentease/internal/config"
|
"github.com/rjNemo/rentease/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (bs Service) CreateItem(bookingId int, item config.HostItem, quantity int, price float64, paymentMethod string, customerNumber int) (items []*Item) {
|
func (bs Service) CreateItem(bookingId int, item config.HostItem, quantity int, price float64, paymentMethod string, customerNumber int, platform string) (items []*Item) {
|
||||||
i := &Item{
|
i := &Item{
|
||||||
BookingId: bookingId,
|
BookingId: bookingId,
|
||||||
Item: item.Name,
|
Item: item.Name,
|
||||||
|
|
@ -19,7 +19,7 @@ func (bs Service) CreateItem(bookingId int, item config.HostItem, quantity int,
|
||||||
}
|
}
|
||||||
items = append(items, i)
|
items = append(items, i)
|
||||||
|
|
||||||
if item.Taxes != 0.0 {
|
if item.Taxes != 0.0 && platform == "Booking" {
|
||||||
ti := &Item{
|
ti := &Item{
|
||||||
BookingId: bookingId,
|
BookingId: bookingId,
|
||||||
Item: "Taxes",
|
Item: "Taxes",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue