mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
Merge pull request #44 from bigcapitalhq/BIG-238-validate-bill-due-date-should-be-equal-or-bigger-than-bill-date
Big 238 validate bill due date should be equal or bigger than bill date
This commit is contained in:
@@ -1,16 +1,19 @@
|
|||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
|
import moment from 'moment';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||||
import { isBlank } from 'utils';
|
import { isBlank } from 'utils';
|
||||||
|
|
||||||
const BillFormSchema = Yup.object().shape({
|
const BillFormSchema = Yup.object().shape({
|
||||||
vendor_id: Yup.number()
|
vendor_id: Yup.number().required().label(intl.get('vendor_name_')),
|
||||||
.required()
|
bill_date: Yup.date().required().label(intl.get('bill_date_')),
|
||||||
.label(intl.get('vendor_name_')),
|
|
||||||
bill_date: Yup.date()
|
|
||||||
.required()
|
|
||||||
.label(intl.get('bill_date_')),
|
|
||||||
due_date: Yup.date()
|
due_date: Yup.date()
|
||||||
|
.min(Yup.ref('bill_date'), ({ path, min }) =>
|
||||||
|
intl.get('bill.validation.due_date', {
|
||||||
|
path,
|
||||||
|
min: moment(min).format('YYYY/MM/DD'),
|
||||||
|
}),
|
||||||
|
)
|
||||||
.required()
|
.required()
|
||||||
.label(intl.get('due_date_')),
|
.label(intl.get('due_date_')),
|
||||||
bill_number: Yup.string()
|
bill_number: Yup.string()
|
||||||
|
|||||||
@@ -2,16 +2,19 @@ import * as Yup from 'yup';
|
|||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||||
import { isBlank } from 'utils';
|
import { isBlank } from 'utils';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
const Schema = Yup.object().shape({
|
const Schema = Yup.object().shape({
|
||||||
customer_id: Yup.number()
|
customer_id: Yup.number().label(intl.get('customer_name_')).required(),
|
||||||
.label(intl.get('customer_name_'))
|
estimate_date: Yup.date().required().label(intl.get('estimate_date_')),
|
||||||
.required(),
|
|
||||||
estimate_date: Yup.date()
|
|
||||||
.required()
|
|
||||||
.label(intl.get('estimate_date_')),
|
|
||||||
expiration_date: Yup.date()
|
expiration_date: Yup.date()
|
||||||
.required()
|
.required()
|
||||||
|
.min(Yup.ref('estimate_date'), ({ path, min }) =>
|
||||||
|
intl.get('estimate.validation.expiration_date', {
|
||||||
|
path,
|
||||||
|
min: moment(min).format('YYYY/MM/DD'),
|
||||||
|
}),
|
||||||
|
)
|
||||||
.label(intl.get('expiration_date_')),
|
.label(intl.get('expiration_date_')),
|
||||||
estimate_number: Yup.string()
|
estimate_number: Yup.string()
|
||||||
.max(DATATYPES_LENGTH.STRING)
|
.max(DATATYPES_LENGTH.STRING)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
|
import moment from 'moment';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||||
import { isBlank } from 'utils';
|
import { isBlank } from 'utils';
|
||||||
@@ -7,7 +8,15 @@ const getSchema = () =>
|
|||||||
Yup.object().shape({
|
Yup.object().shape({
|
||||||
customer_id: Yup.string().label(intl.get('customer_name_')).required(),
|
customer_id: Yup.string().label(intl.get('customer_name_')).required(),
|
||||||
invoice_date: Yup.date().required().label(intl.get('invoice_date_')),
|
invoice_date: Yup.date().required().label(intl.get('invoice_date_')),
|
||||||
due_date: Yup.date().required().label(intl.get('due_date_')),
|
due_date: Yup.date()
|
||||||
|
.min(Yup.ref('invoice_date'), ({ path, min }) =>
|
||||||
|
intl.get('invoice.validation.due_date', {
|
||||||
|
path,
|
||||||
|
min: moment(min).format('YYYY/MM/DD'),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.required()
|
||||||
|
.label(intl.get('due_date_')),
|
||||||
invoice_no: Yup.string()
|
invoice_no: Yup.string()
|
||||||
.max(DATATYPES_LENGTH.STRING)
|
.max(DATATYPES_LENGTH.STRING)
|
||||||
.label(intl.get('invoice_no_')),
|
.label(intl.get('invoice_no_')),
|
||||||
|
|||||||
@@ -1361,6 +1361,7 @@
|
|||||||
"item.field.sell_account.hint": "أدخل السعر الذي ستبيعه لهذا العنصر.",
|
"item.field.sell_account.hint": "أدخل السعر الذي ستبيعه لهذا العنصر.",
|
||||||
"item_entries.products_services.hint": "أدخل المنتجات أو الخدمات التي تبيعها أو تشتريها لتتبع ما قمت ببيعه أو شرائه.",
|
"item_entries.products_services.hint": "أدخل المنتجات أو الخدمات التي تبيعها أو تشتريها لتتبع ما قمت ببيعه أو شرائه.",
|
||||||
"item_entries.landed.hint": "يتيح لك هذه الخيار إمكانية إضافة تكلفة اضافية علي فاتورة الشراء متال علي ذلك تكاليف الشحن ، ثم تحديد هذه التكلفة لتحميلها علي فاتورة الشراء.",
|
"item_entries.landed.hint": "يتيح لك هذه الخيار إمكانية إضافة تكلفة اضافية علي فاتورة الشراء متال علي ذلك تكاليف الشحن ، ثم تحديد هذه التكلفة لتحميلها علي فاتورة الشراء.",
|
||||||
|
"item_entries.remove_row": "حذف الصف",
|
||||||
"invoice.auto_increment.auto": "يتم تعيين أرقام الفواتير على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟",
|
"invoice.auto_increment.auto": "يتم تعيين أرقام الفواتير على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟",
|
||||||
"invoice.auto_increment.manually": "يتم تعيين أرقام فواتيرك يدوياً. هل أنت متأكد من تغيير هذه الإعدادات؟",
|
"invoice.auto_increment.manually": "يتم تعيين أرقام فواتيرك يدوياً. هل أنت متأكد من تغيير هذه الإعدادات؟",
|
||||||
"manual_journals.auto_increment.auto": "يتم تعيين أرقام القيود على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟",
|
"manual_journals.auto_increment.auto": "يتم تعيين أرقام القيود على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟",
|
||||||
@@ -1847,6 +1848,7 @@
|
|||||||
"warehouse_transfer.column.transfer_quantity": "الكمية ",
|
"warehouse_transfer.column.transfer_quantity": "الكمية ",
|
||||||
"warehouse_transfer.column.source_warehouse": "المصدر",
|
"warehouse_transfer.column.source_warehouse": "المصدر",
|
||||||
"warehouse_transfer.column.destination_warehouse": "الوجهة",
|
"warehouse_transfer.column.destination_warehouse": "الوجهة",
|
||||||
|
"warehouse_transfer.column.cost_price": "سعر التكلفة",
|
||||||
"warehouse_transfer.auto_increment.auto": "يتم تعيين أرقام النقل على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟",
|
"warehouse_transfer.auto_increment.auto": "يتم تعيين أرقام النقل على وضع الزيادة التلقائي. هل أنت متأكد من تغيير هذا الإعداد؟",
|
||||||
"warehouse_transfer.auto_increment.manually": "يتم تعيين أرقام النقل يدوياً. هل أنت متأكد من تغيير هذه الإعدادات؟",
|
"warehouse_transfer.auto_increment.manually": "يتم تعيين أرقام النقل يدوياً. هل أنت متأكد من تغيير هذه الإعدادات؟",
|
||||||
"warehouse_transfer.setting_your_auto_generated_transfer_no": "تعيين رقم النقل الذي تم إنشاؤه تلقائيًا",
|
"warehouse_transfer.setting_your_auto_generated_transfer_no": "تعيين رقم النقل الذي تم إنشاؤه تلقائيًا",
|
||||||
@@ -2006,6 +2008,8 @@
|
|||||||
"warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المستودعات",
|
"warehouse_transfer.empty_status.title": "إدارة عمليات النقل بين المستودعات",
|
||||||
"warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.",
|
"warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.",
|
||||||
"item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ",
|
"item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ",
|
||||||
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة."
|
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.",
|
||||||
|
"invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}",
|
||||||
|
"estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}",
|
||||||
|
"bill.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}"
|
||||||
}
|
}
|
||||||
@@ -1338,6 +1338,7 @@
|
|||||||
"item.field.sell_account.hint": "Enter price which you goint to sell this item.",
|
"item.field.sell_account.hint": "Enter price which you goint to sell this item.",
|
||||||
"item_entries.products_services.hint": "Enter products or services you sell or buy to keep tracking what your sold or purchased.",
|
"item_entries.products_services.hint": "Enter products or services you sell or buy to keep tracking what your sold or purchased.",
|
||||||
"item_entries.landed.hint": "This options allows you to be able to add additional cost eg. freight then allocate cost to the items in your bills.",
|
"item_entries.landed.hint": "This options allows you to be able to add additional cost eg. freight then allocate cost to the items in your bills.",
|
||||||
|
"item_entries.remove_row": "Remove line",
|
||||||
"invoice.auto_increment.auto": "Your invoice numbers are set on auto-increment mode. Are you sure changing this setting?",
|
"invoice.auto_increment.auto": "Your invoice numbers are set on auto-increment mode. Are you sure changing this setting?",
|
||||||
"invoice.auto_increment.manually": "Your invoice numbers are set on manual mode. Are you sure chaning this settings?",
|
"invoice.auto_increment.manually": "Your invoice numbers are set on manual mode. Are you sure chaning this settings?",
|
||||||
"manual_journals.auto_increment.auto": "Your Jouranl numbers are set on auto-increment mode. Are you sure changing this setting?",
|
"manual_journals.auto_increment.auto": "Your Jouranl numbers are set on auto-increment mode. Are you sure changing this setting?",
|
||||||
@@ -2007,5 +2008,8 @@
|
|||||||
"warehouse_transfer.empty_status.description": "Business with multiply warehouses often transfers items from on warehouse to another when they are in immediate need of vendors.",
|
"warehouse_transfer.empty_status.description": "Business with multiply warehouses often transfers items from on warehouse to another when they are in immediate need of vendors.",
|
||||||
"warehouse_transfer.form.reason.label": "Reason",
|
"warehouse_transfer.form.reason.label": "Reason",
|
||||||
"warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.",
|
"warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.",
|
||||||
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty."
|
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.",
|
||||||
|
"invoice.validation.due_date": "{path} field must be later than {min}",
|
||||||
|
"estimate.validation.expiration_date": "{path} field must be later than {min}",
|
||||||
|
"bill.validation.due_date": "{path} field must be later than {min}"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user