change price type int -> decimal field

This commit is contained in:
behruz-dev
2025-11-07 12:17:57 +05:00
parent c113f003df
commit 8dca5505d8
35 changed files with 584 additions and 195 deletions

View File

@@ -79,7 +79,7 @@ class Project(BaseModel):
CashTransaction, related_name='projects'
)
currency = models.CharField(choices=[('usd', 'usd'),('uzs','uzs')], max_length=3, default='uzs')
benifit_plan = models.PositiveBigIntegerField(null=True, blank=True)
benifit_plan = models.DecimalField(max_digits=15, decimal_places=2, default=0.00, null=True, blank=True)
status = models.CharField(max_length=20, choices=STATUS, default='PLANNED')
is_archive = models.BooleanField(default=False)

View File

@@ -32,18 +32,18 @@ class EstimateWork(BaseModel):
unity = models.ForeignKey(
Unity, on_delete=models.SET_NULL, null=True, related_name='estimate_works'
)
price = models.PositiveBigIntegerField(null=True, blank=True)
price = models.DecimalField(max_digits=15, decimal_places=2, default=0.00)
estimate = models.ForeignKey(
ProjectEstimate, on_delete=models.CASCADE, related_name='estimate_works'
)
date = models.DateField(null=True, blank=True)
total_price = models.PositiveBigIntegerField(default=0)
total_price = models.DecimalField(max_digits=15, decimal_places=2, default=0.00)
status = models.CharField(choices=STATUS, max_length=20, default='ochiq')
start_date = models.DateField(null=True, blank=True)
end_date = models.DateField(null=True, blank=True)
employee = models.ManyToManyField(User, related_name='estimate_work', blank=True)
percentage = models.PositiveSmallIntegerField(db_default=0, null=True, blank=True)
percentage = models.FloatField(default=0, null=True, blank=True)
def __str__(self):
return f"{self.number}.{self.name}"