map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
# vendors
- if (@{ $form->{all_vendor} }) {
+ if (@{ $form->{all_vendor} || [] }) {
$form->{vendor} = qq|$form->{vendor}--$form->{vendor_id}|;
map { $form->{selectvendor} .= "<option>$_->{name}--$_->{id}\n" }
(@{ $form->{all_vendor} });
}
# departments
- if (@{ $form->{all_departments} }) {
+ if (@{ $form->{all_departments} || [] }) {
$form->{selectdepartment} = "<option>\n";
$form->{department} = "$form->{department}--$form->{department_id}";
map {
$form->{selectdepartment} .=
"<option>$_->{description}--$_->{id}\n"
- } (@{ $form->{all_departments} });
+ } (@{ $form->{all_departments} || [] });
}
$form->{employee} = "$form->{employee}--$form->{employee_id}";
my ($debitaccno, $debittaxkey) = split /--/, $form->{AP_amountselected};
my ($taxkey, $NULL) = split /--/, $form->{taxchartselected};
my ($payablesaccno, $payablestaxkey) = split /--/, $form->{APselected};
- $form->{AP}{amount_1} = $debitaccno;
- $form->{AP}{payables} = $payablesaccno;
+ $form->{AP_amount_1} = $debitaccno;
+ $form->{AP_payables} = $payablesaccno;
$form->{taxkey} = $taxkey;
$form->{storno} = 0;
$form->all_vc(\%myconfig, "vendor", "AP");
my $vendor;
- if (@{ $form->{all_vendor} }) {
+ if (@{ $form->{all_vendor} || [] }) {
map { $vendor .= "<option>$_->{name}--$_->{id}\n" }
@{ $form->{all_vendor} };
$vendor = qq|<select name=vendor><option>\n$vendor\n</select>|;
}
# departments
- if (@{ $form->{all_departments} }) {
+ if (@{ $form->{all_departments} || [] }) {
$form->{selectdepartment} = "<option>\n";
map {
$form->{selectdepartment} .=
"<option>$_->{description}--$_->{id}\n"
- } (@{ $form->{all_departments} });
+ } (@{ $form->{all_departments} || [] });
}
my $department = qq|