Compare commits

...

2 Commits

File diff suppressed because it is too large Load Diff

@ -0,0 +1,162 @@
# Generated by Django 3.2.16 on 2023-04-01 21:07
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='City',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('c_name', models.CharField(max_length=30, verbose_name='城市名称')),
],
options={
'verbose_name': '城市表',
'verbose_name_plural': '城市表',
'db_table': 'city',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='CustomerModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=100, unique=True, verbose_name='客户名称')),
('mobile', models.CharField(blank=True, max_length=11, null=True, verbose_name='手机号码')),
('phone', models.CharField(blank=True, max_length=22, null=True, verbose_name='联系电话')),
('contacts_name', models.CharField(blank=True, max_length=22, null=True, verbose_name='联系人名')),
('email', models.CharField(blank=True, max_length=50, null=True, verbose_name='电子邮箱')),
('ratepayer_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='纳税人识别号码')),
('bank', models.CharField(blank=True, max_length=50, null=True, verbose_name='开户银行')),
('account_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='银行账号')),
('nation', models.CharField(blank=True, max_length=50, null=True, verbose_name='国家')),
('province', models.CharField(blank=True, max_length=50, null=True, verbose_name='省份')),
('city', models.CharField(blank=True, max_length=50, null=True, verbose_name='城市')),
('address', models.CharField(blank=True, max_length=50, null=True, verbose_name='详细地址')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('init_receivable', models.DecimalField(blank=True, decimal_places=2, max_digits=20, null=True, verbose_name='初期应收')),
('current_receivable', models.DecimalField(blank=True, decimal_places=2, max_digits=20, null=True, verbose_name='末期应收')),
('order_number', models.IntegerField(default=100, verbose_name='排序号码')),
],
options={
'verbose_name': '客户',
'verbose_name_plural': '客户',
'db_table': 't_customer',
'ordering': ['order_number', 'id'],
},
),
migrations.CreateModel(
name='Nation',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('n_name', models.CharField(max_length=30, verbose_name='国家名称')),
],
options={
'verbose_name': '国家表',
'verbose_name_plural': '国家表',
'db_table': 'nation',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='Province',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False)),
('p_name', models.CharField(max_length=30, verbose_name='省份名称')),
],
options={
'verbose_name': '省份表',
'verbose_name_plural': '省份表',
'db_table': 'province',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='SettlementAccountModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=100, unique=True, verbose_name='仓库名称')),
('number_code', models.CharField(max_length=28, unique=True, verbose_name='编号')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('init_amount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='初期金额')),
('balance', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='余额')),
('order_number', models.IntegerField(default=100, verbose_name='排序号码')),
('is_default', models.BooleanField(default=False, verbose_name='是否默认')),
],
options={
'verbose_name': '结算账户',
'verbose_name_plural': '结算账户',
'db_table': 't_settlement_account',
'ordering': ['order_number', 'id'],
},
),
migrations.CreateModel(
name='SupplierModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=100, unique=True, verbose_name='供应商名称')),
('mobile', models.CharField(blank=True, max_length=11, null=True, verbose_name='手机号码')),
('phone', models.CharField(blank=True, max_length=22, null=True, verbose_name='联系电话')),
('contacts_name', models.CharField(blank=True, max_length=22, null=True, verbose_name='联系人名')),
('email', models.CharField(blank=True, max_length=50, null=True, verbose_name='电子邮箱')),
('ratepayer_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='纳税人识别号码')),
('bank', models.CharField(blank=True, max_length=50, null=True, verbose_name='开户银行')),
('account_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='银行账号')),
('nation', models.CharField(blank=True, max_length=50, null=True, verbose_name='国家')),
('province', models.CharField(blank=True, max_length=50, null=True, verbose_name='省份')),
('city', models.CharField(blank=True, max_length=50, null=True, verbose_name='城市')),
('address', models.CharField(blank=True, max_length=50, null=True, verbose_name='详细地址')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('init_pay', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=20, verbose_name='初期应付')),
('current_pay', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=20, verbose_name='末期应付')),
('order_number', models.IntegerField(default=100, verbose_name='排序号码')),
],
options={
'verbose_name': '供应商',
'verbose_name_plural': '供应商',
'db_table': 't_supplier',
'ordering': ['order_number', 'id'],
},
),
migrations.CreateModel(
name='WarehouseModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=100, unique=True, verbose_name='仓库名称')),
('nation', models.CharField(blank=True, max_length=50, null=True, verbose_name='国家')),
('province', models.CharField(blank=True, max_length=50, null=True, verbose_name='省份')),
('city', models.CharField(blank=True, max_length=50, null=True, verbose_name='城市')),
('address', models.CharField(blank=True, max_length=50, null=True, verbose_name='详细地址')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('warehouse_fee', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='仓储费用(元/天/KG)')),
('truckage', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='搬运费用')),
('order_number', models.IntegerField(default=100, verbose_name='排序号码')),
('is_default', models.BooleanField(default=False, verbose_name='是否默认的仓库')),
],
options={
'verbose_name': '仓库',
'verbose_name_plural': '仓库',
'db_table': 't_warehouse',
'ordering': ['order_number', 'id'],
},
),
]

