$trans_no = $this->trans_no;
}
- $sup = $type == 21 || $type == 22;
+ $sup = $type == ST_SUPPCREDIT || $type == ST_SUPPAYMENT;
$this->allocs = array();
if ($trans_no) {
//
function write()
{
- $sup = $this->type == 21 || $this->type == 22;
+ $sup = $this->type == ST_SUPPCREDIT || $this->type == ST_SUPPAYMENT;
begin_transaction();
exchange_variation($this->type, $this->trans_no,
$alloc_item->type, $alloc_item->type_no, $this->date_,
$alloc_item->current_allocated,
- $sup ? payment_person_types::supplier()
- : payment_person_types::customer());
+ $sup ? PT_SUPPLIER
+ : PT_CUSTOMER);
//////////////////////////////////////////////////////////////
function show_allocatable($show_totals) {
- global $table_style;
+ global $table_style, $systypes_array;
$k = $counter = $total_allocated = 0;
if (count($_SESSION['alloc']->allocs))
{
- start_table($table_style);
+ start_table("$table_style width=60%");
$th = array(_("Transaction Type"), _("#"), _("Date"), _("Due Date"), _("Amount"),
_("Other Allocations"), _("This Allocation"), _("Left to Allocate"),'','');
table_header($th);
foreach ($_SESSION['alloc']->allocs as $alloc_item)
{
alt_table_row_color($k);
- label_cell(systypes::name($alloc_item->type));
+ label_cell($systypes_array[$alloc_item->type]);
label_cell(get_trans_view_str($alloc_item->type, $alloc_item->type_no));
label_cell($alloc_item->date_, "align=right");
label_cell($alloc_item->due_date, "align=right");
function check_allocations()
{
+ global $SysPrefs;
+
$total_allocated = 0;
for ($counter = 0; $counter < $_POST["TotalNumberOfAllocs"]; $counter++)
if ($_SESSION['alloc']->type == 21 || $_SESSION['alloc']->type == 22)
$amount = -$amount;
- if ($total_allocated - $amount > sys_prefs::allocation_settled_allowance())
+ if ($total_allocated - ($amount + input_num('discount')) > $SysPrefs->allocation_settled_allowance())
{
display_error(_("These allocations cannot be processed because the amount allocated is more than the total amount left to allocate."));
return false;