update
This commit is contained in:
parent
1396294e4b
commit
d57702ea7a
Binary file not shown.
@ -26,7 +26,7 @@ SECRET_KEY = 'django-insecure-gc9bh4*3=b6hihdnaom0edjsbxh$5t)aap@e8p&340r7)*)qb8
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = ['10.10.1.120', 'localhost', '127.0.0.1', '192.168.1.135', '172.20.10.4']
|
||||
ALLOWED_HOSTS = ['10.10.1.120', 'localhost', '127.0.0.1', '192.168.1.109', '172.20.10.4', '10.10.1.109']
|
||||
|
||||
# Application definition
|
||||
INSTALLED_APPS = [
|
||||
@ -107,9 +107,9 @@ WSGI_APPLICATION = 'car_inventory.wsgi.application'
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django_prometheus.db.backends.postgresql",
|
||||
"NAME": "haikal",
|
||||
"USER": "haikal",
|
||||
"PASSWORD": "haikal",
|
||||
"NAME": "murad_haikal",
|
||||
"USER": "f95166",
|
||||
"PASSWORD": "Kfsh&rc9788",
|
||||
"HOST": "localhost",
|
||||
"PORT": 5432,
|
||||
}
|
||||
|
||||
4112
carmake_updated_backup.json
Normal file
4112
carmake_updated_backup.json
Normal file
File diff suppressed because it is too large
Load Diff
47693
carmodel_updated_backup.json
Normal file
47693
carmodel_updated_backup.json
Normal file
File diff suppressed because it is too large
Load Diff
176332
carserie_updated_backup.json
Normal file
176332
carserie_updated_backup.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,848 +0,0 @@
|
||||
[
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1,
|
||||
"fields": {
|
||||
"name": "Bodywork",
|
||||
"arabic_name": "هيكل السيارة",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 2,
|
||||
"fields": {
|
||||
"name": "Body type",
|
||||
"arabic_name": "نوع الهيكل",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 3,
|
||||
"fields": {
|
||||
"name": "Number of doors",
|
||||
"arabic_name": "عدد الأبواب",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 4,
|
||||
"fields": {
|
||||
"name": "Number of seater",
|
||||
"arabic_name": "عدد المقاعد",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 5,
|
||||
"fields": {
|
||||
"name": "Length",
|
||||
"arabic_name": "الطول",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 6,
|
||||
"fields": {
|
||||
"name": "Width",
|
||||
"arabic_name": "العرض",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 7,
|
||||
"fields": {
|
||||
"name": "Height",
|
||||
"arabic_name": "الارتفاع",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 8,
|
||||
"fields": {
|
||||
"name": "Wheelbase",
|
||||
"arabic_name": "قاعدة العجلات",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 9,
|
||||
"fields": {
|
||||
"name": "Front track",
|
||||
"arabic_name": "المسار الأمامي",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 10,
|
||||
"fields": {
|
||||
"name": "Rear track",
|
||||
"arabic_name": "المسار الخلفي",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 11,
|
||||
"fields": {
|
||||
"name": "Engine",
|
||||
"arabic_name": "المحرك",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 12,
|
||||
"fields": {
|
||||
"name": "Engine type",
|
||||
"arabic_name": "نوع المحرك",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 13,
|
||||
"fields": {
|
||||
"name": "Capacity",
|
||||
"arabic_name": "السعة",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 14,
|
||||
"fields": {
|
||||
"name": "Engine power",
|
||||
"arabic_name": "قوة المحرك",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 15,
|
||||
"fields": {
|
||||
"name": "Max power at RPM",
|
||||
"arabic_name": "القوة القصوى عند دورة في الدقيقة",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 16,
|
||||
"fields": {
|
||||
"name": "Maximum torque",
|
||||
"arabic_name": "العزم الأقصى",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 17,
|
||||
"fields": {
|
||||
"name": "Injection type",
|
||||
"arabic_name": "نوع الحقن",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 18,
|
||||
"fields": {
|
||||
"name": "Overhead camshaft",
|
||||
"arabic_name": "عمود الحدبات العلوي",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 19,
|
||||
"fields": {
|
||||
"name": "Cylinder layout",
|
||||
"arabic_name": "تخطيط الأسطوانة",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 20,
|
||||
"fields": {
|
||||
"name": "Number of cylinders",
|
||||
"arabic_name": "عدد الأسطوانات",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 21,
|
||||
"fields": {
|
||||
"name": "Compression ratio",
|
||||
"arabic_name": "نسبة الضغط",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 22,
|
||||
"fields": {
|
||||
"name": "Fuel",
|
||||
"arabic_name": "الوقود",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 23,
|
||||
"fields": {
|
||||
"name": "Gearbox",
|
||||
"arabic_name": "(جيربوكس) علبة التروس",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 24,
|
||||
"fields": {
|
||||
"name": "Gearbox type",
|
||||
"arabic_name": "نوع علبة التروس",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 26,
|
||||
"fields": {
|
||||
"name": "Number of gear",
|
||||
"arabic_name": "عدد السرعات",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 27,
|
||||
"fields": {
|
||||
"name": "Drive wheels",
|
||||
"arabic_name": "عجلات القيادة",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 29,
|
||||
"fields": {
|
||||
"name": "Front brakes",
|
||||
"arabic_name": "الفرامل الأمامية",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 30,
|
||||
"fields": {
|
||||
"name": "Rear brakes",
|
||||
"arabic_name": "الفرامل الخلفية",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 31,
|
||||
"fields": {
|
||||
"name": "Operating characteristics",
|
||||
"arabic_name": "خصائص التشغيل",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 32,
|
||||
"fields": {
|
||||
"name": "Max speed",
|
||||
"arabic_name": "السرعة القصوى",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 33,
|
||||
"fields": {
|
||||
"name": "Acceleration (0-100 km/h)",
|
||||
"arabic_name": "التسارع (من ٠ إلى ١٠٠ كم/ساعة)",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 34,
|
||||
"fields": {
|
||||
"name": "Curb weight",
|
||||
"arabic_name": "وزن الرصيف",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 35,
|
||||
"fields": {
|
||||
"name": "Fuel tank capacity",
|
||||
"arabic_name": "سعة خزان الوقود",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 36,
|
||||
"fields": {
|
||||
"name": "Wheel size",
|
||||
"arabic_name": "حجم العجلة",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 37,
|
||||
"fields": {
|
||||
"name": "Emission standards",
|
||||
"arabic_name": "معايير الانبعاثات",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 38,
|
||||
"fields": {
|
||||
"name": "Ground clearance",
|
||||
"arabic_name": "المسافة الفارغة عن الأرض",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 39,
|
||||
"fields": {
|
||||
"name": "Valves per cylinder",
|
||||
"arabic_name": "صمامات لكل اسطوانة",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 40,
|
||||
"fields": {
|
||||
"name": "Suspension and brakes",
|
||||
"arabic_name": "التعليق والفرامل",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 41,
|
||||
"fields": {
|
||||
"name": "Front suspension",
|
||||
"arabic_name": "تعليق أمامي",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 42,
|
||||
"fields": {
|
||||
"name": "Back suspension",
|
||||
"arabic_name": "تعليق الخلفي",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 44,
|
||||
"fields": {
|
||||
"name": "Max trunk capacity",
|
||||
"arabic_name": "الحد الأقصى لسعة صندوق السيارة",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 45,
|
||||
"fields": {
|
||||
"name": "Min trunk capacity",
|
||||
"arabic_name": "الحد الأدنى لسعة صندوق السيارة",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 46,
|
||||
"fields": {
|
||||
"name": "Boost type",
|
||||
"arabic_name": "نوع الدفع",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 47,
|
||||
"fields": {
|
||||
"name": "Cylinder bore",
|
||||
"arabic_name": "قطر الأسطوانة",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 48,
|
||||
"fields": {
|
||||
"name": "Stroke cycle",
|
||||
"arabic_name": "دورة الشوط",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 49,
|
||||
"fields": {
|
||||
"name": "Bore/stroke ratio",
|
||||
"arabic_name": "نسبة القطر إلى الشوط",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 50,
|
||||
"fields": {
|
||||
"name": "City driving fuel consumption per 100 km",
|
||||
"arabic_name": "استهلاك الوقود داخل المدينة لكل ١٠٠ كيلومتر",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 51,
|
||||
"fields": {
|
||||
"name": "Highway driving fuel consumption per 100 km",
|
||||
"arabic_name": "استهلاك الوقود على الطريق السريع لكل ١٠٠ كيلومتر",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 52,
|
||||
"fields": {
|
||||
"name": "Mixed driving fuel consumption per 100 km",
|
||||
"arabic_name": "استهلاك الوقود لكل ١٠٠ كيلومتر في القيادة المختطلة",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 53,
|
||||
"fields": {
|
||||
"name": "Steering",
|
||||
"arabic_name": "التوجيه",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 54,
|
||||
"fields": {
|
||||
"name": "Steering type",
|
||||
"arabic_name": "نوع التوجيه",
|
||||
"id_parent": 53
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 55,
|
||||
"fields": {
|
||||
"name": "Engine model",
|
||||
"arabic_name": "نموذج المحرك",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 56,
|
||||
"fields": {
|
||||
"name": "Electric motor power",
|
||||
"arabic_name": "قوة المحرك الكهربائي",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 57,
|
||||
"fields": {
|
||||
"name": "Turning circle",
|
||||
"arabic_name": "دائرة الالتفاف",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 58,
|
||||
"fields": {
|
||||
"name": "Full weight",
|
||||
"arabic_name": "الوزن الكامل",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 59,
|
||||
"fields": {
|
||||
"name": "Disc size",
|
||||
"arabic_name": "حجم القرص",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 60,
|
||||
"fields": {
|
||||
"name": "Total power output",
|
||||
"arabic_name": "إجمالي قوة الإخراج",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 61,
|
||||
"fields": {
|
||||
"name": "Engine placement",
|
||||
"arabic_name": "موضع المحرك",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 62,
|
||||
"fields": {
|
||||
"name": "Cruising range",
|
||||
"arabic_name": "مدى السير",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 63,
|
||||
"fields": {
|
||||
"name": "Full cycle charge",
|
||||
"arabic_name": "شحن دورة كاملة",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 66,
|
||||
"fields": {
|
||||
"name": "Car width with mirrors",
|
||||
"arabic_name": "عرض السيارة مع المرايا",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1521,
|
||||
"fields": {
|
||||
"name": "Cylinder bore and stroke cycle",
|
||||
"arabic_name": "دورة حجم الاسطوانة والشوط",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1549,
|
||||
"fields": {
|
||||
"name": "General information",
|
||||
"arabic_name": "معلومات عامة",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1550,
|
||||
"fields": {
|
||||
"name": "Volume and weight",
|
||||
"arabic_name": "الحجم والوزن",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1551,
|
||||
"fields": {
|
||||
"name": "Security",
|
||||
"arabic_name": "الأمان",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1552,
|
||||
"fields": {
|
||||
"name": "Country",
|
||||
"arabic_name": "الدولة",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1553,
|
||||
"fields": {
|
||||
"name": "Car class",
|
||||
"arabic_name": "فئة السيارة",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1554,
|
||||
"fields": {
|
||||
"name": "Clearance",
|
||||
"arabic_name": "إرتفاع السيارة عن الارض",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1555,
|
||||
"fields": {
|
||||
"name": "Front track width",
|
||||
"arabic_name": "عرض المسار الأمامي للسيارة",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1556,
|
||||
"fields": {
|
||||
"name": "Back track width",
|
||||
"arabic_name": "عرض المسار الخلفي للسيارة",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1558,
|
||||
"fields": {
|
||||
"name": "Max power (h.p.)",
|
||||
"arabic_name": "القوة القصوى (حصان)",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1559,
|
||||
"fields": {
|
||||
"name": "Max power (kW)",
|
||||
"arabic_name": "القوة القصوى (كيلوواط)",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1560,
|
||||
"fields": {
|
||||
"name": "Model assembly",
|
||||
"arabic_name": "تجميع الطراز",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1561,
|
||||
"fields": {
|
||||
"name": "CO2 emissions",
|
||||
"arabic_name": "انبعاثات ثاني أكسيد الكربون",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1562,
|
||||
"fields": {
|
||||
"name": "Safety assessment",
|
||||
"arabic_name": "تقييم السلامة",
|
||||
"id_parent": 1551
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1563,
|
||||
"fields": {
|
||||
"name": "Rating name",
|
||||
"arabic_name": "اسم التقييم",
|
||||
"id_parent": 1551
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1564,
|
||||
"fields": {
|
||||
"name": "Turnover of maximum torque",
|
||||
"arabic_name": "تحول العزم الأقصى",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1565,
|
||||
"fields": {
|
||||
"name": "Payload",
|
||||
"arabic_name": "الحمولة",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1566,
|
||||
"fields": {
|
||||
"name": "Presence of intercooler",
|
||||
"arabic_name": "وجود مبرد بيني",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1567,
|
||||
"fields": {
|
||||
"name": "Trailer load (with brakes)",
|
||||
"arabic_name": "حمولة المقطورة (مع الفرامل)",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1568,
|
||||
"fields": {
|
||||
"name": "Front/rear axle load",
|
||||
"arabic_name": "حمولة محور العجلات الأمامي / الخلفي",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1569,
|
||||
"fields": {
|
||||
"name": "Loading height",
|
||||
"arabic_name": "ارتفاع التحميل",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1570,
|
||||
"fields": {
|
||||
"name": "Cargo compartment (Length x Width x Height)",
|
||||
"arabic_name": "حجرة البضائع (الطول x العرض x الارتفاع)",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1571,
|
||||
"fields": {
|
||||
"name": "Cargo compartment volume",
|
||||
"arabic_name": "حجم حيز التحميل في السيارة",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1631,
|
||||
"fields": {
|
||||
"name": "Accumulator battery",
|
||||
"arabic_name": "البطارية المجمعة",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1632,
|
||||
"fields": {
|
||||
"name": "Battery capacity",
|
||||
"arabic_name": "سعة البطارية",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1634,
|
||||
"fields": {
|
||||
"name": "Electric power reserve",
|
||||
"arabic_name": "احتياطي الطاقة الكهربائية",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1635,
|
||||
"fields": {
|
||||
"name": "Charging time",
|
||||
"arabic_name": "وقت الشحن",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1636,
|
||||
"fields": {
|
||||
"name": "Fuel consumption city/highway/mixed, l",
|
||||
"arabic_name": "استهلاك الوقود في المدينة / الطريق السريع / المختلط، لتر",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1641,
|
||||
"fields": {
|
||||
"name": "Rudder location",
|
||||
"arabic_name": "موقع الدفة",
|
||||
"id_parent": 53
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1642,
|
||||
"fields": {
|
||||
"name": "Dimensions",
|
||||
"arabic_name": "الأبعاد",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1644,
|
||||
"fields": {
|
||||
"name": "Pitch Circle Diameter",
|
||||
"arabic_name": "قطر دائرة التركيب",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1645,
|
||||
"fields": {
|
||||
"name": "Engine code",
|
||||
"arabic_name": "كود المحرك",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1646,
|
||||
"fields": {
|
||||
"name": "Disc sizes",
|
||||
"arabic_name": "أحجام الأقراص",
|
||||
"id_parent": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
938
carspecification_updated_backup.json
Normal file
938
carspecification_updated_backup.json
Normal file
@ -0,0 +1,938 @@
|
||||
[
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1,
|
||||
"fields": {
|
||||
"name": "Bodywork",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 2,
|
||||
"fields": {
|
||||
"name": "Body type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 3,
|
||||
"fields": {
|
||||
"name": "Number of doors",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 4,
|
||||
"fields": {
|
||||
"name": "Number of seater",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 5,
|
||||
"fields": {
|
||||
"name": "Length",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 6,
|
||||
"fields": {
|
||||
"name": "Width",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 7,
|
||||
"fields": {
|
||||
"name": "Height",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 8,
|
||||
"fields": {
|
||||
"name": "Wheelbase",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 9,
|
||||
"fields": {
|
||||
"name": "Front track",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 10,
|
||||
"fields": {
|
||||
"name": "Rear track",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 11,
|
||||
"fields": {
|
||||
"name": "Engine",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 12,
|
||||
"fields": {
|
||||
"name": "Engine type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 13,
|
||||
"fields": {
|
||||
"name": "Capacity",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 14,
|
||||
"fields": {
|
||||
"name": "Engine power",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 15,
|
||||
"fields": {
|
||||
"name": "Max power at RPM",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 16,
|
||||
"fields": {
|
||||
"name": "Maximum torque",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 17,
|
||||
"fields": {
|
||||
"name": "Injection type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 18,
|
||||
"fields": {
|
||||
"name": "Overhead camshaft",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 19,
|
||||
"fields": {
|
||||
"name": "Cylinder layout",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 20,
|
||||
"fields": {
|
||||
"name": "Number of cylinders",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 21,
|
||||
"fields": {
|
||||
"name": "Compression ratio",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 22,
|
||||
"fields": {
|
||||
"name": "Fuel",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 23,
|
||||
"fields": {
|
||||
"name": "Gearbox and handling",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 24,
|
||||
"fields": {
|
||||
"name": "Gearbox type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 26,
|
||||
"fields": {
|
||||
"name": "Number of gear",
|
||||
"arabic_name": "",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 27,
|
||||
"fields": {
|
||||
"name": "Drive wheels",
|
||||
"arabic_name": "",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 29,
|
||||
"fields": {
|
||||
"name": "Front brakes",
|
||||
"arabic_name": "",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 30,
|
||||
"fields": {
|
||||
"name": "Rear brakes",
|
||||
"arabic_name": "",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 31,
|
||||
"fields": {
|
||||
"name": "Operating characteristics",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 32,
|
||||
"fields": {
|
||||
"name": "Max speed",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 33,
|
||||
"fields": {
|
||||
"name": "Acceleration (0-100 km/h)",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 34,
|
||||
"fields": {
|
||||
"name": "Curb weight",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 35,
|
||||
"fields": {
|
||||
"name": "Fuel tank capacity",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 36,
|
||||
"fields": {
|
||||
"name": "Wheel size",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 37,
|
||||
"fields": {
|
||||
"name": "Emission standards",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 38,
|
||||
"fields": {
|
||||
"name": "Ground clearance",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 39,
|
||||
"fields": {
|
||||
"name": "Valves per cylinder",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 40,
|
||||
"fields": {
|
||||
"name": "Suspension and brakes",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 41,
|
||||
"fields": {
|
||||
"name": "Front suspension",
|
||||
"arabic_name": "",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 42,
|
||||
"fields": {
|
||||
"name": "Back suspension",
|
||||
"arabic_name": "",
|
||||
"id_parent": 40
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 44,
|
||||
"fields": {
|
||||
"name": "Max trunk capacity",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 45,
|
||||
"fields": {
|
||||
"name": "Min trunk capacity",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 46,
|
||||
"fields": {
|
||||
"name": "Boost type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 47,
|
||||
"fields": {
|
||||
"name": "Cylinder bore",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 48,
|
||||
"fields": {
|
||||
"name": "Stroke cycle",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 49,
|
||||
"fields": {
|
||||
"name": "Bore/stroke ratio",
|
||||
"arabic_name": "",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 50,
|
||||
"fields": {
|
||||
"name": "City driving fuel consumption per 100 km",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 51,
|
||||
"fields": {
|
||||
"name": "Highway driving fuel consumption per 100 km",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 52,
|
||||
"fields": {
|
||||
"name": "Mixed driving fuel consumption per 100 km",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 53,
|
||||
"fields": {
|
||||
"name": "Steering",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 54,
|
||||
"fields": {
|
||||
"name": "Steering type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 53
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 55,
|
||||
"fields": {
|
||||
"name": "Engine model",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 56,
|
||||
"fields": {
|
||||
"name": "Electric motor power",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 57,
|
||||
"fields": {
|
||||
"name": "Turning circle",
|
||||
"arabic_name": "",
|
||||
"id_parent": 23
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 58,
|
||||
"fields": {
|
||||
"name": "Full weight",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 59,
|
||||
"fields": {
|
||||
"name": "Disc size",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 60,
|
||||
"fields": {
|
||||
"name": "Total power output",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 61,
|
||||
"fields": {
|
||||
"name": "Engine placement",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 62,
|
||||
"fields": {
|
||||
"name": "Cruising range",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 63,
|
||||
"fields": {
|
||||
"name": "Full cycle charge",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 66,
|
||||
"fields": {
|
||||
"name": "Car width with mirrors",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1521,
|
||||
"fields": {
|
||||
"name": "Cylinder bore and stroke cycle",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1549,
|
||||
"fields": {
|
||||
"name": "General information",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1550,
|
||||
"fields": {
|
||||
"name": "Volume and weight",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1551,
|
||||
"fields": {
|
||||
"name": "Security",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1552,
|
||||
"fields": {
|
||||
"name": "Country",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1553,
|
||||
"fields": {
|
||||
"name": "Car class",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1554,
|
||||
"fields": {
|
||||
"name": "Clearance",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1555,
|
||||
"fields": {
|
||||
"name": "Front track width",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1556,
|
||||
"fields": {
|
||||
"name": "Back track width",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1558,
|
||||
"fields": {
|
||||
"name": "Max power (h.p.)",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1559,
|
||||
"fields": {
|
||||
"name": "Max power (kW)",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1560,
|
||||
"fields": {
|
||||
"name": "Model assembly",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1549
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1561,
|
||||
"fields": {
|
||||
"name": "CO2 emissions",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1562,
|
||||
"fields": {
|
||||
"name": "Safety assessment",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1551
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1563,
|
||||
"fields": {
|
||||
"name": "Rating name",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1551
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1564,
|
||||
"fields": {
|
||||
"name": "Turnover of maximum torque",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1565,
|
||||
"fields": {
|
||||
"name": "Payload",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1566,
|
||||
"fields": {
|
||||
"name": "Presence of intercooler",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1567,
|
||||
"fields": {
|
||||
"name": "Trailer load (with brakes)",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1568,
|
||||
"fields": {
|
||||
"name": "Front/rear axle load",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1569,
|
||||
"fields": {
|
||||
"name": "Loading height",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1570,
|
||||
"fields": {
|
||||
"name": "Cargo compartment (Length x Width x Height)",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1571,
|
||||
"fields": {
|
||||
"name": "Cargo compartment volume",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1631,
|
||||
"fields": {
|
||||
"name": "Accumulator battery",
|
||||
"arabic_name": "",
|
||||
"id_parent": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1632,
|
||||
"fields": {
|
||||
"name": "Battery capacity",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1634,
|
||||
"fields": {
|
||||
"name": "Electric power reserve",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1635,
|
||||
"fields": {
|
||||
"name": "Charging time",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1636,
|
||||
"fields": {
|
||||
"name": "Fuel consumption city/highway/mixed l'",
|
||||
"arabic_name": "",
|
||||
"id_parent": 31
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1641,
|
||||
"fields": {
|
||||
"name": "Rudder location",
|
||||
"arabic_name": "",
|
||||
"id_parent": 53
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1642,
|
||||
"fields": {
|
||||
"name": "Dimensions",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1644,
|
||||
"fields": {
|
||||
"name": "Pitch Circle Diameter",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1645,
|
||||
"fields": {
|
||||
"name": "Engine code",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1646,
|
||||
"fields": {
|
||||
"name": "Disc sizes",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1647,
|
||||
"fields": {
|
||||
"name": "Battery type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1648,
|
||||
"fields": {
|
||||
"name": "Timing belt",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1649,
|
||||
"fields": {
|
||||
"name": "Flow calculation method",
|
||||
"arabic_name": "",
|
||||
"id_parent": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1650,
|
||||
"fields": {
|
||||
"name": "Battery temperature",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1651,
|
||||
"fields": {
|
||||
"name": "Fast charge time",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1652,
|
||||
"fields": {
|
||||
"name": "Description of fast charging",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1653,
|
||||
"fields": {
|
||||
"name": "Charging connector type",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1654,
|
||||
"fields": {
|
||||
"name": "Consumption",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1655,
|
||||
"fields": {
|
||||
"name": "Maximum charging power",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "inventory.carspecification",
|
||||
"pk": 1656,
|
||||
"fields": {
|
||||
"name": "Battery capacity (available)",
|
||||
"arabic_name": "",
|
||||
"id_parent": 1631
|
||||
}
|
||||
}
|
||||
]
|
||||
BIN
carspecificationvalue_updated_backup.json
Normal file
BIN
carspecificationvalue_updated_backup.json
Normal file
Binary file not shown.
940678
cartrim_backup.json
940678
cartrim_backup.json
File diff suppressed because it is too large
Load Diff
1059734
cartrim_updated_backup.json
Normal file
1059734
cartrim_updated_backup.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-18 16:49
|
||||
# Generated by Django 5.1.4 on 2024-12-22 21:55
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
@ -9,7 +9,7 @@ class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0030_alter_carfinance_options_and_more'),
|
||||
('inventory', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,349 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-12 07:40
|
||||
|
||||
from decimal import Decimal
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import inventory.mixins
|
||||
import phonenumber_field.modelfields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
replaces = [('inventory', '0001_initial'), ('inventory', '0002_remove_salequotationcar_financial_details_and_more'), ('inventory', '0003_remove_salequotationcar_administration_fee_and_more'), ('inventory', '0004_remove_carfinance_administration_vat_amount_and_more'), ('inventory', '0005_alter_carfinance_options_alter_carfinance_total'), ('inventory', '0006_alter_car_status'), ('inventory', '0007_salequotation_amount_salequotation_dealer_and_more'), ('inventory', '0008_carfinance_vat_amount'), ('inventory', '0009_alter_salequotation_amount'), ('inventory', '0010_alter_salequotation_dealer'), ('inventory', '0011_remove_salequotationcar_dealer'), ('inventory', '0012_remove_salequotationcar_price'), ('inventory', '0005_alter_carfinance_options_remove_carfinance_total'), ('inventory', '0013_merge_20241211_1620')]
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Car',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('vin', models.CharField(max_length=17, unique=True, verbose_name='VIN')),
|
||||
('year', models.IntegerField(verbose_name='Year')),
|
||||
('status', models.CharField(choices=[('available', 'Available'), ('sold', 'Sold'), ('hold', 'Hold'), ('damaged', 'Damaged')], default='available', max_length=10, verbose_name='Status')),
|
||||
('stock_type', models.CharField(choices=[('new', 'New'), ('used', 'Used')], default='new', max_length=10, verbose_name='Stock Type')),
|
||||
('remarks', models.TextField(blank=True, null=True, verbose_name='Remarks')),
|
||||
('mileage', models.IntegerField(blank=True, null=True, verbose_name='Mileage')),
|
||||
('receiving_date', models.DateTimeField(verbose_name='Receiving Date')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Car',
|
||||
'verbose_name_plural': 'Cars',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarMake',
|
||||
fields=[
|
||||
('id_car_make', models.AutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('arabic_name', models.CharField(max_length=255)),
|
||||
('logo', models.ImageField(blank=True, null=True, upload_to='car_make', verbose_name='logo')),
|
||||
('is_sa_import', models.BooleanField(default=False)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Make',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ExteriorColors',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('rgb', models.CharField(blank=True, max_length=24, null=True, verbose_name='RGB')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Exterior Colors',
|
||||
'verbose_name_plural': 'Exterior Colors',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='InteriorColors',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('rgb', models.CharField(blank=True, max_length=24, null=True, verbose_name='RGB')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Interior Colors',
|
||||
'verbose_name_plural': 'Interior Colors',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarFinance',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('cost_price', models.DecimalField(decimal_places=2, max_digits=14, verbose_name='Cost Price')),
|
||||
('selling_price', models.DecimalField(decimal_places=2, max_digits=14, verbose_name='Selling Price')),
|
||||
('profit_margin', models.DecimalField(decimal_places=2, editable=False, max_digits=14, verbose_name='Profit Margin')),
|
||||
('discount_amount', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Discount Amount')),
|
||||
('registration_fee', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Registration Fee')),
|
||||
('administration_fee', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Administration Fee')),
|
||||
('transportation_fee', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Transportation Fee')),
|
||||
('custom_card_fee', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Custom Card Fee')),
|
||||
('vat_rate', models.DecimalField(decimal_places=2, default=Decimal('0.15'), max_digits=14, verbose_name='VAT Rate')),
|
||||
('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='finances', to='inventory.car')),
|
||||
('vat_amount', models.DecimalField(decimal_places=2, default=2300, editable=False, max_digits=14, verbose_name='Vat Amount')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Car Financial Details',
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='car',
|
||||
name='id_car_make',
|
||||
field=models.ForeignKey(blank=True, db_column='id_car_make', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carmake', verbose_name='Make'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarModel',
|
||||
fields=[
|
||||
('id_car_model', models.AutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('arabic_name', models.CharField(max_length=255)),
|
||||
('id_car_make', models.ForeignKey(db_column='id_car_make', on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carmake')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Model',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='car',
|
||||
name='id_car_model',
|
||||
field=models.ForeignKey(blank=True, db_column='id_car_model', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carmodel', verbose_name='Model'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarRegistration',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('plate_number', models.IntegerField(verbose_name='Plate Number')),
|
||||
('text1', models.CharField(max_length=1, verbose_name='Text 1')),
|
||||
('text2', models.CharField(max_length=1, verbose_name='Text 2')),
|
||||
('text3', models.CharField(max_length=1, verbose_name='Text 3')),
|
||||
('registration_date', models.DateTimeField(verbose_name='Registration Date')),
|
||||
('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='registrations', to='inventory.car', verbose_name='Car')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Registration',
|
||||
'verbose_name_plural': 'Registrations',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarSerie',
|
||||
fields=[
|
||||
('id_car_serie', models.AutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('arabic_name', models.CharField(max_length=255)),
|
||||
('id_car_model', models.ForeignKey(db_column='id_car_model', on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carmodel')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Series',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='car',
|
||||
name='id_car_serie',
|
||||
field=models.ForeignKey(blank=True, db_column='id_car_serie', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carserie', verbose_name='Series'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarSpecification',
|
||||
fields=[
|
||||
('id_car_specification', models.AutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('arabic_name', models.CharField(max_length=255)),
|
||||
('id_parent', models.ForeignKey(blank=True, db_column='id_parent', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carspecification')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Specification',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarTrim',
|
||||
fields=[
|
||||
('id_car_trim', models.AutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('arabic_name', models.CharField(max_length=255)),
|
||||
('start_production_year', models.IntegerField(blank=True, null=True)),
|
||||
('end_production_year', models.IntegerField(blank=True, null=True)),
|
||||
('id_car_serie', models.ForeignKey(db_column='id_car_serie', on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carserie')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Trim',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarSpecificationValue',
|
||||
fields=[
|
||||
('id_car_specification_value', models.AutoField(primary_key=True, serialize=False)),
|
||||
('value', models.CharField(max_length=500)),
|
||||
('unit', models.CharField(blank=True, max_length=255, null=True)),
|
||||
('id_car_specification', models.ForeignKey(db_column='id_car_specification', on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carspecification')),
|
||||
('id_car_trim', models.ForeignKey(db_column='id_car_trim', on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.cartrim')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Specification Value',
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='car',
|
||||
name='id_car_trim',
|
||||
field=models.ForeignKey(blank=True, db_column='id_car_trim', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.cartrim', verbose_name='Trim'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CustomCard',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('custom_number', models.CharField(max_length=255, verbose_name='Custom Number')),
|
||||
('custom_date', models.DateField(verbose_name='Custom Date')),
|
||||
('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_cards', to='inventory.car', verbose_name='Car')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Custom Card',
|
||||
'verbose_name_plural': 'Custom Cards',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Dealer',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('crn', models.CharField(max_length=10, verbose_name='Commercial Registration Number')),
|
||||
('vrn', models.CharField(max_length=15, verbose_name='VAT Registration Number')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('name', models.CharField(max_length=255, verbose_name='English Name')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('logo', models.ImageField(blank=True, null=True, upload_to='logos/users', verbose_name='Logo')),
|
||||
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='dealer', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Dealer',
|
||||
'verbose_name_plural': 'Dealers',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Customer',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('first_name', models.CharField(max_length=50, verbose_name='First Name')),
|
||||
('middle_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='Middle Name')),
|
||||
('last_name', models.CharField(max_length=50, verbose_name='Last Name')),
|
||||
('email', models.EmailField(max_length=254, unique=True, verbose_name='Email')),
|
||||
('national_id', models.CharField(max_length=10, unique=True, verbose_name='National ID')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', unique=True, verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
|
||||
('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customers', to='inventory.dealer')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Customer',
|
||||
'verbose_name_plural': 'Customers',
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='car',
|
||||
name='dealer',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='cars', to='inventory.dealer', verbose_name='Dealer'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SaleQuotation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('remarks', models.TextField(blank=True, null=True, verbose_name='Remarks')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotations', to='inventory.customer', verbose_name='Customer')),
|
||||
('status', models.CharField(choices=[('DRAFT', 'Draft'), ('CONFIRMED', 'Confirmed'), ('CANCELED', 'Canceled')], default='DRAFT', max_length=10, verbose_name='Status')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated At')),
|
||||
('amount', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10, verbose_name='Amount')),
|
||||
('dealer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sales', to='inventory.dealer')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Vendor',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('crn', models.CharField(max_length=10, unique=True, verbose_name='Commercial Registration Number')),
|
||||
('vrn', models.CharField(max_length=15, unique=True, verbose_name='VAT Registration Number')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('name', models.CharField(max_length=255, verbose_name='English Name')),
|
||||
('contact_person', models.CharField(max_length=100, verbose_name='Contact Person')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('logo', models.ImageField(blank=True, null=True, upload_to='logos/vendors', verbose_name='Logo')),
|
||||
('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vendors', to='inventory.dealer')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Vendor',
|
||||
'verbose_name_plural': 'Vendors',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='car',
|
||||
name='vendor',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cars', to='inventory.vendor', verbose_name='Vendor'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarReservation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('reserved_at', models.DateTimeField(auto_now_add=True)),
|
||||
('reserved_until', models.DateTimeField()),
|
||||
('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='inventory.car')),
|
||||
('reserved_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-reserved_at'],
|
||||
'unique_together': {('car', 'reserved_until')},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarColors',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='colors', to='inventory.car')),
|
||||
('exterior', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='colors', to='inventory.exteriorcolors')),
|
||||
('interior', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='colors', to='inventory.interiorcolors')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Color',
|
||||
'verbose_name_plural': 'Colors',
|
||||
'unique_together': {('car', 'exterior', 'interior')},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SalesOrder',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('total_amount', models.DecimalField(decimal_places=2, max_digits=14, verbose_name='Total Amount')),
|
||||
('quotation', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='sales_order', to='inventory.salequotation', verbose_name='Quotation')),
|
||||
],
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='car',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('available', 'Available'), ('sold', 'Sold'), ('hold', 'Hold'), ('damaged', 'Damaged'), ('reserved', 'Reserved')], default='available', max_length=10, verbose_name='Status'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SaleQuotationCar',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('car', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.car', verbose_name='Car')),
|
||||
('quotation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotation_cars', to='inventory.salequotation', verbose_name='Quotation')),
|
||||
('quantity', models.PositiveIntegerField(default=1, verbose_name='Quantity')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,335 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-22 21:55
|
||||
|
||||
import django.db.models.deletion
|
||||
import inventory.mixins
|
||||
import phonenumber_field.modelfields
|
||||
from decimal import Decimal
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('django_ledger', '0017_alter_accountmodel_unique_together_and_more'),
|
||||
('inventory', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='AdditionalServices',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('display_name', models.CharField(max_length=255, verbose_name='Display Name')),
|
||||
('description', models.TextField(verbose_name='Description')),
|
||||
('price', models.DecimalField(decimal_places=2, max_digits=14, verbose_name='Price')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Additional Services',
|
||||
'verbose_name_plural': 'Additional Services',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Subscription',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('plan', models.CharField(max_length=255)),
|
||||
('start_date', models.DateField()),
|
||||
('end_date', models.DateField()),
|
||||
('max_users', models.IntegerField()),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SubscriptionPlan',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('description', models.TextField()),
|
||||
('price', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('max_users', models.IntegerField()),
|
||||
],
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='carfinance',
|
||||
options={'verbose_name': 'Car Financial Details', 'verbose_name_plural': 'Car Financial Details'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='carreservation',
|
||||
options={'ordering': ['-reserved_at'], 'verbose_name': 'Car Reservation', 'verbose_name_plural': 'Car Reservations'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='dealer',
|
||||
options={'permissions': [('change_dealer_type', 'Can change dealer type')], 'verbose_name': 'Dealer', 'verbose_name_plural': 'Dealers'},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='administration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='administration_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='profit_margin',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='registration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='selling_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='total',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='total_before_vat',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='total_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='transportation_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='transportation_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='vat_rate',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='financial_details',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carserie',
|
||||
name='year_begin',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carserie',
|
||||
name='year_end',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cartrim',
|
||||
name='id_car_model',
|
||||
field=models.ForeignKey(blank=True, db_column='id_car_model', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carmodel'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='dealer',
|
||||
name='dealer_type',
|
||||
field=models.CharField(choices=[('Owner', 'Owner'), ('Inventory', 'Inventory'), ('Accountent', 'Accountent'), ('sales', 'Sales')], default='Owner', max_length=255, verbose_name='Dealer Type'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='dealer',
|
||||
name='parent_dealer',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sub_dealers', to='inventory.dealer', verbose_name='Parent Dealer'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='amount',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10, verbose_name='Amount'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='dealer',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sales', to='inventory.dealer'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='entity',
|
||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='django_ledger.entitymodel'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='is_approved',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='quotation_number',
|
||||
field=models.CharField(default=1, max_length=10, unique=True),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='updated_at',
|
||||
field=models.DateTimeField(auto_now=True, verbose_name='Updated At'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='quantity',
|
||||
field=models.PositiveIntegerField(default=1, verbose_name='Quantity'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='car',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('available', 'Available'), ('sold', 'Sold'), ('hold', 'Hold'), ('damaged', 'Damaged'), ('reserved', 'Reserved')], default='available', max_length=10, verbose_name='Status'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='car',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='finances', to='inventory.car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_at',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Reserved At'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_by',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to=settings.AUTH_USER_MODEL, verbose_name='Reserved By'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_until',
|
||||
field=models.DateTimeField(verbose_name='Reserved Until'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='customcard',
|
||||
name='car',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='custom_cards', to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='dealer',
|
||||
name='crn',
|
||||
field=models.CharField(blank=True, max_length=10, null=True, verbose_name='Commercial Registration Number'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='dealer',
|
||||
name='vrn',
|
||||
field=models.CharField(blank=True, max_length=15, null=True, verbose_name='VAT Registration Number'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='created_at',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Created At'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='customer',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotations', to='inventory.customer', verbose_name='Customer'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='remarks',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='Remarks'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotationcar',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotationcar',
|
||||
name='quotation',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotation_cars', to='inventory.salequotation', verbose_name='Quotation'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='additional_services',
|
||||
field=models.ManyToManyField(blank=True, related_name='additional_finances', to='inventory.additionalservices'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarLocation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('description', models.TextField(blank=True, help_text='Optional description about the showroom placement.', null=True, verbose_name='Description')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Updated')),
|
||||
('car', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='location', to='inventory.car', verbose_name='Car')),
|
||||
('owner', models.ForeignKey(help_text='Dealer who owns the car.', on_delete=django.db.models.deletion.CASCADE, related_name='owned_cars', to='inventory.dealer', verbose_name='Owner')),
|
||||
('showroom', models.ForeignKey(help_text='Dealer where the car is displayed (can be the owner).', on_delete=django.db.models.deletion.CASCADE, related_name='showroom_cars', to='inventory.dealer', verbose_name='Showroom')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Car Location',
|
||||
'verbose_name_plural': 'Car Locations',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Organization',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('crn', models.CharField(max_length=15, verbose_name='Commercial Registration Number')),
|
||||
('vrn', models.CharField(max_length=15, verbose_name='VAT Registration Number')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('logo', models.ImageField(blank=True, null=True, upload_to='logos', verbose_name='Logo')),
|
||||
('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organizations', to='inventory.dealer')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Organization',
|
||||
'verbose_name_plural': 'Organizations',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Representative',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('id_number', models.CharField(max_length=10, verbose_name='ID Number')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='representatives', to='inventory.dealer')),
|
||||
('organization', models.ManyToManyField(related_name='representatives', to='inventory.organization')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Representative',
|
||||
'verbose_name_plural': 'Representatives',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SalesOrder',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('total_amount', models.DecimalField(decimal_places=2, max_digits=14, verbose_name='Total Amount')),
|
||||
('quotation', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='sales_order', to='inventory.salequotation', verbose_name='Quotation')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SubscriptionUser',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('subscription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.subscription')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='subscription',
|
||||
name='users',
|
||||
field=models.ManyToManyField(through='inventory.SubscriptionUser', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
]
|
||||
@ -1,98 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-09 20:42
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='financial_details',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('DRAFT', 'Draft'), ('CONFIRMED', 'Confirmed'), ('CANCELED', 'Canceled')], default='DRAFT', max_length=10, verbose_name='Status'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='updated_at',
|
||||
field=models.DateTimeField(auto_now=True, verbose_name='Updated At'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='administration_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=150, max_digits=14, verbose_name='Administration Fee'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='custom_card_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=70, max_digits=14, verbose_name='Custom Card Fee'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='selling_price',
|
||||
field=models.DecimalField(decimal_places=2, default=120000, max_digits=14, verbose_name='Selling Price'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='total_amount',
|
||||
field=models.DecimalField(decimal_places=2, default=135000, max_digits=14, verbose_name='Total Amount'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='transportation_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=500, max_digits=14, verbose_name='Transportation Fee'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, default=4352, max_digits=14, verbose_name='VAT Amount'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='created_at',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Created At'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='customer',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotations', to='inventory.customer', verbose_name='Customer'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='remarks',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='Remarks'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotationcar',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='salequotationcar',
|
||||
name='quotation',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotation_cars', to='inventory.salequotation', verbose_name='Quotation'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SalesOrder',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('total_amount', models.DecimalField(decimal_places=2, max_digits=14, verbose_name='Total Amount')),
|
||||
('quotation', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='sales_order', to='inventory.salequotation', verbose_name='Quotation')),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-23 08:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0002_additionalservices_subscription_subscriptionplan_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='additionalservices',
|
||||
name='display_name',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='additionalservices',
|
||||
name='arabic_name',
|
||||
field=models.CharField(default='-', max_length=255, verbose_name='Arabic Name'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -1,37 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-09 21:06
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0002_remove_salequotationcar_financial_details_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='administration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='custom_card_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='selling_price',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='total_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='transportation_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='vat_amount',
|
||||
),
|
||||
]
|
||||
@ -1,37 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-09 21:59
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0003_remove_salequotationcar_administration_fee_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='administration_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='selling_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='total_before_vat',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='total_vat_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='transportation_vat_amount',
|
||||
),
|
||||
]
|
||||
@ -1,23 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-10 11:45
|
||||
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0004_remove_carfinance_administration_vat_amount_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='carfinance',
|
||||
options={'verbose_name': 'Car Financial Details'},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='total',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=14, null=True),
|
||||
),
|
||||
]
|
||||
@ -1,21 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-10 11:57
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0004_remove_carfinance_administration_vat_amount_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='carfinance',
|
||||
options={'verbose_name': 'Car Financial Details'},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='total',
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-10 14:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0005_alter_carfinance_options_alter_carfinance_total'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='car',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('available', 'Available'), ('sold', 'Sold'), ('hold', 'Hold'), ('damaged', 'Damaged'), ('reserved', 'Reserved')], default='available', max_length=10, verbose_name='Status'),
|
||||
),
|
||||
]
|
||||
@ -1,43 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-10 22:52
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0006_alter_car_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='amount',
|
||||
field=models.DecimalField(decimal_places=2, default=100000, max_digits=10, verbose_name='Amount'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='dealer',
|
||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='sales', to='inventory.dealer'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='dealer',
|
||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='sale_cars', to='inventory.dealer', verbose_name='Dealer'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='price',
|
||||
field=models.DecimalField(decimal_places=2, default=12000.0, editable=False, max_digits=10, verbose_name='Price'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotationcar',
|
||||
name='quantity',
|
||||
field=models.PositiveIntegerField(default=1, verbose_name='Quantity'),
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-10 23:02
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0007_salequotation_amount_salequotation_dealer_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, default=2300, editable=False, max_digits=14, verbose_name='Vat Amount'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 12:09
|
||||
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0008_carfinance_vat_amount'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='amount',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10, verbose_name='Amount'),
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 12:16
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0009_alter_salequotation_amount'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='salequotation',
|
||||
name='dealer',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sales', to='inventory.dealer'),
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 12:17
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0010_alter_salequotation_dealer'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='dealer',
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 12:18
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0011_remove_salequotationcar_dealer'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='salequotationcar',
|
||||
name='price',
|
||||
),
|
||||
]
|
||||
@ -1,14 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-11 13:20
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0005_alter_carfinance_options_remove_carfinance_total'),
|
||||
('inventory', '0012_remove_salequotationcar_price'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
@ -1,14 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 15:47
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0005_alter_carfinance_options_remove_carfinance_total'),
|
||||
('inventory', '0012_remove_salequotationcar_price'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
@ -1,74 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 15:50
|
||||
|
||||
import django.db.models.deletion
|
||||
from decimal import Decimal
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0013_merge_20241211_1847'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='carfinance',
|
||||
options={'verbose_name': 'Car Financial Details', 'verbose_name_plural': 'Car Financial Details'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='carreservation',
|
||||
options={'ordering': ['-reserved_at'], 'verbose_name': 'Car Reservation', 'verbose_name_plural': 'Car Reservations'},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='vat_rate',
|
||||
),
|
||||
# migrations.RemoveField(
|
||||
# model_name='carfinance',
|
||||
# name='total',
|
||||
# ),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='total',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=14, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_at',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Reserved At'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_by',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to=settings.AUTH_USER_MODEL, verbose_name='Reserved By'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_until',
|
||||
field=models.DateTimeField(verbose_name='Reserved Until'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarShowroom',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('description', models.TextField(blank=True, null=True, verbose_name='Description')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Updated')),
|
||||
('car', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='showroom', to='inventory.car', verbose_name='Car')),
|
||||
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owned_cars', to='inventory.dealer', verbose_name='Owner')),
|
||||
('showroom', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='showroom_cars', to='inventory.dealer', verbose_name='Showroom')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Car Showroom',
|
||||
'verbose_name_plural': 'Car Showrooms',
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,23 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-11 13:26
|
||||
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0013_merge_20241211_1620'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
# migrations.RemoveField(
|
||||
# model_name='carfinance',
|
||||
# name='total',
|
||||
# ),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='total',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=14, null=True),
|
||||
),
|
||||
]
|
||||
@ -1,33 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 16:05
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0014_alter_carfinance_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CarLocation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('description', models.TextField(blank=True, help_text='Optional description about the showroom placement.', null=True, verbose_name='Description')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Updated')),
|
||||
('car', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='location', to='inventory.car', verbose_name='Car')),
|
||||
('owner', models.ForeignKey(help_text='Dealer who owns the car.', on_delete=django.db.models.deletion.CASCADE, related_name='owned_cars', to='inventory.dealer', verbose_name='Owner')),
|
||||
('showroom', models.ForeignKey(help_text='Dealer where the car is displayed (can be the owner).', on_delete=django.db.models.deletion.CASCADE, related_name='showroom_cars', to='inventory.dealer', verbose_name='Showroom')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Car Location',
|
||||
'verbose_name_plural': 'Car Locations',
|
||||
},
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='CarShowroom',
|
||||
),
|
||||
]
|
||||
@ -1,24 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-11 17:02
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0015_carlocation_delete_carshowroom'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='car',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='finances', to='inventory.car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='customcard',
|
||||
name='car',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='custom_cards', to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
]
|
||||
@ -1,14 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-12 07:35
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0014_carfinance_total'),
|
||||
('inventory', '0016_alter_carfinance_car_alter_customcard_car'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
@ -1,53 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-12 12:44
|
||||
|
||||
import django.db.models.deletion
|
||||
import inventory.mixins
|
||||
import phonenumber_field.modelfields
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0016_alter_carfinance_car_alter_customcard_car'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Organization',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('crn', models.CharField(max_length=15, verbose_name='Commercial Registration Number')),
|
||||
('vrn', models.CharField(max_length=15, verbose_name='VAT Registration Number')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('logo', models.ImageField(blank=True, null=True, upload_to='logos', verbose_name='Logo')),
|
||||
('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='organizations', to='inventory.dealer')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Organization',
|
||||
'verbose_name_plural': 'Organizations',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Representative',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('id_number', models.CharField(max_length=10, verbose_name='ID Number')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='representatives', to='inventory.dealer')),
|
||||
('organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='representatives', to='inventory.organization')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Representative',
|
||||
'verbose_name_plural': 'Representatives',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
]
|
||||
@ -1,68 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-15 13:20
|
||||
|
||||
from decimal import Decimal
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('inventory', '0017_merge_20241212_1035'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='carfinance',
|
||||
options={'verbose_name': 'Car Financial Details'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='carreservation',
|
||||
options={'ordering': ['-reserved_at']},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='vat_rate',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.15'), max_digits=14, verbose_name='VAT Rate'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='finances', to='inventory.car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, editable=False, max_digits=14, verbose_name='Vat Amount'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='inventory.car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_at',
|
||||
field=models.DateTimeField(auto_now_add=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_by',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_until',
|
||||
field=models.DateTimeField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='customcard',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='custom_cards', to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='CarLocation',
|
||||
),
|
||||
]
|
||||
@ -1,22 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-12 12:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0017_organization_representative'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='representative',
|
||||
name='organization',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='representative',
|
||||
name='organization',
|
||||
field=models.ManyToManyField(related_name='representatives', to='inventory.organization'),
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-15 14:41
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0018_remove_representative_organization_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='total',
|
||||
),
|
||||
]
|
||||
@ -1,32 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-15 14:47
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import inventory.mixins
|
||||
import phonenumber_field.modelfields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0018_alter_carfinance_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SubDealer',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('arabic_name', models.CharField(max_length=255, verbose_name='Arabic Name')),
|
||||
('name', models.CharField(max_length=255, verbose_name='English Name')),
|
||||
('phone_number', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region='SA', verbose_name='Phone Number')),
|
||||
('address', models.CharField(blank=True, max_length=200, null=True, verbose_name='Address')),
|
||||
('dealer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subdealers', to='inventory.dealer')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'SubDealer',
|
||||
'verbose_name_plural': 'SubDealers',
|
||||
},
|
||||
bases=(models.Model, inventory.mixins.LocalizedNameMixin),
|
||||
),
|
||||
]
|
||||
@ -1,45 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-16 01:33
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0019_remove_carfinance_total'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='administration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='registration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='transportation_fee',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='cartrim',
|
||||
name='id_car_model',
|
||||
field=models.ForeignKey(blank=True, db_column='id_car_model', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carmodel'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='car',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='financial_details', to='inventory.car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, editable=False, max_digits=14, verbose_name='VAT Amount'),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-15 14:53
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0019_subdealer'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='subdealer',
|
||||
name='dealer_type',
|
||||
field=models.CharField(choices=[('Inventory', 'Inventory'), ('Accountent', 'Accountent'), ('sales', 'Sales')], default='Inventory', max_length=255, verbose_name='Dealer Type'),
|
||||
),
|
||||
]
|
||||
@ -1,23 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-16 10:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0020_remove_carfinance_administration_fee_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='carserie',
|
||||
name='year_begin',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carserie',
|
||||
name='year_end',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
@ -1,22 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-16 09:02
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('inventory', '0020_subdealer_dealer_type'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='subdealer',
|
||||
name='user',
|
||||
field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='subdealer', to=settings.AUTH_USER_MODEL),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -1,27 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-16 09:31
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0021_subdealer_user'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='dealer',
|
||||
name='dealer_type',
|
||||
field=models.CharField(choices=[('Inventory', 'Inventory'), ('Accountent', 'Accountent'), ('sales', 'Sales')], default='Inventory', max_length=255, verbose_name='Dealer Type'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='dealer',
|
||||
name='parent_dealer',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.dealer'),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='SubDealer',
|
||||
),
|
||||
]
|
||||
@ -1,49 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-16 12:54
|
||||
|
||||
import django.db.models.deletion
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0021_carserie_year_begin_carserie_year_end'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='cartrim',
|
||||
name='id_car_model',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='administration_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Administration Fee'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Custom Card Fee'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='registration_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Registration Fee'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='transportation_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Transportation Fee'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='car',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='finances', to='inventory.car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, editable=False, max_digits=14, verbose_name='Vat Amount'),
|
||||
),
|
||||
]
|
||||
@ -1,24 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-16 09:33
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0022_dealer_dealer_type_dealer_parent_dealer_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='dealer',
|
||||
name='dealer_type',
|
||||
field=models.CharField(choices=[('Owner', 'Owner'), ('Inventory', 'Inventory'), ('Accountent', 'Accountent'), ('sales', 'Sales')], default='Owner', max_length=255, verbose_name='Dealer Type'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='dealer',
|
||||
name='parent_dealer',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.dealer', verbose_name='Parent Dealer'),
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-16 19:55
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0022_remove_cartrim_id_car_model_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='cartrim',
|
||||
name='id_car_model',
|
||||
field=models.ForeignKey(blank=True, db_column='id_car_model', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.carmodel'),
|
||||
),
|
||||
]
|
||||
@ -1,29 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-16 11:31
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0023_alter_dealer_dealer_type_alter_dealer_parent_dealer'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='dealer',
|
||||
name='crn',
|
||||
field=models.CharField(blank=True, max_length=10, null=True, verbose_name='Commercial Registration Number'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='dealer',
|
||||
name='parent_dealer',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sub_dealers', to='inventory.dealer', verbose_name='Parent Dealer'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='dealer',
|
||||
name='vrn',
|
||||
field=models.CharField(blank=True, max_length=15, null=True, verbose_name='VAT Registration Number'),
|
||||
),
|
||||
]
|
||||
@ -1,49 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-16 15:02
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('inventory', '0024_alter_dealer_crn_alter_dealer_parent_dealer_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Subscription',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('plan', models.CharField(max_length=255)),
|
||||
('start_date', models.DateField()),
|
||||
('end_date', models.DateField()),
|
||||
('max_users', models.IntegerField()),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SubscriptionPlan',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('description', models.TextField()),
|
||||
('price', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('max_users', models.IntegerField()),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SubscriptionUser',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('subscription', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.subscription')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='subscription',
|
||||
name='users',
|
||||
field=models.ManyToManyField(through='inventory.SubscriptionUser', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-16 15:22
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0025_subscription_subscriptionplan_subscriptionuser_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='subscription',
|
||||
name='is_active',
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-17 09:45
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0026_subscription_is_active'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='dealer',
|
||||
options={'permissions': [('can_edit_dealer_type', 'Can edit dealer type')], 'verbose_name': 'Dealer', 'verbose_name_plural': 'Dealers'},
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-17 09:53
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0027_alter_dealer_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='dealer',
|
||||
options={'permissions': [('change_dealer_type', 'Can change dealer type')], 'verbose_name': 'Dealer', 'verbose_name_plural': 'Dealers'},
|
||||
),
|
||||
]
|
||||
@ -1,14 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-17 14:24
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0023_cartrim_id_car_model'),
|
||||
('inventory', '0028_alter_dealer_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
||||
@ -1,69 +0,0 @@
|
||||
# Generated by Django 5.1.4 on 2024-12-17 14:25
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0029_merge_20241217_1724'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='carfinance',
|
||||
options={'verbose_name': 'Car Financial Details', 'verbose_name_plural': 'Car Financial Details'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='carreservation',
|
||||
options={'ordering': ['-reserved_at'], 'verbose_name': 'Car Reservation', 'verbose_name_plural': 'Car Reservations'},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='vat_rate',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='car',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_at',
|
||||
field=models.DateTimeField(auto_now_add=True, verbose_name='Reserved At'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_by',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to=settings.AUTH_USER_MODEL, verbose_name='Reserved By'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carreservation',
|
||||
name='reserved_until',
|
||||
field=models.DateTimeField(verbose_name='Reserved Until'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='customcard',
|
||||
name='car',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='custom_cards', to='inventory.car', verbose_name='Car'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='CarLocation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('description', models.TextField(blank=True, help_text='Optional description about the showroom placement.', null=True, verbose_name='Description')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
|
||||
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Updated')),
|
||||
('car', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='location', to='inventory.car', verbose_name='Car')),
|
||||
('owner', models.ForeignKey(help_text='Dealer who owns the car.', on_delete=django.db.models.deletion.CASCADE, related_name='owned_cars', to='inventory.dealer', verbose_name='Owner')),
|
||||
('showroom', models.ForeignKey(help_text='Dealer where the car is displayed (can be the owner).', on_delete=django.db.models.deletion.CASCADE, related_name='showroom_cars', to='inventory.dealer', verbose_name='Showroom')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Car Location',
|
||||
'verbose_name_plural': 'Car Locations',
|
||||
},
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-18 10:14
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0030_alter_carfinance_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-18 10:15
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0031_remove_carfinance_vat_amount'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=14, verbose_name='Vat Amount'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-18 10:19
|
||||
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0032_carfinance_vat_amount'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), editable=False, max_digits=14, verbose_name='Vat Amount'),
|
||||
),
|
||||
]
|
||||
@ -1,59 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-18 15:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0033_alter_carfinance_vat_amount'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='AdditionalServices',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Name')),
|
||||
('description', models.TextField(verbose_name='Description')),
|
||||
('price', models.DecimalField(decimal_places=2, max_digits=14, verbose_name='Price')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Additional Services',
|
||||
'verbose_name_plural': 'Additional Services',
|
||||
},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='administration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='discount_amount',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='profit_margin',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='registration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='transportation_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='car',
|
||||
name='additional_services',
|
||||
field=models.ManyToManyField(related_name='cars', to='inventory.additionalservices'),
|
||||
),
|
||||
]
|
||||
@ -1,50 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-18 16:00
|
||||
|
||||
from decimal import Decimal
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0034_additionalservices_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='administration_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Administration Fee'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Custom Card Fee'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='discount_amount',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Discount Amount'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='profit_margin',
|
||||
field=models.DecimalField(decimal_places=2, default=0, editable=False, max_digits=14, verbose_name='Profit Margin'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='registration_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Registration Fee'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='transportation_fee',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=14, verbose_name='Transportation Fee'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
field=models.DecimalField(decimal_places=2, default=Decimal('0.00'), editable=False, max_digits=14, verbose_name='Vat Amount'),
|
||||
),
|
||||
]
|
||||
@ -1,22 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-18 16:02
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0035_carfinance_administration_fee_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='car',
|
||||
name='additional_services',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='carfinance',
|
||||
name='additional_services',
|
||||
field=models.ManyToManyField(related_name='cars', to='inventory.additionalservices'),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-19 09:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0036_remove_car_additional_services_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='additional_services',
|
||||
field=models.ManyToManyField(related_name='additional_finances', to='inventory.additionalservices'),
|
||||
),
|
||||
]
|
||||
@ -1,42 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-19 09:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0037_alter_carfinance_additional_services'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='administration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='custom_card_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='profit_margin',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='registration_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='transportation_fee',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='carfinance',
|
||||
name='vat_amount',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='additional_services',
|
||||
field=models.ManyToManyField(blank=True, null=True, related_name='additional_finances', to='inventory.additionalservices'),
|
||||
),
|
||||
]
|
||||
@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-19 09:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0038_remove_carfinance_administration_fee_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='carfinance',
|
||||
name='additional_services',
|
||||
field=models.ManyToManyField(blank=True, related_name='additional_finances', to='inventory.additionalservices'),
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-19 12:01
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0039_alter_carfinance_additional_services'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='additionalservices',
|
||||
name='display_name',
|
||||
field=models.CharField(default=1, max_length=255, verbose_name='Display Name'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -1,19 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-22 08:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0040_additionalservices_display_name'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='quotation_number',
|
||||
field=models.CharField(default=1, max_length=10, unique=True),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -1,26 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-22 10:36
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('django_ledger', '0017_alter_accountmodel_unique_together_and_more'),
|
||||
('inventory', '0041_salequotation_quotation_number'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='entity',
|
||||
field=models.ForeignKey(default="cb12725d-3b89-4742-8668-05d825b0b1f0", on_delete=django.db.models.deletion.CASCADE, to='django_ledger.entitymodel'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='salequotation',
|
||||
name='is_approved',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
||||
@ -1,17 +0,0 @@
|
||||
# Generated by Django 4.2.17 on 2024-12-22 11:48
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('inventory', '0042_salequotation_entity_salequotation_is_approved'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='salequotation',
|
||||
name='status',
|
||||
),
|
||||
]
|
||||
Binary file not shown.
@ -143,9 +143,9 @@ class DEALER_TYPES(models.TextChoices):
|
||||
Sales = "sales", _("Sales")
|
||||
|
||||
|
||||
class AdditionalServices(models.Model):
|
||||
class AdditionalServices(models.Model, LocalizedNameMixin):
|
||||
name = models.CharField(max_length=255, verbose_name=_("Name"))
|
||||
display_name = models.CharField(max_length=255, verbose_name=_("Display Name"))
|
||||
arabic_name = models.CharField(max_length=255, verbose_name=_("Arabic Name"))
|
||||
description = models.TextField(verbose_name=_("Description"))
|
||||
price = models.DecimalField(max_digits=14, decimal_places=2, verbose_name=_("Price"))
|
||||
|
||||
|
||||
121
inventory/pdf_generator.py
Normal file
121
inventory/pdf_generator.py
Normal file
@ -0,0 +1,121 @@
|
||||
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Paragraph, Spacer
|
||||
from reportlab.lib import colors
|
||||
from reportlab.lib.pagesizes import A4
|
||||
from reportlab.lib.styles import getSampleStyleSheet
|
||||
from decimal import Decimal
|
||||
|
||||
|
||||
def generate_quotation_pdf(response, quotation, services):
|
||||
# Initialize PDF
|
||||
doc = SimpleDocTemplate(response, pagesize=A4)
|
||||
elements = []
|
||||
|
||||
# Styles
|
||||
styles = getSampleStyleSheet()
|
||||
title_style = styles['Heading1']
|
||||
heading_style = styles['Heading2']
|
||||
normal_style = styles['Normal']
|
||||
|
||||
# Title
|
||||
title = Paragraph(f"Quotation Details - {quotation.display_quotation_number}", title_style)
|
||||
elements.append(title)
|
||||
elements.append(Spacer(1, 12))
|
||||
|
||||
# Customer Details
|
||||
elements.append(Paragraph("Customer Details", heading_style))
|
||||
customer_details = [
|
||||
["Name:", quotation.customer.get_full_name],
|
||||
["Address:", quotation.customer.address],
|
||||
["VAT No:", quotation.customer.national_id]
|
||||
]
|
||||
customer_table = Table(customer_details, colWidths=[100, 400])
|
||||
|
||||
customer_table.setStyle(TableStyle([
|
||||
('BACKGROUND', (0, 0), (0, -1), colors.lightgrey),
|
||||
('TEXTCOLOR', (0, 0), (0, -1), colors.black),
|
||||
('ALIGN', (0, 0), (-1, -1), 'LEFT'),
|
||||
('FONTNAME', (0, 0), (-1, -1), 'Helvetica'),
|
||||
('FONTSIZE', (0, 0), (-1, -1), 10),
|
||||
('BOTTOMPADDING', (0, 0), (-1, -1), 6),
|
||||
]))
|
||||
elements.append(customer_table)
|
||||
elements.append(Spacer(1, 12))
|
||||
|
||||
# Quotation Info
|
||||
elements.append(Paragraph("Quotation Information", heading_style))
|
||||
quotation_details = [
|
||||
["Quotation No:", quotation.display_quotation_number],
|
||||
["Date:", quotation.created_at.strftime("%Y-%m-%d")],
|
||||
["Remarks:", quotation.remarks or "-"]
|
||||
]
|
||||
quotation_table = Table(quotation_details, colWidths=[100, 400])
|
||||
quotation_table.setStyle(TableStyle([
|
||||
('BACKGROUND', (0, 0), (0, -1), colors.lightgrey),
|
||||
('TEXTCOLOR', (0, 0), (0, -1), colors.black),
|
||||
('ALIGN', (0, 0), (-1, -1), 'LEFT'),
|
||||
('FONTNAME', (0, 0), (-1, -1), 'Helvetica'),
|
||||
('FONTSIZE', (0, 0), (-1, -1), 10),
|
||||
('BOTTOMPADDING', (0, 0), (-1, -1), 6),
|
||||
]))
|
||||
elements.append(quotation_table)
|
||||
elements.append(Spacer(1, 12))
|
||||
|
||||
# Car Details Table
|
||||
elements.append(Paragraph("Car Details", heading_style))
|
||||
car_data = [["VIN", "Model", "Year", "Quantity", "Price", "VAT %", "Total"]]
|
||||
for item in quotation.quotation_cars.all():
|
||||
car_data.append([
|
||||
item.car.vin,
|
||||
item.car.id_car_model.name,
|
||||
item.car.year,
|
||||
item.quantity,
|
||||
f"{item.car.finances.selling_price:.2f}",
|
||||
"15%",
|
||||
f"{item.total_vat:.2f}"
|
||||
])
|
||||
car_table = Table(car_data, colWidths=[120, 70, 50, 50, 70, 50, 70])
|
||||
car_table.setStyle(TableStyle([
|
||||
('BACKGROUND', (0, 0), (-1, 0), colors.grey),
|
||||
('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),
|
||||
('ALIGN', (0, 0), (-1, -1), 'CENTER'),
|
||||
('FONTNAME', (0, 0), (-1, -1), 'Helvetica-Bold'),
|
||||
('FONTSIZE', (0, 0), (-1, -1), 10),
|
||||
('BOTTOMPADDING', (0, 0), (-1, 0), 6),
|
||||
('BACKGROUND', (0, 1), (-1, -1), colors.white),
|
||||
('TEXTCOLOR', (0, 1), (-1, -1), colors.black),
|
||||
('ALIGN', (0, 1), (-1, -1), 'CENTER'),
|
||||
('FONTNAME', (0, 1), (-1, -1), 'Helvetica'),
|
||||
('FONTSIZE', (0, 1), (-1, -1), 9),
|
||||
('GRID', (0, 0), (-1, -1), 0.5, colors.black)
|
||||
]))
|
||||
elements.append(car_table)
|
||||
elements.append(Spacer(1, 12))
|
||||
|
||||
# Additional Costs Table
|
||||
elements.append(Paragraph("Additional Costs", heading_style))
|
||||
additional_data = [["Additions", "Cost", "VAT Amount", "Total Cost with VAT"]]
|
||||
for service in services:
|
||||
additional_data.append([
|
||||
service.name,
|
||||
f"{service.price:.2f}",
|
||||
|
||||
])
|
||||
additional_table = Table(additional_data, colWidths=[120, 100, 100, 120])
|
||||
additional_table.setStyle(TableStyle([
|
||||
('BACKGROUND', (0, 0), (-1, 0), colors.grey),
|
||||
('TEXTCOLOR', (0, 0), (-1, 0), colors.whitesmoke),
|
||||
('ALIGN', (0, 0), (-1, -1), 'CENTER'),
|
||||
('FONTNAME', (0, 0), (-1, -1), 'Helvetica-Bold'),
|
||||
('FONTSIZE', (0, 0), (-1, -1), 10),
|
||||
('BOTTOMPADDING', (0, 0), (-1, 0), 6),
|
||||
('BACKGROUND', (0, 1), (-1, -1), colors.white),
|
||||
('TEXTCOLOR', (0, 1), (-1, -1), colors.black),
|
||||
('ALIGN', (0, 1), (-1, -1), 'CENTER'),
|
||||
('FONTNAME', (0, 1), (-1, -1), 'Helvetica'),
|
||||
('FONTSIZE', (0, 1), (-1, -1), 9),
|
||||
('GRID', (0, 0), (-1, -1), 0.5, colors.black)
|
||||
]))
|
||||
elements.append(additional_table)
|
||||
|
||||
# Build PDF
|
||||
doc.build(elements)
|
||||
@ -2,13 +2,7 @@ from random import randint
|
||||
|
||||
from django.db.models.signals import post_save, post_delete,pre_delete
|
||||
from django.dispatch import receiver
|
||||
from django_ledger.models import (EntityModel,
|
||||
VendorModel,
|
||||
CustomerModel,
|
||||
UnitOfMeasureModel,
|
||||
AccountModel,
|
||||
ItemModelAbstract
|
||||
)
|
||||
from django_ledger.models import EntityModel
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
@ -75,7 +69,7 @@ def create_ledger_entity(sender, instance, created, **kwargs):
|
||||
# address_1=instance.address,
|
||||
accrual_method=False,
|
||||
fy_start_month=1,
|
||||
# depth=0,
|
||||
depth=0,
|
||||
)
|
||||
print(entity)
|
||||
if created:
|
||||
@ -149,7 +143,7 @@ def create_ledger_vendor(sender, instance, created, **kwargs):
|
||||
entity = EntityModel.objects.filter(name=instance.dealer.name).first()
|
||||
|
||||
entity.create_vendor(
|
||||
vendor_name=instance.name,
|
||||
name=instance.name,
|
||||
vendor_number=instance.crn,
|
||||
address_1=instance.address,
|
||||
phone=instance.phone_number,
|
||||
|
||||
@ -76,7 +76,7 @@ urlpatterns = [
|
||||
path('sales/quotations/', views.QuotationListView.as_view(), name='quotation_list'),
|
||||
path('sales/quotations/<int:pk>/confirm/', views.confirm_quotation, name='confirm_quotation'),
|
||||
path('sales/orders/detail/<int:order_id>/', views.SalesOrderDetailView.as_view(), name='order_detail'),
|
||||
path('quotation/<pk>/pdf/', views.quotation_pdf_view, name='quotation_pdf'),
|
||||
path('quotation/<int:quotation_id>/pdf/', views.download_quotation_pdf, name='quotation_pdf'),
|
||||
path('generate_invoice/<int:pk>/', views.generate_invoice, name='generate_invoice'),
|
||||
|
||||
|
||||
|
||||
@ -2,10 +2,10 @@ from django_ledger.models import EntityModel, InvoiceModel
|
||||
import logging
|
||||
import json
|
||||
from decimal import Decimal
|
||||
|
||||
from .pdf_generator import generate_quotation_pdf
|
||||
from django.shortcuts import HttpResponse
|
||||
from django.template.loader import render_to_string
|
||||
from weasyprint import HTML
|
||||
# from weasyprint import HTML
|
||||
# from weasyprint.fonts import FontConfiguration
|
||||
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
@ -822,9 +822,9 @@ def generate_invoice(request, pk):
|
||||
.filter(customer_name=quotation.customer.get_full_name)
|
||||
.first()
|
||||
)
|
||||
|
||||
print(customer)
|
||||
invoices = entity.create_invoice(
|
||||
customer_model=customer.customer_number, terms=InvoiceModel.TERMS_NET_30
|
||||
customer_model=customer, terms=InvoiceModel.TERMS_NET_30
|
||||
)
|
||||
# invoice_itemtxs = {
|
||||
# f"{qc}": {
|
||||
@ -834,21 +834,21 @@ def generate_invoice(request, pk):
|
||||
# }
|
||||
# for qc in quotation.quotation_cars.all()
|
||||
# }
|
||||
invoice_itemtxs = {
|
||||
"test":{
|
||||
"unit_cost": "1000",
|
||||
"quantity": "1",
|
||||
"total_amount": "1000",
|
||||
},
|
||||
"test1":{
|
||||
"unit_cost": "1000",
|
||||
"quantity": "1",
|
||||
"total_amount": "1000",
|
||||
}
|
||||
}
|
||||
invoice_itemtxs = invoices.migrate_itemtxs(
|
||||
itemtxs=invoice_itemtxs, commit=True, operation=InvoiceModel.ITEMIZE_APPEND
|
||||
)
|
||||
# invoice_itemtxs = {
|
||||
# "test":{
|
||||
# "unit_cost": "1000",
|
||||
# "quantity": "1",
|
||||
# "total_amount": "1000",
|
||||
# },
|
||||
# "test1":{
|
||||
# "unit_cost": "1000",
|
||||
# "quantity": "1",
|
||||
# "total_amount": "1000",
|
||||
# }
|
||||
# }
|
||||
# invoice_itemtxs = invoices.migrate_itemtxs(
|
||||
# itemtxs=invoice_itemtxs, commit=True, operation=InvoiceModel.ITEMIZE_APPEND
|
||||
# )
|
||||
messages.success(request, "Invoice created")
|
||||
return redirect("quotation_detail", pk=pk)
|
||||
|
||||
@ -1106,26 +1106,49 @@ class RepresentativeDeleteView(LoginRequiredMixin, SuccessMessageMixin, DeleteVi
|
||||
success_message = "Representative deleted successfully."
|
||||
|
||||
|
||||
def quotation_pdf_view(request, pk):
|
||||
# Get the quotation object
|
||||
quotation = models.SaleQuotation.objects.get(pk=pk)
|
||||
# def quotation_pdf_view(request, pk):
|
||||
# # Get the quotation object
|
||||
# quotation = models.SaleQuotation.objects.get(pk=pk)
|
||||
#
|
||||
# # Render the HTML template for the quotation page
|
||||
# context = {
|
||||
# "quotation": quotation,
|
||||
# }
|
||||
# context_result = get_calculations(quotation)
|
||||
# context = context.update(context_result)
|
||||
#
|
||||
# html_content = render_to_string("sales/quotation_pdf.html", context)
|
||||
#
|
||||
# # Create a PDF file
|
||||
#
|
||||
# pdf_file = HTML(string=html_content).render()
|
||||
#
|
||||
# # Save the PDF file to a file
|
||||
# with open("quotation.pdf", "wb") as f:
|
||||
# f.write(pdf_file.write_pdf())
|
||||
#
|
||||
# # Return the PDF file as a response
|
||||
# return HttpResponse(pdf_file, content_type="application/pdf")
|
||||
|
||||
# Render the HTML template for the quotation page
|
||||
context = {
|
||||
"quotation": quotation,
|
||||
}
|
||||
context_result = get_calculations(quotation)
|
||||
context = context.update(context_result)
|
||||
|
||||
html_content = render_to_string("sales/quotation_pdf.html", context)
|
||||
@login_required
|
||||
def download_quotation_pdf(request, quotation_id):
|
||||
try:
|
||||
# Retrieve the quotation object
|
||||
quotation = models.SaleQuotation.objects.get(id=quotation_id)
|
||||
cars = models.SaleQuotationCar.objects.get(id=quotation_id)
|
||||
print(cars)
|
||||
services = cars.finance.additional_services.all()
|
||||
print(services)
|
||||
|
||||
# Create a PDF file
|
||||
|
||||
pdf_file = HTML(string=html_content).render()
|
||||
# Create a response object
|
||||
response = HttpResponse(content_type='application/pdf')
|
||||
response['Content-Disposition'] = f'attachment; filename="quotation_{quotation.id}.pdf"'
|
||||
|
||||
# Save the PDF file to a file
|
||||
with open("quotation.pdf", "wb") as f:
|
||||
f.write(pdf_file.write_pdf())
|
||||
# Call the PDF generation function
|
||||
generate_quotation_pdf(response, quotation, services)
|
||||
|
||||
# Return the PDF file as a response
|
||||
return HttpResponse(pdf_file, content_type="application/pdf")
|
||||
return response
|
||||
except models.SaleQuotation.DoesNotExist:
|
||||
return HttpResponse("Quotation not found", status=404)
|
||||
@ -10,6 +10,7 @@ babel==2.16.0
|
||||
beautifulsoup4==4.12.3
|
||||
bleach==6.2.0
|
||||
blinker==1.9.0
|
||||
Brotli==1.1.0
|
||||
certifi==2024.12.14
|
||||
cffi==1.17.1
|
||||
chardet==5.2.0
|
||||
@ -19,6 +20,7 @@ colorama==0.4.6
|
||||
commonmark==0.9.1
|
||||
crispy-bootstrap5==2024.10
|
||||
cryptography==44.0.0
|
||||
cssselect2==0.7.0
|
||||
desert==2020.11.18
|
||||
dill==0.3.9
|
||||
distro==1.9.0
|
||||
@ -55,6 +57,7 @@ easy-thumbnails==2.10
|
||||
et_xmlfile==2.0.0
|
||||
Faker==33.1.0
|
||||
Flask==3.1.0
|
||||
fonttools==4.55.3
|
||||
gprof2dot==2024.6.6
|
||||
graphqlclient==0.2.4
|
||||
h11==0.14.0
|
||||
@ -102,6 +105,7 @@ pycparser==2.22
|
||||
pydantic==2.10.4
|
||||
pydantic_core==2.27.2
|
||||
pydotplus==2.0.2
|
||||
pydyf==0.11.0
|
||||
PyGetWindow==0.0.9
|
||||
Pygments==2.18.0
|
||||
PyJWT==2.10.1
|
||||
@ -113,6 +117,7 @@ pyobjc-framework-Cocoa==10.3.2
|
||||
pyobjc-framework-Quartz==10.3.2
|
||||
pyparsing==3.2.0
|
||||
pyperclip==1.9.0
|
||||
pyphen==0.17.0
|
||||
pypng==0.20220715.0
|
||||
PyRect==0.2.0
|
||||
PyScreeze==1.0.1
|
||||
@ -147,6 +152,8 @@ SQLAlchemy==2.0.36
|
||||
sqlparse==0.5.3
|
||||
tablib==3.7.0
|
||||
threadpoolctl==3.5.0
|
||||
tinycss2==1.4.0
|
||||
tinyhtml5==2.0.0
|
||||
tomlkit==0.13.2
|
||||
tqdm==4.67.1
|
||||
trio==0.27.0
|
||||
@ -161,9 +168,11 @@ vin==0.6.2
|
||||
vininfo==1.8.0
|
||||
vishap==0.1.5
|
||||
vpic-api==0.7.4
|
||||
weasyprint==63.1
|
||||
webencodings==0.5.1
|
||||
websocket-client==1.8.0
|
||||
Werkzeug==3.1.3
|
||||
wikipedia==1.4.0
|
||||
wsproto==1.2.0
|
||||
xmlsec==1.3.14
|
||||
zopfli==0.2.3.post1
|
||||
|
||||
BIN
static/images/logos/users/app_logo.png
Normal file
BIN
static/images/logos/users/app_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@ -2,17 +2,17 @@
|
||||
{% load custom_filters %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
<!-- Custom Card Modal -->
|
||||
<div class="modal fade" id="customCardModal" tabindex="-1" aria-labelledby="customCardModalLabel" aria-hidden="true">
|
||||
<!-- Confirm Modal -->
|
||||
<div class="modal fade" id="confirmModal" tabindex="-1" aria-labelledby="confirmModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary">
|
||||
<h5 class="modal-title text-light" id="customCardModalLabel">{% trans 'Custom Card' %}</h5>
|
||||
<h5 class="modal-title text-light" id="confirmModalLabel">{% trans 'Confirm' %}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{% trans 'Confirm Approve?' %}
|
||||
|
||||
{% trans 'Are you sure' %}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-danger"
|
||||
@ -62,7 +62,7 @@
|
||||
<th>{% trans "Year" %}</th>
|
||||
<th>{% trans "Quantity" %}</th>
|
||||
<th>{% trans "Price" %}</th>
|
||||
<th>{% trans "VAT" %}</th>
|
||||
<th>{% trans "VAT %" %}</th>
|
||||
<th>{% trans "Total" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -74,7 +74,7 @@
|
||||
<td>{{ item.car.year }}</td>
|
||||
<td>{{ item.quantity }}</td>
|
||||
<td>{{ item.car.finances.selling_price }}</td>
|
||||
<td>{{ 0.15 }}</td>
|
||||
<td>{{ 0.15|percentage }}</td>
|
||||
<td>{{ item.total_vat}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -83,9 +83,9 @@
|
||||
<tr>
|
||||
<th colspan="3">{% trans "Totals" %}</th>
|
||||
<th>{{ quotation.total_quantity }}</th>
|
||||
<th>{{ quotation.total }}</th>
|
||||
<th>{{ vat_amount }}</th>
|
||||
<th>{{ quotation.total_vat }}</th>
|
||||
<th>{{ quotation.total }}</th>
|
||||
<th>{{ vat_amount }}</th>
|
||||
<th>{{ quotation.total_vat }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@ -96,7 +96,7 @@
|
||||
<tr>
|
||||
<th>{% trans "Additions" %}</th>
|
||||
<th>{% trans "Cost" %}</th>
|
||||
<th>{% trans "VAT %" %}</th>
|
||||
<th>{% trans "VAT Amount" %}</th>
|
||||
<th>{% trans "Total Cost with VAT" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -114,7 +114,7 @@
|
||||
<td>{{ total_cost }}</td>
|
||||
<td>{{ total_vat }}</td>
|
||||
<td>{{ total_cost_vat }}</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -123,12 +123,17 @@
|
||||
{% if perms.inventory.change_carfinance and quotation.status == 'DRAFT' %}
|
||||
<button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#customCardModal">{% trans "Approve Quotation" %}</button>
|
||||
{% endif %}
|
||||
<a href="{% url 'quotation_pdf' quotation.pk %}" class="btn btn-primary">Download as PDF</a>
|
||||
<a href="{% url 'quotation_pdf' quotation.pk %}" class="btn btn-primary">Download as PDF</a>
|
||||
{% if not quotation.is_approved %}
|
||||
<a href="{% url 'confirm_quotation' quotation.pk %}" class="btn btn-success">Approve</a>
|
||||
{% endif %}
|
||||
<button type="button"
|
||||
class="btn btn-success"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#confirmModal">
|
||||
{% trans 'Approve' %}
|
||||
</button>
|
||||
{% endif %}
|
||||
{% if quotation.is_approved %}
|
||||
<a href="{% url 'generate_invoice' quotation.pk %}" class="btn btn-success">Generate Invoice</a>
|
||||
<a href="{% url 'generate_invoice' quotation.pk %}" class="btn btn-success">Generate Invoice</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
@ -1,112 +1,70 @@
|
||||
{% load static %} {% load i18n %}
|
||||
{% extends 'base.html' %}
|
||||
{% load static i18n %}
|
||||
<!DOCTYPE html>
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<html lang="{{ LANGUAGE_CODE }}" dir="{% if LANGUAGE_CODE == 'ar' %}rtl{% else %}ltr{% endif %}" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<title>{% block title %}{% trans 'HAIKAL' %}{% endblock %}</title>
|
||||
<link href="{% static 'css/themes/cosmo/_variables.scss' %}" rel="stylesheet" />
|
||||
<link href="{% static 'css/custom.css' %}" rel="stylesheet" />
|
||||
{% if LANGUAGE_CODE == 'ar' %}
|
||||
<link href="{% static 'css/themes/cosmo/bootstrap.rtl.css' %}" rel="stylesheet" />
|
||||
{% else %}
|
||||
<link href="{% static 'css/themes/cosmo/bootstrap.css' %}" rel="stylesheet" />
|
||||
{% endif %}
|
||||
<link href="{% static 'css/themes/cosmo/_bootswatch.scss' %}" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-4">
|
||||
<div class="card" id="quotation-html">
|
||||
<div class="card-header">
|
||||
<h4>{% trans "Quotation Details" %} - {{ quotation.quotation_number }}</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h5>{% trans "Customer Details" %}</h5>
|
||||
<p>
|
||||
<strong>{% trans "Name" %}:</strong>
|
||||
{{ quotation.customer.get_full_name }}</p>
|
||||
<p><strong>{% trans "Address" %}:</strong> {{ quotation.customer.address }}</p>
|
||||
<p><strong>{% trans "VAT No" %}:</strong> {{ quotation.customer.vat_number }}</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h5>{% trans "Quotation Information" %}</h5>
|
||||
<p><strong>{% trans "Quotation No" %}:</strong> {{ quotation.quotation_number }}</p>
|
||||
<p><strong>{% trans "Date" %}:</strong> {{ quotation.created_at|date }}</p>
|
||||
<p><strong>{% trans "Remarks" %}:</strong> {{ quotation.remarks }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% trans "Quotation PDF" %}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
h1, h2 {
|
||||
text-align: center;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-top: 20px;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
text-align: left;
|
||||
}
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{% trans "Quotation Details" %} - {{ quotation.id }}</h1>
|
||||
<h2>{% trans "Customer Details" %}</h2>
|
||||
<p><strong>{% trans "Name" %}:</strong> {{ quotation.customer.get_full_name }}</p>
|
||||
<p><strong>{% trans "Address" %}:</strong> {{ quotation.customer.address }}</p>
|
||||
<p><strong>{% trans "VAT No" %}:</strong> {{ quotation.customer.vat_number }}</p>
|
||||
|
||||
<h5 class="mt-4">{% trans "Car Details" %}</h5>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "VIN" %}</th>
|
||||
<th>{% trans "Model" %}</th>
|
||||
<th>{% trans "Year" %}</th>
|
||||
<th>{% trans "Quantity" %}</th>
|
||||
<th>{% trans "Price" %}</th>
|
||||
<th>{% trans "VAT" %}</th>
|
||||
<th>{% trans "Total" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in quotation.quotation_cars.all %}
|
||||
<tr>
|
||||
<td>{{ item.car.vin }}</td>
|
||||
<td>{{ item.car.id_car_model.get_local_name }}</td>
|
||||
<td>{{ item.car.year }}</td>
|
||||
<td>{{ item.quantity }}</td>
|
||||
<td>{{ item.car.finances.selling_price }}</td>
|
||||
<td>{{ 0.15 }}</td>
|
||||
<td>{{ item.total_vat}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3">{% trans "Totals" %}</th>
|
||||
<th>{{ quotation.total_quantity }}</th>
|
||||
<th>{{ quotation.total }}</th>
|
||||
<th>{{ vat_amount }}</th>
|
||||
<th>{{ quotation.total_vat }}</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<h2>{% trans "Car Details" %}</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "VIN" %}</th>
|
||||
<th>{% trans "Model" %}</th>
|
||||
<th>{% trans "Year" %}</th>
|
||||
<th>{% trans "Quantity" %}</th>
|
||||
<th>{% trans "Price" %}</th>
|
||||
<th>{% trans "VAT" %}</th>
|
||||
<th>{% trans "Total" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in quotation.quotation_cars.all %}
|
||||
<tr>
|
||||
<td>{{ item.car.vin }}</td>
|
||||
<td>{{ item.car.id_car_model.get_local_name }}</td>
|
||||
<td>{{ item.car.year }}</td>
|
||||
<td>{{ item.quantity }}</td>
|
||||
<td>{{ item.selling_price }}</td>
|
||||
<td>{{ item.vat_amount }}</td>
|
||||
<td>{{ item.total }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h5 class="mt-4">{% trans "Additional Costs" %}</h5>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Additions" %}</th>
|
||||
<th>{% trans "Cost" %}</th>
|
||||
<th>{% trans "VAT %" %}</th>
|
||||
<th>{% trans "Total Cost with VAT" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for service in services %}
|
||||
<tr>
|
||||
<td>{{service.name}}</td>
|
||||
<td>{{ service.price }}</td>
|
||||
<td>{{ service.vated }}</td>
|
||||
<td>{{ service.total_price_vat }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{{ total_cost }}</td>
|
||||
<td>{{ total_vat }}</td>
|
||||
<td>{{ total_cost_vat }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>{% trans "Summary" %}</h2>
|
||||
<p><strong>{% trans "Total Sales Before VAT" %}:</strong> {{ total_sales_before_vat }}</p>
|
||||
<p><strong>{% trans "VAT Amount" %}:</strong> {{ vat_amount }}</p>
|
||||
<p><strong>{% trans "Total Sales After VAT" %}:</strong> {{ total_sales_after_vat }}</p>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user