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 @@ -307,20 +307,30 @@ Object.assign(india_compliance, {
307307 } ,
308308
309309 validate_gstin ( gstin , show_msg = true ) {
310+ const opts = { title : __ ( "Error" ) , indicator : "red" } ;
311+
310312 if ( ! gstin || gstin . length !== 15 ) {
311- if ( show_msg ) frappe . msgprint ( __ ( "GSTIN must be 15 characters long" ) ) ;
313+ if ( show_msg ) {
314+ frappe . msgprint ( {
315+ message : __ ( "GSTIN must be 15 characters long" ) ,
316+ ...opts ,
317+ } ) ;
318+ }
319+
312320 return ;
313321 }
314322
315323 gstin = gstin . trim ( ) . toUpperCase ( ) ;
316324
317325 if ( GSTIN_REGEX . test ( gstin ) && is_gstin_check_digit_valid ( gstin ) ) {
318326 return gstin ;
319- } else {
320- if ( show_msg ) frappe . msgprint ( __ ( "Invalid GSTIN" ) ) ;
327+ } else if ( show_msg ) {
328+ frappe . msgprint ( {
329+ message : __ ( "Invalid GSTIN" ) ,
330+ ...opts ,
331+ } ) ;
321332 }
322333 } ,
323-
324334 guess_gst_category ( gstin , country ) {
325335 if ( ! gstin ) {
326336 if ( country && country !== "India" ) return "Overseas" ;
You can’t perform that action at this time.
0 commit comments