File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -103,15 +103,18 @@ public static function booted()
103103 });
104104
105105 static ::updating (function (Invoice $ invoice ) {
106- if ($ invoice ->isDirty ([
107- 'serial_number ' ,
108- 'serial_number_format ' ,
109- 'serial_number_prefix ' ,
110- 'serial_number_serie ' ,
111- 'serial_number_year ' ,
112- 'serial_number_month ' ,
113- 'serial_number_count ' ,
114- ])) {
106+ if (
107+ $ invoice ->state !== InvoiceState::Draft &&
108+ $ invoice ->isDirty ([
109+ 'serial_number ' ,
110+ 'serial_number_format ' ,
111+ 'serial_number_prefix ' ,
112+ 'serial_number_serie ' ,
113+ 'serial_number_year ' ,
114+ 'serial_number_month ' ,
115+ 'serial_number_count ' ,
116+ ])
117+ ) {
115118 throw new Exception ("Serial number details can't be changed after creation " , 500 );
116119 }
117120
You can’t perform that action at this time.
0 commit comments