@ -0,0 +1,33 @@
# Generated by Django 3.2.16 on 2023-04-01 21:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('basic_info', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AddField(
model_name='warehousemodel',
name='leader_user',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='仓库负责人'),
),
migrations.AddField(
model_name='province',
name='nation',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='province_list', to='basic_info.nation', verbose_name='省份所在的国家'),
),
migrations.AddField(
model_name='city',
name='province',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='city_list', to='basic_info.province', verbose_name='城市所在的省份'),
),
]

@ -0,0 +1,123 @@
# Generated by Django 3.2.16 on 2023-04-01 21:07
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='Menu',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('number', models.IntegerField(blank=True, null=True, verbose_name='排序数字')),
('url', models.CharField(blank=True, max_length=256, null=True, verbose_name='菜单访问的URL')),
('name', models.CharField(max_length=50, verbose_name='菜单名字')),
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='erp_system.menu')),
],
options={
'verbose_name': '功能菜单',
'verbose_name_plural': '功能菜单',
'db_table': 't_menu',
'ordering': ['number'],
},
),
migrations.CreateModel(
name='PermissionsModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=50, verbose_name='权限名')),
('is_menu', models.BooleanField(default=True, verbose_name='是否为菜单')),
('method', models.CharField(blank=True, choices=[('POST', ''), ('DELETE', ''), ('PUT', ''), ('PATCH', '改局部'), ('GET', '')], default='', max_length=8, verbose_name='请求方法')),
('path', models.CharField(blank=True, default='', max_length=200, verbose_name='请求路径')),
('desc', models.CharField(blank=True, default='', max_length=512, verbose_name='权限描述')),
('menu', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='permissions_list', to='erp_system.menu')),
],
options={
'verbose_name': '权限',
'verbose_name_plural': '权限',
'db_table': 't_permissions',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='RolesModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=32, unique=True, verbose_name='角色名字')),
('permissions', models.ManyToManyField(blank=True, db_table='t_roles_permissions', to='erp_system.PermissionsModel', verbose_name='权限')),
],
options={
'verbose_name': '角色',
'verbose_name_plural': '角色',
'db_table': 't_roles',
},
),
migrations.CreateModel(
name='DeptModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=32, unique=True, verbose_name='部门')),
('address', models.CharField(blank=True, default='', max_length=128, verbose_name='部门地址')),
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='erp_system.deptmodel', verbose_name='父部门')),
],
options={
'verbose_name': '部门',
'verbose_name_plural': '部门',
'db_table': 't_dept',
},
),
migrations.CreateModel(
name='UserModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('phone', models.CharField(blank=True, max_length=11, null=True, unique=True, verbose_name='手机号码')),
('real_name', models.CharField(blank=True, max_length=128, null=True, verbose_name='真实姓名')),
('dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='erp_system.deptmodel', verbose_name='用户所在的部门')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('roles', models.ManyToManyField(blank=True, db_table='t_users_roles', to='erp_system.RolesModel', verbose_name='用户所拥有的角色列表')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'verbose_name': '功能菜单',
'verbose_name_plural': '功能菜单',
'db_table': 't_user',
'ordering': ['id'],
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]

@ -0,0 +1,121 @@
# Generated by Django 3.2.16 on 2023-04-01 21:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('basic_info', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='AttachmentModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('a_file', models.FileField(upload_to='', verbose_name='附件或者图片')),
('a_type', models.CharField(blank=True, choices=[('image', '图片'), ('doc', 'Word文档'), ('excel', 'Excel文档'), ('zip', '压缩文件'), ('other', '其他文件')], max_length=20, null=True, verbose_name='附件的类型')),
],
options={
'verbose_name': '附件表',
'verbose_name_plural': '附件表',
'db_table': 't_attachment',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='GoodsCategoryModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=100, verbose_name='类别名称')),
('number_code', models.CharField(max_length=28, unique=True, verbose_name='编号')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('order_number', models.IntegerField(default=100, verbose_name='排序号码')),
('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='children', to='goods_info.goodscategorymodel')),
],
options={
'verbose_name': '商品类别',
'verbose_name_plural': '商品类别',
'db_table': 't_category',
'ordering': ['order_number', 'id'],
},
),
migrations.CreateModel(
name='UnitsModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('basic_name', models.CharField(max_length=20, unique=True, verbose_name='基本单位')),
('backup_name', models.CharField(blank=True, max_length=20, null=True, verbose_name='副单位')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
],
options={
'verbose_name': '计量单位',
'verbose_name_plural': '计量单位',
'db_table': 't_units',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='GoodsModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=20, unique=True, verbose_name='货品名称')),
('specification', models.CharField(blank=True, max_length=50, null=True, verbose_name='规格')),
('model_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='型号')),
('color', models.CharField(blank=True, max_length=50, null=True, verbose_name='颜色')),
('basic_weight', models.CharField(blank=True, max_length=50, null=True, verbose_name='基础重量')),
('expiration_day', models.IntegerField(blank=True, null=True, verbose_name='保质期')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('number_code', models.CharField(max_length=28, unique=True, verbose_name='编号或者批号')),
('purchase_price', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='采购价')),
('retail_price', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='零售价')),
('sales_price', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='销售价')),
('lowest_price', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='最低售价')),
('order_number', models.IntegerField(default=100, verbose_name='排序号码')),
('images_list', models.CharField(blank=True, max_length=20, null=True, verbose_name='商品附件所对应的id列表')),
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.goodscategorymodel')),
('units', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.unitsmodel')),
],
options={
'verbose_name': '货品表',
'verbose_name_plural': '货品表',
'db_table': 't_goods',
'ordering': ['order_number', 'id'],
},
),
migrations.CreateModel(
name='GoodsInventoryModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('init_inventory', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='期初库存数量')),
('cur_inventory', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='现在库存数量')),
('lowest_inventory', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='最低安全库存, 0表示不设置')),
('highest_inventory', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='最高安全库存,0表示不设置')),
('warehouse_name', models.CharField(max_length=50, verbose_name='仓库的名称')),
('goods', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='inventory_list', to='goods_info.goodsmodel')),
('warehouse', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='basic_info.warehousemodel')),
],
options={
'verbose_name': '货品库存表',
'verbose_name_plural': '货品库存表',
'db_table': 't_goods_inventory',
'ordering': ['id'],
},
),
]

