Compare commits

...

171 Commits

Author SHA1 Message Date
Rohit Waghchaure
6440e4f970 Merge branch 'version-13-pre-release' into version-13 2021-09-01 22:33:12 +05:30
Rohit Waghchaure
702eea3b54 bumped to version 13.10.0 2021-09-01 22:53:11 +05:50
rohitwaghchaure
e362e23941 Merge pull request #27303 from rohitwaghchaure/chnage-log-for-v13-10-0
chore: change log for v13.10.0
2021-09-01 22:27:45 +05:30
Rohit Waghchaure
68482b223f chore: change log for v13.10.0 2021-09-01 22:26:41 +05:30
Frappe PR Bot
c31bf155f0 fix: Healthcare Service Unit fixes (#27273) (#27274)
* fix: validate service unit setup against practitioner schedule

* fix: service unit properties getting overwritten

(cherry picked from commit ef76f62bc1)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-08-31 21:18:22 +05:30
Frappe PR Bot
d641dd68d4 fix: revert "refactor: simplify initialize_previous_data" (#27270) (#27271)
This reverts commit 2f5624e588.

(cherry picked from commit c1d986a0c6)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-31 19:46:13 +05:30
Frappe PR Bot
155df936cd Revert "fix: add child item groups into the filters (#26997)" (#27266) (#27268)
This reverts commit c60d5523bc.

(cherry picked from commit 763450dcf8)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-31 19:13:04 +05:30
Frappe PR Bot
0c4f29edcf fix(minor): Incorrect unallocated amount on type receive (#27262) (#27263)
(cherry picked from commit c37cec9b9d)

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-08-31 18:53:30 +05:30
Frappe PR Bot
f20913fb69 fix: Correct company address not getting copied from Purchase Order to Invoice (#27217) (#27234)
* fix: Correct company adderess not getting copied from Purchase Order to Invoice

* fix: Linting issues

(cherry picked from commit fd467e6d32)

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-08-31 11:08:58 +05:30
Frappe PR Bot
bafc9ddde4 fix: patches were breaking during migration (#27213) (#27241)
* fix: patches were breaking during migration (#27200)

* fix: patches were breaking during migrating

* fix: patches were breaking during migration

(cherry picked from commit 7433757489)

# Conflicts:
#	erpnext/patches.txt

* fix: resolve conflicts

Co-authored-by: Shadrak Gurupnor <30501401+shadrak98@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
(cherry picked from commit aa04051416)
2021-08-30 19:04:58 +05:30
Frappe PR Bot
d9b9888ad5 feat: (consistency) Add Primary Address and Contact section in Supplier (#27232) (#27233)
* feat: (consistency) Add Primary Address and Contact section in Supplier

- The same is present in customer and is inconsistent with supplier
- Helps quickly create primary address and contact via quick entry

* fix: Popup stale build and data consistency

- Include `supplier_quick_entry.js` in erpnext.bundle.js
- Create primary supplier address on update
- Set newly created address (quick entry)  in Supplier and Customer
- Clear address set in supplier and customer on delete (dependency)

* fix: Indentation and removed f-strings

- Sider: fixed indentation in js
- Dont use f-strings in queries

(cherry picked from commit 3d87d9f1d3)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-08-30 18:49:40 +05:30
Frappe PR Bot
03dcecff67 ci: use node action instead of apt (#27226) (#27237)
* ci: use node action instead of apt (#27220)

(cherry picked from commit e5e00700e5)

* ci: keep python version 3.6 for v13

* ci: use node v12

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
(cherry picked from commit dc948cab3e)
2021-08-30 18:07:05 +05:30
Saqib
f71ff830ef fix: remove non-existent method call in hooks (#27224) 2021-08-30 11:49:43 +05:30
Frappe PR Bot
d88346c6cd fix: patches were breaking while migrating (#27205)
* fix: patches were breaking while migrating (#27195)

* fix: patches were breaking while migrating

* fix: Removed duplicate function

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit 17e0fa7a8b)

# Conflicts:
#	erpnext/patches.txt

* fix: resolve conflicts

Co-authored-by: Shadrak Gurupnor <30501401+shadrak98@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-28 14:53:59 +05:30
Frappe PR Bot
0767d2dac2 fix: v13 migration fails due to missing reload_doc (#27192) (#27194)
closes #25948

(cherry picked from commit 1eb2526d0b)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-27 12:59:00 +05:30
Frappe PR Bot
64fab5b7d1 fix: operation time auto set to zero (#27190)
* fix: operation time auto set to zero (#27188)

(cherry picked from commit e6799d78ef)

# Conflicts:
#	erpnext/patches.txt

* fix: conflicts

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2021-08-27 11:02:44 +05:30
rohitwaghchaure
7c31e1f8bf chore: merge branch 'version-13-hotfix' into 'version-13-pre-release' (#27173)
* feat: add provision for process loss in manufac

* feat: add is process loss autoset and validation

* fix: add warehouse and unset is scrap for process loss items

* refactor: shift auto entry of is process loss check, update validations

* test: add bom tests for process loss val, add se test for qty calc

* fix: add more validations, remove source wh req for pl item

* fix: sider

* refactor: polyfill ??

* fix: sider

* refactor: validation error message formatting

* test: check manufacture completion qty in se and wo

* fix: wo tests, sider, account for pl in se validation

* fix: reword error messages, fix test values

* feat: add procss_loss_qty field in work order

* feat: process loss report, fix set pl query condition

* fix: correct value in test

* fix: get filters to work
- reorder and rename columns
- add work order filter

* fix: Shopping cart Exchange rate validation (#27050)

* fix: Shopping cart Exchange rate validation

- Use `get_exchange_rate` to check for price list exchange rate in cart settings
- Move cart exchange rate validation for Price List from hooks to doc event
- Call cart exchange rate validation on PL update only if PL is in cart and currency is changed

* chore: Comment out obsolete test

- Modifying this test means considering extreme edge cases, which seems pointless now

* fix: Remove snippet that got in due to cherry-pick from `develop`

- This snippet is not present in v13-hotfix. Via https://github.com/frappe/erpnext/pull/26520

Co-authored-by: Nabin Hait <nabinhait@gmail.com>

* feat: initialize party link for customer & suppliers

* feat: toggle to enable common party accounting

* feat: auto create advance entry on invoice submission

* test: creation of advance entry on invoice submission

* fix: remove unwanted filter query

* feat: validate multiple links

* fix: party link permissions

* perf: reduce number of queries to get party link

* fix: cost center & naming series

* fix: cost center in test_sales_invoice_against_supplier

* fix: Don't create inward SLE against SI unless is internal customer enabled (#27086)

* fix: Dont create inward SLE against SI unless is internal customer enabled

- Check if is internal customer enabled apart from target warehouse
- Test to check if inward SLE is made if target warehouse is accidentally set but customer is not internal

* test: Use internal customer for delivery of bundle items to target warehouse

- created `create_internal_customer` util
- reused it in delivery note and sales invoice tests
- use internal customer for target warehouse test in delivery note

(cherry picked from commit f4dc9ee2aa)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py

* fix: prevent over riding scrap table values, name kwargs, set currency

* fix(regional): minor fixes and test for South Africa VAT report (#26933) (#27162)

* fix: allow to change incoming rate manually in case of stand-alone credit note (#27164)

* fix: allow to change rate manually in case of stand-alone credit note (#27036)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit fe4540d74d)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json

* fix: resolve conflicts

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>

* fix: Fee Validity fixes (#27161)

* fix: Fee Validity fixes (#27156)

* chore: update Fee Validity form labels

* fix: first appointment should not be considered for Fee Validity

* fix: Fee Validity test cases

* fix: appointment test case

(cherry picked from commit 642b4c805c)

* fix: overlapping appointments

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>

* fix: Merge conflicts and place internal customer creation util in test_customer.py

* fix: internal customer util returns 'str' not doc object

* fix: negative qty validation on stock reco cancellation (#27170) (#27171)

* test: negative stock validation on SR cancel

* fix: negative stock setting ignored in stock reco

In stock reconcilation cancellation negative stock setting is ignored as
`db.get_value` is returning string `'0'` which is not casted to int/bool
for further logic. This causes negative qty, which evantually gets
caught by reposting but by design this should stop cancellation.

* test: typo and minor refactor

(cherry picked from commit e7109c18db)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>

Co-authored-by: 18alantom <2.alan.tom@gmail.com>
Co-authored-by: Marica <maricadsouza221197@gmail.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
Co-authored-by: Frappe PR Bot <frappe.pr.bot@gmail.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-08-26 19:49:27 +05:30
rohitwaghchaure
409cc95b7b Merge pull request #27158 from rohitwaghchaure/merge-branch-hotfix-to-pre-release-for-13-10
chore: merge version-13-hotfix into version-13-pre-release for release v13.10.0
2021-08-26 17:39:58 +05:30
Rohit Waghchaure
327be1cd9d chore: merge version-13-hotfix into version-13-pre-release for release v13.10.0 2021-08-26 11:45:55 +05:30
Frappe PR Bot
6609321399 fix: removing toggle_display for address and contact HTML (#27152) (#27155)
(cherry picked from commit c8f22e5524)

Co-authored-by: Anupam Kumar <anupamvns0099@gmail.com>
2021-08-26 11:02:01 +05:30
Frappe PR Bot
7f27586cbe fix(healthcare): Removed ignore user permissions flag in appointment (#27146)
* fix(healthcare): Removed ignore user permissions flag in appointment (#27129)

(cherry picked from commit 81b28b8998)

# Conflicts:
#	erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py

* chore: Fix merge conflicts

Co-authored-by: Chillar Anand <anand21nanda@gmail.com>
2021-08-25 22:26:09 +05:30
Frappe PR Bot
4837d8872e fix: unable to create manual / auto asset depreciation entry when cost_center is mandatory (#26912) (#27149)
Summary : unable to create manual / auto asset depreciation entry when cost_center is mandatory

Reason: Though we are calculating value for depreciation_cost_center, it is not passed in credit_entry(it is passed in debit_entry) and this prevents creation of manual / auto asset depreciation entry when cost_center is mandatory

Solution : pass already calculated depreciation_cost_center value in credit_entry (in line with, already done as in debit_entry)
(cherry picked from commit b99c011947)

Co-authored-by: Ashish Shah <mr.ashish.shah@gmail.com>
2021-08-25 22:25:29 +05:30
Nabin Hait
014df08e7b Merge branch 'alyf-de-datev_more_info' into version-13-hotfix 2021-08-25 21:23:45 +05:30
Nabin Hait
09fb90b8ac fix: merge conflict 2021-08-25 21:23:24 +05:30
Dany Robert
7b9a23eb7a feat: Increase number of supported currency exchanges (#26763)
* fix: update test suite to accodomate new currency exchange function

* feat: Increase number of supported currency exchanges

* fix: don't make api call when testing

* remove condition for test(being fixed in another pull request)
2021-08-25 21:15:44 +05:30
Frappe PR Bot
0fe6995816 fix: sequence of sub-operations in job card (#27138) (#27147)
(cherry picked from commit ad45ddcabe)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
2021-08-25 20:11:23 +05:30
Frappe PR Bot
f8ec0b6a86 feat: provision to create customer from opportunity (#27145)
* feat: provision to create customer from opportunity (#27141)

* feat: provision to create customer from opportunity

* fead: linking of address and contact

* revert: create_opportunity_address_contact

* enabming print hide and no copy

(cherry picked from commit 4d98be2126)

# Conflicts:
#	erpnext/crm/doctype/opportunity/opportunity.js

* Update opportunity.js

* fix: conflicts

Co-authored-by: Anupam Kumar <anupamvns0099@gmail.com>
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-08-25 20:05:54 +05:30
Frappe PR Bot
4c3034ad79 fix: remove VARCHARs from Sales Invoice (#27136) (#27139)
Sales Invoice doctype is starting to hit row length limit as many
integrations add custom fields on this doctype. This is just a small
change to remove VARCHAR(140) fields and reduce row size wherever
possible.

(cherry picked from commit 8d116fb9ff)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-25 17:47:51 +05:30
Alan
1be810479c refactor: update stock module onboarding (#25745)
* refactor: update stock onboarding

* refactor: add form tour for stock module onboarding

* refactor: move trailing whitespace out of translate func

* refactor: sider/semgrep

* refactor: remove DN, PR; change wording, add/remove steps in tour

* refactor: add watch video step for stock opening balance

* refactor: reorder steps according to stock settings refactor

* refactor: fix typo, remove target warehouse cause SE Type dependency

* fix: semgrep, remove trailing and leading whitespaces

* refactor: reduce steps, reword cards

* fix: minor changes

- remove Is Group from warehouse
- change stock entry type
- link to stock entry type
- add posting date to stock reco
- change report to Stock Projected Qty
- highlight quality inspection action
- remove allow neg highlight

* refactor: use Form Tour doc instead of controller form tour

note - keeping controller form tours as a fallback, new form tours
seem to work only for Stock Settings

* fix: rename form tours to doctype names, remove tours from js controllers

* fix: re-order tour to circumvent glitchy save highlight
2021-08-25 17:45:55 +05:30
Frappe PR Bot
d97a87e28d fix(healthcare): Made payment fields mandatory for new appointments (#27135)
* fix(healthcare): Made payment fields mandatory for new appointments (#26608)

* fix(healthcare): Made payment fields mandatory for new appointments

* fix: sider issues

* fix: Fix failing test

* fix: Patient appointment invoicing

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
(cherry picked from commit a65498dc61)

# Conflicts:
#	erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
#	erpnext/healthcare/doctype/patient_appointment/test_patient_appointment.py

* chore: Fix merge conflicts

* chore: Fix failing tests

Co-authored-by: Chillar Anand <anand21nanda@gmail.com>
2021-08-25 17:12:04 +05:30
Frappe PR Bot
7ac4916191 feat: unreconcile on cancellation of bank transaction (#27109) (#27137) 2021-08-25 16:59:03 +05:30
Deepesh Garg
4eb7c2a011 fix: TDS calculation on net total (#27058) 2021-08-25 16:54:45 +05:30
Frappe PR Bot
fcb17f047d fix: validate party and party type only if both available (#27002) (#27133)
* fix: validate party and party type only if both available

* fix: indentation

(cherry picked from commit 8366b6322e)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-25 12:49:04 +05:30
Marica
688fe4192c Merge pull request #27118 from 18alantom/fix-scrap-items-updation-bp
fix: update scrap table item details; typo (backport #27052)
2021-08-25 12:36:14 +05:30
rohitwaghchaure
2b875bbf52 Merge pull request #27127 from rohitwaghchaure/v13-fixed-stock-ledger-report-with-included-uom
fix: stock ledger report not working if include uom selected in filter
2021-08-25 01:24:53 +05:30
Rohit Waghchaure
1810b73113 fix: stock ledger report not working if include uom selected in filter 2021-08-25 01:24:02 +05:30
rohitwaghchaure
2ea108ae92 Merge pull request #27126 from rohitwaghchaure/fixed-donot-overrride-batch-no-v13
fix: selected batch no changed on updation of qty
2021-08-25 01:23:10 +05:30
Rohit Waghchaure
2f71b740fd fix: selected batch no changed on updation of qty 2021-08-25 01:22:04 +05:30
Frappe PR Bot
5b411dc1f6 fix: Updated timestamp for pos invoice json (#27110) (#27123)
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
(cherry picked from commit fbc5977248)

Co-authored-by: Subin Tom <36098155+nemesis189@users.noreply.github.com>
2021-08-24 23:18:35 +05:30
Frappe PR Bot
f13ae4de0b fix: broken URL in supplier portal (#26823) (#27122)
* fix: broken URL

The quotations are supplier quotations, not sales quotation.

* fix: remove erpnext from path

(cherry picked from commit c7bad657b1)

Co-authored-by: Dany Robert <rtdany10@gmail.com>
2021-08-24 22:28:29 +05:30
Frappe PR Bot
b3ffa0eb57 fix(minor): Update GSTR-1 json version (#27074) (#27121)
(cherry picked from commit c30fb04e96)

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-08-24 22:28:07 +05:30
Anuja Pawar
8220117500 feat(regional): South Africa VAT Audit Report (#27017)
* feat: SA VAT Report

* fix: added party column and fixed permissions

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2021-08-24 22:02:05 +05:30
Deepesh Garg
74073ddc85 fix: Ignore due date validations if payment terms are copied from orders/receipts (#27120) 2021-08-24 21:56:49 +05:30
Frappe PR Bot
8474961b79 perf: reduce number of queries to validate selling price (#26225) (#27119)
* perf: reduce number of queries to validate selling price

* fix: improved flow and formatting

* fix: improve condition and use of `as_dict`

Co-authored-by: Sagar Vora <sagar@resilient.tech>
(cherry picked from commit 7c957d72b3)

Co-authored-by: Pruthvi Patel <pruthvipatel145@gmail.com>
2021-08-24 21:51:53 +05:30
Nabin Hait
487952a04e Merge branch 'version-13-hotfix' into fix-scrap-items-updation-bp 2021-08-24 21:08:14 +05:30
Frappe PR Bot
c7508a034a feat: allow draft pos invoices even if no stock available (#27078) (#27106)
(cherry picked from commit f47cbae5e0)

Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-24 20:51:30 +05:30
18alantom
38898d33c6 fix: update scrap table item details; typo 2021-08-24 20:39:51 +05:30
Frappe PR Bot
0bf9d1b29f fix: pos invoice test (#27116) 2021-08-24 19:48:05 +05:30
Frappe PR Bot
a7cdba24bc feat: coupon code discount in pos invoice (#27103) 2021-08-24 19:47:40 +05:30
Saqib
f84740e6e4 fix: incorrect gl entry on period closing involving finance books (#27104) 2021-08-24 19:46:35 +05:30
Mohammad Hussain Nagaria
24b2a31581 feat: Employee reminders (#25735)
* feat: Add reminders section to HR Settings

* refactor: Extract generic function for getting Employees

* feat: Employee Work Anniversary Reminder

* feat: Daily Holiday Reminder

* fix: Unnecessary params and replace [] with .get()

* test: Daily Holiday Reminders

* test: is_holiday basic tests

* refactor: Move employee reminders code to separate module

* feat: Add advance reminder to HR settings

* feat: Advance Holiday Reminders

* refactor: get_holidays_for_employee

* feat: Email holiday reminders in advance + tests

* fix: Remove unused import

* refactor: HR Setting Reminder Section

* refactor: Remove Daily Holiday Reminders feat

* feat: Reminder miss warning

* fix: Failing test and function name change

* chore: Add patch for field rename

* chore: Rename frequency label

* fix: Failing patch test

* fix: sider and removed description of fields

* fix: email alignment

Co-authored-by: pateljannat <pateljannat2308@gmail.com>
Co-authored-by: Jannat Patel <31363128+pateljannat@users.noreply.github.com>
2021-08-24 19:43:43 +05:30
Anupam Kumar
f7e0edecc9 refactor: social media post fixes (#24664)
* fix: social media post fixes

* feat: post metrics and some fixes

* fix: sider issues

* fix: sider issue

* fix: reverting optional chaning statements

* fix: sider issues

* fix: review chnages

* fix: text trigger check

* fix: sider issue
2021-08-24 19:15:56 +05:30
Frappe PR Bot
d55d200b47 fix: calculation of gross profit percentage in Gross Profit Report (#27108) 2021-08-24 18:58:56 +05:30
Frappe PR Bot
c8092b7e7a fix: correct price list rate value in return si (#27105) 2021-08-24 18:41:16 +05:30
Syed Mujeer Hashmi
1604b6cc63 fix: Allow backdated discharge for inpatient (#25124)
* fix: Allow backdated discharge for inpatient

The system is not flexible enough to allow backdated patient discharge.

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>

* fix: Sider issues and test cases related to this patch

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
Co-authored-by: Jannat Patel <31363128+pateljannat@users.noreply.github.com>
2021-08-24 18:35:59 +05:30
Rucha Mahabal
27fad29ad6 refactor: Healthcare Redesign Changes (#27100)
* chore: reorder workspace cards

* fix: Patient Progress Page UI

* feat: redesign Patient History

* fix: redesign patient history card

* fix: filter style

* fix: sider

* fix: patient history and patient progress links

* fix: change percentage/donut charts to bar charts

-percentage charts broken in redesign

* fix(style): patient progress heatmap

* chore: semgrep and translation fixes

* fix: patient progress page card views

* fix: tests
2021-08-24 17:54:28 +05:30
Deepesh Garg
0476accf26 fix: Payment Reconciliation link in Accounting Workspace (#27085) 2021-08-24 16:27:10 +05:30
Sagar Vora
925a4a28e2 Merge pull request #27092 from frappe-pr-bot/backport/version-13-hotfix/27008
refactor: use `read_only_depends_on` instead of code
2021-08-24 13:33:19 +05:30
Afshan
ac0800511d fix: resolved conflicts 2021-08-24 12:59:07 +05:30
Afshan
d360819384 Merge branch 'version-13-hotfix' into backport/version-13-hotfix/27008 2021-08-24 12:53:13 +05:30
Marica
ff6cda8547 Merge pull request #27096 from frappe-pr-bot/backport/version-13-hotfix/27043
fix(ux): keep stock entry title & purpose in sync
2021-08-24 12:46:31 +05:30
rohitwaghchaure
60c06d3194 Merge pull request #26455 from noahjacob/supplier_defaults_v13hf
feat: fetching details from supplier/customer groups
2021-08-24 12:31:01 +05:30
rohitwaghchaure
5320f3e5ea Merge branch 'version-13-hotfix' into supplier_defaults_v13hf 2021-08-24 12:28:16 +05:30
Ankush Menat
cc7ed1573a fix(ux): keep stock entry title & purpose in sync (#27043)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit c09d8a2809)
2021-08-24 06:55:25 +00:00
Marica
b932b3f252 Merge pull request #27093 from frappe-pr-bot/backport/version-13-hotfix/27014
fix: stock analytics report date range issues and add company filter
2021-08-24 12:21:43 +05:30
Frappe PR Bot
1e3a6a8a98 fix: discard empty rows from update items (#27021) (#27095)
(cherry picked from commit 6de7b8ea93)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-24 12:20:51 +05:30
Ankush Menat
0a23328151 fix: stock analytics report date range issues and add company filter (#27014)
* test: tests for correct get_period_date_ranges

* fix: stock analytics report date range issues

- Upon selecting second half of month with Monthly filter, data from
  that period was missing.
- Solution: "round down" the date as per expected frequency.

* chore: drop py2 and fix misleading docstring

* test: fix test to avoid FY clash

* feat: add company filter in stock analytics report

[skip ci]

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 0dff0beaba)
2021-08-24 06:47:49 +00:00
Pruthvi Patel
f08d7410be refactor: use read_only_depends_on instead of code (#27008)
(cherry picked from commit 332ac105b5)

# Conflicts:
#	erpnext/accounts/doctype/pos_invoice/pos_invoice.js
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.js
2021-08-24 06:38:39 +00:00
Nabin Hait
352157c9fc Merge pull request #27005 from frappe/addl_salary_fix-v13
fix: Additional salary processing
2021-08-24 10:35:51 +05:30
Deepesh Garg
85f582b145 Merge pull request #26725 from deepeshgarg007/payment_entry_validations_and_trigger
fix: Multiple fixes in payment entry
2021-08-23 18:03:11 +05:30
Frappe PR Bot
3d047b83fd fix: Eway bill test update to check ver 1.0.0421 (#27083) (#27084) 2021-08-23 15:43:30 +05:30
Frappe PR Bot
6814509f07 fix: eway bill version changed to 1.0.0421 (#27077) 2021-08-23 15:43:06 +05:30
Saqib
dbca11071e refactor: scan barcode field scanning (#26990) (#27076) 2021-08-23 11:23:46 +05:30
Deepesh Garg
dd688db54c Merge pull request #27072 from frappe-pr-bot/backport/version-13-hotfix/27069
feat: Column for total amount due in Accounts Receivable/Payable Summary
2021-08-22 23:15:58 +05:30
Deepesh Garg
be57dee57a Merge pull request #27068 from frappe-pr-bot/backport/version-13-hotfix/26975
fix: Consolidated balance sheet showing incorrect values
2021-08-22 18:14:15 +05:30
Deepesh Garg
67dbb2bd7f feat: Column for total amount due in Accounts Receivable/Payable Summary (#27069)
(cherry picked from commit 496bff5136)
2021-08-22 12:41:50 +00:00
Deepesh Garg
571178ffbe fix: Revert commit 46372fe 2021-08-22 18:02:51 +05:30
Deepesh Garg
9542da80c5 test: Update test cases 2021-08-21 19:36:38 +05:30
Deepesh Garg
593ab98575 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into payment_entry_validations_and_trigger 2021-08-21 19:19:10 +05:30
Deepesh Garg
43813875ea fix: Consolidated balance sheet showing incorrect values (#26975)
(cherry picked from commit 57e326e7d0)
2021-08-21 12:30:23 +00:00
Ankush Menat
d0e393a4cc fix: Incorrect mandatory error message for warehouse (#27060)
Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
2021-08-20 18:33:28 +05:30
Ankush Menat
05c7905fa3 fix(ux): removed rate from grid view (#27061)
Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
2021-08-20 18:33:08 +05:30
Frappe PR Bot
3f05d928a3 refactor: rectify typo (#27057) (#27059)
[skip ci]

(cherry picked from commit 62c590261c)

Co-authored-by: Alan <2.alan.tom@gmail.com>
2021-08-20 18:24:49 +05:30
Frappe PR Bot
2fd823ffb6 fix: Cascade deletion for Company (#26923) (#27053)
* fix: Cascade deletion for Company

(cherry picked from commit 2b2572b9b9)

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
2021-08-20 15:20:50 +05:30
Frappe PR Bot
52570cc1f9 refactor: renamed varint_item_code to variant_item_code (#27025) (#27046)
(cherry picked from commit f13315809e)

Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
2021-08-19 20:55:45 +05:30
Frappe PR Bot
5c6f6c16d6 fix: pass planned start date to created work order (#27031) (#27042)
* fix: pass planned start date to created workorder

* test: production plan to work order start date

Co-authored-by: Alan <2.alan.tom@gmail.com>
Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
(cherry picked from commit 9225f02599)
2021-08-19 18:56:26 +05:30
Anoop
ee9b6d158a feat(Healthcare): Capacity for Service Unit, concurrent appointments based on Capacity, Patient enhancements (#24860)
* fix: (tests) get_healthcare_docs and get_medical_department separated, related changes

* feat: Service Unit option to allow overlap, overlap capacity
Appointment to allow overlapping appointments

Co-authored-by: Akash Krishna <akash@earthianslive.com>

* feat: Create multiple service units from tree view

Co-authored-by: Akash Krishna <akash@earthianslive.com>

* feat: patient address and contact
patient dashboard links, customer stats

* fix: sider review

* fix: untranslated message

* fix: enable non-negative check for service unit capacity

- incorrect depends on statement in dialog

* refactor(UX): Available Slots Dialog

* chore: remove unused field from Healthcare Service Unit Type

Co-authored-by: Akash Krishna <akash@earthianslive.com>
Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-08-19 18:15:51 +05:30
Frappe PR Bot
c192e9457e fix: add child item groups into the filters (#26997) (#27035)
* fix: add child item groups into the filters

* fix: appending values to proper variable

* fix: refactor the loop

(cherry picked from commit c60d5523bc)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-19 16:44:56 +05:30
Frappe PR Bot
74af3be968 fix: set production plan to completed even on over production (#27027) (#27032)
(cherry picked from commit 09f34e558e)

Co-authored-by: Alan <2.alan.tom@gmail.com>

[skip ci]
2021-08-19 10:50:06 +00:00
Subin Tom
02a23bae58 Fix: Payment Entry party validation issue (#27022)
Co-authored-by: Subin Tom <subin-home@Subins-MacBook-Air.local>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-19 15:49:16 +05:30
Frappe PR Bot
df32fe3d49 Merge pull request #27026 from ankush/eq_assign (#27030)
fix: equality check instead of assignment

[skip ci]

(cherry picked from commit 993b0532f8)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-19 15:45:39 +05:30
Ankush Menat
92b3743c54 Merge pull request #27024 from ankush/whitespace_fix
chore: whitespace cleanup from codebase
2021-08-19 14:57:57 +05:30
Ankush Menat
b42c23cad6 chore: ignore whitespace changes in git blame 2021-08-19 14:36:17 +05:30
Rohit Waghchaure
23c713cc9b Merge branch 'version-13-pre-release' into version-13 2021-08-19 14:35:52 +05:30
Rohit Waghchaure
f0d3a074e0 bumped to version 13.9.2 2021-08-19 14:55:52 +05:50
Ankush Menat
9bb69e711a chore: whitespace cleanup from codebase 2021-08-19 14:33:03 +05:30
Frappe PR Bot
e536f6d13f fix: assigning values to rows in sales register reports (#26546) (#27020)
* fix: assigning values to rows in sales register reports

* fix: check for is_internal_customer for unrealized_profit_loss_account

(cherry picked from commit ecd6584c50)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-19 13:30:50 +05:30
Frappe PR Bot
f37747da25 fix: Add ignore user perms to set_target_warehouse field in sales invoice (#27013)
* fix:  Add ignore user perms to set_target_warehouse field in sales invoice (#26987)

* reverting ot v12.7.1

* fix: Ignore user permissions for set_target_warehouse in SI

Co-authored-by: Subin Tom <subin-home@Subins-MacBook-Air.local>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
(cherry picked from commit ef792971f3)

# Conflicts:
#	erpnext/accounts/doctype/sales_invoice/sales_invoice.json

* fix: conflicts

* fix: conflicts

Co-authored-by: Subin Tom <36098155+nemesis189@users.noreply.github.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-19 12:16:15 +05:30
rohitwaghchaure
cada9b679a Merge pull request #27019 from anupamvs/email-digest-fix-pre
fix: email digest recipient patch
2021-08-19 11:49:49 +05:30
Frappe PR Bot
25b705e2ad fix: sales pipeline graph issue (#26626) (#27018)
(cherry picked from commit 34353df48c)

Co-authored-by: Anupam Kumar <anupamvns0099@gmail.com>
2021-08-19 11:46:55 +05:30
Anupam Kumar
ecbb59a1ce Merge branch 'version-13-pre-release' into email-digest-fix-pre 2021-08-19 11:14:38 +05:30
Anupam
9f79415186 fix: email digest recipient patch 2021-08-19 11:12:32 +05:30
rohitwaghchaure
87326dd489 Merge pull request #27007 from anupamvs/email-digest-fix
fix: [patch]Email digest fix
2021-08-19 11:09:21 +05:30
Frappe PR Bot
8ea5782c69 fix: filtering of items in Sales and Purchase Orders (#26936) (#27012)
* fix: filtering of items in Sales and Purchase Orders

* fix: slider

* fix: slider

(cherry picked from commit dc7280eef0)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-18 20:44:45 +05:30
Frappe PR Bot
6a35d580e4 fix: Dimension filter query fix to avoid including disabled dimensions (#26988) (#27006)
* reverting ot v12.7.1

* fix: Dimension filter query fix to not display disabled dimensions

Co-authored-by: Subin Tom <subin-home@Subins-MacBook-Air.local>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
(cherry picked from commit 333e44eb47)

Co-authored-by: Subin Tom <36098155+nemesis189@users.noreply.github.com>
Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-18 18:46:25 +05:30
Frappe PR Bot
77ad668a6f fix: date_unchanged calculation in "Update Items" (#26992) (#27010)
Branch corrected https://github.com/frappe/erpnext/pull/26058

  ERPNext generates "Cannot set quantity less than delivered quantity" error even the delivered qty is zero when user clicks "Update Items".
  "date_unchanged" variable gets false value because of new_date is string.

  "getdate(new_date)" corrects the date comparison.

  ![ERPNext_PR](https://user-images.githubusercontent.com/710051/121928377-c0263180-cd48-11eb-8cd9-eda7dace09d6.gif)

(cherry picked from commit d8a7abcd02)

Co-authored-by: Türker Tunalı <turkert@hotmail.com>
2021-08-18 12:32:59 +00:00
Nabin Hait
5e1ed2d7eb fix: Message (Received Amount should be same as Paid Amount) 2021-08-18 16:46:32 +05:30
Anupam
36f18935d3 fix: email digest recipient patch 2021-08-18 16:30:45 +05:30
Anupam
01a538123b Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into version-13-hotfix 2021-08-18 16:15:38 +05:30
Nabin Hait
44919ac807 fix: Additional salary processing 2021-08-18 16:14:48 +05:30
Frappe PR Bot
e555e8cf05 fix: Return Qty in PR/DN for legacy data (#27001) (#27003)
(cherry picked from commit 112fc888f1)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-08-18 10:30:51 +00:00
Deepesh Garg
0f15ded0cd Merge branch 'payment_entry_validations_and_trigger' of https://github.com/deepeshgarg007/erpnext into payment_entry_validations_and_trigger 2021-08-18 15:58:46 +05:30
Deepesh Garg
46372fe5cd fix: Decide party account debit or credit on payment entry type instead of party type 2021-08-18 15:57:55 +05:30
Deepesh Garg
6950844a74 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into payment_entry_validations_and_trigger 2021-08-18 15:29:48 +05:30
Rohit Waghchaure
8cd3ffc84d Merge branch 'version-13-pre-release' into version-13 2021-08-18 13:00:35 +05:30
Rohit Waghchaure
9c1d739946 bumped to version 13.9.1 2021-08-18 13:20:35 +05:50
Frappe PR Bot
5e17b82779 fix: set account for change amount even if pos profile not found (#26986) (#26989)
(cherry picked from commit 5fec44446e)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-17 20:34:35 +05:30
Deepesh Garg
9c401e75bb Merge pull request #26980 from deepeshgarg007/payment_entry_unallocated_fix_v13
fix: Incorrect unallocated amount calculation in payment entry
2021-08-17 19:14:07 +05:30
Deepesh Garg
c8449702b4 Merge pull request #26981 from deepeshgarg007/payment_entry_unallocated_fix_v13_pre
fix: Incorrect unallocated amount calculation in payment entry
2021-08-17 19:13:27 +05:30
Frappe PR Bot
90818d57f1 fix: change print_format_type from Server to Jinja (#26374) (#26985)
(cherry picked from commit a2966db1e5)

Co-authored-by: Mohammed Redah <mhbu50@gmail.com>
2021-08-17 13:36:08 +00:00
Deepesh Garg
0a5dff1e1f test: Add test case for payment entry 2021-08-17 18:11:29 +05:30
Ankush Menat
333d962ac2 test: fix tests failing due to doc amend feature (bp #26656) (#26907)
* test: fix test due to rename change

* test: fix attendance request tests

- Use `frappe.db.get_value` instead of `get_doc` for asserting values
- Get values after cancellation as reloading attendance doc breaks due to stale doc (primary key changed after cancel of attendance request)
- rollback everything on tearDown

* test: fix Shift Request test

- Use `get_value` instead of `get_doc`
- Remove unnecessary loop, only one shift assignment is made against a shift request
- Get value after cancel again. Get doc is not reliable since primary key changed after cancel

* test: fix POS Closing Entry Test

- Separated into two tests, one checks if SI cancelling is blocked, the other checks PCE cancel impact
- This is done because after cancel via assertRaises, damage done by cancel still exists or is partially comitted
- Dont use this partially cancelled doc for any assertions further, end test at exception assertion
- Use `get_value` to check SI docstatus, as its primary key changes after cancel

* test: fixed asset movement tests

- set cwip account in company to avoid value missing
- removed unused statement
- removed trailing spaces

* Revert "test: fix POS Closing Entry Test"

This reverts commit 8f1a3aef2e.

Co-authored-by: marination <maricadsouza221197@gmail.com>
2021-08-17 18:01:39 +05:30
Deepesh Garg
2730f51ca9 test: Add test case for payment entry 2021-08-17 17:44:30 +05:30
Raffael Meyer
ace8cf965d fix: typo (#26967) 2021-08-17 16:13:28 +05:30
Deepesh Garg
e7143d8711 fix: Incorrect unallocated amount calculation in payment entry 2021-08-17 13:36:17 +05:30
Deepesh Garg
94f2c41475 fix: Incorrect unallocated amount calculation in payment entry 2021-08-17 13:31:17 +05:30
Sagar Vora
48a11591cc Merge pull request #26976 from resilient-tech/fix-incorrect-modified (#26979)
fix: Incorrect `modified` time in documents that inherit from `StatusUpdater`
(cherry picked from commit d932cba38a)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
2021-08-17 13:21:00 +05:30
Sagar Vora
6e921b1ccc Merge pull request #26976 from resilient-tech/fix-incorrect-modified
fix: Incorrect `modified` time in documents that inherit from `StatusUpdater`
(cherry picked from commit d932cba38a)
2021-08-17 07:48:29 +00:00
Frappe PR Bot
133486a5c7 Merge pull request #26906 from ChillarAnand/label (#26972)
fix: Changed label to "Inpatient Visit Charge" in appointment type
(cherry picked from commit 8c851b7019)

Co-authored-by: Chillar Anand <anand21nanda@gmail.com>
2021-08-17 11:12:33 +05:30
Deepesh Garg
94030e08f1 Merge pull request #26963 from deepeshgarg007/distributed_budget_variance_report_v13
fix: Budget variance missing values
2021-08-16 18:28:09 +05:30
Frappe PR Bot
663e550824 ci: ignore backports while checking docs (#26962) (#26965)
[skip ci]

(cherry picked from commit 2a43fe1a22)

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-16 18:20:07 +05:30
Deepesh Garg
d076ba5c94 fix: Budget variance missing values 2021-08-16 18:02:15 +05:30
Frappe PR Bot
3c9b8dce21 feat: Training Event Status Update and Validations (#26698) (#26961)
* fix: training event employee status not updated on feedback submission

* feat: update attendees status on training event status update

* test: Training Event and Feedback

* chore: remove unused import

(cherry picked from commit bf75ea70fb)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-08-16 17:57:14 +05:30
Frappe PR Bot
64dfbfaecb feat: enable track changes for leave type (#26917) (#26959)
Co-authored-by: Jannat Patel <31363128+pateljannat@users.noreply.github.com>
(cherry picked from commit a9a24051c9)

Co-authored-by: Anupam Kumar <anupamvns0099@gmail.com>
2021-08-16 15:17:28 +05:30
Deepesh Garg
1351d6e3be Merge pull request #26957 from deepeshgarg007/export_type_mandatory_v13
fix: Add mandatory depends on condition for export type field
2021-08-16 15:15:43 +05:30
Deepesh Garg
2aa0daf47b Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into export_type_mandatory_v13 2021-08-16 14:40:13 +05:30
Deepesh Garg
5fddd27cab fix: Add mandatory depends on condition for export type field 2021-08-16 14:34:40 +05:30
Frappe PR Bot
321dd33015 fix: Org Chart fixes (#26952) (#26953)
* fix: add z-index to filter to avoid svg wrapper overlapping

* fix: expand all nodes not working when there are only 2 levels

- added dom freeze while expanding all nodes and exporting

(cherry picked from commit 67e3971c3b)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
2021-08-16 10:44:35 +05:30
Deepesh Garg
560483eb98 Merge pull request #26946 from GangaManoj/property-enable-discount-accounting
fix: Make enable_discount _accounting a class property
2021-08-14 18:06:17 +05:30
Ankush Menat
6aed9e26ac fix: unknown attribute "string_type" (#26947) 2021-08-14 10:45:43 +05:30
GangaManoj
20a5795d67 fix: Make enable_discount_accounting a class property 2021-08-13 19:23:57 +05:30
Frappe PR Bot
434692ad34 fix: Copy previous balance dict object instead of assigning (#26942) (#26944)
- Due to plain assignment, dict mutation gave wrong monthly values

(cherry picked from commit fe2a34f171)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
2021-08-13 10:26:26 +00:00
Frappe PR Bot
7881536e09 ci: ignore js files in unittests (#26937)
* ci: ignore js files in unittests (#26934)

* ci: ignore js files in unittests

- Avoid running python unittests on PRs that ONLY change JS files.

* ci: ignore md files in test workflows

(cherry picked from commit 8a6b82b196)

# Conflicts:
#	.github/workflows/server-tests.yml

* fix: resolve conflicts

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
2021-08-13 07:59:48 +00:00
Frappe PR Bot
cb583a349f fix: show proper currency symbol in taxes and charges table (#26827) (#26935)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
(cherry picked from commit 587d2db6a9)

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-13 12:43:02 +05:30
Frappe PR Bot
a2a5800b23 fix: Deferred Revenue Section should be collapsible only if its not enabled (#26930)
* fix: Deferred Revenue Section should be collapsible only if its not enabled (#26928)

(cherry picked from commit 1de4c01942)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
#	erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json

* fix: conflicts

* fix: conflicts

* fix: conflicts

* fix: conflicts

* fix: conflicts

Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com>
2021-08-13 10:58:43 +05:30
Deepesh Garg
ffb174c489 fix: Grammatical error in comments 2021-08-13 10:55:13 +05:30
Suraj Shetty
adfa11d449 fix: Nest .level class style under .hierarchy class (#26905)
fix: Nest `.level` class style under `.hierarchy` class
2021-08-12 21:12:52 +05:30
Frappe PR Bot
9209c1f91a fix: from_warehouse getting set to None (#26920) (#26927)
(cherry picked from commit b8658d003f)

Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
2021-08-12 14:54:08 +00:00
Frappe PR Bot
262c1823a5 fix: ZeroDivisionError on creating e-invoice for credit note (#26919) 2021-08-12 17:11:55 +05:30
Marica
703b081172 fix: Stock Analytics Report must consider warehouse during calculation (#26908)
* fix: Stock Analytics Report must consider warehouse during calculation

* fix: Brand filter in Stock Analytics
2021-08-12 10:31:01 +05:30
Frappe PR Bot
f3ae956eae perf: various minor perf fixes for ledger postings (#26775) (#26896)
* perf: only validate if voucher is journal entry

* perf: optimize merge GLE

- Order fields such that comparison will fail faster
- Break out of loops if not matched

* perf: don't try to match SLE if count mismatch

* refactor: simplify initialize_previous_data

* perf: use cache for fetching valuation_method

These are set only once fields

* refactor: simplify get_future_stock_vouchers

* refactor: simplify get_voucherwise_gl_entries

* perf: fetch only required fields for GL comparison

`select *` fetches all fields, output of this function is only used for
comparing.

* perf: reorder conditions in PL cost center check

* perf: reduce query while validating new gle

* perf: use cache for validating warehouse props

These properties don't change often, no need to query everytime.

* perf: use cached stock settings to validate SLE

* docs: update misleading docstring

Co-authored-by: Marica <maricadsouza221197@gmail.com>
(cherry picked from commit 9152715f90)

Co-authored-by: Ankush <ankush@iwebnotes.com>
2021-08-11 12:18:58 +05:30
Deepesh Garg
6691d2ca54 fix: Do not update settings for test 2021-08-11 11:36:49 +05:30
Rucha Mahabal
fd325a123c fix(style): apply svg container margin only in desktop view (#26894) 2021-08-10 23:49:56 +05:30
Deepesh Garg
a16ab92e00 test: Add test case for payment entry unlink 2021-08-10 22:21:52 +05:30
Deepesh Garg
cf9734f98a test: Update exchange rate in test cases 2021-08-10 22:21:28 +05:30
Deepesh Garg
42b340cc66 fix: Only do specific validations on reference unlink 2021-08-10 14:52:24 +05:30
Deepesh Garg
c26f95e3b2 fix: Validation for receivingfrom customer against negative outstanding 2021-08-10 14:04:31 +05:30
Deepesh Garg
8da3a5cdd4 Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into payment_entry_validations_and_trigger 2021-08-09 17:38:03 +05:30
barredterra
c6c2773e02 refactor: def instead of lambda 2021-08-03 11:22:42 +02:00
barredterra
950521299a Merge branch 'version-13-hotfix' into datev_more_info 2021-08-03 10:47:57 +02:00
Anupam Kumar
c2b5b0edee fix: bank remittance report issue (#26398) 2021-08-02 10:51:21 +05:30
Deepesh Garg
75f23aed1c fix: Multiple fixes in payment entry 2021-08-01 17:48:50 +05:30
Deepesh Garg
c02e42ff84 fix: Multiple fixes in payment entry 2021-07-29 19:46:17 +05:30
barredterra
a21f76f2a1 feat: add voucher-specific data to datev export 2021-07-21 20:08:20 +02:00
Noah Jacob
449c58d809 refactor: suggested changes 2021-07-13 11:12:33 +05:30
Noah Jacob
a1a4e8d616 fix: Sider 2021-07-13 11:12:33 +05:30
Noah Jacob
e60a349432 test: updated test cases 2021-07-13 11:12:33 +05:30
Noah Jacob
872cd1cac8 test: test cases for fetching customer group details 2021-07-13 11:12:33 +05:30
Noah Jacob
d160e73c03 test: test case for fetching supplier group details 2021-07-13 11:12:33 +05:30
Noah Jacob
905aebc310 feat: details fetched from customer group in customer 2021-07-13 11:12:33 +05:30
Noah Jacob
47c2317b1a feat: details fetched from supplier group in supplier 2021-07-13 11:12:33 +05:30
1442 changed files with 8709 additions and 4623 deletions

View File

@@ -10,3 +10,6 @@
# This commit just changes spaces to tabs for indentation in some files
5f473611bd6ed57703716244a054d3fb5ba9cd23
# Whitespace trimming throughout codebase
9bb69e711a5da43aaf8c8ecb5601aeffd89dbe5a

View File

@@ -32,11 +32,15 @@ if __name__ == "__main__":
if response.ok:
payload = response.json()
title = payload.get("title", "").lower()
title = payload.get("title", "").lower().strip()
head_sha = payload.get("head", {}).get("sha")
body = payload.get("body", "").lower()
if title.startswith("feat") and head_sha and "no-docs" not in body:
if (title.startswith("feat")
and head_sha
and "no-docs" not in body
and "backport" not in body
):
if docs_link_exists(body):
print("Documentation Link Found. You're Awesome! 🎉")

View File

@@ -4,11 +4,7 @@ set -e
cd ~ || exit
sudo apt-get install redis-server
sudo apt install nodejs
sudo apt install npm
sudo apt-get install redis-server libcups2-dev
pip install frappe-bench
@@ -32,7 +28,6 @@ wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/w
tar -xf /tmp/wkhtmltox.tar.xz -C /tmp
sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
sudo chmod o+x /usr/local/bin/wkhtmltopdf
sudo apt-get install libcups2-dev
cd ~/frappe-bench || exit

View File

@@ -1,6 +1,12 @@
name: Patch
on: [pull_request, workflow_dispatch]
on:
pull_request:
paths-ignore:
- '**.js'
- '**.md'
workflow_dispatch:
jobs:
test:
@@ -26,6 +32,12 @@ jobs:
with:
python-version: 3.6
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 12
check-latest: true
- name: Add to Hosts
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts

View File

@@ -1,6 +1,16 @@
name: Server
on: [pull_request, workflow_dispatch]
on:
pull_request:
paths-ignore:
- '**.js'
- '**.md'
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.js'
- '**.md'
jobs:
test:
@@ -32,6 +42,12 @@ jobs:
with:
python-version: 3.7
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 12
check-latest: true
- name: Add to Hosts
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts

View File

@@ -2,6 +2,8 @@ name: UI
on:
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:

View File

@@ -6,4 +6,4 @@
"scss/at-rule-no-unknown": true,
"no-descending-specificity": null
}
}
}

View File

@@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides
from frappe.utils import getdate
__version__ = '13.9.0'
__version__ = '13.10.0'
def get_default_company(user=None):
'''Get default company for user'''

View File

@@ -19,4 +19,4 @@ frappe.dashboards.chart_sources["Account Balance Timeline"] = {
reqd: 1
},
]
};
};

View File

@@ -450,5 +450,3 @@ def get_deferred_booking_accounts(doctype, voucher_detail_no, dr_or_cr):
return debit_account
else:
return credit_account

View File

@@ -60,4 +60,4 @@ frappe.ui.form.on('Accounting Dimension Detail', {
let row = locals[cdt][cdn];
row.reference_document = frm.doc.document_type;
}
});
});

View File

@@ -113,5 +113,3 @@ def disable_dimension():
dimension2 = frappe.get_doc("Accounting Dimension", "Location")
dimension2.disabled = 1
dimension2.save()

View File

@@ -79,4 +79,4 @@ frappe.ui.form.on('Allowed Dimension', {
row.accounting_dimension = frm.doc.accounting_dimension;
frm.refresh_field("dimensions");
}
});
});

View File

@@ -56,4 +56,4 @@ class AccountingPeriod(Document):
self.append('closed_documents', {
"document_type": doctype_for_closing.document_type,
"closed": doctype_for_closing.closed
})
})

View File

@@ -48,4 +48,4 @@ frappe.tour['Accounts Settings'] = [
title: "Unlink Advance Payment on Cancellation of Order",
description: __("Similar to the previous option, this unlinks any advance payments made against Purchase/Sales Orders.")
}
];
];

View File

@@ -18,6 +18,7 @@
"delete_linked_ledger_entries",
"book_asset_depreciation_entry_automatically",
"unlink_advance_payment_on_cancelation_of_order",
"enable_common_party_accounting",
"post_change_gl_entries",
"enable_discount_accounting",
"tax_settings_section",
@@ -269,6 +270,12 @@
"fieldname": "enable_discount_accounting",
"fieldtype": "Check",
"label": "Enable Discount Accounting"
},
{
"default": "0",
"fieldname": "enable_common_party_accounting",
"fieldtype": "Check",
"label": "Enable Common Party Accounting"
}
],
"icon": "icon-cog",
@@ -276,7 +283,7 @@
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2021-07-12 18:54:29.084958",
"modified": "2021-08-19 11:17:38.788054",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",

View File

@@ -37,7 +37,7 @@ class AccountsSettings(Document):
def toggle_discount_accounting_fields(self):
enable_discount_accounting = cint(self.enable_discount_accounting)
for doctype in ["Sales Invoice Item", "Purchase Invoice Item"]:
make_property_setter(doctype, "discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
if enable_discount_accounting:
@@ -52,4 +52,4 @@ class AccountsSettings(Document):
else:
make_property_setter(doctype, "additional_discount_account", "mandatory_depends_on", "", "Code", validate_fields_for_doctype=False)
make_property_setter("Item", "default_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)
make_property_setter("Item", "default_discount_account", "hidden", not(enable_discount_accounting), "Check", validate_fields_for_doctype=False)

View File

@@ -5,4 +5,4 @@ frappe.ui.form.on('Accounts Settings', {
frm.set_df_property("frozen_accounts_modifier", "label", "Role Allowed to Close Books & Make Changes to Closed Periods");
frm.set_df_property("credit_controller", "label", "Credit Manager");
}
});
});

View File

@@ -120,4 +120,4 @@ erpnext.integrations.refreshPlaidLink = class refreshPlaidLink {
plaid_success(token, response) {
frappe.show_alert({ message: __('Plaid Link Updated'), indicator: 'green' });
}
};
};

View File

@@ -13,4 +13,4 @@ class Bank(Document):
load_address_and_contact(self)
def on_trash(self):
delete_contact_and_address('Bank', self.name)
delete_contact_and_address('Bank', self.name)

View File

@@ -26,4 +26,4 @@ def get_data():
'items': ['Journal Entry']
}
]
}
}

View File

@@ -8,7 +8,7 @@ frappe.ui.form.on("Bank Clearance", {
onload: function(frm) {
let default_bank_account = frappe.defaults.get_user_default("Company")?
let default_bank_account = frappe.defaults.get_user_default("Company")?
locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]: "";
frm.set_value("account", default_bank_account);

View File

@@ -6,4 +6,4 @@ import frappe
from frappe.model.document import Document
class BankClearanceDetail(Document):
pass
pass

View File

@@ -25,6 +25,6 @@ class BankGuarantee(Document):
def get_vouchar_detials(column_list, doctype, docname):
column_list = json.loads(column_list)
for col in column_list:
sanitize_searchfield(col)
sanitize_searchfield(col)
return frappe.db.sql(''' select {columns} from `tab{doctype}` where name=%s'''
.format(columns=", ".join(column_list), doctype=doctype), docname, as_dict=1)[0]

View File

@@ -21,6 +21,10 @@ class BankTransaction(StatusUpdater):
self.update_allocations()
self.clear_linked_payment_entries()
self.set_status(update=True)
def on_cancel(self):
self.clear_linked_payment_entries(for_cancel=True)
self.set_status(update=True)
def update_allocations(self):
if self.payment_entries:
@@ -41,21 +45,30 @@ class BankTransaction(StatusUpdater):
frappe.db.set_value(self.doctype, self.name, "status", "Reconciled")
self.reload()
def clear_linked_payment_entries(self):
def clear_linked_payment_entries(self, for_cancel=False):
for payment_entry in self.payment_entries:
if payment_entry.payment_document in ["Payment Entry", "Journal Entry", "Purchase Invoice", "Expense Claim"]:
self.clear_simple_entry(payment_entry)
self.clear_simple_entry(payment_entry, for_cancel=for_cancel)
elif payment_entry.payment_document == "Sales Invoice":
self.clear_sales_invoice(payment_entry)
self.clear_sales_invoice(payment_entry, for_cancel=for_cancel)
def clear_simple_entry(self, payment_entry):
frappe.db.set_value(payment_entry.payment_document, payment_entry.payment_entry, "clearance_date", self.date)
def clear_simple_entry(self, payment_entry, for_cancel=False):
clearance_date = self.date if not for_cancel else None
frappe.db.set_value(
payment_entry.payment_document, payment_entry.payment_entry,
"clearance_date", clearance_date)
def clear_sales_invoice(self, payment_entry):
frappe.db.set_value("Sales Invoice Payment", dict(parenttype=payment_entry.payment_document,
parent=payment_entry.payment_entry), "clearance_date", self.date)
def clear_sales_invoice(self, payment_entry, for_cancel=False):
clearance_date = self.date if not for_cancel else None
frappe.db.set_value(
"Sales Invoice Payment",
dict(
parenttype=payment_entry.payment_document,
parent=payment_entry.payment_entry
),
"clearance_date", clearance_date)
def get_total_allocated_amount(payment_entry):
return frappe.db.sql("""
@@ -105,4 +118,3 @@ def unclear_reference_payment(doctype, docname):
frappe.db.set_value(doc.payment_document, doc.payment_entry, "clearance_date", None)
return doc.payment_entry

View File

@@ -4,10 +4,12 @@
frappe.listview_settings['Bank Transaction'] = {
add_fields: ["unallocated_amount"],
get_indicator: function(doc) {
if(flt(doc.unallocated_amount)>0) {
return [__("Unreconciled"), "orange", "unallocated_amount,>,0"];
if(doc.docstatus == 2) {
return [__("Cancelled"), "red", "docstatus,=,2"];
} else if(flt(doc.unallocated_amount)<=0) {
return [__("Reconciled"), "green", "unallocated_amount,=,0"];
} else if(flt(doc.unallocated_amount)>0) {
return [__("Unreconciled"), "orange", "unallocated_amount,>,0"];
}
}
};
};

View File

@@ -77,4 +77,4 @@ def get_bank_mapping(bank_account):
mapping = {row.file_field:row.bank_transaction_field for row in bank.bank_transaction_mapping}
return mapping
return mapping

View File

@@ -25,7 +25,8 @@ class TestBankTransaction(unittest.TestCase):
def tearDownClass(cls):
for bt in frappe.get_all("Bank Transaction"):
doc = frappe.get_doc("Bank Transaction", bt.name)
doc.cancel()
if doc.docstatus == 1:
doc.cancel()
doc.delete()
# Delete directly in DB to avoid validation errors for countries not allowing deletion
@@ -57,6 +58,12 @@ class TestBankTransaction(unittest.TestCase):
clearance_date = frappe.db.get_value("Payment Entry", payment.name, "clearance_date")
self.assertTrue(clearance_date is not None)
bank_transaction.reload()
bank_transaction.cancel()
clearance_date = frappe.db.get_value("Payment Entry", payment.name, "clearance_date")
self.assertFalse(clearance_date)
# Check if ERPNext can correctly filter a linked payments based on the debit/credit amount
def test_debit_credit_output(self):
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07"))

View File

@@ -6,4 +6,4 @@ import frappe
from frappe.model.document import Document
class CFormInvoiceDetail(Document):
pass
pass

View File

@@ -18,5 +18,3 @@ class CashFlowMapping(Document):
frappe._('You can only select a maximum of one option from the list of check boxes.'),
title='Error'
)

View File

@@ -33,4 +33,4 @@ class CashierClosing(Document):
def validate_time(self):
if self.from_time >= self.time:
frappe.throw(_("From Time Should Be Less Than To Time"))
frappe.throw(_("From Time Should Be Less Than To Time"))

View File

@@ -10,10 +10,10 @@ frappe.ui.form.on('Cheque Print Template', {
function() {
erpnext.cheque_print.view_cheque_print(frm);
}).addClass("btn-primary");
$(frm.fields_dict.cheque_print_preview.wrapper).empty()
var template = '<div style="position: relative; overflow-x: scroll;">\
<div id="cheque_preview" style="width: {{ cheque_width }}cm; \
height: {{ cheque_height }}cm;\
@@ -47,9 +47,9 @@ frappe.ui.form.on('Cheque Print Template', {
position: absolute;"> Signatory Name </span>\
</div>\
</div>';
$(frappe.render(template, frm.doc)).appendTo(frm.fields_dict.cheque_print_preview.wrapper)
if (frm.doc.scanned_cheque) {
$(frm.fields_dict.cheque_print_preview.wrapper).find("#cheque_preview").css('background-image', 'url(' + frm.doc.scanned_cheque + ')');
}

View File

@@ -129,4 +129,4 @@ def get_name_with_number(new_account, account_number):
def check_if_distributed_cost_center_enabled(cost_center_list):
value_list = frappe.get_list("Cost Center", {"name": ["in", cost_center_list]}, "enable_distributed_cost_center", as_list=1)
return next((True for x in value_list if x[0]), False)
return next((True for x in value_list if x[0]), False)

View File

@@ -12,4 +12,4 @@ def get_data():
'items': ['Budget Variance Report', 'General Ledger']
}
]
}
}

View File

@@ -51,4 +51,4 @@ frappe.treeview_settings["Cost Center"] = {
}
}
}

View File

@@ -62,6 +62,3 @@ def create_cost_center(**args):
cc.is_group = args.is_group or 0
cc.parent_cost_center = args.parent_cost_center or "_Test Company - _TC"
cc.insert()

View File

@@ -17,7 +17,7 @@ class CouponCode(Document):
self.coupon_code =''.join(i for i in self.coupon_name if not i.isdigit())[0:8].upper()
elif self.coupon_type == "Gift Card":
self.coupon_code = frappe.generate_hash()[:10].upper()
def validate(self):
if self.coupon_type == "Gift Card":
self.maximum_use = 1

View File

@@ -124,6 +124,3 @@ class TestCouponCode(unittest.TestCase):
so.submit()
self.assertEqual(frappe.db.get_value("Coupon Code", "SAVE30", "used"), 1)

View File

@@ -7,4 +7,4 @@ from __future__ import unicode_literals
from frappe.model.document import Document
class DiscountedInvoice(Document):
pass
pass

View File

@@ -14,4 +14,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}

View File

@@ -144,4 +144,4 @@ def create_dunning_type_with_zero_interest_rate():
'closing_text': 'We kindly request that you pay the outstanding amount immediately, and late fees.'
}
)
dunning_type.save()
dunning_type.save()

View File

@@ -31,7 +31,7 @@ frappe.ui.form.on('Exchange Rate Revaluation', {
}, __('Create'));
}
}
});
});
}
},
@@ -128,4 +128,4 @@ var get_account_details = function(frm, cdt, cdn) {
frm.events.get_total_gain_loss(frm);
}
});
};
};

View File

@@ -44,7 +44,7 @@ class ExchangeRateRevaluation(Document):
if total_amt != total_debit:
return True
return False
@frappe.whitelist()
@@ -205,4 +205,4 @@ def get_account_details(account, company, posting_date, party_type=None, party=N
"new_balance_in_base_currency": new_balance_in_base_currency
}
return account_details
return account_details

View File

@@ -9,19 +9,8 @@ import frappe
import unittest
class TestFinanceBook(unittest.TestCase):
def create_finance_book(self):
if not frappe.db.exists("Finance Book", "_Test Finance Book"):
finance_book = frappe.get_doc({
"doctype": "Finance Book",
"finance_book_name": "_Test Finance Book"
}).insert()
else:
finance_book = frappe.get_doc("Finance Book", "_Test Finance Book")
return finance_book
def test_finance_book(self):
finance_book = self.create_finance_book()
finance_book = create_finance_book()
# create jv entry
jv = make_journal_entry("_Test Bank - _TC",
@@ -41,3 +30,14 @@ class TestFinanceBook(unittest.TestCase):
for gl_entry in gl_entries:
self.assertEqual(gl_entry.finance_book, finance_book.name)
def create_finance_book():
if not frappe.db.exists("Finance Book", "_Test Finance Book"):
finance_book = frappe.get_doc({
"doctype": "Finance Book",
"finance_book_name": "_Test Finance Book"
}).insert()
else:
finance_book = frappe.get_doc("Finance Book", "_Test Finance Book")
return finance_book

View File

@@ -58,8 +58,8 @@ class GLEntry(Document):
if not self.get(k):
frappe.throw(_("{0} is required").format(_(self.meta.get_label(k))))
account_type = frappe.get_cached_value("Account", self.account, "account_type")
if not (self.party_type and self.party):
account_type = frappe.get_cached_value("Account", self.account, "account_type")
if account_type == "Receivable":
frappe.throw(_("{0} {1}: Customer is required against Receivable account {2}")
.format(self.voucher_type, self.voucher_no, self.account))
@@ -73,15 +73,19 @@ class GLEntry(Document):
.format(self.voucher_type, self.voucher_no, self.account))
def pl_must_have_cost_center(self):
if frappe.get_cached_value("Account", self.account, "report_type") == "Profit and Loss":
if not self.cost_center and self.voucher_type != 'Period Closing Voucher':
msg = _("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}.").format(
self.voucher_type, self.voucher_no, self.account)
msg += " "
msg += _("Please set the cost center field in {0} or setup a default Cost Center for the Company.").format(
self.voucher_type)
"""Validate that profit and loss type account GL entries have a cost center."""
frappe.throw(msg, title=_("Missing Cost Center"))
if self.cost_center or self.voucher_type == 'Period Closing Voucher':
return
if frappe.get_cached_value("Account", self.account, "report_type") == "Profit and Loss":
msg = _("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}.").format(
self.voucher_type, self.voucher_no, self.account)
msg += " "
msg += _("Please set the cost center field in {0} or setup a default Cost Center for the Company.").format(
self.voucher_type)
frappe.throw(msg, title=_("Missing Cost Center"))
def validate_dimensions_for_pl_and_bs(self):
account_type = frappe.db.get_value("Account", self.account, "report_type")

View File

@@ -17,4 +17,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}

View File

@@ -18,4 +18,4 @@ frappe.listview_settings['Invoice Discounting'] = {
return [__("Canceled"), "red", "status,=,Canceled"];
}
}
};
};

View File

@@ -14,4 +14,4 @@ frappe.ui.form.on("Journal Entry", {
};
});
}
});
});

View File

@@ -100,7 +100,7 @@ class TestJournalEntry(unittest.TestCase):
"debit_in_account_currency": 0 if diff > 0 else abs(diff),
"credit_in_account_currency": diff if diff > 0 else 0
})
jv.append("accounts", {
"account": "Stock Adjustment - TCP1",
"cost_center": "Main - TCP1",

View File

@@ -88,4 +88,4 @@ frappe.ui.form.on("Journal Entry Template", {
frappe.model.clear_table(frm.doc, "accounts");
frm.refresh_field("accounts");
}
});
});

View File

@@ -14,4 +14,4 @@ frappe.ui.form.on('Mode of Payment', {
};
});
},
});
});

View File

@@ -39,4 +39,3 @@ class ModeofPayment(Document):
message = "POS Profile " + frappe.bold(", ".join(pos_profiles)) + " contains \
Mode of Payment " + frappe.bold(str(self.name)) + ". Please remove them to disable this mode."
frappe.throw(_(message), title="Not Allowed")

View File

@@ -55,4 +55,4 @@ def get_percentage(doc, start_date, period):
if d.month in months:
percentage += d.percentage_allocation
return percentage
return percentage

View File

@@ -20,4 +20,4 @@ def get_data():
'items': ['Budget']
}
]
}
}

View File

@@ -154,4 +154,4 @@ frappe.ui.form.on('Opening Invoice Creation Tool Item', {
invoices_add: (frm) => {
frm.trigger('update_invoice_table');
}
});
});

View File

@@ -240,5 +240,3 @@ def get_temporary_opening_account(company=None):
frappe.throw(_("Please add a Temporary Opening account in Chart of Accounts"))
return accounts[0].name

View File

@@ -0,0 +1,33 @@
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Party Link', {
refresh: function(frm) {
frm.set_query('primary_role', () => {
return {
filters: {
name: ['in', ['Customer', 'Supplier']]
}
};
});
frm.set_query('secondary_role', () => {
let party_types = Object.keys(frappe.boot.party_account_types)
.filter(p => p != frm.doc.primary_role);
return {
filters: {
name: ['in', party_types]
}
};
});
},
primary_role(frm) {
frm.set_value('primary_party', '');
frm.set_value('secondary_role', '');
},
secondary_role(frm) {
frm.set_value('secondary_party', '');
}
});

View File

@@ -0,0 +1,102 @@
{
"actions": [],
"autoname": "ACC-PT-LNK-.###.",
"creation": "2021-08-18 21:06:53.027695",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"primary_role",
"secondary_role",
"column_break_2",
"primary_party",
"secondary_party"
],
"fields": [
{
"fieldname": "primary_role",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Primary Role",
"options": "DocType",
"reqd": 1
},
{
"fieldname": "column_break_2",
"fieldtype": "Column Break"
},
{
"depends_on": "primary_role",
"fieldname": "secondary_role",
"fieldtype": "Link",
"label": "Secondary Role",
"mandatory_depends_on": "primary_role",
"options": "DocType"
},
{
"depends_on": "primary_role",
"fieldname": "primary_party",
"fieldtype": "Dynamic Link",
"label": "Primary Party",
"mandatory_depends_on": "primary_role",
"options": "primary_role"
},
{
"depends_on": "secondary_role",
"fieldname": "secondary_party",
"fieldtype": "Dynamic Link",
"label": "Secondary Party",
"mandatory_depends_on": "secondary_role",
"options": "secondary_role"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-08-25 20:08:56.761150",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Party Link",
"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": "Accounts Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Accounts User",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "primary_party",
"track_changes": 1
}

View File

@@ -0,0 +1,26 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
class PartyLink(Document):
def validate(self):
if self.primary_role not in ['Customer', 'Supplier']:
frappe.throw(_("Allowed primary roles are 'Customer' and 'Supplier'. Please select one of these roles only."),
title=_("Invalid Primary Role"))
existing_party_link = frappe.get_all('Party Link', {
'primary_party': self.secondary_party
}, pluck="primary_role")
if existing_party_link:
frappe.throw(_('{} {} is already linked with another {}')
.format(self.secondary_role, self.secondary_party, existing_party_link[0]))
existing_party_link = frappe.get_all('Party Link', {
'secondary_party': self.primary_party
}, pluck="primary_role")
if existing_party_link:
frappe.throw(_('{} {} is already linked with another {}')
.format(self.primary_role, self.primary_party, existing_party_link[0]))

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
# import frappe
import unittest
class TestPartyLink(unittest.TestCase):
pass

View File

@@ -533,8 +533,8 @@ frappe.ui.form.on('Payment Entry', {
source_exchange_rate: function(frm) {
if (frm.doc.paid_amount) {
frm.set_value("base_paid_amount", flt(frm.doc.paid_amount) * flt(frm.doc.source_exchange_rate));
if(!frm.set_paid_amount_based_on_received_amount &&
(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency)) {
// target exchange rate should always be same as source if both account currencies are same
if(frm.doc.paid_from_account_currency == frm.doc.paid_to_account_currency) {
frm.set_value("target_exchange_rate", frm.doc.source_exchange_rate);
frm.set_value("base_received_amount", frm.doc.base_paid_amount);
}
@@ -872,7 +872,7 @@ frappe.ui.form.on('Payment Entry', {
&& frm.doc.base_total_allocated_amount < frm.doc.base_received_amount + total_deductions
&& frm.doc.total_allocated_amount < frm.doc.paid_amount + (total_deductions / frm.doc.source_exchange_rate)) {
unallocated_amount = (frm.doc.base_received_amount + total_deductions + frm.doc.base_total_taxes_and_charges
+ frm.doc.base_total_allocated_amount) / frm.doc.source_exchange_rate;
- frm.doc.base_total_allocated_amount) / frm.doc.source_exchange_rate;
} else if (frm.doc.payment_type == "Pay"
&& frm.doc.base_total_allocated_amount < frm.doc.base_paid_amount - total_deductions
&& frm.doc.total_allocated_amount < frm.doc.received_amount + (total_deductions / frm.doc.target_exchange_rate)) {

View File

@@ -55,14 +55,17 @@ class PaymentEntry(AccountsController):
self.validate_mandatory()
self.validate_reference_documents()
self.set_tax_withholding()
self.apply_taxes()
self.set_amounts()
self.validate_amounts()
self.apply_taxes()
self.set_amounts_after_tax()
self.clear_unallocated_reference_document_rows()
self.validate_payment_against_negative_invoice()
self.validate_transaction_reference()
self.set_title()
self.set_remarks()
self.validate_duplicate_entry()
self.validate_payment_type_with_outstanding()
self.validate_allocated_amount()
self.validate_paid_invoices()
self.ensure_supplier_is_not_blocked()
@@ -118,6 +121,11 @@ class PaymentEntry(AccountsController):
if not self.get(field):
self.set(field, bank_data.account)
def validate_payment_type_with_outstanding(self):
total_outstanding = sum(d.allocated_amount for d in self.get('references'))
if total_outstanding < 0 and self.party_type == 'Customer' and self.payment_type == 'Receive':
frappe.throw(_("Cannot receive from customer against negative outstanding"), title=_("Incorrect Payment Type"))
def validate_allocated_amount(self):
for d in self.get("references"):
if (flt(d.allocated_amount))> 0:
@@ -185,7 +193,7 @@ class PaymentEntry(AccountsController):
for field, value in iteritems(ref_details):
if d.exchange_gain_loss:
# for cases where gain/loss is booked into invoice
# exchange_gain_loss is calculated from invoice & populated
# exchange_gain_loss is calculated from invoice & populated
# and row.exchange_rate is already set to payment entry's exchange rate
# refer -> `update_reference_in_payment_entry()` in utils.py
continue
@@ -236,7 +244,9 @@ class PaymentEntry(AccountsController):
self.company_currency, self.posting_date)
def set_target_exchange_rate(self, ref_doc=None):
if self.paid_to and not self.target_exchange_rate:
if self.paid_from_account_currency == self.paid_to_account_currency:
self.target_exchange_rate = self.source_exchange_rate
elif self.paid_to and not self.target_exchange_rate:
if ref_doc:
if self.paid_to_account_currency == ref_doc.currency:
self.target_exchange_rate = ref_doc.get("exchange_rate")
@@ -417,7 +427,7 @@ class PaymentEntry(AccountsController):
net_total_for_tds = 0
if reference.reference_doctype == 'Purchase Order':
net_total_for_tds += flt(frappe.db.get_value('Purchase Order', reference.reference_name, 'net_total'))
if net_total_for_tds:
net_total = net_total_for_tds
@@ -468,13 +478,22 @@ class PaymentEntry(AccountsController):
def set_amounts(self):
self.set_received_amount()
self.set_amounts_in_company_currency()
self.set_amounts_after_tax()
self.set_total_allocated_amount()
self.set_unallocated_amount()
self.set_difference_amount()
def validate_amounts(self):
self.validate_received_amount()
def validate_received_amount(self):
if self.paid_from_account_currency == self.paid_to_account_currency:
if self.paid_amount != self.received_amount:
frappe.throw(_("Received Amount should be same as Paid Amount"))
def set_received_amount(self):
self.base_received_amount = self.base_paid_amount
if self.paid_from_account_currency == self.paid_to_account_currency:
self.received_amount = self.paid_amount
def set_amounts_after_tax(self):
applicable_tax = 0
@@ -529,7 +548,7 @@ class PaymentEntry(AccountsController):
if self.payment_type == "Receive" \
and self.base_total_allocated_amount < self.base_received_amount + total_deductions \
and self.total_allocated_amount < self.paid_amount + (total_deductions / self.source_exchange_rate):
self.unallocated_amount = (self.received_amount + total_deductions -
self.unallocated_amount = (self.base_received_amount + total_deductions -
self.base_total_allocated_amount) / self.source_exchange_rate
self.unallocated_amount -= included_taxes
elif self.payment_type == "Pay" \
@@ -841,7 +860,7 @@ class PaymentEntry(AccountsController):
if account_details:
row.update(account_details)
if not row.get('amount'):
# if no difference amount
return

View File

@@ -11,4 +11,4 @@ frappe.listview_settings['Payment Entry'] = {
};
}
}
};
};

View File

@@ -107,7 +107,7 @@ class TestPaymentEntry(unittest.TestCase):
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank USD - _TC")
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
pe.target_exchange_rate = 50
pe.source_exchange_rate = 50
pe.insert()
pe.submit()
@@ -154,7 +154,7 @@ class TestPaymentEntry(unittest.TestCase):
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank USD - _TC")
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
pe.target_exchange_rate = 50
pe.source_exchange_rate = 50
pe.insert()
pe.submit()
@@ -295,6 +295,34 @@ class TestPaymentEntry(unittest.TestCase):
outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount"))
self.assertEqual(outstanding_amount, 80)
def test_payment_entry_against_si_usd_to_usd_with_deduction_in_base_currency (self):
si = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC",
currency="USD", conversion_rate=50, do_not_save=1)
si.plc_conversion_rate = 50
si.save()
si.submit()
pe = get_payment_entry("Sales Invoice", si.name, party_amount=20,
bank_account="_Test Bank USD - _TC", bank_amount=900)
pe.source_exchange_rate = 45.263
pe.target_exchange_rate = 45.263
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
pe.append("deductions", {
"account": "_Test Exchange Gain/Loss - _TC",
"cost_center": "_Test Cost Center - _TC",
"amount": 94.80
})
pe.save()
self.assertEqual(flt(pe.difference_amount, 2), 0.0)
self.assertEqual(flt(pe.unallocated_amount, 2), 0.0)
def test_payment_entry_retrieves_last_exchange_rate(self):
from erpnext.setup.doctype.currency_exchange.test_currency_exchange import test_records, save_new_records
@@ -463,7 +491,7 @@ class TestPaymentEntry(unittest.TestCase):
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank USD - _TC")
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
pe.target_exchange_rate = 55
pe.source_exchange_rate = 55
pe.append("deductions", {
"account": "_Test Exchange Gain/Loss - _TC",

View File

@@ -57,4 +57,4 @@ QUnit.test("test payment entry", function(assert) {
() => frappe.timeout(3),
() => done()
]);
});
});

View File

@@ -25,4 +25,4 @@ QUnit.test("test payment entry", function(assert) {
() => frappe.timeout(0.3),
() => done()
]);
});
});

View File

@@ -64,4 +64,4 @@ QUnit.test("test payment entry", function(assert) {
},
() => done()
]);
});
});

View File

@@ -9,19 +9,19 @@ from frappe.model.document import Document
class PaymentGatewayAccount(Document):
def autoname(self):
self.name = self.payment_gateway + " - " + self.currency
def validate(self):
self.currency = frappe.db.get_value("Account", self.payment_account, "account_currency")
self.update_default_payment_gateway()
self.set_as_default_if_not_set()
def update_default_payment_gateway(self):
if self.is_default:
frappe.db.sql("""update `tabPayment Gateway Account` set is_default = 0
where is_default = 1 """)
def set_as_default_if_not_set(self):
if not frappe.db.get_value("Payment Gateway Account",
if not frappe.db.get_value("Payment Gateway Account",
{"is_default": 1, "name": ("!=", self.name)}, "name"):
self.is_default = 1

View File

@@ -136,4 +136,4 @@ frappe.ui.form.on('Payment Order', {
dialog.show();
},
});
});

View File

@@ -9,4 +9,4 @@ def get_data():
'items': ['Payment Entry', 'Journal Entry']
}
]
}
}

View File

@@ -46,4 +46,4 @@ def create_payment_order_against_payment_entry(ref_doc, order_type):
doc = make_payment_order(ref_doc.name, payment_order)
doc.save()
doc.submit()
return doc
return doc

View File

@@ -307,4 +307,4 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
]
})
jv.flags.ignore_mandatory = True
jv.submit()
jv.submit()

View File

@@ -541,4 +541,4 @@ def make_payment_order(source_name, target_doc=None):
}
}, target_doc, set_missing_values)
return doclist
return doclist

View File

@@ -138,4 +138,4 @@ class TestPaymentRequest(unittest.TestCase):
# Try to make Payment Request more than SO amount, should give validation
pr2.grand_total = 900
self.assertRaises(frappe.ValidationError, pr2.save)
self.assertRaises(frappe.ValidationError, pr2.save)

View File

@@ -19,4 +19,4 @@ frappe.ui.form.on('Payment Term', {
frm.set_df_property("discount", "description", description);
}
}
});
});

View File

@@ -3,6 +3,6 @@
frappe.ui.form.on('Payment Terms Template', {
setup: function(frm) {
}
});

View File

@@ -30,4 +30,4 @@ def get_data():
'items': ['Customer Group', 'Supplier Group']
}
]
}
}

View File

@@ -50,9 +50,13 @@ class PeriodClosingVoucher(AccountsController):
.format(pce[0][0], self.posting_date))
def make_gl_entries(self):
gl_entries = self.get_gl_entries()
if gl_entries:
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
def get_gl_entries(self):
gl_entries = []
net_pl_balance = 0
pl_accounts = self.get_pl_balances()
for acc in pl_accounts:
@@ -60,6 +64,7 @@ class PeriodClosingVoucher(AccountsController):
gl_entries.append(self.get_gl_dict({
"account": acc.account,
"cost_center": acc.cost_center,
"finance_book": acc.finance_book,
"account_currency": acc.account_currency,
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) < 0 else 0,
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) < 0 else 0,
@@ -67,35 +72,13 @@ class PeriodClosingVoucher(AccountsController):
"credit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0
}, item=acc))
net_pl_balance += flt(acc.bal_in_company_currency)
if gl_entries:
gle_for_net_pl_bal = self.get_pnl_gl_entry(pl_accounts)
gl_entries += gle_for_net_pl_bal
if net_pl_balance:
if self.cost_center_wise_pnl:
costcenter_wise_gl_entries = self.get_costcenter_wise_pnl_gl_entries(pl_accounts)
gl_entries += costcenter_wise_gl_entries
else:
gl_entry = self.get_pnl_gl_entry(net_pl_balance)
gl_entries.append(gl_entry)
from erpnext.accounts.general_ledger import make_gl_entries
make_gl_entries(gl_entries)
return gl_entries
def get_pnl_gl_entry(self, net_pl_balance):
cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entry = self.get_gl_dict({
"account": self.closing_account_head,
"debit_in_account_currency": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"debit": abs(net_pl_balance) if net_pl_balance > 0 else 0,
"credit_in_account_currency": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"credit": abs(net_pl_balance) if net_pl_balance < 0 else 0,
"cost_center": cost_center
})
self.update_default_dimensions(gl_entry)
return gl_entry
def get_costcenter_wise_pnl_gl_entries(self, pl_accounts):
def get_pnl_gl_entry(self, pl_accounts):
company_cost_center = frappe.db.get_value("Company", self.company, "cost_center")
gl_entries = []
@@ -104,6 +87,7 @@ class PeriodClosingVoucher(AccountsController):
gl_entry = self.get_gl_dict({
"account": self.closing_account_head,
"cost_center": acc.cost_center or company_cost_center,
"finance_book": acc.finance_book,
"account_currency": acc.account_currency,
"debit_in_account_currency": abs(flt(acc.bal_in_account_currency)) if flt(acc.bal_in_account_currency) > 0 else 0,
"debit": abs(flt(acc.bal_in_company_currency)) if flt(acc.bal_in_company_currency) > 0 else 0,
@@ -130,7 +114,7 @@ class PeriodClosingVoucher(AccountsController):
def get_pl_balances(self):
"""Get balance for dimension-wise pl accounts"""
dimension_fields = ['t1.cost_center']
dimension_fields = ['t1.cost_center', 't1.finance_book']
self.accounting_dimensions = get_accounting_dimensions()
for dimension in self.accounting_dimensions:

View File

@@ -8,6 +8,7 @@ import frappe
from frappe.utils import flt, today
from erpnext.accounts.utils import get_fiscal_year, now
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
from erpnext.accounts.doctype.finance_book.test_finance_book import create_finance_book
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
class TestPeriodClosingVoucher(unittest.TestCase):
@@ -118,6 +119,58 @@ class TestPeriodClosingVoucher(unittest.TestCase):
self.assertTrue(pcv_gle, expected_gle)
def test_period_closing_with_finance_book_entries(self):
frappe.db.sql("delete from `tabGL Entry` where company='Test PCV Company'")
company = create_company()
surplus_account = create_account()
cost_center = create_cost_center("Test Cost Center 1")
create_sales_invoice(
company=company,
income_account="Sales - TPC",
expense_account="Cost of Goods Sold - TPC",
cost_center=cost_center,
rate=400,
debit_to="Debtors - TPC"
)
jv = make_journal_entry(
account1="Cash - TPC",
account2="Sales - TPC",
amount=400,
cost_center=cost_center,
posting_date=now()
)
jv.company = company
jv.finance_book = create_finance_book().name
jv.save()
jv.submit()
pcv = frappe.get_doc({
"transaction_date": today(),
"posting_date": today(),
"fiscal_year": get_fiscal_year(today())[0],
"company": company,
"closing_account_head": surplus_account,
"remarks": "Test",
"doctype": "Period Closing Voucher"
})
pcv.insert()
pcv.submit()
expected_gle = (
(surplus_account, 0.0, 400.0, ''),
(surplus_account, 0.0, 400.0, jv.finance_book),
('Sales - TPC', 400.0, 0.0, ''),
('Sales - TPC', 400.0, 0.0, jv.finance_book)
)
pcv_gle = frappe.db.sql("""
select account, debit, credit, finance_book from `tabGL Entry` where voucher_no=%s
""", (pcv.name))
self.assertTrue(pcv_gle, expected_gle)
def make_period_closing_voucher(self):
pcv = frappe.get_doc({
"doctype": "Period Closing Voucher",
@@ -139,7 +192,7 @@ def create_company():
'company_name': "Test PCV Company",
'country': 'United States',
'default_currency': 'USD'
})
})
company.insert(ignore_if_duplicate = True)
return company.name

View File

@@ -20,9 +20,9 @@ frappe.ui.form.on('POS Closing Entry', {
frm.set_query("pos_opening_entry", function(doc) {
return { filters: { 'status': 'Open', 'docstatus': 1 } };
});
if (frm.doc.docstatus === 0 && !frm.doc.amended_from) frm.set_value("period_end_date", frappe.datetime.now_datetime());
frappe.realtime.on('closing_process_complete', async function(data) {
await frm.reload_doc();
if (frm.doc.status == 'Failed' && frm.doc.error_message && data.user == frappe.session.user) {
@@ -43,7 +43,7 @@ frappe.ui.form.on('POS Closing Entry', {
const issue = '<a id="jump_to_error" style="text-decoration: underline;">issue</a>';
frm.dashboard.set_headline(
__('POS Closing failed while running in a background process. You can resolve the {0} and retry the process again.', [issue]));
$('#jump_to_error').on('click', (e) => {
e.preventDefault();
frappe.utils.scroll_to(

View File

@@ -110,17 +110,13 @@ erpnext.selling.POSInvoiceController = erpnext.selling.SellingController.extend(
this.frm.refresh_field("base_paid_amount");
},
write_off_outstanding_amount_automatically: function() {
if(cint(this.frm.doc.write_off_outstanding_amount_automatically)) {
write_off_outstanding_amount_automatically() {
if (cint(this.frm.doc.write_off_outstanding_amount_automatically)) {
frappe.model.round_floats_in(this.frm.doc, ["grand_total", "paid_amount"]);
// this will make outstanding amount 0
this.frm.set_value("write_off_amount",
flt(this.frm.doc.grand_total - this.frm.doc.paid_amount - this.frm.doc.total_advance, precision("write_off_amount"))
);
this.frm.toggle_enable("write_off_amount", false);
} else {
this.frm.toggle_enable("write_off_amount", true);
}
this.calculate_outstanding_amount(false);
@@ -235,4 +231,4 @@ frappe.ui.form.on('POS Invoice', {
});
});
}
});
});

View File

@@ -99,6 +99,7 @@
"loyalty_redemption_account",
"loyalty_redemption_cost_center",
"section_break_49",
"coupon_code",
"apply_discount_on",
"base_discount_amount",
"column_break_51",
@@ -595,7 +596,8 @@
{
"fieldname": "scan_barcode",
"fieldtype": "Data",
"label": "Scan Barcode"
"label": "Scan Barcode",
"options": "Barcode"
},
{
"allow_bulk_edit": 1,
@@ -1182,7 +1184,8 @@
"label": "Write Off Amount",
"no_copy": 1,
"options": "currency",
"print_hide": 1
"print_hide": 1,
"read_only_depends_on": "eval: doc.write_off_outstanding_amount_automatically"
},
{
"fieldname": "base_write_off_amount",
@@ -1548,12 +1551,20 @@
"no_copy": 1,
"options": "Sales Invoice",
"read_only": 1
},
{
"depends_on": "coupon_code",
"fieldname": "coupon_code",
"fieldtype": "Link",
"label": "Coupon Code",
"options": "Coupon Code",
"print_hide": 1
}
],
"icon": "fa fa-file-text",
"is_submittable": 1,
"links": [],
"modified": "2021-07-29 13:37:20.636171",
"modified": "2021-08-24 18:19:20.728433",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Invoice",

View File

@@ -44,6 +44,9 @@ class POSInvoice(SalesInvoice):
self.validate_pos()
self.validate_payment_amount()
self.validate_loyalty_transaction()
if self.coupon_code:
from erpnext.accounts.doctype.pricing_rule.utils import validate_coupon_code
validate_coupon_code(self.coupon_code)
def on_submit(self):
# create the loyalty point ledger entry if the customer is enrolled in any loyalty program
@@ -58,6 +61,10 @@ class POSInvoice(SalesInvoice):
self.check_phone_payments()
self.set_status(update=True)
if self.coupon_code:
from erpnext.accounts.doctype.pricing_rule.utils import update_coupon_code_count
update_coupon_code_count(self.coupon_code,'used')
def before_cancel(self):
if self.consolidated_invoice and frappe.db.get_value('Sales Invoice', self.consolidated_invoice, 'docstatus') == 1:
pos_closing_entry = frappe.get_all(
@@ -84,6 +91,10 @@ class POSInvoice(SalesInvoice):
against_psi_doc.delete_loyalty_point_entry()
against_psi_doc.make_loyalty_point_entry()
if self.coupon_code:
from erpnext.accounts.doctype.pricing_rule.utils import update_coupon_code_count
update_coupon_code_count(self.coupon_code,'cancelled')
def check_phone_payments(self):
for pay in self.payments:
if pay.type == "Phone" and pay.amount >= 0:
@@ -127,7 +138,7 @@ class POSInvoice(SalesInvoice):
.format(item.idx, bold_delivered_serial_nos), title=_("Item Unavailable"))
def validate_stock_availablility(self):
if self.is_return:
if self.is_return or self.docstatus != 1:
return
allow_negative_stock = frappe.db.get_single_value('Stock Settings', 'allow_negative_stock')

View File

@@ -320,7 +320,8 @@ class TestPOSInvoice(unittest.TestCase):
pos2.get("items")[0].serial_no = serial_nos[0]
pos2.append("payments", {'mode_of_payment': 'Bank Draft', 'account': '_Test Bank - _TC', 'amount': 1000})
self.assertRaises(frappe.ValidationError, pos2.insert)
pos2.insert()
self.assertRaises(frappe.ValidationError, pos2.submit)
def test_delivered_serialized_item_transaction(self):
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item
@@ -348,7 +349,8 @@ class TestPOSInvoice(unittest.TestCase):
pos2.get("items")[0].serial_no = serial_nos[0]
pos2.append("payments", {'mode_of_payment': 'Bank Draft', 'account': '_Test Bank - _TC', 'amount': 1000})
self.assertRaises(frappe.ValidationError, pos2.insert)
pos2.insert()
self.assertRaises(frappe.ValidationError, pos2.submit)
def test_loyalty_points(self):
from erpnext.accounts.doctype.loyalty_program.test_loyalty_program import create_records

View File

@@ -5,10 +5,10 @@ frappe.ui.form.on('POS Invoice Merge Log', {
setup: function(frm) {
frm.set_query("pos_invoice", "pos_invoices", doc => {
return{
filters: {
filters: {
'docstatus': 1,
'customer': doc.customer,
'consolidated_invoice': ''
'customer': doc.customer,
'consolidated_invoice': ''
}
}
});

View File

@@ -354,4 +354,4 @@ def safe_load_json(message):
except Exception:
json_message = message
return json_message
return json_message

View File

@@ -147,4 +147,3 @@ class TestPOSInvoiceMergeLog(unittest.TestCase):
frappe.set_user("Administrator")
frappe.db.sql("delete from `tabPOS Profile`")
frappe.db.sql("delete from `tabPOS Invoice`")

View File

@@ -53,4 +53,4 @@ frappe.ui.form.on('POS Opening Entry', {
});
}
}
});
});

View File

@@ -38,4 +38,4 @@ class POSOpeningEntry(StatusUpdater):
frappe.throw(msg.format(", ".join(invalid_modes)), title=_("Missing Account"))
def on_submit(self):
self.set_status(update=True)
self.set_status(update=True)

View File

@@ -21,8 +21,8 @@ def create_opening_entry(pos_profile, user):
balance_details.append(frappe._dict({
'mode_of_payment': d.mode_of_payment
}))
entry.set("balance_details", balance_details)
entry.submit()
return entry.as_dict()
return entry.as_dict()

View File

@@ -8,4 +8,4 @@ from frappe.model.document import Document
class POSSettings(Document):
def validate(self):
pass
pass

View File

@@ -198,12 +198,19 @@ def apply_pricing_rule(args, doc=None):
set_serial_nos_based_on_fifo = frappe.db.get_single_value("Stock Settings",
"automatically_set_serial_nos_based_on_fifo")
item_code_list = tuple(item.get('item_code') for item in item_list)
query_items = frappe.get_all('Item', fields=['item_code','has_serial_no'], filters=[['item_code','in',item_code_list]],as_list=1)
serialized_items = dict()
for item_code, val in query_items:
serialized_items.setdefault(item_code, val)
for item in item_list:
args_copy = copy.deepcopy(args)
args_copy.update(item)
data = get_pricing_rule_for_item(args_copy, item.get('price_list_rate'), doc=doc)
out.append(data)
if not item.get("serial_no") and set_serial_nos_based_on_fifo and not args.get('is_return'):
if serialized_items.get(item.get('item_code')) and not item.get("serial_no") and set_serial_nos_based_on_fifo and not args.get('is_return'):
out[0].update(get_serial_no_for_item(args_copy))
return out

View File

@@ -605,4 +605,4 @@ def delete_existing_pricing_rules():
for doctype in ["Pricing Rule", "Pricing Rule Item Code",
"Pricing Rule Item Group", "Pricing Rule Brand"]:
frappe.db.sql("delete from `tab{0}`".format(doctype))
frappe.db.sql("delete from `tab{0}`".format(doctype))

View File

@@ -26,4 +26,3 @@ QUnit.test("test pricing rule", function(assert) {
() => done()
]);
});

View File

@@ -31,4 +31,4 @@ class ProcessDeferredAccounting(Document):
'against_voucher': self.name
})
make_reverse_gl_entries(gl_entries=gl_entries)
make_reverse_gl_entries(gl_entries=gl_entries)

View File

@@ -45,4 +45,4 @@ class TestProcessDeferredAccounting(unittest.TestCase):
["Sales - _TC", 0.0, 33.85, "2019-01-31"]
]
check_gl_entries(self, si.name, expected_gle, "2019-01-10")
check_gl_entries(self, si.name, expected_gle, "2019-01-10")

View File

@@ -106,4 +106,4 @@
{{ terms_and_conditions }}
</div>
{% endif %}
</div>
</div>

View File

@@ -284,4 +284,4 @@ def send_auto_email():
selected = frappe.get_list('Process Statement Of Accounts', filters={'to_date': format_date(today()), 'enable_auto_email': 1})
for entry in selected:
send_emails(entry.name, from_scheduler=True)
return True
return True

View File

@@ -48,4 +48,4 @@ frappe.ui.form.on('Promotional Scheme', {
frm.doc.apply_on === key ? 1 : 0);
}
}
});
});

Some files were not shown because too many files have changed in this diff Show More