Code Duplication    Length = 12-12 lines in 2 locations

app/cashflow.py 2 locations

@@ 180-191 (lines=12) @@
177
                                futuredate = futuredate.replace(day=futuredateday)
178
                    except ValueError:
179
                        pass
180
                if futuredate <= todaydate and datetime.today().weekday() < 5:
181
                    existing.startdate = futuredate + relativedelta(months=3)
182
                    daycheckdate = futuredate + relativedelta(months=3)
183
                    daycheck = daycheckdate.day
184
                    if firstdateday > daycheck:
185
                        try:
186
                            for m in range(3):
187
                                daycheck += 1
188
                                if firstdateday >= daycheck:
189
                                    existing.startdate = daycheckdate.replace(day=daycheck)
190
                        except ValueError:
191
                            pass
192
                # Create a new row
193
                new_row = {
194
                    'type': type,
@@ 106-117 (lines=12) @@
103
                                futuredate = futuredate.replace(day=futuredateday)
104
                    except ValueError:
105
                        pass
106
                if futuredate <= todaydate and datetime.today().weekday() < 5:
107
                    existing.startdate = futuredate + relativedelta(months=1)
108
                    daycheckdate = futuredate + relativedelta(months=1)
109
                    daycheck = daycheckdate.day
110
                    if firstdateday > daycheck:
111
                        try:
112
                            for m in range(3):
113
                                daycheck += 1
114
                                if firstdateday >= daycheck:
115
                                    existing.startdate = daycheckdate.replace(day=daycheck)
116
                        except ValueError:
117
                            pass
118
                if type == 'Income':
119
                    rollbackdate = datetime.combine(futuredate, datetime.min.time())
120
                    # Create a new row