$pay_service = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
- if ($from == null)
- $from = 0;
- if ($to == null)
- $to = 0;
+ if (!$from || !$to) return;
+
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
+ $from = min($fno[0], $tno[0]);
+ $to = max($fno[0], $tno[0]);
$cols = array(4, 60, 225, 300, 325, 385, 450, 515);
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
}
- for ($i = $fno[0]; $i <= $tno[0]; $i++)
+ for ($i = $from; $i <= $to; $i++)
{
if (!exists_customer_trans(ST_SALESINVOICE, $i))
continue;
$packing_slip = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
- if ($from == null)
- $from = 0;
- if ($to == null)
- $to = 0;
+ if (!$from || !$to) return;
+
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
+ $from = min($fno[0], $tno[0]);
+ $to = max($fno[0], $tno[0]);
$cols = array(4, 60, 225, 300, 325, 385, 450, 515);
$rep->Info($params, $cols, null, $aligns);
}
- for ($i = $fno[0]; $i <= $tno[0]; $i++)
+ for ($i = $from; $i <= $to; $i++)
{
if (!exists_customer_trans(ST_CUSTDELIVERY, $i))
continue;
$currency = $_POST['PARAM_2'];
$comments = $_POST['PARAM_3'];
- if ($from == null)
- $from = 0;
- if ($to == null)
- $to = 0;
+ if (!$from || !$to) return;
+
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
+ $from = min($fno[0], $tno[0]);
+ $to = max($fno[0], $tno[0]);
$cols = array(4, 85, 150, 225, 275, 360, 450, 515);
$rep->Font();
$rep->Info($params, $cols, null, $aligns);
- for ($i = $fno[0]; $i <= $tno[0]; $i++)
+ for ($i = $from; $i <= $to; $i++)
{
- if ($fno[0] == $tno[0])
- $types = array($fno[1]);
+ if ($from == $to)
+ $types = array($from);
else
$types = array(ST_BANKDEPOSIT, ST_CUSTPAYMENT);
foreach ($types as $j)
$paylink = $_POST['PARAM_4'];
$comments = $_POST['PARAM_5'];
- if ($from == null)
- $from = 0;
- if ($to == null)
- $to = 0;
+ if (!$from || !$to) return;
+
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
+ $from = min($fno[0], $fto[0]);
+ $to = max($fno[0], $fto[0]);
$cols = array(4, 60, 225, 300, 325, 385, 450, 515);
$rep->Info($params, $cols, null, $aligns);
}
- for ($i = $fno[0]; $i <= $tno[0]; $i++)
+ for ($i = $from; $i <= $to; $i++)
{
if (!exists_customer_trans(ST_CUSTCREDIT, $i))
continue;
$email = $_POST['PARAM_3'];
$comments = $_POST['PARAM_4'];
- if ($from == null)
- $from = 0;
- if ($to == null)
- $to = 0;
+ if (!$from || !$to) return;
+
$dec = user_price_dec();
$fno = explode("-", $from);
$tno = explode("-", $to);
+ $from = min($fno[0], $tno[0]);
+ $to = max($fno[0], $tno[0]);
$cols = array(4, 85, 150, 225, 275, 360, 450, 515);
$rep->Info($params, $cols, null, $aligns);
}
- for ($i = $fno[0]; $i <= $tno[0]; $i++)
+ for ($i = $from; $i <= $to; $i++)
{
if ($fno[0] == $tno[0])
$types = array($fno[1]);
$email = $_POST['PARAM_2'];
$comments = $_POST['PARAM_3'];
- if ($from == null)
- $from = 0;
- if ($to == null)
- $to = 0;
- $dec = user_price_dec();
+ if (!$from || !$to) return;
$fno = explode("-", $from);
$tno = explode("-", $to);
+ $from = min($fno[0], $tno[0]);
+ $to = max($fno[0], $tno[0]);
$cols = array(4, 60, 190, 255, 320, 385, 450, 515);
$rep->Info($params, $cols, null, $aligns);
}
- for ($i = $fno[0]; $i <= $tno[0]; $i++)
+ for ($i = $from; $i <= $to; $i++)
{
$myrow = get_work_order($i);
if ($myrow === false)