@ -0,0 +1,75 @@
# Generated by Django 3.2.16 on 2023-04-01 21:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('goods_info', '0001_initial'),
('basic_info', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='PurchaseModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('invoices_date', models.DateTimeField(verbose_name='单据日期')),
('number_code', models.CharField(max_length=28, verbose_name='单据编号,不让用户填写')),
('discount', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=5, verbose_name='优惠率,最多精确到小数点后两位')),
('discount_money', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='优惠金额(付款优惠),最多精确到小数点后两位')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('last_amount', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=13, verbose_name='优惠后总金额,最多精确到小数点后两位')),
('deposit', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='支付定金,最多精确到小数点后两位')),
('number_count', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='采购数量,最多精确到小数点后两位')),
('status', models.CharField(default='0', max_length=1, verbose_name='状态,0:未审核,1:已审核,2:部分入库,3:全部入库,4:完成采购,5:已付定金')),
('operator_user_name', models.CharField(blank=True, max_length=20, null=True, verbose_name='操作人员的真实姓名')),
('check_user_name', models.CharField(blank=True, max_length=20, null=True, verbose_name='操作人员的真实姓名')),
('supplier_name', models.CharField(blank=True, max_length=30, null=True, verbose_name='供应商名称')),
('attachment_list', models.CharField(blank=True, max_length=20, null=True, verbose_name='附件的id列表字段的值为: 1,2,3,4')),
('account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='basic_info.settlementaccountmodel', verbose_name='结算账户,审核之后不能改')),
('check_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='审核人员,不能修改')),
('operator_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='operator_purchase_list', to=settings.AUTH_USER_MODEL, verbose_name='采购操作人员,不能修改')),
('supplier', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='basic_info.suppliermodel', verbose_name='供应商,审核之后不能改')),
],
options={
'verbose_name': '采购表',
'verbose_name_plural': '采购表',
'db_table': 't_purchase',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='PurchaseItemModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=20, verbose_name='货品名称')),
('specification', models.CharField(blank=True, max_length=50, null=True, verbose_name='货品规格')),
('number_code', models.CharField(blank=True, max_length=28, null=True, verbose_name='货品的编号或者批号')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('purchase_count', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='采购数量,最多精确到小数点后两位')),
('purchase_price', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='采购单价,最多精确到小数点后两位')),
('purchase_money', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='采购金额,最多精确到小数点后两位')),
('goods', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.goodsmodel', verbose_name='货品')),
('purchase', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='item_list', to='purchase_info.purchasemodel', verbose_name='采购单')),
],
options={
'verbose_name': '采购项表',
'verbose_name_plural': '采购项表',
'db_table': 't_purchase_items',
'ordering': ['id'],
},
),
]

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

