From 2b274b3533a4bcbc3abb51c442f9a4f4262bc1df Mon Sep 17 00:00:00 2001 From: Anoop Date: Fri, 21 Oct 2022 20:50:48 +0530 Subject: [PATCH] Rebranded --- .deepsource.toml | 9 + .gitignore | 6 + .idea/.gitignore | 8 + .idea/deployment.xml | 49 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/propms.iml | 8 + LICENSE | 1 + MANIFEST.in | 18 + README.md | 32 + propms/__init__.py | 4 + propms/auto_custom.py | 620 +++++ propms/config/__init__.py | 0 propms/config/desktop.py | 17 + propms/config/docs.py | 12 + propms/config/property_management_solution.py | 200 ++ propms/fixtures/custom_field.json | 1486 ++++++++++++ propms/fixtures/property_setter.json | 665 ++++++ propms/hooks.py | 252 ++ propms/issue_hook.py | 316 +++ propms/lease_invoice.py | 262 ++ propms/modules.txt | 1 + propms/patches.txt | 0 propms/pos.js | 2116 +++++++++++++++++ propms/pos.py | 19 + .../property_management_solution/__init__.py | 0 .../property_management_solution/company.js | 35 + .../doctype/__init__.py | 0 .../doctype/apartment_status/__init__.py | 0 .../apartment_status/apartment_status.js | 8 + .../apartment_status/apartment_status.json | 280 +++ .../apartment_status/apartment_status.py | 10 + .../apartment_status/test_apartment_status.js | 23 + .../apartment_status/test_apartment_status.py | 9 + .../checklist_checkup_area/__init__.py | 0 .../checklist_checkup_area.js | 8 + .../checklist_checkup_area.json | 129 + .../checklist_checkup_area.py | 10 + .../test_checklist_checkup_area.js | 23 + .../test_checklist_checkup_area.py | 9 + .../checklist_checkup_area_task/__init__.py | 0 .../checklist_checkup_area_task.json | 75 + .../checklist_checkup_area_task.py | 10 + .../doctype/custom_error_log/__init__.py | 0 .../custom_error_log/custom_error_log.js | 8 + .../custom_error_log/custom_error_log.json | 163 ++ .../custom_error_log/custom_error_log.py | 10 + .../custom_error_log/test_custom_error_log.js | 23 + .../custom_error_log/test_custom_error_log.py | 9 + .../doctype/daily_checklist/__init__.py | 0 .../daily_checklist/daily_checklist.js | 34 + .../daily_checklist/daily_checklist.json | 353 +++ .../daily_checklist/daily_checklist.py | 10 + .../daily_checklist/test_daily_checklist.js | 23 + .../daily_checklist/test_daily_checklist.py | 9 + .../daily_checklist_detail/__init__.py | 0 .../daily_checklist_detail.json | 174 ++ .../daily_checklist_detail.py | 10 + .../doctype/door/__init__.py | 0 .../doctype/door/door.json | 204 ++ .../doctype/door/door.py | 10 + .../doctype/exit/__init__.py | 0 .../doctype/exit/exit.js | 8 + .../doctype/exit/exit.json | 214 ++ .../doctype/exit/exit.py | 10 + .../doctype/exit/test_exit.js | 23 + .../doctype/exit/test_exit.py | 9 + .../doctype/flooring/__init__.py | 0 .../doctype/flooring/flooring.json | 109 + .../doctype/flooring/flooring.py | 10 + .../doctype/guard_shift/__init__.py | 0 .../doctype/guard_shift/guard_shift.js | 8 + .../doctype/guard_shift/guard_shift.json | 129 + .../doctype/guard_shift/guard_shift.py | 10 + .../doctype/guard_shift/test_guard_shift.js | 23 + .../doctype/guard_shift/test_guard_shift.py | 9 + .../doctype/guard_shift_location/__init__.py | 0 .../guard_shift_location.json | 75 + .../guard_shift_location.py | 10 + .../doctype/insurance/__init__.py | 0 .../doctype/insurance/insurance.js | 8 + .../doctype/insurance/insurance.json | 340 +++ .../doctype/insurance/insurance.py | 10 + .../doctype/insurance/test_insurance.js | 23 + .../doctype/insurance/test_insurance.py | 9 + .../issue_materials_billed/__init__.py | 0 .../issue_materials_billed.json | 104 + .../issue_materials_billed.py | 12 + .../issue_materials_detail/__init__.py | 0 .../issue_materials_detail.json | 97 + .../issue_materials_detail.py | 10 + .../doctype/key/__init__.py | 0 .../doctype/key/key.json | 108 + .../doctype/key/key.py | 10 + .../doctype/key_set/__init__.py | 0 .../doctype/key_set/key_set.js | 8 + .../doctype/key_set/key_set.json | 93 + .../doctype/key_set/key_set.py | 10 + .../doctype/key_set/test_key_set.js | 23 + .../doctype/key_set/test_key_set.py | 9 + .../doctype/key_set_detail/__init__.py | 0 .../doctype/key_set_detail/key_set_detail.js | 29 + .../key_set_detail/key_set_detail.json | 106 + .../doctype/key_set_detail/key_set_detail.py | 10 + .../key_set_detail/test_key_set_detail.js | 23 + .../key_set_detail/test_key_set_detail.py | 9 + .../doctype/lease/__init__.py | 0 .../doctype/lease/lease.js | 87 + .../doctype/lease/lease.json | 357 +++ .../doctype/lease/lease.py | 334 +++ .../doctype/lease/test_lease.js | 23 + .../doctype/lease/test_lease.py | 9 + .../lease_invoice_schedule/__init__.py | 0 .../lease_invoice_schedule.js | 8 + .../lease_invoice_schedule.json | 130 + .../lease_invoice_schedule.py | 10 + .../test_lease_invoice_schedule.js | 23 + .../test_lease_invoice_schedule.py | 9 + .../doctype/lease_item/__init__.py | 0 .../doctype/lease_item/lease_item.js | 8 + .../doctype/lease_item/lease_item.json | 108 + .../doctype/lease_item/lease_item.py | 10 + .../doctype/lease_item/test_lease_item.js | 23 + .../doctype/lease_item/test_lease_item.py | 9 + .../doctype/meter/__init__.py | 0 .../doctype/meter/meter.js | 18 + .../doctype/meter/meter.json | 198 ++ .../doctype/meter/meter.py | 10 + .../doctype/meter/test_meter.js | 23 + .../doctype/meter/test_meter.py | 9 + .../doctype/meter_reading/__init__.py | 0 .../doctype/meter_reading/meter_reading.js | 82 + .../doctype/meter_reading/meter_reading.json | 301 +++ .../doctype/meter_reading/meter_reading.py | 10 + .../meter_reading/test_meter_reading.js | 23 + .../meter_reading/test_meter_reading.py | 9 + .../doctype/meter_reading_detail/__init__.py | 0 .../meter_reading_detail.js | 8 + .../meter_reading_detail.json | 93 + .../meter_reading_detail.py | 10 + .../test_meter_reading_detail.js | 23 + .../test_meter_reading_detail.py | 9 + .../multiselect_item_group/__init__.py | 0 .../multiselect_item_group.json | 29 + .../multiselect_item_group.py | 12 + .../doctype/outsource_contact/__init__.py | 0 .../outsource_contact/outsource_contact.js | 8 + .../outsource_contact/outsource_contact.json | 142 ++ .../outsource_contact/outsource_contact.py | 10 + .../test_outsource_contact.js | 23 + .../test_outsource_contact.py | 9 + .../outsourcing_attendance/__init__.py | 0 .../outsourcing_attendance.js | 52 + .../outsourcing_attendance.json | 299 +++ .../outsourcing_attendance.py | 10 + .../test_outsourcing_attendance.js | 23 + .../test_outsourcing_attendance.py | 9 + .../__init__.py | 0 .../outsourcing_attendance_details.json | 174 ++ .../outsourcing_attendance_details.py | 10 + .../doctype/outsourcing_category/__init__.py | 0 .../outsourcing_category.js | 8 + .../outsourcing_category.json | 130 + .../outsourcing_category.py | 10 + .../test_outsourcing_category.js | 23 + .../test_outsourcing_category.py | 9 + .../doctype/outsourcing_shift/__init__.py | 0 .../outsourcing_shift/outsourcing_shift.js | 8 + .../outsourcing_shift/outsourcing_shift.json | 162 ++ .../outsourcing_shift/outsourcing_shift.py | 10 + .../test_outsourcing_shift.js | 23 + .../test_outsourcing_shift.py | 9 + .../outsourcing_shift_location/__init__.py | 0 .../outsourcing_shift_location.json | 75 + .../outsourcing_shift_location.py | 10 + .../doctype/paint/__init__.py | 0 .../doctype/paint/paint.json | 108 + .../doctype/paint/paint.py | 10 + .../doctype/property/__init__.py | 0 .../doctype/property/property.js | 52 + .../doctype/property/property.json | 372 +++ .../doctype/property/property.py | 29 + .../doctype/property/property_tree.js | 13 + .../doctype/property/test_property.js | 23 + .../doctype/property/test_property.py | 9 + .../doctype/property_amenity/__init__.py | 0 .../property_amenity/property_amenity.js | 8 + .../property_amenity/property_amenity.json | 34 + .../property_amenity/property_amenity.py | 10 + .../property_amenity/test_property_amenity.js | 23 + .../property_amenity/test_property_amenity.py | 9 + .../property_management_settings/__init__.py | 0 .../property_management_settings.js | 6 + .../property_management_settings.json | 147 ++ .../property_management_settings.py | 10 + .../test_property_management_settings.js | 23 + .../test_property_management_settings.py | 9 + .../property_meter_reading/__init__.py | 0 .../property_meter_reading.js | 8 + .../property_meter_reading.json | 317 +++ .../property_meter_reading.py | 10 + .../test_property_meter_reading.js | 23 + .../test_property_meter_reading.py | 9 + .../doctype/property_unit/__init__.py | 0 .../doctype/property_unit/property_unit.json | 689 ++++++ .../doctype/property_unit/property_unit.py | 10 + .../doctype/security_attendance/__init__.py | 0 .../security_attendance.js | 34 + .../security_attendance.json | 102 + .../security_attendance.py | 10 + .../test_security_attendance.js | 23 + .../test_security_attendance.py | 9 + .../security_attendance_details/__init__.py | 0 .../security_attendance_details.js | 10 + .../security_attendance_details.json | 238 ++ .../security_attendance_details.py | 10 + .../test_security_attendance_details.js | 23 + .../test_security_attendance_details.py | 9 + .../security_deposit_details/__init__.py | 0 .../security_deposit_details.js | 8 + .../security_deposit_details.json | 191 ++ .../security_deposit_details.py | 10 + .../test_security_deposit_details.js | 23 + .../test_security_deposit_details.py | 9 + .../doctype/tool_item/__init__.py | 0 .../doctype/tool_item/tool_item.json | 42 + .../doctype/tool_item/tool_item.py | 9 + .../doctype/tool_item_record/__init__.py | 0 .../tool_item_record/test_tool_item_record.py | 9 + .../tool_item_record/tool_item_record.js | 28 + .../tool_item_record/tool_item_record.json | 106 + .../tool_item_record/tool_item_record.py | 9 + .../doctype/tool_item_set/__init__.py | 0 .../tool_item_set/test_tool_item_set.py | 9 + .../doctype/tool_item_set/tool_item_set.js | 8 + .../doctype/tool_item_set/tool_item_set.json | 93 + .../doctype/tool_item_set/tool_item_set.py | 9 + .../doctype/unit_assets/__init__.py | 0 .../doctype/unit_assets/unit_assets.json | 108 + .../doctype/unit_assets/unit_assets.py | 10 + .../doctype/unit_type/__init__.py | 0 .../doctype/unit_type/test_unit_type.js | 23 + .../doctype/unit_type/test_unit_type.py | 9 + .../doctype/unit_type/unit_type.js | 8 + .../doctype/unit_type/unit_type.json | 115 + .../doctype/unit_type/unit_type.py | 10 + propms/property_management_solution/issue.js | 246 ++ .../journal_entry_account.js | 40 + .../notification/__init__.py | 0 .../daily_checkup_report/__init__.py | 0 .../daily_checkup_report.json | 28 + .../daily_checkup_report.md | 1 + .../daily_checkup_report.py | 6 + .../outsourcing_attendance/__init__.py | 0 .../outsourcing_attendance.json | 28 + .../outsourcing_attendance.md | 1 + .../outsourcing_attendance.py | 6 + .../security_attendance/__init__.py | 0 .../security_attendance.json | 28 + .../security_attendance.md | 1 + .../security_attendance.py | 6 + .../point_of_sale.js | 94 + .../print_format/__init__.py | 0 .../attendance_report/__init__.py | 0 .../attendance_report/attendance_report.json | 24 + .../av_payment_entry_voucher_viva/__init__.py | 0 .../av_payment_entry_voucher_viva.json | 28 + .../outsourcing_attendance/__init__.py | 0 .../outsourcing_attendance.json | 25 + .../property_daily_checklist/__init__.py | 0 .../property_daily_checklist.json | 25 + .../property_tax_invoice/__init__.py | 0 .../property_tax_invoice.json | 26 + .../security_attendance/__init__.py | 0 .../security_attendance.json | 25 + .../viva_daily_checklist/__init__.py | 0 .../viva_daily_checklist.json | 25 + .../report/__init__.py | 0 .../report/creditors_report/__init__.py | 0 .../creditors_report/creditors_report.json | 36 + .../report/debtors_report/__init__.py | 0 .../report/debtors_report/debtors_report.js | 37 + .../report/debtors_report/debtors_report.json | 31 + .../report/invoice_details/__init__.py | 0 .../report/invoice_details/invoice_details.js | 26 + .../invoice_details/invoice_details.json | 27 + .../report/invoice_details/invoice_details.py | 17 + .../report/invoice_details/other_methods.py | 216 ++ .../report/lease_information/__init__.py | 0 .../lease_information/lease_information.js | 16 + .../lease_information/lease_information.json | 21 + .../report/mis_income_break_up/__init__.py | 0 .../mis_income_break_up.js | 36 + .../mis_income_break_up.json | 28 + .../mis_income_break_up.py | 15 + .../mis_income_break_up/other_methods.py | 109 + .../report/outsourcing_attendance/__init__.py | 0 .../outsourcing_attendance.json | 28 + .../pending_signed_agreement/__init__.py | 0 .../pending_signed_agreement.json | 28 + .../report/property_status/__init__.py | 0 .../report/property_status/property_status.js | 24 + .../property_status/property_status.json | 28 + .../report/rent_invoices_details/__init__.py | 0 .../rent_invoices_details.js | 51 + .../rent_invoices_details.json | 28 + .../rent_invoices_details.py | 506 ++++ .../rent_invoices_details_usd/__init__.py | 0 .../rent_invoices_details_usd.js | 44 + .../rent_invoices_details_usd.json | 30 + .../rent_invoices_details_usd.py | 501 ++++ .../security_attendance_report/__init__.py | 0 .../security_attendance_report.html | 48 + .../security_attendance_report.json | 27 + .../report/security_deposit/__init__.py | 0 .../security_deposit/security_deposit.js | 25 + .../security_deposit/security_deposit.json | 28 + .../__init__.py | 0 ...elf_consumption_in_maintenance_job_card.js | 18 + ...f_consumption_in_maintenance_job_card.json | 34 + .../stamp_duty_paid_by_tenant/__init__.py | 0 .../stamp_duty_paid_by_tenant.json | 28 + .../subscription_service_report/__init__.py | 0 .../subscription_service_report.js | 30 + .../subscription_service_report.json | 28 + .../report/utility_invoices/__init__.py | 0 .../report/utility_invoices/other_methods.py | 205 ++ .../utility_invoices/utility_invoices.js | 14 + .../utility_invoices/utility_invoices.json | 33 + .../utility_invoices/utility_invoices.py | 15 + .../__init__.py | 0 ...lding_tax_summary_on_sales_(properties).js | 20 + ...ing_tax_summary_on_sales_(properties).json | 28 + .../__init__.py | 0 ...g_tax_summary_on_sales_for_properties.json | 29 + .../sales_invoice.js | 40 + .../workspace/property_ms/property_ms.json | 287 +++ propms/propms-gitlab.sh | 16 + propms/propms-pull.sh | 5 + propms/templates/__init__.py | 0 propms/templates/pages/__init__.py | 0 requirements.txt | 3 + setup.py | 29 + 343 files changed, 19554 insertions(+) create mode 100644 .deepsource.toml create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/deployment.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/propms.iml create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 README.md create mode 100644 propms/__init__.py create mode 100644 propms/auto_custom.py create mode 100644 propms/config/__init__.py create mode 100644 propms/config/desktop.py create mode 100644 propms/config/docs.py create mode 100644 propms/config/property_management_solution.py create mode 100644 propms/fixtures/custom_field.json create mode 100644 propms/fixtures/property_setter.json create mode 100644 propms/hooks.py create mode 100644 propms/issue_hook.py create mode 100644 propms/lease_invoice.py create mode 100644 propms/modules.txt create mode 100644 propms/patches.txt create mode 100644 propms/pos.js create mode 100644 propms/pos.py create mode 100644 propms/property_management_solution/__init__.py create mode 100644 propms/property_management_solution/company.js create mode 100644 propms/property_management_solution/doctype/__init__.py create mode 100644 propms/property_management_solution/doctype/apartment_status/__init__.py create mode 100644 propms/property_management_solution/doctype/apartment_status/apartment_status.js create mode 100644 propms/property_management_solution/doctype/apartment_status/apartment_status.json create mode 100644 propms/property_management_solution/doctype/apartment_status/apartment_status.py create mode 100644 propms/property_management_solution/doctype/apartment_status/test_apartment_status.js create mode 100644 propms/property_management_solution/doctype/apartment_status/test_apartment_status.py create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area/__init__.py create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.js create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.json create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.py create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.js create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.py create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area_task/__init__.py create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.json create mode 100644 propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.py create mode 100644 propms/property_management_solution/doctype/custom_error_log/__init__.py create mode 100644 propms/property_management_solution/doctype/custom_error_log/custom_error_log.js create mode 100644 propms/property_management_solution/doctype/custom_error_log/custom_error_log.json create mode 100644 propms/property_management_solution/doctype/custom_error_log/custom_error_log.py create mode 100644 propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.js create mode 100644 propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.py create mode 100644 propms/property_management_solution/doctype/daily_checklist/__init__.py create mode 100644 propms/property_management_solution/doctype/daily_checklist/daily_checklist.js create mode 100644 propms/property_management_solution/doctype/daily_checklist/daily_checklist.json create mode 100644 propms/property_management_solution/doctype/daily_checklist/daily_checklist.py create mode 100644 propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.js create mode 100644 propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.py create mode 100644 propms/property_management_solution/doctype/daily_checklist_detail/__init__.py create mode 100644 propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.json create mode 100644 propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.py create mode 100644 propms/property_management_solution/doctype/door/__init__.py create mode 100644 propms/property_management_solution/doctype/door/door.json create mode 100644 propms/property_management_solution/doctype/door/door.py create mode 100644 propms/property_management_solution/doctype/exit/__init__.py create mode 100644 propms/property_management_solution/doctype/exit/exit.js create mode 100644 propms/property_management_solution/doctype/exit/exit.json create mode 100644 propms/property_management_solution/doctype/exit/exit.py create mode 100644 propms/property_management_solution/doctype/exit/test_exit.js create mode 100644 propms/property_management_solution/doctype/exit/test_exit.py create mode 100644 propms/property_management_solution/doctype/flooring/__init__.py create mode 100644 propms/property_management_solution/doctype/flooring/flooring.json create mode 100644 propms/property_management_solution/doctype/flooring/flooring.py create mode 100644 propms/property_management_solution/doctype/guard_shift/__init__.py create mode 100644 propms/property_management_solution/doctype/guard_shift/guard_shift.js create mode 100644 propms/property_management_solution/doctype/guard_shift/guard_shift.json create mode 100644 propms/property_management_solution/doctype/guard_shift/guard_shift.py create mode 100644 propms/property_management_solution/doctype/guard_shift/test_guard_shift.js create mode 100644 propms/property_management_solution/doctype/guard_shift/test_guard_shift.py create mode 100644 propms/property_management_solution/doctype/guard_shift_location/__init__.py create mode 100644 propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.json create mode 100644 propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.py create mode 100644 propms/property_management_solution/doctype/insurance/__init__.py create mode 100644 propms/property_management_solution/doctype/insurance/insurance.js create mode 100644 propms/property_management_solution/doctype/insurance/insurance.json create mode 100644 propms/property_management_solution/doctype/insurance/insurance.py create mode 100644 propms/property_management_solution/doctype/insurance/test_insurance.js create mode 100644 propms/property_management_solution/doctype/insurance/test_insurance.py create mode 100644 propms/property_management_solution/doctype/issue_materials_billed/__init__.py create mode 100644 propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.json create mode 100644 propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.py create mode 100644 propms/property_management_solution/doctype/issue_materials_detail/__init__.py create mode 100644 propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.json create mode 100644 propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.py create mode 100644 propms/property_management_solution/doctype/key/__init__.py create mode 100644 propms/property_management_solution/doctype/key/key.json create mode 100644 propms/property_management_solution/doctype/key/key.py create mode 100644 propms/property_management_solution/doctype/key_set/__init__.py create mode 100644 propms/property_management_solution/doctype/key_set/key_set.js create mode 100644 propms/property_management_solution/doctype/key_set/key_set.json create mode 100644 propms/property_management_solution/doctype/key_set/key_set.py create mode 100644 propms/property_management_solution/doctype/key_set/test_key_set.js create mode 100644 propms/property_management_solution/doctype/key_set/test_key_set.py create mode 100644 propms/property_management_solution/doctype/key_set_detail/__init__.py create mode 100644 propms/property_management_solution/doctype/key_set_detail/key_set_detail.js create mode 100644 propms/property_management_solution/doctype/key_set_detail/key_set_detail.json create mode 100644 propms/property_management_solution/doctype/key_set_detail/key_set_detail.py create mode 100644 propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.js create mode 100644 propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.py create mode 100644 propms/property_management_solution/doctype/lease/__init__.py create mode 100644 propms/property_management_solution/doctype/lease/lease.js create mode 100644 propms/property_management_solution/doctype/lease/lease.json create mode 100644 propms/property_management_solution/doctype/lease/lease.py create mode 100644 propms/property_management_solution/doctype/lease/test_lease.js create mode 100644 propms/property_management_solution/doctype/lease/test_lease.py create mode 100644 propms/property_management_solution/doctype/lease_invoice_schedule/__init__.py create mode 100644 propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.js create mode 100644 propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.json create mode 100644 propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.py create mode 100644 propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.js create mode 100644 propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.py create mode 100644 propms/property_management_solution/doctype/lease_item/__init__.py create mode 100644 propms/property_management_solution/doctype/lease_item/lease_item.js create mode 100644 propms/property_management_solution/doctype/lease_item/lease_item.json create mode 100644 propms/property_management_solution/doctype/lease_item/lease_item.py create mode 100644 propms/property_management_solution/doctype/lease_item/test_lease_item.js create mode 100644 propms/property_management_solution/doctype/lease_item/test_lease_item.py create mode 100644 propms/property_management_solution/doctype/meter/__init__.py create mode 100644 propms/property_management_solution/doctype/meter/meter.js create mode 100644 propms/property_management_solution/doctype/meter/meter.json create mode 100644 propms/property_management_solution/doctype/meter/meter.py create mode 100644 propms/property_management_solution/doctype/meter/test_meter.js create mode 100644 propms/property_management_solution/doctype/meter/test_meter.py create mode 100644 propms/property_management_solution/doctype/meter_reading/__init__.py create mode 100644 propms/property_management_solution/doctype/meter_reading/meter_reading.js create mode 100644 propms/property_management_solution/doctype/meter_reading/meter_reading.json create mode 100644 propms/property_management_solution/doctype/meter_reading/meter_reading.py create mode 100644 propms/property_management_solution/doctype/meter_reading/test_meter_reading.js create mode 100644 propms/property_management_solution/doctype/meter_reading/test_meter_reading.py create mode 100644 propms/property_management_solution/doctype/meter_reading_detail/__init__.py create mode 100644 propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.js create mode 100644 propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.json create mode 100644 propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.py create mode 100644 propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.js create mode 100644 propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.py create mode 100644 propms/property_management_solution/doctype/multiselect_item_group/__init__.py create mode 100644 propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.json create mode 100644 propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.py create mode 100644 propms/property_management_solution/doctype/outsource_contact/__init__.py create mode 100644 propms/property_management_solution/doctype/outsource_contact/outsource_contact.js create mode 100644 propms/property_management_solution/doctype/outsource_contact/outsource_contact.json create mode 100644 propms/property_management_solution/doctype/outsource_contact/outsource_contact.py create mode 100644 propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.js create mode 100644 propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.py create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance/__init__.py create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.js create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.json create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.py create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.js create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.py create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance_details/__init__.py create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.json create mode 100644 propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.py create mode 100644 propms/property_management_solution/doctype/outsourcing_category/__init__.py create mode 100644 propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.js create mode 100644 propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.json create mode 100644 propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.py create mode 100644 propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.js create mode 100644 propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.py create mode 100644 propms/property_management_solution/doctype/outsourcing_shift/__init__.py create mode 100644 propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.js create mode 100644 propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.json create mode 100644 propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.py create mode 100644 propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.js create mode 100644 propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.py create mode 100644 propms/property_management_solution/doctype/outsourcing_shift_location/__init__.py create mode 100644 propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.json create mode 100644 propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.py create mode 100644 propms/property_management_solution/doctype/paint/__init__.py create mode 100644 propms/property_management_solution/doctype/paint/paint.json create mode 100644 propms/property_management_solution/doctype/paint/paint.py create mode 100644 propms/property_management_solution/doctype/property/__init__.py create mode 100644 propms/property_management_solution/doctype/property/property.js create mode 100644 propms/property_management_solution/doctype/property/property.json create mode 100644 propms/property_management_solution/doctype/property/property.py create mode 100644 propms/property_management_solution/doctype/property/property_tree.js create mode 100644 propms/property_management_solution/doctype/property/test_property.js create mode 100644 propms/property_management_solution/doctype/property/test_property.py create mode 100644 propms/property_management_solution/doctype/property_amenity/__init__.py create mode 100644 propms/property_management_solution/doctype/property_amenity/property_amenity.js create mode 100644 propms/property_management_solution/doctype/property_amenity/property_amenity.json create mode 100644 propms/property_management_solution/doctype/property_amenity/property_amenity.py create mode 100644 propms/property_management_solution/doctype/property_amenity/test_property_amenity.js create mode 100644 propms/property_management_solution/doctype/property_amenity/test_property_amenity.py create mode 100644 propms/property_management_solution/doctype/property_management_settings/__init__.py create mode 100644 propms/property_management_solution/doctype/property_management_settings/property_management_settings.js create mode 100644 propms/property_management_solution/doctype/property_management_settings/property_management_settings.json create mode 100644 propms/property_management_solution/doctype/property_management_settings/property_management_settings.py create mode 100644 propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.js create mode 100644 propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.py create mode 100644 propms/property_management_solution/doctype/property_meter_reading/__init__.py create mode 100644 propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.js create mode 100644 propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.json create mode 100644 propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.py create mode 100644 propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.js create mode 100644 propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.py create mode 100644 propms/property_management_solution/doctype/property_unit/__init__.py create mode 100644 propms/property_management_solution/doctype/property_unit/property_unit.json create mode 100644 propms/property_management_solution/doctype/property_unit/property_unit.py create mode 100644 propms/property_management_solution/doctype/security_attendance/__init__.py create mode 100644 propms/property_management_solution/doctype/security_attendance/security_attendance.js create mode 100644 propms/property_management_solution/doctype/security_attendance/security_attendance.json create mode 100644 propms/property_management_solution/doctype/security_attendance/security_attendance.py create mode 100644 propms/property_management_solution/doctype/security_attendance/test_security_attendance.js create mode 100644 propms/property_management_solution/doctype/security_attendance/test_security_attendance.py create mode 100644 propms/property_management_solution/doctype/security_attendance_details/__init__.py create mode 100644 propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.js create mode 100644 propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.json create mode 100644 propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.py create mode 100644 propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.js create mode 100644 propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.py create mode 100644 propms/property_management_solution/doctype/security_deposit_details/__init__.py create mode 100644 propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.js create mode 100644 propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.json create mode 100644 propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.py create mode 100644 propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.js create mode 100644 propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.py create mode 100644 propms/property_management_solution/doctype/tool_item/__init__.py create mode 100644 propms/property_management_solution/doctype/tool_item/tool_item.json create mode 100644 propms/property_management_solution/doctype/tool_item/tool_item.py create mode 100644 propms/property_management_solution/doctype/tool_item_record/__init__.py create mode 100644 propms/property_management_solution/doctype/tool_item_record/test_tool_item_record.py create mode 100644 propms/property_management_solution/doctype/tool_item_record/tool_item_record.js create mode 100644 propms/property_management_solution/doctype/tool_item_record/tool_item_record.json create mode 100644 propms/property_management_solution/doctype/tool_item_record/tool_item_record.py create mode 100644 propms/property_management_solution/doctype/tool_item_set/__init__.py create mode 100644 propms/property_management_solution/doctype/tool_item_set/test_tool_item_set.py create mode 100644 propms/property_management_solution/doctype/tool_item_set/tool_item_set.js create mode 100644 propms/property_management_solution/doctype/tool_item_set/tool_item_set.json create mode 100644 propms/property_management_solution/doctype/tool_item_set/tool_item_set.py create mode 100644 propms/property_management_solution/doctype/unit_assets/__init__.py create mode 100644 propms/property_management_solution/doctype/unit_assets/unit_assets.json create mode 100644 propms/property_management_solution/doctype/unit_assets/unit_assets.py create mode 100644 propms/property_management_solution/doctype/unit_type/__init__.py create mode 100644 propms/property_management_solution/doctype/unit_type/test_unit_type.js create mode 100644 propms/property_management_solution/doctype/unit_type/test_unit_type.py create mode 100644 propms/property_management_solution/doctype/unit_type/unit_type.js create mode 100644 propms/property_management_solution/doctype/unit_type/unit_type.json create mode 100644 propms/property_management_solution/doctype/unit_type/unit_type.py create mode 100644 propms/property_management_solution/issue.js create mode 100644 propms/property_management_solution/journal_entry_account.js create mode 100644 propms/property_management_solution/notification/__init__.py create mode 100644 propms/property_management_solution/notification/daily_checkup_report/__init__.py create mode 100644 propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.json create mode 100644 propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.md create mode 100644 propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.py create mode 100644 propms/property_management_solution/notification/outsourcing_attendance/__init__.py create mode 100644 propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.json create mode 100644 propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.md create mode 100644 propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.py create mode 100644 propms/property_management_solution/notification/security_attendance/__init__.py create mode 100644 propms/property_management_solution/notification/security_attendance/security_attendance.json create mode 100644 propms/property_management_solution/notification/security_attendance/security_attendance.md create mode 100644 propms/property_management_solution/notification/security_attendance/security_attendance.py create mode 100644 propms/property_management_solution/point_of_sale.js create mode 100644 propms/property_management_solution/print_format/__init__.py create mode 100644 propms/property_management_solution/print_format/attendance_report/__init__.py create mode 100644 propms/property_management_solution/print_format/attendance_report/attendance_report.json create mode 100644 propms/property_management_solution/print_format/av_payment_entry_voucher_viva/__init__.py create mode 100644 propms/property_management_solution/print_format/av_payment_entry_voucher_viva/av_payment_entry_voucher_viva.json create mode 100644 propms/property_management_solution/print_format/outsourcing_attendance/__init__.py create mode 100644 propms/property_management_solution/print_format/outsourcing_attendance/outsourcing_attendance.json create mode 100644 propms/property_management_solution/print_format/property_daily_checklist/__init__.py create mode 100644 propms/property_management_solution/print_format/property_daily_checklist/property_daily_checklist.json create mode 100644 propms/property_management_solution/print_format/property_tax_invoice/__init__.py create mode 100644 propms/property_management_solution/print_format/property_tax_invoice/property_tax_invoice.json create mode 100644 propms/property_management_solution/print_format/security_attendance/__init__.py create mode 100644 propms/property_management_solution/print_format/security_attendance/security_attendance.json create mode 100644 propms/property_management_solution/print_format/viva_daily_checklist/__init__.py create mode 100644 propms/property_management_solution/print_format/viva_daily_checklist/viva_daily_checklist.json create mode 100644 propms/property_management_solution/report/__init__.py create mode 100644 propms/property_management_solution/report/creditors_report/__init__.py create mode 100644 propms/property_management_solution/report/creditors_report/creditors_report.json create mode 100644 propms/property_management_solution/report/debtors_report/__init__.py create mode 100644 propms/property_management_solution/report/debtors_report/debtors_report.js create mode 100644 propms/property_management_solution/report/debtors_report/debtors_report.json create mode 100644 propms/property_management_solution/report/invoice_details/__init__.py create mode 100644 propms/property_management_solution/report/invoice_details/invoice_details.js create mode 100644 propms/property_management_solution/report/invoice_details/invoice_details.json create mode 100644 propms/property_management_solution/report/invoice_details/invoice_details.py create mode 100644 propms/property_management_solution/report/invoice_details/other_methods.py create mode 100644 propms/property_management_solution/report/lease_information/__init__.py create mode 100644 propms/property_management_solution/report/lease_information/lease_information.js create mode 100644 propms/property_management_solution/report/lease_information/lease_information.json create mode 100644 propms/property_management_solution/report/mis_income_break_up/__init__.py create mode 100644 propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.js create mode 100644 propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.json create mode 100644 propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.py create mode 100644 propms/property_management_solution/report/mis_income_break_up/other_methods.py create mode 100644 propms/property_management_solution/report/outsourcing_attendance/__init__.py create mode 100644 propms/property_management_solution/report/outsourcing_attendance/outsourcing_attendance.json create mode 100644 propms/property_management_solution/report/pending_signed_agreement/__init__.py create mode 100644 propms/property_management_solution/report/pending_signed_agreement/pending_signed_agreement.json create mode 100644 propms/property_management_solution/report/property_status/__init__.py create mode 100644 propms/property_management_solution/report/property_status/property_status.js create mode 100644 propms/property_management_solution/report/property_status/property_status.json create mode 100644 propms/property_management_solution/report/rent_invoices_details/__init__.py create mode 100644 propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.js create mode 100644 propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.json create mode 100644 propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.py create mode 100644 propms/property_management_solution/report/rent_invoices_details_usd/__init__.py create mode 100644 propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.js create mode 100644 propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.json create mode 100644 propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.py create mode 100644 propms/property_management_solution/report/security_attendance_report/__init__.py create mode 100644 propms/property_management_solution/report/security_attendance_report/security_attendance_report.html create mode 100644 propms/property_management_solution/report/security_attendance_report/security_attendance_report.json create mode 100644 propms/property_management_solution/report/security_deposit/__init__.py create mode 100644 propms/property_management_solution/report/security_deposit/security_deposit.js create mode 100644 propms/property_management_solution/report/security_deposit/security_deposit.json create mode 100644 propms/property_management_solution/report/self_consumption_in_maintenance_job_card/__init__.py create mode 100644 propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.js create mode 100644 propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.json create mode 100644 propms/property_management_solution/report/stamp_duty_paid_by_tenant/__init__.py create mode 100644 propms/property_management_solution/report/stamp_duty_paid_by_tenant/stamp_duty_paid_by_tenant.json create mode 100644 propms/property_management_solution/report/subscription_service_report/__init__.py create mode 100644 propms/property_management_solution/report/subscription_service_report/subscription_service_report.js create mode 100644 propms/property_management_solution/report/subscription_service_report/subscription_service_report.json create mode 100644 propms/property_management_solution/report/utility_invoices/__init__.py create mode 100644 propms/property_management_solution/report/utility_invoices/other_methods.py create mode 100644 propms/property_management_solution/report/utility_invoices/utility_invoices.js create mode 100644 propms/property_management_solution/report/utility_invoices/utility_invoices.json create mode 100644 propms/property_management_solution/report/utility_invoices/utility_invoices.py create mode 100644 propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/__init__.py create mode 100644 propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).js create mode 100644 propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).json create mode 100644 propms/property_management_solution/report/withholding_tax_summary_on_sales_for_properties/__init__.py create mode 100644 propms/property_management_solution/report/withholding_tax_summary_on_sales_for_properties/withholding_tax_summary_on_sales_for_properties.json create mode 100644 propms/property_management_solution/sales_invoice.js create mode 100644 propms/property_management_solution/workspace/property_ms/property_ms.json create mode 100644 propms/propms-gitlab.sh create mode 100644 propms/propms-pull.sh create mode 100644 propms/templates/__init__.py create mode 100644 propms/templates/pages/__init__.py create mode 100644 requirements.txt create mode 100644 setup.py diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 0000000..c2162e3 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,9 @@ +version = 1 + +[[analyzers]] +name = "python" +enabled = true + + [analyzers.meta] + runtime_version = "3.x.x" + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70899f1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +*.pyc +*.egg-info +*.swp +tags +propms/docs/current \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..89064f6 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..55f7ddd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/propms.iml b/.idea/propms.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/propms.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1a5b374 --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +License: GPL \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..782f018 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,18 @@ +include MANIFEST.in +include requirements.txt +include *.json +include *.md +include *.py +include *.txt +recursive-include propms *.css +recursive-include propms *.csv +recursive-include propms *.html +recursive-include propms *.ico +recursive-include propms *.js +recursive-include propms *.json +recursive-include propms *.md +recursive-include propms *.png +recursive-include propms *.py +recursive-include propms *.svg +recursive-include propms *.txt +recursive-exclude propms *.pyc \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..624a86d --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +
+ +

Aakvatech's Property Management Solution Powered on InfluxERP

+ +[https:/aakvatech.com](https://influxerp.com) + +
+ +## Property Management Solution +Includes: Lease, Daily Checklist, Key Set, Meter, Outsourced Attendance. Requires InfluxERP. + +Property Management Solution is powered by [InfluxERP](https://github.com/frappe/erpnext), the world's best 100% open source ERP and a comprehensive one system solution that includes accounting, inventory, asset management, HR & Payroll and much more. + +### Install +>Step 1: run the following commands to install CSF_TZ app (Prerequisite) and PropMS app. + +1. Install CSF_TZ +``` +bench get-app https://github.com/aakvatech/CSF_TZ.git +bench --site “site-name” install-app csf_tz +``` +2. Install PropMS +``` +bench get-app https://github.com/aakvatech/PropMS.git +bench --site “site-name” install-app propms +``` + +>Step 2: Create a domain named Property Management Solution + +#### License + +GPL diff --git a/propms/__init__.py b/propms/__init__.py new file mode 100644 index 0000000..aef1e4f --- /dev/null +++ b/propms/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +__version__ = "1.7.0" diff --git a/propms/auto_custom.py b/propms/auto_custom.py new file mode 100644 index 0000000..53b997c --- /dev/null +++ b/propms/auto_custom.py @@ -0,0 +1,620 @@ +from __future__ import unicode_literals +from datetime import datetime +from erpnext.controllers.accounts_controller import get_taxes_and_charges +from frappe.model.mapper import get_mapped_doc +from frappe.utils import add_days, today, date_diff, getdate, add_months +from propms.lease_invoice import getDueDate +import calendar +import frappe +import frappe.permissions +import frappe.share +import traceback + + +@frappe.whitelist() +def app_error_log(title, error): + frappe.throw( + msg=error, + exc=traceback.format_exc(), + title=str("User:") + str(title), + is_minimizable=None, + ) + + +@frappe.whitelist() +def makeSalesInvoice(self, method): + try: + if self.doctype == "Stock Entry": + return + if ( + self.doctype == "Material Request" + and self.material_request_type == "Material Issue" + ): + + if self.status == "Issued": + result = checkIssue(self.name) + if result: + items = [] + issue_details = frappe.get_doc("Issue", result) + if issue_details.customer: + material_request_details = frappe.get_doc( + "Material Request", self.name + ) + if not material_request_details.sales_invoice: + if not len(material_request_details.items) == 0: + for item in material_request_details.items: + item_json = {} + item_json["item_code"] = item.item_code + item_json["qty"] = item.qty + items.append(item_json) + sales_invoice = frappe.get_doc( + dict( + doctype="Sales Invoice", + company=self.company, + fiscal_year=frappe.db.get_single_value( + "Global Defaults", "current_fiscal_year" + ), + posting_date=today(), + items=items, + taxes_and_charges=frappe.get_value( + "Company", + self.company, + "default_tax_template", + ), + customer=str(issue_details.customer), + due_date=add_days(today(), 2), + update_stock=1, + ) + ).insert() + if sales_invoice.name: + assignInvoiceNameInMR( + sales_invoice.name, + material_request_details.name, + ) + getTax(sales_invoice) + sales_invoice.calculate_taxes_and_totals() + changeStatusIssue(self.name, self.status) + else: + if self.customer: + if not len(self.materials_required) == 0: + items = [] + for row in self.materials_required: + material_request_details = frappe.get_doc( + "Material Request", row.material_request + ) + if ( + material_request_details.status == "Issued" + and not material_request_details.sales_invoice + ): + + if not len(material_request_details.items) == 0: + for item in material_request_details.items: + item_json = {} + item_json["item_code"] = item.item_code + item_json["qty"] = item.qty + items.append(item_json) + sales_invoice = frappe.get_doc( + dict( + doctype="Sales Invoice", + company=self.company, + fiscal_year=frappe.db.get_single_value( + "Global Defaults", "current_fiscal_year" + ), + posting_date=today(), + items=items, + taxes_and_charges=frappe.get_value( + "Company", + self.company, + "default_tax_template", + ), + customer=str(self.customer), + due_date=add_days(today(), 2), + update_stock=1, + ) + ).insert() + if sales_invoice.name: + assignInvoiceNameInMR( + sales_invoice.name, + material_request_details.name, + ) + if sales_invoice.taxes_and_charges: + getTax(sales_invoice) + sales_invoice.calculate_taxes_and_totals() + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +def getTax(sales_invoice): + taxes = get_taxes_and_charges( + "Sales Taxes and Charges Template", sales_invoice.taxes_and_charges + ) + for tax in taxes: + sales_invoice.append("taxes", tax) + + +def checkIssue(name): + data = frappe.db.sql( + """select parent from `tabIssue Materials Detail` where material_request=%s""", + name, + ) + if data: + if not data[0][0] is None: + return data[0][0] + else: + return False + else: + return False + + +def assignInvoiceNameInMR(invoice, pr): + frappe.db.sql( + """update `tabMaterial Request` set sales_invoice=%s where name=%s""", + (invoice, pr), + ) + + +@frappe.whitelist() +def changeStatusKeyset(self, method): + try: + keyset_name = getKeysetName(self.key_set) + if keyset_name: + doc = frappe.get_doc("Key Set", keyset_name) + if self.returned: + doc.status = "In" + else: + doc.status = "Out" + doc.save() + else: + frappe.throw("Key set not found - {0}.".format(self.key_set)) + + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +def getKeysetName(name): + data = frappe.db.sql("""select name from `tabKey Set` where name=%s""", name) + if data: + if not data[0][0] is None: + return data[0][0] + else: + return False + else: + return False + + +@frappe.whitelist() +def changeStatusIssue(name, status): + try: + issue_name = getIssueName(name) + if issue_name: + doc = frappe.get_doc("Issue Materials Detail", issue_name) + doc.material_status = status + doc.save() + + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +def getIssueName(name): + data = frappe.db.sql( + """select name from `tabIssue Materials Detail` where material_request=%s""", + name, + ) + if data: + if not data[0][0] is None: + return data[0][0] + else: + return False + else: + return False + + +@frappe.whitelist() +def validateSalesInvoiceItemDuplication(self, method): + for item in self.items: + for item_child in self.items: + if not item.name == item_child.name: + if item.item_code == item_child.item_code: + frappe.throw( + "Duplicate Item Exists - {0}. Duplications are not allowed.".format( + item.item_code + ) + ) + + +@frappe.whitelist() +def statusChangeBeforeLeaseExpire(): + try: + # Remarked as the users will set the property status manually + # lease_doclist=frappe.db.sql("SELECT l.name, l.property, l.end_date FROM `tabLease` l INNER JOIN `tabProperty` p ON l.property = p.name WHERE l.name = (SELECT ml.name FROM `tabLease` ml WHERE ml.property = l.property ORDER BY ml.end_date DESC LIMIT 1) AND p.status != 'On Lease' and Now() BETWEEN l.start_date and l.end_date", as_dict=1) + # if lease_doclist: + # for lease in lease_doclist: + # frappe.db.set_value("Property",lease.property,"status","On Lease") + lease_doclist = frappe.db.sql( + "SELECT l.name, l.property, l.end_date FROM `tabLease` l INNER JOIN `tabProperty` p ON l.property = p.name WHERE l.name = (SELECT ml.name FROM `tabLease` ml WHERE ml.property = l.property ORDER BY ml.end_date DESC LIMIT 1) AND l.end_date BETWEEN Now() AND Date_add(Now(), INTERVAL 3 month) AND p.status = 'On Lease'", + as_dict=1, + ) + if lease_doclist: + for lease in lease_doclist: + frappe.db.set_value( + "Property", lease.property, "status", "Off Lease in 3 Months" + ) + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def statusChangeAfterLeaseExpire(): + try: + lease_doclist = frappe.db.sql( + "SELECT l.name, l.property, l.end_date FROM `tabLease` l INNER JOIN `tabProperty` p ON l.property = p.name WHERE l.name = (SELECT ml.name FROM `tabLease` ml WHERE ml.property = l.property ORDER BY ml.end_date DESC LIMIT 1) AND p.status IN ('On Lease', 'Off Lease in 3 Months') and l.end_date < Now()", + as_dict=1, + ) + if lease_doclist: + for lease in lease_doclist: + frappe.db.set_value("Property", lease.property, "status", "Available") + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def getCheckList(): + checklist_doc = frappe.get_doc("Checklist Checkup Area", "Takeover") + if checklist_doc: + check_list = [] + for task in checklist_doc.task: + check = {} + check["checklist_task"] = task.task_name + check_list.append(check) + return check_list + + +@frappe.whitelist() +def makeDailyCheckListForTakeover( + source_name, target_doc=None, ignore_permissions=True +): + try: + + def set_missing_values(source, target): + target.checkup_date = today() + target.area = "Takeover" + + doclist = get_mapped_doc( + "Lease", + source_name, + { + "Lease": { + "doctype": "Daily Checklist", + "field_map": {"property": "property"}, + } + }, + target_doc, + set_missing_values, + ignore_permissions=ignore_permissions, + ) + return doclist + + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def makeJournalEntry(customer, date, amount): + try: + propm_setting = frappe.get_doc( + "Property Management Settings", "Property Management Settings" + ) + company = frappe.db.get_single_value("Global Defaults", "default_company") + company_doc = frappe.get_doc("Company", company) + j_entry = [] + j_entry_debit = {} + j_entry_debit["account"] = company_doc.default_receivable_account + j_entry_debit["party_type"] = "Customer" + j_entry_debit["party"] = customer + j_entry_debit["debit_in_account_currency"] = amount + j_entry.append(j_entry_debit) + j_entry_credit = {} + j_entry_credit["account"] = company_doc.default_cash_account + j_entry_credit["credit_in_account_currency"] = amount + j_entry.append(j_entry_credit) + j_entry = frappe.get_doc( + dict( + doctype="Journal Entry", + posting_date=date, + company=propm_setting.company, + accounts=j_entry, + mode_of_payment=propm_setting.security_deposit_payment_type, + ) + ).insert() + return j_entry.name + + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def getMonthADD(date, month): + return add_months(getdate(date), int(month)) + + +@frappe.whitelist() +def getDateDiff(date1, date2): + return date_diff(getdate(date1), getdate(date2)) + + +@frappe.whitelist() +def getNumberOfDays(date): + return calendar.monthrange(getdate(date).year, getdate(date).month)[1] + + +@frappe.whitelist() +def getMonthNo(date1, date2): + d1 = getdate(date1) + d2 = getdate(date2) + return diff_month( + datetime(d1.year, d1.month, d1.day), datetime(d2.year, d2.month, d2.day) + ) + + +@frappe.whitelist() +def makeInvoiceSchedule( + date, + item, + paid_by, + item_name, + name, + qty, + rate, + idx, + currency=None, + tax=None, + days_to_invoice_in_advance=None, + invoice_item_group=None, + document_type="Sales Invoice", +): + if not document_type: + document_type = "Sales Invoice" + try: + date_to_invoice = add_days(date, -1 * (days_to_invoice_in_advance or 0)) + frappe.get_doc( + dict( + idx=idx, + doctype="Lease Invoice Schedule", + parent=name, + parentfield="lease_invoice_schedule", + parenttype="lease", + date_to_invoice=date_to_invoice, + schedule_start_date=date, + lease_item=item, + paid_by=paid_by, + lease_item_name=item_name, + qty=qty, + rate=rate, + currency=currency, + tax=tax, + invoice_item_group=invoice_item_group, + document_type=document_type, + ) + ).insert() + # frappe.msgprint(str(doc.name)) + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +def diff_month(d1, d2): + if d1.day >= d2.day - 1: + return (d1.year - d2.year) * 12 + d1.month - d2.month + else: + return (d1.year - d2.year) * 12 + d1.month - d2.month - 1 + + +@frappe.whitelist() +def getDateMonthDiff(start_date, end_date, month_factor): + month_count = 0 + no_month = 0 + month_float = 0 + # frappe.msgprint("start_date: " + str(start_date) + " --- end_date: " + str(end_date)) + while start_date <= end_date: + period_end_date = add_days(add_months(start_date, month_factor), -1) + # frappe.msgprint("start_date: " + str(start_date) + " --- period_end_date: " + str(period_end_date)) + if period_end_date <= end_date: + # add month and set new start date to calculate next month_count + month_count = month_count + month_factor + start_date = add_months(start_date, month_factor) + else: + # find last number of days + days = float( + date_diff(getdate(end_date), getdate(add_months(start_date, no_month))) + + 1 + ) + # msg = "no_month = 0 so Days calculated: " + str(days) + " between " + str(start_date) + " and " + str(end_date) + # frappe.msgprint(msg) + # start_date to cater for correct number of days in month in case the start date is feb + no_days_in_month = float( + calendar.monthrange( + getdate(start_date).year, getdate(start_date).month + )[1] + ) + # msg = "no_month = 0 so No of Days calculated: " + str(no_days_in_month) + " between " + str(start_date) + " and " + str(end_date) + # frappe.msgprint(msg) + month_float = days / no_days_in_month + # frappe.msgprint("month_float = " + str(month_float) + " for days = " + str(days) + " and total number of days = " + str(no_days_in_month)) + start_date = add_months(start_date, month_factor) + month_count = month_count + no_month + month_float + return month_count + + +@frappe.whitelist() +def get_active_meter_from_property(property_id, meter_type): + """Get Active Meter Number""" + meter_data = frappe.db.sql( + """SELECT meter_number + FROM `tabProperty Meter Reading` + WHERE parent=%s + AND meter_type=%s + AND status='Active'""", + (property_id, meter_type), + as_dict=True, + ) + if meter_data: + return meter_data[0].meter_number + else: + return "" + + +@frappe.whitelist() +def get_active_meter_customer_from_property(property_id, meter_type): + # Unused as per conversation with Vimal on 2019-08-11 + """Get Active Meter Customer Name""" + meter_data = frappe.db.sql( + """SELECT invoice_customer + FROM `tabProperty Meter Reading` + WHERE parent=%s + AND meter_type=%s + AND status='Active'""", + (property_id, meter_type), + as_dict=True, + ) + if meter_data: + return meter_data[0].invoice_customer + else: + return "" + + +@frappe.whitelist() +def get_previous_meter_reading(meter_number, property_id, meter_type): + """Get Previous Meter Reading""" + previous_reading_details = frappe.db.sql( + """SELECT md.current_meter_reading as 'previous_reading', + m.reading_date as 'reading_date' + FROM `tabMeter Reading Detail` AS md + INNER JOIN `tabMeter Reading` AS m ON md.parent=m.name + WHERE md.meter_number=%s + AND m.docstatus=1 + ORDER BY m.reading_date DESC limit 1""", + meter_number, + as_dict=True, + ) + if len(previous_reading_details) >= 1: + # print previous_reading_details[0].previous_reading + return previous_reading_details[0] + else: + initial_reading_details = frappe.db.sql( + """SELECT initial_meter_reading as 'previous_reading', + installation_date as 'reading_date' + FROM `tabProperty Meter Reading` + WHERE parent=%s + AND meter_type=%s + AND meter_number=%s + AND status='Active'""", + (property_id, meter_type, meter_number), + as_dict=True, + ) + if len(initial_reading_details) >= 1: + return initial_reading_details[0] + else: + return 0 + + +@frappe.whitelist() +def make_invoice_meter_reading(self, method): + for meter_row in self.meter_reading_detail: + if int(meter_row.do_not_create_invoice) != 1: + item_detail = get_item_details( + self.meter_type, + meter_row.reading_difference, + meter_row.previous_reading_date, + add_days(self.reading_date, -1), + ) + # Changed from propert/meter customer lookup to pos cusotmer lookup as per conversation with Vimal on 2019-11-08 + leasename = get_latest_active_lease(meter_row.property) + lease = frappe.get_doc("Lease", leasename) + # customer = get_active_meter_customer_from_property(meter_row.property,self.meter_type) + customer = lease.customer + if customer: + meter_row.invoice_number = make_invoice( + self.reading_date, + customer, + meter_row.property, + item_detail, + self.meter_type, + meter_row.previous_reading_date, + add_days(self.reading_date, -1), + ) + # meter_row.invoice_number = si_no + # frappe.db.set_value("Meter Reading Detail",meter_row.name,"invoice_number",si_no) + self.db_update() + + +@frappe.whitelist() +def make_invoice( + meter_date, customer, property_id, items, lease_item, from_date=None, to_date=None +): + company = frappe.db.get_value("Property", property_id, "company") + try: + sales_invoice = frappe.get_doc( + dict( + doctype="Sales Invoice", + company=company, + posting_date=meter_date, + items=items, + lease=get_latest_active_lease(property_id), + lease_item=lease_item, + customer=str(customer), + due_date=getDueDate(meter_date, str(customer)), + taxes_and_charges=frappe.get_value( + "Company", company, "default_tax_template" + ), + cost_center=get_cost_center(property_id), + from_date=from_date, + to_date=to_date, + ) + ).insert() + if sales_invoice.taxes_and_charges: + get_tax(sales_invoice) + sales_invoice.calculate_taxes_and_totals() + sales_invoice.save() + return sales_invoice.name + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def get_tax(sales_invoice): + taxes = get_taxes_and_charges( + "Sales Taxes and Charges Template", sales_invoice.taxes_and_charges + ) + for tax in taxes: + sales_invoice.append("taxes", tax) + + +@frappe.whitelist() +def get_cost_center(property_id): + return frappe.db.get_value("Property", property_id, "cost_center") + + +@frappe.whitelist() +def get_item_details(item, qty, service_start_date, service_end_date): + item_dict = [] + item_json = {} + item_json["item_code"] = item + item_json["qty"] = qty + item_json["service_start_date"] = service_start_date + item_json["service_end_date"] = service_end_date + item_dict.append(item_json) + return item_dict + + +@frappe.whitelist() +def get_latest_active_lease(property_id): + lease_details = frappe.get_all( + "Lease", + filters={"property": property_id}, + fields=["name"], + order_by="lease_date desc", + limit=1, + ) + if len(lease_details) >= 1: + return lease_details[0].name + else: + return "" diff --git a/propms/config/__init__.py b/propms/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/config/desktop.py b/propms/config/desktop.py new file mode 100644 index 0000000..d217fbc --- /dev/null +++ b/propms/config/desktop.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from frappe import _ + + +def get_data(): + return [ + { + "module_name": "Property Management Solution", + "category": "Domains", + "color": "grey", + "icon": "octicon octicon-home", + "type": "module", + "label": _("Property Management"), + "description": "Property, lease, maintenance jobs, keys and analytics", + }, + ] diff --git a/propms/config/docs.py b/propms/config/docs.py new file mode 100644 index 0000000..846fb03 --- /dev/null +++ b/propms/config/docs.py @@ -0,0 +1,12 @@ +""" +Configuration for docs +""" + +# source_link = "https://github.com/[org_name]/propms" +# docs_base_url = "https://[org_name].github.io/propms" +# headline = "App that does everything" +# sub_heading = "Yes, you got that right the first time, everything" + + +def get_context(context): + context.brand_html = "Property Management Solution" diff --git a/propms/config/property_management_solution.py b/propms/config/property_management_solution.py new file mode 100644 index 0000000..f7da7e8 --- /dev/null +++ b/propms/config/property_management_solution.py @@ -0,0 +1,200 @@ +from __future__ import unicode_literals +from frappe import _ + + +def get_data(): + config = [ + { + "label": _("Property Documents"), + "items": [ + { + "type": "doctype", + "name": "Property", + "description": _("Property that needs to be managed."), + }, + { + "type": "doctype", + "name": "Lease", + "description": _("Lease pertaining to the properties."), + }, + { + "type": "doctype", + "name": "Key Set Detail", + "description": _("Key Set Detail"), + }, + { + "type": "doctype", + "name": "Tool Item Record", + "description": _("Tool Item Record"), + }, + { + "type": "doctype", + "name": "Daily Checklist", + "description": _("Daily Checklist"), + }, + { + "type": "doctype", + "name": "Exit", + "description": _("Exit"), + }, + { + "type": "doctype", + "name": "Meter Reading", + "description": _("Meter Reading"), + }, + { + "type": "doctype", + "name": "Outsourcing Attendance", + "description": _("Outsourcing Attendance"), + }, + { + "type": "doctype", + "name": "Insurance", + "description": _("Insurance"), + }, + { + "type": "doctype", + "name": "Security Attendance", + "description": _("Security Attendance"), + }, + { + "type": "doctype", + "name": "Withholding Tax Summary", + "description": _("Withholding Tax Summary"), + }, + ], + }, + { + "label": _("Property Masters"), + "icon": "fa fa-cog", + "items": [ + { + "type": "doctype", + "name": "Unit Type", + "label": _("Unit Type"), + "description": _("Unit Type definition."), + }, + { + "type": "doctype", + "name": "Property", + "description": _("Property database."), + }, + { + "type": "doctype", + "name": "Checklist Checkup Area", + "icon": "fa fa-sitemap", + "label": _("Checklist Checkup Area"), + "description": _("Areas for Checklist Checkup."), + }, + { + "type": "doctype", + "name": "Guard Shift", + "label": _("Guard Shift"), + "description": _("Shif for security guards."), + }, + { + "type": "doctype", + "name": "Key Set", + "icon": "fa fa-sitemap", + "label": _("Key Set"), + "description": _("Key sets in custody."), + }, + { + "type": "doctype", + "name": "Tool Item Set", + "icon": "fa fa-sitemap", + "label": _("Tool Item Set"), + "description": _("Tool Item Sets in custody."), + }, + { + "type": "doctype", + "name": "Outsourcing Category", + "label": _("Outsourcing Category"), + "description": _("Outsourcing Category definition."), + }, + { + "type": "doctype", + "name": "Property Amenity", + "label": _("Property Amenity"), + "description": _("Property Amenity definition."), + }, + { + "type": "doctype", + "name": "Security Deposit Details", + "label": _("Security Deposit Details"), + "description": _("Security Deposit Details definition."), + }, + { + "type": "doctype", + "name": "Meter", + "label": _("Meter database"), + "description": _("Register all meters here."), + }, + ], + }, + { + "label": _("Property Settings"), + "items": [ + { + "type": "doctype", + "name": "Property Management Settings", + "label": _("Property Management Settings"), + "description": _("Property Management Settings"), + }, + ], + }, + { + "label": _("Property Analytics"), + "items": [ + { + "type": "report", + "name": "Outsourcing Attendance", + "is_query_report": True, + "doctype": "Outsourcing Attendance", + }, + { + "type": "report", + "name": "Security Attendance Report", + "is_query_report": True, + "doctype": "Security Attendance", + }, + { + "type": "report", + "name": "Security Deposit", + "is_query_report": True, + "doctype": "Journal Entry", + }, + { + "type": "report", + "name": "Debtors Report", + "is_query_report": True, + "doctype": "Sales Invoice", + }, + { + "type": "report", + "name": "Creditors Report", + "is_query_report": True, + "doctype": "Purchase Invoice", + }, + { + "type": "report", + "name": "Lease Information", + "is_query_report": True, + "doctype": "Lease", + "label": _("Lease Report"), + "description": _( + "This is to show status of every lease by type of property" + ), + }, + { + "type": "report", + "name": "Property Status", + "is_query_report": True, + "doctype": "Property", + "label": _("Property Status"), + "description": _("Information about all properties in the system"), + }, + ], + }, + ] + return config diff --git a/propms/fixtures/custom_field.json b/propms/fixtures/custom_field.json new file mode 100644 index 0000000..02ed7bd --- /dev/null +++ b/propms/fixtures/custom_field.json @@ -0,0 +1,1486 @@ +[ + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "column_break_4", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "subject", + "label": null, + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-04-17 18:10:34.082349", + "name": "Issue-column_break_4", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "property_name", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 1, + "insert_after": "column_break_4", + "label": "Property Name", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:30.067591", + "name": "Issue-property_name", + "no_copy": 0, + "non_negative": 0, + "options": "Property", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "section_break_15", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "customer", + "label": null, + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:18.343718", + "name": "Issue-section_break_15", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue Materials Detail", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "mateiral_request", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "material_status", + "label": "Mateiral Request", + "length": 0, + "mandatory_depends_on": null, + "modified": "2021-01-08 10:37:59.202031", + "name": "Issue Materials Detail-mateiral_request", + "no_copy": 0, + "non_negative": 0, + "options": "Material Request", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "person_in_charge", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 1, + "insert_after": "section_break_15", + "label": "Person in charge", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:35.683043", + "name": "Issue-person_in_charge", + "no_copy": 0, + "non_negative": 0, + "options": "Employee", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sub_contractor_contact", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "person_in_charge", + "label": "Sub Contractor", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:47.462346", + "name": "Issue-sub_contractor_contact", + "no_copy": 0, + "non_negative": 0, + "options": "Supplier", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "col_brk_001", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "sub_contractor_contact", + "label": "", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:24.374829", + "name": "Issue-col_brk_001", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": "person_in_charge.employee_name", + "fetch_if_empty": 0, + "fieldname": "person_in_charge_name", + "fieldtype": "Read Only", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "col_brk_001", + "label": "Person In Charge Name", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:28:44.136810", + "name": "Issue-person_in_charge_name", + "no_copy": 0, + "non_negative": 0, + "options": "", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": "sub_contractor_contact.supplier_name", + "fetch_if_empty": 0, + "fieldname": "sub_contractor_name", + "fieldtype": "Read Only", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "person_in_charge_name", + "label": "Sub Contractor Name", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:05.121272", + "name": "Issue-sub_contractor_name", + "no_copy": 0, + "non_negative": 0, + "options": "", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Quotation", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "cost_center", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "order_type", + "label": "Cost Center", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-20 19:21:28.874674", + "name": "Quotation-cost_center", + "no_copy": 0, + "non_negative": 0, + "options": "Cost Center", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "column_break_14", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "description", + "label": null, + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:28:03.654075", + "name": "Issue-column_break_14", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "defect_found", + "fieldtype": "Text Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "column_break_14", + "label": "Defect Found", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:28:09.663327", + "name": "Issue-defect_found", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "material_request", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "defect_found", + "label": "Material Request", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:58.580301", + "name": "Issue-material_request", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "materials_required", + "fieldtype": "Table", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "material_request", + "label": "Materials Required", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:53.694881", + "name": "Issue-materials_required", + "no_copy": 0, + "non_negative": 0, + "options": "Issue Materials Detail", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "materials_billed", + "fieldtype": "Table", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "materials_required", + "label": "Materials Billed", + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-04-17 18:10:50.450539", + "name": "Issue-materials_billed", + "no_copy": 0, + "non_negative": 0, + "options": "Issue Materials Billed", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Material Request", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "sales_invoice", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "job_card", + "label": "Sales Invoice", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:41.928992", + "name": "Material Request-sales_invoice", + "no_copy": 0, + "non_negative": 0, + "options": "Sales Invoice", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval:!doc.__islocal", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Issue", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "customer_feedback", + "fieldtype": "Text Editor", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "column_break1", + "label": "Customer Feedback", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:27:12.072483", + "name": "Issue-customer_feedback", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Material Request Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "material_request", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "page_break", + "label": "Material Request", + "length": 0, + "mandatory_depends_on": null, + "modified": "2021-01-08 10:39:21.402224", + "name": "Material Request Item-material_request", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 1, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": "If the item requires Gas or Electricity or similar meter reading to charge the customer.", + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "reading_required", + "fieldtype": "Check", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "is_sales_item", + "label": "Reading required", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:24:45.938599", + "name": "Item-reading_required", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "property_management_settings", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "expenses_included_in_valuation", + "label": "Property Management Settings", + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-09-19 05:20:19.926416", + "name": "Company-property_management_settings", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "security_account_code", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "property_management_settings", + "label": "Security Account Code", + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-09-19 05:20:20.640276", + "name": "Company-security_account_code", + "no_copy": 0, + "non_negative": 0, + "options": "Account", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "default_tax_account_head", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "security_account_code", + "label": "Default Tax Account Head", + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-09-19 05:20:21.521117", + "name": "Company-default_tax_account_head", + "no_copy": 0, + "non_negative": 0, + "options": "Account", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "default_tax_template", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "default_tax_account_head", + "label": "Default Tax Template", + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-09-19 05:20:22.287077", + "name": "Company-default_tax_template", + "no_copy": 0, + "non_negative": 0, + "options": "Sales Taxes and Charges Template", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Company", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "default_maintenance_tax_template", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "default_tax_template", + "label": "Default Maintenance Tax Template", + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-09-19 05:20:23.092180", + "name": "Company-default_maintenance_tax_template", + "no_copy": 0, + "non_negative": 0, + "options": "Sales Taxes and Charges Template", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "eval: !in_list(frappe.user_roles, \"Healthcare Receptionist\")", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "lease_information", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "select_print_heading", + "label": "Lease Information", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:25:40.535861", + "name": "Sales Invoice-lease_information", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "lease", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "lease_information", + "label": "Lease", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:25:56.046693", + "name": "Sales Invoice-lease", + "no_copy": 0, + "non_negative": 0, + "options": "Lease", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "lease_item", + "fieldtype": "Read Only", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "lease", + "label": "Lease Item", + "length": 0, + "mandatory_depends_on": null, + "modified": "2019-12-05 15:25:24.126654", + "name": "Sales Invoice-lease_item", + "no_copy": 0, + "non_negative": 0, + "options": null, + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": "", + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Invoice", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "job_card", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "lease_item", + "label": "Job Card", + "length": 0, + "mandatory_depends_on": null, + "modified": "2020-04-16 17:05:14.944120", + "name": "Sales Invoice-job_card", + "no_copy": 0, + "non_negative": 0, + "options": "Issue", + "parent": null, + "parentfield": null, + "parenttype": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0, + "width": null + } +] \ No newline at end of file diff --git a/propms/fixtures/property_setter.json b/propms/fixtures/property_setter.json new file mode 100644 index 0000000..d7bb1cd --- /dev/null +++ b/propms/fixtures/property_setter.json @@ -0,0 +1,665 @@ +[ + { + "default_value": null, + "doc_type": "Property", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "status", + "modified": "2020-07-25 17:21:20.402797", + "name": "Property-status-options", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "Available\nBooked\nCommon Area (Not for lease)\nManaged for Customer\nOff lease in 3 months\nOn lease\nOn Sale\nRemoved\nRenewal\nSold\nVacating" + }, + { + "default_value": null, + "doc_type": "Daily Checklist", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocType", + "field_name": null, + "modified": "2019-12-05 17:17:42.450023", + "name": "Daily Checklist-default_print_format", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "default_print_format", + "property_type": "Data", + "row_name": null, + "value": "Viva Daily Checklist" + }, + { + "default_value": null, + "doc_type": "Journal Entry Account", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "account", + "modified": "2019-01-06 22:08:42.754975", + "name": "Journal Entry Account-account-columns", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "columns", + "property_type": "Int", + "row_name": null, + "value": "2" + }, + { + "default_value": null, + "doc_type": "Property", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "identification_section", + "modified": "2018-11-22 23:40:47.629777", + "name": "Property-identification_section-bold", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "bold", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Property", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "section_break_4", + "modified": "2018-11-22 23:40:47.637187", + "name": "Property-section_break_4-bold", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "bold", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Property", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "section_break_13", + "modified": "2018-11-22 23:40:47.643462", + "name": "Property-section_break_13-bold", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "bold", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Property", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "section_break_22", + "modified": "2018-11-22 23:40:47.648895", + "name": "Property-section_break_22-bold", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "bold", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "section_break_7", + "modified": "2019-12-05 15:52:47.917365", + "name": "Issue-section_break_7-collapsible", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "collapsible", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "section_break_19", + "modified": "2019-12-05 15:52:58.147959", + "name": "Issue-section_break_19-collapsible", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "collapsible", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "raised_by", + "modified": "2019-12-05 15:53:02.525191", + "name": "Issue-raised_by-report_hide", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "report_hide", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "email_account", + "modified": "2019-12-05 15:53:09.089897", + "name": "Issue-email_account-report_hide", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "report_hide", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "issue_type", + "modified": "2019-12-05 15:50:47.649347", + "name": "Issue-issue_type-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "priority", + "modified": "2019-12-05 15:50:42.409011", + "name": "Issue-priority-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "property_owner", + "modified": "2019-01-07 17:11:16.168472", + "name": "Lease-property_owner-in_list_view", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "customer", + "modified": "2019-01-07 17:11:16.172340", + "name": "Lease-customer-in_list_view", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "start_date", + "modified": "2019-01-07 17:11:16.176321", + "name": "Lease-start_date-in_list_view", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "end_date", + "modified": "2019-01-07 17:11:16.180756", + "name": "Lease-end_date-in_list_view", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Unit Type", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocType", + "field_name": null, + "modified": "2018-04-24 11:36:39.792787", + "name": "Unit Type-search_fields", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "search_fields", + "property_type": "Data", + "row_name": null, + "value": "unit_type" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "opening_date", + "modified": "2019-12-05 15:54:21.901296", + "name": "Issue-opening_date-in_list_view", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "raised_by", + "modified": "2019-12-05 15:54:26.025138", + "name": "Issue-raised_by-in_list_view", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "issue_type", + "modified": "2019-12-05 16:01:10.745021", + "name": "Issue-issue_type-reqd", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "reqd", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "status", + "modified": "2019-12-05 16:01:06.081899", + "name": "Issue-status-options", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "Open\nIn Progress\nAwaiting Parts\nUnder Observation\nIn Discussion\nAppointment\nHold\nClosed" + }, + { + "default_value": null, + "doc_type": "Contact", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "department", + "modified": "2019-12-05 17:21:33.595133", + "name": "Contact-department-fieldtype", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "fieldtype", + "property_type": "Select", + "row_name": null, + "value": "Select" + }, + { + "default_value": null, + "doc_type": "Contact", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "department", + "modified": "2019-12-05 17:21:28.706462", + "name": "Contact-department-options", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "\nOutsourcing - Cleaning" + }, + { + "default_value": null, + "doc_type": "Material Request", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "material_request_type", + "modified": "2019-01-04 09:15:05.932767", + "name": "Material Request-material_request_type-options", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "Material Issue\nPurchase\nMaterial Transfer\nManufacture" + }, + { + "default_value": null, + "doc_type": "Key Set Detail", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "taken_by", + "modified": "2018-12-19 15:55:00.488279", + "name": "Key Set Detail-taken_by-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Key Set Detail", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "returned", + "modified": "2018-12-19 15:55:00.491873", + "name": "Key Set Detail-returned-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Key Set Detail", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "key_set", + "modified": "2018-12-19 15:56:19.843792", + "name": "Key Set Detail-key_set-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "property_owner", + "modified": "2019-07-05 18:49:31.131288", + "name": "Lease-property_owner-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "lease_customer", + "modified": "2019-07-05 18:49:31.135659", + "name": "Lease-lease_customer-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "customer", + "modified": "2019-07-05 18:49:31.140425", + "name": "Lease-customer-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "property_user", + "modified": "2019-07-05 18:49:31.144249", + "name": "Lease-property_user-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "security_status", + "modified": "2019-07-05 18:49:31.151498", + "name": "Lease-security_status-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "property", + "modified": "2019-07-05 18:50:00.736862", + "name": "Lease-property-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "wtax_paid_by", + "modified": "2019-07-05 18:54:41.367118", + "name": "Lease-wtax_paid_by-in_standard_filter", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "in_standard_filter", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Lease", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "security_status", + "modified": "2019-07-10 13:36:03.659626", + "name": "Lease-security_status-options", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "\nProforma Invoice raised\nReceiving in process\nReceived\nReceived in part\nReturn in part\nReturned\nRecovered for rent\nRecovered for repairs\nNot required" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocType", + "field_name": null, + "modified": "2019-12-05 15:53:35.441427", + "name": "Issue-quick_entry", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "quick_entry", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "default_value": null, + "doc_type": "Journal Entry Account", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "cost_center", + "modified": "2020-03-13 16:19:25.831974", + "name": "Journal Entry Account-cost_center-columns", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "columns", + "property_type": "Int", + "row_name": null, + "value": "1" + }, + { + "default_value": null, + "doc_type": "Issue", + "docstatus": 0, + "doctype": "Property Setter", + "doctype_or_field": "DocField", + "field_name": "company", + "modified": "2020-10-13 04:17:10.536770", + "name": "Issue-company-fetch_from", + "parent": null, + "parentfield": null, + "parenttype": null, + "property": "fetch_from", + "property_type": "Small Text", + "row_name": null, + "value": "property_name.company" + } +] \ No newline at end of file diff --git a/propms/hooks.py b/propms/hooks.py new file mode 100644 index 0000000..e1fdd45 --- /dev/null +++ b/propms/hooks.py @@ -0,0 +1,252 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from . import __version__ as app_version + +app_name = "propms" +app_title = "Property Management Solution" +app_publisher = "Aakvatech" +app_description = "Property Management Solution" +app_icon = "octicon octicon-home" +app_color = "grey" +app_email = "info@aakvatech.com" +app_license = "MIT" + +# Includes in +# ------------------ + +# include js, css files in header of desk.html +# app_include_css = "/assets/propms/css/propms.css" +# app_include_js = "/assets/propms/js/propms.js" + +# include js, css files in header of web template +# web_include_css = "/assets/propms/css/propms.css" +# web_include_js = "/assets/propms/js/propms.js" + +# include js in page +# page_js = {"page" : "public/js/file.js"} +page_js = { + "pos": "property_management_solution/point_of_sale.js", + "point-of-sale": "property_management_solution/point_of_sale.js", +} + +# include js in doctype views +# doctype_js = {"doctype" : "public/js/doctype.js"} +doctype_js = { + "Sales Invoice": "property_management_solution/sales_invoice.js", + "Journal Entry Account": "property_management_solution/journal_entry_account.js", + "Issue": "property_management_solution/issue.js", + "Company": "property_management_solution/company.js", +} +# doctype_list_js = {"doctype" : "public/js/doctype_list.js"} +# doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} +# doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} + +# Home Pages +# ---------- + +# application home page (will override Website Settings) +# home_page = "login" + +# website user home page (by Role) +# role_home_page = { +# "Role": "home_page" +# } + +# Website user home page (by function) +# get_website_user_home_page = "propms.utils.get_home_page" + +# Generators +# ---------- + +# automatically create page for each record of this doctype +# website_generators = ["Web Page"] + +# Installation +# ------------ + +# before_install = "propms.install.before_install" +# after_install = "propms.install.after_install" + +# Desk Notifications +# ------------------ +# See frappe.core.notifications.get_notification_config + +# notification_config = "propms.notifications.get_notification_config" + +# Permissions +# ----------- +# Permissions evaluated in scripted ways + +# permission_query_conditions = { +# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", +# } +# +# has_permission = { +# "Event": "frappe.desk.doctype.event.event.has_permission", +# } + +# Document Events +# --------------- +# Hook on document methods and events + +fixtures = [ + { + "doctype": "Custom Field", + "filters": [ + [ + "name", + "in", + ( + "Company-default_maintenance_tax_template", + "Company-default_tax_account_head", + "Company-default_tax_template", + "Company-property_management_settings", + "Company-security_account_code", + "Issue Materials Detail-mateiral_request", + "Issue-col_brk_001", + "Issue-column_break_14", + "Issue-column_break_4", + "Issue-customer_feedback", + "Issue-defect_found", + "Issue-material_request", + "Issue-materials_billed", + "Issue-materials_required", + "Issue-person_in_charge_name", + "Issue-person_in_charge", + "Issue-property_name", + "Issue-section_break_15", + "Issue-sub_contractor_contact", + "Issue-sub_contractor_name", + "Item-reading_required", + "Material Request Item-material_request", + "Material Request-sales_invoice", + "Quotation-cost_center", + "Sales Invoice-job_card", + "Sales Invoice-lease_information", + "Sales Invoice-lease_item", + "Sales Invoice-lease", + ), + ] + ], + }, + { + "doctype": "Property Setter", + "filters": [ + [ + "name", + "in", + ( + "Contact-department-fieldtype", + "Contact-department-options", + "Daily Checklist-default_print_format", + "Issue-company-fetch_from", + "Issue-email_account-report_hide", + "Issue-issue_type-in_standard_filter", + "Issue-issue_type-reqd", + "Issue-opening_date-in_list_view", + "Issue-priority-in_standard_filter", + "Issue-quick_entry", + "Issue-raised_by-in_list_view", + "Issue-raised_by-report_hide", + "Issue-section_break_19-collapsible", + "Issue-section_break_7-collapsible", + "Issue-status-options", + "Journal Entry Account-account-columns", + "Journal Entry Account-cost_center-columns", + "Key Set Detail-key_set-in_standard_filter", + "Key Set Detail-returned-in_standard_filter", + "Key Set Detail-taken_by-in_standard_filter", + "Lease-customer-in_list_view", + "Lease-customer-in_standard_filter", + "Lease-end_date-in_list_view", + "Lease-lease_customer-in_standard_filter", + "Lease-property_owner-in_list_view", + "Lease-property_owner-in_standard_filter", + "Lease-property_user-in_standard_filter", + "Lease-property-in_standard_filter", + "Lease-security_status-in_standard_filter", + "Lease-security_status-options", + "Lease-start_date-in_list_view", + "Lease-wtax_paid_by-in_standard_filter", + "Material Request-material_request_type-options", + "Property-identification_section-bold", + "Property-section_break_13-bold", + "Property-section_break_22-bold", + "Property-section_break_4-bold", + "Property-status-options", + "Unit Type-search_fields", + ), + ] + ], + }, +] + + +doc_events = { + "Issue": { + "validate": [ + "propms.issue_hook.validate", + ], + }, + "Material Request": { + "validate": "propms.auto_custom.makeSalesInvoice", + "on_update": "propms.auto_custom.makeSalesInvoice", + "on_change": "propms.auto_custom.makeSalesInvoice", + }, + "Sales Order": { + "validate": "propms.auto_custom.validateSalesInvoiceItemDuplication" + }, + "Key Set Detail": {"on_change": "propms.auto_custom.changeStatusKeyset"}, + "Meter Reading": {"on_submit": "propms.auto_custom.make_invoice_meter_reading"}, +} + + +scheduler_events = { + "daily": [ + "propms.auto_custom.statusChangeBeforeLeaseExpire", + "propms.auto_custom.statusChangeAfterLeaseExpire", + ], + "cron": {"00 12 * * *": ["propms.lease_invoice.leaseInvoiceAutoCreate"]}, +} + + +# doc_events = { +# "*": { +# "on_update": "method", +# "on_cancel": "method", +# "on_trash": "method" +# } +# } + +# Scheduled Tasks +# --------------- + +# scheduler_events = { +# "all": [ +# "propms.tasks.all" +# ], +# "daily": [ +# "propms.tasks.daily" +# ], +# "hourly": [ +# "propms.tasks.hourly" +# ], +# "weekly": [ +# "propms.tasks.weekly" +# ] +# "monthly": [ +# "propms.tasks.monthly" +# ] +# } + +# Testing +# ------- + +# before_tests = "propms.install.before_tests" + +# Overriding Whitelisted Methods +# ------------------------------ +# +# override_whitelisted_methods = { +# "frappe.desk.doctype.event.event.get_events": "propms.event.get_events" +# } diff --git a/propms/issue_hook.py b/propms/issue_hook.py new file mode 100644 index 0000000..a15eff4 --- /dev/null +++ b/propms/issue_hook.py @@ -0,0 +1,316 @@ +from __future__ import unicode_literals +import frappe +from frappe import _ +from frappe.utils import today +from erpnext.utilities.product import get_price +from erpnext.stock.get_item_details import get_pos_profile +from propms.auto_custom import get_latest_active_lease +from erpnext.controllers.accounts_controller import get_taxes_and_charges + + +def make_sales_invoice(doc, for_self_consumption=None): + is_grouped = frappe.db.get_value( + "Property Management Settings", None, "group_maintenance_job_items" + ) + if not is_grouped: + is_grouped = 0 + is_grouped = int(is_grouped) + company = doc.company + if not company: + company = frappe.db.get_single_value("Global Defaults", "default_company") + cost_center = frappe.db.get_value("Property", doc.property_name, "cost_center") + submit_maintenance_invoice = frappe.db.get_value( + "Property Management Settings", None, "submit_maintenance_invoice" + ) + self_consumption_customer = frappe.db.get_value( + "Property Management Settings", None, "self_consumption_customer" + ) + if not submit_maintenance_invoice: + submit_maintenance_invoice = 0 + submit_maintenance_invoice = int(submit_maintenance_invoice) + user_remarks = "Sales invoice for Maintenance Job Card {0}".format(doc.name) + lease = get_latest_active_lease(doc.property_name) + + def _make_sales_invoice(items_list=None, pos=None, self_customer=None): + if not len(items_list) > 0 or not doc.customer: + return + default_tax_template = frappe.db.get_value( + "Company", company, "default_maintenance_tax_template" + ) + if not default_tax_template: + url = frappe.utils.get_url_to_form("Company", company) + frappe.throw( + _( + "Please Setup Default Maintenance Tax Template in {1}".format( + url, company + ) + ) + ) + if self_customer: + invoice_customer = self_consumption_customer + else: + invoice_customer = doc.customer + is_pos = 0 + pos_profile = "" + naming_series = "" + if pos: + user_pos_profile = get_pos_profile(company) + is_pos = 1 + pos_profile = user_pos_profile.name + naming_series = user_pos_profile.naming_series + default_tax_template = ( + user_pos_profile.taxes_and_charges or default_tax_template + ) + invoice_doc = frappe.get_doc( + dict( + is_pos=is_pos, + pos_profile=pos_profile, + naming_series=naming_series, + doctype="Sales Invoice", + customer=invoice_customer, + company=company, + posting_date=today(), + due_date=today(), + ignore_pricing_rule=1, + items=items_list, + update_stock=1, + remarks=user_remarks, + cost_center=cost_center, + lease=lease, + taxes_and_charges=default_tax_template, + job_card=doc.name, + ) + ).insert(ignore_permissions=True) + invoice_doc.reload() + if invoice_doc.taxes_and_charges and not pos: + getTax(invoice_doc) + invoice_doc.calculate_taxes_and_totals() + invoice_doc.run_method("set_missing_values") + invoice_doc.run_method("calculate_taxes_and_totals") + invoice_doc.save() + if invoice_doc: + invoice_url = frappe.utils.get_url_to_form( + invoice_doc.doctype, invoice_doc.name + ) + si_msgprint = "Sales invoice Created {1}".format( + invoice_url, invoice_doc.name + ) + frappe.flags.ignore_account_permission = True + if submit_maintenance_invoice == 1 and not pos: + invoice_doc.submit() + if pos: + make_sales_pos_payment(invoice_doc, user_pos_profile.name) + si_msgprint = "POS " + si_msgprint + frappe.msgprint(_(si_msgprint)) + for item_row in doc.materials_billed: + if ( + item_row.item + and item_row.quantity + and item_row.invoiced == 1 + and not item_row.sales_invoice + ): + item_row.sales_invoice = invoice_doc.name + frappe.db.set_value( + "Issue Materials Billed", + item_row.name, + "sales_invoice", + invoice_doc.name, + ) + frappe.db.commit() + + def getTax(sales_invoice): + taxes = get_taxes_and_charges( + "Sales Taxes and Charges Template", sales_invoice.taxes_and_charges + ) + for tax in taxes: + sales_invoice.append("taxes", tax) + + def make_sales_pos_payment(invoice_doc, pos_profile_name): + default_mode_of_payment = frappe.db.get_value( + "Sales Invoice Payment", + {"parent": pos_profile_name, "default": 1}, + ["mode_of_payment", "type", "account"], + as_dict=1, + ) + payment_row = invoice_doc.append("payments", {}) + payment_row.mode_of_payment = default_mode_of_payment.mode_of_payment + payment_row.amount = invoice_doc.grand_total + payment_row.base_amount = invoice_doc.grand_total + payment_row.account = default_mode_of_payment.account + invoice_doc.submit() + + if is_grouped == 1: + items = [] + for item_row in doc.materials_billed: + if ( + item_row.item + and item_row.quantity + and item_row.material_status == "Bill" + and not item_row.sales_invoice + and item_row.is_pos + ): + item_dict = dict( + item_code=item_row.item, + qty=item_row.quantity, + rate=item_row.rate, + cost_center=cost_center, + item_tax_template=get_taxes_template(item_row.item), + ) + items.append(item_dict) + item_row.invoiced = 1 + _make_sales_invoice(items, True) + + items = [] + for item_row in doc.materials_billed: + if ( + item_row.item + and item_row.quantity + and item_row.material_status == "Bill" + and not item_row.sales_invoice + and not item_row.is_pos + ): + item_dict = dict( + item_code=item_row.item, + qty=item_row.quantity, + rate=item_row.rate, + cost_center=cost_center, + item_tax_template=get_taxes_template(item_row.item), + ) + items.append(item_dict) + item_row.invoiced = 1 + _make_sales_invoice(items, False) + + if for_self_consumption: + items = [] + for item_row in doc.materials_billed: + if ( + item_row.item + and item_row.quantity + and item_row.material_status == "Self Consumption" + and not item_row.sales_invoice + ): + item_dict = dict( + item_code=item_row.item, + qty=item_row.quantity, + rate=item_row.rate, + cost_center=cost_center, + item_tax_template=get_taxes_template(item_row.item), + ) + items.append(item_dict) + item_row.invoiced = 1 + _make_sales_invoice(items, False, True) + + else: + for item_row in doc.materials_billed: + items = [] + if ( + item_row.item + and item_row.quantity + and item_row.material_status == "Bill" + and not item_row.sales_invoice + ): + item_dict = dict( + item_code=item_row.item, + qty=item_row.quantity, + rate=item_row.rate, + cost_center=cost_center, + item_tax_template=get_taxes_template(item_row.item), + ) + items.append(item_dict) + item_row.invoiced = 1 + if item_row.is_pos: + pos = True + else: + pos = False + _make_sales_invoice(items, pos) + + if for_self_consumption: + for item_row in doc.materials_billed: + items = [] + if ( + item_row.item + and item_row.quantity + and item_row.material_status == "Self Consumption" + and not item_row.sales_invoice + ): + item_dict = dict( + item_code=item_row.item, + qty=item_row.quantity, + rate=item_row.rate, + cost_center=cost_center, + item_tax_template=get_taxes_template(item_row.item), + ) + items.append(item_dict) + item_row.invoiced = 1 + _make_sales_invoice(items, False, True) + + +@frappe.whitelist() +def get_item_rate(item, customer): + price_list = frappe.db.get_single_value("Selling Settings", "selling_price_list") + price_list = price_list or frappe.db.get_value( + "Customer", customer, "default_price_list" + ) + customer_group = frappe.db.get_value("Customer", customer, "customer_group") + company = frappe.db.get_single_value("Global Defaults", "default_company") + rate = get_price(item, price_list, customer_group, company) + if rate: + return rate["price_list_rate"] + + +@frappe.whitelist() +def get_items_group(): + property_doc = frappe.get_doc("Property Management Settings") + items_group_list = [] + for items_group in property_doc.maintenance_item_group: + items_group_list.append(items_group.item_group) + return items_group_list + + +def validate_materials_required(doc): + have_items = 0 + for item in doc.materials_required: + if item.material_status != "Self Consumption": + have_items += 1 + if have_items > 0 and doc.status == "Closed": + frappe.throw( + _( + "The materials required has items and so the job card cannot be closed. Please confirm billing status fo the materials required." + ) + ) + + +def validate(doc, method): + validate_materials_required(doc) + make_sales_invoice(doc, False) + if doc.status == "Closed": + make_sales_invoice(doc, True) + + +def get_taxes_template(item_code): + item_tax_template = get_taxes_and_charges("Item", item_code) + if len(item_tax_template) > 0: + return item_tax_template[0]["item_tax_template"] + else: + return "" + + +@frappe.whitelist() +def get_stock_availability(item_code, company, is_pos): + warehouse = "" + if int(is_pos) == 1: + user_pos_profile = get_pos_profile(company) + warehouse = user_pos_profile.warehouse + if not warehouse: + warehouse = frappe.db.get_single_value("Stock Settings", "default_warehouse") + latest_sle = frappe.db.sql( + """select sum(actual_qty) as actual_qty + from `tabStock Ledger Entry` + where item_code = %s and warehouse = %s + limit 1""", + (item_code, warehouse), + as_dict=1, + ) + + sle_qty = latest_sle[0].actual_qty or 0 if latest_sle else 0 + return sle_qty diff --git a/propms/lease_invoice.py b/propms/lease_invoice.py new file mode 100644 index 0000000..13efc29 --- /dev/null +++ b/propms/lease_invoice.py @@ -0,0 +1,262 @@ +from __future__ import unicode_literals +from erpnext.controllers.accounts_controller import get_taxes_and_charges +from erpnext.accounts.party import get_due_date +from frappe.utils import add_days, today, add_months +import frappe +import frappe.permissions +import frappe.share +import json +import traceback +from frappe import _ + + +@frappe.whitelist() +def app_error_log(title, error): + d = frappe.get_doc( + { + "doctype": "Custom Error Log", + "title": str("User:") + str(title), + "error": traceback.format_exc(), + } + ) + d = d.insert(ignore_permissions=True) + return d + + +@frappe.whitelist() +def makeInvoice( + date, + customer, + items, + currency=None, + lease=None, + lease_item=None, + qty=None, + schedule_start_date=None, + doctype="Sales Invoice", # Allow to create Sales Invoice or Sales Order +): + """Create sales invoice from lease invoice schedule.""" + if not doctype: + doctype = "Sales Invoice" + try: + if not customer: + frappe.throw(_("Please select a Customer in Lease {0}").format(lease)) + company = frappe.get_value("Lease", lease, "company") + default_tax_template = frappe.get_value( + "Company", company, "default_tax_template" + ) + if qty != int(qty): + # it means the last invoice for the lease that may have fraction of months + subs_end_date = frappe.get_value("Lease", lease, "end_date") + else: + # month qty is not fractional + subs_end_date = add_days(add_months(schedule_start_date, qty), -1) + doc = frappe.get_doc( + dict( + doctype=doctype, + company=company, + posting_date=today(), + items=json.loads(items), + customer=str(customer), + due_date=getDueDate(today(), str(customer)), + currency=currency, + lease=lease, + lease_item=lease_item, + taxes_and_charges=default_tax_template, + from_date=schedule_start_date, + to_date=subs_end_date, + cost_center=getCostCenter(lease), + ) + ) + if doc.doctype == "Sales Order": + doc.delivery_date = doc.to_date + doc.insert() + if doc.taxes_and_charges: + getTax(doc) + doc.calculate_taxes_and_totals() + # frappe.msgprint("Department " + str(sales_invoice.department)) + doc.save() + return doc + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def getTax(sales_invoice): + taxes = get_taxes_and_charges( + "Sales Taxes and Charges Template", sales_invoice.taxes_and_charges + ) + for tax in taxes: + sales_invoice.append("taxes", tax) + + +@frappe.whitelist() +def getDueDate(date, customer): + return get_due_date( + date, + "Customer", + str(customer), + frappe.db.get_single_value("Global Defaults", "default_company"), + date, + ) + + +@frappe.whitelist() +def getCostCenter(name): + property_name = frappe.db.get_value("Lease", name, "property") + return frappe.db.get_value("Property", property_name, "cost_center") + + +@frappe.whitelist() +def leaseInvoiceAutoCreate(): + """Prepare data to create sales invoice from lease invoice schedule. This is called from form button as well as daily schedule""" + try: + # frappe.msgprint("Started") + invoice_start_date = frappe.db.get_single_value( + "Property Management Settings", "invoice_start_date" + ) + lease_invoice = frappe.get_all( + "Lease Invoice Schedule", + filters={ + "date_to_invoice": ["between", (invoice_start_date, today())], + "invoice_number": "", + }, + fields=[ + "name", + "date_to_invoice", + "invoice_number", + "parent", + "parent", + "invoice_item_group", + "lease_item", + "paid_by", + "currency", + ], + order_by="parent, paid_by, invoice_item_group, date_to_invoice, currency, lease_item", + ) + # frappe.msgprint("Lease being generated for " + str(lease_invoice)) + row_num = 1 # to identify the 1st line of the list + prev_parent = "" + prev_customer = "" + prev_invoice_item_group = "" + prev_date_to_invoice = "" + lease_invoice_schedule_name = "" + prev_currency = "" + lease_invoice_schedule_list = [] + item_dict = [] + item_json = {} + # frappe.msgprint(str(lease_invoice)) + for row in lease_invoice: + # frappe.msgprint(str(invoice_item.name) + " " + str(invoice_item.lease_item)) + # Check if same lease, customer, invoice_item_group and date_to_invoice. + # Also should not be 1st row of the list + # frappe.msgprint(row.parent + " -- " + prev_parent + " -- " + row.paid_by + " -- " + prev_customer + " -- " + row.invoice_item_group + " -- " + prev_invoice_item_group + " -- " + str(row.date_to_invoice) + " -- " + str(prev_date_to_invoice) + " -- " + row.currency + " -- " + prev_currency) + if ( + not ( + row.parent == prev_parent + and row.paid_by == prev_customer + and row.invoice_item_group == prev_invoice_item_group + and row.date_to_invoice == prev_date_to_invoice + and row.currency == prev_currency + ) + and row_num != 1 + ): + # frappe.msgprint("Creating invoice for: " + str(item_dict)) + res = makeInvoice( + invoice_item.date_to_invoice, + invoice_item.paid_by, + json.dumps(item_dict), + invoice_item.currency, + invoice_item.parent, + invoice_item.lease_item, + invoice_item.qty, + invoice_item.schedule_start_date, + doctype=invoice_item.document_type, + ) + # frappe.msgprint("Result: " + str(res)) + if res: + # Loop through all list invoice names that were created and update them with same invoice number + for lease_invoice_schedule_name in lease_invoice_schedule_list: + # frappe.msgprint("---") + # frappe.msgprint("The lease invoice schedule " + str(lease_invoice_schedule_name) + " would be updated with invoice number " + str(res.name) ) + frappe.db.set_value( + "Lease Invoice Schedule", + lease_invoice_schedule_name, + "invoice_number" + if res.doctype == "Sales Invoice" + else "sales_order_number", + res.name, + ) + frappe.msgprint( + "Lease Invoice generated with number: " + str(res.name) + ) + item_dict = [] + lease_invoice_schedule_list = ( + [] + ) # reset the list of names of lease_invoice_schedule + item_json = {} + # Now that the invoice would be created if required, load the record for preparing item_dict + invoice_item = frappe.get_doc("Lease Invoice Schedule", row.name) + if not (invoice_item.schedule_start_date): + invoice_item.schedule_start_date = invoice_item.date_to_invoice + lease_end_date = frappe.get_value("Lease", invoice_item.parent, "end_date") + item_json["item_code"] = invoice_item.lease_item + item_json["qty"] = invoice_item.qty + item_json["rate"] = invoice_item.rate + item_json["cost_center"] = getCostCenter(invoice_item.parent) + item_json["withholding_tax_rate"] = invoice_item.tax + # item_json["enable_deferred_revenue"] = 1 # Set it to true + item_json["service_start_date"] = str(invoice_item.schedule_start_date) + if invoice_item.qty != int(invoice_item.qty): + # it means the last invoice for the lease that may have fraction of months + subs_end_date = lease_end_date + else: + # month qty is not fractional + subs_end_date = add_days( + add_months(invoice_item.schedule_start_date, invoice_item.qty), -1 + ) + item_json["service_end_date"] = str(subs_end_date) + # Append to the dictionary as a dict() so that the values for the new row can be set + item_dict.append(dict(item_json)) + lease_invoice_schedule_list.append(invoice_item.name) + + # Remember the values for the next round + prev_parent = invoice_item.parent + prev_customer = invoice_item.paid_by + prev_invoice_item_group = invoice_item.invoice_item_group + prev_date_to_invoice = invoice_item.date_to_invoice + prev_currency = invoice_item.currency + row_num += 1 # increment by 1 + # Create the last invoice + res = makeInvoice( + invoice_item.date_to_invoice, + invoice_item.paid_by, + json.dumps(item_dict), + invoice_item.currency, + invoice_item.parent, + invoice_item.lease_item, + invoice_item.qty, + invoice_item.schedule_start_date, + doctype=invoice_item.document_type, + ) + if res: + # Loop through all list invoice names that were created and update them with same invoice number + for lease_invoice_schedule_name in lease_invoice_schedule_list: + # frappe.msgprint("The lease invoice schedule " + str(lease_invoice_schedule_name) + " would be updated with invoice number " + str(res.name)) + frappe.db.set_value( + "Lease Invoice Schedule", + lease_invoice_schedule_name, + "invoice_number" + if res.doctype == "Sales Invoice" + else "sales_order_number", + res.name, + ) + frappe.msgprint("Lease Invoice generated with number: " + str(res.name)) + + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def test(): + return today() diff --git a/propms/modules.txt b/propms/modules.txt new file mode 100644 index 0000000..86f0f77 --- /dev/null +++ b/propms/modules.txt @@ -0,0 +1 @@ +Property Management Solution \ No newline at end of file diff --git a/propms/patches.txt b/propms/patches.txt new file mode 100644 index 0000000..e69de29 diff --git a/propms/pos.js b/propms/pos.js new file mode 100644 index 0000000..602828b --- /dev/null +++ b/propms/pos.js @@ -0,0 +1,2116 @@ +frappe.provide("erpnext.pos"); +{% include "erpnext/public/js/controllers/taxes_and_totals.js" %} + +frappe.pages['pos'].on_page_load = function (wrapper) { + var page = frappe.ui.make_app_page({ + parent: wrapper, + title: __('Point of Sale'), + single_column: true + }); + + frappe.db.get_value('POS Settings', {name: 'POS Settings'}, 'is_online', (r) => { + if (r && r.use_pos_in_offline_mode && cint(r.use_pos_in_offline_mode)) { + // offline + wrapper.pos = new erpnext.pos.PointOfSale(wrapper); + cur_pos = wrapper.pos; + } else { + // online + frappe.flags.is_online = true + frappe.set_route('point-of-sale'); + } + }); +} + +frappe.pages['pos'].refresh = function (wrapper) { + window.onbeforeunload = function () { + return wrapper.pos.beforeunload() + } + + if (frappe.flags.is_online) { + frappe.set_route('point-of-sale'); + } +} + +erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({ + init: function (wrapper) { + this.page_len = 20; + this.freeze = false; + this.page = wrapper.page; + this.wrapper = $(wrapper).find('.page-content'); + this.set_indicator(); + this.onload(); + this.make_menu_list(); + this.bind_events(); + this.bind_items_event(); + this.si_docs = this.get_doc_from_localstorage(); + }, + + beforeunload: function (e) { + if (this.connection_status == false && frappe.get_route()[0] == "pos") { + e = e || window.event; + + // For IE and Firefox prior to version 4 + if (e) { + e.returnValue = __("You are in offline mode. You will not be able to reload until you have network."); + return + } + + // For Safari + return __("You are in offline mode. You will not be able to reload until you have network."); + } + }, + + check_internet_connection: function () { + var me = this; + //Check Internet connection after every 30 seconds + setInterval(function () { + me.set_indicator(); + }, 5000) + }, + + set_indicator: function () { + var me = this; + // navigator.onLine + this.connection_status = false; + this.page.set_indicator(__("Offline"), "grey") + frappe.call({ + method: "frappe.handler.ping", + callback: function (r) { + if (r.message) { + me.connection_status = true; + me.page.set_indicator(__("Online"), "green") + } + } + }) + }, + + onload: function () { + var me = this; + this.get_data_from_server(function () { + me.make_control(); + me.create_new(); + me.make(); + }); + }, + + make_menu_list: function () { + var me = this; + this.page.clear_menu(); + + // for mobile + this.page.add_menu_item(__("Pay"), function () { + me.validate(); + me.update_paid_amount_status(true); + me.create_invoice(); + me.make_payment(); + }).addClass('visible-xs'); + + this.page.add_menu_item(__("New Sales Invoice"), function () { + me.save_previous_entry(); + me.create_new(); + }) + + this.page.add_menu_item(__("Sync Master Data"), function () { + me.get_data_from_server(function () { + me.load_data(false); + me.make_item_list(); + me.set_missing_values(); + }) + }); + + this.page.add_menu_item(__("Sync Offline Invoices"), function () { + me.freeze_screen = true; + me.sync_sales_invoice() + }); + + this.page.add_menu_item(__("Cashier Closing"), function () { + frappe.set_route('List', 'Cashier Closing'); + }); + + this.page.add_menu_item(__("POS Profile"), function () { + frappe.set_route('List', 'POS Profile'); + }); + }, + + email_prompt: function() { + var me = this; + var fields = [{label:__("To"), fieldtype:"Data", reqd: 0, fieldname:"recipients",length:524288}, + {fieldtype: "Section Break", collapsible: 1, label: "CC & Email Template"}, + {fieldtype: "Section Break"}, + {label:__("Subject"), fieldtype:"Data", reqd: 1, + fieldname:"subject",length:524288}, + {fieldtype: "Section Break"}, + {label:__("Message"), fieldtype:"Text Editor", reqd: 1, + fieldname:"content"}, + {fieldtype: "Section Break"}, + {fieldtype: "Column Break"}]; + + this.email_dialog = new frappe.ui.Dialog({ + title: "Email", + fields: fields, + primary_action_label: __("Send"), + primary_action: function() { + me.send_action(); + } + }); + + this.email_dialog.show() + }, + + send_action: function() { + this.email_queue = this.get_email_queue() + this.email_queue[this.frm.doc.offline_pos_name] = JSON.stringify(this.email_dialog.get_values()) + this.update_email_queue() + this.email_dialog.hide() + }, + + update_email_queue: function () { + try { + localStorage.setItem('email_queue', JSON.stringify(this.email_queue)); + } catch (e) { + frappe.throw(__("LocalStorage is full, did not save")) + } + }, + + get_email_queue: function () { + try { + return JSON.parse(localStorage.getItem('email_queue')) || {}; + } catch (e) { + return {} + } + }, + + get_customers_details: function () { + try { + return JSON.parse(localStorage.getItem('customer_details')) || {}; + } catch (e) { + return {} + } + }, + + edit_record: function () { + var me = this; + + doc_data = this.get_invoice_doc(this.si_docs); + if (doc_data) { + this.frm.doc = doc_data[0][this.frm.doc.offline_pos_name]; + this.set_missing_values(); + this.refresh(false); + this.toggle_input_field(); + this.list_dialog && this.list_dialog.hide(); + } + }, + + delete_records: function () { + var me = this; + this.validate_list() + this.remove_doc_from_localstorage() + this.update_localstorage(); + this.toggle_delete_button(); + }, + + validate_list: function() { + var me = this; + this.si_docs = this.get_submitted_invoice() + $.each(this.removed_items, function(index, pos_name){ + $.each(me.si_docs, function(key, data){ + if(me.si_docs[key][pos_name] && me.si_docs[key][pos_name].offline_pos_name == pos_name ){ + frappe.throw(__("Submitted orders can not be deleted")) + } + }) + }) + }, + + toggle_delete_button: function () { + var me = this; + if(this.pos_profile_data["allow_delete"]) { + if (this.removed_items && this.removed_items.length > 0) { + $(this.page.wrapper).find('.btn-danger').show(); + } else { + $(this.page.wrapper).find('.btn-danger').hide(); + } + } + }, + + get_doctype_status: function (doc) { + if (doc.docstatus == 0) { + return { status: "Draft", indicator: "red" } + } else if (doc.outstanding_amount == 0) { + return { status: "Paid", indicator: "green" } + } else { + return { status: "Submitted", indicator: "blue" } + } + }, + + set_missing_values: function () { + var me = this; + doc = JSON.parse(localStorage.getItem('doc')) + if (this.frm.doc.payments.length == 0) { + this.frm.doc.payments = doc.payments; + this.calculate_outstanding_amount(); + } + + this.set_customer_value_in_party_field(); + + if (!this.frm.doc.write_off_account) { + this.frm.doc.write_off_account = doc.write_off_account + } + + if (!this.frm.doc.account_for_change_amount) { + this.frm.doc.account_for_change_amount = doc.account_for_change_amount + } + }, + + set_customer_value_in_party_field: function() { + if (this.frm.doc.customer) { + this.party_field.$input.val(this.frm.doc.customer); + } + }, + + get_invoice_doc: function (si_docs) { + var me = this; + this.si_docs = this.get_doc_from_localstorage(); + + return $.grep(this.si_docs, function (data) { + for (key in data) { + return key == me.frm.doc.offline_pos_name; + } + }) + }, + + get_data_from_server: function (callback) { + var me = this; + frappe.call({ + method: "erpnext.accounts.doctype.sales_invoice.pos.get_pos_data", + freeze: true, + freeze_message: __("Master data syncing, it might take some time"), + callback: function (r) { + localStorage.setItem('doc', JSON.stringify(r.message.doc)); + me.init_master_data(r) + me.set_interval_for_si_sync(); + me.check_internet_connection(); + if (callback) { + callback(); + } + }, + error: () => { + setTimeout(() => frappe.set_route('List', 'POS Profile'), 2000); + } + }) + }, + + init_master_data: function (r) { + var me = this; + this.doc = JSON.parse(localStorage.getItem('doc')); + this.meta = r.message.meta; + this.item_data = r.message.items; + this.cost_center = r.message.cost_center; + this.item_groups = r.message.item_groups; + this.customers = r.message.customers; + this.serial_no_data = r.message.serial_no_data; + this.batch_no_data = r.message.batch_no_data; + this.barcode_data = r.message.barcode_data; + this.tax_data = r.message.tax_data; + this.contacts = r.message.contacts; + this.address = r.message.address || {}; + this.price_list_data = r.message.price_list_data; + this.customer_wise_price_list = r.message.customer_wise_price_list + this.bin_data = r.message.bin_data; + this.pricing_rules = r.message.pricing_rules; + this.print_template = r.message.print_template; + this.pos_profile_data = r.message.pos_profile; + this.default_customer = r.message.default_customer || null; + this.print_settings = locals[":Print Settings"]["Print Settings"]; + this.letter_head = (this.pos_profile_data.length > 0) ? frappe.boot.letter_heads[this.pos_profile_data[letter_head]] : {}; + }, + + save_previous_entry: function () { + if (this.frm.doc.docstatus < 1 && this.frm.doc.items.length > 0) { + this.create_invoice(); + } + }, + + create_new: function () { + var me = this; + this.frm = {} + this.load_data(true); + this.setup(); + this.set_default_customer() + }, + + load_data: function (load_doc) { + var me = this; + + this.items = this.item_data; + this.actual_qty_dict = {}; + + if (load_doc) { + this.frm.doc = JSON.parse(localStorage.getItem('doc')); + this.frm.doc.offline_pos_name = null; + } + + $.each(this.meta, function (i, data) { + frappe.meta.sync(data) + locals["DocType"][data.name] = data; + }) + + this.print_template_data = frappe.render_template("print_template", { + content: this.print_template, + title: "POS", + base_url: frappe.urllib.get_base_url(), + print_css: frappe.boot.print_css, + print_settings: this.print_settings, + header: this.letter_head.header, + footer: this.letter_head.footer, + landscape: false, + columns: [] + }) + }, + + setup: function () { + this.set_primary_action(); + this.party_field.$input.attr('disabled', false); + if(this.selected_row) { + this.selected_row.hide() + } + }, + + set_default_customer: function() { + if (this.default_customer && !this.frm.doc.customer) { + this.party_field.$input.val(this.default_customer); + this.frm.doc.customer = this.default_customer; + this.numeric_keypad.show(); + this.toggle_list_customer(false) + this.toggle_item_cart(true) + } + }, + + set_transaction_defaults: function (party) { + var me = this; + this.party = party; + this.price_list = (party == "Customer" ? + this.frm.doc.selling_price_list : this.frm.doc.buying_price_list); + this.price_list_field = (party == "Customer" ? "selling_price_list" : "buying_price_list"); + this.sales_or_purchase = (party == "Customer" ? "Sales" : "Purchase"); + }, + + make: function () { + this.make_item_list(); + this.make_discount_field() + }, + + make_control: function() { + this.frm = {} + this.frm.doc = this.doc + this.set_transaction_defaults("Customer"); + this.frm.doc["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false; + this.frm.doc["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false; + this.wrapper.html(frappe.render_template("pos", this.frm.doc)); + this.make_search(); + this.make_customer(); + this.make_list_customers(); + this.bind_numeric_keypad(); + }, + + make_search: function () { + var me = this; + this.search_item = frappe.ui.form.make_control({ + df: { + "fieldtype": "Data", + "label": __("Item"), + "fieldname": "pos_item", + "placeholder": __("Search Item") + }, + parent: this.wrapper.find(".search-item"), + only_input: true, + }); + + this.search_item.make_input(); + + + this.cost_center = frappe.ui.form.make_control({ + df: { + "fieldtype": "Data", + "label": __("Item"), + "fieldname": "pos_item", + "placeholder": __("Search Item") + }, + parent: this.wrapper.find(".search-item"), + only_input: true, + }); + this.cost_center.make_input(); + + this.search_item.$input.on("keypress", function (event) { + + clearTimeout(me.last_search_timeout); + me.last_search_timeout = setTimeout(() => { + if((me.search_item.$input.val() != "") || (event.which == 13)) { + me.items = me.get_items(); + me.make_item_list(); + } + }, 400); + }); + + this.search_cost_center = this.wrapper.find('.search-cost-center'); + + var dropdown_html = this.cost_center.map(function(cost_center) { + return "
  • "+cost_center+"
  • "; + }).join(""); + + this.search_item_group = this.wrapper.find('.search-item-group'); + sorted_item_groups = this.get_sorted_item_groups() + var dropdown_html = sorted_item_groups.map(function(item_group) { + return "
  • "+item_group+"
  • "; + }).join(""); + + this.search_item_group.find('.dropdown-menu').html(dropdown_html); + + this.search_item_group.on('click', '.dropdown-menu a', function() { + me.selected_item_group = $(this).attr('data-value'); + me.search_item_group.find('.dropdown-text').text(me.selected_item_group); + + me.page_len = 20; + me.items = me.get_items(); + me.make_item_list(); + }) + + me.toggle_more_btn(); + + this.wrapper.on("click", ".btn-more", function() { + me.page_len += 20; + me.items = me.get_items(); + me.make_item_list(); + me.toggle_more_btn(); + }); + + this.page.wrapper.on("click", ".edit-customer-btn", function() { + me.update_customer() + }) + }, + + get_sorted_item_groups: function() { + list = {} + $.each(this.item_groups, function(i, data) { + list[i] = data[0] + }) + + return Object.keys(list).sort(function(a,b){return list[a]-list[b]}) + }, + + toggle_more_btn: function() { + if(!this.items || this.items.length <= this.page_len) { + this.wrapper.find(".btn-more").hide(); + } else { + this.wrapper.find(".btn-more").show(); + } + }, + + toggle_totals_area: function(show) { + + if(show === undefined) { + show = this.is_totals_area_collapsed; + } + + var totals_area = this.wrapper.find('.totals-area'); + totals_area.find('.net-total-area, .tax-area, .discount-amount-area') + .toggle(show); + + if(show) { + totals_area.find('.collapse-btn i') + .removeClass('octicon-chevron-down') + .addClass('octicon-chevron-up'); + } else { + totals_area.find('.collapse-btn i') + .removeClass('octicon-chevron-up') + .addClass('octicon-chevron-down'); + } + + this.is_totals_area_collapsed = !show; + }, + + make_list_customers: function () { + var me = this; + this.list_customers_btn = this.page.wrapper.find('.list-customers-btn'); + this.add_customer_btn = this.wrapper.find('.add-customer-btn'); + this.pos_bill = this.wrapper.find('.pos-bill-wrapper').hide(); + this.list_customers = this.wrapper.find('.list-customers'); + this.numeric_keypad = this.wrapper.find('.numeric_keypad'); + this.list_customers_btn.addClass("view_customer") + + me.render_list_customers(); + me.toggle_totals_area(false); + + this.page.wrapper.on('click', '.list-customers-btn', function() { + $(this).toggleClass("view_customer"); + if($(this).hasClass("view_customer")) { + me.render_list_customers(); + me.list_customers.show(); + me.pos_bill.hide(); + me.numeric_keypad.hide(); + me.toggle_delete_button() + } else { + if(me.frm.doc.docstatus == 0) { + me.party_field.$input.attr('disabled', false); + } + me.pos_bill.show(); + me.toggle_totals_area(false); + me.toggle_delete_button() + me.list_customers.hide(); + me.numeric_keypad.show(); + } + }); + this.add_customer_btn.on('click', function() { + me.save_previous_entry(); + me.create_new(); + me.refresh(); + me.set_focus(); + }); + this.pos_bill.on('click', '.collapse-btn', function() { + me.toggle_totals_area(); + }); + }, + + bind_numeric_keypad: function() { + var me = this; + $(this.numeric_keypad).find('.pos-operation').on('click', function(){ + me.numeric_val = ''; + }) + + $(this.numeric_keypad).find('.numeric-keypad').on('click', function(){ + me.numeric_id = $(this).attr("id") || me.numeric_id; + me.val = $(this).attr("val") + if(me.numeric_id) { + me.selected_field = $(me.wrapper).find('.selected-item').find('.' + me.numeric_id) + } + + if(me.val && me.numeric_id) { + me.numeric_val += me.val; + me.selected_field.val(flt(me.numeric_val)) + me.selected_field.trigger("change") + // me.render_selected_item() + } + + if(me.numeric_id && $(this).hasClass('pos-operation')) { + me.numeric_keypad.find('button.pos-operation').removeClass('active'); + $(this).addClass('active'); + + me.selected_row.find('.pos-list-row').removeClass('active'); + me.selected_field.closest('.pos-list-row').addClass('active'); + } + }) + + $(this.numeric_keypad).find('.numeric-del').click(function(){ + if(me.numeric_id) { + me.selected_field = $(me.wrapper).find('.selected-item').find('.' + me.numeric_id) + me.numeric_val = cstr(flt(me.selected_field.val())).slice(0, -1); + me.selected_field.val(me.numeric_val); + me.selected_field.trigger("change") + } else { + //Remove an item from the cart, if focus is at selected item + me.remove_selected_item() + } + }) + + $(this.numeric_keypad).find('.pos-pay').click(function(){ + me.validate(); + me.update_paid_amount_status(true); + me.create_invoice(); + me.make_payment(); + }) + }, + + remove_selected_item: function() { + this.remove_item = [] + idx = $(this.wrapper).find(".pos-selected-item-action").attr("data-idx") + this.remove_item.push(idx) + this.remove_zero_qty_items_from_cart() + this.update_paid_amount_status(false) + }, + + render_list_customers: function () { + var me = this; + + this.removed_items = []; + // this.list_customers.empty(); + this.si_docs = this.get_doc_from_localstorage(); + if (!this.si_docs.length) { + this.list_customers.find('.list-customers-table').html(""); + return; + } + + var html = ""; + if(this.si_docs.length) { + this.si_docs.forEach(function (data, i) { + for (var key in data) { + html += frappe.render_template("pos_invoice_list", { + sr: i + 1, + name: key, + customer: data[key].customer, + paid_amount: format_currency(data[key].paid_amount, me.frm.doc.currency), + grand_total: format_currency(data[key].grand_total, me.frm.doc.currency), + data: me.get_doctype_status(data[key]) + }); + } + }); + } + this.list_customers.find('.list-customers-table').html(html); + + this.list_customers.on('click', '.customer-row', function () { + me.list_customers.hide(); + me.numeric_keypad.show(); + me.list_customers_btn.toggleClass("view_customer"); + me.pos_bill.show(); + me.list_customers_btn.show(); + me.frm.doc.offline_pos_name = $(this).parents().attr('invoice-name') + me.edit_record(); + }) + + //actions + $(this.wrapper).find('.list-select-all').click(function () { + me.list_customers.find('.list-delete').prop("checked", $(this).is(":checked")) + me.removed_items = []; + if ($(this).is(":checked")) { + $.each(me.si_docs, function (index, data) { + for (key in data) { + me.removed_items.push(key) + } + }); + } + + me.toggle_delete_button(); + }); + + $(this.wrapper).find('.list-delete').click(function () { + me.frm.doc.offline_pos_name = $(this).parent().parent().attr('invoice-name'); + if ($(this).is(":checked")) { + me.removed_items.push(me.frm.doc.offline_pos_name); + } else { + me.removed_items.pop(me.frm.doc.offline_pos_name) + } + + me.toggle_delete_button(); + }); + }, + + bind_delete_event: function() { + var me = this; + + $(this.page.wrapper).on('click', '.btn-danger', function(){ + frappe.confirm(__("Delete permanently?"), function () { + me.delete_records(); + me.list_customers.find('.list-customers-table').html(""); + me.render_list_customers(); + }) + }) + }, + + set_focus: function () { + if (this.default_customer || this.frm.doc.customer) { + this.set_customer_value_in_party_field(); + this.search_item.$input.focus(); + } else { + this.party_field.$input.focus(); + } + }, + + make_customer: function () { + var me = this; + + if(!this.party_field) { + if(this.page.wrapper.find('.pos-bill-toolbar').length === 0) { + $(frappe.render_template('customer_toolbar', { + allow_delete: this.pos_profile_data["allow_delete"] + })).insertAfter(this.page.$title_area.hide()); + } + + this.party_field = frappe.ui.form.make_control({ + df: { + "fieldtype": "Data", + "options": this.party, + "label": this.party, + "fieldname": this.party.toLowerCase(), + "placeholder": __("Select or add new customer") + }, + parent: this.page.wrapper.find(".party-area"), + only_input: true, + }); + + this.party_field.make_input(); + setTimeout(this.set_focus.bind(this), 500); + me.toggle_delete_button(); + } + + this.party_field.awesomeplete = + new Awesomplete(this.party_field.$input.get(0), { + minChars: 0, + maxItems: 99, + autoFirst: true, + list: [], + filter: function (item, input) { + if (item.value.includes('is_action')) { + return true; + } + + input = input.toLowerCase(); + item = this.get_item(item.value); + result = item ? item.searchtext.includes(input) : ''; + if(!result) { + me.prepare_customer_mapper(input); + } else { + return result; + } + }, + item: function (item, input) { + var d = this.get_item(item.value); + var html = "" + __(d.label || d.value) + ""; + if(d.customer_name) { + html += '
    ' + __(d.customer_name) + ''; + } + + return $('
  • ') + .data('item.autocomplete', d) + .html('

    ' + html + '

    ') + .get(0); + } + }); + + this.prepare_customer_mapper() + this.autocomplete_customers(); + + this.party_field.$input + .on('input', function (e) { + if(me.customers_mapper.length <= 1) { + me.prepare_customer_mapper(e.target.value); + } + me.party_field.awesomeplete.list = me.customers_mapper; + }) + .on('awesomplete-select', function (e) { + var customer = me.party_field.awesomeplete + .get_item(e.originalEvent.text.value); + if (!customer) return; + // create customer link + if (customer.action) { + customer.action.apply(me); + return; + } + me.toggle_list_customer(false); + me.toggle_edit_button(true); + me.update_customer_data(customer); + me.refresh(); + me.set_focus(); + me.list_customers_btn.removeClass("view_customer"); + }) + .on('focus', function (e) { + $(e.target).val('').trigger('input'); + me.toggle_edit_button(false); + + if(me.frm.doc.items.length) { + me.toggle_list_customer(false) + me.toggle_item_cart(true) + } else { + me.toggle_list_customer(true) + me.toggle_item_cart(false) + } + }) + .on("awesomplete-selectcomplete", function (e) { + var item = me.party_field.awesomeplete + .get_item(e.originalEvent.text.value); + // clear text input if item is action + if (item.action) { + $(this).val(""); + } + me.make_item_list(item.customer_name); + }); + }, + + prepare_customer_mapper: function(key) { + var me = this; + var customer_data = ''; + + if (key) { + key = key.toLowerCase().trim(); + var re = new RegExp('%', 'g'); + var reg = new RegExp(key.replace(re, '\\w*\\s*[a-zA-Z0-9]*')); + + customer_data = $.grep(this.customers, function(data) { + contact = me.contacts[data.name]; + if(reg.test(data.name.toLowerCase()) + || reg.test(data.customer_name.toLowerCase()) + || (contact && reg.test(contact["mobile_no"])) + || (contact && reg.test(contact["phone"])) + || (data.customer_group && reg.test(data.customer_group.toLowerCase()))){ + return data; + } + }) + } else { + customer_data = this.customers; + } + + this.customers_mapper = []; + + customer_data.forEach(function (c, index) { + if(index < 30) { + contact = me.contacts[c.name]; + if(contact && !c['phone']) { + c["phone"] = contact["phone"]; + c["email_id"] = contact["email_id"]; + c["mobile_no"] = contact["mobile_no"]; + } + + me.customers_mapper.push({ + label: c.name, + value: c.name, + customer_name: c.customer_name, + customer_group: c.customer_group, + territory: c.territory, + phone: contact ? contact["phone"] : '', + mobile_no: contact ? contact["mobile_no"] : '', + email_id: contact ? contact["email_id"] : '', + searchtext: ['customer_name', 'customer_group', 'name', 'value', + 'label', 'email_id', 'phone', 'mobile_no'] + .map(key => c[key]).join(' ') + .toLowerCase() + }); + } else { + return; + } + }); + + this.customers_mapper.push({ + label: "" + + " " + + __("Create a new Customer") + + "", + value: 'is_action', + action: me.add_customer + }); + }, + + autocomplete_customers: function() { + this.party_field.awesomeplete.list = this.customers_mapper; + }, + + toggle_edit_button: function(flag) { + this.page.wrapper.find('.edit-customer-btn').toggle(flag); + }, + + toggle_list_customer: function(flag) { + this.list_customers.toggle(flag); + }, + + toggle_item_cart: function(flag) { + this.wrapper.find('.pos-bill-wrapper').toggle(flag); + }, + + add_customer: function() { + this.frm.doc.customer = ""; + this.update_customer(true); + this.numeric_keypad.show(); + }, + + update_customer: function (new_customer) { + var me = this; + + this.customer_doc = new frappe.ui.Dialog({ + 'title': 'Customer', + fields: [ + { + "label": __("Full Name"), + "fieldname": "full_name", + "fieldtype": "Data", + "reqd": 1 + }, + { + "fieldtype": "Section Break" + }, + { + "label": __("Email Id"), + "fieldname": "email_id", + "fieldtype": "Data" + }, + { + "fieldtype": "Column Break" + }, + { + "label": __("Contact Number"), + "fieldname": "phone", + "fieldtype": "Data" + }, + { + "fieldtype": "Section Break" + }, + { + "label": __("Address Name"), + "read_only": 1, + "fieldname": "name", + "fieldtype": "Data" + }, + { + "label": __("Address Line 1"), + "fieldname": "address_line1", + "fieldtype": "Data" + }, + { + "label": __("Address Line 2"), + "fieldname": "address_line2", + "fieldtype": "Data" + }, + { + "fieldtype": "Column Break" + }, + { + "label": __("City"), + "fieldname": "city", + "fieldtype": "Data" + }, + { + "label": __("State"), + "fieldname": "state", + "fieldtype": "Data" + }, + { + "label": __("ZIP Code"), + "fieldname": "pincode", + "fieldtype": "Data" + }, + { + "label": __("Customer POS Id"), + "fieldname": "customer_pos_id", + "fieldtype": "Data", + "hidden": 1 + } + ] + }) + this.customer_doc.show() + this.render_address_data() + + this.customer_doc.set_primary_action(__("Save"), function () { + me.make_offline_customer(new_customer); + me.pos_bill.show(); + me.list_customers.hide(); + }); + }, + + render_address_data: function() { + var me = this; + this.address_data = this.address[this.frm.doc.customer] || {}; + if(!this.address_data.email_id || !this.address_data.phone) { + this.address_data = this.contacts[this.frm.doc.customer]; + } + + this.customer_doc.set_values(this.address_data) + if(!this.customer_doc.fields_dict.full_name.$input.val()) { + this.customer_doc.set_value("full_name", this.frm.doc.customer) + } + + if(!this.customer_doc.fields_dict.customer_pos_id.value) { + this.customer_doc.set_value("customer_pos_id", $.now()) + } + }, + + get_address_from_localstorage: function() { + this.address_details = this.get_customers_details() + return this.address_details[this.frm.doc.customer] + }, + + make_offline_customer: function(new_customer) { + this.frm.doc.customer = this.frm.doc.customer || this.customer_doc.get_values().full_name; + this.frm.doc.customer_pos_id = this.customer_doc.fields_dict.customer_pos_id.value; + this.customer_details = this.get_customers_details(); + this.customer_details[this.frm.doc.customer] = this.get_prompt_details(); + this.party_field.$input.val(this.frm.doc.customer); + this.update_address_and_customer_list(new_customer) + this.autocomplete_customers(); + this.update_customer_in_localstorage() + this.update_customer_in_localstorage() + this.customer_doc.hide() + }, + + update_address_and_customer_list: function(new_customer) { + var me = this; + if(new_customer) { + this.customers_mapper.push({ + label: this.frm.doc.customer, + value: this.frm.doc.customer, + customer_group: "", + territory: "" + }); + } + + this.address[this.frm.doc.customer] = JSON.parse(this.get_prompt_details()) + }, + + get_prompt_details: function() { + this.prompt_details = this.customer_doc.get_values(); + this.prompt_details['country'] = this.pos_profile_data.country; + this.prompt_details['territory'] = this.pos_profile_data["territory"]; + this.prompt_details['customer_group'] = this.pos_profile_data["customer_group"]; + this.prompt_details['customer_pos_id'] = this.customer_doc.fields_dict.customer_pos_id.value; + return JSON.stringify(this.prompt_details) + }, + + update_customer_data: function (doc) { + var me = this; + this.frm.doc.customer = doc.label || doc.name; + this.frm.doc.customer_name = doc.customer_name; + this.frm.doc.customer_group = doc.customer_group; + this.frm.doc.territory = doc.territory; + this.pos_bill.show(); + this.numeric_keypad.show(); + }, + + make_item_list: function (customer) { + var me = this; + if (!this.price_list) { + frappe.msgprint(__("Price List not found or disabled")); + return; + } + + me.item_timeout = null; + + var $wrap = me.wrapper.find(".item-list"); + me.wrapper.find(".item-list").empty(); + + if (this.items.length > 0) { + $.each(this.items, function(index, obj) { + let customer_price_list = me.customer_wise_price_list[customer]; + let item_price + if (customer && customer_price_list && customer_price_list[obj.name]) { + item_price = format_currency(customer_price_list[obj.name], me.frm.doc.currency); + } else { + item_price = format_currency(me.price_list_data[obj.name], me.frm.doc.currency); + } + if(index < me.page_len) { + $(frappe.render_template("pos_item", { + item_code: obj.name, + item_price: item_price, + item_name: obj.name === obj.item_name ? "" : obj.item_name, + item_image: obj.image, + item_stock: __('Stock Qty') + ": " + me.get_actual_qty(obj), + item_uom: obj.stock_uom, + color: frappe.get_palette(obj.item_name), + abbr: frappe.get_abbr(obj.item_name) + })).tooltip().appendTo($wrap); + } + }); + + $wrap.append(` +
    +
    + +
    Load more items
    +
    +
    + `); + + me.toggle_more_btn(); + } else { + $("

    " + +__("Not items found")+"

    ").appendTo($wrap) + } + + if (this.items.length == 1 + && this.search_item.$input.val()) { + this.search_item.$input.val(""); + this.add_to_cart(); + } + }, + + get_items: function (item_code) { + // To search item as per the key enter + + var me = this; + this.item_serial_no = {}; + this.item_batch_no = {}; + + if (item_code) { + return $.grep(this.item_data, function (item) { + if (item.item_code == item_code) { + return true + } + }) + } + + this.items_list = this.apply_category(); + + key = this.search_item.$input.val().toLowerCase().replace(/[&\/\\#,+()\[\]$~.'":*?<>{}]/g, '\\$&'); + var re = new RegExp('%', 'g'); + var reg = new RegExp(key.replace(re, '[\\w*\\s*[a-zA-Z0-9]*]*')) + search_status = true + + if (key) { + return $.grep(this.items_list, function (item) { + if (search_status) { + if (in_list(me.batch_no_data[item.item_code], me.search_item.$input.val())) { + search_status = false; + return me.item_batch_no[item.item_code] = me.search_item.$input.val() + } else if (me.serial_no_data[item.item_code] + && in_list(Object.keys(me.serial_no_data[item.item_code]), me.search_item.$input.val())) { + search_status = false; + me.item_serial_no[item.item_code] = [me.search_item.$input.val(), me.serial_no_data[item.item_code][me.search_item.$input.val()]] + return true + } else if (in_list(me.barcode_data[item.item_code], me.search_item.$input.val())) { + search_status = false; + return true; + } else if (reg.test(item.item_code.toLowerCase()) || (item.description && reg.test(item.description.toLowerCase())) || + reg.test(item.item_name.toLowerCase()) || reg.test(item.item_group.toLowerCase())) { + return true + } + } + }) + } else { + return this.items_list; + } + }, + + apply_category: function() { + var me = this; + category = this.selected_item_group || "All Item Groups"; + if(category == 'All Item Groups') { + return this.item_data + } else { + return this.item_data.filter(function(element, index, array){ + return element.item_group == category; + }); + } + }, + + bind_items_event: function() { + var me = this; + $(this.wrapper).on('click', '.pos-bill-item', function() { + $(me.wrapper).find('.pos-bill-item').removeClass('active'); + $(this).addClass('active'); + me.numeric_val = ""; + me.numeric_id = "" + me.item_code = $(this).attr("data-item-code"); + me.render_selected_item() + me.bind_qty_event() + me.update_rate() + $(me.wrapper).find(".selected-item").scrollTop(1000); + }) + }, + + bind_qty_event: function () { + var me = this; + + $(this.wrapper).on("change", ".pos-item-qty", function () { + var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code"); + var qty = $(this).val(); + me.update_qty(item_code, qty); + me.update_value(); + }) + + $(this.wrapper).on("focusout", ".pos-item-qty", function () { + var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code"); + var qty = $(this).val(); + me.update_qty(item_code, qty, true); + me.update_value(); + }) + + $(this.wrapper).find("[data-action='increase-qty']").on("click", function () { + var item_code = $(this).parents(".pos-bill-item").attr("data-item-code"); + var qty = flt($(this).parents(".pos-bill-item").find('.pos-item-qty').val()) + 1; + me.update_qty(item_code, qty); + }) + + $(this.wrapper).find("[data-action='decrease-qty']").on("click", function () { + var item_code = $(this).parents(".pos-bill-item").attr("data-item-code"); + var qty = flt($(this).parents(".pos-bill-item").find('.pos-item-qty').val()) - 1; + me.update_qty(item_code, qty); + }) + + $(this.wrapper).on("change", ".pos-item-disc", function () { + var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code"); + var discount = $(this).val(); + if(discount > 100){ + discount = $(this).val(''); + frappe.show_alert({ + indicator: 'red', + message: __('Discount amount cannot be greater than 100%') + }); + me.update_discount(item_code, discount); + }else{ + me.update_discount(item_code, discount); + me.update_value(); + } + }) + }, + + bind_events: function() { + var me = this; + // if form is local then allow this function + // $(me.wrapper).find(".pos-item-wrapper").on("click", function () { + $(this.wrapper).on("click", ".pos-item-wrapper", function () { + me.item_code = ''; + me.customer_validate(); + if($(me.pos_bill).is(":hidden")) return; + + if (me.frm.doc.docstatus == 0) { + me.items = me.get_items($(this).attr("data-item-code")) + me.add_to_cart(); + me.clear_selected_row(); + } + }); + + me.bind_delete_event() + }, + + update_qty: function (item_code, qty, remove_zero_qty_items) { + var me = this; + this.items = this.get_items(item_code); + this.validate_serial_no() + this.set_item_details(item_code, "qty", qty, remove_zero_qty_items); + }, + + update_discount: function(item_code, discount) { + var me = this; + this.items = this.get_items(item_code); + this.set_item_details(item_code, "discount_percentage", discount); + }, + + update_rate: function () { + var me = this; + $(this.wrapper).on("change", ".pos-item-price", function () { + var item_code = $(this).parents(".pos-selected-item-action").attr("data-item-code"); + me.set_item_details(item_code, "rate", $(this).val()); + me.update_value() + }) + }, + + update_value: function() { + var me = this; + var fields = {qty: ".pos-item-qty", "discount_percentage": ".pos-item-disc", + "rate": ".pos-item-price", "amount": ".pos-amount"} + this.child_doc = this.get_child_item(this.item_code); + + if(me.child_doc.length) { + $.each(fields, function(key, field) { + $(me.selected_row).find(field).val(me.child_doc[0][key]) + }) + } else { + this.clear_selected_row(); + } + }, + + clear_selected_row: function() { + $(this.wrapper).find('.selected-item').empty(); + }, + + render_selected_item: function() { + this.child_doc = this.get_child_item(this.item_code); + $(this.wrapper).find('.selected-item').empty(); + if(this.child_doc.length) { + this.child_doc[0]["allow_user_to_edit_rate"] = this.pos_profile_data["allow_user_to_edit_rate"] ? true : false, + this.child_doc[0]["allow_user_to_edit_discount"] = this.pos_profile_data["allow_user_to_edit_discount"] ? true : false; + this.selected_row = $(frappe.render_template("pos_selected_item", this.child_doc[0])) + $(this.wrapper).find('.selected-item').html(this.selected_row) + } + + $(this.selected_row).find('.form-control').click(function(){ + $(this).select(); + }) + }, + + get_child_item: function(item_code) { + var me = this; + return $.map(me.frm.doc.items, function(doc){ + if(doc.item_code == item_code) { + return doc + } + }) + }, + + set_item_details: function (item_code, field, value, remove_zero_qty_items) { + var me = this; + if (value < 0) { + frappe.throw(__("Enter value must be positive")); + } + + this.remove_item = [] + $.each(this.frm.doc["items"] || [], function (i, d) { + if (d.item_code == item_code) { + if (d.serial_no && field == 'qty') { + me.validate_serial_no_qty(d, item_code, field, value) + } + + d[field] = flt(value); + d.amount = flt(d.rate) * flt(d.qty); + if (d.qty == 0 && remove_zero_qty_items) { + me.remove_item.push(d.idx) + } + + if(field=="discount_percentage" && value == 0) { + d.rate = d.price_list_rate; + } + } + }); + + if (field == 'qty') { + this.remove_zero_qty_items_from_cart(); + } + + this.update_paid_amount_status(false) + }, + + remove_zero_qty_items_from_cart: function () { + var me = this; + var idx = 0; + this.items = [] + $.each(this.frm.doc["items"] || [], function (i, d) { + if (!in_list(me.remove_item, d.idx)) { + d.idx = idx; + me.items.push(d); + idx++; + } + }); + + this.frm.doc["items"] = this.items; + }, + + make_discount_field: function () { + var me = this; + + this.wrapper.find('input.discount-percentage').on("change", function () { + me.frm.doc.additional_discount_percentage = flt($(this).val(), precision("additional_discount_percentage")); + + if(me.frm.doc.additional_discount_percentage && me.frm.doc.discount_amount) { + // Reset discount amount + me.frm.doc.discount_amount = 0; + } + + var total = me.frm.doc.grand_total + + if (me.frm.doc.apply_discount_on == 'Net Total') { + total = me.frm.doc.net_total + } + + me.frm.doc.discount_amount = flt(total * flt(me.frm.doc.additional_discount_percentage) / 100, precision("discount_amount")); + me.refresh(); + me.wrapper.find('input.discount-amount').val(me.frm.doc.discount_amount) + }); + + this.wrapper.find('input.discount-amount').on("change", function () { + me.frm.doc.discount_amount = flt($(this).val(), precision("discount_amount")); + me.frm.doc.additional_discount_percentage = 0.0; + me.refresh(); + me.wrapper.find('input.discount-percentage').val(0); + }); + }, + + customer_validate: function () { + var me = this; + if (!this.frm.doc.customer || this.party_field.get_value() == "") { + frappe.throw(__("Please select customer")) + } + }, + + add_to_cart: function () { + var me = this; + var caught = false; + var no_of_items = me.wrapper.find(".pos-bill-item").length; + + this.customer_validate(); + this.mandatory_batch_no(); + this.validate_serial_no(); + this.validate_warehouse(); + + if (no_of_items != 0) { + $.each(this.frm.doc["items"] || [], function (i, d) { + if (d.item_code == me.items[0].item_code) { + caught = true; + d.qty += 1; + d.amount = flt(d.rate) * flt(d.qty); + if (me.item_serial_no[d.item_code]) { + d.serial_no += '\n' + me.item_serial_no[d.item_code][0] + d.warehouse = me.item_serial_no[d.item_code][1] + } + + if (me.item_batch_no.length) { + d.batch_no = me.item_batch_no[d.item_code] + } + } + }); + } + + // if item not found then add new item + if (!caught) + this.add_new_item_to_grid(); + + this.update_paid_amount_status(false) + this.wrapper.find(".item-cart-items").scrollTop(1000); + }, + + add_new_item_to_grid: function () { + var me = this; + this.child = frappe.model.add_child(this.frm.doc, this.frm.doc.doctype + " Item", "items"); + this.child.item_code = this.items[0].item_code; + this.child.item_name = this.items[0].item_name; + this.child.stock_uom = this.items[0].stock_uom; + this.child.uom = this.items[0].sales_uom || this.items[0].stock_uom; + this.child.conversion_factor = this.items[0].conversion_factor || 1; + this.child.brand = this.items[0].brand; + this.child.description = this.items[0].description || this.items[0].item_name; + this.child.discount_percentage = 0.0; + this.child.qty = 1; + this.child.item_group = this.items[0].item_group; + this.child.cost_center = this.pos_profile_data['cost_center'] || this.items[0].cost_center; + this.child.income_account = this.pos_profile_data['income_account'] || this.items[0].income_account; + this.child.warehouse = (this.item_serial_no[this.child.item_code] + ? this.item_serial_no[this.child.item_code][1] : (this.pos_profile_data['warehouse'] || this.items[0].default_warehouse)); + + customer = this.frm.doc.customer; + let rate; + + customer_price_list = this.customer_wise_price_list[customer] + if (customer_price_list && customer_price_list[this.child.item_code]){ + rate = flt(this.customer_wise_price_list[customer][this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9); + } + else{ + rate = flt(this.price_list_data[this.child.item_code] * this.child.conversion_factor, 9) / flt(this.frm.doc.conversion_rate, 9); + } + + this.child.price_list_rate = rate; + this.child.rate = rate; + this.child.actual_qty = me.get_actual_qty(this.items[0]); + this.child.amount = flt(this.child.qty) * flt(this.child.rate); + this.child.batch_no = this.item_batch_no[this.child.item_code]; + this.child.serial_no = (this.item_serial_no[this.child.item_code] + ? this.item_serial_no[this.child.item_code][0] : ''); + this.child.item_tax_rate = JSON.stringify(this.tax_data[this.child.item_code]); + }, + + update_paid_amount_status: function (update_paid_amount) { + if (this.frm.doc.offline_pos_name) { + update_paid_amount = update_paid_amount ? false : true; + } + + this.refresh(update_paid_amount); + }, + + refresh: function (update_paid_amount) { + var me = this; + this.refresh_fields(update_paid_amount); + this.set_primary_action(); + }, + + refresh_fields: function (update_paid_amount) { + this.apply_pricing_rule(); + this.discount_amount_applied = false; + this._calculate_taxes_and_totals(); + this.calculate_discount_amount(); + this.show_items_in_item_cart(); + this.set_taxes(); + this.calculate_outstanding_amount(update_paid_amount); + this.set_totals(); + this.update_total_qty(); + }, + + get_company_currency: function () { + return erpnext.get_currency(this.frm.doc.company); + }, + + show_items_in_item_cart: function () { + var me = this; + var $items = this.wrapper.find(".items").empty(); + var $no_items_message = this.wrapper.find(".no-items-message"); + $no_items_message.toggle(this.frm.doc.items.length === 0); + + var $totals_area = this.wrapper.find('.totals-area'); + $totals_area.toggle(this.frm.doc.items.length > 0); + + $.each(this.frm.doc.items || [], function (i, d) { + $(frappe.render_template("pos_bill_item_new", { + item_code: d.item_code, + item_name: (d.item_name === d.item_code || !d.item_name) ? "" : ("
    " + d.item_name), + qty: d.qty, + discount_percentage: d.discount_percentage || 0.0, + actual_qty: me.actual_qty_dict[d.item_code] || 0.0, + projected_qty: d.projected_qty, + rate: format_currency(d.rate, me.frm.doc.currency), + amount: format_currency(d.amount, me.frm.doc.currency), + selected_class: (me.item_code == d.item_code) ? "active" : "" + })).appendTo($items); + }); + + this.wrapper.find("input.pos-item-qty").on("focus", function () { + $(this).select(); + }); + + this.wrapper.find("input.pos-item-disc").on("focus", function () { + $(this).select(); + }); + + this.wrapper.find("input.pos-item-price").on("focus", function () { + $(this).select(); + }); + }, + + set_taxes: function () { + var me = this; + me.frm.doc.total_taxes_and_charges = 0.0 + + var taxes = this.frm.doc.taxes || []; + $(this.wrapper) + .find(".tax-area").toggleClass("hide", (taxes && taxes.length) ? false : true) + .find(".tax-table").empty(); + + $.each(taxes, function (i, d) { + if (d.tax_amount && cint(d.included_in_print_rate) == 0) { + $(frappe.render_template("pos_tax_row", { + description: d.description, + tax_amount: format_currency(flt(d.tax_amount_after_discount_amount), + me.frm.doc.currency) + })).appendTo(me.wrapper.find(".tax-table")); + } + }); + }, + + set_totals: function () { + var me = this; + this.wrapper.find(".net-total").text(format_currency(me.frm.doc.total, me.frm.doc.currency)); + this.wrapper.find(".grand-total").text(format_currency(me.frm.doc.grand_total, me.frm.doc.currency)); + this.wrapper.find('input.discount-percentage').val(this.frm.doc.additional_discount_percentage); + this.wrapper.find('input.discount-amount').val(this.frm.doc.discount_amount); + }, + + update_total_qty: function() { + var me = this; + var qty_total = 0; + $.each(this.frm.doc["items"] || [], function (i, d) { + if (d.item_code) { + qty_total += d.qty; + } + }); + this.frm.doc.qty_total = qty_total; + this.wrapper.find('.qty-total').text(this.frm.doc.qty_total); + }, + + set_primary_action: function () { + var me = this; + this.page.set_primary_action(__("New Cart"), function () { + me.make_new_cart() + me.make_menu_list() + }, "fa fa-plus") + + if (this.frm.doc.docstatus == 1 || this.pos_profile_data["allow_print_before_pay"]) { + this.page.set_secondary_action(__("Print"), function () { + me.create_invoice(); + var html = frappe.render(me.print_template_data, me.frm.doc) + me.print_document(html) + }) + } + + if (this.frm.doc.docstatus == 1) { + this.page.add_menu_item(__("Email"), function () { + me.email_prompt() + }) + } + }, + + make_new_cart: function (){ + this.item_code = ''; + this.page.clear_secondary_action(); + this.save_previous_entry(); + this.create_new(); + this.refresh(); + this.toggle_input_field(); + this.render_list_customers(); + this.set_focus(); + }, + + print_dialog: function () { + var me = this; + + this.msgprint = frappe.msgprint( + `${__('Print')} + ${__('New')}`); + + this.msgprint.msg_area.find('.print_doc').on('click', function() { + var html = frappe.render(me.print_template_data, me.frm.doc); + me.print_document(html); + }) + + this.msgprint.msg_area.find('.new_doc').on('click', function() { + me.msgprint.hide(); + me.make_new_cart(); + }) + + }, + + print_document: function (html) { + var w = window.open(); + w.document.write(html); + w.document.close(); + setTimeout(function () { + w.print(); + w.close(); + }, 1000) + }, + + submit_invoice: function () { + var me = this; + this.change_status(); + this.update_serial_no() + if (this.frm.doc.docstatus == 1) { + this.print_dialog() + } + }, + + update_serial_no: function() { + var me = this; + + //Remove the sold serial no from the cache + $.each(this.frm.doc.items, function(index, data) { + var sn = data.serial_no.split('\n') + if(sn.length) { + var serial_no_list = me.serial_no_data[data.item_code] + if(serial_no_list) { + $.each(sn, function(i, serial_no) { + if(in_list(Object.keys(serial_no_list), serial_no)) { + delete serial_no_list[serial_no] + } + }) + me.serial_no_data[data.item_code] = serial_no_list; + } + } + }) + }, + + change_status: function () { + if (this.frm.doc.docstatus == 0) { + this.frm.doc.docstatus = 1; + this.update_invoice(); + this.toggle_input_field(); + } + }, + + toggle_input_field: function () { + var pointer_events = 'inherit' + var disabled = this.frm.doc.docstatus == 1 ? true: false; + $(this.wrapper).find('input').attr("disabled", disabled); + $(this.wrapper).find('select').attr("disabled", disabled); + $(this.wrapper).find('input').attr("disabled", disabled); + $(this.wrapper).find('select').attr("disabled", disabled); + $(this.wrapper).find('button').attr("disabled", disabled); + this.party_field.$input.attr('disabled', disabled); + + if (this.frm.doc.docstatus == 1) { + pointer_events = 'none'; + } + + $(this.wrapper).find('.pos-bill').css('pointer-events', pointer_events); + $(this.wrapper).find('.pos-items-section').css('pointer-events', pointer_events); + this.set_primary_action(); + }, + + create_invoice: function () { + var me = this; + var invoice_data = {}; + this.si_docs = this.get_doc_from_localstorage(); + + if (this.frm.doc.offline_pos_name) { + this.update_invoice() + //to retrieve and set the default payment + invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc; + invoice_data[this.frm.doc.offline_pos_name].payments[0].amount = this.frm.doc.net_total + invoice_data[this.frm.doc.offline_pos_name].payments[0].base_amount = this.frm.doc.net_total + + this.frm.doc.paid_amount = this.frm.doc.net_total + this.frm.doc.outstanding_amount = 0 + } else { + this.frm.doc.offline_pos_name = $.now(); + this.frm.doc.posting_date = frappe.datetime.get_today(); + this.frm.doc.posting_time = frappe.datetime.now_time(); + this.frm.doc.pos_total_qty = this.frm.doc.qty_total; + this.frm.doc.pos_profile = this.pos_profile_data['name']; + invoice_data[this.frm.doc.offline_pos_name] = this.frm.doc; + this.si_docs.push(invoice_data); + this.update_localstorage(); + this.set_primary_action(); + } + return invoice_data; + }, + + update_invoice: function () { + var me = this; + this.si_docs = this.get_doc_from_localstorage(); + $.each(this.si_docs, function (index, data) { + for (var key in data) { + if (key == me.frm.doc.offline_pos_name) { + me.si_docs[index][key] = me.frm.doc; + me.update_localstorage(); + } + } + }); + }, + + update_localstorage: function () { + try { + localStorage.setItem('sales_invoice_doc', JSON.stringify(this.si_docs)); + } catch (e) { + frappe.throw(__("LocalStorage is full , did not save")) + } + }, + + get_doc_from_localstorage: function () { + try { + return JSON.parse(localStorage.getItem('sales_invoice_doc')) || []; + } catch (e) { + return [] + } + }, + + set_interval_for_si_sync: function () { + var me = this; + setInterval(function () { + me.freeze_screen = false; + me.sync_sales_invoice() + }, 180000) + }, + + sync_sales_invoice: function () { + var me = this; + this.si_docs = this.get_submitted_invoice() || []; + this.email_queue_list = this.get_email_queue() || {}; + this.customers_list = this.get_customers_details() || {}; + if(this.customer_doc) { + this.freeze = this.customer_doc.display + } + + freeze_screen = this.freeze_screen || false; + + if ((this.si_docs.length || this.email_queue_list || this.customers_list) && !this.freeze) { + this.freeze = true; + + frappe.call({ + method: "erpnext.accounts.doctype.sales_invoice.pos.make_invoice", + freeze: freeze_screen, + args: { + doc_list: me.si_docs, + email_queue_list: me.email_queue_list, + customers_list: me.customers_list + }, + callback: function (r) { + if (r.message) { + me.freeze = false; + me.customers = r.message.synced_customers_list; + me.address = r.message.synced_address; + me.contacts = r.message.synced_contacts; + me.removed_items = r.message.invoice; + me.removed_email = r.message.email_queue; + me.removed_customers = r.message.customers; + me.remove_doc_from_localstorage(); + me.remove_email_queue_from_localstorage(); + me.remove_customer_from_localstorage(); + me.prepare_customer_mapper(); + me.autocomplete_customers(); + me.render_list_customers(); + } + } + }) + } + }, + + get_submitted_invoice: function () { + var invoices = []; + var index = 1; + var docs = this.get_doc_from_localstorage(); + if (docs) { + invoices = $.map(docs, function (data) { + for (var key in data) { + if (data[key].docstatus == 1 && index < 50) { + index++ + data[key].docstatus = 0; + return data + } + } + }); + } + + return invoices + }, + + remove_doc_from_localstorage: function () { + var me = this; + this.si_docs = this.get_doc_from_localstorage(); + this.new_si_docs = []; + if (this.removed_items) { + $.each(this.si_docs, function (index, data) { + for (var key in data) { + if (!in_list(me.removed_items, key)) { + me.new_si_docs.push(data); + } + } + }) + this.removed_items = []; + this.si_docs = this.new_si_docs; + this.update_localstorage(); + } + }, + + remove_email_queue_from_localstorage: function() { + var me = this; + this.email_queue = this.get_email_queue() + if (this.removed_email) { + $.each(this.email_queue_list, function (index, data) { + if (in_list(me.removed_email, index)) { + delete me.email_queue[index] + } + }) + this.update_email_queue(); + } + }, + + remove_customer_from_localstorage: function() { + var me = this; + this.customer_details = this.get_customers_details() + if (this.removed_customers) { + $.each(this.customers_list, function (index, data) { + if (in_list(me.removed_customers, index)) { + delete me.customer_details[index] + } + }) + this.update_customer_in_localstorage(); + } + }, + + validate: function () { + var me = this; + this.customer_validate(); + this.validate_zero_qty_items(); + this.item_validate(); + this.validate_mode_of_payments(); + }, + + validate_zero_qty_items: function() { + this.remove_item = []; + + this.frm.doc.items.forEach(d => { + if (d.qty == 0) { + this.remove_item.push(d.idx); + } + }); + + if(this.remove_item) { + this.remove_zero_qty_items_from_cart(); + } + }, + + item_validate: function () { + if (this.frm.doc.items.length == 0) { + frappe.throw(__("Select items to save the invoice")) + } + }, + + validate_mode_of_payments: function () { + if (this.frm.doc.payments.length === 0) { + frappe.throw(__("Payment Mode is not configured. Please check, whether account has been set on Mode of Payments or on POS Profile.")) + } + }, + + validate_serial_no: function () { + var me = this; + var item_code = '' + var serial_no = ''; + for (var key in this.item_serial_no) { + item_code = key; + serial_no = me.item_serial_no[key][0]; + } + + if (this.items[0].has_serial_no && serial_no == "") { + this.refresh(); + frappe.throw(__(repl("Error: Serial no is mandatory for item %(item)s", { + 'item': this.items[0].item_code + }))) + } + + if (item_code && serial_no) { + $.each(this.frm.doc.items, function (index, data) { + if (data.item_code == item_code) { + if (in_list(data.serial_no.split('\n'), serial_no)) { + frappe.throw(__(repl("Serial no %(serial_no)s is already taken", { + 'serial_no': serial_no + }))) + } + } + }) + } + }, + + validate_serial_no_qty: function (args, item_code, field, value) { + var me = this; + if (args.item_code == item_code && args.serial_no + && field == 'qty' && cint(value) != value) { + args.qty = 0.0; + this.refresh(); + frappe.throw(__("Serial no item cannot be a fraction")) + } + + if (args.item_code == item_code && args.serial_no && args.serial_no.split('\n').length != cint(value)) { + args.qty = 0.0; + args.serial_no = '' + this.refresh(); + frappe.throw(__(repl("Total nos of serial no is not equal to quantity for item %(item)s.", { + 'item': item_code + }))) + } + }, + + mandatory_batch_no: function () { + var me = this; + if (this.items[0].has_batch_no && !this.item_batch_no[this.items[0].item_code]) { + frappe.prompt([{ + 'fieldname': 'batch', + 'fieldtype': 'Select', + 'label': __('Batch No'), + 'reqd': 1, + 'options': this.batch_no_data[this.items[0].item_code] + }], + function(values){ + me.item_batch_no[me.items[0].item_code] = values.batch; + }, + __('Select Batch No')) + } + }, + + apply_pricing_rule: function () { + var me = this; + $.each(this.frm.doc["items"], function (n, item) { + var pricing_rule = me.get_pricing_rule(item) + me.validate_pricing_rule(pricing_rule) + if (pricing_rule.length) { + item.pricing_rule = pricing_rule[0].name; + item.margin_type = pricing_rule[0].margin_type; + item.price_list_rate = pricing_rule[0].price || item.price_list_rate; + item.margin_rate_or_amount = pricing_rule[0].margin_rate_or_amount; + item.discount_percentage = pricing_rule[0].discount_percentage || 0.0; + me.apply_pricing_rule_on_item(item) + } else if (item.pricing_rule) { + item.price_list_rate = me.price_list_data[item.item_code] + item.margin_rate_or_amount = 0.0; + item.discount_percentage = 0.0; + item.pricing_rule = null; + me.apply_pricing_rule_on_item(item) + } + + if(item.discount_percentage > 0) { + me.apply_pricing_rule_on_item(item) + } + }) + }, + + get_pricing_rule: function (item) { + var me = this; + return $.grep(this.pricing_rules, function (data) { + if (item.qty >= data.min_qty && (item.qty <= (data.max_qty ? data.max_qty : item.qty))) { + if (me.validate_item_condition(data, item)) { + if (in_list(['Customer', 'Customer Group', 'Territory', 'Campaign'], data.applicable_for)) { + return me.validate_condition(data) + } else { + return true + } + } + } + }) + }, + + validate_item_condition: function (data, item) { + var apply_on = frappe.model.scrub(data.apply_on); + + return (data.apply_on == 'Item Group') + ? this.validate_item_group(data.item_group, item.item_group) : (data[apply_on] == item[apply_on]); + }, + + validate_item_group: function (pr_item_group, cart_item_group) { + //pr_item_group = pricing rule's item group + //cart_item_group = cart item's item group + //this.item_groups has information about item group's lft and rgt + //for example: {'Foods': [12, 19]} + + pr_item_group = this.item_groups[pr_item_group] + cart_item_group = this.item_groups[cart_item_group] + + return (cart_item_group[0] >= pr_item_group[0] && + cart_item_group[1] <= pr_item_group[1]) + }, + + validate_condition: function (data) { + //This method check condition based on applicable for + var condition = this.get_mapper_for_pricing_rule(data)[data.applicable_for] + if (in_list(condition[1], condition[0])) { + return true + } + }, + + get_mapper_for_pricing_rule: function (data) { + return { + 'Customer': [data.customer, [this.frm.doc.customer]], + 'Customer Group': [data.customer_group, [this.frm.doc.customer_group, 'All Customer Groups']], + 'Territory': [data.territory, [this.frm.doc.territory, 'All Territories']], + 'Campaign': [data.campaign, [this.frm.doc.campaign]], + } + }, + + validate_pricing_rule: function (pricing_rule) { + //This method validate duplicate pricing rule + var pricing_rule_name = ''; + var priority = 0; + var pricing_rule_list = []; + var priority_list = [] + + if (pricing_rule.length > 1) { + + $.each(pricing_rule, function (index, data) { + pricing_rule_name += data.name + ',' + priority_list.push(data.priority) + if (priority <= data.priority) { + priority = data.priority + pricing_rule_list.push(data) + } + }) + + var count = 0 + $.each(priority_list, function (index, value) { + if (value == priority) { + count++ + } + }) + + if (priority == 0 || count > 1) { + frappe.throw(__(repl("Multiple Price Rules exists with same criteria, please resolve conflict by assigning priority. Price Rules: %(pricing_rule)s", { + 'pricing_rule': pricing_rule_name + }))) + } + + return pricing_rule_list + } + }, + + validate_warehouse: function () { + if (this.items[0].is_stock_item && !this.items[0].default_warehouse && !this.pos_profile_data['warehouse']) { + frappe.throw(__("Default warehouse is required for selected item")) + } + }, + + get_actual_qty: function (item) { + this.actual_qty = 0.0; + + var warehouse = this.pos_profile_data['warehouse'] || item.default_warehouse; + if (warehouse && this.bin_data[item.item_code]) { + this.actual_qty = this.bin_data[item.item_code][warehouse] || 0; + this.actual_qty_dict[item.item_code] = this.actual_qty + } + + return this.actual_qty + }, + + update_customer_in_localstorage: function() { + var me = this; + try { + localStorage.setItem('customer_details', JSON.stringify(this.customer_details)); + } catch (e) { + frappe.throw(__("LocalStorage is full , did not save")) + } + } +}) \ No newline at end of file diff --git a/propms/pos.py b/propms/pos.py new file mode 100644 index 0000000..37ebcd4 --- /dev/null +++ b/propms/pos.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals +import frappe + + +@frappe.whitelist() +def get_pos_data(cost_center): + property = frappe.get_list("Property", filters={"cost_center": cost_center}) + lease = None + one_lease = None + if property: + lease = frappe.get_all( + "Lease", + filters={"property": property[0].name}, + fields=["*"], + order_by="end_date desc", + ) + if lease: + one_lease = frappe.get_doc("Lease", lease[0].name) + return one_lease diff --git a/propms/property_management_solution/__init__.py b/propms/property_management_solution/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/company.js b/propms/property_management_solution/company.js new file mode 100644 index 0000000..7806de4 --- /dev/null +++ b/propms/property_management_solution/company.js @@ -0,0 +1,35 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Company', { + setup: function(frm) { + frm.set_query("security_account_code", function() { + return { + "filters": [ + ["company","=", frm.doc.name], + ] + }; + }); + frm.set_query("default_tax_account_head", function() { + return { + "filters": [ + ["company","=", frm.doc.name], + ] + }; + }); + frm.set_query("default_tax_template", function() { + return { + "filters": [ + ["company","=", frm.doc.name], + ] + }; + }); + frm.set_query("default_maintenance_tax_template", function() { + return { + "filters": [ + ["company","=", frm.doc.name], + ] + }; + }); + }, +}); diff --git a/propms/property_management_solution/doctype/__init__.py b/propms/property_management_solution/doctype/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/apartment_status/__init__.py b/propms/property_management_solution/doctype/apartment_status/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/apartment_status/apartment_status.js b/propms/property_management_solution/doctype/apartment_status/apartment_status.js new file mode 100644 index 0000000..3552899 --- /dev/null +++ b/propms/property_management_solution/doctype/apartment_status/apartment_status.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Apartment Status', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/apartment_status/apartment_status.json b/propms/property_management_solution/doctype/apartment_status/apartment_status.json new file mode 100644 index 0000000..f3e9d2b --- /dev/null +++ b/propms/property_management_solution/doctype/apartment_status/apartment_status.json @@ -0,0 +1,280 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 1, + "allow_rename": 0, + "beta": 0, + "creation": "2018-11-19 14:37:42.223377", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "apartment_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Apartment No", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "bhk", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "BHK", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "rent", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rent", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "agreement_start_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Agreement Start Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "agreement_end_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Agreement End Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-11-26 10:44:05.098029", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Apartment Status", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Floor Maintenance Supervisor", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Job in-charge", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/apartment_status/apartment_status.py b/propms/property_management_solution/doctype/apartment_status/apartment_status.py new file mode 100644 index 0000000..60286c6 --- /dev/null +++ b/propms/property_management_solution/doctype/apartment_status/apartment_status.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class ApartmentStatus(Document): + pass diff --git a/propms/property_management_solution/doctype/apartment_status/test_apartment_status.js b/propms/property_management_solution/doctype/apartment_status/test_apartment_status.js new file mode 100644 index 0000000..d8fd227 --- /dev/null +++ b/propms/property_management_solution/doctype/apartment_status/test_apartment_status.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Apartment Status", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Apartment Status + () => frappe.tests.make('Apartment Status', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/apartment_status/test_apartment_status.py b/propms/property_management_solution/doctype/apartment_status/test_apartment_status.py new file mode 100644 index 0000000..8d61d6e --- /dev/null +++ b/propms/property_management_solution/doctype/apartment_status/test_apartment_status.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestApartmentStatus(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/checklist_checkup_area/__init__.py b/propms/property_management_solution/doctype/checklist_checkup_area/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.js b/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.js new file mode 100644 index 0000000..b58f0ae --- /dev/null +++ b/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Checklist Checkup Area', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.json b/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.json new file mode 100644 index 0000000..c3b7df5 --- /dev/null +++ b/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.json @@ -0,0 +1,129 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 1, + "allow_rename": 0, + "autoname": "field:area_name", + "beta": 0, + "creation": "2018-11-19 21:25:43.525121", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "area_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Area Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "task", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Task", + "length": 0, + "no_copy": 0, + "options": "Checklist Checkup Area Task", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-11-28 23:30:01.366323", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Checklist Checkup Area", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.py b/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.py new file mode 100644 index 0000000..b04c40b --- /dev/null +++ b/propms/property_management_solution/doctype/checklist_checkup_area/checklist_checkup_area.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class ChecklistCheckupArea(Document): + pass diff --git a/propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.js b/propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.js new file mode 100644 index 0000000..e08e9e8 --- /dev/null +++ b/propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Checklist Checkup Area", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Checklist Checkup Area + () => frappe.tests.make('Checklist Checkup Area', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.py b/propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.py new file mode 100644 index 0000000..7c422b9 --- /dev/null +++ b/propms/property_management_solution/doctype/checklist_checkup_area/test_checklist_checkup_area.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestChecklistCheckupArea(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/checklist_checkup_area_task/__init__.py b/propms/property_management_solution/doctype/checklist_checkup_area_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.json b/propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.json new file mode 100644 index 0000000..75e4585 --- /dev/null +++ b/propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.json @@ -0,0 +1,75 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-11-28 23:29:17.113927", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "task_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Task Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-28 23:30:54.797083", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Checklist Checkup Area Task", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.py b/propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.py new file mode 100644 index 0000000..63c2b82 --- /dev/null +++ b/propms/property_management_solution/doctype/checklist_checkup_area_task/checklist_checkup_area_task.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class ChecklistCheckupAreaTask(Document): + pass diff --git a/propms/property_management_solution/doctype/custom_error_log/__init__.py b/propms/property_management_solution/doctype/custom_error_log/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/custom_error_log/custom_error_log.js b/propms/property_management_solution/doctype/custom_error_log/custom_error_log.js new file mode 100644 index 0000000..9ccf428 --- /dev/null +++ b/propms/property_management_solution/doctype/custom_error_log/custom_error_log.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Custom Error Log', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/custom_error_log/custom_error_log.json b/propms/property_management_solution/doctype/custom_error_log/custom_error_log.json new file mode 100644 index 0000000..d1fbfa1 --- /dev/null +++ b/propms/property_management_solution/doctype/custom_error_log/custom_error_log.json @@ -0,0 +1,163 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "", + "beta": 0, + "creation": "2018-11-24 00:37:39.594937", + "custom": 0, + "description": "Log of Scheduler Errors", + "docstatus": 0, + "doctype": "DocType", + "document_type": "System", + "editable_grid": 0, + "engine": "MyISAM", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fieldname": "seen", + "fieldtype": "Check", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Seen", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "method", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Title", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "error", + "fieldtype": "Code", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Error", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "fa fa-warning-sign", + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-12-18 21:18:01.379834", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Custom Error Log", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "ASC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/custom_error_log/custom_error_log.py b/propms/property_management_solution/doctype/custom_error_log/custom_error_log.py new file mode 100644 index 0000000..f5951e9 --- /dev/null +++ b/propms/property_management_solution/doctype/custom_error_log/custom_error_log.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class CustomErrorLog(Document): + pass diff --git a/propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.js b/propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.js new file mode 100644 index 0000000..2dc0e0a --- /dev/null +++ b/propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Custom Error Log", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Custom Error Log + () => frappe.tests.make('Custom Error Log', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.py b/propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.py new file mode 100644 index 0000000..7f44d2d --- /dev/null +++ b/propms/property_management_solution/doctype/custom_error_log/test_custom_error_log.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestCustomErrorLog(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/daily_checklist/__init__.py b/propms/property_management_solution/doctype/daily_checklist/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/daily_checklist/daily_checklist.js b/propms/property_management_solution/doctype/daily_checklist/daily_checklist.js new file mode 100644 index 0000000..c0c79c9 --- /dev/null +++ b/propms/property_management_solution/doctype/daily_checklist/daily_checklist.js @@ -0,0 +1,34 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Daily Checklist', 'area', function(frm, cdt, cdn) { + var doc = locals[cdt][cdn]; + if (doc.area) { + frappe.call({ + method: "frappe.client.get", + args: { + name: doc.area, + doctype: "Checklist Checkup Area" + }, + callback(r) { + console.log(r); + if (r.message) { + for (var row in r.message.task) { + var child = frm.add_child("daily_checklist_detail"); + frappe.model.set_value(child.doctype, child.name, "checklist_task", r.message.task[row].task_name); + refresh_field("daily_checklist_detail"); + } + } + } + }) + } +}) +cur_frm.fields_dict['daily_checklist_detail'].grid.get_field('job_card').get_query = function(doc, cdt, cdn) { + var child = locals[cdt][cdn] + return { + filters: [ + ['Issue', 'docstatus', '=', '0'], + ['Issue', 'docstatus', '=', '1'] + ] + } +}; \ No newline at end of file diff --git a/propms/property_management_solution/doctype/daily_checklist/daily_checklist.json b/propms/property_management_solution/doctype/daily_checklist/daily_checklist.json new file mode 100644 index 0000000..4589628 --- /dev/null +++ b/propms/property_management_solution/doctype/daily_checklist/daily_checklist.json @@ -0,0 +1,353 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "naming_series:", + "beta": 0, + "color": "#ff0102", + "creation": "2018-11-19 22:14:25.047735", + "custom": 0, + "default_print_format": "", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Today", + "fieldname": "checkup_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Checkup Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "shift", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": " Shift", + "length": 0, + "no_copy": 0, + "options": "Day\nNight", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "area", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Area", + "length": 0, + "no_copy": 0, + "options": "Checklist Checkup Area", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "property", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Property", + "length": 0, + "no_copy": 0, + "options": "Property", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "daily_checklist_detail", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Daily Checklist Detail", + "length": 0, + "no_copy": 0, + "options": "Daily Checklist Detail", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amended From", + "length": 0, + "no_copy": 1, + "options": "Daily Checklist", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "naming_series", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "naming_series", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "octicon octicon-checklist", + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 1, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-12-24 19:42:26.306039", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Daily Checklist", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Floor Maintenance Supervisor", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Job in-charge", + "set_user_permissions": 0, + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 1, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/daily_checklist/daily_checklist.py b/propms/property_management_solution/doctype/daily_checklist/daily_checklist.py new file mode 100644 index 0000000..408f09f --- /dev/null +++ b/propms/property_management_solution/doctype/daily_checklist/daily_checklist.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class DailyChecklist(Document): + pass diff --git a/propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.js b/propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.js new file mode 100644 index 0000000..8659152 --- /dev/null +++ b/propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Daily Checklist", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Daily Checklist + () => frappe.tests.make('Daily Checklist', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.py b/propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.py new file mode 100644 index 0000000..8c2363d --- /dev/null +++ b/propms/property_management_solution/doctype/daily_checklist/test_daily_checklist.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestDailyChecklist(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/daily_checklist_detail/__init__.py b/propms/property_management_solution/doctype/daily_checklist_detail/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.json b/propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.json new file mode 100644 index 0000000..a720523 --- /dev/null +++ b/propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.json @@ -0,0 +1,174 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-11-19 22:11:27.560230", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "checklist_task", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Checklist Task", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "NOT CHECKED", + "fieldname": "remarks", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Remarks", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "issue_photo", + "fieldtype": "Attach Image", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Issue photo", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "", + "fieldname": "job_card", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Job Card", + "length": 0, + "no_copy": 0, + "options": "Issue", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-28 14:40:04.352416", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Daily Checklist Detail", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.py b/propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.py new file mode 100644 index 0000000..673808d --- /dev/null +++ b/propms/property_management_solution/doctype/daily_checklist_detail/daily_checklist_detail.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class DailyChecklistDetail(Document): + pass diff --git a/propms/property_management_solution/doctype/door/__init__.py b/propms/property_management_solution/doctype/door/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/door/door.json b/propms/property_management_solution/doctype/door/door.json new file mode 100644 index 0000000..09e8dc8 --- /dev/null +++ b/propms/property_management_solution/doctype/door/door.json @@ -0,0 +1,204 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:door_type", + "beta": 0, + "creation": "2018-04-19 23:28:31.948059", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "door_type", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Door Type", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "lock_type", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Lock Type", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "screen_door_attached", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Screen Door attached", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "inside_color", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Inside Color", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "exterior_color", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Exterior Color", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-20 00:09:25.077337", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Door", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/door/door.py b/propms/property_management_solution/doctype/door/door.py new file mode 100644 index 0000000..2271225 --- /dev/null +++ b/propms/property_management_solution/doctype/door/door.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class Door(Document): + pass diff --git a/propms/property_management_solution/doctype/exit/__init__.py b/propms/property_management_solution/doctype/exit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/exit/exit.js b/propms/property_management_solution/doctype/exit/exit.js new file mode 100644 index 0000000..fdee806 --- /dev/null +++ b/propms/property_management_solution/doctype/exit/exit.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Exit', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/exit/exit.json b/propms/property_management_solution/doctype/exit/exit.json new file mode 100644 index 0000000..226d183 --- /dev/null +++ b/propms/property_management_solution/doctype/exit/exit.json @@ -0,0 +1,214 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "EXT.#####", + "beta": 0, + "creation": "2018-04-19 23:39:45.150319", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "lease", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Lease", + "length": 0, + "no_copy": 0, + "options": "Lease", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "exit_type", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Exit Type", + "length": 0, + "no_copy": 0, + "options": "Expiry\nPre-mature\nTermination", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval: in_list([\"Pre-mature\", \"Termination\"], doc.exit_type)\n\n", + "fieldname": "premature_expiry_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Premature expiry date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "exit_details", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Exit Details", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-12-24 19:27:44.846927", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Exit", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Property Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/exit/exit.py b/propms/property_management_solution/doctype/exit/exit.py new file mode 100644 index 0000000..fb2a797 --- /dev/null +++ b/propms/property_management_solution/doctype/exit/exit.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class Exit(Document): + pass diff --git a/propms/property_management_solution/doctype/exit/test_exit.js b/propms/property_management_solution/doctype/exit/test_exit.js new file mode 100644 index 0000000..2d41cbd --- /dev/null +++ b/propms/property_management_solution/doctype/exit/test_exit.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Exit", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Exit + () => frappe.tests.make('Exit', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/exit/test_exit.py b/propms/property_management_solution/doctype/exit/test_exit.py new file mode 100644 index 0000000..8fecabd --- /dev/null +++ b/propms/property_management_solution/doctype/exit/test_exit.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestExit(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/flooring/__init__.py b/propms/property_management_solution/doctype/flooring/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/flooring/flooring.json b/propms/property_management_solution/doctype/flooring/flooring.json new file mode 100644 index 0000000..16e664a --- /dev/null +++ b/propms/property_management_solution/doctype/flooring/flooring.json @@ -0,0 +1,109 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:flooring_type", + "beta": 0, + "creation": "2018-04-19 23:26:54.584190", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "flooring_type", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Flooring Type", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "description", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-20 00:10:23.006585", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Flooring", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/flooring/flooring.py b/propms/property_management_solution/doctype/flooring/flooring.py new file mode 100644 index 0000000..70c4a7c --- /dev/null +++ b/propms/property_management_solution/doctype/flooring/flooring.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class Flooring(Document): + pass diff --git a/propms/property_management_solution/doctype/guard_shift/__init__.py b/propms/property_management_solution/doctype/guard_shift/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/guard_shift/guard_shift.js b/propms/property_management_solution/doctype/guard_shift/guard_shift.js new file mode 100644 index 0000000..dcac51f --- /dev/null +++ b/propms/property_management_solution/doctype/guard_shift/guard_shift.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Guard Shift', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/guard_shift/guard_shift.json b/propms/property_management_solution/doctype/guard_shift/guard_shift.json new file mode 100644 index 0000000..a6554c6 --- /dev/null +++ b/propms/property_management_solution/doctype/guard_shift/guard_shift.json @@ -0,0 +1,129 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 1, + "autoname": "field:shift_name", + "beta": 0, + "creation": "2018-12-07 15:07:49.367515", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "shift_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Shift Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "shift_location", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Shift Location", + "length": 0, + "no_copy": 0, + "options": "Guard Shift Location", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-12-07 15:15:58.796377", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Guard Shift", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/guard_shift/guard_shift.py b/propms/property_management_solution/doctype/guard_shift/guard_shift.py new file mode 100644 index 0000000..3eb758a --- /dev/null +++ b/propms/property_management_solution/doctype/guard_shift/guard_shift.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class GuardShift(Document): + pass diff --git a/propms/property_management_solution/doctype/guard_shift/test_guard_shift.js b/propms/property_management_solution/doctype/guard_shift/test_guard_shift.js new file mode 100644 index 0000000..72bb73a --- /dev/null +++ b/propms/property_management_solution/doctype/guard_shift/test_guard_shift.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Guard Shift", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Guard Shift + () => frappe.tests.make('Guard Shift', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/guard_shift/test_guard_shift.py b/propms/property_management_solution/doctype/guard_shift/test_guard_shift.py new file mode 100644 index 0000000..e4cbb3c --- /dev/null +++ b/propms/property_management_solution/doctype/guard_shift/test_guard_shift.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestGuardShift(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/guard_shift_location/__init__.py b/propms/property_management_solution/doctype/guard_shift_location/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.json b/propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.json new file mode 100644 index 0000000..3cd2417 --- /dev/null +++ b/propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.json @@ -0,0 +1,75 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-12-07 15:04:24.204609", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "location_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Location Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-12-07 15:09:14.885125", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Guard Shift Location", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.py b/propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.py new file mode 100644 index 0000000..abdf9dc --- /dev/null +++ b/propms/property_management_solution/doctype/guard_shift_location/guard_shift_location.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class GuardShiftLocation(Document): + pass diff --git a/propms/property_management_solution/doctype/insurance/__init__.py b/propms/property_management_solution/doctype/insurance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/insurance/insurance.js b/propms/property_management_solution/doctype/insurance/insurance.js new file mode 100644 index 0000000..5e6d051 --- /dev/null +++ b/propms/property_management_solution/doctype/insurance/insurance.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Insurance', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/insurance/insurance.json b/propms/property_management_solution/doctype/insurance/insurance.json new file mode 100644 index 0000000..8052e86 --- /dev/null +++ b/propms/property_management_solution/doctype/insurance/insurance.json @@ -0,0 +1,340 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "INSUR.#####", + "beta": 0, + "creation": "2018-04-19 23:30:49.117465", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "insurance_provider", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Insurance Provider", + "length": 0, + "no_copy": 0, + "options": "Supplier", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "insurance_type", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Insurance Type", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "policy_number", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Policy Number", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "premium_price", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Premium Price", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "effective_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Effective Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "expiration_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Expiration Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "description", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "cover_document", + "fieldtype": "Attach", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Cover Document", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-11-20 00:08:18.607882", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Insurance", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Property Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/insurance/insurance.py b/propms/property_management_solution/doctype/insurance/insurance.py new file mode 100644 index 0000000..c0575bf --- /dev/null +++ b/propms/property_management_solution/doctype/insurance/insurance.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class Insurance(Document): + pass diff --git a/propms/property_management_solution/doctype/insurance/test_insurance.js b/propms/property_management_solution/doctype/insurance/test_insurance.js new file mode 100644 index 0000000..86d8c17 --- /dev/null +++ b/propms/property_management_solution/doctype/insurance/test_insurance.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Insurance", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Insurance + () => frappe.tests.make('Insurance', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/insurance/test_insurance.py b/propms/property_management_solution/doctype/insurance/test_insurance.py new file mode 100644 index 0000000..315b3bb --- /dev/null +++ b/propms/property_management_solution/doctype/insurance/test_insurance.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestInsurance(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/issue_materials_billed/__init__.py b/propms/property_management_solution/doctype/issue_materials_billed/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.json b/propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.json new file mode 100644 index 0000000..0e63bd4 --- /dev/null +++ b/propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.json @@ -0,0 +1,104 @@ +{ + "creation": "2020-04-16 17:07:23.961402", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "item", + "quantity", + "uom", + "rate", + "amount", + "is_pos", + "material_status", + "invoiced", + "sales_invoice" + ], + "fields": [ + { + "columns": 2, + "fieldname": "item", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Item", + "options": "Item" + }, + { + "columns": 1, + "default": "1", + "fieldname": "quantity", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity" + }, + { + "columns": 1, + "fetch_from": "item.stock_uom", + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 1, + "label": "UOM", + "options": "UOM" + }, + { + "columns": 1, + "fetch_from": "item.standard_rate", + "fetch_if_empty": 1, + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate" + }, + { + "columns": 2, + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "read_only": 1 + }, + { + "columns": 1, + "default": "0", + "fieldname": "is_pos", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Is POS" + }, + { + "columns": 1, + "fieldname": "material_status", + "fieldtype": "Select", + "label": "Status", + "options": "\nBill\nSelf Consumption" + }, + { + "columns": 1, + "default": "0", + "fieldname": "invoiced", + "fieldtype": "Check", + "label": "Invoiced", + "read_only": 1 + }, + { + "fieldname": "sales_invoice", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Sales Invoice", + "options": "Sales Invoice", + "read_only": 1 + } + ], + "istable": 1, + "modified": "2020-04-18 16:19:40.733080", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Issue Materials Billed", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 + } \ No newline at end of file diff --git a/propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.py b/propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.py new file mode 100644 index 0000000..4b1014c --- /dev/null +++ b/propms/property_management_solution/doctype/issue_materials_billed/issue_materials_billed.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals + +# import frappe +from frappe.model.document import Document + + +class IssueMaterialsBilled(Document): + pass diff --git a/propms/property_management_solution/doctype/issue_materials_detail/__init__.py b/propms/property_management_solution/doctype/issue_materials_detail/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.json b/propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.json new file mode 100644 index 0000000..6ad706c --- /dev/null +++ b/propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.json @@ -0,0 +1,97 @@ +{ + "actions": [], + "creation": "2018-11-22 07:16:14.803984", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "item", + "quantity", + "uom", + "rate", + "amount", + "is_pos", + "material_status", + "material_request" + ], + "fields": [ + { + "columns": 1, + "fieldname": "material_status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "options": "Requested\nReceived and WIP\nWork Done\nBill\nSelf Consumption" + }, + { + "columns": 2, + "fieldname": "item", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Item", + "options": "Item" + }, + { + "columns": 1, + "default": "1", + "fieldname": "quantity", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity" + }, + { + "columns": 1, + "fetch_from": "item.standard_rate", + "fetch_if_empty": 1, + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate" + }, + { + "columns": 2, + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "read_only": 1 + }, + { + "columns": 1, + "fetch_from": "item.stock_uom", + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 1, + "label": "UOM", + "options": "UOM" + }, + { + "columns": 1, + "default": "0", + "depends_on": "eval: doc.material_status != \"Self Consumption\"", + "fieldname": "is_pos", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Is POS" + }, + { + "fieldname": "material_request", + "fieldtype": "Data", + "label": "Material Request" + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2021-07-03 23:43:04.350234", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Issue Materials Detail", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.py b/propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.py new file mode 100644 index 0000000..bbd603e --- /dev/null +++ b/propms/property_management_solution/doctype/issue_materials_detail/issue_materials_detail.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class IssueMaterialsDetail(Document): + pass diff --git a/propms/property_management_solution/doctype/key/__init__.py b/propms/property_management_solution/doctype/key/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/key/key.json b/propms/property_management_solution/doctype/key/key.json new file mode 100644 index 0000000..cd8b4f7 --- /dev/null +++ b/propms/property_management_solution/doctype/key/key.json @@ -0,0 +1,108 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:key_number", + "beta": 0, + "creation": "2018-04-19 23:34:00.841956", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "key_number", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Key Number", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "status_active", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Status Active", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-22 21:09:10.710448", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Key", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/key/key.py b/propms/property_management_solution/doctype/key/key.py new file mode 100644 index 0000000..0d38679 --- /dev/null +++ b/propms/property_management_solution/doctype/key/key.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class Key(Document): + pass diff --git a/propms/property_management_solution/doctype/key_set/__init__.py b/propms/property_management_solution/doctype/key_set/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/key_set/key_set.js b/propms/property_management_solution/doctype/key_set/key_set.js new file mode 100644 index 0000000..56d17fb --- /dev/null +++ b/propms/property_management_solution/doctype/key_set/key_set.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Key Set', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/key_set/key_set.json b/propms/property_management_solution/doctype/key_set/key_set.json new file mode 100644 index 0000000..6b2db89 --- /dev/null +++ b/propms/property_management_solution/doctype/key_set/key_set.json @@ -0,0 +1,93 @@ +{ + "actions": [], + "allow_import": 1, + "allow_rename": 1, + "autoname": "format:{shelf_no}-{location_no}", + "creation": "2018-12-19 13:07:27.577369", + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "set_name", + "no_of_keys", + "shelf_no", + "location_no", + "status", + "duplicate_of", + "disabled" + ], + "fields": [ + { + "fieldname": "set_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Set Name", + "search_index": 1 + }, + { + "fieldname": "no_of_keys", + "fieldtype": "Int", + "in_list_view": 1, + "label": "No. of Keys" + }, + { + "fieldname": "shelf_no", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Shelf No.", + "options": "\nS1\nS2\nS3" + }, + { + "fieldname": "location_no", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Location No." + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "In\nOut\nLost" + }, + { + "fieldname": "duplicate_of", + "fieldtype": "Link", + "label": "Duplicate of", + "options": "Key Set" + }, + { + "default": "0", + "fieldname": "disabled", + "fieldtype": "Check", + "label": "Disabled" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-10-26 15:30:23.859967", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Key Set", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "search_fields": "set_name", + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/key_set/key_set.py b/propms/property_management_solution/doctype/key_set/key_set.py new file mode 100644 index 0000000..5d500bf --- /dev/null +++ b/propms/property_management_solution/doctype/key_set/key_set.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class KeySet(Document): + pass diff --git a/propms/property_management_solution/doctype/key_set/test_key_set.js b/propms/property_management_solution/doctype/key_set/test_key_set.js new file mode 100644 index 0000000..84130fd --- /dev/null +++ b/propms/property_management_solution/doctype/key_set/test_key_set.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Key Set", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Key Set + () => frappe.tests.make('Key Set', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/key_set/test_key_set.py b/propms/property_management_solution/doctype/key_set/test_key_set.py new file mode 100644 index 0000000..04276cf --- /dev/null +++ b/propms/property_management_solution/doctype/key_set/test_key_set.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestKeySet(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/key_set_detail/__init__.py b/propms/property_management_solution/doctype/key_set_detail/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/key_set_detail/key_set_detail.js b/propms/property_management_solution/doctype/key_set_detail/key_set_detail.js new file mode 100644 index 0000000..7002d89 --- /dev/null +++ b/propms/property_management_solution/doctype/key_set_detail/key_set_detail.js @@ -0,0 +1,29 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Key Set Detail", "returned", function(frm) { + if (cur_frm.doc.returned) { + cur_frm.set_value("return_date_and_time", frappe.datetime.now_datetime()); + cur_frm.set_df_property("returned", "read_only", 1); + } else { + cur_frm.set_value("return_date_and_time", ""); + } +}); + +cur_frm.add_fetch('key_set', 'set_name', 'set_name'); + +frappe.ui.form.on("Key Set Detail","onload",function(){ + if (cur_frm.doc.returned) { + cur_frm.set_df_property("returned", "read_only", 1); + } +}); + +cur_frm.set_query("key_set", function() { + return { + filters: { + 'status': 'In', + 'disabled': 0 + } + } +}); + diff --git a/propms/property_management_solution/doctype/key_set_detail/key_set_detail.json b/propms/property_management_solution/doctype/key_set_detail/key_set_detail.json new file mode 100644 index 0000000..56cfde6 --- /dev/null +++ b/propms/property_management_solution/doctype/key_set_detail/key_set_detail.json @@ -0,0 +1,106 @@ +{ + "actions": [], + "allow_import": 1, + "autoname": "format:{key_set}-{taken_by}-{######}", + "color": "#ff0102", + "creation": "2018-12-19 15:33:36.946075", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "key_set", + "set_name", + "staff_type", + "taken_by", + "reason_for_key_taken", + "datetime_taken", + "returned", + "return_date_and_time", + "other_remarks" + ], + "fields": [ + { + "fieldname": "key_set", + "fieldtype": "Link", + "label": "Key Set", + "options": "Key Set" + }, + { + "fieldname": "set_name", + "fieldtype": "Data", + "label": "Set Name", + "read_only": 1 + }, + { + "fieldname": "staff_type", + "fieldtype": "Select", + "label": "Staff Type", + "options": "\nSpik n Span\nViva Staff\nViva Security\nConsultant\nOthers", + "reqd": 1 + }, + { + "fieldname": "taken_by", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Taken by" + }, + { + "fieldname": "reason_for_key_taken", + "fieldtype": "Data", + "label": "Reason for key taken", + "reqd": 1 + }, + { + "default": "Now", + "fieldname": "datetime_taken", + "fieldtype": "Datetime", + "in_list_view": 1, + "label": "Datetime taken", + "read_only": 1 + }, + { + "default": "0", + "fieldname": "returned", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Returned" + }, + { + "fieldname": "return_date_and_time", + "fieldtype": "Datetime", + "label": "Return Date and Time", + "read_only": 1 + }, + { + "fieldname": "other_remarks", + "fieldtype": "Text", + "label": "Other remarks" + } + ], + "icon": "octicon octicon-key", + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-09-21 13:44:44.726925", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Key Set Detail", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/key_set_detail/key_set_detail.py b/propms/property_management_solution/doctype/key_set_detail/key_set_detail.py new file mode 100644 index 0000000..b1474d4 --- /dev/null +++ b/propms/property_management_solution/doctype/key_set_detail/key_set_detail.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class KeySetDetail(Document): + pass diff --git a/propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.js b/propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.js new file mode 100644 index 0000000..cf5088a --- /dev/null +++ b/propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Key Set Detail", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Key Set Detail + () => frappe.tests.make('Key Set Detail', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.py b/propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.py new file mode 100644 index 0000000..7184879 --- /dev/null +++ b/propms/property_management_solution/doctype/key_set_detail/test_key_set_detail.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestKeySetDetail(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/lease/__init__.py b/propms/property_management_solution/doctype/lease/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/lease/lease.js b/propms/property_management_solution/doctype/lease/lease.js new file mode 100644 index 0000000..aabc9f6 --- /dev/null +++ b/propms/property_management_solution/doctype/lease/lease.js @@ -0,0 +1,87 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt +cur_frm.add_fetch('property', 'unit_owner', 'property_owner'); + +frappe.ui.form.on('Lease', { + setup: function(frm) { + frm.set_query("lease_item", "lease_item", function() { + return { + "filters": [ + ["item_group","=", "Lease Items"], + ] + }; + }); + frm.set_query("property", function() { + return { + "filters": { + "company": frm.doc.company, + }, + }; + }); + }, + refresh: function(frm) { + cur_frm.add_custom_button(__("Make Invoice Schedule"), function() { + make_lease_invoice_schedule(cur_frm); + }); + cur_frm.add_custom_button(__("Generate Pending Invoice"), function() { + generate_pending_invoice(); + }); + cur_frm.add_custom_button(__("Make Invoice Schedule for all Lease"), function() { + getAllLease(cur_frm); + }); + }, + onload: function(frm) { + frappe.realtime.on("lease_invoice_schedule_progress", function(data) { + if (data.reload && data.reload === 1) { + frm.reload_doc(); + } + if (data.progress) { + let progress_bar = $(cur_frm.dashboard.progress_area).find(".progress-bar"); + if (progress_bar) { + $(progress_bar).removeClass("progress-bar-danger").addClass("progress-bar-success progress-bar-striped"); + $(progress_bar).css("width", data.progress+"%"); + } + } + }); + } +}); + +var make_lease_invoice_schedule = function(frm){ + var doc = frm.doc; + frappe.call({ + method: "propms.property_management_solution.doctype.lease.lease.make_lease_invoice_schedule", + args: {leasedoc: doc.name}, + callback: function(){ + cur_frm.reload_doc(); + } + }); +}; + +var generate_pending_invoice = function(){ + frappe.call({ + method: "propms.lease_invoice.leaseInvoiceAutoCreate", + args: {}, + callback: function(){ + cur_frm.reload_doc(); + } + }); +}; + +var getAllLease = function(){ + frappe.confirm( + 'Are you sure to initiate this long process?', + function(){ + frappe.call({ + method: "propms.property_management_solution.doctype.lease.lease.getAllLease", + args: {}, + callback: function(){ + cur_frm.reload_doc(); + } + }); + }, + function(){ + frappe.msgprint(__("Closed before starting long process!")); + window.close(); + } + ) +}; diff --git a/propms/property_management_solution/doctype/lease/lease.json b/propms/property_management_solution/doctype/lease/lease.json new file mode 100644 index 0000000..93b87ce --- /dev/null +++ b/propms/property_management_solution/doctype/lease/lease.json @@ -0,0 +1,357 @@ +{ + "allow_import": 1, + "autoname": "format:{property}-{#####}", + "creation": "2018-05-01 22:11:38.457329", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "lease_basic_info_section", + "company", + "property", + "column_break_4", + "lease_date", + "lease_status", + "document_reminders_section", + "signed_agreement_received", + "column_break_1", + "stamp_duty_paid_by_tenant", + "lease_parties_section", + "property_owner", + "lease_customer", + "column_break_8", + "customer", + "property_user", + "lease_dates_section", + "start_date", + "column_break_13", + "end_date", + "frequency", + "lease_item_table_section", + "lease_item", + "section_break_11", + "lease_invoice_schedule", + "section_break_13", + "days_to_invoice_in_advance", + "notice_period", + "column_break_23", + "fit_out_period", + "security_deposit_details_section", + "security_deposit_currency", + "security_deposit", + "security_status", + "column_break_27", + "security_received_payment", + "security_returned_reference", + "other_lease_details_section", + "late_payment_interest_percentage", + "wtax_paid_by", + "column_break_34", + "witness_2", + "witness_1", + "section_break_36", + "amended_from" + ], + "fields": [ + { + "fieldname": "lease_basic_info_section", + "fieldtype": "Section Break", + "label": "Lease Basic info" + }, + { + "fetch_from": "property.company", + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company" + }, + { + "fieldname": "property", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Property", + "options": "Property", + "reqd": 1 + }, + { + "fieldname": "column_break_4", + "fieldtype": "Column Break" + }, + { + "default": "Today", + "fieldname": "lease_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Lease Date", + "reqd": 1 + }, + { + "fieldname": "document_reminders_section", + "fieldtype": "Section Break", + "label": "Document Reminders" + }, + { + "default": "0", + "fieldname": "signed_agreement_received", + "fieldtype": "Check", + "label": "Signed agreement received" + }, + { + "fieldname": "column_break_1", + "fieldtype": "Column Break" + }, + { + "default": "0", + "fieldname": "stamp_duty_paid_by_tenant", + "fieldtype": "Check", + "label": "Stamp duty paid by tenant" + }, + { + "fieldname": "lease_parties_section", + "fieldtype": "Section Break", + "label": "Lease Parties" + }, + { + "fieldname": "property_owner", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Property Owner", + "options": "Customer", + "read_only": 1 + }, + { + "fieldname": "lease_customer", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Lease Customer", + "options": "Customer", + "reqd": 1 + }, + { + "fieldname": "column_break_8", + "fieldtype": "Column Break" + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_list_view": 1, + "label": "POS Customer", + "options": "Customer", + "reqd": 1 + }, + { + "fieldname": "property_user", + "fieldtype": "Link", + "label": "Property User", + "options": "Contact" + }, + { + "fieldname": "lease_dates_section", + "fieldtype": "Section Break", + "label": "Lease Dates" + }, + { + "fieldname": "start_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Start Date", + "reqd": 1 + }, + { + "fieldname": "column_break_13", + "fieldtype": "Column Break" + }, + { + "fieldname": "end_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "End Date", + "reqd": 1 + }, + { + "fieldname": "frequency", + "fieldtype": "Select", + "hidden": 1, + "label": "Frequency", + "options": "Monthly\nBi-Monthly\nQuarterly\nAnnually\n6 months" + }, + { + "fieldname": "lease_item_table_section", + "fieldtype": "Section Break", + "label": "Lease Item Table" + }, + { + "fieldname": "lease_item", + "fieldtype": "Table", + "label": "Lease Item", + "options": "Lease Item", + "reqd": 1 + }, + { + "fieldname": "section_break_11", + "fieldtype": "Section Break", + "label": "Invoice Schedule" + }, + { + "fieldname": "lease_invoice_schedule", + "fieldtype": "Table", + "label": "Lease Invoice Schedule", + "options": "Lease Invoice Schedule" + }, + { + "fieldname": "section_break_13", + "fieldtype": "Section Break" + }, + { + "description": "No. of Days", + "fieldname": "notice_period", + "fieldtype": "Int", + "label": "Notice Period", + "reqd": 1 + }, + { + "fieldname": "column_break_23", + "fieldtype": "Column Break" + }, + { + "description": "No. of Days", + "fieldname": "fit_out_period", + "fieldtype": "Int", + "label": "Fit out Period" + }, + { + "fieldname": "security_deposit_details_section", + "fieldtype": "Section Break", + "label": "Security Deposit Details" + }, + { + "default": "USD", + "fieldname": "security_deposit_currency", + "fieldtype": "Link", + "label": "Security Deposit Currency", + "options": "Currency", + "reqd": 1 + }, + { + "description": "Security Deposit Amount", + "fieldname": "security_deposit", + "fieldtype": "Currency", + "label": "Security deposit", + "options": "security_deposit_currency", + "reqd": 1 + }, + { + "fieldname": "security_status", + "fieldtype": "Select", + "label": "Security Status", + "options": "\nProforma Invoice raised\nReceived\nReceived in part\nReturn in part\nReturned\nRecovered for rent\nRecovered for repairs\nNot required" + }, + { + "fieldname": "column_break_27", + "fieldtype": "Column Break" + }, + { + "fieldname": "security_received_payment", + "fieldtype": "Link", + "label": "Final Security Received Payment", + "options": "Payment Entry" + }, + { + "fieldname": "security_returned_reference", + "fieldtype": "Link", + "label": "Final Security Returned Reference", + "options": "Payment Entry" + }, + { + "fieldname": "other_lease_details_section", + "fieldtype": "Section Break", + "label": "Other lease details" + }, + { + "fieldname": "late_payment_interest_percentage", + "fieldtype": "Percent", + "label": "Late payment interest percentage" + }, + { + "fieldname": "wtax_paid_by", + "fieldtype": "Select", + "label": "WTax paid by", + "options": "By Lessee\nOn behalf of lessee by Landlord\nBy Landlord" + }, + { + "fieldname": "column_break_34", + "fieldtype": "Column Break" + }, + { + "fieldname": "witness_2", + "fieldtype": "Link", + "label": "Witness 2", + "options": "Contact" + }, + { + "fieldname": "witness_1", + "fieldtype": "Link", + "label": "Witness 1", + "options": "Contact" + }, + { + "fieldname": "section_break_36", + "fieldtype": "Section Break" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Lease", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "days_to_invoice_in_advance", + "fieldtype": "Int", + "label": "Days to invoice in advance" + }, + { + "fieldname": "lease_status", + "fieldtype": "Select", + "label": "Lease Status", + "options": "\nActive\nClosed\nNot Materialized\nRenewal to Previous Lease\nAdendum to Previous Lease\nVacating" + } + ], + "modified": "2021-06-09 17:20:19.067591", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Lease", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Property Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/lease/lease.py b/propms/property_management_solution/doctype/lease/lease.py new file mode 100644 index 0000000..d7fcc70 --- /dev/null +++ b/propms/property_management_solution/doctype/lease/lease.py @@ -0,0 +1,334 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document +from frappe.utils import add_days, today, getdate, add_months, get_datetime, now +from propms.auto_custom import app_error_log, makeInvoiceSchedule, getDateMonthDiff + + +class Lease(Document): + def on_submit(self): + try: + checklist_doc = frappe.get_doc("Checklist Checkup Area", "Handover") + if checklist_doc: + check_list = [] + for task in checklist_doc.task: + check = {} + check["checklist_task"] = task.task_name + check_list.append(check) + + frappe.get_doc( + dict( + doctype="Daily Checklist", + area="Handover", + checkup_date=self.start_date, + daily_checklist_detail=check_list, + property=self.property, + ) + ).insert() + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + def validate(self): + try: + if ( + get_datetime(self.start_date) + <= get_datetime(now()) + <= get_datetime(add_months(self.end_date, -3)) + ): + frappe.db.set_value("Property", self.property, "status", "On Lease") + frappe.msgprint("Property set to On Lease") + if ( + get_datetime(add_months(self.end_date, -3)) + <= get_datetime(now()) + <= get_datetime(add_months(self.end_date, 3)) + ): + frappe.db.set_value( + "Property", self.property, "status", "Off Lease in 3 Months" + ) + frappe.msgprint("Property set to Off Lease in 3 Months") + except Exception as e: + app_error_log(frappe.session.user, str(e)) + + +@frappe.whitelist() +def getAllLease(): + # Below is temporarily created to manually run through all lease and refresh lease invoice schedule. Hardcoded to start from 1st Jan 2020. + frappe.msgprint( + "The task of making lease invoice schedule for all users has been sent for background processing." + ) + invoice_start_date = frappe.db.get_single_value( + "Property Management Settings", "invoice_start_date" + ) + lease_list = frappe.get_all( + "Lease", filters={"end_date": (">=", invoice_start_date)}, fields=["name"] + ) + # frappe.msgprint("Working on lease_list" + str(lease_list)) + lease_list_len = len(lease_list) + frappe.msgprint("Total number of lease to be processed is " + str(lease_list_len)) + for lease in lease_list: + make_lease_invoice_schedule(lease.name) + + +# def on_update(self): +@frappe.whitelist() +def make_lease_invoice_schedule(leasedoc): + # frappe.msgprint("This is the parameter passed: " + str(leasedoc)) + lease = frappe.get_doc("Lease", str(leasedoc)) + try: + # Delete unnecessary records after lease end date + lease_invoice_schedule_list = frappe.get_list( + "Lease Invoice Schedule", + fields=[ + "name", + "parent", + "lease_item", + "invoice_number", + "date_to_invoice", + ], + filters={"parent": lease.name, "date_to_invoice": (">", lease.end_date)}, + ) + for lease_invoice_schedule in lease_invoice_schedule_list: + frappe.delete_doc("Lease Invoice Schedule", lease_invoice_schedule.name) + # Only process lease that items and is current + if len(lease.lease_item) >= 1 and lease.end_date >= getdate(today()): + # Clean up records that are no longer required, i.e. of unnecessary lease items and unnecessary dates + # Records before Invoice Start Date + invoice_start_date = frappe.db.get_single_value( + "Property Management Settings", "invoice_start_date" + ) + lease_invoice_schedule_list = frappe.get_list( + "Lease Invoice Schedule", + fields=["name", "parent", "invoice_number", "date_to_invoice"], + filters={ + "parent": lease.name, + "date_to_invoice": ("<", invoice_start_date), + }, + ) + # frappe.msgprint("Records before Invoice Start Date " + str(lease_invoice_schedule_list)) + for lease_invoice_schedule in lease_invoice_schedule_list: + # frappe.msgprint("Deleting Record before Invoice Start Date " + str(invoice_start_date) + str(lease_invoice_schedule.name)) + frappe.delete_doc("Lease Invoice Schedule", lease_invoice_schedule.name) + # Records of lease_items that no longer existing in lease.lease_item + lease_invoice_schedule_list = frappe.get_list( + "Lease Invoice Schedule", + fields=[ + "name", + "parent", + "lease_item", + "invoice_number", + "date_to_invoice", + ], + filters={"parent": lease.name}, + ) + lease_items_list = frappe.get_list( + "Lease Item", + fields=["name", "parent", "lease_item"], + filters={"parent": lease.name}, + ) + # Create list of lease items that are part of lease.lease_item + lease_item_name_list = [ + lease_item["lease_item"] for lease_item in lease_items_list + ] + # frappe.msgprint(str(lease_item_list)) + for lease_invoice_schedule in lease_invoice_schedule_list: + if lease_invoice_schedule.lease_item not in lease_item_name_list: + # frappe.msgprint("This lease item will be removed from invoice schedule " + str(lease_invoice_schedule.lease_item)) + frappe.delete_doc( + "Lease Invoice Schedule", lease_invoice_schedule.name + ) + item_invoice_frequency = { + "Monthly": 1.00, # .00 to make it float type + "Bi-Monthly": 2.00, + "Quarterly": 3.00, + "6 months": 6.00, + "Annually": 12.00, + } + idx = 1 + for item in lease.lease_item: + # frappe.msgprint("Lease item being processed: " + str(item.lease_item)) + lease_invoice_schedule_list = frappe.get_all( + "Lease Invoice Schedule", + fields=[ + "name", + "parent", + "lease_item", + "qty", + "invoice_number", + "date_to_invoice", + ], + filters={"parent": lease.name, "lease_item": item.lease_item}, + order_by="date_to_invoice", + ) + # frappe.msgprint(str(lease_invoice_schedule_list)) + # Get the latest item frequency incase lease was changed. + frequency_factor = item_invoice_frequency.get( + item.frequency, "Invalid frequency" + ) + # frappe.msgprint("Next Invoice date calculated: " + str(invoice_date)) + if frequency_factor == "Invalid frequency": + message = ( + "Invalid frequency: " + + str(item.frequency) + + " for " + + str(leasedoc) + + " not found. Contact the developers!" + ) + frappe.log_error("Frequency incorrect", message) + break + invoice_qty = float(frequency_factor) + end_date = lease.end_date + invoice_date = lease.start_date + # Find out the first invoice date on or after Invoice Start Date process. + while end_date >= invoice_date and invoice_date < invoice_start_date: + invoice_period_end = add_days( + add_months(invoice_date, frequency_factor), -1 + ) + # Set invoice_Qty as appropriate fraction of frequency_factor + if invoice_period_end > end_date: + invoice_qty = getDateMonthDiff(invoice_date, end_date, 1) + # frappe.msgprint("Invoice quantity corrected as " + str(invoice_qty)) + invoice_date = add_days(invoice_period_end, 1) + # If there is no lease_invoice_schedule_list found, i.e. it is fresh new list to be created + if not lease_invoice_schedule_list: + while end_date >= invoice_date: + invoice_period_end = add_days( + add_months(invoice_date, frequency_factor), -1 + ) + # frappe.msgprint("Invoice period end: " + str(invoice_period_end) + "--- Invoice Date: " + str(invoice_date)) + # frappe.msgprint("End Date: " + str(end_date)) + # set invoice_Qty as appropriate fraction of frequency_factor + if invoice_period_end > end_date: + invoice_qty = getDateMonthDiff(invoice_date, end_date, 1) + # frappe.msgprint("Invoice quantity corrected as " + str(invoice_qty)) + # frappe.msgprint("Making Fresh Invoice Schedule for " + str(invoice_date) + # + ", Quantity calculated: " + str(invoice_qty)) + makeInvoiceSchedule( + invoice_date, + item.lease_item, + item.paid_by, + item.lease_item, + lease.name, + invoice_qty, + item.amount, + idx, + item.currency_code, + item.witholding_tax, + lease.days_to_invoice_in_advance, + item.invoice_item_group, + item.document_type, + ) + idx += 1 + invoice_date = add_days(invoice_period_end, 1) + for lease_invoice_schedule in lease_invoice_schedule_list: + # frappe.msgprint("Upon entering lease_invoice_schedule_list - Date to invoice: " + str(lease_invoice_schedule.date_to_invoice) + # + " and invoice date to process is " + str(invoice_date)) + if not (lease_invoice_schedule.schedule_start_date): + lease_invoice_schedule.schedule_start_date = ( + lease_invoice_schedule.date_to_invoice + ) + while ( + end_date >= invoice_date + and lease_invoice_schedule.schedule_start_date > invoice_date + ): + invoice_period_end = add_days( + add_months(invoice_date, frequency_factor), -1 + ) + # frappe.msgprint("Upon entering Invoice period end: " + str(invoice_period_end) + "--- Invoice Date: " + str(invoice_date)) + # frappe.msgprint("End Date: " + str(end_date)) + # set invoice_Qty as appropriate fraction of frequency_factor + if invoice_period_end > end_date: + invoice_qty = getDateMonthDiff(invoice_date, end_date, 1) + # frappe.msgprint("Invoice quantity corrected as " + str(invoice_qty)) + # frappe.msgprint("Making Pre Invoice Schedule for " + str(invoice_date) + ", Quantity calculated: " + str(invoice_qty)) + makeInvoiceSchedule( + invoice_date, + item.lease_item, + item.paid_by, + item.lease_item, + lease.name, + invoice_qty, + item.amount, + idx, + item.currency_code, + item.witholding_tax, + lease.days_to_invoice_in_advance, + item.invoice_item_group, + item.document_type, + ) + idx += 1 + invoice_date = add_days(invoice_period_end, 1) + # frappe.msgprint(str(lease_invoice_schedule)) + # If the record already exists and invoice is generated + if ( + lease_invoice_schedule.invoice_number is not None + and lease_invoice_schedule.invoice_number != "" + ): + # frappe.msgprint("Lease Invoice Schedule retained: " + lease_invoice_schedule.name + # + " for invoice number: " + str(lease_invoice_schedule.invoice_number) + # + " dated " + str(lease_invoice_schedule.date_to_invoice) + # ) + # Set months as rounded up by 1 if the month is a fraction (last invoice for the lease item already created). + # Above needed to escape from infinite loop of rounded down date and therefore never reaching end of the lease. + if lease_invoice_schedule.qty != round( + lease_invoice_schedule.qty, 0 + ): + add_months_value = round(lease_invoice_schedule.qty, 0) + 1 + else: + add_months_value = lease_invoice_schedule.qty + # frappe.msgprint("Add Months Value" + str(add_months_value) + " due to qty = " + str(lease_invoice_schedule.qty)) + invoice_date = add_months( + lease_invoice_schedule.schedule_start_date, add_months_value + ) + # Set sequence to show it on the top + frappe.db.set_value( + "Lease Invoice Schedule", + lease_invoice_schedule.name, + "idx", + idx, + ) + idx += 1 + # If the invoice is not created + else: + # frappe.msgprint("Deleting schedule :" + lease_invoice_schedule.name + " dated: " + str(lease_invoice_schedule.date_to_invoice) + " for " + str(lease_invoice_schedule.lease_item)) + frappe.delete_doc( + "Lease Invoice Schedule", lease_invoice_schedule.name + ) + # frappe.msgprint("first invoice_date: " + str(invoice_date), "Lease Invoice Schedule") + while end_date >= invoice_date: + invoice_period_end = add_days( + add_months(invoice_date, frequency_factor), -1 + ) + # frappe.msgprint("Invoice period end: " + str(invoice_period_end) + "--- Invoice Date: " + str(invoice_date)) + # frappe.msgprint("End Date: " + str(end_date)) + # set invoice_Qty as appropriate fraction of frequency_factor + if invoice_period_end > end_date: + invoice_qty = getDateMonthDiff(invoice_date, end_date, 1) + # frappe.msgprint("Invoice quantity corrected as " + str(invoice_qty)) + # frappe.msgprint("Making Post Invoice Schedule for " + str(invoice_date) + ", Quantity calculated: " + str(invoice_qty)) + makeInvoiceSchedule( + invoice_date, + item.lease_item, + item.paid_by, + item.lease_item, + lease.name, + invoice_qty, + item.amount, + idx, + item.currency_code, + item.witholding_tax, + lease.days_to_invoice_in_advance, + item.invoice_item_group, + item.document_type, + ) + idx += 1 + invoice_date = add_days(invoice_period_end, 1) + + frappe.msgprint("Completed making of invoice schedule.") + + except Exception as e: + frappe.msgprint("Exception error! Check app error log.") + app_error_log(frappe.session.user, str(e)) diff --git a/propms/property_management_solution/doctype/lease/test_lease.js b/propms/property_management_solution/doctype/lease/test_lease.js new file mode 100644 index 0000000..5662e6e --- /dev/null +++ b/propms/property_management_solution/doctype/lease/test_lease.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Lease", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Lease + () => frappe.tests.make('Lease', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/lease/test_lease.py b/propms/property_management_solution/doctype/lease/test_lease.py new file mode 100644 index 0000000..d1a2886 --- /dev/null +++ b/propms/property_management_solution/doctype/lease/test_lease.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestLease(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/lease_invoice_schedule/__init__.py b/propms/property_management_solution/doctype/lease_invoice_schedule/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.js b/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.js new file mode 100644 index 0000000..26c5467 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Lease Invoice Schedule', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.json b/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.json new file mode 100644 index 0000000..f4e2165 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.json @@ -0,0 +1,130 @@ +{ + "actions": [], + "autoname": "LIS.#####", + "creation": "2019-02-01 14:07:00.154448", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "date_to_invoice", + "schedule_start_date", + "lease_item", + "paid_by", + "lease_item_name", + "document_type", + "invoice_number", + "sales_order_number", + "qty", + "rate", + "currency", + "tax", + "invoice_item_group" + ], + "fields": [ + { + "columns": 2, + "fieldname": "date_to_invoice", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Date to invoice", + "options": "Lease" + }, + { + "columns": 3, + "fieldname": "lease_item", + "fieldtype": "Link", + "label": "Lease Item", + "options": "Item" + }, + { + "columns": 2, + "fieldname": "paid_by", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Paid By", + "options": "Customer", + "read_only": 1 + }, + { + "columns": 2, + "fieldname": "lease_item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Lease Item Name", + "read_only": 1 + }, + { + "columns": 2, + "fieldname": "invoice_number", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Invoice Number", + "options": "Sales Invoice" + }, + { + "columns": 1, + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty" + }, + { + "columns": 1, + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "options": "currency" + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "options": "Currency", + "read_only": 1 + }, + { + "columns": 1, + "fieldname": "tax", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Tax", + "read_only": 1 + }, + { + "fieldname": "schedule_start_date", + "fieldtype": "Date", + "label": "Schedule Start Date", + "read_only": 1 + }, + { + "fieldname": "invoice_item_group", + "fieldtype": "Select", + "label": "Invoice Item Group", + "options": "1\n2\n3" + }, + { + "fieldname": "sales_order_number", + "fieldtype": "Link", + "label": "Sales Order Number", + "options": "Sales Order" + }, + { + "fieldname": "document_type", + "fieldtype": "Select", + "label": "Document Type", + "options": "\nSales Invoice\nSales Order" + } + ], + "istable": 1, + "links": [], + "modified": "2022-05-28 15:13:40.233162", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Lease Invoice Schedule", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.py b/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.py new file mode 100644 index 0000000..f44a6b2 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_invoice_schedule/lease_invoice_schedule.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class LeaseInvoiceSchedule(Document): + pass diff --git a/propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.js b/propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.js new file mode 100644 index 0000000..ee17d65 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Lease Invoice Schedule", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Lease Invoice Schedule + () => frappe.tests.make('Lease Invoice Schedule', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.py b/propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.py new file mode 100644 index 0000000..d877077 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_invoice_schedule/test_lease_invoice_schedule.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestLeaseInvoiceSchedule(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/lease_item/__init__.py b/propms/property_management_solution/doctype/lease_item/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/lease_item/lease_item.js b/propms/property_management_solution/doctype/lease_item/lease_item.js new file mode 100644 index 0000000..76b9ee2 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_item/lease_item.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Lease Item', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/lease_item/lease_item.json b/propms/property_management_solution/doctype/lease_item/lease_item.json new file mode 100644 index 0000000..89bc1ae --- /dev/null +++ b/propms/property_management_solution/doctype/lease_item/lease_item.json @@ -0,0 +1,108 @@ +{ + "actions": [], + "autoname": "LI.#####", + "creation": "2018-05-01 22:14:35.767947", + "description": "Percentage of Witholding tax applicable to this item", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "lease_item", + "frequency", + "amount", + "currency_code", + "charge_basis", + "charge_rate", + "witholding_tax", + "paid_by", + "invoice_item_group", + "document_type" + ], + "fields": [ + { + "columns": 2, + "fieldname": "lease_item", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Lease Item", + "options": "Item" + }, + { + "columns": 1, + "fieldname": "frequency", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Frequency", + "options": "Monthly\nBi-Monthly\nQuarterly\nAnnually\n6 months" + }, + { + "columns": 1, + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "options": "currency_code" + }, + { + "columns": 1, + "default": "USD", + "fieldname": "currency_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Currency Code", + "options": "Currency" + }, + { + "fieldname": "charge_basis", + "fieldtype": "Select", + "label": "Charge basis", + "options": "\nBuilt-up Area\nCarpet Area" + }, + { + "fieldname": "charge_rate", + "fieldtype": "Data", + "label": "Charge Rate" + }, + { + "columns": 1, + "fieldname": "witholding_tax", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Witholding Tax" + }, + { + "columns": 2, + "fieldname": "paid_by", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Paid By", + "options": "Customer" + }, + { + "fieldname": "invoice_item_group", + "fieldtype": "Select", + "label": "Invoice Item Group", + "options": "1\n2\n3" + }, + { + "default": "Sales Invoice", + "fieldname": "document_type", + "fieldtype": "Select", + "label": "Document Type", + "options": "Sales Invoice\nSales Order", + "reqd": 1 + } + ], + "istable": 1, + "links": [], + "modified": "2022-06-20 17:25:38.629178", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Lease Item", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/lease_item/lease_item.py b/propms/property_management_solution/doctype/lease_item/lease_item.py new file mode 100644 index 0000000..dc69b9a --- /dev/null +++ b/propms/property_management_solution/doctype/lease_item/lease_item.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class LeaseItem(Document): + pass diff --git a/propms/property_management_solution/doctype/lease_item/test_lease_item.js b/propms/property_management_solution/doctype/lease_item/test_lease_item.js new file mode 100644 index 0000000..a589009 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_item/test_lease_item.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Lease Item", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Lease Item + () => frappe.tests.make('Lease Item', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/lease_item/test_lease_item.py b/propms/property_management_solution/doctype/lease_item/test_lease_item.py new file mode 100644 index 0000000..a5efc62 --- /dev/null +++ b/propms/property_management_solution/doctype/lease_item/test_lease_item.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestLeaseItem(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/meter/__init__.py b/propms/property_management_solution/doctype/meter/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/meter/meter.js b/propms/property_management_solution/doctype/meter/meter.js new file mode 100644 index 0000000..ff6cc36 --- /dev/null +++ b/propms/property_management_solution/doctype/meter/meter.js @@ -0,0 +1,18 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Meter', { + onload: function(frm) { + frm.set_query("meter_type", function(){ + return { + "filters": [ + ["Item","reading_required", "=", "1"] + ] + } + }); + + } +}); + + + diff --git a/propms/property_management_solution/doctype/meter/meter.json b/propms/property_management_solution/doctype/meter/meter.json new file mode 100644 index 0000000..2c487f2 --- /dev/null +++ b/propms/property_management_solution/doctype/meter/meter.json @@ -0,0 +1,198 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:meter_number", + "beta": 0, + "creation": "2019-06-26 15:04:46.442026", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 0, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "meter_number", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Meter Number", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "meter_type", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Meter Type", + "length": 0, + "no_copy": 0, + "options": "Item", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "initial_reading", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Initial Reading", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Status", + "length": 0, + "no_copy": 0, + "options": "Active\nInactive", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-06-26 18:44:58.114866", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Meter", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "ASC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/meter/meter.py b/propms/property_management_solution/doctype/meter/meter.py new file mode 100644 index 0000000..68270d4 --- /dev/null +++ b/propms/property_management_solution/doctype/meter/meter.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class Meter(Document): + pass diff --git a/propms/property_management_solution/doctype/meter/test_meter.js b/propms/property_management_solution/doctype/meter/test_meter.js new file mode 100644 index 0000000..95cb2ea --- /dev/null +++ b/propms/property_management_solution/doctype/meter/test_meter.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Meter", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Meter + () => frappe.tests.make('Meter', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/meter/test_meter.py b/propms/property_management_solution/doctype/meter/test_meter.py new file mode 100644 index 0000000..60710e7 --- /dev/null +++ b/propms/property_management_solution/doctype/meter/test_meter.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestMeter(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/meter_reading/__init__.py b/propms/property_management_solution/doctype/meter_reading/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/meter_reading/meter_reading.js b/propms/property_management_solution/doctype/meter_reading/meter_reading.js new file mode 100644 index 0000000..88d8849 --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading/meter_reading.js @@ -0,0 +1,82 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt +frappe.ui.form.on("Meter Reading", "onload", function(frm) { + frm.set_query("meter_type", function() { + return { + "filters": [ + ["Item", "reading_required", "=", "1"] + ] + } + }); +}); +frappe.ui.form.on('Meter Reading Detail', { + property: function(frm, cdt, cdn) { + var doc = locals[cdt][cdn] + console.log(doc.property) + console.log(cur_frm.doc.meter_type) + if (doc.property && cur_frm.doc.meter_type) { + frappe.call({ + method: "propms.auto_custom.get_active_meter_from_property", + args: { + 'property_id': doc.property, + 'meter_type': cur_frm.doc.meter_type + }, + callback: function(r) { + if (r.message) { + frappe.model.set_value(cdt, cdn, "meter_number", r.message) + } else { + frappe.model.set_value(cdt, cdn, "property", "") + frappe.model.set_value(cdt, cdn, "meter_number", "") + frappe.model.set_value(cdt, cdn, "previous_meter_reading", 0) + frappe.throw(_("Meter Does Not Exist For This Type")) + } + } + }) + } + }, + meter_number: function(frm, cdt, cdn) { + var doc = locals[cdt][cdn] + if (doc.meter_number && doc.property && cur_frm.doc.meter_type) { + frappe.call({ + method: "propms.auto_custom.get_previous_meter_reading", + args: { + 'meter_number': doc.meter_number, + 'property_id': doc.property, + 'meter_type': cur_frm.doc.meter_type + }, + callback: function(r) { + if (r.message) { + if (r.message["reading_date"]) { + frappe.model.set_value(cdt, cdn, "previous_reading_date", r.message["reading_date"]) + } + if (r.message["previous_reading"]) { + frappe.model.set_value(cdt, cdn, "previous_meter_reading", r.message["previous_reading"]) + } + } + } + + }) + } + }, + current_meter_reading: function(frm, cdt, cdn) { + var doc = locals[cdt][cdn] + if (parseFloat(doc.current_meter_reading) <= parseFloat(doc.previous_meter_reading)) { + frappe.model.set_value(cdt, cdn, "current_meter_reading", '') + frappe.throw("Current Meter Reading Must Be Greater Than Previous Reading") + } + // frappe.msgprint("Current meter reading value is: " + String(doc.current_meter_reading)) + if (doc.current_meter_reading) { + console.log(parseFloat(doc.current_meter_reading) - parseFloat(doc.previous_meter_reading)) + frappe.model.set_value(cdt, cdn, "reading_difference", parseFloat(doc.current_meter_reading) - parseFloat(doc.previous_meter_reading)) + } + } +}) + +cur_frm.fields_dict['meter_reading_detail'].grid.get_field('property').get_query = function(doc, cdt, cdn) { + return { + filters:[ + ['Property Meter Reading', 'meter_type', '=', cur_frm.doc.meter_type] + + ] + } +} diff --git a/propms/property_management_solution/doctype/meter_reading/meter_reading.json b/propms/property_management_solution/doctype/meter_reading/meter_reading.json new file mode 100644 index 0000000..2d8035c --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading/meter_reading.json @@ -0,0 +1,301 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "format:{meter_type}-{reading_date}", + "beta": 0, + "creation": "2019-04-08 13:02:06.643577", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 0, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "meter_type", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Meter Type", + "length": 0, + "no_copy": 0, + "options": "Item", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Today", + "fetch_if_empty": 0, + "fieldname": "reading_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Reading Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "section_break_3", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "meter_reading_detail", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Meter Reading Detail", + "length": 0, + "no_copy": 0, + "options": "Meter Reading Detail", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amended From", + "length": 0, + "no_copy": 1, + "options": "Meter Reading", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 1, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-07-29 14:57:56.687940", + "modified_by": "maheshwaribhavesh95863@gmail.com", + "module": "Property Management Solution", + "name": "Meter Reading", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Floor Maintenance Supervisor", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "ASC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/meter_reading/meter_reading.py b/propms/property_management_solution/doctype/meter_reading/meter_reading.py new file mode 100644 index 0000000..da29895 --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading/meter_reading.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class MeterReading(Document): + pass diff --git a/propms/property_management_solution/doctype/meter_reading/test_meter_reading.js b/propms/property_management_solution/doctype/meter_reading/test_meter_reading.js new file mode 100644 index 0000000..be38ad8 --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading/test_meter_reading.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Meter Reading", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Meter Reading + () => frappe.tests.make('Meter Reading', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/meter_reading/test_meter_reading.py b/propms/property_management_solution/doctype/meter_reading/test_meter_reading.py new file mode 100644 index 0000000..2b348ae --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading/test_meter_reading.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestMeterReading(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/meter_reading_detail/__init__.py b/propms/property_management_solution/doctype/meter_reading_detail/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.js b/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.js new file mode 100644 index 0000000..7dd1f1f --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Meter Reading Detail', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.json b/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.json new file mode 100644 index 0000000..c63ea32 --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.json @@ -0,0 +1,93 @@ +{ + "creation": "2019-04-08 13:01:58.226727", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "property", + "meter_number", + "previous_meter_reading", + "current_meter_reading", + "reading_difference", + "previous_reading_date", + "do_not_create_invoice", + "invoice_number" + ], + "fields": [ + { + "columns": 2, + "fieldname": "property", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Property", + "options": "Property", + "reqd": 1 + }, + { + "columns": 2, + "fieldname": "meter_number", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Meter Number", + "options": "Meter", + "read_only": 1 + }, + { + "columns": 2, + "default": "0", + "fieldname": "previous_meter_reading", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Previous Meter Reading", + "read_only": 1 + }, + { + "columns": 2, + "fieldname": "current_meter_reading", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Current Meter Reading", + "reqd": 1 + }, + { + "columns": 1, + "fieldname": "reading_difference", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Reading Difference", + "read_only": 1 + }, + { + "fieldname": "previous_reading_date", + "fieldtype": "Date", + "label": "Previous Reading Date", + "read_only": 1 + }, + { + "default": "0", + "fieldname": "do_not_create_invoice", + "fieldtype": "Check", + "label": "Do not create invoice" + }, + { + "allow_on_submit": 1, + "fieldname": "invoice_number", + "fieldtype": "Link", + "label": "Invoice number", + "options": "Sales Invoice", + "read_only": 1 + } + ], + "istable": 1, + "modified": "2020-11-06 22:13:55.717334", + "modified_by": "info@aakvatech.com", + "module": "Property Management Solution", + "name": "Meter Reading Detail", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "ASC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.py b/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.py new file mode 100644 index 0000000..0f910ff --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading_detail/meter_reading_detail.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class MeterReadingDetail(Document): + pass diff --git a/propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.js b/propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.js new file mode 100644 index 0000000..4b1eaca --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Meter Reading Detail", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Meter Reading Detail + () => frappe.tests.make('Meter Reading Detail', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.py b/propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.py new file mode 100644 index 0000000..d414da4 --- /dev/null +++ b/propms/property_management_solution/doctype/meter_reading_detail/test_meter_reading_detail.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestMeterReadingDetail(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/multiselect_item_group/__init__.py b/propms/property_management_solution/doctype/multiselect_item_group/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.json b/propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.json new file mode 100644 index 0000000..7d5ffd7 --- /dev/null +++ b/propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.json @@ -0,0 +1,29 @@ +{ + "creation": "2020-03-06 21:35:58.455911", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "item_group" + ], + "fields": [ + { + "fieldname": "item_group", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Group", + "options": "Item Group" + } + ], + "istable": 1, + "modified": "2020-03-06 22:14:46.135224", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "MultiSelect Item Group", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.py b/propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.py new file mode 100644 index 0000000..5f4e55e --- /dev/null +++ b/propms/property_management_solution/doctype/multiselect_item_group/multiselect_item_group.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals + +# import frappe +from frappe.model.document import Document + + +class MultiSelectItemGroup(Document): + pass diff --git a/propms/property_management_solution/doctype/outsource_contact/__init__.py b/propms/property_management_solution/doctype/outsource_contact/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/outsource_contact/outsource_contact.js b/propms/property_management_solution/doctype/outsource_contact/outsource_contact.js new file mode 100644 index 0000000..2e29c3b --- /dev/null +++ b/propms/property_management_solution/doctype/outsource_contact/outsource_contact.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Outsource Contact', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/outsource_contact/outsource_contact.json b/propms/property_management_solution/doctype/outsource_contact/outsource_contact.json new file mode 100644 index 0000000..8ad9504 --- /dev/null +++ b/propms/property_management_solution/doctype/outsource_contact/outsource_contact.json @@ -0,0 +1,142 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:full_name", + "beta": 0, + "creation": "2019-01-04 17:52:30.306251", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 3, + "fieldname": "full_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Full Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fieldname": "id_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": " ID No.", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 2, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Status", + "length": 0, + "no_copy": 0, + "options": "Active\nInactive", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2019-01-04 19:26:16.314064", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsource Contact", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "full_name", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/outsource_contact/outsource_contact.py b/propms/property_management_solution/doctype/outsource_contact/outsource_contact.py new file mode 100644 index 0000000..a49be7a --- /dev/null +++ b/propms/property_management_solution/doctype/outsource_contact/outsource_contact.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class OutsourceContact(Document): + pass diff --git a/propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.js b/propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.js new file mode 100644 index 0000000..7bb31ce --- /dev/null +++ b/propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Outsource Contact", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Outsource Contact + () => frappe.tests.make('Outsource Contact', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.py b/propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.py new file mode 100644 index 0000000..af8252e --- /dev/null +++ b/propms/property_management_solution/doctype/outsource_contact/test_outsource_contact.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestOutsourceContact(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_attendance/__init__.py b/propms/property_management_solution/doctype/outsourcing_attendance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.js b/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.js new file mode 100644 index 0000000..48d09a1 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.js @@ -0,0 +1,52 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +cur_frm.add_fetch('shift_name', 'outsourcing_category', 'outsourcing_category_name'); + +frappe.ui.form.on('Outsourcing Attendance', 'shift_name', function(frm, cdt, cdn) { + var doc = locals[cdt][cdn]; + if (doc.shift_name) { + frappe.call({ + method: "frappe.client.get", + args: { + name: doc.shift_name, + doctype: "Outsourcing Shift" + }, + callback(r) { + console.log(r); + if (r.message) { + for (var row in r.message.shift_location) { + var child = frm.add_child("attendance_details"); + frappe.model.set_value(child.doctype, child.name, "position", r.message.shift_location[row].location_name); + refresh_field("attendance_details"); + } + } + } + }) + } +}); + +cur_frm.fields_dict['attendance_details'].grid.get_field('person_name').get_query = function(doc, cdt, cdn) { + var child = locals[cdt][cdn]; + return { + filters: [ + ['Outsource Contact', 'parent', '=', cur_frm.doc.outsourcing_category_name ], + ['Outsource Contact', 'status', '=', 'Active' ] + ] + } +}; + +frappe.ui.form.on('Outsourcing Attendance Details', { + person_name:function(frm,cdt,cdn){ + var row=locals[cdt][cdn]; + var doc=locals['Outsourcing Attendance'][row.parent]; + for(var item in doc.attendance_details){ + if(doc.attendance_details[item].person_name!="" && doc.attendance_details[item].person_name==row.person_name){ + if(doc.attendance_details[item].name!=row.name){ + frappe.model.set_value(cdt,cdn,"person_name",""); + frappe.throw("Person already selected, please select a different person."); + } + } + } + } +}); diff --git a/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.json b/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.json new file mode 100644 index 0000000..f287e32 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.json @@ -0,0 +1,299 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "naming_series:", + "beta": 0, + "color": "#ff0102", + "creation": "2018-12-12 10:50:44.279663", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "shift_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Shift Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "shift_name", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Shift Name", + "length": 0, + "no_copy": 0, + "options": "Outsourcing Shift", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "outsourcing_category_name", + "fieldtype": "Link", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Outsourcing Category Name", + "length": 0, + "no_copy": 0, + "options": "Outsourcing Category", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "attendance_details", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Attendance Details", + "length": 0, + "no_copy": 0, + "options": "Outsourcing Attendance Details", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "naming_series", + "fieldtype": "Data", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "naming_series", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amended From", + "length": 0, + "no_copy": 1, + "options": "Outsourcing Attendance", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "octicon octicon-clippy", + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 1, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-01-16 15:54:32.839686", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Attendance", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Job in-charge", + "set_user_permissions": 0, + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Floor Maintenance Supervisor", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.py b/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.py new file mode 100644 index 0000000..5de918a --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_attendance/outsourcing_attendance.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class OutsourcingAttendance(Document): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.js b/propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.js new file mode 100644 index 0000000..db5e8f4 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Outsourcing Attendance", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Outsourcing Attendance + () => frappe.tests.make('Outsourcing Attendance', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.py b/propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.py new file mode 100644 index 0000000..909a56a --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_attendance/test_outsourcing_attendance.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestOutsourcingAttendance(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_attendance_details/__init__.py b/propms/property_management_solution/doctype/outsourcing_attendance_details/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.json b/propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.json new file mode 100644 index 0000000..3506b03 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.json @@ -0,0 +1,174 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-12-12 10:54:24.160839", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "person_name", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Person Name", + "length": 0, + "no_copy": 0, + "options": "Outsource Contact", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "position", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Position", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Status", + "length": 0, + "no_copy": 0, + "options": "\nPresent\nAbsent\nDay off", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:child.status == 'Absent'", + "fieldname": "remarks", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Remarks ( If absent )", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2019-01-04 17:53:56.183412", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Attendance Details", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.py b/propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.py new file mode 100644 index 0000000..06efbb0 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_attendance_details/outsourcing_attendance_details.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class OutsourcingAttendanceDetails(Document): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_category/__init__.py b/propms/property_management_solution/doctype/outsourcing_category/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.js b/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.js new file mode 100644 index 0000000..dfc7b81 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Outsourcing Category', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.json b/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.json new file mode 100644 index 0000000..6540e89 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.json @@ -0,0 +1,130 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:outsourcing_category", + "beta": 0, + "creation": "2019-01-04 18:27:02.061202", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "outsourcing_category", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Outsourcing Category", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "outsource_contact", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Outsource Contact", + "length": 0, + "no_copy": 0, + "options": "Outsource Contact", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-01-04 19:19:21.239207", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Category", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "title_field": "outsourcing_category", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.py b/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.py new file mode 100644 index 0000000..2316b31 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_category/outsourcing_category.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class OutsourcingCategory(Document): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.js b/propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.js new file mode 100644 index 0000000..74f7a1b --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Outsourcing Category", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Outsourcing Category + () => frappe.tests.make('Outsourcing Category', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.py b/propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.py new file mode 100644 index 0000000..69dbdae --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_category/test_outsourcing_category.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestOutsourcingCategory(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_shift/__init__.py b/propms/property_management_solution/doctype/outsourcing_shift/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.js b/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.js new file mode 100644 index 0000000..ba5901b --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Outsourcing Shift', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.json b/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.json new file mode 100644 index 0000000..593a8ce --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.json @@ -0,0 +1,162 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 1, + "autoname": "field:shift_name", + "beta": 0, + "creation": "2018-12-12 11:19:14.451898", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "shift_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Shift Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "outsourcing_category", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Outsourcing Category", + "length": 0, + "no_copy": 0, + "options": "Outsourcing Category", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "shift_location", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Shift Location", + "length": 0, + "no_copy": 0, + "options": "Outsourcing Shift Location", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2019-01-04 19:08:14.311381", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Shift", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.py b/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.py new file mode 100644 index 0000000..671acc0 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_shift/outsourcing_shift.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class OutsourcingShift(Document): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.js b/propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.js new file mode 100644 index 0000000..69a96a7 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Outsourcing Shift", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Outsourcing Shift + () => frappe.tests.make('Outsourcing Shift', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.py b/propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.py new file mode 100644 index 0000000..1ab8d31 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_shift/test_outsourcing_shift.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestOutsourcingShift(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/outsourcing_shift_location/__init__.py b/propms/property_management_solution/doctype/outsourcing_shift_location/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.json b/propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.json new file mode 100644 index 0000000..7e1f27f --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.json @@ -0,0 +1,75 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-12-12 11:19:47.533687", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "location_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Location Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-12-12 11:19:47.533687", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Shift Location", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.py b/propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.py new file mode 100644 index 0000000..8a27d18 --- /dev/null +++ b/propms/property_management_solution/doctype/outsourcing_shift_location/outsourcing_shift_location.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class OutsourcingShiftLocation(Document): + pass diff --git a/propms/property_management_solution/doctype/paint/__init__.py b/propms/property_management_solution/doctype/paint/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/paint/paint.json b/propms/property_management_solution/doctype/paint/paint.json new file mode 100644 index 0000000..0593b3d --- /dev/null +++ b/propms/property_management_solution/doctype/paint/paint.json @@ -0,0 +1,108 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "CLR.#####", + "beta": 0, + "creation": "2018-04-19 23:33:16.203944", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "description", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "color_code", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Color Code", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-20 00:09:36.523037", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Paint", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/paint/paint.py b/propms/property_management_solution/doctype/paint/paint.py new file mode 100644 index 0000000..a7252f5 --- /dev/null +++ b/propms/property_management_solution/doctype/paint/paint.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class Paint(Document): + pass diff --git a/propms/property_management_solution/doctype/property/__init__.py b/propms/property_management_solution/doctype/property/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/property/property.js b/propms/property_management_solution/doctype/property/property.js new file mode 100644 index 0000000..994859f --- /dev/null +++ b/propms/property_management_solution/doctype/property/property.js @@ -0,0 +1,52 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Property', { + refresh: function(frm) { + + }, + setup: function(frm) { + frm.set_query("cost_center", function() { + return { + "filters": { + "company": frm.doc.company, + }, + }; + }); + + frm.set_query("parent_property", {is_group: 1}); + }, + company: function(frm) { + frm.set_value("cost_center", ""); + }, +}); + +frappe.ui.form.on('Property Meter Reading', { + meter_number: function(frm,cdt,cdn) { + var property_doc = locals[cur_frm.doc.doctype][cur_frm.doc.name]; + var meter_doc = locals[cdt][cdn]; + if (meter_doc.meter_number != "") { + $.each(property_doc.property_meter_reading, function(i, d) { + if(d.name!=meter_doc.name && meter_doc.meter_type==d.meter_type && d.status=="Active") { + var msg="Another Active Meter of type "+meter_doc.meter_type+" Is Already allocated. Please de-activate it before adding a new meter of same type." + frappe.model.set_value(cdt,cdn,"meter_number",'') + frappe.throw(msg) + } + }) + } + }, + status: function(frm,cdt,cdn) { + var property_doc = locals[cur_frm.doc.doctype][cur_frm.doc.name]; + var meter_doc = locals[cdt][cdn]; + if (meter_doc.meter_number != "") { + $.each(property_doc.property_meter_reading, function(i, d) { + if(d.name!=meter_doc.name && meter_doc.meter_type==d.meter_type && d.status=="Active") { + var msg="Another Active Meter of type "+meter_doc.meter_type+" Is Already allocated. Please de-activate it before adding a new meter of same type." + frappe.model.set_value(cdt,cdn,"status",'') + frappe.throw(msg) + } + }) + } + } +}) + diff --git a/propms/property_management_solution/doctype/property/property.json b/propms/property_management_solution/doctype/property/property.json new file mode 100644 index 0000000..b68bf9d --- /dev/null +++ b/propms/property_management_solution/doctype/property/property.json @@ -0,0 +1,372 @@ +{ + "actions": [], + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:name1", + "color": "#ff0102", + "creation": "2018-11-22 23:15:45.736517", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "identification_section", + "name1", + "parent_property", + "is_group", + "column_break_2", + "photo", + "company", + "cost_center", + "section_break_4", + "unit_owner", + "title_deed_number", + "type", + "column_break_9", + "bedroom", + "master_bedroom", + "common_bathroom", + "section_break_13", + "builtup_area", + "carpet_area", + "facing", + "no_of_parking", + "column_break_18", + "rent", + "security_deposit", + "smoking", + "furnished", + "status", + "section_break_22", + "unit_assets", + "column_break_24", + "amenity_name", + "property_meters_section", + "property_meter_reading", + "description_section", + "description", + "lft", + "rgt", + "old_parent" + ], + "fields": [ + { + "bold": 1, + "fieldname": "identification_section", + "fieldtype": "Section Break", + "label": "IDENTIFICATION" + }, + { + "fieldname": "name1", + "fieldtype": "Data", + "label": "Name", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "parent_property", + "fieldtype": "Link", + "label": "Parent property", + "options": "Property" + }, + { + "fieldname": "column_break_2", + "fieldtype": "Column Break" + }, + { + "fieldname": "photo", + "fieldtype": "Attach Image", + "hidden": 1, + "label": "Photo" + }, + { + "bold": 1, + "fieldname": "section_break_4", + "fieldtype": "Section Break", + "label": "UNIT CHARACTERISTICS" + }, + { + "fieldname": "unit_owner", + "fieldtype": "Link", + "label": "Unit Owner", + "options": "Customer" + }, + { + "fieldname": "title_deed_number", + "fieldtype": "Data", + "label": "Title deed number" + }, + { + "fieldname": "type", + "fieldtype": "Link", + "label": "Type", + "options": "Unit Type" + }, + { + "fieldname": "column_break_9", + "fieldtype": "Column Break" + }, + { + "fieldname": "bedroom", + "fieldtype": "Int", + "label": "Bedroom" + }, + { + "fieldname": "master_bedroom", + "fieldtype": "Int", + "label": "Master bedroom" + }, + { + "fieldname": "common_bathroom", + "fieldtype": "Int", + "label": "Common bathroom" + }, + { + "bold": 1, + "collapsible": 1, + "fieldname": "section_break_13", + "fieldtype": "Section Break", + "label": "UNIT DETAILS" + }, + { + "fieldname": "builtup_area", + "fieldtype": "Float", + "label": "Builtup area" + }, + { + "fieldname": "carpet_area", + "fieldtype": "Float", + "label": "Carpet area" + }, + { + "fieldname": "facing", + "fieldtype": "Select", + "label": "Facing", + "options": "North\nNorth-East\nEast\nSouth-East\nWest\nNorth-West\nSouth-West\nSouth" + }, + { + "fieldname": "no_of_parking", + "fieldtype": "Int", + "label": "No of parking" + }, + { + "fieldname": "column_break_18", + "fieldtype": "Column Break" + }, + { + "fieldname": "rent", + "fieldtype": "Currency", + "label": "Rent", + "permlevel": 2 + }, + { + "fieldname": "security_deposit", + "fieldtype": "Currency", + "label": "Security Deposit", + "permlevel": 2 + }, + { + "default": "0", + "fieldname": "smoking", + "fieldtype": "Check", + "label": "Smoking" + }, + { + "default": "0", + "fieldname": "furnished", + "fieldtype": "Check", + "label": "Furnished" + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "Available\nBooked\nCommon Area (Not for lease)\nManaged for Customer\nOff Lease in 3 Months\nOn Lease\nOn Sale\nRemoved\nRenewal\nSold\nVacating\nOn lease" + }, + { + "bold": 1, + "collapsible": 1, + "fieldname": "section_break_22", + "fieldtype": "Section Break", + "label": "MORE INFORMATION" + }, + { + "fieldname": "unit_assets", + "fieldtype": "Table", + "label": "Unit Assets", + "options": "Unit Assets" + }, + { + "fieldname": "column_break_24", + "fieldtype": "Column Break" + }, + { + "fieldname": "amenity_name", + "fieldtype": "Table", + "label": "Amenity Name", + "options": "Property Amenity" + }, + { + "fieldname": "property_meters_section", + "fieldtype": "Section Break", + "label": "Property Meters" + }, + { + "fieldname": "property_meter_reading", + "fieldtype": "Table", + "label": "Property Meter Reading", + "options": "Property Meter Reading" + }, + { + "fieldname": "description_section", + "fieldtype": "Section Break" + }, + { + "fieldname": "description", + "fieldtype": "Text", + "label": "DESCRIPTION" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Cost Center", + "options": "Cost Center", + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "options": "Company", + "reqd": 1 + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "label": "Left", + "no_copy": 1, + "read_only": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "label": "Right", + "no_copy": 1, + "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_group", + "fieldtype": "Check", + "label": "Is Group" + }, + { + "fieldname": "old_parent", + "fieldtype": "Link", + "hidden": 1, + "label": "Old Parent", + "options": "Property", + "read_only": 1 + }, + { + "fieldname": "parent_property", + "fieldtype": "Link", + "label": "Parent property", + "options": "Property" + } + ], + "icon": "octicon octicon-home", + "image_field": "photo", + "is_tree": 1, + "links": [], + "modified": "2021-12-29 14:57:26.678556", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property", + "nsm_parent_field": "parent_property", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "delete": 1, + "email": 1, + "export": 1, + "permlevel": 2, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Floor Maintenance Supervisor", + "share": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Job in-charge", + "share": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Manager", + "share": 1 + }, + { + "delete": 1, + "email": 1, + "export": 1, + "permlevel": 2, + "print": 1, + "read": 1, + "report": 1, + "role": "Property Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Property Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/property/property.py b/propms/property_management_solution/doctype/property/property.py new file mode 100644 index 0000000..477563f --- /dev/null +++ b/propms/property_management_solution/doctype/property/property.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.utils.nestedset import NestedSet +import frappe + + +class Property(NestedSet): + nsm_parent_field = "parent_property" + + def on_trash(self, allow_root_deletion=True): + super().on_trash(allow_root_deletion) + + +@frappe.whitelist() +def add_node(): + from frappe.desk.treeview import make_tree_args + + args = frappe.form_dict + args = make_tree_args(**frappe.form_dict) + + if args["is_root"]: + args["parent_property"] = None + + doc = frappe.get_doc(args) + + doc.save() diff --git a/propms/property_management_solution/doctype/property/property_tree.js b/propms/property_management_solution/doctype/property/property_tree.js new file mode 100644 index 0000000..3d2b59a --- /dev/null +++ b/propms/property_management_solution/doctype/property/property_tree.js @@ -0,0 +1,13 @@ +frappe.treeview_settings["Property"] = { + add_tree_node: "propms.property_management_solution.doctype.property.property.add_node", + filters: [ + { + fieldname: "company", + fieldtype:"Link", + options: "Company", + label: __("Company"), + default: frappe.user_defaults.company, + }, + ], + root_label: __("All Property"), +} diff --git a/propms/property_management_solution/doctype/property/test_property.js b/propms/property_management_solution/doctype/property/test_property.js new file mode 100644 index 0000000..75ea0aa --- /dev/null +++ b/propms/property_management_solution/doctype/property/test_property.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Property", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Property + () => frappe.tests.make('Property', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/property/test_property.py b/propms/property_management_solution/doctype/property/test_property.py new file mode 100644 index 0000000..7c400f4 --- /dev/null +++ b/propms/property_management_solution/doctype/property/test_property.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestProperty(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/property_amenity/__init__.py b/propms/property_management_solution/doctype/property_amenity/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/property_amenity/property_amenity.js b/propms/property_management_solution/doctype/property_amenity/property_amenity.js new file mode 100644 index 0000000..3350ccc --- /dev/null +++ b/propms/property_management_solution/doctype/property_amenity/property_amenity.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Property Amenity', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/property_amenity/property_amenity.json b/propms/property_management_solution/doctype/property_amenity/property_amenity.json new file mode 100644 index 0000000..ebadbf5 --- /dev/null +++ b/propms/property_management_solution/doctype/property_amenity/property_amenity.json @@ -0,0 +1,34 @@ +{ + "actions": [], + "autoname": "format:amenity_name-{##}", + "creation": "2018-11-22 23:17:10.604222", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "amenity_name" + ], + "fields": [ + { + "fieldname": "amenity_name", + "fieldtype": "Select", + "in_global_search": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Amenity Name", + "options": "Club house\nElevator\nIn unit laundry\nTennis court\nDoor attendant\nFitness center\nOff-street Parking\nStorage\nWheelchair access\nRooftop patio\nPlayground\nHot tub\nBbq area" + } + ], + "istable": 1, + "links": [], + "modified": "2021-09-17 11:45:39.214872", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property Amenity", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/property_amenity/property_amenity.py b/propms/property_management_solution/doctype/property_amenity/property_amenity.py new file mode 100644 index 0000000..29a4da9 --- /dev/null +++ b/propms/property_management_solution/doctype/property_amenity/property_amenity.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class PropertyAmenity(Document): + pass diff --git a/propms/property_management_solution/doctype/property_amenity/test_property_amenity.js b/propms/property_management_solution/doctype/property_amenity/test_property_amenity.js new file mode 100644 index 0000000..5204ed5 --- /dev/null +++ b/propms/property_management_solution/doctype/property_amenity/test_property_amenity.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Property Amenity", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Property Amenity + () => frappe.tests.make('Property Amenity', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/property_amenity/test_property_amenity.py b/propms/property_management_solution/doctype/property_amenity/test_property_amenity.py new file mode 100644 index 0000000..388d426 --- /dev/null +++ b/propms/property_management_solution/doctype/property_amenity/test_property_amenity.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestPropertyAmenity(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/property_management_settings/__init__.py b/propms/property_management_solution/doctype/property_management_settings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/property_management_settings/property_management_settings.js b/propms/property_management_solution/doctype/property_management_settings/property_management_settings.js new file mode 100644 index 0000000..adc5536 --- /dev/null +++ b/propms/property_management_solution/doctype/property_management_settings/property_management_settings.js @@ -0,0 +1,6 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Property Management Settings', { + +}); diff --git a/propms/property_management_solution/doctype/property_management_settings/property_management_settings.json b/propms/property_management_solution/doctype/property_management_settings/property_management_settings.json new file mode 100644 index 0000000..26b57e1 --- /dev/null +++ b/propms/property_management_solution/doctype/property_management_settings/property_management_settings.json @@ -0,0 +1,147 @@ +{ + "actions": [], + "creation": "2019-01-10 09:46:13.704896", + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "company", + "section_break_2", + "security_deposit_item", + "column_break_5", + "security_deposit_payment_type", + "damage_charge_item", + "section_break_8", + "column_break_10", + "section_break_9", + "invoice_start_date", + "section_break_12", + "group_maintenance_job_items", + "submit_maintenance_invoice", + "column_break_14", + "maintenance_item_group", + "section_break_17", + "self_consumption_customer" + ], + "fields": [ + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company" + }, + { + "fieldname": "security_deposit_item", + "fieldtype": "Link", + "label": "Security Deposit Item", + "options": "Item" + }, + { + "fieldname": "damage_charge_item", + "fieldtype": "Link", + "label": "Damage Charge Item", + "options": "Item" + }, + { + "fieldname": "security_deposit_payment_type", + "fieldtype": "Link", + "label": "Security Deposit Payment Type", + "options": "Mode of Payment" + }, + { + "default": "0", + "fieldname": "group_maintenance_job_items", + "fieldtype": "Check", + "label": "Group Maintenance Job Items" + }, + { + "fieldname": "section_break_2", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_5", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_8", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_10", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_12", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_14", + "fieldtype": "Column Break" + }, + { + "fieldname": "maintenance_item_group", + "fieldtype": "Table MultiSelect", + "label": "Maintenance Item Group", + "options": "MultiSelect Item Group" + }, + { + "default": "0", + "fieldname": "submit_maintenance_invoice", + "fieldtype": "Check", + "label": "Submit Maintenance Invoice" + }, + { + "fieldname": "section_break_17", + "fieldtype": "Section Break" + }, + { + "fieldname": "self_consumption_customer", + "fieldtype": "Link", + "label": "Self Consumption Customer", + "options": "Customer" + }, + { + "fieldname": "section_break_9", + "fieldtype": "Section Break" + }, + { + "fieldname": "invoice_start_date", + "fieldtype": "Date", + "label": "Invoice Start Date" + } + ], + "index_web_pages_for_search": 1, + "issingle": 1, + "links": [], + "modified": "2021-09-27 12:28:52.887903", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property Management Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "Property Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/property_management_settings/property_management_settings.py b/propms/property_management_solution/doctype/property_management_settings/property_management_settings.py new file mode 100644 index 0000000..3573d6a --- /dev/null +++ b/propms/property_management_solution/doctype/property_management_settings/property_management_settings.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class PropertyManagementSettings(Document): + pass diff --git a/propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.js b/propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.js new file mode 100644 index 0000000..4207409 --- /dev/null +++ b/propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Property Management Settings", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Property Management Settings + () => frappe.tests.make('Property Management Settings', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.py b/propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.py new file mode 100644 index 0000000..52771dd --- /dev/null +++ b/propms/property_management_solution/doctype/property_management_settings/test_property_management_settings.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestPropertyManagementSettings(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/property_meter_reading/__init__.py b/propms/property_management_solution/doctype/property_meter_reading/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.js b/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.js new file mode 100644 index 0000000..2ed1170 --- /dev/null +++ b/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.js @@ -0,0 +1,8 @@ +// Copyright (c) 2019, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Property Meter Reading', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.json b/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.json new file mode 100644 index 0000000..0cdc316 --- /dev/null +++ b/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.json @@ -0,0 +1,317 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2019-04-08 12:57:29.643398", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "meter_number", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Meter Number", + "length": 0, + "no_copy": 0, + "options": "Meter", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_from": "meter_number.meter_type", + "fetch_if_empty": 0, + "fieldname": "meter_type", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Meter Type", + "length": 0, + "no_copy": 0, + "options": "Item", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Today", + "fetch_if_empty": 0, + "fieldname": "installation_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Installation Date", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "0", + "fetch_if_empty": 0, + "fieldname": "initial_meter_reading", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Initial Meter Reading", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "invoice_customer", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Invoice Customer", + "length": 0, + "no_copy": 0, + "options": "Customer", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Status", + "length": 0, + "no_copy": 0, + "options": "Active\nInactive", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval: status==\"Inactive\"", + "fetch_if_empty": 0, + "fieldname": "deactivation_date", + "fieldtype": "Date", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Deactivation Date", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fetch_if_empty": 0, + "fieldname": "property_number", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Property Number", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2019-08-13 15:27:36.195445", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property Meter Reading", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "ASC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.py b/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.py new file mode 100644 index 0000000..279401e --- /dev/null +++ b/propms/property_management_solution/doctype/property_meter_reading/property_meter_reading.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class PropertyMeterReading(Document): + pass diff --git a/propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.js b/propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.js new file mode 100644 index 0000000..dc2bb7a --- /dev/null +++ b/propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Property Meter Reading", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Property Meter Reading + () => frappe.tests.make('Property Meter Reading', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.py b/propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.py new file mode 100644 index 0000000..200d12a --- /dev/null +++ b/propms/property_management_solution/doctype/property_meter_reading/test_property_meter_reading.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2019, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestPropertyMeterReading(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/property_unit/__init__.py b/propms/property_management_solution/doctype/property_unit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/property_unit/property_unit.json b/propms/property_management_solution/doctype/property_unit/property_unit.json new file mode 100644 index 0000000..3c212a1 --- /dev/null +++ b/propms/property_management_solution/doctype/property_unit/property_unit.json @@ -0,0 +1,689 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "format:unit_number-{##}", + "beta": 0, + "creation": "2018-04-18 23:21:16.452013", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "unit_number", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Unit Number", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "name1", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_global_search": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "photo", + "fieldtype": "Attach Image", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Photo", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "unit_owner", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Unit Owner", + "length": 0, + "no_copy": 0, + "options": "Contact", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "title_deed_number", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Title deed number", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "type", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Type", + "length": 0, + "no_copy": 0, + "options": "Unit Type", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "bedroom", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Bedroom", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "master_bedroom", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Master bedroom", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "common_bathroom", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Common bathroom", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "builtup_area", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Builtup area", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "carpet_area", + "fieldtype": "Float", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Carpet area", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "facing", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Facing", + "length": 0, + "no_copy": 0, + "options": "North\nNorth-East\nEast\nSouth-East\nWest\nNorth-West\nSouth-West\nSouth", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "no_of_parking", + "fieldtype": "Int", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "No of parking", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "unit_assets", + "fieldtype": "Table", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Unit Assets", + "length": 0, + "no_copy": 0, + "options": "Unit Assets", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "rent", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Rent", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "security_deposit", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Security Deposit", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "smoking", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Smoking", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "furnished", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Furnished", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "description", + "fieldtype": "Text", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Description", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "status_active", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Status active", + "length": 0, + "no_copy": 0, + "options": "Available\nBooked\nSale\nOn Lease\nOff Lease in 3 Months\nSold\nManaged for customer", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-22 22:59:04.976445", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property Unit", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} diff --git a/propms/property_management_solution/doctype/property_unit/property_unit.py b/propms/property_management_solution/doctype/property_unit/property_unit.py new file mode 100644 index 0000000..03ed1ab --- /dev/null +++ b/propms/property_management_solution/doctype/property_unit/property_unit.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class PropertyUnit(Document): + pass diff --git a/propms/property_management_solution/doctype/security_attendance/__init__.py b/propms/property_management_solution/doctype/security_attendance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/security_attendance/security_attendance.js b/propms/property_management_solution/doctype/security_attendance/security_attendance.js new file mode 100644 index 0000000..8b3d6fc --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance/security_attendance.js @@ -0,0 +1,34 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +cur_frm.add_fetch('guard_empid', 'employee_name', 'guard_name'); +frappe.ui.form.on('Security Attendance', 'shift_name', function(frm, cdt, cdn) { + var doc = locals[cdt][cdn]; + if (doc.shift_name) { + frappe.call({ + method: "frappe.client.get", + args: { + name: doc.shift_name, + doctype: "Guard Shift" + }, + callback(r) { + console.log(r); + if (r.message) { + for (var row in r.message.shift_location) { + var child = frm.add_child("attendance_details"); + frappe.model.set_value(child.doctype, child.name, "position", r.message.shift_location[row].location_name); + refresh_field("attendance_details"); + } + } + } + }) + } +}) +cur_frm.fields_dict['attendance_details'].grid.get_field('guard_empid').get_query = function(doc, cdt, cdn) { + var child = locals[cdt][cdn] + return { + filters: [ + ['Employee', 'department', 'like', 'Security -%'] + ] + } +}; \ No newline at end of file diff --git a/propms/property_management_solution/doctype/security_attendance/security_attendance.json b/propms/property_management_solution/doctype/security_attendance/security_attendance.json new file mode 100644 index 0000000..53824fa --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance/security_attendance.json @@ -0,0 +1,102 @@ +{ + "_user_tags": ",PropMS", + "autoname": "naming_series:", + "color": "#ff0102", + "creation": "2018-12-07 15:50:25.659269", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "shift_date", + "shift_name", + "attendance_details", + "amended_from", + "naming_series" + ], + "fields": [ + { + "fieldname": "shift_date", + "fieldtype": "Date", + "label": "Shift Date" + }, + { + "fieldname": "shift_name", + "fieldtype": "Link", + "label": "Shift Name", + "options": "Guard Shift" + }, + { + "fieldname": "attendance_details", + "fieldtype": "Table", + "label": "Attendance Details", + "options": "Security Attendance Details" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Security Attendance", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "naming_series", + "fieldtype": "Data", + "label": "naming_series", + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "octicon octicon-clippy", + "is_submittable": 1, + "modified": "2019-12-05 16:49:29.347921", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Security Attendance", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Job in-charge", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Floor Maintenance Supervisor", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/security_attendance/security_attendance.py b/propms/property_management_solution/doctype/security_attendance/security_attendance.py new file mode 100644 index 0000000..92fd102 --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance/security_attendance.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class SecurityAttendance(Document): + pass diff --git a/propms/property_management_solution/doctype/security_attendance/test_security_attendance.js b/propms/property_management_solution/doctype/security_attendance/test_security_attendance.js new file mode 100644 index 0000000..0b6478c --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance/test_security_attendance.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Security Attendance", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Security Attendance + () => frappe.tests.make('Security Attendance', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/security_attendance/test_security_attendance.py b/propms/property_management_solution/doctype/security_attendance/test_security_attendance.py new file mode 100644 index 0000000..51f5833 --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance/test_security_attendance.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestSecurityAttendance(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/security_attendance_details/__init__.py b/propms/property_management_solution/doctype/security_attendance_details/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.js b/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.js new file mode 100644 index 0000000..1402e1b --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.js @@ -0,0 +1,10 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +cur_frm.set_query("guard_empid", function() { + return { + "filters": { + "department": ["like", "Security - "] + } + } +}); \ No newline at end of file diff --git a/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.json b/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.json new file mode 100644 index 0000000..d97f462 --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.json @@ -0,0 +1,238 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-12-07 15:18:37.833257", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "guard_empid", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Guard EmpID", + "length": 0, + "no_copy": 0, + "options": "Employee", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "guard_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Guard Name", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "id_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "ID No.", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "position", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Position", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "status", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Status", + "length": 0, + "no_copy": 0, + "options": "\nPresent\nAbsent\nDay off", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "depends_on": "eval:child.status == 'Absent'", + "fieldname": "remarks", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Remarks ( If absent )", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-12-11 15:42:14.355409", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Security Attendance Details", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.py b/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.py new file mode 100644 index 0000000..4a41de5 --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance_details/security_attendance_details.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class SecurityAttendanceDetails(Document): + pass diff --git a/propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.js b/propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.js new file mode 100644 index 0000000..1967ac7 --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Security Attendance Details", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Security Attendance Details + () => frappe.tests.make('Security Attendance Details', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.py b/propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.py new file mode 100644 index 0000000..f047a1f --- /dev/null +++ b/propms/property_management_solution/doctype/security_attendance_details/test_security_attendance_details.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestSecurityAttendanceDetails(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/security_deposit_details/__init__.py b/propms/property_management_solution/doctype/security_deposit_details/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.js b/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.js new file mode 100644 index 0000000..78edbfc --- /dev/null +++ b/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Security Deposit Details', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.json b/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.json new file mode 100644 index 0000000..4dedd40 --- /dev/null +++ b/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.json @@ -0,0 +1,191 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-11-19 14:39:31.796515", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "apartment_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Apartment No", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "bhk", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "BHK", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "amount", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Amount", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "remarks", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Remarks", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-11-22 21:10:15.815847", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Security Deposit Details", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.py b/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.py new file mode 100644 index 0000000..ba9f161 --- /dev/null +++ b/propms/property_management_solution/doctype/security_deposit_details/security_deposit_details.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class SecurityDepositDetails(Document): + pass diff --git a/propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.js b/propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.js new file mode 100644 index 0000000..10b83c3 --- /dev/null +++ b/propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Security Deposit Details", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Security Deposit Details + () => frappe.tests.make('Security Deposit Details', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.py b/propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.py new file mode 100644 index 0000000..5df5dee --- /dev/null +++ b/propms/property_management_solution/doctype/security_deposit_details/test_security_deposit_details.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestSecurityDepositDetails(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/tool_item/__init__.py b/propms/property_management_solution/doctype/tool_item/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/tool_item/tool_item.json b/propms/property_management_solution/doctype/tool_item/tool_item.json new file mode 100644 index 0000000..ca0072b --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item/tool_item.json @@ -0,0 +1,42 @@ +{ + "actions": [], + "autoname": "field:tool_item_number", + "creation": "2021-08-24 08:47:41.318127", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "tool_item_number", + "status_active" + ], + "fields": [ + { + "default": "0", + "fieldname": "status_active", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Status Active" + }, + { + "fieldname": "tool_item_number", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Tool Item Number", + "unique": 1 + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2021-08-24 08:52:04.782917", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Tool Item", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/tool_item/tool_item.py b/propms/property_management_solution/doctype/tool_item/tool_item.py new file mode 100644 index 0000000..1953a60 --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item/tool_item.py @@ -0,0 +1,9 @@ +# Copyright (c) 2021, Aakvatech and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class ToolItem(Document): + pass diff --git a/propms/property_management_solution/doctype/tool_item_record/__init__.py b/propms/property_management_solution/doctype/tool_item_record/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/tool_item_record/test_tool_item_record.py b/propms/property_management_solution/doctype/tool_item_record/test_tool_item_record.py new file mode 100644 index 0000000..b679d62 --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_record/test_tool_item_record.py @@ -0,0 +1,9 @@ +# Copyright (c) 2021, Aakvatech and Contributors +# See license.txt + +# import frappe +import unittest + + +class TestToolItemRecord(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/tool_item_record/tool_item_record.js b/propms/property_management_solution/doctype/tool_item_record/tool_item_record.js new file mode 100644 index 0000000..e116016 --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_record/tool_item_record.js @@ -0,0 +1,28 @@ +// Copyright (c) 2021, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Tool Item Record", "returned", function (frm) { + if (cur_frm.doc.returned) { + cur_frm.set_value("return_date_and_time", frappe.datetime.now_datetime()); + cur_frm.set_df_property("returned", "read_only", 1); + } else { + cur_frm.set_value("return_date_and_time", ""); + } +}); + +cur_frm.add_fetch('tool_item_set', 'set_name', 'set_name'); + +frappe.ui.form.on("Tool Item Record", "onload", function () { + if (cur_frm.doc.returned) { + cur_frm.set_df_property("returned", "read_only", 1); + } +}); + +cur_frm.set_query("tool_item_set", function () { + return { + filters: { + 'status': 'In' + } + } +}); + diff --git a/propms/property_management_solution/doctype/tool_item_record/tool_item_record.json b/propms/property_management_solution/doctype/tool_item_record/tool_item_record.json new file mode 100644 index 0000000..5f0a34d --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_record/tool_item_record.json @@ -0,0 +1,106 @@ +{ + "actions": [], + "allow_import": 1, + "autoname": "format:{tool_item_set}-{taken_by}-{######}", + "color": "#ff0102", + "creation": "2021-08-24 08:51:03.124133", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "tool_item_set", + "set_name", + "staff_type", + "taken_by", + "reason_for_tool_item_taken", + "datetime_taken", + "returned", + "return_date_and_time", + "other_remarks" + ], + "fields": [ + { + "fieldname": "tool_item_set", + "fieldtype": "Link", + "label": "Tool Item Set", + "options": "Tool Item Set" + }, + { + "fieldname": "set_name", + "fieldtype": "Data", + "label": "Set Name", + "read_only": 1 + }, + { + "fieldname": "staff_type", + "fieldtype": "Select", + "label": "Staff Type", + "options": "\nSpik n Span\nStaff\nSecurity\nConsultant\nOthers", + "reqd": 1 + }, + { + "fieldname": "taken_by", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Taken by" + }, + { + "fieldname": "reason_for_tool_item_taken", + "fieldtype": "Data", + "label": "Reason for tool item taken", + "reqd": 1 + }, + { + "default": "Now", + "fieldname": "datetime_taken", + "fieldtype": "Datetime", + "in_list_view": 1, + "label": "Datetime taken", + "read_only": 1 + }, + { + "default": "0", + "fieldname": "returned", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Returned" + }, + { + "fieldname": "return_date_and_time", + "fieldtype": "Datetime", + "label": "Return Date and Time", + "read_only": 1 + }, + { + "fieldname": "other_remarks", + "fieldtype": "Text", + "label": "Other remarks" + } + ], + "icon": "octicon octicon-key", + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-08-24 08:51:03.124133", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Tool Item Record", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/tool_item_record/tool_item_record.py b/propms/property_management_solution/doctype/tool_item_record/tool_item_record.py new file mode 100644 index 0000000..e8a2b49 --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_record/tool_item_record.py @@ -0,0 +1,9 @@ +# Copyright (c) 2021, Aakvatech and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class ToolItemRecord(Document): + pass diff --git a/propms/property_management_solution/doctype/tool_item_set/__init__.py b/propms/property_management_solution/doctype/tool_item_set/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/tool_item_set/test_tool_item_set.py b/propms/property_management_solution/doctype/tool_item_set/test_tool_item_set.py new file mode 100644 index 0000000..fb33d38 --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_set/test_tool_item_set.py @@ -0,0 +1,9 @@ +# Copyright (c) 2021, Aakvatech and Contributors +# See license.txt + +# import frappe +import unittest + + +class TestToolItemSet(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/tool_item_set/tool_item_set.js b/propms/property_management_solution/doctype/tool_item_set/tool_item_set.js new file mode 100644 index 0000000..e8e914c --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_set/tool_item_set.js @@ -0,0 +1,8 @@ +// Copyright (c) 2021, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Tool Item Set', { + // refresh: function(frm) { + + // } +}); diff --git a/propms/property_management_solution/doctype/tool_item_set/tool_item_set.json b/propms/property_management_solution/doctype/tool_item_set/tool_item_set.json new file mode 100644 index 0000000..dfbd260 --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_set/tool_item_set.json @@ -0,0 +1,93 @@ +{ + "actions": [], + "allow_import": 1, + "allow_rename": 1, + "autoname": "format:{shelf_no}-{location_no}", + "creation": "2021-08-24 08:48:30.157614", + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "set_name", + "no_of_tool_items", + "shelf_no", + "location_no", + "status", + "duplicate_of", + "disabled" + ], + "fields": [ + { + "fieldname": "set_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Set Name", + "search_index": 1 + }, + { + "fieldname": "shelf_no", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Shelf No.", + "options": "\nS1\nS2\nS3" + }, + { + "fieldname": "location_no", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Location No." + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "In\nOut\nLost" + }, + { + "fieldname": "duplicate_of", + "fieldtype": "Link", + "label": "Duplicate of", + "options": "Tool Item Set" + }, + { + "fieldname": "no_of_tool_items", + "fieldtype": "Int", + "in_list_view": 1, + "label": "No. of Tool Items" + }, + { + "default": "0", + "fieldname": "disabled", + "fieldtype": "Check", + "label": "Disabled" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2022-05-16 17:06:37.003473", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Tool Item Set", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "search_fields": "set_name", + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/tool_item_set/tool_item_set.py b/propms/property_management_solution/doctype/tool_item_set/tool_item_set.py new file mode 100644 index 0000000..df1ba4c --- /dev/null +++ b/propms/property_management_solution/doctype/tool_item_set/tool_item_set.py @@ -0,0 +1,9 @@ +# Copyright (c) 2021, Aakvatech and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class ToolItemSet(Document): + pass diff --git a/propms/property_management_solution/doctype/unit_assets/__init__.py b/propms/property_management_solution/doctype/unit_assets/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/unit_assets/unit_assets.json b/propms/property_management_solution/doctype/unit_assets/unit_assets.json new file mode 100644 index 0000000..a5e8baf --- /dev/null +++ b/propms/property_management_solution/doctype/unit_assets/unit_assets.json @@ -0,0 +1,108 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2018-05-01 22:17:01.527808", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "asset", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Asset", + "length": 0, + "no_copy": 0, + "options": "Asset", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "maintenable", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_standard_filter": 0, + "label": "Maintenable", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 1, + "max_attachments": 0, + "modified": "2018-11-22 21:05:17.066924", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Unit Assets", + "name_case": "", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/unit_assets/unit_assets.py b/propms/property_management_solution/doctype/unit_assets/unit_assets.py new file mode 100644 index 0000000..d3e3709 --- /dev/null +++ b/propms/property_management_solution/doctype/unit_assets/unit_assets.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class UnitAssets(Document): + pass diff --git a/propms/property_management_solution/doctype/unit_type/__init__.py b/propms/property_management_solution/doctype/unit_type/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/doctype/unit_type/test_unit_type.js b/propms/property_management_solution/doctype/unit_type/test_unit_type.js new file mode 100644 index 0000000..c4eaac0 --- /dev/null +++ b/propms/property_management_solution/doctype/unit_type/test_unit_type.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Unit Type", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Unit Type + () => frappe.tests.make('Unit Type', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/propms/property_management_solution/doctype/unit_type/test_unit_type.py b/propms/property_management_solution/doctype/unit_type/test_unit_type.py new file mode 100644 index 0000000..b255391 --- /dev/null +++ b/propms/property_management_solution/doctype/unit_type/test_unit_type.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and Contributors +# See license.txt +from __future__ import unicode_literals +import unittest + + +class TestUnitType(unittest.TestCase): + pass diff --git a/propms/property_management_solution/doctype/unit_type/unit_type.js b/propms/property_management_solution/doctype/unit_type/unit_type.js new file mode 100644 index 0000000..753b9cd --- /dev/null +++ b/propms/property_management_solution/doctype/unit_type/unit_type.js @@ -0,0 +1,8 @@ +// Copyright (c) 2018, Aakvatech and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Unit Type', { + refresh: function(frm) { + + } +}); diff --git a/propms/property_management_solution/doctype/unit_type/unit_type.json b/propms/property_management_solution/doctype/unit_type/unit_type.json new file mode 100644 index 0000000..f635383 --- /dev/null +++ b/propms/property_management_solution/doctype/unit_type/unit_type.json @@ -0,0 +1,115 @@ +{ + "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:unit_type", + "beta": 0, + "creation": "2018-04-18 23:21:56.307232", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "unit_type", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Unit Type", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "translatable": 0, + "unique": 1 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2018-11-22 22:55:45.110205", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Unit Type", + "name_case": "", + "owner": "mkhakheria@aakvatech.com", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Property Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0, + "track_views": 0 +} \ No newline at end of file diff --git a/propms/property_management_solution/doctype/unit_type/unit_type.py b/propms/property_management_solution/doctype/unit_type/unit_type.py new file mode 100644 index 0000000..3d20b5a --- /dev/null +++ b/propms/property_management_solution/doctype/unit_type/unit_type.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + + +class UnitType(Document): + pass diff --git a/propms/property_management_solution/issue.js b/propms/property_management_solution/issue.js new file mode 100644 index 0000000..7a377cf --- /dev/null +++ b/propms/property_management_solution/issue.js @@ -0,0 +1,246 @@ +frappe.ui.form.on('Issue', { + validate: (frm) => { + // frm.trigger("make_row_readonly"); + if (!frm.doc.materials_required) { + return + } + let to_update = []; + frm.doc.materials_required.forEach((item, idx) => { + var sle_qty = 0 + frappe.call({ + method: "propms.issue_hook.get_stock_availability", + args: { + item_code: item.item, + company: frm.doc.company, + is_pos: item.is_pos + }, + async: false, + callback: function (r) { + if (r.message) { + sle_qty = r.message; + } + } + }); + if (item.material_status === "Bill" || item.material_status === "Self Consumption" && frm.doc.status === "Closed") { + if (sle_qty < item.quantity) { + frappe.throw(__(`Existing stock quantity of item ${item.item} is ${sle_qty} not enough`)) + return + } + let child = frm.add_child("materials_billed"); + child.item = item.item; + child.quantity = item.quantity; + child.uom = item.uom; + child.rate = item.rate; + child.amount = item.amount; + child.is_pos = item.is_pos; + child.material_status = item.material_status; + } + else { + to_update.push(item); + } + }); + frm.clear_table("materials_required"); + refresh_field("materials_required"); + to_update.forEach(item => { + let child = frm.add_child("materials_required"); + child.item = item.item; + child.quantity = item.quantity; + child.uom = item.uom; + child.rate = item.rate; + child.amount = item.amount; + child.is_pos = item.is_pos; + child.material_status = item.material_status; + refresh_field("materials_required"); + }); + refresh_field("materials_required"); + + if (!frm.doc.materials_billed) { + return + } + const sort_list = []; + frm.doc.materials_billed.forEach((item, idx) => { + let item_inv_no = Number.MAX_SAFE_INTEGER; + let item_inv_ser = ""; + if (item.sales_invoice) { + item_inv_no = +item.sales_invoice.slice(9).replace("-", ""); + item_inv_ser = item.sales_invoice.slice(0, 8); + } + sort_list.push({ + idx: idx, + no: item_inv_no, + ser: item_inv_ser, + pos: item.is_pos, + name: item.name + }); + }); + const sorted_list = sort_list.sort((a, b) => a.no - b.no); + const pos_list = []; + const not_list = []; + sorted_list.forEach(i => { + if (i.pos) { pos_list.push(i) } + else { not_list.push(i) } + }); + const new_sorted = [].concat(pos_list, not_list); + new_sorted.forEach((i, idx) => { + const row = locals["Issue Materials Billed"][i.name]; + row.idx = idx + 1; + }); + refresh_field("materials_billed"); + }, + + refresh: (frm) => { + frm.trigger("make_pos_readonly"); + }, + + onload: (frm) => { + frm.trigger("make_pos_readonly"); + }, + + make_pos_readonly: (frm) => { + if (!frm.doc.materials_required) { + return; + } + let child = frm.doc.materials_required; + child.forEach(function (e) { + $("[data-idx='" + e.idx + "']").find('.btn-open-row').css("pointer-events", "none"); + if (e.material_status === "Self Consumption") { + $("[data-idx='" + e.idx + "']").find('[data-fieldname = is_pos]').css("pointer-events", "none"); + } + else { + $("[data-idx='" + e.idx + "']").find('[data-fieldname = is_pos]').css("pointer-events", "auto"); + } + }); + refresh_field("materials_required"); + }, + + setup: function (frm) { + frm.set_query('person_in_charge', function () { + return { + filters: { + 'department': ['like', 'Maintenance - %'] + } + } + }); + frm.set_query('sub_contractor_contact', function () { + return { + filters: { + 'supplier_group': 'Sub-Contractor' + } + } + }); + frappe.call({ + method: "propms.issue_hook.get_items_group", + async: false, + callback: function (r) { + if (r.message) { + let maintenance_item_group = r.message; + frm.fields_dict["materials_required"].grid.get_field("item").get_query = function (doc, cdt, cdn) { + return { + filters: [ + ["Item", "item_group", "in", maintenance_item_group], + + ] + } + } + } + } + }); + }, + property_name: function (frm, cdt, cdn) { + // frappe.msgprint(__("Testing")) + frappe.model.set_value(cdt, cdn, 'customer', ''); + if (frm.doc.property_name) { + frappe.call({ + method: 'frappe.client.get_value', + args: { + doctype: 'Property', + fieldname: 'status', + filters: { + name: frm.doc.property_name + }, + }, + async: false, + callback: function (r, rt) { + if (r.message) { + if (r.message.status.toLowerCase() == 'on lease' || r.message.status.toLowerCase() == 'off lease in 3 months') { + frappe.call({ + method: 'frappe.client.get_value', + args: { + doctype: 'Lease', + fieldname: ['name', 'customer'], + filters: { + property: frm.doc.property_name, + start_date: ["<=", frappe.datetime.nowdate()], + end_date: [">=", frappe.datetime.nowdate()] + }, + }, + async: false, + callback: function (r, rt) { + if (r.message) { + frm.set_value("customer", r.message.customer); + refresh_field("customer") + } + } + }); + } else { + frappe.db.get_value("Property", frm.doc.property_name, "unit_owner", (r) => { + frm.set_value("customer", r.unit_owner); + }); + } + } + } + }); + } + }, +}); + +frappe.ui.form.on("Issue Materials Detail", "quantity", function (frm, cdt, cdn) { + var item_row = locals[cdt][cdn]; + item_row.amount = item_row.rate * item_row.quantity; + refresh_field("materials_required"); +}); + + +frappe.ui.form.on("Issue Materials Detail", "rate", function (frm, cdt, cdn) { + var item_row = locals[cdt][cdn]; + item_row.amount = item_row.rate * item_row.quantity; + refresh_field("materials_required"); +}); + + +frappe.ui.form.on("Issue Materials Detail", "material_status", function (frm, cdt, cdn) { + var item_row = locals[cdt][cdn]; + var is_pos = $("[data-idx='" + item_row.idx + "']").find('[data-fieldname = is_pos]') + + if (item_row.material_status === "Self Consumption") { + is_pos.css("pointer-events", "none"); + item_row.is_pos = 0; + + } else { + is_pos.css("pointer-events", "auto"); + } + refresh_field("materials_required"); +}); + + +frappe.ui.form.on("Issue Materials Detail", "item", function (frm, cdt, cdn) { + var item_row = locals[cdt][cdn]; + if (!item_row.item) { + return; + } + frappe.call({ + method: "propms.issue_hook.get_item_rate", + args: { + item: item_row.item, + customer: frm.doc.customer, + }, + async: false, + callback: function (r) { + if (r.message) { + item_row.rate = r.message; + item_row.amount = item_row.rate * item_row.quantity; + refresh_field("materials_required"); + } + } + }); +}); diff --git a/propms/property_management_solution/journal_entry_account.js b/propms/property_management_solution/journal_entry_account.js new file mode 100644 index 0000000..653a637 --- /dev/null +++ b/propms/property_management_solution/journal_entry_account.js @@ -0,0 +1,40 @@ +frappe.ui.form.on('Journal Entry Account', { + property_name: function(frm, cdt, cdn) { + frappe.model.set_value(cdt, cdn, "party", ""); + if (frm.doc.cost_center) { + frappe.call({ + method: "frappe.client.get_value", + args: { + doctype: "Property", + fieldname: "status", + filters: { + name: frm.doc.cost_center + }, + }, + callback: function(r, rt) { + if (r.message) { + if (r.message.status == "On Lease") { + frappe.call({ + method: "frappe.client.get_value", + args: { + doctype: "Lease", + fieldname: "customer", + filters: { + property: frm.doc.cost_center + }, + }, + callback: function(r, rt) { + if (r.message) { + frappe.model.set_value(cdt, cdn, "party", r.message.customer); + } + } + }); + } + } + } + }); + } else { + frappe.model.set_value(cdt, cdn, "party", ""); + } + } +}) \ No newline at end of file diff --git a/propms/property_management_solution/notification/__init__.py b/propms/property_management_solution/notification/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/notification/daily_checkup_report/__init__.py b/propms/property_management_solution/notification/daily_checkup_report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.json b/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.json new file mode 100644 index 0000000..e6eea1d --- /dev/null +++ b/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.json @@ -0,0 +1,28 @@ +{ + "attach_print": 1, + "channel": "Email", + "condition": "", + "creation": "2019-11-27 12:05:53.894345", + "days_in_advance": 0, + "docstatus": 0, + "doctype": "Notification", + "document_type": "Daily Checklist", + "enabled": 0, + "event": "Submit", + "idx": 0, + "is_standard": 1, + "message": "This email has been sent with data from daily report submission", + "modified": "2020-04-17 19:36:26.205199", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Daily Checkup Report", + "owner": "Administrator", + "recipients": [ + { + "cc": "", + "email_by_role": "Analytics" + } + ], + "sender_email": "notification@aakvatech.com", + "subject": "{{ doc.name }} Daily Checkup Report" +} \ No newline at end of file diff --git a/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.md b/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.md new file mode 100644 index 0000000..b54ea65 --- /dev/null +++ b/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.md @@ -0,0 +1 @@ +This email has been sent with data from daily report submission \ No newline at end of file diff --git a/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.py b/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.py new file mode 100644 index 0000000..2f1b3d1 --- /dev/null +++ b/propms/property_management_solution/notification/daily_checkup_report/daily_checkup_report.py @@ -0,0 +1,6 @@ +from __future__ import unicode_literals + + +def get_context(context): + # do your magic here + pass diff --git a/propms/property_management_solution/notification/outsourcing_attendance/__init__.py b/propms/property_management_solution/notification/outsourcing_attendance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.json b/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.json new file mode 100644 index 0000000..afa5048 --- /dev/null +++ b/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.json @@ -0,0 +1,28 @@ +{ + "attach_print": 1, + "channel": "Email", + "condition": "", + "creation": "2019-11-27 12:05:54.012151", + "days_in_advance": 0, + "docstatus": 0, + "doctype": "Notification", + "document_type": "Outsourcing Attendance", + "enabled": 0, + "event": "Submit", + "idx": 0, + "is_standard": 1, + "message": "This email has been sent with data from security attendance submission", + "modified": "2020-04-17 19:36:05.145028", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Attendance", + "owner": "Administrator", + "recipients": [ + { + "cc": "", + "email_by_role": "Analytics" + } + ], + "sender_email": "notification@aakvatech.com", + "subject": "{{ doc.name }} Outsourcing Attendance" +} \ No newline at end of file diff --git a/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.md b/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.md new file mode 100644 index 0000000..5f1c19e --- /dev/null +++ b/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.md @@ -0,0 +1 @@ +This email has been sent with data from security attendance submission \ No newline at end of file diff --git a/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.py b/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.py new file mode 100644 index 0000000..2f1b3d1 --- /dev/null +++ b/propms/property_management_solution/notification/outsourcing_attendance/outsourcing_attendance.py @@ -0,0 +1,6 @@ +from __future__ import unicode_literals + + +def get_context(context): + # do your magic here + pass diff --git a/propms/property_management_solution/notification/security_attendance/__init__.py b/propms/property_management_solution/notification/security_attendance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/notification/security_attendance/security_attendance.json b/propms/property_management_solution/notification/security_attendance/security_attendance.json new file mode 100644 index 0000000..8482fac --- /dev/null +++ b/propms/property_management_solution/notification/security_attendance/security_attendance.json @@ -0,0 +1,28 @@ +{ + "attach_print": 1, + "channel": "Email", + "condition": "", + "creation": "2019-11-27 12:05:53.964629", + "days_in_advance": 0, + "docstatus": 0, + "doctype": "Notification", + "document_type": "Security Attendance", + "enabled": 0, + "event": "Submit", + "idx": 0, + "is_standard": 1, + "message": "This email has been sent with data from security attendance submission", + "modified": "2020-04-17 19:35:58.180568", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Security Attendance", + "owner": "Administrator", + "recipients": [ + { + "cc": "", + "email_by_role": "Analytics" + } + ], + "sender_email": "notification@aakvatech.com", + "subject": "{{ doc.name }} Security Attendance" +} \ No newline at end of file diff --git a/propms/property_management_solution/notification/security_attendance/security_attendance.md b/propms/property_management_solution/notification/security_attendance/security_attendance.md new file mode 100644 index 0000000..5f1c19e --- /dev/null +++ b/propms/property_management_solution/notification/security_attendance/security_attendance.md @@ -0,0 +1 @@ +This email has been sent with data from security attendance submission \ No newline at end of file diff --git a/propms/property_management_solution/notification/security_attendance/security_attendance.py b/propms/property_management_solution/notification/security_attendance/security_attendance.py new file mode 100644 index 0000000..2f1b3d1 --- /dev/null +++ b/propms/property_management_solution/notification/security_attendance/security_attendance.py @@ -0,0 +1,6 @@ +from __future__ import unicode_literals + + +def get_context(context): + # do your magic here + pass diff --git a/propms/property_management_solution/point_of_sale.js b/propms/property_management_solution/point_of_sale.js new file mode 100644 index 0000000..03d24bf --- /dev/null +++ b/propms/property_management_solution/point_of_sale.js @@ -0,0 +1,94 @@ +/* Customized version 2019-12-30 */ +/* Added cost_center field */ +// POS page js. +try { + erpnext.pos.PointOfSale = erpnext.pos.PointOfSale.extend({ + }); +} catch (e) { //online POS + class NewPOSCart extends POSCart { + constructor(wrapper) { + super(wrapper); + } + make() { + this.make_dom(); + console.log("AakvaERP POS making cost center field") + this.make_cost_center_field(); + this.make_customer_field(); + this.make_loyalty_points(); + this.make_numpad(); + } + make_cost_center_field() { + // console.log("AakvaERP POS making cost center field") + this.cost_center_field = frappe.ui.form.make_control({ + df: { + fieldtype: 'Link', + label: 'Cost Center', + fieldname: 'cost_center', + options: 'Cost Center', + reqd: 0, + get_query: function () { + return { + filters: { + "is_group": 0 + } + } + }, + onchange: () => { + frappe.call({ + method: "propms.pos.get_pos_data", + freeze: true, + args: { + 'cost_center': this.cost_center_field.get_value() + } + }).then(r => { + var pos_customer = "Cash Customer" + if (r.message) { + if (r.message.hasOwnProperty('customer')) { + pos_customer = r.message.customer + } + } + this.customer_field.set_value(pos_customer); + this.frm.set_value('customer', pos_customer); + //for(var i = 0; i< r.message.lease_item.length; i++ ){ + // this.events.on_field_change(r.message.lease_item[i].lease_item); + //} + }); + }, + }, + parent: this.wrapper.find('.customer-field'), + render_input: true + }); + } + }; + POSCart = NewPOSCart; + + class PointOfSale extends erpnext.pos.PointOfSale { + constructor(wrapper) { + super(wrapper); + } + + submit_sales_invoice() { + for (var i = 0; i < this.frm.doc.items.length; i++) { + console.log("AakvaERP POS ", document.querySelector('input[data-fieldname="cost_center"]').value) + this.frm.doc.items[i].cost_center = document.querySelector('input[data-fieldname="cost_center"]').value; + } + this.frm.doc.cost_center = document.querySelector('input[data-fieldname="cost_center"]').value; + this.frm.savesubmit() + .then((r) => { + if (r && r.doc) { + this.frm.doc.docstatus = r.doc.docstatus; + frappe.show_alert({ + indicator: 'green', + message: __(`Sales invoice ${r.doc.name} created succesfully`) + }); + + this.toggle_editing(); + this.set_form_action(); + this.set_primary_action_in_modal(); + } + }); + } + + }; + erpnext.pos.PointOfSale = PointOfSale; +} diff --git a/propms/property_management_solution/print_format/__init__.py b/propms/property_management_solution/print_format/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/attendance_report/__init__.py b/propms/property_management_solution/print_format/attendance_report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/attendance_report/attendance_report.json b/propms/property_management_solution/print_format/attendance_report/attendance_report.json new file mode 100644 index 0000000..59b2c1b --- /dev/null +++ b/propms/property_management_solution/print_format/attendance_report/attendance_report.json @@ -0,0 +1,24 @@ +{ + "align_labels_right": 0, + "creation": "2020-03-04 10:08:35.711962", + "css": ".print-format {\n padding-left: 5mm;\n padding-right: 5mm;\n padding-top: 15mm;\n padding-bottom: 5mm;\n}\n", + "custom_format": 1, + "disabled": 0, + "doc_type": "Security Attendance", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "html": "{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}\n {% if letter_head and not no_letterhead %}\n
    {{ letter_head }}
    \n {% endif %}\n \n {% if max_pages > 1 %}\n

    {{ _(\"Page #{0} of {1}\").format(page_num, max_pages) }}

    \n {% endif %}\n{%- endmacro -%}\n{{ add_header(0,1,doc,letter_head, no_letterhead) }}\n\n

    \n\t{{ doc.shift_name|upper }} SHIFT SECURITY ATTENDANCE REPORT FOR {{ frappe.utils.formatdate(doc.shift_date) }}\n

    \n\n\n \n \n \n \n \n \n \n \n \n \n \n {% set present = [0] %}\n {% set absent = [0] %}\n {% set day_off = [0] %}\n {% for ad in doc.attendance_details %}\n \n {% if ad.status == \"Present\" %}\n {% if present.append(present.pop() + 1) %}{% endif %} \n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n {% set cpresent = \"X\" %}\n {% elif ad.status == \"Absent\" %}\n {% if absent.append(absent.pop() + 1) %}{% endif %} \n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n {% set cabsent = \"X\" %}\n {% elif ad.status == \"Day off\" %}\n {% if day_off.append(day_off.pop() + 1) %}{% endif %} \n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n {% set cday_off = \"X\" %}\n\t {% else %}\t\t\n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n\t\t {% endif %}\n\n \n \n \n \n \n\t\t\t\n \n \n \n {% endfor %}\n \n\t\n\t\t \n \n \n \n \n\t\t\t\n \n\n \n
    GUARD NAMEPOSITIONPRESENTABSENTDAY OFFREMARKS
    {{ ad.guard_name}}{{ ad.position }}{{ cpresent }}{{ cabsent }}{{ cday_off }}{{ ad.remarks }}
    TOTAL{{ present[0] }}{{ absent[0] }}{{ day_off[0] }} 
    \n", + "idx": 0, + "line_breaks": 0, + "modified": "2020-03-10 13:21:55.167934", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Attendance Report", + "owner": "Administrator", + "print_format_builder": 1, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 0, + "standard": "Yes" +} \ No newline at end of file diff --git a/propms/property_management_solution/print_format/av_payment_entry_voucher_viva/__init__.py b/propms/property_management_solution/print_format/av_payment_entry_voucher_viva/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/av_payment_entry_voucher_viva/av_payment_entry_voucher_viva.json b/propms/property_management_solution/print_format/av_payment_entry_voucher_viva/av_payment_entry_voucher_viva.json new file mode 100644 index 0000000..e28b7bd --- /dev/null +++ b/propms/property_management_solution/print_format/av_payment_entry_voucher_viva/av_payment_entry_voucher_viva.json @@ -0,0 +1,28 @@ +{ + "absolute_value": 0, + "align_labels_right": 1, + "creation": "2020-03-04 10:08:35.838458", + "css": "@media screen {\n .print-format {\n padding-left: 10mm;\n padding-right: 10mm;\n padding-top: 5mm;\n padding-bottom: 2mm;\n width: 5.8in;\n min-height: 8.3in;\n font-size: 7pt;\n }\n .print-format td, .print-format th {\n vertical-align: top !important;\n padding: 1px !important;\n }\n\n .print-format h1 { font-size: 19pt;}\n .print-format h2 { font-size: 17pt;}\n .print-format h3 { font-size: 15pt;}\n .print-format h4 { font-size: 13pt;}\n .print-format h5 { font-size: 9pt;}\n .print-format h6 { font-size: 8px;}\n \n .data-field {\n margin-top: 0px;\n margin-bottom: 0px;\n }\n}\n\n.data-field {\n margin-top: 0px;\n margin-bottom: 0px;\n}\n\n.hr_class {\n margin-top: 6px;\n margin-bottom: 6px;\n}\n\n.clearfix:after {\n /* clear: both; */\n}\n\n.col-xs-7 {\n position: relative;\n min-height: 1px;\n padding-right: 5px;\n padding-left: 5px;\n}", + "custom_format": 0, + "default_print_language": "en", + "disabled": 0, + "doc_type": "Payment Entry", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"\\n \\n \\n \\n \\n \\n

    VRN {{ frappe.db.get_value(\\\"Company\\\", doc.company, \\\"vrn\\\") }}

    \\n\\t{% if doc.payment_type == \\\"Receive\\\" %}\\n\\t RECEIPT\\n\\t{% elif doc.payment_type == \\\"Pay\\\" %}\\n PAYMENT VOUCHER\\n\\t{% else %}\\n INTERNAL TRANSFER VOUCHER\\n {% endif %}\\n

    TIN {{ frappe.db.get_value(\\\"Company\\\", doc.company, \\\"tin\\\") }}

    \\n
    \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.party_name}}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ doc.mode_of_payment}}\\n
    \\n
    \"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.name}}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ doc.posting_date}}\\n
    \\n
    \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.paid_from }}\\n
    \\n
    \\n\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.paid_to }}\\n
    \\n
    \\n\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.utils.fmt_money(doc.received_amount, currency=doc.paid_to_account_currency) }}\\n
    \\n
    \"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.utils.money_in_words(doc.received_amount, doc.paid_to_account_currency) }}\\n
    \\n
    \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.reference_no }}\\n
    \\n
    \"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.reference_date }}\\n
    \\n
    \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"{% if doc.payment_type != \\\"Internal Transfer\\\" %}\\n
    \\n
    \\n \\n
    \\n
    \\n{% endif %}\"}, {\"fieldname\": \"references\", \"print_hide\": 0, \"label\": \"Payment References\", \"visible_columns\": [{\"fieldname\": \"reference_doctype\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"reference_name\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"due_date\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"bill_no\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"outstanding_amount\", \"print_width\": \"\", \"print_hide\": 0}, {\"fieldname\": \"allocated_amount\", \"print_width\": \"\", \"print_hide\": 0}]}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.remarks }}\\n
    \\n
    \"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \" \\n \\n \\n \\n \\n
    \\n\\t\\t  \\n
    \\n
    \\n Received by\\n
    \\n
    \\n
    \\n for {{ doc.company }}\\n
    \\n
    \\n Authorised Signatory\\n
    \\n
    \\n
    \"}]", + "html": "\n", + "idx": 0, + "line_breaks": 0, + "modified": "2021-06-18 15:40:12.894864", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "AV Payment Entry Voucher VIVA", + "owner": "Administrator", + "parent": "Payment Entry", + "print_format_builder": 0, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 1, + "standard": "Yes" +} \ No newline at end of file diff --git a/propms/property_management_solution/print_format/outsourcing_attendance/__init__.py b/propms/property_management_solution/print_format/outsourcing_attendance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/outsourcing_attendance/outsourcing_attendance.json b/propms/property_management_solution/print_format/outsourcing_attendance/outsourcing_attendance.json new file mode 100644 index 0000000..511c708 --- /dev/null +++ b/propms/property_management_solution/print_format/outsourcing_attendance/outsourcing_attendance.json @@ -0,0 +1,25 @@ +{ + "align_labels_right": 0, + "creation": "2020-03-04 10:08:35.893805", + "css": ".print-format {\n padding-left: 5mm;\n padding-right: 5mm;\n padding-top: 15mm;\n padding-bottom: 5mm;\n}", + "custom_format": 1, + "default_print_language": "en", + "disabled": 0, + "doc_type": "Outsourcing Attendance", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "html": "{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}\n {% if letter_head and not no_letterhead %}\n
    {{ letter_head }}
    \n {% endif %}\n \n {% if max_pages > 1 %}\n

    {{ _(\"Page #{0} of {1}\").format(page_num, max_pages) }}

    \n {% endif %}\n{%- endmacro -%}\n{{ add_header(0,1,doc,letter_head, no_letterhead) }}\n\n

    \n\t{{ doc.shift_name|upper }} ATTENDANCE REPORT FOR {{ frappe.utils.formatdate(doc.shift_date) }}\n

    \n\n\n \n \n \n \n \n \n \n \n \n \n \n {% set present = [0] %}\n {% set absent = [0] %}\n {% set day_off = [0] %}\n {% for ad in doc.attendance_details %}\n \n {% if ad.status == \"Present\" %}\n {% if present.append(present.pop() + 1) %}{% endif %} \n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n {% set cpresent = \"X\" %}\n {% elif ad.status == \"Absent\" %}\n {% if absent.append(absent.pop() + 1) %}{% endif %} \n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n {% set cabsent = \"X\" %}\n {% elif ad.status == \"Day off\" %}\n {% if day_off.append(day_off.pop() + 1) %}{% endif %} \n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n {% set cday_off = \"X\" %}\n\t {% else %}\t\t\n {% set cpresent = \"\" %}\n {% set cabsent = \"\" %}\n {% set cday_off = \"\" %}\n\t\t {% endif %}\n\n \n \n \n \n \n\t\t\t\n \n \n \n {% endfor %}\n \n\t\n\t\t \n \n \n \n \n\t\t\t\n \n\n \n
    PERSON NAMEPOSITIONPRESENTABSENTDAY OFFREMARKS
    {{ ad.person_name}}{{ ad.position }}{{ cpresent }}{{ cabsent }}{{ cday_off }}{{ ad.remarks }}
    TOTAL{{ present[0] }}{{ absent[0] }}{{ day_off[0] }} 
    \n", + "idx": 0, + "line_breaks": 0, + "modified": "2020-03-10 13:19:27.740757", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Attendance", + "owner": "Administrator", + "print_format_builder": 0, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 0, + "standard": "Yes" +} \ No newline at end of file diff --git a/propms/property_management_solution/print_format/property_daily_checklist/__init__.py b/propms/property_management_solution/print_format/property_daily_checklist/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/property_daily_checklist/property_daily_checklist.json b/propms/property_management_solution/print_format/property_daily_checklist/property_daily_checklist.json new file mode 100644 index 0000000..e93e26a --- /dev/null +++ b/propms/property_management_solution/print_format/property_daily_checklist/property_daily_checklist.json @@ -0,0 +1,25 @@ +{ + "align_labels_right": 1, + "creation": "2020-04-12 18:42:31.673511", + "css": ".print-format {\npadding-left: 10mm;\npadding-right: 5mm;\npadding-top: 10mm; }\n", + "custom_format": 0, + "disabled": 0, + "doc_type": "Daily Checklist", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "format_data": "[{\"fieldtype\": \"Custom HTML\", \"options\": \"
    \\t\\t\\t\\t

    Daily Checklist
    {{ doc.name }}\\t\\t\\t\\t

    \", \"fieldname\": \"print_heading_template\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"label\": \"Checkup Date\", \"fieldname\": \"checkup_date\"}, {\"print_hide\": 0, \"label\": \" Shift\", \"fieldname\": \"shift\"}, {\"print_hide\": 0, \"label\": \"Area\", \"fieldname\": \"area\"}, {\"fieldtype\": \"HTML\", \"print_hide\": 0, \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.modified }}\\n
    \\n
    \", \"label\": \"Custom HTML\", \"fieldname\": \"_custom_html\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"HTML\", \"print_hide\": 0, \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.get_fullname(user) }}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.get_fullname(doc.owner) }}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.get_fullname(doc.modified_by) }}\\n
    \\n
    \\n\", \"label\": \"Custom HTML\", \"fieldname\": \"_custom_html\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"fieldname\": \"daily_checklist_detail\", \"label\": \"Daily Checklist Detail\", \"visible_columns\": [{\"print_width\": \"\", \"print_hide\": 0, \"fieldname\": \"checklist_task\"}, {\"print_width\": \"\", \"print_hide\": 0, \"fieldname\": \"remarks\"}]}]", + "html": "
    ", + "idx": 0, + "line_breaks": 1, + "modified": "2020-04-17 19:41:23.118064", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property Daily Checklist", + "owner": "Administrator", + "print_format_builder": 1, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 1, + "standard": "Yes" +} \ No newline at end of file diff --git a/propms/property_management_solution/print_format/property_tax_invoice/__init__.py b/propms/property_management_solution/print_format/property_tax_invoice/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/property_tax_invoice/property_tax_invoice.json b/propms/property_management_solution/print_format/property_tax_invoice/property_tax_invoice.json new file mode 100644 index 0000000..a37d7a8 --- /dev/null +++ b/propms/property_management_solution/print_format/property_tax_invoice/property_tax_invoice.json @@ -0,0 +1,26 @@ +{ + "align_labels_right": 1, + "creation": "2020-09-19 12:34:19.764515", + "css": ".print-format td, .print-format th \n{\n vertical-align: top !important;\n \tpadding: 3px !important;\n\tvertical-align: bottom !important;\n}\n.print-format {\n padding-left: 10mm;\n padding-right: 5mm;\n padding-top: 5mm;\n\tfont-size: 10pt;\t\n}\n\ntd.tight {\n padding: 0px !important;\n}", + "custom_format": 0, + "default_print_language": "en", + "disabled": 0, + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "format_data": "[{\"fieldname\": \"print_heading_template\", \"fieldtype\": \"Custom HTML\", \"options\": \"\\n \\n \\n \\n \\n

    VRN {{ frappe.db.get_value(\\\"Company\\\", doc.company, \\\"vrn\\\") }}

    TIN {{ frappe.db.get_value(\\\"Company\\\", doc.company, \\\"tin\\\") }}

    \\n{% if doc.select_print_heading is not none %}\\n

    {{ doc.select_print_heading }}

    \\n{% else %}\\n

    TAX INVOICE

    \\n{% endif %}\\n
    \"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.customer_name}}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ doc.address_display}}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.db.get_value(\\\"Customer\\\", doc.customer, \\\"vrn\\\") }}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.db.get_value(\\\"Customer\\\", doc.customer, \\\"tax_id\\\") }}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n\\t{{ doc.cost_center}}\\n
    \\n
    \"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"
    \\n
    \\n {% if (doc.is_return == 0) %}\\n \\n {% else %}\\n \\n {% endif %}\\n
    \\n
    \\n {{ doc.name}}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.utils.formatdate(doc.posting_date, 'dd-MMM-YYYY') }}\\n
    \\n
    \\n{% if (doc.is_return == 0) %} \\n
    \\n
    \\n
    {{ doc.po_no}}
    \\n
    \\n
    \\n
    \\n
    {{ frappe.utils.formatdate(doc.po_date, 'dd-MMM-YYYY') }}
    \\n
    \\n
    \\n
    \\n
    {{ frappe.utils.formatdate(doc.due_date, 'dd-MMM-YYYY') }}
    \\n
    \\n{% else %}\\n
    \\n
    \\n
    {{ doc.return_against}}
    \\n
    \\n{% endif %}\"}, {\"fieldtype\": \"Section Break\", \"label\": \"\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t{% for item in doc.items %}\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t{% endfor %}\\r\\n\\t\\r\\n \\r\\n \\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t{% if (doc.is_return == 0) %}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t{% else %}\\r\\n\\t\\t\\t\\r\\n\\t\\t{% endif %}\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t{% if (doc.is_return == 0) %}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t{% endif %}\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t{% if (doc.is_return == 0) %}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t{% endif %}\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t{% if (doc.is_return == 0) %}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t{% endif %}\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t{% if (doc.is_return == 0) %}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t{% endif %}\\r\\n\\t\\r\\n\\t\\r\\n\\t\\t{% if (doc.is_return == 0) %}\\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\r\\n\\t\\t{% endif %}\\r\\n\\t\\r\\n
    SI\\r\\n\\t\\tParticulars\\r\\n\\t\\tQTY\\r\\n\\t\\tVAT\\r\\n\\t\\tRate\\r\\n\\t\\tAmount\\r\\n\\t
    {{ loop.index }}\\r\\n\\t\\t\\t{{ item.item_name }}\\r\\n\\t\\t\\t{% if (item.description != item.item_name) %}\\r\\n\\t\\t\\t\\t
    {{ item.description }}\\r\\n\\t\\t\\t{% endif %}\\r\\n\\t\\t\\t{% if (item.service_start_date != None) %}\\r\\n\\t\\t\\t
    From {{ frappe.utils.formatdate(item.service_start_date, 'dd-MMM-YYYY') }} TO {{ frappe.utils.formatdate(item.service_start_date, 'dd-MMM-YYYY') }}\\r\\n\\t\\t\\t{% endif %}\\r\\n\\t\\t
    \\r\\n\\t\\t {% if item.qty|int != 0 %} \\r\\n\\t\\t {{ item.get_formatted(\\\"qty\\\", 0).replace(\\\"-\\\",\\\"\\\") }}\\r\\n {% else %}\\t\\t \\r\\n\\t\\t {{ item.get_formatted(\\\"qty\\\", 2).replace(\\\"-\\\",\\\"\\\") }}\\r\\n\\t\\t {% endif %}\\r\\n\\t\\t\\t{{ item.get_formatted(\\\"uom\\\", 0) }}\\r\\n\\t\\t\\r\\n\\t\\t\\t{% set mydict = json.loads(item.item_tax_rate) %}\\r\\n\\t\\t\\t{% if item.item_tax_rate == \\\"{}\\\" %}\\r\\n\\t\\t\\t\\t{% for row in doc.taxes %}\\r\\n\\t\\t\\t\\t\\t{{ row.get_formatted(\\\"rate\\\",0) }}%\\r\\n\\t\\t\\t\\t{% endfor %}\\r\\n\\t\\t\\t{% else %}\\r\\n\\t\\t\\t\\t{% set ns = namespace(vat=none) %}\\r\\n\\t\\t\\t\\t{% for key, value in mydict.items() %}\\t\\r\\n\\t\\t\\t\\t\\t{% set ns.vat = value %}\\r\\n\\t\\t\\t\\t\\t{% endfor %}\\r\\n\\t\\t\\t\\t{{ ns.vat }}%\\r\\n\\t\\t\\t{% endif %}\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t{{ item.get_formatted(\\\"net_rate\\\", doc) }}{{ frappe.utils.fmt_money('%0.2f'|format(item.net_amount|float|abs), currency=doc.currency) }}
    \\r\\n Amount in Words
    \\r\\n {{ doc.in_words }}

    \\r\\n \\r\\n {% if doc.currency != \\\"TZS\\\" %}\\r\\n {{ doc.base_in_words }}\\r\\n {% endif %} \\r\\n \\r\\n
    SUB. TOTAL{{ frappe.utils.fmt_money('%0.2f'|format(doc.net_total|float|abs), currency=doc.currency) }}
    V.A.T.{{ frappe.utils.fmt_money('%0.2f'|format(doc.total_taxes_and_charges|float|abs), currency=doc.currency) }}
    TOTAL{{ frappe.utils.fmt_money('%0.2f'|format(doc.grand_total|float|abs), currency=doc.currency) }}
    E&OE
    Assessable Value:\\r\\n\\t\\t\\t\\t{% if (doc.base_total_taxes_and_charges == 0) %}\\r\\n\\t\\t\\t\\t\\t{{ frappe.utils.fmt_money(0, currency=\\\"\\\") }}\\r\\n\\t\\t\\t\\t{% else %}\\r\\n\\t\\t\\t\\t\\t{% if (doc.base_net_total != doc.base_total) %}\\r\\n\\t\\t\\t\\t\\t\\t{{ frappe.utils.fmt_money(doc.base_net_total, currency=\\\"\\\") }}\\r\\n\\t\\t\\t\\t\\t{% else %}\\r\\n\\t\\t\\t\\t\\t\\t{{ frappe.utils.fmt_money(doc.base_total_taxes_and_charges / 0.18, currency=\\\"\\\") }}\\r\\n\\t\\t\\t\\t\\t{% endif %}\\r\\n\\t\\t\\t\\t{% endif %}\\r\\n\\t\\t\\t 
    VAT Amount:{{ frappe.utils.fmt_money(doc.base_total_taxes_and_charges, currency=\\\"\\\") }}
    Exempt:\\r\\n\\t\\t\\t\\t{% if (doc.base_total_taxes_and_charges == 0) %}\\r\\n\\t\\t\\t\\t\\t{{ frappe.utils.fmt_money(doc.base_total, currency=\\\"\\\") }}\\r\\n\\t\\t\\t\\t{% else %}\\r\\n\\t\\t\\t\\t\\t{% if (doc.base_net_total != doc.base_total) %}\\r\\n\\t\\t\\t\\t\\t\\t{{ frappe.utils.fmt_money(doc.base_grand_total - (doc.base_net_total + doc.base_total_taxes_and_charges), currency=\\\"\\\") }}\\r\\n\\t\\t\\t\\t\\t{% else %}\\r\\n\\t\\t\\t\\t\\t\\t{{ frappe.utils.fmt_money(doc.base_grand_total - ((doc.base_total_taxes_and_charges / 0.18) + doc.base_total_taxes_and_charges), currency=\\\"\\\") }}\\r\\n\\t\\t\\t\\t\\t{% endif %}\\r\\n\\t\\t\\t\\t{% endif %}\\r\\n\\t\\t\\t
    Special Relief: 
    Zero Rated: 
    Total:\\r\\n\\t\\t\\t\\t{{ frappe.utils.fmt_money(doc.base_grand_total, currency=\\\"\\\") }}\\r\\n\\t\\t\\t
    \\r\\n
    \\r\\n
    \\r\\n 1mm\\r\\n 1mm\\r\\n 1mm\\r\\n 0mm\\r\\n
    \\r\\n
    \\r\\n\"}, {\"fieldname\": \"_custom_html\", \"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldtype\": \"HTML\", \"options\": \"\\n\\t\\n\\t\\t\\n\\t\\t\\n\\t\\n\\t\\n\\t\\t\\n\\t\\t\\t{% if (doc.is_return == 0) %}\\n\\t\\t\\t\\t\\n\\t\\t\\t{% else %}\\n\\t\\t\\t\\t\\n\\t\\t\\t{% endif %}\\n\\t\\t\\t\\n\\t\\t\\n\\t\\n
    \\n\\t\\t\\t\\t {% if (frappe.db.get_value(\\\"Company\\\", doc.company, \\\"company_bank_details\\\") != None) %}\\n\\t\\t\\t\\t\\t {{ frappe.db.get_value(\\\"Company\\\", doc.company, \\\"company_bank_details\\\") }}\\n {% endif %}\\t\\t\\t\\t\\t \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t{{ doc.remarks }}\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t
    \\n\\t\\t\\t\\t\\t
    for {{ doc.company }}
    \\n\\t\\t\\t\\t\\t
    Authorised Signatory
    \\n\\t\\t\\t\\t
    \\n\\t\\t\\t
    \"}]", + "html": "", + "idx": 0, + "line_breaks": 1, + "modified": "2020-09-19 13:12:40.054678", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property Tax Invoice", + "owner": "Administrator", + "print_format_builder": 1, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 1, + "standard": "Yes" +} \ No newline at end of file diff --git a/propms/property_management_solution/print_format/security_attendance/__init__.py b/propms/property_management_solution/print_format/security_attendance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/security_attendance/security_attendance.json b/propms/property_management_solution/print_format/security_attendance/security_attendance.json new file mode 100644 index 0000000..496ece2 --- /dev/null +++ b/propms/property_management_solution/print_format/security_attendance/security_attendance.json @@ -0,0 +1,25 @@ +{ + "align_labels_right": 1, + "creation": "2020-03-04 10:08:35.659623", + "custom_format": 0, + "disabled": 0, + "doc_type": "Security Attendance", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "format_data": "[{\"fieldname\": \"print_heading_template\", \"options\": \"
    \\t\\t\\t\\t

    Security Attendance
    {{ doc.name }}\\t\\t\\t\\t

    \", \"fieldtype\": \"Custom HTML\"}, {\"label\": \"\", \"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"label\": \"Shift Date\", \"fieldname\": \"shift_date\", \"print_hide\": 0}, {\"label\": \"Shift Name\", \"fieldname\": \"shift_name\", \"print_hide\": 0}, {\"label\": \"Attendance Details\", \"fieldname\": \"attendance_details\", \"visible_columns\": [{\"print_width\": \"\", \"fieldname\": \"guard_empid\", \"print_hide\": 0}, {\"print_width\": \"\", \"fieldname\": \"guard_name\", \"print_hide\": 0}, {\"print_width\": \"\", \"fieldname\": \"id_no\", \"print_hide\": 0}, {\"print_width\": \"\", \"fieldname\": \"position\", \"print_hide\": 0}, {\"print_width\": \"\", \"fieldname\": \"status\", \"print_hide\": 0}, {\"print_width\": \"\", \"fieldname\": \"remarks\", \"print_hide\": 0}], \"print_hide\": 0}, {\"label\": \"\", \"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"fieldtype\": \"HTML\", \"label\": \"Custom HTML\", \"fieldname\": \"_custom_html\", \"options\": \" {% set list = [] %}\\n {% set dict = {} %}\\n {% set tot_qty = [] %}\\n {% set avg_rate = [] %}\\n {% set tot_amt = 0 %}\\n \\n {% set groups = doc.items|groupby('status') %}\\n {% set no_of_group = groups|length %}\\n {% set total_count = 0 %}\\n{% set group_count = 0 %}\\n {% set tot_qty = doc.items|count(attribute='status') %}\\n\\n {% set item_details = {\\\"total_qty\\\":0.0} %}\\t\\n\\n {% for group in doc.items | groupby('status') %}\\n {% set group_count = group.list|length %}\\n {% set total_count = total_count + group_count %}\\n {% set count = 1 %} \\n {% set item_desc = [] %} \\n {% for item in group.list %}\\n \\n\\t\\t {% if count == 1 -%}\\n\\n\\t\\t {% set _ = item_desc.append(item.status) %}\\n \\n\\t\\t {%- endif %}\\n {% set count = count + 1 %}\\n\\n\\t\\t{%- endfor %}\\n \\n \\n \\t \\n
    \\n {{ group.grouper }} - {{ item_desc[0] }}
    \\n \\n {% set tot_qty = group.list|sum(attribute='status') %}\\n\\t\\t{% set tot_amt = group.list|sum(0) %}\\n\\t {% set avg_rate = tot_amt / tot_qty %}\\n\\t\\t\\n\\t\\t {{ (tot_qty | round(2)|string).rstrip('0').rstrip('.') }} Nos\\n\\t\\t\\n\\n {{ \\\"{:,.2f}\\\".format(avg_rate) }}\\t\\t\\t\\n\\t {{ \\\"{:,.2f}\\\".format(tot_amt) }}\\n \", \"print_hide\": 0}]", + "html": "", + "idx": 0, + "line_breaks": 1, + "modified": "2020-03-10 13:20:57.654626", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Security Attendance", + "owner": "Administrator", + "parent": "Security Attendance", + "print_format_builder": 1, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 1, + "standard": "Yes" +} \ No newline at end of file diff --git a/propms/property_management_solution/print_format/viva_daily_checklist/__init__.py b/propms/property_management_solution/print_format/viva_daily_checklist/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/print_format/viva_daily_checklist/viva_daily_checklist.json b/propms/property_management_solution/print_format/viva_daily_checklist/viva_daily_checklist.json new file mode 100644 index 0000000..25610f4 --- /dev/null +++ b/propms/property_management_solution/print_format/viva_daily_checklist/viva_daily_checklist.json @@ -0,0 +1,25 @@ +{ + "align_labels_right": 1, + "creation": "2020-03-04 10:08:35.787720", + "css": ".print-format {\npadding-left: 10mm;\npadding-right: 5mm;\npadding-top: 10mm; }\n", + "custom_format": 0, + "disabled": 0, + "doc_type": "Daily Checklist", + "docstatus": 0, + "doctype": "Print Format", + "font": "Default", + "format_data": "[{\"fieldname\": \"print_heading_template\", \"options\": \"
    \\t\\t\\t\\t

    Daily Checklist
    {{ doc.name }}\\t\\t\\t\\t

    \", \"fieldtype\": \"Custom HTML\"}, {\"label\": \"\", \"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"label\": \"Checkup Date\", \"fieldname\": \"checkup_date\", \"print_hide\": 0}, {\"label\": \" Shift\", \"fieldname\": \"shift\", \"print_hide\": 0}, {\"label\": \"Area\", \"fieldname\": \"area\", \"print_hide\": 0}, {\"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldname\": \"_custom_html\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ doc.modified }}\\n
    \\n
    \", \"fieldtype\": \"HTML\"}, {\"fieldtype\": \"Column Break\"}, {\"print_hide\": 0, \"label\": \"Custom HTML\", \"fieldname\": \"_custom_html\", \"options\": \"
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.get_fullname(user) }}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.get_fullname(doc.owner) }}\\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n {{ frappe.get_fullname(doc.modified_by) }}\\n
    \\n
    \\n\", \"fieldtype\": \"HTML\"}, {\"label\": \"\", \"fieldtype\": \"Section Break\"}, {\"fieldtype\": \"Column Break\"}, {\"label\": \"Daily Checklist Detail\", \"fieldname\": \"daily_checklist_detail\", \"print_hide\": 0, \"visible_columns\": [{\"print_width\": \"\", \"fieldname\": \"checklist_task\", \"print_hide\": 0}, {\"print_width\": \"\", \"fieldname\": \"remarks\", \"print_hide\": 0}]}]", + "html": "", + "idx": 0, + "line_breaks": 1, + "modified": "2020-03-10 13:21:25.083309", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Daily Checklist", + "owner": "Administrator", + "print_format_builder": 1, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 1, + "standard": "Yes" +} \ No newline at end of file diff --git a/propms/property_management_solution/report/__init__.py b/propms/property_management_solution/report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/creditors_report/__init__.py b/propms/property_management_solution/report/creditors_report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/creditors_report/creditors_report.json b/propms/property_management_solution/report/creditors_report/creditors_report.json new file mode 100644 index 0000000..553bcb3 --- /dev/null +++ b/propms/property_management_solution/report/creditors_report/creditors_report.json @@ -0,0 +1,36 @@ +{ + "add_total_row": 1, + "columns": [], + "creation": "2020-03-04 10:08:36.376375", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "filters": [], + "idx": 0, + "is_standard": "Yes", + "modified": "2021-11-03 08:59:48.390055", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Creditors Report", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT \tpi.name AS \"Invoice No:Link/Purchase Invoice:150\", \r\n\t\tpi.supplier AS \"Customer:Link/Supplier:150\", \r\n\t\tGROUP_CONCAT(pid.item_name) AS \"Items:Data:200\",\r\n\t\tpi.due_date AS \"Due Date:Date:100\", \r\n\t\tROUND(IF(pi.currency = \"USD\", IF( pi.currency = pi.party_account_currency, pi.outstanding_amount, pi.outstanding_amount/pi.conversion_rate), 0),2) AS \"USD:Float:100\",\r\n\t\tROUND(IF(pi.currency = \"TZS\", IF( pi.currency = pi.party_account_currency, pi.outstanding_amount, pi.outstanding_amount*pi.conversion_rate), 0),2) AS \"TZS:Float:100\",\r\n\t\tpi._user_tags as \"Remarks:Data:200\"\r\nFROM `tabPurchase Invoice` pi LEFT JOIN `tabPurchase Invoice Item` as pid ON pi.name = pid.parent\r\nWHERE pi.status IN (\"Sumitted\", \"Unpaid\", \"Overdue\")\r\nGROUP BY pi.name", + "ref_doctype": "Purchase Invoice", + "report_name": "Creditors Report", + "report_type": "Query Report", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Purchase User" + }, + { + "role": "Accounts Manager" + }, + { + "role": "Auditor" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/debtors_report/__init__.py b/propms/property_management_solution/report/debtors_report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/debtors_report/debtors_report.js b/propms/property_management_solution/report/debtors_report/debtors_report.js new file mode 100644 index 0000000..b015a25 --- /dev/null +++ b/propms/property_management_solution/report/debtors_report/debtors_report.js @@ -0,0 +1,37 @@ +frappe.query_reports["Debtors Report"] = { + filters: [ + ], + formatter: function (value, row, column, data, default_formatter) { + value = default_formatter(value, row, column, data); + // console.log(column) + if (column.id == "usd") { + value = "" + value + ""; + } + if (column.id == "tzs") { + value = "" + value + ""; + } + + if (data["invoice_no"] == "TOTAL") { + value = "" + value + ""; + if (column.id == "due_date") { + value = ""; + } + + if (column.id == "cost_center") { + value = ""; + } + + if (column.id == "items") { + value = ""; + } + if (column.id == "from_date") { + value = ""; + } + if (column.id == "to_date") { + value = ""; + } + } + + return value; + }, +}; \ No newline at end of file diff --git a/propms/property_management_solution/report/debtors_report/debtors_report.json b/propms/property_management_solution/report/debtors_report/debtors_report.json new file mode 100644 index 0000000..ff5a17f --- /dev/null +++ b/propms/property_management_solution/report/debtors_report/debtors_report.json @@ -0,0 +1,31 @@ +{ + "add_total_row": 0, + "columns": [], + "creation": "2020-01-12 12:40:47.985294", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "filters": [], + "idx": 0, + "is_standard": "Yes", + "javascript": "", + "modified": "2022-08-04 16:11:10.847373", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Debtors Report", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT COALESCE(gsi.name, \"TOTAL\") AS \"Invoice No:Link/Sales Invoice:150\",\r\n if(gsi.name is null, \"\", gsi.customer) AS \"Customer:Link/Customer:250\",\r\n gsi.cost_center AS \"Cost Center:Data:250\",\r\n gsi.item AS \"Items:Data:300\",\r\n\t\tgsi.from_date AS \"From Date:Date:100\", \r\n\t\tgsi.to_date AS \"To Date:Date:100\", \r\n\t\tgsi.due_date AS \"Due Date:Date:100\", \r\n FORMAT(SUM(gsi.usd),2) AS \"USD:Decimal/2:100\",\r\n FORMAT(SUM(gsi.tzs),2) AS \"TZS:Decimal/2:100\",\r\n gsi._user_tags as \"Remarks:Data:200\" \r\nFROM\r\n(\r\n SELECT \tsi.name, \r\n \t\tsi.customer,\r\n \t\tsi.cost_center,\r\n \t\tGROUP_CONCAT(sid.item_name) AS \"item\",\r\n \t\tsi.from_date,\r\n \t\tsi.to_date, \r\n \t\tsi.due_date, \r\n \t\tsi.currency,\r\n \tMAX(IF(si.currency = \"USD\", IF( si.currency = si.party_account_currency, si.outstanding_amount, si.outstanding_amount/si.conversion_rate), 0)) AS \"usd\",\r\n \t MAX(IF(si.currency = \"TZS\", IF( si.currency = si.party_account_currency, si.outstanding_amount, si.outstanding_amount*si.conversion_rate), 0)) AS \"tzs\",\r\n \t\tsi._user_tags\r\n FROM `tabSales Invoice` si LEFT JOIN `tabSales Invoice Item` as sid ON si.name = sid.parent\r\n WHERE si.status IN (\"Partly Paid\", \"Unpaid\", \"Unpaid and Discounted\", \"Partly Paid and Discounted\", \"Overdue and Discounted\", \"Overdue\")\r\n GROUP BY si.name\r\n) gsi\r\nGROUP BY gsi.customer, gsi.name WITH ROLLUP", + "ref_doctype": "Sales Invoice", + "report_name": "Debtors Report", + "report_type": "Query Report", + "roles": [ + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/invoice_details/__init__.py b/propms/property_management_solution/report/invoice_details/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/invoice_details/invoice_details.js b/propms/property_management_solution/report/invoice_details/invoice_details.js new file mode 100644 index 0000000..8213cb6 --- /dev/null +++ b/propms/property_management_solution/report/invoice_details/invoice_details.js @@ -0,0 +1,26 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Invoice Details"] = { + "filters": [ + { + "fieldname":"rental", + "label": __("Rental"), + "fieldtype": "Select", + "options": "Commercial Rent\nResidential Rent", + "default": "Commercial Rent" + }, + { + "fieldname":"maintenance", + "label": __("Maintenance"), + "fieldtype": "Check" + }, + { + "fieldname":"year", + "label": __("Year"), + "fieldtype": "Link", + "options": "Fiscal Year" + } + ] +}; diff --git a/propms/property_management_solution/report/invoice_details/invoice_details.json b/propms/property_management_solution/report/invoice_details/invoice_details.json new file mode 100644 index 0000000..7995b32 --- /dev/null +++ b/propms/property_management_solution/report/invoice_details/invoice_details.json @@ -0,0 +1,27 @@ +{ + "add_total_row": 1, + "creation": "2019-12-11 05:57:50.689934", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-12-18 13:05:26.776123", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Invoice Details", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Sales Invoice", + "report_name": "Invoice Details", + "report_type": "Script Report", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Accounts Manager" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/invoice_details/invoice_details.py b/propms/property_management_solution/report/invoice_details/invoice_details.py new file mode 100644 index 0000000..f96aea4 --- /dev/null +++ b/propms/property_management_solution/report/invoice_details/invoice_details.py @@ -0,0 +1,17 @@ +# Copyright (c) 2013, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals + +# import frappe +from .other_methods import get_residential_columns +from .other_methods import get_sales_invoice + + +def execute(filters=None): + columns, data = [], [] + if filters.get("rental") and filters.get("year"): + columns = get_residential_columns(filters.get("year")) + get_sales_invoice(filters, data) + + return columns, data diff --git a/propms/property_management_solution/report/invoice_details/other_methods.py b/propms/property_management_solution/report/invoice_details/other_methods.py new file mode 100644 index 0000000..eef0872 --- /dev/null +++ b/propms/property_management_solution/report/invoice_details/other_methods.py @@ -0,0 +1,216 @@ +import frappe, calendar +from frappe import _ +from datetime import date, timedelta + + +def get_residential_columns(year): + columns = [ + { + "fieldname": "apartment_no", + "label": _("Apartment No."), + "fieldtype": "Data", + "width": 150, + }, + { + "fieldname": "client", + "label": _("Client"), + "fieldtype": "Data", + "width": 150, + }, + { + "fieldname": "advance_prev_year", + "label": _("Advance RECD in 2019"), + "fieldtype": "Data", + "width": 150, + }, + { + "fieldname": "invoice_no", + "label": _("Invoice No."), + "fieldtype": "Link", + "options": "Sales Invoice", + "width": 150, + }, + {"fieldname": "from", "label": _("From"), "fieldtype": "Data", "width": 150}, + {"fieldname": "to", "label": _("To"), "fieldtype": "Data", "width": 150}, + { + "fieldname": "invoice_amount", + "label": _("Invoice Amount"), + "fieldtype": "Data", + "width": 150, + }, + ] + months = months_array() + for i in months: + columns.append( + { + "fieldname": i.lower(), + "label": i + " " + str(year), + "fieldtype": "Data", + "width": 150, + } + ) + + return columns + + +def get_sales_invoice(filters, data, from_other=None, months=None): + total = {} + lease_item = "'" + filters.get("rental") + "' " + print(lease_item) + if filters.get("maintenance"): + lease_item = "'Service Charge - " + filters.get("rental").split()[0] + "'" + + query = """ SELECT * FROM `tabSales Invoice` AS SI WHERE EXISTS (SELECT * FROM `tabSales Invoice Item` AS SIT WHERE SIT.item_code = {0} and SIT.parent = SI.name ) + and SI.docstatus=%s + ORDER by SI.customer,SI.from_date ASC""".format( + lease_item + ) % ( + 1 + ) + + sales_invoices = frappe.db.sql(query, as_dict=True) + previuos_customer = "" + for i in sales_invoices: + lease = frappe.get_value("Lease", i.lease, "property") + obj = { + "apartment_no": lease or "", + "client": i.customer, + "advance_prev_year": "", + "invoice_no": i.name, + "from": i.from_date if i.from_date else i.posting_date, + "to": i.to_date - timedelta(days=1) if i.to_date else i.posting_date, + "invoice_amount": i.total, + } + set_monthly_amount( + i.from_date, + i.to_date - timedelta(days=1) if i.to_date else "", + obj, + filters, + total, + months, + ) + if previuos_customer != i.customer: + data.append({}) + previuos_customer = i.customer + data.append(obj) + if from_other: + data.append(total) + + +def set_monthly_amount(start_date, end_date, obj, filters, total, months): + rate = get_rate(obj["invoice_no"], filters) + if end_date and rate: + check_dates(start_date, end_date, rate, obj, total, months) + + +def check_dates(start_date, end_date, rate, obj, total, months): + start = start_date + no_minus = 0 + + while start < end_date: + month_string = start.strftime("%b") + month_no_of_days = calendar.monthrange(start.year, start.month)[1] + last_date = date(start.year, start.month, month_no_of_days) + if (last_date - start).days >= 29 or ( + month_string == "Feb" and (last_date - start).days >= 27 + ): + if start.year == start_date.year: + obj[month_string.lower()] = round(rate, 2) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round(rate, 2) + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round(rate, 2) + ) + else: + if start.year == start_date.year: + obj[month_string.lower()] = round( + round(rate / month_no_of_days, 2) + * (month_no_of_days - int(start.day)), + 2, + ) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round( + round(rate / month_no_of_days, 2) + * (month_no_of_days - int(start.day)), + 2, + ) + + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round( + round(rate / month_no_of_days, 2) + * (month_no_of_days - int(start.day)), + 2, + ) + ) + no_minus = month_no_of_days + start += timedelta(days=month_no_of_days) + + start_last = start - timedelta(days=no_minus) + + if (end_date - start_last).days > 0 and start_last.month != end_date.month: + if start_last.year == start_date.year and start_last.year == end_date.year: + month_string = end_date.strftime("%b") + month_no_of_days = calendar.monthrange(end_date.year, end_date.month)[1] + if int(end_date.day) >= 29 or ( + month_string == "Feb" and (end_date - start_last).days >= 27 + ): + obj[month_string.lower()] = round(rate, 2) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round(rate, 2) + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round(rate, 2) + ) + else: + obj[month_string.lower()] = round( + round(rate / month_no_of_days, 2) * (int(end_date.day)), 2 + ) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round( + round(rate / month_no_of_days, 2) * (int(end_date.day)), 2 + ) + + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round( + round(rate / month_no_of_days, 2) * (int(end_date.day)), 2 + ) + ) + + +def months_array(): + return [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", + ] + + +def get_rate(invoice_name, filters): + filters_value = " and item_code= '" + filters.get("rental") + "' " + if filters.get("maintenance"): + filters_value = ( + "and item_code = 'Service Charge - " + + filters.get("rental").split()[0] + + "'" + ) + query = """ SELECT rate FROM `tabSales Invoice Item` WHERE {0} {1}""".format( + "parent = '" + invoice_name + "' ", filters_value + ) + + return ( + frappe.db.sql(query, as_dict=True)[0].rate + if len(frappe.db.sql(query, as_dict=True)) > 0 + else "" + ) diff --git a/propms/property_management_solution/report/lease_information/__init__.py b/propms/property_management_solution/report/lease_information/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/lease_information/lease_information.js b/propms/property_management_solution/report/lease_information/lease_information.js new file mode 100644 index 0000000..a89539f --- /dev/null +++ b/propms/property_management_solution/report/lease_information/lease_information.js @@ -0,0 +1,16 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Lease Information"] = { + "filters": [ + { + "fieldname":"property_type", + "label": __("Property Type"), + "fieldtype": "Link", + "options": "Unit Type", + "default": " ", + "reqd": 1 + }, + ] +} diff --git a/propms/property_management_solution/report/lease_information/lease_information.json b/propms/property_management_solution/report/lease_information/lease_information.json new file mode 100644 index 0000000..102611a --- /dev/null +++ b/propms/property_management_solution/report/lease_information/lease_information.json @@ -0,0 +1,21 @@ +{ + "add_total_row": 0, + "creation": "2020-04-22 14:28:59.140359", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2020-04-27 11:38:13.263202", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Lease Information", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT p.type AS \"Property Type:Data:0\",\n l.property AS \"Property:Link/Property:0\",\n l.name \"Lease No.:Data:0\",\n p.bedroom AS \"BHK:Data:0\",\n p.builtup_area AS \"Builtup Area:Data:0\",\n p.carpet_area AS \"Carper Area:Data:0\",\n p.unit_owner AS \"Unit Owner:Link/Customer:0\",\n l.lease_customer AS \"Lease Customer:Link/Customer:0\",\n l.customer as \"POS Customer:Link/Customer:0\",\n l.lease_date as \"Lease Date:Date:0\",\n l.start_date as \"Lease Start:Date:0\",\n l.end_date as \"Lease End:Date:0\",\n if(l.signed_agreement_received = 1, \"Yes\", \" \") AS \"Agreement Status:Data:0\",\n if(l.stamp_duty_paid_by_tenant = 1, \"Yes\", \" \") AS \"Stamp Duty Status:Data:0\",\n l.security_deposit_currency as \"Security Deposit Currency:Data:0\",\n l.security_deposit as \"Security Amount:Currency/Security Deposit Currency:0\",\n ld1.frequency AS \"Rent Frequency:Data:0\",\n ld1.currency_code AS \"Rent Currency:Data:0\",\n ld1.amount as \"Rent Amount:Currency/Rent Currency:0\",\n ld2.frequency AS \"Service Charge Frequency:Data:0\",\n ld2.currency_code AS \"Service Charge Currency:Data:0\",\n ld2.amount as \"Service Charge Amount:Currency/Service Charge Currency:0\"\nFROM `tabLease` l left join `tabProperty` p on l.property = p.name\n left join `tabLease Item` ld1 on l.name = ld1.parent and (ld1.lease_item in ('Commercial Rent', 'Residential Rent') or ld1.lease_item like 'Parking Slot%%')\n left join `tabLease Item` ld2 on l.name = ld2.parent and ld2.lease_item in ('Service Charge - Commercial','Service Charge - Residential')\nWHERE p.type LIKE concat(\"%%\", IF(%(property_type)s = \" \" , \"\", %(property_type)s), \"%%\") ", + "ref_doctype": "Lease", + "report_name": "Lease Information", + "report_type": "Query Report", + "roles": [] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/mis_income_break_up/__init__.py b/propms/property_management_solution/report/mis_income_break_up/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.js b/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.js new file mode 100644 index 0000000..0ecc6e9 --- /dev/null +++ b/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.js @@ -0,0 +1,36 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ +var months = "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember" +frappe.query_reports["Mis-Income Break Up"] = { + "filters": [ + { + "fieldname":"from", + "label": __("From Month"), + "fieldtype": "Select", + "options": months, + "default": "January" + }, + { + "fieldname":"to", + "label": __("To Month"), + "fieldtype": "Select", + "options": months, + "default": "December" + }, + { + "fieldname":"year", + "label": __("Year"), + "fieldtype": "Link", + "options": "Fiscal Year" + } + ], + "formatter": function(value, row, column, data, default_formatter) { + value = default_formatter(value, row, column, data); + if (row[0].rowIndex === 5 || value === "RENTAL INCOME" || value === "MAINTENANCE INCOME" || value === "Maintenance Total"){ + value = ''+value+''; + } + return value; + } + +}; diff --git a/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.json b/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.json new file mode 100644 index 0000000..eb93e76 --- /dev/null +++ b/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 0, + "creation": "2019-12-18 09:36:54.791826", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "letter_head": "Viva Towers Official", + "modified": "2019-12-18 09:36:54.791826", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Mis-Income Break Up", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Sales Invoice", + "report_name": "Mis-Income Break Up", + "report_type": "Script Report", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Accounts Manager" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.py b/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.py new file mode 100644 index 0000000..1349464 --- /dev/null +++ b/propms/property_management_solution/report/mis_income_break_up/mis_income_break_up.py @@ -0,0 +1,15 @@ +# Copyright (c) 2013, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from .other_methods import get_columns +from .other_methods import get_rentals +from .other_methods import get_rental_maintenance + + +def execute(filters=None): + columns, data = get_columns(filters), get_rentals(filters) + + get_rental_maintenance(filters, data) + + return columns, data diff --git a/propms/property_management_solution/report/mis_income_break_up/other_methods.py b/propms/property_management_solution/report/mis_income_break_up/other_methods.py new file mode 100644 index 0000000..73ec6d8 --- /dev/null +++ b/propms/property_management_solution/report/mis_income_break_up/other_methods.py @@ -0,0 +1,109 @@ +from time import strptime +import calendar +from collections import Counter +from ..invoice_details.other_methods import get_sales_invoice +from ..utility_invoices.other_methods import get_utility_sales_invoice + +months = [] + + +def get_rentals(filters): + return_data = [] + if filters.get("year"): + + return_data.append({"income": "RENTAL INCOME"}) + sum_monthly = Counter({}) + tax = {"income": "LESS: W.TAX 10%"} + net_rent = {"income": "NET RENT RECEIVED"} + rentals = ["Commercial Rent", "Residential Rent"] + for i in rentals: + data = [] + _filters = {"rental": i, "year": filters.get("year")} + get_sales_invoice(_filters, data, "Mis Income Break Up", months) + if len(data) > 0 and len(data[len(data) - 1]) > 0: + data[len(data) - 1]["total"] = sum(data[len(data) - 1].values()) / len( + data[len(data) - 1] + ) + + sum_monthly += Counter(data[len(data) - 1]) + + data[len(data) - 1]["income"] = i + return_data.append(data[len(data) - 1]) + + sum_monthly["income"] = "Total Rentals Received" + + return_data.append(sum_monthly) + return_data.append(tax) + return_data.append(net_rent) + for i in sum_monthly: + tax[i] = float(sum_monthly[i]) * float(0.10) + net_rent[i] = sum_monthly[i] - tax[i] + return return_data + + +def get_rental_maintenance(filters, return_data): + + if filters.get("year"): + + return_data.append({"income": "MAINTENANCE INCOME"}) + sum_monthly = Counter({}) + + rentals = ["Commercial Rent", "Residential Rent", "Utility Charges"] + for ii in rentals: + data = [] + _filters = {"rental": ii, "year": filters.get("year"), "maintenance": 1} + if ii == "Utility Charges": + get_utility_sales_invoice(data, "Mis Income Break Up", months) + else: + get_sales_invoice(_filters, data, "Mis Income Break Up", months) + if len(data) > 0 and len(data[len(data) - 1]) > 0: + data[len(data) - 1]["total"] = sum(data[len(data) - 1].values()) / len( + data[len(data) - 1] + ) + + sum_monthly += Counter(data[len(data) - 1]) + + data[len(data) - 1]["income"] = ( + ii + " Maintenance" if ii != "Utility Charges" else ii + ) + return_data.append(data[len(data) - 1]) + + sum_monthly["income"] = "Maintenance Total" + + return_data.append(sum_monthly) + return_data.append({}) + return return_data + + +def get_columns(filters): + columns = [ + { + "label": "Income", + "fieldname": "income", + "fieldtype": "Data", + "width": 200, + } + ] + month_int_from = int(strptime(filters.get("from"), "%B").tm_mon) + month_int_to = int(strptime(filters.get("to"), "%B").tm_mon) + + while month_int_from <= month_int_to: + months.append(calendar.month_name[month_int_from].lower()[:3]) + columns.append( + { + "label": calendar.month_name[month_int_from], + "fieldname": calendar.month_name[month_int_from].lower()[:3], + "fieldtype": "Currency", + "width": 180, + } + ) + month_int_from += 1 + columns.append( + { + "label": "Total", + "fieldname": "total", + "fieldtype": "Currency", + "width": 180, + } + ) + return columns diff --git a/propms/property_management_solution/report/outsourcing_attendance/__init__.py b/propms/property_management_solution/report/outsourcing_attendance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/outsourcing_attendance/outsourcing_attendance.json b/propms/property_management_solution/report/outsourcing_attendance/outsourcing_attendance.json new file mode 100644 index 0000000..897c370 --- /dev/null +++ b/propms/property_management_solution/report/outsourcing_attendance/outsourcing_attendance.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 0, + "creation": "2019-02-07 10:32:32.266115", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-02-07 10:42:43.433394", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Outsourcing Attendance", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT oa.owner as `Created by`,\n oa.modified_by as `Approved by`,\n upper(oa.shift_name) as `Shift`,\n oa.shift_date as `Date:Date:`,\n oad.person_name as `Person Name`,\n oad.position as `Position`, \n if(oad.status = 'Present', 1, 0) as `Present:Int:`,\n if(oad.status = 'Absent ', 1, 0) as `Absent:Int:`,\n if(oad.status = 'Day off', 1, 0) as `Day off:Int:`,\n 1 as `Total:Int:`,\n oad.remarks as `Remarks`\nFROM `tabOutsourcing Attendance` as oa,\n `tabOutsourcing Attendance Details` oad\nWHERE oa.name = oad.parent ", + "ref_doctype": "Outsourcing Attendance", + "report_name": "Outsourcing Attendance", + "report_type": "Query Report", + "roles": [ + { + "role": "System Manager" + }, + { + "role": "Maintenance Job in-charge" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/pending_signed_agreement/__init__.py b/propms/property_management_solution/report/pending_signed_agreement/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/pending_signed_agreement/pending_signed_agreement.json b/propms/property_management_solution/report/pending_signed_agreement/pending_signed_agreement.json new file mode 100644 index 0000000..a148b8b --- /dev/null +++ b/propms/property_management_solution/report/pending_signed_agreement/pending_signed_agreement.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 0, + "creation": "2020-03-04 10:08:36.269492", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "json": "{\"order_by\": \"`tabLease`.`modified` desc\", \"filters\": [[\"Lease\", \"signed_agreement_received\", \"=\", 0, false]], \"fields\": [[\"name\", \"Lease\"], [\"docstatus\", \"Lease\"], [\"property_owner\", \"Lease\"], [\"customer\", \"Lease\"], [\"start_date\", \"Lease\"], [\"end_date\", \"Lease\"]], \"add_totals_row\": 0, \"add_total_row\": 0, \"page_length\": 20}", + "modified": "2020-03-10 13:15:06.003053", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Pending Signed Agreement", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Lease", + "report_name": "Pending Signed Agreement", + "report_type": "Report Builder", + "roles": [ + { + "role": "System Manager" + }, + { + "role": "Property Manager" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/property_status/__init__.py b/propms/property_management_solution/report/property_status/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/property_status/property_status.js b/propms/property_management_solution/report/property_status/property_status.js new file mode 100644 index 0000000..4833ae5 --- /dev/null +++ b/propms/property_management_solution/report/property_status/property_status.js @@ -0,0 +1,24 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Property Status"] = { + "filters": [ + { + "fieldname":"property_type", + "label": __("Property Type"), + "fieldtype": "Link", + "options": "Unit Type", + "default": " ", + "reqd": 1 + }, + { + "fieldname":"owner_type", + "label": __("Owner Type"), + "fieldtype": "Link", + "options": "Customer Group", + "default": " ", + "reqd": 1 + }, + ] +} diff --git a/propms/property_management_solution/report/property_status/property_status.json b/propms/property_management_solution/report/property_status/property_status.json new file mode 100644 index 0000000..785a607 --- /dev/null +++ b/propms/property_management_solution/report/property_status/property_status.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 0, + "creation": "2020-03-04 10:08:36.015795", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2021-06-18 15:28:51.610759", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property Status", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT p.name AS \"Property:Link/Property:150\",\n p.type AS \"Property Type:Data:150\",\n p.bedroom AS \"BHK:Data:50\",\n p.builtup_area AS \"Builtup Area:Data:100\",\n p.carpet_area AS \"Carper Area:Data:100\",\n p.unit_owner AS \"Unit Owner:Link/Customer:150\",\n c.customer_group AS \"Owner Type:Data:150\",\n l.lease_customer AS \"Customer:Link/Customer:150\",\n l.end_date AS \"End Date:Date:100\",\n l.lease_status AS \"Status:Data:80\",\n l.name AS \"Lease:Link/Lease:100\",\n l.security_deposit_currency AS \"Currency:Data:50\",\n l.security_deposit AS \"Amount:Float:100\",\n l.security_status AS \"Security Status:Data:100\",\n GROUP_CONCAT(CONCAT_WS('-',li.lease_item,FORMAT(li.amount,2)) SEPARATOR ' | ') AS \"Lease Details:Data:400\"\nFROM `tabProperty` p left join `tabLease` l on p.name = l.property\n LEFT JOIN `tabLease Item` li on l.name = li.parent\n left join `tabCustomer` c on p.unit_owner = c.name\nWHERE p.type LIKE concat(\"%%\", IF(%(property_type)s = \" \" , \"\", %(property_type)s), \"%%\")\nAND c.customer_group LIKE concat(\"%%\", IF(%(owner_type)s = \" \" , \"\", %(owner_type)s), \"%%\")\nGROUP by p.name\nORDER BY p.name", + "ref_doctype": "Lease", + "report_name": "Property Status", + "report_type": "Query Report", + "roles": [ + { + "role": "System Manager" + }, + { + "role": "Property Manager" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/rent_invoices_details/__init__.py b/propms/property_management_solution/report/rent_invoices_details/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.js b/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.js new file mode 100644 index 0000000..952c3d1 --- /dev/null +++ b/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.js @@ -0,0 +1,51 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Rent Invoices Details"] = { + "filters": [ + { + fieldname: 'company', + label: __('Company'), + fieldtype: 'Link', + options: 'Company', + default: frappe.defaults.get_user_default('company'), + reqd: 1 + }, + { + fieldname: 'type_name', + label: __('Item Group'), + fieldtype: 'Link', + options: 'Item Group', + default: 'All Item Groups', + "reqd": 1 + }, + { + fieldname:"from_date", + label: __("Start Date"), + fieldtype: "Date", + default: frappe.datetime.year_start(), + reqd: 1 + }, + { + fieldname:"to_date", + label: __("End Date"), + fieldtype: "Date", + default: frappe.datetime.get_today(), + reqd: 1 + }, + { + fieldname: 'foreign_currency', + label: __('Currency'), + fieldtype: 'Select', + default: 'USD', + options: erpnext.get_presentation_currency_list() + }, + { + fieldname: 'extand', + label: __('Extand'), + fieldtype: 'Check', + default: '0', + }, + ] +}; diff --git a/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.json b/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.json new file mode 100644 index 0000000..29f9daa --- /dev/null +++ b/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 1, + "creation": "2020-04-28 01:03:22.579523", + "disable_prepared_report": 1, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2020-04-28 01:05:52.715499", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Rent Invoices Details", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Sales Invoice", + "reference_report": "", + "report_name": "Rent Invoices Details", + "report_type": "Script Report", + "roles": [ + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.py b/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.py new file mode 100644 index 0000000..b8bf743 --- /dev/null +++ b/propms/property_management_solution/report/rent_invoices_details/rent_invoices_details.py @@ -0,0 +1,506 @@ +# Copyright (c) 2013, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from time import strptime +import calendar +from datetime import date, timedelta, datetime +from collections import OrderedDict +from frappe.utils import ( + getdate, + date_diff, + month_diff, + get_last_day, + get_first_day, + add_months, + floor, + add_days, + flt, + cint, +) +from erpnext import get_company_currency, get_default_company + + +def execute(filters=None): + data = get_data(filters) + columns = get_columns(filters) + return columns, data + + +def get_data(filters): + rows = [] + _from_date = "'{from_date}'".format(from_date=filters["from_date"]) + _to_date = "'{to_date}'".format(to_date=filters["to_date"]) + _company = "'{company}'".format(company=filters["company"]) + _items_grupe = filters.get("type_name") + float_precision = cint(frappe.db.get_default("float_precision")) or 2 + if filters.get("company"): + default_currency = get_company_currency(filters["company"]) + else: + company = get_default_company() + default_currency = get_company_currency(company) + + conditions = "" + if not filters.get("extand"): + conditions = "AND DATE(posting_date) BETWEEN {start} AND {end}".format( + start=_from_date, end=_to_date + ) + + query = """ + SELECT + name as invoice_id, + customer, + base_net_total as total, + net_total as foreign_total, + currency, + conversion_rate as exchange_rate, + posting_date as date, + lease + FROM + `tabSales Invoice` + WHERE + docstatus = 1 + AND company = {company} + AND lease != "" + AND from_date != "" + AND to_date != "" + AND is_return != 1 + {conditions} + ORDER BY lease DESC, posting_date DESC + """.format( + conditions=conditions, company=_company + ) + + sales_invoices = frappe.db.sql(query, as_dict=True) + + for invoice in sales_invoices: + _items_rwos = [] + append = False + property_name = frappe.db.get_value("Lease", invoice["lease"], "property") + invoice["property_name"] = property_name + if invoice.total == invoice.foreign_total: + invoice.foreign_total, invoice.exchange_rate = "", "" + # if filters.get("foreign_currency") and get_company_currency(filters.company) != filters.foreign_currency: + # months_obj = calculate_monthly_ammount(invoice.foreign_total,invoice.from_date,invoice.to_date) + # else: + # months_obj = calculate_monthly_ammount(invoice.total,invoice.from_date,invoice.to_date) + # if months_obj: + # for key,value in months_obj.items(): + # invoice[key] = value + + invoice_id = "'{invoice_id}'".format(invoice_id=invoice["invoice_id"]) + + query_items = """ + SELECT + item_code, + base_net_amount as item_total, + net_amount as item_foreign_total, + service_start_date as from_date, + service_end_date as to_date, + qty as quantity, + net_rate + FROM + `tabSales Invoice Item` + WHERE + parent = {invoice_id} + """.format( + invoice_id=invoice_id + ) + + items = frappe.db.sql(query_items, as_dict=True) + for item in items: + item_group = frappe.db.get_value("Item", item["item_code"], "item_group") + item["item_group"] = item_group + item.item_foreign_total = flt(item.item_foreign_total, float_precision) + item.item_total = flt(item.item_total, float_precision) + months_obj = calculate_monthly_ammount( + item.item_total, + default_currency, + item.from_date, + item.to_date, + item.item_foreign_total, + filters.get("foreign_currency"), + filters, + ) + if months_obj: + for key, value in months_obj.items(): + item[key] = value + if _items_grupe == "All Item Groups": + _items_rwos.append(item) + append = True + elif _items_grupe == item_group: + _items_rwos.append(item) + append = True + if filters.get("foreign_currency"): + item.item_total = flt(item.item_foreign_total, float_precision) + else: + item.item_total = flt(item.item_total, float_precision) + if append and ( + filters.foreign_currency == invoice.currency or not filters.foreign_currency + ): + # rows.append(invoice) + for item in _items_rwos: + item.update(invoice) + rows.append(item) + # rows.append({}) + + return rows + + +def get_columns(filters): + if filters.get("company"): + currency = get_company_currency(filters["company"]) + else: + company = get_default_company() + currency = get_company_currency(company) + + if filters.get("foreign_currency"): + _foreign_currency = filters["foreign_currency"] + else: + _foreign_currency = currency + + if _foreign_currency == currency: + foreign_currency = "Foreign" + else: + foreign_currency = filters["foreign_currency"] + + columns = [ + { + "label": "Property", + "fieldname": "property_name", + "fieldtype": "Link", + "options": "Property", + "width": 100, + }, + { + "label": "Customer", + "fieldname": "customer", + "fieldtype": "Link", + "options": "Customer", + "width": 100, + }, + { + "label": "Lease", + "fieldname": "lease", + "fieldtype": "Link", + "options": "Lease", + "width": 100, + }, + { + "label": "Advance Before {0}".format(_foreign_currency), + "fieldname": "advance_before", + "fieldtype": "Float", + "width": 100, + }, + { + "label": "Invoice", + "fieldname": "invoice_id", + "fieldtype": "Link", + "options": "Sales Invoice", + "width": 150, + }, + { + "label": "Date", + "fieldname": "date", + "fieldtype": "date", + "width": 100, + }, + # { + # "label": "Total {0}".format(currency), + # "fieldname": "total", + # "fieldtype": "Float", + # "width": 100, + # }, + { + "label": "Exchange Rate", + "fieldname": "exchange_rate", + "fieldtype": "Float", + "width": 100, + }, + # { + # "label": "Total {0}".format(foreign_currency or "Foreign"), + # "fieldname": "foreign_total", + # "fieldtype": "Float", + # "width": 100, + # }, + { + "label": "Item", + "fieldname": "item_code", + "fieldtype": "Link", + "options": "Item", + "width": 100, + }, + { + "label": "Quantity", + "fieldname": "quantity", + "width": 75, + }, + { + "label": "Item Total {0}".format(_foreign_currency), + "fieldname": "item_total", + "fieldtype": "Float", + "width": 100, + }, + { + "label": "From Date", + "fieldname": "from_date", + "fieldtype": "date", + "width": 100, + }, + { + "label": "To Date", + "fieldname": "to_date", + "fieldtype": "date", + "width": 100, + }, + ] + + months_list = get_months(filters["from_date"], filters["to_date"]) + + for month in months_list: + columns.append( + { + "label": "{0} {1}".format(month, currency), + "fieldname": "{0} {1}".format(month.lower(), currency), + "fieldtype": "Float", + "width": 100, + } + ) + if ( + filters.get("foreign_currency") + and filters.get("foreign_currency") != currency + ): + columns.append( + { + "label": "{0} {1}".format(month, filters.get("foreign_currency")), + "fieldname": "{0} {1}".format( + month.lower(), filters.get("foreign_currency") + ), + "fieldtype": "Float", + "width": 100, + } + ) + + columns.append( + { + "label": "Advance After {0}".format(_foreign_currency), + "fieldname": "advance_after", + "fieldtype": "Float", + "width": 100, + } + ) + + return columns + + +def get_months(from_date, to_date): + months_list = [] + dates = [from_date, to_date] + start, end = [datetime.strptime(_, "%Y-%m-%d") for _ in dates] + months_obj = OrderedDict( + ((start + timedelta(_)).strftime(r"%b-%y"), None) + for _ in range((end - start).days) + ) + for key, value in months_obj.items(): + months_list.append(key) + return months_list + + +def check_full_month(from_date, to_date): + month_start_day = get_first_day(from_date) + month_end_day = get_last_day(from_date) + if from_date == month_start_day and to_date == month_end_day: + return True + else: + return False + + +def calculate_monthly_ammount( + ammount, + default_currency, + from_date, + to_date, + foreign_ammount, + foreign_currency=None, + filters=None, +): + float_precision = cint(frappe.db.get_default("float_precision")) or 2 + months_report_list = [] + for month in get_months(filters["from_date"], filters["to_date"]): + months_report_list.append("{0} {1}".format(month.lower(), default_currency)) + if ( + filters.get("foreign_currency") + and filters.get("foreign_currency") != default_currency + ): + months_report_list.append( + "{0} {1}".format(month.lower(), filters.get("foreign_currency")) + ) + if ammount and from_date and to_date: + monthly_ammount_obj = {} + days = 0 + date = from_date + end_date = to_date + field_list = [] + field_list_foreign = [] + first_last = 0 + first_last_foreign = 0 + sub_ammount = 0 + sub_ammount_foreign = 0 + # days_list= [] + + while date <= end_date: + start_month = getdate(date).month + end_month = getdate(to_date).month + + if start_month == end_month: + last_day = end_date + days_diff = date_diff(last_day, date) + 1 + if check_full_month(date, last_day): + days_diff = 30 + days += days_diff + # days_list.append(days_diff) + if date == last_day: + last_day = add_days(last_day, 1) + month_filed = (get_months(str(date), str(last_day))[0]).lower() + month_len = date_diff(get_last_day(date), get_first_day(date)) + field_list.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format(month_filed, default_currency), + "month_len": month_len, + "foreign": False, + } + ) + if foreign_currency and foreign_currency != default_currency: + field_list_foreign.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format( + month_filed, foreign_currency + ), + "month_len": month_len, + "foreign": True, + } + ) + date = get_first_day(add_months(date, 1)) + + else: + last_day = get_last_day(date) + days_diff = date_diff(last_day, date) + 1 + if check_full_month(date, last_day): + days_diff = 30 + days += days_diff + # days_list.append(days_diff) + if date == last_day: + last_day = add_days(last_day, 1) + month_filed = (get_months(str(date), str(last_day))[0]).lower() + month_len = date_diff(get_last_day(date), get_first_day(date)) + field_list.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format(month_filed, default_currency), + "month_len": month_len, + "foreign": False, + } + ) + if foreign_currency and foreign_currency != default_currency: + field_list_foreign.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format( + month_filed, foreign_currency + ), + "month_len": month_len, + "foreign": True, + } + ) + date = get_first_day(add_months(date, 1)) + + if floor(days / 30) != (days / 30) and (floor(days / 30) * 30 + 6) < days: + days = (floor(days / 30) + 1) * 30 + elif floor(days / 30) != (days / 30) and floor(days / 30) * 30 < days: + days = floor(days / 30) * 30 + + daily_ammount = ammount / (days) + daily_ammount_foreign = foreign_ammount / (days) + + m = 1 + for i in field_list: + if m == 1 and i["days_diff"] < 30: + first_last += i["days_diff"] + elif m == len(field_list) and i["days_diff"] < 30: + first_last += i["days_diff"] + else: + sub_ammount += i["days_diff"] * daily_ammount + m += 1 + + m = 1 + for i in field_list_foreign: + if m == 1 and i["days_diff"] < 30: + first_last_foreign += i["days_diff"] + elif m == len(field_list) and i["days_diff"] < 30: + first_last_foreign += i["days_diff"] + else: + sub_ammount_foreign += i["days_diff"] * daily_ammount_foreign + m += 1 + + n = 1 + for i in field_list_foreign: + if n == 1 and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] + * ((foreign_ammount - sub_ammount_foreign) / first_last), + float_precision, + ) + elif n == len(field_list) and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] + * ((foreign_ammount - sub_ammount_foreign) / first_last), + float_precision, + ) + else: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * daily_ammount_foreign, float_precision + ) + n += 1 + + n = 1 + for i in field_list: + if n == 1 and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * ((ammount - sub_ammount) / first_last), + float_precision, + ) + elif n == len(field_list) and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * ((ammount - sub_ammount) / first_last), + float_precision, + ) + else: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * daily_ammount, float_precision + ) + n += 1 + advance_before = 0 + advance_after = 0 + first_month = datetime.strptime( + months_report_list[0][:6].replace("-", " 20"), "%b %Y" + ) + last_month = datetime.strptime( + months_report_list[-1][:6].replace("-", " 20"), "%b %Y" + ) + for key, value in monthly_ammount_obj.items(): + key_currency = key[7:] + currency = foreign_currency or default_currency + if key not in months_report_list and key_currency == currency: + mydate = datetime.strptime(str(key)[:6].replace("-", " 20"), "%b %Y") + if mydate > last_month: + advance_after += value + elif mydate < first_month: + advance_before += value + if advance_after: + monthly_ammount_obj["advance_after"] = advance_after + if advance_before: + monthly_ammount_obj["advance_before"] = advance_before + return monthly_ammount_obj diff --git a/propms/property_management_solution/report/rent_invoices_details_usd/__init__.py b/propms/property_management_solution/report/rent_invoices_details_usd/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.js b/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.js new file mode 100644 index 0000000..69af3a7 --- /dev/null +++ b/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.js @@ -0,0 +1,44 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Rent Invoices Details USD"] = { + "filters": [ + { + fieldname: 'company', + label: __('Company'), + fieldtype: 'Link', + options: 'Company', + default: frappe.defaults.get_user_default('company'), + reqd: 1 + }, + { + fieldname: 'type_name', + label: __('Item Group'), + fieldtype: 'Link', + options: 'Item Group', + default: 'All Item Groups', + "reqd": 1 + }, + { + fieldname: "from_date", + label: __("Start Date"), + fieldtype: "Date", + default: frappe.datetime.year_start(), + reqd: 1 + }, + { + fieldname: "to_date", + label: __("End Date"), + fieldtype: "Date", + default: frappe.datetime.get_today(), + reqd: 1 + }, + { + fieldname: 'extand', + label: __('Extand'), + fieldtype: 'Check', + default: '0', + }, + ] +}; diff --git a/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.json b/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.json new file mode 100644 index 0000000..441be10 --- /dev/null +++ b/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.json @@ -0,0 +1,30 @@ +{ + "add_total_row": 1, + "columns": [], + "creation": "2021-04-14 02:20:34.835757", + "disable_prepared_report": 1, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "filters": [], + "idx": 0, + "is_standard": "Yes", + "modified": "2021-04-14 02:20:34.835757", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Rent Invoices Details USD", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Sales Invoice", + "reference_report": "", + "report_name": "Rent Invoices Details USD", + "report_type": "Script Report", + "roles": [ + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.py b/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.py new file mode 100644 index 0000000..9fd8a51 --- /dev/null +++ b/propms/property_management_solution/report/rent_invoices_details_usd/rent_invoices_details_usd.py @@ -0,0 +1,501 @@ +# Copyright (c) 2013, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from time import strptime +import calendar +from datetime import date, timedelta, datetime +from collections import OrderedDict +from frappe.utils import ( + getdate, + date_diff, + month_diff, + get_last_day, + get_first_day, + add_months, + floor, + add_days, + flt, + cint, +) +from erpnext import get_company_currency, get_default_company +from erpnext.setup.utils import get_exchange_rate + + +def execute(filters=None): + filters["foreign_currency"] = "USD" + data = get_data(filters) + columns = get_columns(filters) + return columns, data + + +def get_data(filters): + rows = [] + _from_date = "'{from_date}'".format(from_date=filters["from_date"]) + _to_date = "'{to_date}'".format(to_date=filters["to_date"]) + _company = "'{company}'".format(company=filters["company"]) + _items_grupe = filters.get("type_name") + float_precision = cint(frappe.db.get_default("float_precision")) or 2 + if filters.get("company"): + default_currency = get_company_currency(filters["company"]) + else: + company = get_default_company() + default_currency = get_company_currency(company) + + conditions = "" + if not filters.get("extand"): + conditions = "AND DATE(posting_date) BETWEEN {start} AND {end}".format( + start=_from_date, end=_to_date + ) + + query = """ + SELECT + name as invoice_id, + customer, + base_net_total as total, + net_total as foreign_total, + currency, + conversion_rate as exchange_rate, + posting_date as date, + lease + FROM + `tabSales Invoice` + WHERE + docstatus = 1 + AND company = {company} + AND lease != "" + AND from_date != "" + AND to_date != "" + {conditions} + ORDER BY lease DESC, posting_date ASC + """.format( + conditions=conditions, company=_company + ) + + sales_invoices = frappe.db.sql(query, as_dict=True) + + for invoice in sales_invoices: + _items_rwos = [] + append = False + property_name = frappe.db.get_value("Lease", invoice["lease"], "property") + invoice["property_name"] = property_name + if invoice.total == invoice.foreign_total: + invoice.exchange_rate = get_exchange_rate( + "USD", default_currency, invoice.posting_date + ) + invoice.foreign_total = invoice.total / invoice.exchange_rate + + invoice_id = "'{invoice_id}'".format(invoice_id=invoice["invoice_id"]) + + query_items = """ + SELECT + item_code, + base_net_amount as item_total, + net_amount as item_foreign_total, + service_start_date as from_date, + service_end_date as to_date, + qty as quantity, + net_rate + FROM + `tabSales Invoice Item` + WHERE + parent = {invoice_id} + """.format( + invoice_id=invoice_id + ) + + items = frappe.db.sql(query_items, as_dict=True) + for item in items: + item_group = frappe.db.get_value("Item", item["item_code"], "item_group") + item["item_group"] = item_group + item.item_foreign_total = flt(item.item_foreign_total, float_precision) + item.item_total = flt(item.item_total, float_precision) + if item.item_foreign_total == item.item_total: + item.item_foreign_total = item.item_total / invoice.exchange_rate + months_obj = calculate_monthly_ammount( + item.item_total, + default_currency, + item.from_date, + item.to_date, + item.item_foreign_total, + filters.get("foreign_currency"), + filters, + ) + if months_obj: + for key, value in months_obj.items(): + item[key] = value + if _items_grupe == "All Item Groups": + _items_rwos.append(item) + append = True + elif _items_grupe == item_group: + _items_rwos.append(item) + append = True + if filters.get("foreign_currency"): + item.item_total = flt(item.item_foreign_total, float_precision) + else: + item.item_total = flt(item.item_total, float_precision) + if append: + for item in _items_rwos: + item.update(invoice) + rows.append(item) + + return rows + + +def get_columns(filters): + if filters.get("company"): + currency = get_company_currency(filters["company"]) + else: + company = get_default_company() + currency = get_company_currency(company) + + if filters.get("foreign_currency"): + _foreign_currency = filters["foreign_currency"] + else: + _foreign_currency = currency + + if _foreign_currency == currency: + foreign_currency = "Foreign" + else: + foreign_currency = filters["foreign_currency"] + + columns = [ + { + "label": "Property", + "fieldname": "property_name", + "fieldtype": "Link", + "options": "Property", + "width": 100, + }, + { + "label": "Customer", + "fieldname": "customer", + "fieldtype": "Link", + "options": "Customer", + "width": 100, + }, + { + "label": "Lease", + "fieldname": "lease", + "fieldtype": "Link", + "options": "Lease", + "width": 100, + }, + { + "label": "Advance Before {0}".format(_foreign_currency), + "fieldname": "advance_before", + "fieldtype": "Float", + "width": 100, + }, + { + "label": "Invoice", + "fieldname": "invoice_id", + "fieldtype": "Link", + "options": "Sales Invoice", + "width": 150, + }, + { + "label": "Date", + "fieldname": "date", + "fieldtype": "date", + "width": 100, + }, + # { + # "label": "Total {0}".format(currency), + # "fieldname": "total", + # "fieldtype": "Float", + # "width": 100, + # }, + { + "label": "Exchange Rate", + "fieldname": "exchange_rate", + "fieldtype": "Float", + "width": 100, + }, + # { + # "label": "Total {0}".format(foreign_currency or "Foreign"), + # "fieldname": "foreign_total", + # "fieldtype": "Float", + # "width": 100, + # }, + { + "label": "Item", + "fieldname": "item_code", + "fieldtype": "Link", + "options": "Item", + "width": 100, + }, + { + "label": "Quantity", + "fieldname": "quantity", + "width": 75, + }, + { + "label": "Item Total {0}".format(_foreign_currency), + "fieldname": "item_total", + "fieldtype": "Float", + "width": 100, + }, + { + "label": "From Date", + "fieldname": "from_date", + "fieldtype": "date", + "width": 100, + }, + { + "label": "To Date", + "fieldname": "to_date", + "fieldtype": "date", + "width": 100, + }, + ] + + months_list = get_months(filters["from_date"], filters["to_date"]) + + for month in months_list: + columns.append( + { + "label": "{0} {1}".format(month, currency), + "fieldname": "{0} {1}".format(month.lower(), currency), + "fieldtype": "Float", + "width": 100, + } + ) + if ( + filters.get("foreign_currency") + and filters.get("foreign_currency") != currency + ): + columns.append( + { + "label": "{0} {1}".format(month, filters.get("foreign_currency")), + "fieldname": "{0} {1}".format( + month.lower(), filters.get("foreign_currency") + ), + "fieldtype": "Float", + "width": 100, + } + ) + + columns.append( + { + "label": "Advance After {0}".format(_foreign_currency), + "fieldname": "advance_after", + "fieldtype": "Float", + "width": 100, + } + ) + + return columns + + +def get_months(from_date, to_date): + months_list = [] + dates = [from_date, to_date] + start, end = [datetime.strptime(_, "%Y-%m-%d") for _ in dates] + months_obj = OrderedDict( + ((start + timedelta(_)).strftime(r"%b-%y"), None) + for _ in range((end - start).days) + ) + for key, value in months_obj.items(): + months_list.append(key) + return months_list + + +def check_full_month(from_date, to_date): + month_start_day = get_first_day(from_date) + month_end_day = get_last_day(from_date) + if from_date == month_start_day and to_date == month_end_day: + return True + else: + return False + + +def calculate_monthly_ammount( + ammount, + default_currency, + from_date, + to_date, + foreign_ammount, + foreign_currency=None, + filters=None, +): + float_precision = cint(frappe.db.get_default("float_precision")) or 2 + months_report_list = [] + for month in get_months(filters["from_date"], filters["to_date"]): + months_report_list.append("{0} {1}".format(month.lower(), default_currency)) + if ( + filters.get("foreign_currency") + and filters.get("foreign_currency") != default_currency + ): + months_report_list.append( + "{0} {1}".format(month.lower(), filters.get("foreign_currency")) + ) + if ammount and from_date and to_date: + monthly_ammount_obj = {} + days = 0 + date = from_date + end_date = to_date + field_list = [] + field_list_foreign = [] + first_last = 0 + first_last_foreign = 0 + sub_ammount = 0 + sub_ammount_foreign = 0 + # days_list= [] + + while date <= end_date: + start_month = getdate(date).month + end_month = getdate(to_date).month + + if start_month == end_month: + last_day = end_date + days_diff = date_diff(last_day, date) + 1 + if check_full_month(date, last_day): + days_diff = 30 + days += days_diff + # days_list.append(days_diff) + if date == last_day: + last_day = add_days(last_day, 1) + month_filed = (get_months(str(date), str(last_day))[0]).lower() + month_len = date_diff(get_last_day(date), get_first_day(date)) + field_list.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format(month_filed, default_currency), + "month_len": month_len, + "foreign": False, + } + ) + if foreign_currency and foreign_currency != default_currency: + field_list_foreign.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format( + month_filed, foreign_currency + ), + "month_len": month_len, + "foreign": True, + } + ) + date = get_first_day(add_months(date, 1)) + + else: + last_day = get_last_day(date) + days_diff = date_diff(last_day, date) + 1 + if check_full_month(date, last_day): + days_diff = 30 + days += days_diff + # days_list.append(days_diff) + if date == last_day: + last_day = add_days(last_day, 1) + month_filed = (get_months(str(date), str(last_day))[0]).lower() + month_len = date_diff(get_last_day(date), get_first_day(date)) + field_list.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format(month_filed, default_currency), + "month_len": month_len, + "foreign": False, + } + ) + if foreign_currency and foreign_currency != default_currency: + field_list_foreign.append( + { + "days_diff": days_diff, + "month_filed": "{0} {1}".format( + month_filed, foreign_currency + ), + "month_len": month_len, + "foreign": True, + } + ) + date = get_first_day(add_months(date, 1)) + + if floor(days / 30) != (days / 30) and (floor(days / 30) * 30 + 6) < days: + days = (floor(days / 30) + 1) * 30 + elif floor(days / 30) != (days / 30) and floor(days / 30) * 30 < days: + days = floor(days / 30) * 30 + + daily_ammount = 0 if days == 0 else ammount / (days) + daily_ammount_foreign = 0 if days == 0 else foreign_ammount / (days) + + m = 1 + for i in field_list: + if m == 1 and i["days_diff"] < 30: + first_last += i["days_diff"] + elif m == len(field_list) and i["days_diff"] < 30: + first_last += i["days_diff"] + else: + sub_ammount += i["days_diff"] * daily_ammount + m += 1 + + m = 1 + for i in field_list_foreign: + if m == 1 and i["days_diff"] < 30: + first_last_foreign += i["days_diff"] + elif m == len(field_list) and i["days_diff"] < 30: + first_last_foreign += i["days_diff"] + else: + sub_ammount_foreign += i["days_diff"] * daily_ammount_foreign + m += 1 + + n = 1 + for i in field_list_foreign: + if n == 1 and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] + * ((foreign_ammount - sub_ammount_foreign) / first_last), + float_precision, + ) + elif n == len(field_list) and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] + * ((foreign_ammount - sub_ammount_foreign) / first_last), + float_precision, + ) + else: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * daily_ammount_foreign, float_precision + ) + n += 1 + + n = 1 + for i in field_list: + if n == 1 and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * ((ammount - sub_ammount) / first_last), + float_precision, + ) + elif n == len(field_list) and i["days_diff"] < 30: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * ((ammount - sub_ammount) / first_last), + float_precision, + ) + else: + monthly_ammount_obj[i["month_filed"]] = flt( + i["days_diff"] * daily_ammount, float_precision + ) + n += 1 + advance_before = 0 + advance_after = 0 + first_month = datetime.strptime( + months_report_list[0][:6].replace("-", " 20"), "%b %Y" + ) + last_month = datetime.strptime( + months_report_list[-1][:6].replace("-", " 20"), "%b %Y" + ) + for key, value in monthly_ammount_obj.items(): + key_currency = key[7:] + currency = foreign_currency or default_currency + if key not in months_report_list and key_currency == currency: + mydate = datetime.strptime(str(key)[:6].replace("-", " 20"), "%b %Y") + if mydate > last_month: + advance_after += value + elif mydate < first_month: + advance_before += value + if advance_after: + monthly_ammount_obj["advance_after"] = advance_after + if advance_before: + monthly_ammount_obj["advance_before"] = advance_before + return monthly_ammount_obj diff --git a/propms/property_management_solution/report/security_attendance_report/__init__.py b/propms/property_management_solution/report/security_attendance_report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/security_attendance_report/security_attendance_report.html b/propms/property_management_solution/report/security_attendance_report/security_attendance_report.html new file mode 100644 index 0000000..e0a40e1 --- /dev/null +++ b/propms/property_management_solution/report/security_attendance_report/security_attendance_report.html @@ -0,0 +1,48 @@ + + +

    + {%= data[0][ __("Shift")] %} SHIFT SECURITY ATTENDANCE REPORT FOR {%= data[0][ __("Date")] %}
    +

    + + + + + + + + + + + + + + {% for(var i=0, l=data.length - 1; i + + + + + + + + {% endfor %} + + + + + + + + + + + + +
    {%= __("GUARD NAME") %}{%= __("POSITION") %}{%= __("PRESENT") %}{%= __("ABSENT") %}{%= __("DAY OFF") %}{%= __("REMARKS") %}
    {%= data[i][ __("Guard Name")] %}{%= data[i][ __("Position")] %}{%= data[i][ __("Present")] %} {%= data[i][ __("Absent")] %} {%= data[i][ __("Day off")] %} {%= data[i][ __("Remarks")] %}
    {%= __("TOTAL") %}{%= data[l][ __("Total")] %} {%= data[l][ __("Present")] %} {%= data[l][ __("Absent")] %} {%= data[l][ __("Day off")] %}  
    \ No newline at end of file diff --git a/propms/property_management_solution/report/security_attendance_report/security_attendance_report.json b/propms/property_management_solution/report/security_attendance_report/security_attendance_report.json new file mode 100644 index 0000000..a73d709 --- /dev/null +++ b/propms/property_management_solution/report/security_attendance_report/security_attendance_report.json @@ -0,0 +1,27 @@ +{ + "add_total_row": 1, + "creation": "2018-12-20 12:09:28.079276", + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2018-12-20 13:30:28.461805", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Security Attendance Report", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT sa.owner as `Created by`,\n sa.modified_by as `Approved by`,\n upper(sa.shift_name) as `Shift`,\n sa.shift_date as `Date:Date:`,\n sad.guard_name as `Guard Name`,\n sad.position as `Position`, \n if(sad.status = 'Present', 1, 0) as `Present:Int:`,\n if(sad.status = 'Absent ', 1, 0) as `Absent:Int:`,\n if(sad.status = 'Day off', 1, 0) as `Day off:Int:`,\n 1 as `Total:Int:`,\n sad.remarks as `Remarks`\nFROM `tabSecurity Attendance` as sa,\n `tabSecurity Attendance Details` sad\nWHERE sa.name = sad.parent ", + "ref_doctype": "Security Attendance", + "report_name": "Security Attendance Report", + "report_type": "Query Report", + "roles": [ + { + "role": "System Manager" + }, + { + "role": "Maintenance Job in-charge" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/security_deposit/__init__.py b/propms/property_management_solution/report/security_deposit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/security_deposit/security_deposit.js b/propms/property_management_solution/report/security_deposit/security_deposit.js new file mode 100644 index 0000000..91f1e11 --- /dev/null +++ b/propms/property_management_solution/report/security_deposit/security_deposit.js @@ -0,0 +1,25 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Security Deposit"] = { + "filters": [ + + { + "fieldname":"account", + "label": __("Account"), + "fieldtype": "Link", + "options": "Account", + "default": "21401 - Security Deposit Commercial - VPL", + "get_query": function() { + return { + "query": "erpnext.controllers.queries.get_account_list", + "filters": [ + ['Account', 'account_number', 'like', '214%'], + ['Account', 'is_group', '=', 0], + ] + } + } + }, + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/security_deposit/security_deposit.json b/propms/property_management_solution/report/security_deposit/security_deposit.json new file mode 100644 index 0000000..ef618ee --- /dev/null +++ b/propms/property_management_solution/report/security_deposit/security_deposit.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 1, + "creation": "2019-10-03 17:37:08.568327", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-11-02 14:05:27.521112", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Security Deposit", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT \tjea.cost_center AS \"Cost Center:Link/Property:150\",\n\tjea.party AS \"Party:Link/Property:150\", \n\tCONCAT(pr.bedroom, ' BHK') AS \"BHK::50\",\n\taccount_currency AS \"Currency::50\",\n\tFORMAT(SUM(debit_in_account_currency - credit_in_account_currency) * -1,2) \"Amount::100\"\nFROM `tabJournal Entry Account` jea\n\tLEFT JOIN `tabProperty` pr on jea.cost_center = pr.cost_center\nWHERE jea.account LIKE %(account)s \nAND jea.docstatus = '1'\nGROUP BY jea.cost_center, party", + "ref_doctype": "Journal Entry", + "report_name": "Security Deposit", + "report_type": "Query Report", + "roles": [ + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/__init__.py b/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.js b/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.js new file mode 100644 index 0000000..fbf6067 --- /dev/null +++ b/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.js @@ -0,0 +1,18 @@ +frappe.query_reports["Self Consumption in Maintenance Job Card"] = { + "filters": [ + { + "fieldname":"start_date", + "label": __("Start Date"), + "fieldtype": "Date", + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), + "reqd": 1 + }, + { + "fieldname":"end_date", + "label": __("End Date"), + "fieldtype": "Date", + "default": frappe.datetime.get_today(), + "reqd": 1 + }, + ] +} diff --git a/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.json b/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.json new file mode 100644 index 0000000..2b67861 --- /dev/null +++ b/propms/property_management_solution/report/self_consumption_in_maintenance_job_card/self_consumption_in_maintenance_job_card.json @@ -0,0 +1,34 @@ +{ + "add_total_row": 1, + "creation": "2020-04-18 22:55:14.193019", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2020-04-18 23:59:53.516924", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Self Consumption in Maintenance Job Card", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT jc.name as \"Maintenance Job Card:Link/Issue:200\",\n jc.property_name as \"Property:Link/Property:200\",\n jc.customer as \"Customer:Link/Customer:200\",\n jc.opening_date as \"Opening Date:Date:120\",\n jc.resolution_date as \"Resolution Date:Date:120\",\n jc.modified_by as \"Modified By:Link/User:200\",\n jc.status as \"Status:Data:120\",\n jcmb.item as \"Item:Link/Item:200\",\n jcmb.quantity as \"Quantity:Float:200\",\n jcmb.uom as \"UOM:Link/UOM:200\",\n jcmb.rate as \"Rate:Currency:120\",\n jcmb.amount as \"Amount:Currency:200\",\n \"\" as \"Sales Invoice:Link/Sales Invoice:200\"\n FROM `tabIssue` jc\n INNER JOIN `tabIssue Materials Detail` jcmb on jcmb.parent = jc.name\n WHERE jc.docstatus = 0\n AND DATE(jc.opening_date) BETWEEN %(start_date)s AND %(end_date)s\nUNION ALL\nSELECT jc.name as \"Maintenance Job Card:Link/Issue:200\",\n jc.property_name as \"Property:Link/Property:200\",\n jc.customer as \"Customer:Link/Customer:200\",\n jc.opening_date as \"Opening Date:Date:120\",\n jc.resolution_date as \"Resolution Date:Date:120\",\n jc.modified_by as \"Modified By:Link/User:200\",\n jc.status as \"Status:Data:120\",\n jcb.item as \"Item:Link/Item:200\",\n jcb.quantity as \"Quantity:Float:200\",\n jcb.uom as \"UOM:Link/UOM:200\",\n jcb.rate as \"Rate:Currency:120\",\n jcb.amount as \"Amount:Currency:200\",\n jcb.sales_invoice as \"Sales Invoice:Link/Sales Invoice:200\"\n FROM `tabIssue` jc\n INNER JOIN `tabIssue Materials Billed` jcb on jcb.parent = jc.name\n WHERE jc.docstatus = 1\n AND DATE(jc.opening_date) BETWEEN %(start_date)s AND %(end_date)s\nORDER BY \"Opening Date\", \"Maintenance Job Card\", \"Sales Invoice\", \"Item\"\n", + "ref_doctype": "Issue", + "report_name": "Self Consumption in Maintenance Job Card", + "report_type": "Query Report", + "roles": [ + { + "role": "Floor Maintenance Supervisor" + }, + { + "role": "Support Team" + }, + { + "role": "Maintenance Manager" + }, + { + "role": "Maintenance Job in-charge" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/stamp_duty_paid_by_tenant/__init__.py b/propms/property_management_solution/report/stamp_duty_paid_by_tenant/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/stamp_duty_paid_by_tenant/stamp_duty_paid_by_tenant.json b/propms/property_management_solution/report/stamp_duty_paid_by_tenant/stamp_duty_paid_by_tenant.json new file mode 100644 index 0000000..2009d3c --- /dev/null +++ b/propms/property_management_solution/report/stamp_duty_paid_by_tenant/stamp_duty_paid_by_tenant.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 0, + "creation": "2020-03-04 10:08:36.305324", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "json": "{\"order_by\": \"`tabLease`.`modified` desc\", \"filters\": [[\"Lease\", \"stamp_duty_paid_by_tenant\", \"=\", 0, false]], \"fields\": [[\"name\", \"Lease\"], [\"docstatus\", \"Lease\"], [\"property_owner\", \"Lease\"], [\"customer\", \"Lease\"], [\"start_date\", \"Lease\"], [\"end_date\", \"Lease\"]], \"add_totals_row\": 0, \"add_total_row\": 0, \"page_length\": 20}", + "modified": "2020-03-10 13:14:59.488330", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Stamp Duty Paid by Tenant", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Lease", + "report_name": "Stamp Duty Paid by Tenant", + "report_type": "Report Builder", + "roles": [ + { + "role": "System Manager" + }, + { + "role": "Property Manager" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/subscription_service_report/__init__.py b/propms/property_management_solution/report/subscription_service_report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/subscription_service_report/subscription_service_report.js b/propms/property_management_solution/report/subscription_service_report/subscription_service_report.js new file mode 100644 index 0000000..5437f70 --- /dev/null +++ b/propms/property_management_solution/report/subscription_service_report/subscription_service_report.js @@ -0,0 +1,30 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Subscription Service Report"] = { + "filters": [ + { + "fieldname":"service_type", + "label": __("Service Type"), + "fieldtype": "Link", + "options": "Item", + "default": "Gym services", + "reqd": 1 + get_query: () => { + return { + filters: { + 'item_group': "Services" + } + } + } + }, + { + "fieldname":"to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": frappe.datetime.get_today(), + "reqd": 1 + } + ] +} diff --git a/propms/property_management_solution/report/subscription_service_report/subscription_service_report.json b/propms/property_management_solution/report/subscription_service_report/subscription_service_report.json new file mode 100644 index 0000000..1872582 --- /dev/null +++ b/propms/property_management_solution/report/subscription_service_report/subscription_service_report.json @@ -0,0 +1,28 @@ +{ + "add_total_row": 0, + "creation": "2020-04-27 12:48:43.063123", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2020-04-27 13:53:51.035254", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Subscription Service Report", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT si.name, \r\n si.customer,\r\n\t from_date,\r\n\t to_date\r\nFROM `tabSales Invoice` si LEFT JOIN `tabSales Invoice Item` sii on si.name = sii.parent\r\nWHERE si.from_date IS NOT NULL \r\nAND si.to_date IS NOT NULL \r\nAND sii.item_group = 'Services'\r\nAND si.item_name = %(service_type)s;", + "ref_doctype": "Sales Invoice", + "report_name": "Subscription Service Report", + "report_type": "Query Report", + "roles": [ + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/utility_invoices/__init__.py b/propms/property_management_solution/report/utility_invoices/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/utility_invoices/other_methods.py b/propms/property_management_solution/report/utility_invoices/other_methods.py new file mode 100644 index 0000000..b3edd4f --- /dev/null +++ b/propms/property_management_solution/report/utility_invoices/other_methods.py @@ -0,0 +1,205 @@ +import frappe, calendar +from frappe import _ +from datetime import date, timedelta + + +def get_residential_columns(year): + columns = [ + { + "fieldname": "apartment_no", + "label": _("Apartment No."), + "fieldtype": "Data", + "width": 150, + }, + { + "fieldname": "client", + "label": _("Client"), + "fieldtype": "Data", + "width": 150, + }, + { + "fieldname": "advance_prev_year", + "label": _("Advance RECD in 2019"), + "fieldtype": "Data", + "width": 150, + }, + { + "fieldname": "invoice_no", + "label": _("Invoice No."), + "fieldtype": "Link", + "options": "Sales Invoice", + "width": 150, + }, + {"fieldname": "from", "label": _("From"), "fieldtype": "Data", "width": 150}, + {"fieldname": "to", "label": _("To"), "fieldtype": "Data", "width": 150}, + { + "fieldname": "invoice_amount", + "label": _("Invoice Amount"), + "fieldtype": "Data", + "width": 150, + }, + ] + months = months_array() + for i in months: + columns.append( + { + "fieldname": i.lower(), + "label": i + " " + str(year), + "fieldtype": "Data", + "width": 150, + } + ) + + return columns + + +def get_utility_sales_invoice(data, from_other=None, months=None): + total = {} + lease_item = "'Utility Charges' " + query = """ SELECT * FROM `tabSales Invoice` AS SI WHERE EXISTS (SELECT * FROM `tabSales Invoice Item` AS SIT WHERE SIT.item_code = {0} and SIT.parent = SI.name ) + and SI.docstatus=%s + ORDER by SI.customer,SI.from_date ASC""".format( + lease_item + ) % ( + 1 + ) + + sales_invoices = frappe.db.sql(query, as_dict=True) + previuos_customer = "" + for i in sales_invoices: + lease = frappe.get_value("Lease", i.lease, "property") + obj = { + "apartment_no": lease, + "client": i.customer, + "advance_prev_year": "", + "invoice_no": i.name, + "from": i.from_date if i.from_date else i.posting_date, + "to": i.to_date - timedelta(days=1) if i.to_date else i.posting_date, + "invoice_amount": i.total, + } + set_monthly_amount( + i.from_date, + i.to_date - timedelta(days=1) if i.to_date else "", + obj, + total, + months, + ) + if previuos_customer != i.customer: + data.append({}) + previuos_customer = i.customer + data.append(obj) + if from_other: + data.append(total) + + +def set_monthly_amount(start_date, end_date, obj, total, months): + rate = get_rate(obj["invoice_no"]) + if end_date and rate: + check_dates(start_date, end_date, rate, obj, total, months) + + +def check_dates(start_date, end_date, rate, obj, total, months): + start = start_date + no_minus = 0 + while start < end_date: + month_string = start.strftime("%b") + month_no_of_days = calendar.monthrange(start.year, start.month)[1] + last_date = date(start.year, start.month, month_no_of_days) + if (last_date - start).days >= 29 or ( + month_string == "Feb" and (last_date - start).days >= 27 + ): + if start.year == start_date.year: + obj[month_string.lower()] = round(rate, 2) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round(rate, 2) + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round(rate, 2) + ) + else: + if start.year == start_date.year: + obj[month_string.lower()] = round( + round(rate / month_no_of_days, 2) + * (month_no_of_days - int(start.day)), + 2, + ) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round( + round(rate / month_no_of_days, 2) + * (month_no_of_days - int(start.day)), + 2, + ) + + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round( + round(rate / month_no_of_days, 2) + * (month_no_of_days - int(start.day)), + 2, + ) + ) + no_minus = month_no_of_days + start += timedelta(days=month_no_of_days) + + start_last = start - timedelta(days=no_minus) + + if (end_date - start_last).days > 0: + if start_last.year == start_date.year: + month_string = end_date.strftime("%b") + month_no_of_days = calendar.monthrange(end_date.year, end_date.month)[1] + if int(end_date.day) >= 29 or ( + month_string == "Feb" and (end_date - start_last).days >= 27 + ): + obj[month_string.lower()] = round(rate, 2) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round(rate, 2) + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round(rate, 2) + ) + else: + obj[month_string.lower()] = round( + round(rate / month_no_of_days, 2) * (int(end_date.day)), 2 + ) + if months and month_string.lower() in months: + total[month_string.lower()] = ( + round( + round(rate / month_no_of_days, 2) * (int(end_date.day)), 2 + ) + + round(total[month_string.lower()], 2) + if month_string.lower() in total + else round( + round(rate / month_no_of_days, 2) * (int(end_date.day)), 2 + ) + ) + + +def months_array(): + return [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", + ] + + +def get_rate(invoice_name): + filters_value = "and item_code = 'Utility Charges'" + query = """ SELECT rate FROM `tabSales Invoice Item` WHERE {0} {1}""".format( + "parent = '" + invoice_name + "' ", filters_value + ) + print(query) + + return ( + frappe.db.sql(query, as_dict=True)[0].rate + if len(frappe.db.sql(query, as_dict=True)) > 0 + else "" + ) diff --git a/propms/property_management_solution/report/utility_invoices/utility_invoices.js b/propms/property_management_solution/report/utility_invoices/utility_invoices.js new file mode 100644 index 0000000..82b81f0 --- /dev/null +++ b/propms/property_management_solution/report/utility_invoices/utility_invoices.js @@ -0,0 +1,14 @@ +// Copyright (c) 2016, Aakvatech and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Utility Invoices"] = { + "filters": [ + { + "fieldname":"year", + "label": __("Year"), + "fieldtype": "Link", + "options": "Fiscal Year" + } + ] +}; diff --git a/propms/property_management_solution/report/utility_invoices/utility_invoices.json b/propms/property_management_solution/report/utility_invoices/utility_invoices.json new file mode 100644 index 0000000..724bdde --- /dev/null +++ b/propms/property_management_solution/report/utility_invoices/utility_invoices.json @@ -0,0 +1,33 @@ +{ + "add_total_row": 0, + "creation": "2019-12-18 10:54:45.950862", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-12-18 10:54:54.869935", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Utility Invoices", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Sales Invoice", + "report_name": "Utility Invoices", + "report_type": "Script Report", + "roles": [ + { + "role": "Stock Manager" + }, + { + "role": "Stock User" + }, + { + "role": "Purchase User" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/utility_invoices/utility_invoices.py b/propms/property_management_solution/report/utility_invoices/utility_invoices.py new file mode 100644 index 0000000..141dff0 --- /dev/null +++ b/propms/property_management_solution/report/utility_invoices/utility_invoices.py @@ -0,0 +1,15 @@ +# Copyright (c) 2013, Aakvatech and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from .other_methods import get_residential_columns +from .other_methods import get_utility_sales_invoice + + +def execute(filters=None): + columns, data = [], [] + if filters.get("year"): + columns = get_residential_columns(filters.get("year")) + get_utility_sales_invoice(data) + + return columns, data diff --git a/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/__init__.py b/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).js b/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).js new file mode 100644 index 0000000..550d84d --- /dev/null +++ b/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).js @@ -0,0 +1,20 @@ +// Copyright (c) 2016, Aakvatech +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Withholding Tax Summary on Sales (Properties)"] = { + "filters": [ + { + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), + }, + { + "fieldname": "to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": frappe.datetime.get_today(), + }, + ] +}; \ No newline at end of file diff --git a/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).json b/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).json new file mode 100644 index 0000000..8fd5905 --- /dev/null +++ b/propms/property_management_solution/report/withholding_tax_summary_on_sales_(properties)/withholding_tax_summary_on_sales_(properties).json @@ -0,0 +1,28 @@ +{ + "add_total_row": 1, + "creation": "2020-06-02 22:35:46.307332", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "modified": "2021-05-10 14:58:57.728167", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Withholding Tax Summary on Sales (Properties)", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT si.posting_date as \"Date:Date:\",\n si.customer_name as \"Customer:Link/Customer:\", \n sii.item_name as \"Perticulars:Data:\", \n si.name as \"Voucher No:Link/Sales Invoice:\", \n si.lease as \"Property:Link/Lease:\",\n concat_ws(' and ', sii.service_start_date, sii.service_end_date) as \"Period:Data:\", \n sii.base_net_amount as \"Amount:Currency:\", \n sii.base_net_amount * (sii.withholding_tax_rate/100) as \"Withholding Tax:Currency:\",\n si.tra_control_number as \"Contol Number:Data:\",\n si.witholding_tax_certificate_number as \"Contol Number:Data:\",\n if(si.tax_id,si.tax_id,c.tax_id) as \"TIN Number:Data:\"\nFROM `tabSales Invoice` si LEFT JOIN `tabSales Invoice Item` sii ON si.name = sii.parent \nINNER JOIN `tabCustomer` c ON si.customer = c.name\nWHERE si.docstatus = 1\nAND si.is_return = '0' \nAND sii.withholding_tax_rate > 0\nAND si.posting_date >= %(from_date)s \nAND si.posting_date <= %(to_date)s", + "ref_doctype": "Sales Invoice", + "report_name": "Withholding Tax Summary on Sales (Properties)", + "report_type": "Query Report", + "roles": [ + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/report/withholding_tax_summary_on_sales_for_properties/__init__.py b/propms/property_management_solution/report/withholding_tax_summary_on_sales_for_properties/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/property_management_solution/report/withholding_tax_summary_on_sales_for_properties/withholding_tax_summary_on_sales_for_properties.json b/propms/property_management_solution/report/withholding_tax_summary_on_sales_for_properties/withholding_tax_summary_on_sales_for_properties.json new file mode 100644 index 0000000..cbd780d --- /dev/null +++ b/propms/property_management_solution/report/withholding_tax_summary_on_sales_for_properties/withholding_tax_summary_on_sales_for_properties.json @@ -0,0 +1,29 @@ +{ + "add_total_row": 1, + "creation": "2021-05-10 15:01:39.793957", + "disable_prepared_report": 0, + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 0, + "is_standard": "Yes", + "javascript": "frappe.query_reports[\"Withholding Tax Summary on Sales for Properties\"] = {\r\n\t\"filters\": [\r\n {\r\n \"fieldname\": \"from_date\",\r\n \"label\": __(\"From Date\"),\r\n \"fieldtype\": \"Date\",\r\n \"default\": frappe.datetime.add_months(frappe.datetime.get_today(), -1),\r\n },\r\n {\r\n \"fieldname\": \"to_date\",\r\n \"label\": __(\"To Date\"),\r\n \"fieldtype\": \"Date\",\r\n \"default\": frappe.datetime.get_today(),\r\n },\r\n\t]\r\n};", + "modified": "2021-05-10 15:53:30.857930", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Withholding Tax Summary on Sales for Properties", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT si.posting_date as \"Date:Date:\",\n si.customer_name as \"Customer:Link/Customer:\", \n sii.item_name as \"Perticulars:Data:\", \n si.name as \"Voucher No:Link/Sales Invoice:\", \n si.lease as \"Property:Link/Lease:\",\n concat_ws(' and ', sii.service_start_date, sii.service_end_date) as \"Period:Data:\", \n sii.base_net_amount as \"Amount:Currency:\", \n sii.base_net_amount * (sii.withholding_tax_rate/100) as \"Withholding Tax:Currency:\",\n si.tra_control_number as \"Contol Number:Data:\",\n si.witholding_tax_certificate_number as \"Contol Number:Data:\",\n if(si.tax_id,si.tax_id,c.tax_id) as \"TIN Number:Data:\"\nFROM `tabSales Invoice` si LEFT JOIN `tabSales Invoice Item` sii ON si.name = sii.parent \nINNER JOIN `tabCustomer` c ON si.customer = c.name\nWHERE si.docstatus = 1\nAND si.is_return = '0' \nAND sii.withholding_tax_rate > 0\nAND si.posting_date >= %(from_date)s \nAND si.posting_date <= %(to_date)s", + "ref_doctype": "Sales Invoice", + "report_name": "Withholding Tax Summary on Sales for Properties", + "report_type": "Query Report", + "roles": [ + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/propms/property_management_solution/sales_invoice.js b/propms/property_management_solution/sales_invoice.js new file mode 100644 index 0000000..8ccb877 --- /dev/null +++ b/propms/property_management_solution/sales_invoice.js @@ -0,0 +1,40 @@ +frappe.ui.form.on('Sales Invoice', { + property_name: function(frm, cdt, cdn) { + frappe.model.set_value(cdt, cdn, "customer", ""); + if (frm.doc.cost_center) { + frappe.call({ + method: "frappe.client.get_value", + args: { + doctype: "Property", + fieldname: "status", + filters: { + name: frm.doc.cost_center + }, + }, + callback: function(r, rt) { + if (r.message) { + if (r.message.status == "On Lease") { + frappe.call({ + method: "frappe.client.get_value", + args: { + doctype: "Lease", + fieldname: "customer", + filters: { + property: frm.doc.cost_center + }, + }, + callback: function(r, rt) { + if (r.message) { + frappe.model.set_value(cdt, cdn, "customer", r.message.customer); + } + } + }); + } + } + } + }); + } else { + frappe.model.set_value(cdt, cdn, "customer", ""); + } + } +}) \ No newline at end of file diff --git a/propms/property_management_solution/workspace/property_ms/property_ms.json b/propms/property_management_solution/workspace/property_ms/property_ms.json new file mode 100644 index 0000000..5aab7d0 --- /dev/null +++ b/propms/property_management_solution/workspace/property_ms/property_ms.json @@ -0,0 +1,287 @@ +{ + "category": "Domains", + "charts": [], + "creation": "2021-08-03 15:46:41.730961", + "developer_mode_only": 0, + "disable_user_customization": 0, + "docstatus": 0, + "doctype": "Workspace", + "extends_another_page": 0, + "hide_custom": 0, + "idx": 0, + "is_default": 0, + "is_standard": 1, + "label": "Property MS", + "links": [ + { + "hidden": 0, + "is_query_report": 0, + "label": "Masters", + "link_type": "DocType", + "onboard": 0, + "type": "Card Break" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Properties", + "link_to": "Property", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Unit Type", + "link_to": "Unit Type", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Checkup Area", + "link_to": "Checklist Checkup Area", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Guard Shift", + "link_to": "Guard Shift", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Key Set", + "link_to": "Key Set", + "link_type": "DocType", + "onboard": 0, + "only_for": "", + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Tool Item Set", + "link_to": "Tool Item Set", + "link_type": "DocType", + "onboard": 0, + "only_for": "", + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Oursource Category", + "link_to": "Outsourcing Category", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Property Amenity", + "link_to": "Property Amenity", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Meter", + "link_to": "Meter", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Documents", + "link_type": "DocType", + "onboard": 0, + "only_for": "", + "type": "Card Break" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Lease", + "link_to": "Lease", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Keys Sets", + "link_to": "Key Set Detail", + "link_type": "DocType", + "onboard": 0, + "only_for": "", + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Tool Item Record", + "link_to": "Tool Item Record", + "link_type": "DocType", + "onboard": 0, + "only_for": "", + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Daily Checklist", + "link_to": "Daily Checklist", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Exit", + "link_to": "Exit", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Meter Reading", + "link_to": "Meter Reading", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Insurance", + "link_to": "Insurance", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Outsourcing Attendance", + "link_to": "Outsourcing Attendance", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Security Attendance", + "link_to": "Security Attendance", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Settings", + "link_type": "DocType", + "onboard": 0, + "type": "Card Break" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Property Management Settings", + "link_to": "Property Management Settings", + "link_type": "DocType", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Reports and Analytics", + "link_type": "DocType", + "onboard": 0, + "type": "Card Break" + }, + { + "hidden": 0, + "is_query_report": 1, + "label": "Outsourcing Attendance", + "link_to": "Outsourcing Attendance", + "link_type": "Report", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 1, + "label": "Security Attendance", + "link_to": "Security Attendance Report", + "link_type": "Report", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 1, + "label": "Security Deposit", + "link_to": "Security Deposit", + "link_type": "Report", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 1, + "label": "Debtors Report", + "link_to": "Debtors Report", + "link_type": "Report", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 1, + "label": "Creditors Report", + "link_to": "Creditors Report", + "link_type": "Report", + "onboard": 0, + "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 1, + "label": "Property Status", + "link_to": "Property Status", + "link_type": "Report", + "onboard": 0, + "type": "Link" + } + ], + "modified": "2022-05-16 16:58:39.426498", + "modified_by": "Administrator", + "module": "Property Management Solution", + "name": "Property MS", + "owner": "Administrator", + "pin_to_bottom": 0, + "pin_to_top": 0, + "shortcuts": [] +} \ No newline at end of file diff --git a/propms/propms-gitlab.sh b/propms/propms-gitlab.sh new file mode 100644 index 0000000..fcfe2b2 --- /dev/null +++ b/propms/propms-gitlab.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ $# -eq 0 ] + then + echo "Specify the comment for updating GitLab. e.g. $0 'This update is for'" + exit 1 +fi + + +vi apps/propms/propms/__init__.py +bench --site dev-propms.aakvatech.com export-fixtures +cd apps/propms +git add . +git commit -m "$1" +git push upstream master + diff --git a/propms/propms-pull.sh b/propms/propms-pull.sh new file mode 100644 index 0000000..3434401 --- /dev/null +++ b/propms/propms-pull.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +cd apps/propms/ +git pull +git status diff --git a/propms/templates/__init__.py b/propms/templates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/propms/templates/pages/__init__.py b/propms/templates/pages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..aa3b695 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +frappe +erpnext +csf_tz \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..917e323 --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from setuptools import setup, find_packages + +# from pip.req import parse_requirements +import re, ast + +# get version from __version__ variable in propms/__init__.py +_version_re = re.compile(r"__version__\s+=\s+(.*)") + +with open("propms/__init__.py", "rb") as f: + version = str( + ast.literal_eval(_version_re.search(f.read().decode("utf-8")).group(1)) + ) + +with open("requirements.txt") as f: + install_requires = f.read().strip().split("\n") + + +setup( + name="propms", + version=version, + description="Property Management Solution", + author="Aakvatech", + author_email="info@aakvatech.com", + packages=find_packages(), + zip_safe=False, + include_package_data=True, + install_requires=install_requires, +)