fix prints

This commit is contained in:
aminhashemi92 2025-10-09 16:17:01 +03:30
parent 6367d34f0c
commit 10810f8700
15 changed files with 423 additions and 245 deletions

View file

@ -66,12 +66,11 @@ class InstallationReportForm(forms.ModelForm):
'class': 'form-select'
}, choices=[
('', 'انتخاب کنید'),
('A', 'A'),
('B', 'B')
('direct', 'مستقیم'),
('indirect', 'غیرمستقیم')
]),
'discharge_pipe_diameter': forms.NumberInput(attrs={
'class': 'form-control',
'min': '0',
'required': True
}),
'usage_type': forms.Select(attrs={
@ -89,7 +88,6 @@ class InstallationReportForm(forms.ModelForm):
}),
'motor_power': forms.NumberInput(attrs={
'class': 'form-control',
'min': '0',
'required': True
}),
'pre_calibration_flow_rate': forms.NumberInput(attrs={

View file

@ -0,0 +1,30 @@
# Generated by Django 5.2.4 on 2025-10-09 12:28
import django.core.validators
from decimal import Decimal
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('installations', '0008_alter_installationreport_post_calibration_flow_rate_and_more'),
]
operations = [
migrations.AlterField(
model_name='installationreport',
name='meter_model',
field=models.CharField(blank=True, choices=[('direct', 'مستقیم'), ('indirect', 'غیرمستقیم')], max_length=20, null=True, verbose_name='مدل کنتور'),
),
migrations.AlterField(
model_name='installationreport',
name='post_calibration_flow_rate',
field=models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.0001'))], verbose_name='(لیتر بر ثانیه)دبی بعد از کالیبراسیون'),
),
migrations.AlterField(
model_name='installationreport',
name='pre_calibration_flow_rate',
field=models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.0001'))], verbose_name='(لیتر بر ثانیه)دبی قبل از کالیبراسیون'),
),
]

View file

@ -0,0 +1,28 @@
# Generated by Django 5.2.4 on 2025-10-09 12:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('installations', '0009_alter_installationreport_meter_model_and_more'),
]
operations = [
migrations.AlterField(
model_name='installationreport',
name='motor_power',
field=models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True, verbose_name='(کیلووات ساعت) قدرت موتور'),
),
migrations.AlterField(
model_name='installationreport',
name='post_calibration_flow_rate',
field=models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True, verbose_name='(لیتر بر ثانیه)دبی بعد از کالیبراسیون'),
),
migrations.AlterField(
model_name='installationreport',
name='pre_calibration_flow_rate',
field=models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True, verbose_name='(لیتر بر ثانیه)دبی قبل از کالیبراسیون'),
),
]

View file

@ -0,0 +1,18 @@
# Generated by Django 5.2.4 on 2025-10-09 12:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('installations', '0010_alter_installationreport_motor_power_and_more'),
]
operations = [
migrations.AlterField(
model_name='installationreport',
name='discharge_pipe_diameter',
field=models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True, verbose_name='قطر لوله آبده (اینچ)'),
),
]

View file

@ -1,6 +1,8 @@
from django.db import models
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.core.validators import MinValueValidator
from decimal import Decimal
from common.models import BaseModel
User = get_user_model()
@ -48,12 +50,12 @@ class InstallationReport(BaseModel):
]
meter_type = models.CharField(max_length=20, choices=METER_TYPE_CHOICES, null=True, blank=True, verbose_name='نوع کنتور')
METER_MODEL_CHOICES = [
('A', 'A'),
('B', 'B'),
('direct', 'مستقیم'),
('indirect', 'غیرمستقیم'),
]
meter_model = models.CharField(max_length=20, choices=METER_MODEL_CHOICES, null=True, blank=True, verbose_name='مدل کنتور')
meter_size = models.CharField(max_length=50, null=True, blank=True, verbose_name='سایز کنتور')
discharge_pipe_diameter = models.PositiveIntegerField(null=True, blank=True, verbose_name='قطر لوله آبده (اینچ)')
discharge_pipe_diameter = models.DecimalField(max_digits=10, decimal_places=4, null=True, blank=True, verbose_name='قطر لوله آبده (اینچ)')
USAGE_TYPE_CHOICES = [
('domestic', 'شرب و خدمات'),
('agriculture', 'کشاورزی'),
@ -61,7 +63,7 @@ class InstallationReport(BaseModel):
]
usage_type = models.CharField(max_length=20, choices=USAGE_TYPE_CHOICES, null=True, verbose_name='نوع مصرف')
exploitation_license_number = models.CharField(max_length=50, verbose_name='شماره پروانه بهره‌برداری چاه')
motor_power = models.PositiveIntegerField(null=True, blank=True, verbose_name='(کیلووات ساعت) قدرت موتور')
motor_power = models.DecimalField(max_digits=10, decimal_places=4, null=True, blank=True, verbose_name='(کیلووات ساعت) قدرت موتور')
pre_calibration_flow_rate = models.DecimalField(max_digits=10, decimal_places=4, null=True, blank=True, verbose_name='(لیتر بر ثانیه)دبی قبل از کالیبراسیون')
post_calibration_flow_rate = models.DecimalField(max_digits=10, decimal_places=4, null=True, blank=True, verbose_name='(لیتر بر ثانیه)دبی بعد از کالیبراسیون')
water_meter_manufacturer = models.ForeignKey('wells.WaterMeterManufacturer', on_delete=models.SET_NULL, null=True, blank=True, verbose_name='شرکت سازنده کنتور آب')