File tree Expand file tree Collapse file tree
india_compliance/public/js Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -268,20 +268,30 @@ Object.assign(india_compliance, {
268268 } ,
269269
270270 validate_gstin ( gstin , show_msg = true ) {
271+ const opts = { title : __ ( "Error" ) , indicator : "red" } ;
272+
271273 if ( ! gstin || gstin . length !== 15 ) {
272- if ( show_msg ) frappe . msgprint ( __ ( "GSTIN must be 15 characters long" ) ) ;
274+ if ( show_msg ) {
275+ frappe . msgprint ( {
276+ message : __ ( "GSTIN must be 15 characters long" ) ,
277+ ...opts ,
278+ } ) ;
279+ }
280+
273281 return ;
274282 }
275283
276284 gstin = gstin . trim ( ) . toUpperCase ( ) ;
277285
278286 if ( GSTIN_REGEX . test ( gstin ) && is_gstin_check_digit_valid ( gstin ) ) {
279287 return gstin ;
280- } else {
281- if ( show_msg ) frappe . msgprint ( __ ( "Invalid GSTIN" ) ) ;
288+ } else if ( show_msg ) {
289+ frappe . msgprint ( {
290+ message : __ ( "Invalid GSTIN" ) ,
291+ ...opts ,
292+ } ) ;
282293 }
283294 } ,
284-
285295 guess_gst_category ( gstin , country ) {
286296 if ( ! gstin ) {
287297 if ( country && country !== "India" ) return "Overseas" ;
You can’t perform that action at this time.
0 commit comments