mirror of
https://github.com/frappe/books.git
synced 2024-09-20 03:29:00 +00:00
fix: make Payment For not required, fix amount bug, ref mandatory only if not cash
This commit is contained in:
parent
c6c89c2e9f
commit
09d4b305eb
@ -81,7 +81,7 @@ export default {
|
|||||||
label: 'Ref. / Cheque No.',
|
label: 'Ref. / Cheque No.',
|
||||||
placeholder: 'Ref. / Cheque No.',
|
placeholder: 'Ref. / Cheque No.',
|
||||||
fieldtype: 'Data',
|
fieldtype: 'Data',
|
||||||
required: 1 // TODO: UNIQUE
|
required: (doc) => doc.paymentMethod !== 'Cash' // TODO: UNIQUE
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: 'referenceDate',
|
fieldname: 'referenceDate',
|
||||||
@ -94,9 +94,7 @@ export default {
|
|||||||
label: 'Clearance Date',
|
label: 'Clearance Date',
|
||||||
placeholder: 'Clearance Date',
|
placeholder: 'Clearance Date',
|
||||||
fieldtype: 'Date',
|
fieldtype: 'Date',
|
||||||
hidden: doc => {
|
hidden: (doc) => doc.paymentMethod === 'Cash'
|
||||||
return doc.paymentMethod === 'Cash' ? 1 : 0;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: 'amount',
|
fieldname: 'amount',
|
||||||
@ -105,6 +103,7 @@ export default {
|
|||||||
required: 1,
|
required: 1,
|
||||||
formula: doc => doc.getSum('for', 'amount'),
|
formula: doc => doc.getSum('for', 'amount'),
|
||||||
validate(value, doc) {
|
validate(value, doc) {
|
||||||
|
if(doc.for.length === 0) return;
|
||||||
const amount = doc.getSum('for', 'amount');
|
const amount = doc.getSum('for', 'amount');
|
||||||
|
|
||||||
if (value > amount) {
|
if (value > amount) {
|
||||||
@ -135,7 +134,7 @@ export default {
|
|||||||
label: 'Payment For',
|
label: 'Payment For',
|
||||||
fieldtype: 'Table',
|
fieldtype: 'Table',
|
||||||
childtype: 'PaymentFor',
|
childtype: 'PaymentFor',
|
||||||
required: 1
|
required: 0,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ function getInitializedPrintWindow() {
|
|||||||
const printWindow = new BrowserWindow({
|
const printWindow = new BrowserWindow({
|
||||||
width: 595,
|
width: 595,
|
||||||
height: 842,
|
height: 842,
|
||||||
show: true,
|
show: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
contextIsolation: false,
|
contextIsolation: false,
|
||||||
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
|
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
|
||||||
|
Loading…
Reference in New Issue
Block a user