@ -0,0 +1,6 @@
from django.apps import AppConfig
class WarehouseInfoConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'warehouse_info'

@ -0,0 +1,88 @@
# Generated by Django 3.2.16 on 2023-04-04 20:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('basic_info', '0002_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('goods_info', '0001_initial'),
('purchase_info', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='PurchaseStorageModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('invoices_date', models.DateTimeField(verbose_name='单据日期')),
('number_code', models.CharField(max_length=28, verbose_name='单据编号,不让用户填写')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('discount', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=5, null=True, verbose_name='优惠率,最多精确到小数点后两位')),
('discount_money', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name='优惠金额(付款优惠),最多精确到小数点后两位')),
('last_amount', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=13, null=True, verbose_name='优惠后总金额,最多精确到小数点后两位')),
('other_money', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name='其他费用,最多精确到小数点后两位')),
('this_payment', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name='本次付款,最多精确到小数点后两位')),
('this_debt', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, null=True, verbose_name='本次欠款,最多精确到小数点后两位')),
('number_count', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=10, verbose_name='入库总数量,最多精确到小数点后两位')),
('status', models.CharField(default='0', max_length=1, verbose_name='状态,0:未审核,1:已审核,2:付款完成')),
('operator_user_name', models.CharField(blank=True, max_length=20, null=True, verbose_name='操作人员的真实姓名')),
('check_user_name', models.CharField(blank=True, max_length=20, null=True, verbose_name='操作人员的真实姓名')),
('supplier_name', models.CharField(blank=True, max_length=30, null=True, verbose_name='供应商名称')),
('attachment_list', models.CharField(blank=True, max_length=20, null=True, verbose_name='附件的id列表字段的值为: 1,2,3,4')),
('is_other', models.CharField(default='0', max_length=1, verbose_name='是否是其他入库,0:采购入库,1:其他入库')),
('account', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='basic_info.settlementaccountmodel', verbose_name='结算账户,审核之后不能改')),
('check_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='审核人员,不能修改')),
('operator_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='operator_in_list', to=settings.AUTH_USER_MODEL, verbose_name='入库操作人员,不能修改')),
('purchase', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='purchase_info.purchasemodel', verbose_name='采购订单,审核之后不能改')),
('supplier', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='basic_info.suppliermodel', verbose_name='供应商,审核之后不能改')),
],
options={
'verbose_name': '入库单表',
'verbose_name_plural': '入库单表',
'db_table': 't_purchase_storage',
'ordering': ['id'],
},
),
migrations.CreateModel(
name='PurchaseStorageItemModel',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('delete_flag', models.CharField(default='0', help_text='是否启用', max_length=1, verbose_name='是否启用')),
('create_time', models.DateTimeField(auto_now_add=True, help_text='创建时间', verbose_name='创建时间')),
('update_time', models.DateTimeField(auto_now=True, help_text='更新时间', verbose_name='更新时间')),
('name', models.CharField(max_length=20, verbose_name='货品名称')),
('number_code', models.CharField(blank=True, max_length=28, null=True, verbose_name='货品的编号或者批号')),
('specification', models.CharField(blank=True, max_length=50, null=True, verbose_name='货品规格')),
('model_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='型号')),
('color', models.CharField(blank=True, max_length=50, null=True, verbose_name='颜色')),
('units_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='单位名字')),
('category_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='货品类别名称')),
('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='备注')),
('purchase_count', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='入库数量,最多精确到小数点后两位')),
('purchase_price', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='采购单价,最多精确到小数点后两位')),
('purchase_money', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='采购金额,最多精确到小数点后两位')),
('warehouse_name', models.CharField(max_length=50, null=True, verbose_name='仓库名字')),
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.goodscategorymodel')),
('goods', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.goodsmodel', verbose_name='货品')),
('purchase_storage', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='item_list', to='warehouse_info.purchasestoragemodel', verbose_name='采购入库单')),
('units', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='goods_info.unitsmodel')),
('warehouse', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='basic_info.warehousemodel', verbose_name='入库的仓库')),
],
options={
'verbose_name': '入库单的项目表',
'verbose_name_plural': '入库单的项目表',
'db_table': 't_purchase_storage_items',
'ordering': ['id'],
},
),
]

