mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] correction in occupation with extra beds
This commit is contained in:
@@ -142,7 +142,9 @@ class Wizard(models.TransientModel):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Adding overnight stays per day and INE code
|
# Adding overnight stays per day and INE code
|
||||||
|
pernocta_total = []
|
||||||
for dia in range(1, last_day+1):
|
for dia in range(1, last_day+1):
|
||||||
|
pernocta_total.append(0)
|
||||||
for room_night in room_nights.filtered(
|
for room_night in room_nights.filtered(
|
||||||
lambda x: x.date == str(self.ine_year)+'-'+str(
|
lambda x: x.date == str(self.ine_year)+'-'+str(
|
||||||
self.ine_month).zfill(2)+'-'+str(dia).zfill(2)):
|
self.ine_month).zfill(2)+'-'+str(dia).zfill(2)):
|
||||||
@@ -164,7 +166,7 @@ class Wizard(models.TransientModel):
|
|||||||
'pernocta']
|
'pernocta']
|
||||||
# _logger.warning("%s: %s Perenocta: %s In: %s Out: %s Last=%s", dic_tabla[idx]['ine'], dic_tabla[idx]['dia'], dic_tabla[idx]['pernocta'], dic_tabla[idx]['entradas'], dic_tabla[idx]['salidas'],last_stay)
|
# _logger.warning("%s: %s Perenocta: %s In: %s Out: %s Last=%s", dic_tabla[idx]['ine'], dic_tabla[idx]['dia'], dic_tabla[idx]['pernocta'], dic_tabla[idx]['entradas'], dic_tabla[idx]['salidas'],last_stay)
|
||||||
last_stay = dic_tabla[idx]['pernocta']
|
last_stay = dic_tabla[idx]['pernocta']
|
||||||
|
pernocta_total[(dic_tabla[idx]['dia'])-1] += dic_tabla[idx]['pernocta']
|
||||||
|
|
||||||
# "Print" outputs and entries
|
# "Print" outputs and entries
|
||||||
ine_residen = ""
|
ine_residen = ""
|
||||||
@@ -228,6 +230,10 @@ class Wizard(models.TransientModel):
|
|||||||
if service.product_id.is_extra_bed:
|
if service.product_id.is_extra_bed:
|
||||||
suple += 1
|
suple += 1
|
||||||
|
|
||||||
|
# Here, we correct the extra beds
|
||||||
|
if pernocta_total[dia-1] > suple + compan.ine_seats:
|
||||||
|
suple = pernocta_total[dia-1] - compan.ine_seats
|
||||||
|
|
||||||
habitaciones_m = ET.SubElement(habitaciones,
|
habitaciones_m = ET.SubElement(habitaciones,
|
||||||
"HABITACIONES_MOVIMIENTO")
|
"HABITACIONES_MOVIMIENTO")
|
||||||
ET.SubElement(habitaciones_m,
|
ET.SubElement(habitaciones_m,
|
||||||
|
|||||||
Reference in New Issue
Block a user