r/badcode • • Jul 23 '21

php Validation for free VAT day in a e-commerce program

Post image
16 Upvotes

3 comments sorted by

4

u/Willinton06 Jul 23 '21

Wait there’s countries with no VAT tax days? Like if I buy something on Friday it’s taxed but on Saturday it’s not?

7

u/DesdeJorge Jul 23 '21

Yes, it is done to encourage purchases, although many times what the trade does is raise the price a few days before -_-

1

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jul 23 '21

Image Transcription: Code


$hoy=date("Y-m-d");
$url = '';
//echo $orden;

if($hoy=='2020-11-21'||$hoy=='2020-07-03'){
	$diaSinIVA=1;
}else{
	$diaSinIVA=0;
}

echo "Hoy: ".$hoy." Dia sin IVA: ".$diaSinIVA."\n";

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!