@ -0,0 +1,95 @@
from django.db import models
# 采购入库单 模型类
from ERP_5.utils.base_model import BaseModel
class PurchaseStorageModel(BaseModel):
invoices_date = models.DateTimeField('单据日期')
number_code = models.CharField('单据编号,不让用户填写', max_length=28)
remark = models.CharField('备注', max_length=512, blank=True, null=True)
discount = models.DecimalField('优惠率,最多精确到小数点后两位', max_digits=5, default=0, decimal_places=2, blank=True, null=True)
discount_money = models.DecimalField('优惠金额(付款优惠),最多精确到小数点后两位', max_digits=10, default=0, decimal_places=2,
blank=True,
null=True)
last_amount = models.DecimalField('优惠后总金额,最多精确到小数点后两位', max_digits=13, decimal_places=2, default=0, blank=True,
null=True)
other_money = models.DecimalField('其他费用,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0, blank=True,
null=True)
this_payment = models.DecimalField('本次付款,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0, blank=True,
null=True)
this_debt = models.DecimalField('本次欠款,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0, blank=True,
null=True)
number_count = models.DecimalField('入库总数量,最多精确到小数点后两位', max_digits=10, decimal_places=2, blank=True, default=0)
status = models.CharField('状态,0:未审核,1:已审核,2:付款完成', max_length=1, default='0')
operator_user = models.ForeignKey('erp_system.UserModel', related_name='operator_in_list', null=True,
on_delete=models.SET_NULL,
verbose_name='入库操作人员,不能修改')
# 增加一个冗余字段
operator_user_name = models.CharField('操作人员的真实姓名', max_length=20, null=True, blank=True)
check_user = models.ForeignKey('erp_system.UserModel', null=True, blank=True, on_delete=models.SET_NULL,
verbose_name='审核人员,不能修改')
# 增加一个冗余字段
check_user_name = models.CharField('操作人员的真实姓名', max_length=20, null=True, blank=True)
account = models.ForeignKey('basic_info.SettlementAccountModel', null=True, on_delete=models.SET_NULL,
verbose_name='结算账户,审核之后不能改')
supplier = models.ForeignKey('basic_info.SupplierModel', null=True, blank=True, on_delete=models.SET_NULL,
verbose_name='供应商,审核之后不能改')
# 增加一个冗余字段
supplier_name = models.CharField('供应商名称', max_length=30, null=True, blank=True)
purchase = models.ForeignKey('purchase_info.PurchaseModel', null=True, blank=True, on_delete=models.SET_NULL,
verbose_name='采购订单,审核之后不能改')
attachment_list = models.CharField('附件的id列表字段的值为: 1,2,3,4', max_length=20, null=True, blank=True)
is_other = models.CharField('是否是其他入库,0:采购入库,1:其他入库', max_length=1, default='0')
class Meta:
db_table = 't_purchase_storage'
verbose_name = '入库单表'
verbose_name_plural = verbose_name
ordering = ['id']
# 入库单中的货品(货品项目) 模型类
class PurchaseStorageItemModel(BaseModel):
# 这些个也都是冗余字段, 减少查询的时候,表连接查询的次数
name = models.CharField(max_length=20, verbose_name='货品名称')
number_code = models.CharField('货品的编号或者批号', max_length=28, null=True, blank=True)
specification = models.CharField('货品规格', max_length=50, null=True, blank=True)
model_number = models.CharField('型号', max_length=50, null=True, blank=True)
color = models.CharField('颜色', max_length=50, null=True, blank=True)
units_name = models.CharField('单位名字', max_length=50, null=True, blank=True)
units = models.ForeignKey('goods_info.UnitsModel', on_delete=models.SET_NULL, null=True, blank=True)
category = models.ForeignKey('goods_info.GoodsCategoryModel', on_delete=models.SET_NULL, null=True, blank=True)
category_name = models.CharField('货品类别名称', max_length=50, null=True, blank=True)
remark = models.CharField('备注', max_length=512, blank=True, null=True)
purchase_count = models.DecimalField('入库数量,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
purchase_price = models.DecimalField('采购单价,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
purchase_money = models.DecimalField('采购金额,最多精确到小数点后两位', max_digits=10, decimal_places=2, default=0)
purchase_storage = models.ForeignKey('PurchaseStorageModel', related_name='item_list', null=True, blank=True,
on_delete=models.CASCADE,
verbose_name='采购入库单')
goods = models.ForeignKey('goods_info.GoodsModel', null=True, on_delete=models.SET_NULL,
verbose_name='货品')
warehouse = models.ForeignKey('basic_info.WarehouseModel', null=True, on_delete=models.SET_NULL,
verbose_name='入库的仓库')
warehouse_name = models.CharField('仓库名字', max_length=50, null=True)
class Meta:
db_table = 't_purchase_storage_items'
verbose_name = '入库单的项目表'
verbose_name_plural = verbose_name
ordering = ['id']
def __str__(self):
return self.name + ' ' + self.specification

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.
Loading…
Cancel
Save